From patchwork Mon Jan 27 05:06:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 240243 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sun, 26 Jan 2020 22:06:40 -0700 Subject: [PATCH 093/108] x86: apl: Generate CPU tables In-Reply-To: <20200127050655.170614-1-sjg@chromium.org> References: <20200127050655.170614-1-sjg@chromium.org> Message-ID: <20200126220508.93.I2a86b43205b9beb2d6a9a77e9baff15f52fcf97e@changeid> Add ACPI generation to the APL CPU driver. Signed-off-by: Simon Glass --- 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 #include #include +#include +#include +#include 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, };