All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
To: u-boot@lists.denx.de, uboot-stm32@st-md-mailman.stormreply.com,
	patrick.delaunay@foss.st.com
Cc: Alexandru Gagniuc <mr.nuke.me@gmail.com>,
	patrice.chotard@foss.st.com, etienne.carriere@linaro.org
Subject: [PATCH v3 01/13] spl: Untagle spl_start_uboot() from spl_mmc.c
Date: Fri,  8 Oct 2021 14:56:43 -0500	[thread overview]
Message-ID: <20211008195655.46046-2-mr.nuke.me@gmail.com> (raw)
In-Reply-To: <20211008195655.46046-1-mr.nuke.me@gmail.com>

The symbol spl_start_uboot() is provided in spl_mmc.c, but it may also
be provided by platform code.

Fireworks can be created with the following combination:

    CONFIG_SPL_OS_BOOT is not set
    CONFIG_SPL_MMC=y
    ARCH provides spl_start_uboot()

A weak implementation of spl_start_uboot() exists in spl/spl.c, so
leverage that one and stop defining the symbol in spl_mmc.c. We need
the symbol because spl_start_uboot() is called in spl_mmc.c
irrespective of the Falcon mode being activated.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
 common/spl/spl.c     | 10 ++++++----
 common/spl/spl_mmc.c |  4 ----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index a9304d4148..6232a23c9e 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -87,15 +87,17 @@ __weak int dram_init_banksize(void)
  * 0 to not start u-boot
  * positive if u-boot should start
  */
-#ifdef CONFIG_SPL_OS_BOOT
 __weak int spl_start_uboot(void)
 {
-	puts(SPL_TPL_PROMPT
-	     "Please implement spl_start_uboot() for your board\n");
-	puts(SPL_TPL_PROMPT "Direct Linux boot not active!\n");
+	if (IS_ENABLED(CONFIG_SPL_OS_BOOT)){
+		puts(SPL_TPL_PROMPT
+		     "Please implement spl_start_uboot() for your board\n");
+		puts(SPL_TPL_PROMPT "Direct Linux boot not active!\n");
+	}
 	return 1;
 }
 
+#ifdef CONFIG_SPL_OS_BOOT
 /*
  * Weak default function for arch specific zImage check. Return zero
  * and fill start and end address if image is recognized.
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index d52f8a3eef..a9a588b04f 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -252,10 +252,6 @@ static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
 	return 0;
 }
 #else
-int spl_start_uboot(void)
-{
-	return 1;
-}
 static int mmc_load_image_raw_os(struct spl_image_info *spl_image,
 				 struct mmc *mmc)
 {
-- 
2.31.1


  reply	other threads:[~2021-10-08 19:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 19:56 [PATCH v3 00/13] stm32mp1: Support falcon mode with OP-TEE payloads Alexandru Gagniuc
2021-10-08 19:56 ` Alexandru Gagniuc [this message]
2021-10-08 19:56 ` [PATCH v3 02/13] spl: Move SYS_MMCSD_RAW_MODE_KERNEL_SECTOR to Kconfig Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 03/13] stm32mp1: Add support for baudrates higher than 115200 Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 04/13] stm32mp1: Add support for falcon mode boot from SD card Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 05/13] board: stm32mp1: Implement board_fit_config_name_match() for SPL Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 06/13] fdt_support: Implement fdt_ethernet_set_macaddr() Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 07/13] arm: stm32mp: bsec: Update OTP shadow registers in SPL Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 08/13] arm: stm32mp: Factor out reading MAC address from OTP Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 09/13] stm32mp1: spl: Configure MAC address when booting OP-TEE Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 10/13] lib: Makefile: Make optee library available in SPL Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 11/13] ARM: dts: stm32mp: Add OP-TEE "/firmware" node to SPL dtb Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 12/13] stm32mp1: spl: Copy optee nodes to target FDT for OP-TEE payloads Alexandru Gagniuc
2021-10-08 19:56 ` [PATCH v3 13/13] ARM: dts: stm32mp: dts: Don't remove OPTEE nodes for DK2 boards Alexandru Gagniuc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211008195655.46046-2-mr.nuke.me@gmail.com \
    --to=mr.nuke.me@gmail.com \
    --cc=etienne.carriere@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-stm32@st-md-mailman.stormreply.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.