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>
This commit is contained in:
committed by
Patrick Georgi
parent
325fd3462e
commit
b091b33c2a
@@ -5,10 +5,12 @@ romstage-$(CONFIG_CHROMEOS) += chromeos.c
|
|||||||
|
|
||||||
ramstage-$(CONFIG_CHROMEOS) += chromeos.c
|
ramstage-$(CONFIG_CHROMEOS) += chromeos.c
|
||||||
ramstage-y += ec.c
|
ramstage-y += ec.c
|
||||||
|
ramstage-y += mainboard_misc.c
|
||||||
ramstage-y += mainboard.c
|
ramstage-y += mainboard.c
|
||||||
|
|
||||||
verstage-$(CONFIG_CHROMEOS) += chromeos.c
|
verstage-$(CONFIG_CHROMEOS) += chromeos.c
|
||||||
smm-y += smihandler.c
|
smm-y += smihandler.c
|
||||||
|
smm-y += mainboard_misc.c
|
||||||
|
|
||||||
subdirs-y += variants/baseboard
|
subdirs-y += variants/baseboard
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include
|
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include
|
||||||
|
@@ -117,38 +117,6 @@ struct chip_operations mainboard_ops = {
|
|||||||
.enable_dev = mainboard_enable,
|
.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)
|
void __weak variant_update_devtree(struct device *dev)
|
||||||
{
|
{
|
||||||
/* Place holder for common updates. */
|
/* Place holder for common updates. */
|
||||||
|
54
src/mainboard/google/octopus/mainboard_misc.c
Normal file
54
src/mainboard/google/octopus/mainboard_misc.c
Normal file
@@ -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;
|
||||||
|
}
|
@@ -2,3 +2,5 @@ bootblock-y += gpio.c
|
|||||||
|
|
||||||
ramstage-y += gpio.c
|
ramstage-y += gpio.c
|
||||||
ramstage-y += variant.c
|
ramstage-y += variant.c
|
||||||
|
|
||||||
|
smm-y += variant.c
|
||||||
|
Reference in New Issue
Block a user