amd/pi/hudson: Add early SPI setup
commit91dea4a6482cf6ebe4d4bc434fbcd566cedb3941
authorMarshall Dawson <marshalldawson3rd@gmail.com>
Fri, 10 Feb 2017 23:03:54 +0000 (10 16:03 -0700)
committerMarc Jones <marc@marcjonesconsulting.com>
Tue, 7 Mar 2017 22:01:36 +0000 (7 23:01 +0100)
treed6e99903be2abc4b64b9fe7a45969fc51d7ebb63
parent7b0b9f0d418712613ce1eba4ad392c2def958285
amd/pi/hudson: Add early SPI setup

Add some generic functions that can configure the SPI interface to
have faster performance.

Given that the hudson files are used across many generations of FCHs,
make sure to refer to the appropriate BKDG or RRG before using the
functions.  Notable differences:
 * Hudson 1 defines read mode in CNTRL0 differently than later gens
 * Hudson 1 supports setting NormSpeed in Cntr1 but Hudson3 allows
   setting FastSpeed as well
 * Kabini, Mullins, Carrizo and Stoney Ridge contain a "new" SPI100
   controller

Original-Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Original-Reviewed-by: Marc Jones <marcj303@gmail.com>
(cherry picked from commit 1922d6f424dcf1f42e2f21fb7c6d53d7bcc247d0)

Change-Id: Id12440e67bc575dbe4b980ef1da931d7bfae188d
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: https://review.coreboot.org/18442
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
src/southbridge/amd/pi/hudson/early_setup.c
src/southbridge/amd/pi/hudson/hudson.h