summaryrefslogtreecommitdiff
path: root/src/southbridge/amd
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-11-14 20:56:43 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-11-20 19:02:12 +0100
commit84693d3dd40bdb291ec8dd92f99a4349da0db62b (patch)
tree1c7bce1b7ac1f6f8fa80a0bf32f9cdd360ca81c5 /src/southbridge/amd
parent3bff5d906423fa4ac3bc3877f0f82dfa8426e86f (diff)
AGESA: Refactor HUDSON_SATA_MODE
Expose one CONFIG_ variable instead of seven to C preprocessor. Change-Id: Ib815127561d320a5e8f8e6ef168933d81809521e Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/7494 Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/southbridge/amd')
-rw-r--r--src/southbridge/amd/agesa/hudson/Kconfig94
-rw-r--r--src/southbridge/amd/agesa/hudson/Makefile.inc2
-rw-r--r--src/southbridge/amd/agesa/hudson/hudson.h12
3 files changed, 50 insertions, 58 deletions
diff --git a/src/southbridge/amd/agesa/hudson/Kconfig b/src/southbridge/amd/agesa/hudson/Kconfig
index a2a43a428e..df7d76f5de 100644
--- a/src/southbridge/amd/agesa/hudson/Kconfig
+++ b/src/southbridge/amd/agesa/hudson/Kconfig
@@ -140,67 +140,49 @@ config AMD_PUBKEY_FILE
string "AMD public Key"
default "3rdparty/southbridge/amd/avalon/PSP/AmdPubKey.bin" if CPU_AMD_AGESA_00730F01
-choice
- prompt "SATA Mode"
- default HUDSON_SATA_IDE
+config HUDSON_SATA_MODE
+ int "SATA Mode"
+ default 0
+ range 0 6
help
Select the mode in which SATA should be driven. NATIVE AHCI, or RAID.
The default is NATIVE.
+ 0: NATIVE mode does not require a ROM.
+ 1: RAID mode must have the two ROM files.
+ 2: AHCI may work with or without AHCI ROM. It depends on the payload support.
+ For example, seabios does not require the AHCI ROM.
+ 3: LEGACY IDE
+ 4: IDE to AHCI
+ 5: AHCI7804: ROM Required, and AMD driver required in the OS.
+ 6: IDE to AHCI7804: ROM Required, and AMD driver required in the OS.
-config HUDSON_SATA_IDE
- bool "NATIVE"
- help
- NATIVE is the default mode and does not require a ROM.
+comment "NATIVE"
+ depends on HUDSON_SATA_MODE = 0
-config HUDSON_SATA_RAID
- bool "RAID"
- help
- HUDSON RAID mode must have the two required ROM files.
+comment "RAID"
+ depends on HUDSON_SATA_MODE = 1
-config HUDSON_SATA_AHCI
- bool "AHCI"
- help
- AHCI may work with or without AHCI ROM. It depends on the payload support.
- For example, seabios does not require the AHCI ROM.
+comment "AHCI"
+ depends on HUDSON_SATA_MODE = 2
-config HUDSON_SATA_LEGACY_IDE
- bool "LEGACY IDE"
- help
- TODO
+comment "LEGACY IDE"
+ depends on HUDSON_SATA_MODE = 3
-config HUDSON_SATA_IDE2AHCI
- bool "IDE to AHCI"
- help
- TODO
+comment "IDE to AHCI"
+ depends on HUDSON_SATA_MODE = 4
-config HUDSON_SATA_AHCI7804
- bool "AHCI7804"
- help
- AHCI ROM Required, and AMD driver required in the OS.
+comment "AHCI7804"
+ depends on HUDSON_SATA_MODE = 5
-config HUDSON_SATA_IDE2AHCI7804
- bool "IDE to AHCI7804"
- help
- AHCI ROM Required, and AMD driver required in the OS.
+comment "IDE to AHCI7804"
+ depends on HUDSON_SATA_MODE = 6
-endchoice
+if HUDSON_SATA_MODE = 2 || HUDSON_SATA_MODE = 5
-config HUDSON_SATA_MODE
- hex
- depends on (HUDSON_SATA_IDE || HUDSON_SATA_RAID || HUDSON_SATA_AHCI)
- default "0x0" if HUDSON_SATA_IDE
- default "0x1" if HUDSON_SATA_RAID
- default "0x2" if HUDSON_SATA_AHCI
- default "0x3" if HUDSON_SATA_LEGACY_IDE
- default "0x4" if HUDSON_SATA_IDE2AHCI
- default "0x5" if HUDSON_SATA_AHCI7804
- default "0x6" if HUDSON_SATA_IDE2AHCI7804
-
-if HUDSON_SATA_AHCI || HUDSON_SATA_AHCI7804
config AHCI_ROM_ID
- string "AHCI device PCI IDs"
- default "1022,7801" if HUDSON_SATA_AHCI
- default "1022,7804" if HUDSON_SATA_AHCI7804
+ string "AHCI device PCI IDs"
+ default "1022,7801" if HUDSON_SATA_MODE = 2
+ default "1022,7804" if HUDSON_SATA_MODE = 5
config HUDSON_AHCI_ROM
bool "Add a AHCI ROM"
@@ -209,9 +191,11 @@ config AHCI_ROM_FILE
string "AHCI ROM path and filename"
depends on HUDSON_AHCI_ROM
default "src/southbridge/amd/agesa/hudson/ahci.bin"
-endif # HUDSON_SATA_AHCI || HUDSON_SATA_AHCI7804
-if HUDSON_SATA_RAID
+endif
+
+if HUDSON_SATA_MODE = 1
+
config RAID_ROM_ID
string "RAID device PCI IDs"
default "1022,7802"
@@ -220,23 +204,21 @@ config RAID_ROM_ID
config RAID_ROM_FILE
string "RAID ROM path and filename"
- depends on HUDSON_SATA_RAID
default "src/southbridge/amd/agesa/hudson/raid.bin"
config RAID_MISC_ROM_FILE
- string "RAID Misc ROM path and filename"
- default "src/southbridge/amd/agesa/hudson/misc.bin"
- depends on HUDSON_SATA_RAID
+ string "RAID Misc ROM path and filename"
+ default "src/southbridge/amd/agesa/hudson/misc.bin"
config RAID_MISC_ROM_POSITION
hex "RAID Misc ROM Position"
default 0xFFF00000
- depends on HUDSON_SATA_RAID
help
The RAID ROM requires that the MISC ROM is located between the range
0xFFF0_0000 to 0xFFF0_FFFF. Also, it must 1K bytes aligned.
The CONFIG_ROM_SIZE must be larger than 0x100000.
-endif # HUDSON_SATA_RAID
+
+endif
config HUDSON_LEGACY_FREE
bool "System is legacy free"
diff --git a/src/southbridge/amd/agesa/hudson/Makefile.inc b/src/southbridge/amd/agesa/hudson/Makefile.inc
index 5fab10fe19..4b1eed696c 100644
--- a/src/southbridge/amd/agesa/hudson/Makefile.inc
+++ b/src/southbridge/amd/agesa/hudson/Makefile.inc
@@ -149,14 +149,12 @@ hudson/gec-type := raw
hudson/gec-required := Hudson Gigabit Ethernet Controller Firmware (Contact your AMD representative)
endif
-#ifeq ($(CONFIG_HUDSON_SATA_AHCI), y)
ifdef CONFIG_HUDSON_AHCI_ROM
stripped_ahci_rom_id = $(call strip_quotes,$(CONFIG_AHCI_ROM_ID))
cbfs-files-y += pci$(stripped_ahci_rom_id).rom
pci$(stripped_ahci_rom_id).rom-file := $(call strip_quotes,$(CONFIG_AHCI_ROM_FILE))
pci$(stripped_ahci_rom_id).rom-type := optionrom
pci$(stripped_ahci_rom_id).rom-required := Hudson AHCI Option ROM (Contact your AMD representative)
-#endif
endif
ifeq ($(CONFIG_HUDSON_PSP), y)
diff --git a/src/southbridge/amd/agesa/hudson/hudson.h b/src/southbridge/amd/agesa/hudson/hudson.h
index 286e11ca37..90c3205ed1 100644
--- a/src/southbridge/amd/agesa/hudson/hudson.h
+++ b/src/southbridge/amd/agesa/hudson/hudson.h
@@ -55,6 +55,18 @@
#define SPI_ROM_ENABLE 0x02
#define SPI_BASE_ADDRESS 0xFEC10000
+static inline int hudson_sata_enable(void)
+{
+ /* True if IDE or AHCI. */
+ return (CONFIG_HUDSON_SATA_MODE == 0) || (CONFIG_HUDSON_SATA_MODE == 2);
+}
+
+static inline int hudson_ide_enable(void)
+{
+ /* True if IDE or LEGACY IDE. */
+ return (CONFIG_HUDSON_SATA_MODE == 0) || (CONFIG_HUDSON_SATA_MODE == 3);
+}
+
#ifndef __SMM__
void pm_write8(u8 reg, u8 value);