From 51eafdeae621f1b04db51c3b4a690fa993aa48a0 Mon Sep 17 00:00:00 2001 From: Peter Stuge Date: Wed, 13 Oct 2010 06:23:02 +0000 Subject: 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 Acked-by: Aurelien Guillaume Acked-by: Nils Jacobs git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5948 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/mainboard/pcengines/alix1c/Kconfig | 1 + src/mainboard/pcengines/alix2d/Kconfig | 1 + src/mainboard/pcengines/alix2d/romstage.c | 6 ------ 3 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mainboard/pcengines') diff --git a/src/mainboard/pcengines/alix1c/Kconfig b/src/mainboard/pcengines/alix1c/Kconfig index b10095c902..0a016a54f5 100644 --- a/src/mainboard/pcengines/alix1c/Kconfig +++ b/src/mainboard/pcengines/alix1c/Kconfig @@ -11,6 +11,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select PIRQ_ROUTE select UDELAY_TSC select BOARD_ROMSIZE_KB_512 + select POWER_BUTTON_DEFAULT_DISABLE config MAINBOARD_DIR string diff --git a/src/mainboard/pcengines/alix2d/Kconfig b/src/mainboard/pcengines/alix2d/Kconfig index bb54d1cad1..264f5d9e97 100644 --- a/src/mainboard/pcengines/alix2d/Kconfig +++ b/src/mainboard/pcengines/alix2d/Kconfig @@ -10,6 +10,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select PIRQ_ROUTE select UDELAY_TSC select BOARD_ROMSIZE_KB_512 + select POWER_BUTTON_FORCE_DISABLE config MAINBOARD_DIR string diff --git a/src/mainboard/pcengines/alix2d/romstage.c b/src/mainboard/pcengines/alix2d/romstage.c index aa5f7a0fc4..10ab27d662 100644 --- a/src/mainboard/pcengines/alix2d/romstage.c +++ b/src/mainboard/pcengines/alix2d/romstage.c @@ -119,12 +119,6 @@ static u8 spd_read_byte(u8 device, u8 address) /** Early mainboard specific GPIO setup. */ static void mb_gpio_init(void) { - /* - * Disable power button, since it is hardwired to ground on this board, - * and the power would be cut off atfer a 4-second delay otherwise. - */ - outl(0x00020000, PMS_IO_BASE + 0x40); - /* * Enable LEDs GPIO outputs to light up the leds * This is how the original tinyBIOS sets them after boot. -- cgit v1.2.3