From patchwork Wed Apr 7 04:32:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1463152 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=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) 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=gcvHEa0J; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4FFWlm3mg6z9sV5 for ; Wed, 7 Apr 2021 14:35:16 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 072BC819D9; Wed, 7 Apr 2021 06:33:50 +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="gcvHEa0J"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 402D18186C; Wed, 7 Apr 2021 06:33:29 +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 autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 7C34F816B0 for ; Wed, 7 Apr 2021 06:33:20 +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-pl1-x62a.google.com with SMTP id v8so8687166plz.10 for ; Tue, 06 Apr 2021 21:33:20 -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=fu+Wq0JHCW4rpWf4Yah0m3HR4ZQPxfUeLH1YXHpP6TA=; b=gcvHEa0Jh8ciWs/qE5sk43i7QrxTemq0UlEnvNOzfXMyFw8MAvODMqU5/PaZpsreiW eYgCzKlnR9AF9cFl+2NGxn0vx8IsDYFQkK13g1sRCSjYWFWhPi2a8BipwhZr+vZ/8VKe yCDR36RdICPxK3G5vkgm+YkE8xAmCujs2vpXc= 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=fu+Wq0JHCW4rpWf4Yah0m3HR4ZQPxfUeLH1YXHpP6TA=; b=eYN8K6m0VlAioYT6ATJvww3C78Z+pWvTaJT8rMsBSEW9eWXxxU4WcsDSph92tYZkGI PFDXKNoljtkCDdsxbtqn2JJ+a0DUMrL3Z0pV5xSb2nJ+IpD/Brw9AdeWcGhfi/J3/SiA Qzl5xyEX/qmQawB9goNRG5DMZ3gsAZr7appR/tiy/xc7U5jwzAJnnjXoKtdvR4zBbOxr nIq2nliOCQZfWRL0ng6ngUImjQFBnfgdwUV/L/DUjll7l85sIhML8z46tJeS5TfYesi8 JK7wgfggDwocYIhCSMp3F5KLHuvMTaoxKisRM9/nHgk27lA39ajV2ZpHiP2dRcXvQ8fy po5A== X-Gm-Message-State: AOAM532mccfkaU50c95DOx6MALaUmOFrx8T3vKfRga5lYBaOR0Hw3wOl ow7pcUjScJ3FCiiXJChh9VcoQpBt8NoMYw== X-Google-Smtp-Source: ABdhPJwEJky6F47XmIhSrr75+zVd774phfBHEErtdWtS3B2Zu6VjqVgx46+cFo4PglJRw6qgchpCtQ== X-Received: by 2002:a17:90a:5898:: with SMTP id j24mr1450534pji.110.1617769998650; Tue, 06 Apr 2021 21:33:18 -0700 (PDT) Received: from localhost.localdomain (118-93-106-206.dsl.dyn.ihug.co.nz. [118.93.106.206]) by smtp.gmail.com with ESMTPSA id k21sm19968918pfi.28.2021.04.06.21.33.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 21:33:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng Subject: [PATCH 10/17] x86: coral: Allow booting from coreboot Date: Wed, 7 Apr 2021 16:32:20 +1200 Message-Id: <20210407043228.2268429-9-sjg@chromium.org> X-Mailer: git-send-email 2.31.0.208.g409f899ff0-goog In-Reply-To: <20210407043228.2268429-1-sjg@chromium.org> References: <20210407043228.2268429-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.4 at phobos.denx.de X-Virus-Status: Clean Set up coral so that it can boot from coreboot, even though it is a bare-metal build. This helps with testing since the same image can be used in both cases. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- board/google/chromebook_coral/coral.c | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c index 3f9235c903b..b16252d2a8b 100644 --- a/board/google/chromebook_coral/coral.c +++ b/board/google/chromebook_coral/coral.c @@ -10,17 +10,21 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include #include #include "variant_gpio.h" +DECLARE_GLOBAL_DATA_PTR; + struct cros_gpio_info { const char *linux_name; enum cros_gpio_t type; @@ -28,6 +32,30 @@ struct cros_gpio_info { int flags; }; +int misc_init_f(void) +{ + if (!ll_boot_init()) { + printf("Running as secondary loader"); + if (gd->arch.coreboot_table) { + int ret; + + printf(" (found coreboot table at %lx)", + gd->arch.coreboot_table); + + ret = get_coreboot_info(&lib_sysinfo); + if (ret != 0) { + printf("Failed to parse coreboot tables (err=%d)\n", + ret); + return ret; + } + } + + printf("\n"); + } + + return 0; +} + int arch_misc_init(void) { return 0;