Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37649 )
Change subject: mb/google/octopus/variants/bobba: fix LTE power sequence and move get_board_sku to smm stage. ......................................................................
mb/google/octopus/variants/bobba: fix LTE power sequence and move get_board_sku to smm stage.
fix Power_off section power sequence. power_off_lte_module() should run in smm stage, add variant.c in smm stage. also move get_board_sku() to mainboard_misc.c so that we can use it in smm stage and ramstage.
BUG=b:144327240 BRANCH=octopus TEST=build image and verify on the DUT with LTE DB.
Change-Id: I287ba1cb092a95b3a9dd1f960a3b84fd85b9b221 Signed-off-by: Pan Sheng-Liang sheng-liang.pan@quanta.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/37649 Reviewed-by: Marco Chen marcochen@google.com Reviewed-by: Ren Kuo ren.kuo@quanta.corp-partner.google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/octopus/Makefile.inc M src/mainboard/google/octopus/mainboard.c A src/mainboard/google/octopus/mainboard_misc.c M src/mainboard/google/octopus/variants/bobba/Makefile.inc 4 files changed, 58 insertions(+), 32 deletions(-)
Approvals: build bot (Jenkins): Verified Ren Kuo: Looks good to me, approved Sheng-Liang Pan: Looks good to me, but someone else must approve Marco Chen: Looks good to me, approved
diff --git a/src/mainboard/google/octopus/Makefile.inc b/src/mainboard/google/octopus/Makefile.inc index aa05524..d36d5f7 100644 --- a/src/mainboard/google/octopus/Makefile.inc +++ b/src/mainboard/google/octopus/Makefile.inc @@ -5,10 +5,12 @@
ramstage-$(CONFIG_CHROMEOS) += chromeos.c ramstage-y += ec.c +ramstage-y += mainboard_misc.c ramstage-y += mainboard.c
verstage-$(CONFIG_CHROMEOS) += chromeos.c smm-y += smihandler.c +smm-y += mainboard_misc.c
subdirs-y += variants/baseboard CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include diff --git a/src/mainboard/google/octopus/mainboard.c b/src/mainboard/google/octopus/mainboard.c index 3312d4d..0ab4693 100644 --- a/src/mainboard/google/octopus/mainboard.c +++ b/src/mainboard/google/octopus/mainboard.c @@ -117,38 +117,6 @@ .enable_dev = mainboard_enable, };
-#define SKU_UNKNOWN 0xFFFFFFFF -#define SKU_MAX 255 - -uint32_t get_board_sku(void) -{ - static uint32_t sku_id = SKU_UNKNOWN; - - if (sku_id != SKU_UNKNOWN) - return sku_id; - - if (google_chromeec_cbi_get_sku_id(&sku_id)) - sku_id = SKU_UNKNOWN; - - return sku_id; -} - -const char *smbios_system_sku(void) -{ - static char sku_str[7]; /* sku{0..255} */ - uint32_t sku_id = get_board_sku(); - - if ((sku_id == SKU_UNKNOWN) || (sku_id > SKU_MAX)) { - printk(BIOS_ERR, "%s: Unexpected SKU ID %u\n", - __func__, sku_id); - return ""; - } - - snprintf(sku_str, sizeof(sku_str), "sku%u", sku_id); - - return sku_str; -} - void __weak variant_update_devtree(struct device *dev) { /* Place holder for common updates. */ diff --git a/src/mainboard/google/octopus/mainboard_misc.c b/src/mainboard/google/octopus/mainboard_misc.c new file mode 100644 index 0000000..3672f66 --- /dev/null +++ b/src/mainboard/google/octopus/mainboard_misc.c @@ -0,0 +1,54 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Intel Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <baseboard/variants.h> +#include <boardid.h> +#include <console/console.h> +#include <ec/google/chromeec/ec.h> +#include <ec/ec.h> +#include <smbios.h> +#include <string.h> + +#define SKU_UNKNOWN 0xFFFFFFFF +#define SKU_MAX 255 + +uint32_t get_board_sku(void) +{ + static uint32_t sku_id = SKU_UNKNOWN; + + if (sku_id != SKU_UNKNOWN) + return sku_id; + + if (google_chromeec_cbi_get_sku_id(&sku_id)) + sku_id = SKU_UNKNOWN; + + return sku_id; +} + +const char *smbios_system_sku(void) +{ + static char sku_str[7]; /* sku{0..255} */ + uint32_t sku_id = get_board_sku(); + + if ((sku_id == SKU_UNKNOWN) || (sku_id > SKU_MAX)) { + printk(BIOS_ERR, "%s: Unexpected SKU ID %u\n", + __func__, sku_id); + return ""; + } + + snprintf(sku_str, sizeof(sku_str), "sku%u", sku_id); + + return sku_str; +} diff --git a/src/mainboard/google/octopus/variants/bobba/Makefile.inc b/src/mainboard/google/octopus/variants/bobba/Makefile.inc index ba865e9..7ee7e70 100644 --- a/src/mainboard/google/octopus/variants/bobba/Makefile.inc +++ b/src/mainboard/google/octopus/variants/bobba/Makefile.inc @@ -2,3 +2,5 @@
ramstage-y += gpio.c ramstage-y += variant.c + +smm-y += variant.c