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: 1229591 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=RNku9W+2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 485dW00plRz9sR1 for ; Mon, 27 Jan 2020 16:25:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0A63C8191D; Mon, 27 Jan 2020 06:13:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="RNku9W+2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AB1E6817D3; Mon, 27 Jan 2020 06:10:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BE6C981726 for ; Mon, 27 Jan 2020 06:09:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id c16so8568082ioh.6 for ; Sun, 26 Jan 2020 21:09:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ozbqBibQdR00lC4Cf5Mweg3smuJz+nkLTZCkiA8gsxM=; b=RNku9W+2u/d/WOs1rr0bYDgjxhq6AEL8+pzvCQaKwHI/FLUaD6z04SyK+3e76c+6Kj XQO7RFzLwS6q2VXPRD+yOM9hSMLPNjpfKzodzzC1Cd6wIpsAGB6zvgUmEUMgVNshfshd ciniZ/Zlt2aTLIAbp8j+qZzOoidVfaIcluD9o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ozbqBibQdR00lC4Cf5Mweg3smuJz+nkLTZCkiA8gsxM=; b=cSILVSCX8xogvJHQUNMN/SDwd54mrVlH1FVPmCeQ1QksNpKQlvOeOR8UK6JnD6SvI6 afBKbq4YkKhidSa3zJnSagifGuvbaiYlRIotHGGbqCj54Zbur1KryQw7KmbacuJEYXjL /pgDXjujwSiGKflvrdi8xrIHwO7LmoRCTgT0gnnV3PYqnF39Bbq3RZ1yW3biuVSEoN9S 8UqFZQ56Oom6CnWVMHi8mFFz732KKx/ZjKNpIc14lFg0qkaPohOvKuuYeYhIjZ4fTBqG mIaLpzofu46SJTHru6Vu2fEy831d0KJ2c7Z3jCM5QJkY1RpjW0Y+FH+xsb+hszZNzCen LY7A== X-Gm-Message-State: APjAAAW9SAygOTJAfo65+67z3QW6Zpt9qzyTuHfQ1GHeoC+YtKeC3RBU OSOTW6025HC0utgcZBaFuuSAxEDiEF94Aw== X-Google-Smtp-Source: APXvYqyj5JtvRjmeGW26u3gH+wBWgq2blMpT0wq+vTLwbr5Ptgrbt+bSpmj418Bhup//OTUYqwj6xQ== X-Received: by 2002:a5d:8448:: with SMTP id w8mr11451029ior.161.1580101778516; Sun, 26 Jan 2020 21:09:38 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id h23sm4313195ilf.57.2020.01.26.21.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Jan 2020 21:09:38 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Subject: [PATCH 093/108] x86: apl: Generate CPU tables Date: Sun, 26 Jan 2020 22:06:40 -0700 Message-Id: <20200126220508.93.I2a86b43205b9beb2d6a9a77e9baff15f52fcf97e@changeid> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200127050655.170614-1-sjg@chromium.org> References: <20200127050655.170614-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean 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, };