From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47AEFC48BC2 for ; Sun, 27 Jun 2021 23:53:20 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BADE76100C for ; Sun, 27 Jun 2021 23:53:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BADE76100C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 68C2982DAC; Mon, 28 Jun 2021 01:52:05 +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="nNkoT4ak"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E86482D6F; Mon, 28 Jun 2021 01:51:35 +0200 (CEST) Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) (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 0E0F682D71 for ; Mon, 28 Jun 2021 01:51:30 +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-oo1-xc2a.google.com with SMTP id r14-20020a4ad4ce0000b029024b4146e2f5so4274516oos.1 for ; Sun, 27 Jun 2021 16:51:29 -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=qgCu1tXOd/52Z9T3kZV1tbFaXazOdLuaaHD7vpue8AU=; b=nNkoT4akGnSMd+yrJBJKS4vc7NbfZJinWOyOkvTcNyoJXOuzWTNo4H8J2c0eRWT4t1 RO2aklhHQdx0RhhXQ4uonjX41AyTujFUXHCD1PHUAGiMY9xmqOAtJ/m5np+EKMvAU4eU ipRVmy+9GgyLoH8OrMGfonBNCzrFZJcYp27uY= 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=qgCu1tXOd/52Z9T3kZV1tbFaXazOdLuaaHD7vpue8AU=; b=BqDjeT01BLhK8doV/U58Yxl5sfocbcQgg/R0jvCCSG4EOednJB50T6ZPqw/tWnESF+ cjeOOroWHNPBMZs0cEeJSlJrEdDsaff9qCYbsNfu5R1Hy1i941oM5qwwrdkXInGJ3y1r N7QP8Yc4XzfsHl/8053n6WAdhwim2o2KfkRCi+xQA3KE9gTwoIEmkMaeqjqI2mkz9DEg wPqn5LHijcGfzhT54viMfXVXdL8xIlvDb0Xshdx/AFlqutrqcTGFudBPKrJOOmxPnAG1 bVc9ZyxgUeW7K4L9FQozYRA17jborWKB/d5dgTE4jMIv76AJ0tjlBcGWsGM+9QZJI42k ISGg== X-Gm-Message-State: AOAM532+xPvCBwe8o7CZLZ+GZWr6qSDHu3S7N7z6knL/ixR9DZQHZ9hR qw5mfskjZC9HUM3Z61QqO6YQeeRdqx+uSaVo X-Google-Smtp-Source: ABdhPJzlB7XQq7D8rwYJo59rxYsJUSEVmZwVp2JIXgTLFHWyKaZEu9R2wRLKZs6DHqjBll04B3MdJA== X-Received: by 2002:a4a:5285:: with SMTP id d127mr16947921oob.2.1624837888510; Sun, 27 Jun 2021 16:51:28 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id bb34sm1297928oob.39.2021.06.27.16.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Jun 2021 16:51:28 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Bin Meng Subject: [PATCH v3 10/16] x86: coral: Allow booting from coreboot Date: Sun, 27 Jun 2021 17:51:05 -0600 Message-Id: <20210627235111.485507-9-sjg@chromium.org> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog In-Reply-To: <20210627235111.485507-1-sjg@chromium.org> References: <20210627235111.485507-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.103.2 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 --- (no changes since v2) Changes in v2: - Add missing newline in the error path - Use (ret) instead of (ret != 0) to fit with U-Boot style 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..85cba50d4e5 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) { + printf("\nFailed to parse coreboot tables (err=%d)\n", + ret); + return ret; + } + } + + printf("\n"); + } + + return 0; +} + int arch_misc_init(void) { return 0; -- 2.32.0.93.g670b81a890-goog