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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C38BBC433EF for ; Mon, 28 Feb 2022 14:18:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 315E583C6D; Mon, 28 Feb 2022 15:18:22 +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=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="bvtUW0gM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CF58983C6D; Mon, 28 Feb 2022 15:18:00 +0100 (CET) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (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 8B01583BE8 for ; Mon, 28 Feb 2022 15:17:52 +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-ot1-x32b.google.com with SMTP id w3-20020a056830060300b005ad10e3becaso9584580oti.3 for ; Mon, 28 Feb 2022 06:17:52 -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=jF8vQ84JzopsN1GtC5E8t3oNnIWViY2D1mNeuD51sPA=; b=bvtUW0gMONJFrXI/F/Fvnd2VoA/0byS14VbIjgPNF71stnN+7A3C0Nr6YjRDaUZgYU uAYfnby0wSuTmxv7glDQ3nyaJXgA/UHfb52WWkyTxEqmsOWLUkEiOG3wd1LgEsZDrzCP /VW6wOC9zLH52yjy/PxencBCQm38brQKfCnoo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jF8vQ84JzopsN1GtC5E8t3oNnIWViY2D1mNeuD51sPA=; b=ZYvY3dUHqQAZweauucCngXPWU33HMDJTd4hfhFmhIqJrzfCosDLt/UnWe8XF5Pt2pB VdZ7y0Jt1bxSB+XlQHlLue+SCFwVKf4RJWcOJo56OuJZ7ESZmqyvXTwjEorGhI6m8wJd MPUdDXnUz7TumypXqe4rFMsvYPqqzY5CUbZFaHm66hHKMR663gKBq+3dFVKuwfztc0CE /DyUR0emNUC11h/vUcdSBr913j3w5PMgx6HIXS2adFEc6ztscqQYM22IXaXdEeaXvAxm VE9oStR3xtuWo+xpfaREODzw0+ZU9th6edFG2H5nk10KtjrtNAFdfgTN+kjmfnIjI4mN 2Lew== X-Gm-Message-State: AOAM5324HbKYCX3QLPi8tRQ0EyRHaOqTXJ1Gy3AFhjIT9YP8ocUpWs48 rYoqOI179H/WpgDTDGC5U/WoT0g4u+nklg== X-Google-Smtp-Source: ABdhPJw+vAv2cCQIwJ31dt3NNvipKMAFHODaB30rImZy/A94AIEqP9c2+EpMKQMmsfs6Z7zkRcWNyw== X-Received: by 2002:a9d:7e8a:0:b0:5af:152b:266f with SMTP id m10-20020a9d7e8a000000b005af152b266fmr9297584otp.61.1646057870892; Mon, 28 Feb 2022 06:17:50 -0800 (PST) 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 y28-20020a4aea3c000000b0031c0cddfbf9sm4905966ood.20.2022.02.28.06.17.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 06:17:50 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v7 02/15] doc: Expand SPL docs to explain the phase and config Date: Mon, 28 Feb 2022 07:16:44 -0700 Message-Id: <20220228071651.v7.2.I0d67c4ce0fa42058bebd7a5f533f4aabbafda71b@changeid> X-Mailer: git-send-email 2.35.1.574.g5d30c73bfb-goog In-Reply-To: <20220228141657.1388834-1-sjg@chromium.org> References: <20220228141657.1388834-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean Add a bit more information about how to use SPL. Signed-off-by: Simon Glass --- (no changes since v1) doc/develop/spl.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/doc/develop/spl.rst b/doc/develop/spl.rst index 4d6f394bed..1059b2fb9c 100644 --- a/doc/develop/spl.rst +++ b/doc/develop/spl.rst @@ -66,6 +66,40 @@ CONFIG_SPL_SPI_LOAD (drivers/mtd/spi/spi_spl_load.o) CONFIG_SPL_RAM_DEVICE (common/spl/spl.c) CONFIG_SPL_WATCHDOG (drivers/watchdog/libwatchdog.o) +Adding SPL-specific code +------------------------ + +To check whether a feature is enabled, use CONFIG_IS_ENABLED():: + + if (CONFIG_IS_ENABLED(CLK)) + ... + +This checks CONFIG_CLK for the main build, CONFIG_SPL_CLK for the SPL build, +CONFIG_TPL_CLK for the TPL build, etc. + +U-Boot Phases +------------- + +U-Boot boots through the following phases: + +TPL + Very early init, as tiny as possible. This loads SPL. + +SPL + Secondary program loader. Sets up SDRAM and loads U-Boot proper. It may also + load other firmware components. + +U-Boot + U-Boot proper, containing the command line and boot logic. + + +Checking the boot phase +----------------------- + +Use `spl_phase()` to find the current U-Boot phase, e.g. `PHASE_SPL`. You can +also find the previous and next phase and get the phase name. + + Device tree ----------- The U-Boot device tree is filtered by the fdtgrep tools during the build -- 2.35.1.574.g5d30c73bfb-goog