From patchwork Wed Sep 25 14:11:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1167267 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.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.b="Ea0wo8G3"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46dgCH1gT4z9sNx for ; Thu, 26 Sep 2019 00:18:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A923AC21EBA; Wed, 25 Sep 2019 14:13:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 907F5C21F59; Wed, 25 Sep 2019 14:13:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C71C1C21F94; Wed, 25 Sep 2019 14:12:19 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id 17458C21FF3 for ; Wed, 25 Sep 2019 14:12:19 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id c25so14147809iot.12 for ; Wed, 25 Sep 2019 07:12:19 -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=l3x0Pq0Hm1IV9BRPD32TGgIwul+2oRNTNYMQir65fWk=; b=Ea0wo8G3bCHN6to1gpieB/uw6sHSLdmoKUQnqWn/ankfbgXYLDtVY91cjldC2KCh12 hc7818BAwgwHWJ3bY7Pwn0emIX7wv5uOA1GP7yqVs/CZy7XEAs9NLT4H9TifBzGlzs4T cIb3ygh8B/t0qMU6PUQDTFMyufBQAYSwGG4GQ= 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=l3x0Pq0Hm1IV9BRPD32TGgIwul+2oRNTNYMQir65fWk=; b=lxv8D2pPC3bkz5qj9LEmTdW9Ujh6gMa0oOy82JkCC15QETbjGd7DMOIKRQD/Ox7z0J ae4yhJQhn2eMuDIljvatr0Unxg36VVirhiDDvpAMx0BTSfJajoNDgNwmbfN5e7tVrCqA 1lM7JCEdQRMqElM3DMvcQtKTp2r83dik1O7On3jdO2VFViWd+xZVDxGOu+8Q2LAaUniq vZvbXsI5pEx0CqPrt4HYjXYwtOkocKq8e26ysiSb/Ht0s14Z2z8BlmAVtGsY8fLIJDOG KC15CLIbWn7JocsR9DKbFxNE1s1rbz7PPrKFMru2D1YpiA5I5ZPcSmzlviItEDN3CAlx MPnw== X-Gm-Message-State: APjAAAVOQ1uVV/G7OIx31LqNtiOXhRnFbe3mYoldhBAi0diyMDJXq9BS 1E/SXW/RzA62uDiudHZF+2noex8DEG8= X-Google-Smtp-Source: APXvYqz2KcSbA+kmTXLNxXAMfolKEs1Hs36ioP2+flJxGt9ujEVC7hcZFO6DeS0ZIbdpStuSKplKNQ== X-Received: by 2002:a02:80d:: with SMTP id 13mr5464079jac.50.1569420737816; Wed, 25 Sep 2019 07:12:17 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id d20sm196878ilk.83.2019.09.25.07.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2019 07:12:17 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 25 Sep 2019 08:11:19 -0600 Message-Id: <20190925141147.191166-11-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.444.g18eeb5a265-goog In-Reply-To: <20190925141147.191166-1-sjg@chromium.org> References: <20190925141147.191166-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2 10/38] spl: Set up the bloblist in board_init_r() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" At present the bloblist is set up in spl_common_init() which can be called from spl_early_init(), i.e. before SDRAM is ready. This prevents the bloblist from being located in SDRAM, which is useful on some platforms where SRAM is inaccessible after U-Boot relocates (e.g. x86 CAR region). It doesn't serve much purpose to have the bloblist available early, since very little is known about the platform then, and the handoff info is written when SPL is about to jump to U-Boot. Move the code to board_init_r() to avoid any restrictions. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v2: None common/spl/spl.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index 730cd6b3084..5fdd6d0d032 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -410,23 +410,6 @@ static int spl_common_init(bool setup_malloc) return ret; } #endif - if (CONFIG_IS_ENABLED(BLOBLIST)) { - ret = bloblist_init(); - if (ret) { - debug("%s: Failed to set up bloblist: ret=%d\n", - __func__, ret); - return ret; - } - } - if (CONFIG_IS_ENABLED(HANDOFF)) { - int ret; - - ret = setup_spl_handoff(); - if (ret) { - puts(SPL_TPL_PROMPT "Cannot set up SPL handoff\n"); - hang(); - } - } if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) { ret = fdtdec_setup(); if (ret) { @@ -604,6 +587,24 @@ void board_init_r(gd_t *dummy1, ulong dummy2) */ timer_init(); #endif + if (CONFIG_IS_ENABLED(BLOBLIST)) { + ret = bloblist_init(); + if (ret) { + debug("%s: Failed to set up bloblist: ret=%d\n", + __func__, ret); + puts(SPL_TPL_PROMPT "Cannot set up bloblist\n"); + hang(); + } + } + if (CONFIG_IS_ENABLED(HANDOFF)) { + int ret; + + ret = setup_spl_handoff(); + if (ret) { + puts(SPL_TPL_PROMPT "Cannot set up SPL handoff\n"); + hang(); + } + } #if CONFIG_IS_ENABLED(BOARD_INIT) spl_board_init();