EricR Lai has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38566 )
Change subject: mb/google/drallion: Set cpu id to EC ......................................................................
mb/google/drallion: Set cpu id to EC
Set CPU ID and cores to EC then EC will according to different CPU to set different power table.
BUG=b:148126144 BRANCH=None TEST=check EC can get correct CPU id and cores.
Signed-off-by: Eric Lai ericr_lai@compal.corp-partner.google.com Change-Id: I23f5580b15a20a01e03a5f4c798e73574f874c9a --- M src/mainboard/google/drallion/ramstage.c 1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/38566/1
diff --git a/src/mainboard/google/drallion/ramstage.c b/src/mainboard/google/drallion/ramstage.c index 3855045..daee09d 100644 --- a/src/mainboard/google/drallion/ramstage.c +++ b/src/mainboard/google/drallion/ramstage.c @@ -14,14 +14,19 @@ */
#include <arch/acpi.h> +#include <arch/cpu.h> #include <boardid.h> +#include <device/pci_ids.h> +#include <device/pci_ops.h> #include <drivers/vpd/vpd.h> +#include <ec/google/wilco/commands.h> #include <smbios.h> #include <soc/gpio.h> #include <soc/ramstage.h> #include <variant/gpio.h> #include <vendorcode/google/chromeos/chromeos.h>
+ #define VPD_KEY_SYSTEM_SERIAL "serial_number" #define VPD_KEY_MAINBOARD_SERIAL "mlb_serial_number" #define VPD_SERIAL_LEN 64 @@ -59,6 +64,20 @@ } }
+/* set cpu id to EC, default cores is 4 */ +static int set_cpu_id(void) +{ + uint16_t mch_id = 0; + uint8_t cpu_cores = 4; + const struct device *dev = pcidev_path_on_root(SA_DEVFN_ROOT); + + mch_id = dev ? pci_read_config16(dev, PCI_DEVICE_ID) : 0xffff; + if (mch_id == PCI_DEVICE_ID_INTEL_CML_ULT_2_2) + cpu_cores = 2; + + return wilco_ec_set_cpuid(cpu_get_cpuid(), cpu_cores, 0); +} + static void mainboard_init(void *chip_info) { const struct pad_config *gpio_table; @@ -66,6 +85,8 @@
gpio_table = variant_gpio_table(&num_gpios); cnl_configure_pads(gpio_table, num_gpios); + if (set_cpu_id()) + printk(BIOS_ERR, "wilco set cpu id failed\n"); }
static void mainboard_enable(struct device *dev)