diff options
author | Johnny Lin <johnny_lin@wiwynn.com> | 2019-08-13 15:36:23 +0800 |
---|---|---|
committer | Andrey Petrov <andrey.petrov@gmail.com> | 2019-08-20 18:18:34 +0000 |
commit | 64d8b9decf8fe51e13ef5e5e89c71682f1696608 (patch) | |
tree | 572183771d748af8f46293f1c0c97a878f490547 /src/mainboard/ocp/monolake/mainboard.c | |
parent | a4542990f4cd5d9a18e8b0846b54fcfe5cbd01e5 (diff) |
mb/ocp/monolake: Add IPMI CMOS clear support
coreboot would clear CMOS by request via IPMI command, for example
BMC can issue "bios-util server --boot_order enable --clear_CMOS"
to set the request and reboot the system, then coreboot would clear CMOS
on the next boot.
Tested on Mono Lake
Change-Id: I21d44557896680cfac3c3b6d83e07b755b242cad
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34857
Reviewed-by: Johnny Lin
Reviewed-by: Andrey Petrov <andrey.petrov@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/ocp/monolake/mainboard.c')
-rw-r--r-- | src/mainboard/ocp/monolake/mainboard.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mainboard/ocp/monolake/mainboard.c b/src/mainboard/ocp/monolake/mainboard.c index bbfeeafb3b..56aef6b36e 100644 --- a/src/mainboard/ocp/monolake/mainboard.c +++ b/src/mainboard/ocp/monolake/mainboard.c @@ -19,6 +19,9 @@ #if CONFIG(VGA_ROM_RUN) #include <x86emu/x86emu.h> #endif +#include <pc80/mc146818rtc.h> +#include <cf9_reset.h> +#include "ipmi.h" #define BMC_KCS_BASE 0xca2 #define INTERFACE_IS_IO 0x1 @@ -57,9 +60,18 @@ static void mainboard_enable(struct device *dev) /* Enable access to the BMC IPMI via KCS */ struct device *lpc_sio_dev = dev_find_slot_pnp(BMC_KCS_BASE, 0); struct resource *res = new_resource(lpc_sio_dev, BMC_KCS_BASE); + ipmi_oem_rsp_t rsp; res->base = BMC_KCS_BASE; res->size = 1; res->flags = IORESOURCE_IO | IORESOURCE_ASSIGNED | IORESOURCE_FIXED; + + if (is_ipmi_clear_cmos_set(&rsp)) { + /* TODO: Should also try to restore CMOS to cmos.default + * if USE_OPTION_TABLE is set */ + cmos_init(1); + clear_ipmi_flags(&rsp); + system_reset(); + } } struct chip_operations mainboard_ops = { |