[PATCH 093/108] x86: apl: Generate CPU tables

Simon Glass sjg at chromium.org
Mon Jan 27 06:06:40 CET 2020


Add ACPI generation to the APL CPU driver.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/x86/cpu/apollolake/cpu.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/x86/cpu/apollolake/cpu.c b/arch/x86/cpu/apollolake/cpu.c
index 3ae99ccf04..0af1b0c2cb 100644
--- a/arch/x86/cpu/apollolake/cpu.c
+++ b/arch/x86/cpu/apollolake/cpu.c
@@ -8,6 +8,9 @@
 #include <dm.h>
 #include <asm/cpu_common.h>
 #include <asm/cpu_x86.h>
+#include <asm/intel_acpi.h>
+#include <asm/msr.h>
+#include <dm/acpi.h>
 
 static int apl_get_info(const struct udevice *dev, struct cpu_info *info)
 {
@@ -19,6 +22,25 @@ static int apl_get_count(const struct udevice *dev)
 	return 4;
 }
 
+static int acpi_cpu_fill_ssdt(const struct udevice *dev, struct acpi_ctx *ctx)
+{
+	struct cpu_platdata *plat = dev_get_parent_platdata(dev);
+	int ret;
+
+	/* Trigger off the first CPU */
+	if (!plat->cpu_id) {
+		ret = generate_cpu_entries(ctx, dev);
+		if (ret)
+			return log_msg_ret("generate", ret);
+	}
+
+	return 0;
+}
+
+struct acpi_ops apl_cpu_acpi_ops = {
+	.fill_ssdt	= acpi_cpu_fill_ssdt,
+};
+
 static const struct cpu_ops cpu_x86_apl_ops = {
 	.get_desc	= cpu_x86_get_desc,
 	.get_info	= apl_get_info,
@@ -37,5 +59,6 @@ U_BOOT_DRIVER(cpu_x86_apl_drv) = {
 	.of_match	= cpu_x86_apl_ids,
 	.bind		= cpu_x86_bind,
 	.ops		= &cpu_x86_apl_ops,
+	acpi_ops_ptr(&apl_cpu_acpi_ops)
 	.flags		= DM_FLAG_PRE_RELOC,
 };
-- 
2.25.0.341.g760bfbb309-goog



More information about the U-Boot mailing list