From patchwork Sun Apr 26 15:12:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1277078 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=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ZMfM8kUB; 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 499BKX2M7gz9sRY for ; Mon, 27 Apr 2020 01:14:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13AC081D0F; Sun, 26 Apr 2020 17:13:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (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=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ZMfM8kUB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AF63781D0C; Sun, 26 Apr 2020 17:13:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,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-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 B464181D0F for ; Sun, 26 Apr 2020 17:13:14 +0200 (CEST) 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-xd43.google.com with SMTP id i19so16079906ioh.12 for ; Sun, 26 Apr 2020 08:13:14 -0700 (PDT) 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=OuJijMsW5zh/+g+iinbKCH7qiuN153TC7UPGu1Vp+8Y=; b=ZMfM8kUBDFaVjRQwH9JipDQilM6W5NzNGFJoe9qwknYAot2B5RINkVLo0H1upBu6YJ 4jSTcEh8uPemIbaaD11DlFwzqTr+vvjF+t0HMkkaX5MMjpKGaBD9H9bdEkYCqJfB6i3M RpXlx7gPYBCrqGCJtBDbaxe/raawT4fNyQzQk= 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=OuJijMsW5zh/+g+iinbKCH7qiuN153TC7UPGu1Vp+8Y=; b=o9gTnAe8Cp26ft4LadGrtNIxyTHI5ca5Xbpj/VQjPp1X8BeNAwmxwnJbAGZDka5buq jPnZ6Jgixx1yBV17IEe1zPHO7CeyS6gOSk311ayfMaAX8HPB9pZP2pdbgwst4WzrL5Eo +LG1PSoSXwawtMKKTeS1T6ysANSMftKsHwVmVYeLt38UXj4TTt4RyOZB61AOy0rRwfjH 0G5Pzky6Z33S+JTqYIvfQpLCP73Ai3Fer1mDQT+AgcHHEyZV9dmtE5tm6nvq0AeiZCvK 88NFjor8ntPPm83TWU1YVr6SILqgaR4TVoA/unmVU1zOA2yNLAJ7uFCUQmEj7KXp/ml8 WUHg== X-Gm-Message-State: AGi0PubpErXaE9GkDxVkTTGLm4Qx7Z+nLCs3ub/biYPPL8bZ1T5WJlgK uiKjcdyMol0UBUXr7IkuuMUI9TVz3Q2CBA== X-Google-Smtp-Source: APiQypLl2P3+tZ8gxlZYLwE8w31isqAOceyw2u05FvzlZCnHrO/pyYhZ9S55QWjo7q0RnOwr/w5IiQ== X-Received: by 2002:a05:6602:2f08:: with SMTP id q8mr17171315iow.103.1587913993524; Sun, 26 Apr 2020 08:13:13 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id n25sm3981978ion.34.2020.04.26.08.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 08:13:13 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Masahiro Yamada Subject: [PATCH v4 7/9] x86: Add a way to detect running from coreboot Date: Sun, 26 Apr 2020 09:12:59 -0600 Message-Id: <20200426151302.93418-7-sjg@chromium.org> X-Mailer: git-send-email 2.26.2.303.gf8c07b1a785-goog In-Reply-To: <20200426151302.93418-1-sjg@chromium.org> References: <20200426151302.93418-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean If U-Boot is running from coreboot we need to skip low-level init. Add an way to detect this and to set the gd flag. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v4: - Rename flag to GD_FLG_SKIP_LL_INIT - Split this patch into two Changes in v3: - Add new patch to detect running from coreboot Changes in v2: None arch/x86/cpu/i386/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c index e52fd686d9..8a458bb5ff 100644 --- a/arch/x86/cpu/i386/cpu.c +++ b/arch/x86/cpu/i386/cpu.c @@ -476,6 +476,8 @@ int x86_cpu_reinit_f(void) { setup_identity(); setup_pci_ram_top(); + if (locate_coreboot_table() >= 0) + gd->flags |= GD_FLG_SKIP_LL_INIT; return 0; }