[coreboot-gerrit] New patch to review for coreboot: fa7c7a1 Lenovo X60: Add CMOS defaults.

Denis Carikli (GNUtoo@no-log.org) gerrit at coreboot.org
Wed May 29 21:54:10 CEST 2013


Denis Carikli (GNUtoo at no-log.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3335

-gerrit

commit fa7c7a19d1fd21c5ee35199541abd6a551bfd583
Author: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
Date:   Wed May 29 21:25:05 2013 +0200

    Lenovo X60: Add CMOS defaults.
    
    After removing power and the CMOS Battery, putting it back
      and booting coreboot we have:
         # ./nvramtool -a
         boot_option = Fallback
         last_boot = Fallback
         baud_rate = 115200
         debug_level = Spew
         hyper_threading = Enable
         nmi = Enable
         boot_devices = ''
         boot_default = 0x40
         cmos_defaults_loaded = Yes
         lpt = Enable
         volume = 0xff
         tft_brightness = 0xbf
         first_battery = Primary
         bluetooth = Enable
    
    The code for handling the invalid CMOS space in mainboard.c
      is now useless and so it was removed.
    
    Change-Id: Ic57a14eeeea861aa034cb0884795b0152757bf5b
    Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at no-log.org>
---
 src/mainboard/lenovo/x60/Kconfig      |  1 +
 src/mainboard/lenovo/x60/cmos.default | 14 ++++++++++++++
 src/mainboard/lenovo/x60/mainboard.c  | 17 -----------------
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig
index 1431a2f..5ecad2f 100644
--- a/src/mainboard/lenovo/x60/Kconfig
+++ b/src/mainboard/lenovo/x60/Kconfig
@@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	select EC_LENOVO_H8
 	select DRIVERS_ICS_954309
 	select HAVE_OPTION_TABLE
+	select HAVE_CMOS_DEFAULT
 	select HAVE_PIRQ_TABLE
 	select HAVE_MP_TABLE
 	select MMCONF_SUPPORT
diff --git a/src/mainboard/lenovo/x60/cmos.default b/src/mainboard/lenovo/x60/cmos.default
new file mode 100644
index 0000000..f5e4afa
--- /dev/null
+++ b/src/mainboard/lenovo/x60/cmos.default
@@ -0,0 +1,14 @@
+boot_option=Fallback
+last_boot=Fallback
+baud_rate=115200
+debug_level=Spew
+hyper_threading=Enable
+nmi=Enable
+boot_devices=''
+boot_default=0x40
+cmos_defaults_loaded=Yes
+lpt=Enable
+volume=0x3
+tft_brightness=0xf
+first_battery=Primary
+bluetooth=Enable
diff --git a/src/mainboard/lenovo/x60/mainboard.c b/src/mainboard/lenovo/x60/mainboard.c
index 3cb28ff..032d641 100644
--- a/src/mainboard/lenovo/x60/mainboard.c
+++ b/src/mainboard/lenovo/x60/mainboard.c
@@ -54,7 +54,6 @@ int get_cst_entries(acpi_cstate_t **entries)
 static void mainboard_enable(device_t dev)
 {
 	device_t dev0, idedev, sdhci_dev;
-	u8 defaults_loaded = 0;
 
 	ec_clr_bit(0x03, 2);
 
@@ -92,22 +91,6 @@ static void mainboard_enable(device_t dev)
 			pci_write_config8(sdhci_dev, 0xf9, 0x00);
 		}
 	}
-
-	if (get_option(&defaults_loaded, "cmos_defaults_loaded") < 0) {
-		printk(BIOS_INFO, "failed to get cmos_defaults_loaded");
-		defaults_loaded = 0;
-	}
-
-	if (!defaults_loaded) {
-		printk(BIOS_INFO, "Restoring CMOS defaults\n");
-		set_option("tft_brightness", &(u8[]){ 0xff });
-		set_option("volume", &(u8[]){ 0x03 });
-		/* set baudrate to 115200 baud */
-		set_option("baud_rate", &(u8[]){ 0x00 });
-		/* set default debug_level (DEFAULT_CONSOLE_LOGLEVEL starts at 1) */
-		set_option("debug_level", &(u8[]) { CONFIG_DEFAULT_CONSOLE_LOGLEVEL+1 });
-		set_option("cmos_defaults_loaded", &(u8[]){ 0x01 });
-	}
 }
 
 struct chip_operations mainboard_ops = {



More information about the coreboot-gerrit mailing list