From ba936ce5db819d5ecb34e83a998b2390ecbdc4b9 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Wed, 25 Aug 2021 15:49:22 -0700 Subject: soc/intel/denverton_ns: Ensure CPU device has a valid link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change calls `add_more_links()` in `denverton_init_cpus()` if `dev->link_list` is NULL. This condition can occur if mainboard does not add any APIC device in the device tree. Link: https://mail.coreboot.org/hyperkitty/list/coreboot@coreboot.org/thread/YLMK2FBWWL6RKDNKBVZB3NJDYMEYHED7/ "A different lapic number in devicetree.cb needed for CPU with the same SKU and steping (Intel Atom C3538)." Change-Id: I6f453901b17f7eff22beed8dbf6995cdc9f9b776 Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/c/coreboot/+/57152 Reviewed-by: Angel Pons Reviewed-by: King Sumo Reviewed-by: Suresh Bellampalli Reviewed-by: Subrata Banik Reviewed-by: Mariusz SzafraƄski Tested-by: build bot (Jenkins) --- src/soc/intel/denverton_ns/cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/soc/intel/denverton_ns/cpu.c b/src/soc/intel/denverton_ns/cpu.c index 1dc0830d86..10e79be3b5 100644 --- a/src/soc/intel/denverton_ns/cpu.c +++ b/src/soc/intel/denverton_ns/cpu.c @@ -287,6 +287,14 @@ static const struct mp_ops mp_ops = { void denverton_init_cpus(struct device *dev) { + /* + * Ensure there is at least one bus downstream to the CPU device. If not, then create a + * new link. This can occur if the mainboard does not add any APIC device in the device + * tree. + */ + if (!dev->link_list) + add_more_links(dev, 1); + /* Clear for take-off */ if (mp_init_with_smm(dev->link_list, &mp_ops) < 0) printk(BIOS_ERR, "MP initialization failure.\n"); -- cgit v1.2.3