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=-20.2 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, URIBL_BLOCKED,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 9B72AC433EF for ; Sun, 19 Sep 2021 23:49:11 +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 AE12D61028 for ; Sun, 19 Sep 2021 23:49:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AE12D61028 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1842583273; Mon, 20 Sep 2021 01:48:54 +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="gY3njx4p"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5A99483270; Mon, 20 Sep 2021 01:48:36 +0200 (CEST) Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) (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 750EB8290A for ; Mon, 20 Sep 2021 01:48:28 +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-xd2c.google.com with SMTP id r75so2109191iod.7 for ; Sun, 19 Sep 2021 16:48:28 -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=eHwtRCNwMcWuv6PmxzuQRQtdNoeXkJZ3zpYMLrL95PY=; b=gY3njx4pGlLJn97crqd0CbCDl0FAczcB4MMaYa280q/RB74F35QXoDu+KOv+JrUosc r1+AfPKlQUH5M9GMFpUC5M9Up5QRyxOp1VCwOGE+NuTJBD8Cvnbikutgwz8xepYZJbMZ ttE5cmF/8hurbxN4cu2GbmXV7fJXMyYkOtPx8= 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=eHwtRCNwMcWuv6PmxzuQRQtdNoeXkJZ3zpYMLrL95PY=; b=YfyJc8Xa0jmH67RKzDms+izDufMdXsCcR8NV4NJZ87wYe/XN8/bHrTfp5B9DDy++b2 WIyzS5HvXJrOly9gFiLJezGl3F+fNIHQH4ERBX9CMx/OK7YrvF6bM8eKCtI/cApBn1no GEPPTuoIkUJ6x7XZY3u5ZNF5GYlqNiO0MsB02E/5GO5YKCk6n6Vkb4Ra50aGONDs+n/k sPn4X7FDDzPgaehFvtzG3YKrcGnt2YBP1WY5scS2vxsgRPuhVqvKdMGrTcTp19Lo/anN vuXsZZC2sAzirUUISl0e/2A2joGXWG8ZXNXJ0DDGIFstN73SxBfDJ3BPir/BRXgkfkhK 2CvQ== X-Gm-Message-State: AOAM530wD/Yyn3mUXlhQnXHd4CLOOkEJI+E8vhTlzddt2eEZ69Y9ahCk pIEYjGrCsojIvYhvtqRULYezrux6BYQHzg== X-Google-Smtp-Source: ABdhPJwpScPP6c8KlvO9u6APrdA2w+JQ1DWJECO2bfPvcbyekYhxYklBMMFBxWR6lPbtengRBDLEvA== X-Received: by 2002:a5e:c807:: with SMTP id y7mr16206976iol.87.1632095306693; Sun, 19 Sep 2021 16:48:26 -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 y6sm7854441ilv.71.2021.09.19.16.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Sep 2021 16:48:26 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v6 02/11] doc: Expand SPL docs to explain the phase and config Date: Sun, 19 Sep 2021 17:48:11 -0600 Message-Id: <20210919174815.v6.2.I0d67c4ce0fa42058bebd7a5f533f4aabbafda71b@changeid> X-Mailer: git-send-email 2.33.0.464.g1972c5931b-goog In-Reply-To: <20210919234820.3840570-1-sjg@chromium.org> References: <20210919234820.3840570-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 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 c7d08d22bf2..0fb1e1d9784 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.33.0.464.g1972c5931b-goog