summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2023-02-01 08:06:04 +0100
committerArthur Heymans <arthur@aheymans.xyz>2023-02-06 08:09:35 +0000
commit584d5e1cbabc1a8ce679597263d22a2a9b87c9f7 (patch)
treea1d2536b8c7ca9a2ba784249876a1ff91c2d0f49
parent20d25779c8eab9e21668a18a6180d75775f4eaee (diff)
soc/intel/apl: Hook up cpu ops in devicetree
This simplifies the code flow of the cpu init. APL can do CPU init after calling FSP-S, while GLK needs to do that before. This is now reflected directly in the cpu ops rather than using CONFIG_SOC_INTEL_COMMON_BLOCK_CPU_MPINIT as a proxy. Change-Id: I7fd1db72ca98f0a1b8fd03a979308a7c701a8a54 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72705 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Nico Huber <nico.h@gmx.de>
-rw-r--r--src/soc/intel/apollolake/chip.c10
-rw-r--r--src/soc/intel/apollolake/chipset_apl.cb2
-rw-r--r--src/soc/intel/apollolake/chipset_glk.cb2
-rw-r--r--src/soc/intel/apollolake/cpu.c2
4 files changed, 9 insertions, 7 deletions
diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c
index 78fefb1dff..11e3a1e24a 100644
--- a/src/soc/intel/apollolake/chip.c
+++ b/src/soc/intel/apollolake/chip.c
@@ -206,20 +206,24 @@ static struct device_operations pci_domain_ops = {
.acpi_fill_ssdt = ssdt_set_above_4g_pci,
};
-static struct device_operations cpu_bus_ops = {
+struct device_operations apl_cpu_bus_ops = {
.read_resources = noop_read_resources,
.set_resources = noop_set_resources,
.init = apollolake_init_cpus,
.acpi_fill_ssdt = generate_cpu_entries,
};
+struct device_operations glk_cpu_bus_ops = {
+ .read_resources = noop_read_resources,
+ .set_resources = noop_set_resources,
+ .acpi_fill_ssdt = generate_cpu_entries,
+};
+
static void enable_dev(struct device *dev)
{
/* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN)
dev->ops = &pci_domain_ops;
- else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER)
- dev->ops = &cpu_bus_ops;
else if (dev->path.type == DEVICE_PATH_GPIO)
block_gpio_enable(dev);
}
diff --git a/src/soc/intel/apollolake/chipset_apl.cb b/src/soc/intel/apollolake/chipset_apl.cb
index b4f1659899..03a67765ec 100644
--- a/src/soc/intel/apollolake/chipset_apl.cb
+++ b/src/soc/intel/apollolake/chipset_apl.cb
@@ -1,5 +1,5 @@
chip soc/intel/apollolake
- device cpu_cluster 0 on end
+ device cpu_cluster 0 on ops apl_cpu_bus_ops end
device domain 0 on
device pci 00.0 alias system_agent on end # Host Bridge
device pci 00.1 alias dptf on end # DPTF
diff --git a/src/soc/intel/apollolake/chipset_glk.cb b/src/soc/intel/apollolake/chipset_glk.cb
index 07eecf5b17..c6f2db1fe1 100644
--- a/src/soc/intel/apollolake/chipset_glk.cb
+++ b/src/soc/intel/apollolake/chipset_glk.cb
@@ -1,5 +1,5 @@
chip soc/intel/apollolake
- device cpu_cluster 0 on end
+ device cpu_cluster 0 on ops glk_cpu_bus_ops end
device domain 0 on
device pci 00.0 alias system_agent on end # Host Bridge
device pci 00.1 alias dptf on end # DPTF
diff --git a/src/soc/intel/apollolake/cpu.c b/src/soc/intel/apollolake/cpu.c
index dba1923522..7407415737 100644
--- a/src/soc/intel/apollolake/cpu.c
+++ b/src/soc/intel/apollolake/cpu.c
@@ -271,8 +271,6 @@ void soc_init_cpus(struct bus *cpu_bus)
void apollolake_init_cpus(struct device *dev)
{
- if (CONFIG(SOC_INTEL_COMMON_BLOCK_CPU_MPINIT))
- return;
if (!dev->link_list)
add_more_links(dev, 1);
soc_init_cpus(dev->link_list);