summaryrefslogtreecommitdiff
path: root/src/mainboard/lippert/hurricane-lx
diff options
context:
space:
mode:
authorPeter Stuge <peter@stuge.se>2010-10-13 06:23:02 +0000
committerPeter Stuge <peter@stuge.se>2010-10-13 06:23:02 +0000
commit51eafdeae621f1b04db51c3b4a690fa993aa48a0 (patch)
treee36ad669d05eecf00ce5826f8fb3fad8409ebec7 /src/mainboard/lippert/hurricane-lx
parentf2573bd23727db672b22f3840ce91d08ec3aea5d (diff)
downloadcoreboot-51eafdeae621f1b04db51c3b4a690fa993aa48a0.tar.xz
Enable or disable the power button in Kconfig
Some mainboards need to disable the power button to avoid turning off right after being turned on, while other boards ship with a jumper over the power button and should allow the user to configure the behavior. This adds infrastructure in the form of four mutually exclusive options which can be selected in a mainboard Kconfig (power button forced on/off, and user-controllable with default on/off) and one result bool which source code can test. (Enable the button or not.) The options have been implemented in CS5536 code and for all mainboards which select SOUTHBRIDGE_AMD_CS5536, but should be used also by other chipsets where applicable. Note that if chipset code uses the result bool ENABLE_POWER_BUTTON, then every board using that chipset must select one out of the four control options in order to build. All touched boards should have unchanged behavior, except pcengines/alix1c, traverse/geos and lippert/hurricane-lx where the power button can now be configured by the user. Build tested for alix1c, alix2d, hurricane-lx and wyse-s50. Confirmed to work as advertised on alix1c both with button enabled and disabled. Includes additional traverse/geos changes from Nathan and lippert/hurricane-lx changes from Jens to correctly use the new feature on those boards. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Aurelien Guillaume <aurelien@iwi.me> Acked-by: Nils Jacobs <njacobs8@hetnet.nl> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5948 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/mainboard/lippert/hurricane-lx')
-rw-r--r--src/mainboard/lippert/hurricane-lx/Kconfig9
-rw-r--r--src/mainboard/lippert/hurricane-lx/romstage.c9
2 files changed, 10 insertions, 8 deletions
diff --git a/src/mainboard/lippert/hurricane-lx/Kconfig b/src/mainboard/lippert/hurricane-lx/Kconfig
index 027988f959..9b20aa0759 100644
--- a/src/mainboard/lippert/hurricane-lx/Kconfig
+++ b/src/mainboard/lippert/hurricane-lx/Kconfig
@@ -29,11 +29,20 @@ config IRQ_SLOT_COUNT
config BOARD_OLD_REVISION
bool "Board is old pre-3.0 revision"
default n
+ select POWER_BUTTON_DEFAULT_DISABLE
help
Look on the bottom side for a number like 406-0001-30. The last 2
digits state the PCB revision (3.0 in this example). For 2.0 or older
boards choose Y, for 3.0 and newer say N.
+ Old revision boards need a jumper shorting the power button to
+ power on automatically. You may enable the button only after this
+ jumper has been removed. New revision boards are not restricted
+ in this way, and always have the power button enabled.
+
+config POWER_BUTTON_FORCE_ENABLE
+ def_bool y if !BOARD_OLD_REVISION
+
config ONBOARD_UARTS_RS485
bool "Switch on-board serial ports to RS485"
default n
diff --git a/src/mainboard/lippert/hurricane-lx/romstage.c b/src/mainboard/lippert/hurricane-lx/romstage.c
index 018f353fd0..b7314bf06f 100644
--- a/src/mainboard/lippert/hurricane-lx/romstage.c
+++ b/src/mainboard/lippert/hurricane-lx/romstage.c
@@ -147,14 +147,7 @@ void main(unsigned long bist)
cpuRegInit(0, DIMM0, DIMM1, DRAM_TERMINATED);
-#if CONFIG_BOARD_OLD_REVISION
- /*
- * Old revision boards need a jumper shorting the power button to power
- * on automatically. So we must disable the button's fail-safe function,
- * or the board will shut down after 4 s.
- */
- outl(0, PMS_IO_BASE + PM_FSD); // Fail-Save Delay register
-#else
+#if !CONFIG_BOARD_OLD_REVISION
int err;
/* bit0 = Spread Spectrum */
if ((err = smc_send_config(SMC_CONFIG))) {