u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 u-boot-mvebu 0/4] arm: mvebu: Fix eMMC boot
@ 2023-04-13 20:57 Pali Rohár
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 1/4] tools: kwboot: Fix MMC partitions documentation Pali Rohár
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Pali Rohár @ 2023-04-13 20:57 UTC (permalink / raw)
  To: Stefan Roese; +Cc: Martin Rowe, u-boot

Boot configuration stored in EXT_CSD[179] register is completely ignored by BootROM:
https://lore.kernel.org/u-boot/CAOAjy5SYPPzWKok-BSGYwZwcKOQt_aZPgh6FTbrFd3F=8DM5ZQ@mail.gmail.com/

Instead eMMC partition use for booting has to be extracted from Partition access bits:
https://lore.kernel.org/u-boot/CAOAjy5SNrLJ=JAKf96Nf7HkFBXWbZLmWAhEs6nEEHS6UEhQbJw@mail.gmail.com/

Reflect this eMMC booting in documentation and in the code.

This patch series does not address 5 minutes timeout as nobody reacted to the email:
https://lore.kernel.org/u-boot/20230401164345.iwfu7nd5jgbjtpzl@pali/

Pali Rohár (4):
  tools: kwboot: Fix MMC partitions documentation
  mmc: Read eMMC partition access bits before card reset
  arm: mvebu: spl: Load proper U-Boot from correct eMMC partition
  arm: mvebu: clearfog: Update eMMC/SD/SATA instructions

 arch/arm/mach-mvebu/spl.c      | 10 ++++++++--
 board/solidrun/clearfog/README | 20 ++++++++++----------
 drivers/mmc/mmc.c              | 31 ++++++++++++++++++++++++++++---
 tools/kwboot.c                 |  9 ++++++---
 4 files changed, 52 insertions(+), 18 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 u-boot-mvebu 1/4] tools: kwboot: Fix MMC partitions documentation
  2023-04-13 20:57 [PATCH v2 u-boot-mvebu 0/4] arm: mvebu: Fix eMMC boot Pali Rohár
@ 2023-04-13 20:57 ` Pali Rohár
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 2/4] mmc: Read eMMC partition access bits before card reset Pali Rohár
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Pali Rohár @ 2023-04-13 20:57 UTC (permalink / raw)
  To: Stefan Roese; +Cc: Martin Rowe, u-boot

Boot configuration stored in EXT_CSD_PART_CONF register is completely
ignored by BootROM.

Fixes: fa03279e198d ("tools: kwboot: Add image type documentation")
Signed-off-by: Pali Rohár <pali@kernel.org>
---
 tools/kwboot.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/kwboot.c b/tools/kwboot.c
index 6bef4610ff8f..550d2494ff68 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -119,9 +119,12 @@
  *   1024 bytes long sector sizes and also can be changed at runtime.
  *
  *   For MMC-compatible devices, image can be stored at offset 0 or at offset
- *   2 MB. If MMC device supports HW boot partitions then image must be stored
- *   on the HW partition as is configured in the EXT_CSC register (it can be
- *   either boot or user data).
+ *   2 MB. If eMMC device supports HW/boot partitions then image is read from
+ *   partitions in following order: Boot 1, Boot 2, RPMB, GP 1, GP 2, GP 3,
+ *   GP 4, User Data, Boot 1, Boot 2. (Boot 1 and Boot 2 are really repeated).
+ *   Boot configuration stored in EXT_CSD_PART_CONF eMMC register is completely
+ *   ignored by the BootROM. But it sets PARTITION_ACCESS bits of that register
+ *   to the selected partition from which it loaded image.
  *
  *   Note that source address for SDIO image is stored in byte unit, like for
  *   any other images (except SATA). Marvell Functional Specifications for
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 u-boot-mvebu 2/4] mmc: Read eMMC partition access bits before card reset
  2023-04-13 20:57 [PATCH v2 u-boot-mvebu 0/4] arm: mvebu: Fix eMMC boot Pali Rohár
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 1/4] tools: kwboot: Fix MMC partitions documentation Pali Rohár
@ 2023-04-13 20:57 ` Pali Rohár
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 3/4] arm: mvebu: spl: Load proper U-Boot from correct eMMC partition Pali Rohár
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions Pali Rohár
  3 siblings, 0 replies; 14+ messages in thread
From: Pali Rohár @ 2023-04-13 20:57 UTC (permalink / raw)
  To: Stefan Roese; +Cc: Martin Rowe, u-boot

eMMC specification in section "Access partitions" says that all reset
events will restore the access bits in PARTITION_CONFIG CSD register to
default User Data Area value (0b000).

So read partition access bits from PARTITION_CONFIG CSD register before
issuing card reset. This allows SPL/U-Boot to get information which eMMC
partition was in use before SPL/U-Boot was booted. For some platforms this
is the way how to determinate boot partition from which BootROM loaded SPL.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 drivers/mmc/mmc.c | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index dde251c87bc7..771432de354d 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2329,8 +2329,17 @@ static int mmc_startup_v4(struct mmc *mmc)
 	/* store the partition info of emmc */
 	mmc->part_support = ext_csd[EXT_CSD_PARTITIONING_SUPPORT];
 	if ((ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & PART_SUPPORT) ||
-	    ext_csd[EXT_CSD_BOOT_MULT])
-		mmc->part_config = ext_csd[EXT_CSD_PART_CONF];
+	    ext_csd[EXT_CSD_BOOT_MULT]) {
+		/*
+		 * At this stage PART_ACCESS_MASK bits in ext_csd[] are already cleared.
+		 * But it is possible that they were already filled into mmc->part_config.
+		 */
+		if (mmc->part_config == MMCPART_NOAVAILABLE)
+			mmc->part_config = ext_csd[EXT_CSD_PART_CONF];
+		else
+			mmc->part_config = (ext_csd[EXT_CSD_PART_CONF] & ~PART_ACCESS_MASK) |
+					   (mmc->part_config & PART_ACCESS_MASK);
+	}
 	if (part_completed &&
 	    (ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & ENHNCD_SUPPORT))
 		mmc->part_attr = ext_csd[EXT_CSD_PARTITIONS_ATTRIBUTE];
@@ -2600,7 +2609,6 @@ static int mmc_startup(struct mmc *mmc)
 #if CONFIG_IS_ENABLED(MMC_WRITE)
 	mmc->erase_grp_size = 1;
 #endif
-	mmc->part_config = MMCPART_NOAVAILABLE;
 
 	err = mmc_startup_v4(mmc);
 	if (err)
@@ -2848,9 +2856,26 @@ int mmc_get_op_cond(struct mmc *mmc, bool quiet)
 		return err;
 	mmc->ddr_mode = 0;
 
+	mmc->part_config = MMCPART_NOAVAILABLE;
+
 retry:
 	mmc_set_initial_state(mmc);
 
+	/*
+	 * Read partition access bits from partition config register before card reset command
+	 * because these bits are reset to default value (User Data Area) during card reset.
+	 * This allows us to preserve original value of partition access bits used by the code
+	 * which loaded us (for example BootROM) and use it for board specific boot purposes.
+	 */
+	if (mmc->part_config == MMCPART_NOAVAILABLE) {
+		ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
+		err = mmc_send_ext_csd(mmc, ext_csd);
+		if (err == 0 &&
+		    ((ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & PART_SUPPORT) ||
+		     ext_csd[EXT_CSD_BOOT_MULT]))
+			mmc->part_config = ext_csd[EXT_CSD_PART_CONF] & PART_ACCESS_MASK;
+	}
+
 	/* Reset the Card */
 	err = mmc_go_idle(mmc);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 u-boot-mvebu 3/4] arm: mvebu: spl: Load proper U-Boot from correct eMMC partition
  2023-04-13 20:57 [PATCH v2 u-boot-mvebu 0/4] arm: mvebu: Fix eMMC boot Pali Rohár
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 1/4] tools: kwboot: Fix MMC partitions documentation Pali Rohár
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 2/4] mmc: Read eMMC partition access bits before card reset Pali Rohár
@ 2023-04-13 20:57 ` Pali Rohár
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions Pali Rohár
  3 siblings, 0 replies; 14+ messages in thread
From: Pali Rohár @ 2023-04-13 20:57 UTC (permalink / raw)
  To: Stefan Roese; +Cc: Martin Rowe, u-boot

A38x BootROM completely ignores EXT_CSD_PART_CONF eMMC register and tries
to load SPL from any partition in defined order. Chosen partition can be
determined from the access bits in EXT_CSD_PART_CONF eMMC register.

So implement custom spl_mmc_emmc_boot_partition() function to always
returns eMMC partition from which BootROM loaded SPL. So this partition
would be used for loading proper U-Boot too.

Fixes: 2f27db2fbd6e ("arm: mvebu: spl: Load proper U-Boot from selected eMMC boot partition")
Signed-off-by: Pali Rohár <pali@kernel.org>
---
 arch/arm/mach-mvebu/spl.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
index 379daa88a4d8..0688601699f0 100644
--- a/arch/arm/mach-mvebu/spl.c
+++ b/arch/arm/mach-mvebu/spl.c
@@ -11,6 +11,7 @@
 #include <image.h>
 #include <init.h>
 #include <log.h>
+#include <mmc.h>
 #include <spl.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
@@ -34,8 +35,9 @@
 
 /*
  * When loading U-Boot via SPL from eMMC, the kwbimage main header is stored at
- * sector 0 and either on HW boot partition or on data partition. Choice of HW
- * partition depends on what is configured in eMMC EXT_CSC register.
+ * sector 0 on some HW/boot partition. Choice of HW partition depends on what is
+ * set in PART_ACCESS_MASK bits of EXT_CSD_PART_CONF eMMC register. Partition
+ * access bits into EXT_CSD_PART_CONF are set by the BootROM.
  * When loading U-Boot via SPL from SD card, the kwbimage main header is stored
  * at sector 1.
  * Therefore MBR/GPT partition booting, fixed sector number and fixed eMMC HW
@@ -123,6 +125,10 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
 {
 	return IS_SD(mmc) ? MMCSD_MODE_RAW : MMCSD_MODE_EMMCBOOT;
 }
+int spl_mmc_emmc_boot_partition(struct mmc *mmc)
+{
+	return EXT_CSD_EXTRACT_PARTITION_ACCESS(mmc->part_config);
+}
 unsigned long spl_mmc_get_uboot_raw_sector(struct mmc *mmc,
 					   unsigned long raw_sect)
 {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-04-13 20:57 [PATCH v2 u-boot-mvebu 0/4] arm: mvebu: Fix eMMC boot Pali Rohár
                   ` (2 preceding siblings ...)
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 3/4] arm: mvebu: spl: Load proper U-Boot from correct eMMC partition Pali Rohár
@ 2023-04-13 20:57 ` Pali Rohár
  2023-04-13 22:43   ` Martin Rowe
  3 siblings, 1 reply; 14+ messages in thread
From: Pali Rohár @ 2023-04-13 20:57 UTC (permalink / raw)
  To: Stefan Roese; +Cc: Martin Rowe, u-boot

BootROM and neither SPL does not use eMMC boot acknowledgement or boot
enable bits in EXT_CSD_PART_CONF eMMC register. And also fixed SATA disk
sector 0x141 is not used at all.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 board/solidrun/clearfog/README | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/board/solidrun/clearfog/README b/board/solidrun/clearfog/README
index ed4a712c5aa2..c86b37061a30 100644
--- a/board/solidrun/clearfog/README
+++ b/board/solidrun/clearfog/README
@@ -1,7 +1,7 @@
 Update from original Marvell U-Boot to mainline U-Boot:
 -------------------------------------------------------
 
-Generate the U-Boot image with these commands:
+Generate the U-Boot image for eMMC/SD with these commands:
 
 $ make clearfog_defconfig
 $ make
@@ -9,7 +9,7 @@ $ make
 The resulting image including the SPL binary with the
 full DDR setup is "u-boot-with-spl.kwb".
 
-Now all you need to do is copy this image on a SD card.
+Now all you need to do is copy this image on a SD card's sector 1.
 For example with this command:
 
 $ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
@@ -20,12 +20,6 @@ of "/dev/sdX" here!
 Install U-Boot on eMMC:
 -----------------------
 
-To make SPL load the main U-Boot image from the eMMC boot partition enable
-eMMC boot acknowledgement and boot partition with the following U-Boot
-command:
-
-  mmc partconf 0 1 1 0
-
 Install U-Boot on eMMC boot partition from Linux running on Clearfog:
 
   echo 0 > /sys/block/mmcblk0boot0/force_ro
@@ -37,8 +31,14 @@ Consider initial boot from UART (see below).
 Install U-Boot on SATA:
 -----------------------
 
-When loading the main U-Boot image from raw SATA sector, set
-CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
+Generate the U-Boot image for SATA with these commands:
+
+$ make clearfog_sata_defconfig
+$ make
+
+Copy image on a SATA disk's sector 1:
+
+$ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
 
 Boot selection:
 ---------------
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions Pali Rohár
@ 2023-04-13 22:43   ` Martin Rowe
  2023-04-26 23:44     ` Pali Rohár
  0 siblings, 1 reply; 14+ messages in thread
From: Martin Rowe @ 2023-04-13 22:43 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Stefan Roese, u-boot

On Thu, 13 Apr 2023 at 20:58, Pali Rohár <pali@kernel.org> wrote:
>
> BootROM and neither SPL does not use eMMC boot acknowledgement or boot
> enable bits in EXT_CSD_PART_CONF eMMC register. And also fixed SATA disk
> sector 0x141 is not used at all.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>

SPL successfully loads u-boot from the same partition as SPL. SD card
and UART continue to boot.

Thanks Pali!

Tested-by: Martin Rowe <martin.p.rowe@gmail.com>

> ---
>  board/solidrun/clearfog/README | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/board/solidrun/clearfog/README b/board/solidrun/clearfog/README
> index ed4a712c5aa2..c86b37061a30 100644
> --- a/board/solidrun/clearfog/README
> +++ b/board/solidrun/clearfog/README
> @@ -1,7 +1,7 @@
>  Update from original Marvell U-Boot to mainline U-Boot:
>  -------------------------------------------------------
>
> -Generate the U-Boot image with these commands:
> +Generate the U-Boot image for eMMC/SD with these commands:
>
>  $ make clearfog_defconfig
>  $ make
> @@ -9,7 +9,7 @@ $ make
>  The resulting image including the SPL binary with the
>  full DDR setup is "u-boot-with-spl.kwb".
>
> -Now all you need to do is copy this image on a SD card.
> +Now all you need to do is copy this image on a SD card's sector 1.
>  For example with this command:
>
>  $ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
> @@ -20,12 +20,6 @@ of "/dev/sdX" here!
>  Install U-Boot on eMMC:
>  -----------------------
>
> -To make SPL load the main U-Boot image from the eMMC boot partition enable
> -eMMC boot acknowledgement and boot partition with the following U-Boot
> -command:
> -
> -  mmc partconf 0 1 1 0
> -
>  Install U-Boot on eMMC boot partition from Linux running on Clearfog:
>
>    echo 0 > /sys/block/mmcblk0boot0/force_ro
> @@ -37,8 +31,14 @@ Consider initial boot from UART (see below).
>  Install U-Boot on SATA:
>  -----------------------
>
> -When loading the main U-Boot image from raw SATA sector, set
> -CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
> +Generate the U-Boot image for SATA with these commands:
> +
> +$ make clearfog_sata_defconfig
> +$ make
> +
> +Copy image on a SATA disk's sector 1:
> +
> +$ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>
>  Boot selection:
>  ---------------
> --
> 2.20.1
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-04-13 22:43   ` Martin Rowe
@ 2023-04-26 23:44     ` Pali Rohár
  2023-04-27  8:56       ` Stefan Roese
  0 siblings, 1 reply; 14+ messages in thread
From: Pali Rohár @ 2023-04-26 23:44 UTC (permalink / raw)
  To: Martin Rowe; +Cc: Stefan Roese, u-boot

On Thursday 13 April 2023 22:43:25 Martin Rowe wrote:
> On Thu, 13 Apr 2023 at 20:58, Pali Rohár <pali@kernel.org> wrote:
> >
> > BootROM and neither SPL does not use eMMC boot acknowledgement or boot
> > enable bits in EXT_CSD_PART_CONF eMMC register. And also fixed SATA disk
> > sector 0x141 is not used at all.
> >
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> 
> SPL successfully loads u-boot from the same partition as SPL. SD card
> and UART continue to boot.
> 
> Thanks Pali!
> 
> Tested-by: Martin Rowe <martin.p.rowe@gmail.com>

Ok, is something more needed for this patch series?

> > ---
> >  board/solidrun/clearfog/README | 20 ++++++++++----------
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/board/solidrun/clearfog/README b/board/solidrun/clearfog/README
> > index ed4a712c5aa2..c86b37061a30 100644
> > --- a/board/solidrun/clearfog/README
> > +++ b/board/solidrun/clearfog/README
> > @@ -1,7 +1,7 @@
> >  Update from original Marvell U-Boot to mainline U-Boot:
> >  -------------------------------------------------------
> >
> > -Generate the U-Boot image with these commands:
> > +Generate the U-Boot image for eMMC/SD with these commands:
> >
> >  $ make clearfog_defconfig
> >  $ make
> > @@ -9,7 +9,7 @@ $ make
> >  The resulting image including the SPL binary with the
> >  full DDR setup is "u-boot-with-spl.kwb".
> >
> > -Now all you need to do is copy this image on a SD card.
> > +Now all you need to do is copy this image on a SD card's sector 1.
> >  For example with this command:
> >
> >  $ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
> > @@ -20,12 +20,6 @@ of "/dev/sdX" here!
> >  Install U-Boot on eMMC:
> >  -----------------------
> >
> > -To make SPL load the main U-Boot image from the eMMC boot partition enable
> > -eMMC boot acknowledgement and boot partition with the following U-Boot
> > -command:
> > -
> > -  mmc partconf 0 1 1 0
> > -
> >  Install U-Boot on eMMC boot partition from Linux running on Clearfog:
> >
> >    echo 0 > /sys/block/mmcblk0boot0/force_ro
> > @@ -37,8 +31,14 @@ Consider initial boot from UART (see below).
> >  Install U-Boot on SATA:
> >  -----------------------
> >
> > -When loading the main U-Boot image from raw SATA sector, set
> > -CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
> > +Generate the U-Boot image for SATA with these commands:
> > +
> > +$ make clearfog_sata_defconfig
> > +$ make
> > +
> > +Copy image on a SATA disk's sector 1:
> > +
> > +$ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
> >
> >  Boot selection:
> >  ---------------
> > --
> > 2.20.1
> >

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-04-26 23:44     ` Pali Rohár
@ 2023-04-27  8:56       ` Stefan Roese
  2023-04-29 11:08         ` Pali Rohár
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Roese @ 2023-04-27  8:56 UTC (permalink / raw)
  To: Pali Rohár, Martin Rowe
  Cc: u-boot, Sergiu Moga, Tudor Ambarus, Eugen Hristev

Hi Pali,

On 4/27/23 01:44, Pali Rohár wrote:
> On Thursday 13 April 2023 22:43:25 Martin Rowe wrote:
>> On Thu, 13 Apr 2023 at 20:58, Pali Rohár <pali@kernel.org> wrote:
>>>
>>> BootROM and neither SPL does not use eMMC boot acknowledgement or boot
>>> enable bits in EXT_CSD_PART_CONF eMMC register. And also fixed SATA disk
>>> sector 0x141 is not used at all.
>>>
>>> Signed-off-by: Pali Rohár <pali@kernel.org>
>>
>> SPL successfully loads u-boot from the same partition as SPL. SD card
>> and UART continue to boot.
>>
>> Thanks Pali!
>>
>> Tested-by: Martin Rowe <martin.p.rowe@gmail.com>
> 
> Ok, is something more needed for this patch series?

Unfortunately yes. As at least this board breaks with this patchset
added:

$ make sama5d2_icp_mmc_defconfig
$ make -sj
/opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd: 
u-boot-spl section `__u_boot_list' will not fit in region `.sram'
/opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd: 
region `.sram' overflowed by 32 bytes
make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
make: *** [Makefile:2049: spl/u-boot-spl] Error 2

So CI build fails and I can't send a pull request. I'm sending a patch
though, to fix this image overflow by enabling LTO. Stay tuned...

Thanks,
Stefan

>>> ---
>>>   board/solidrun/clearfog/README | 20 ++++++++++----------
>>>   1 file changed, 10 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/board/solidrun/clearfog/README b/board/solidrun/clearfog/README
>>> index ed4a712c5aa2..c86b37061a30 100644
>>> --- a/board/solidrun/clearfog/README
>>> +++ b/board/solidrun/clearfog/README
>>> @@ -1,7 +1,7 @@
>>>   Update from original Marvell U-Boot to mainline U-Boot:
>>>   -------------------------------------------------------
>>>
>>> -Generate the U-Boot image with these commands:
>>> +Generate the U-Boot image for eMMC/SD with these commands:
>>>
>>>   $ make clearfog_defconfig
>>>   $ make
>>> @@ -9,7 +9,7 @@ $ make
>>>   The resulting image including the SPL binary with the
>>>   full DDR setup is "u-boot-with-spl.kwb".
>>>
>>> -Now all you need to do is copy this image on a SD card.
>>> +Now all you need to do is copy this image on a SD card's sector 1.
>>>   For example with this command:
>>>
>>>   $ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>> @@ -20,12 +20,6 @@ of "/dev/sdX" here!
>>>   Install U-Boot on eMMC:
>>>   -----------------------
>>>
>>> -To make SPL load the main U-Boot image from the eMMC boot partition enable
>>> -eMMC boot acknowledgement and boot partition with the following U-Boot
>>> -command:
>>> -
>>> -  mmc partconf 0 1 1 0
>>> -
>>>   Install U-Boot on eMMC boot partition from Linux running on Clearfog:
>>>
>>>     echo 0 > /sys/block/mmcblk0boot0/force_ro
>>> @@ -37,8 +31,14 @@ Consider initial boot from UART (see below).
>>>   Install U-Boot on SATA:
>>>   -----------------------
>>>
>>> -When loading the main U-Boot image from raw SATA sector, set
>>> -CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
>>> +Generate the U-Boot image for SATA with these commands:
>>> +
>>> +$ make clearfog_sata_defconfig
>>> +$ make
>>> +
>>> +Copy image on a SATA disk's sector 1:
>>> +
>>> +$ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>>
>>>   Boot selection:
>>>   ---------------
>>> --
>>> 2.20.1
>>>

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-04-27  8:56       ` Stefan Roese
@ 2023-04-29 11:08         ` Pali Rohár
  2023-05-03  9:17           ` Stefan Roese
  0 siblings, 1 reply; 14+ messages in thread
From: Pali Rohár @ 2023-04-29 11:08 UTC (permalink / raw)
  To: Stefan Roese
  Cc: Martin Rowe, u-boot, Sergiu Moga, Tudor Ambarus, Eugen Hristev

On Thursday 27 April 2023 10:56:17 Stefan Roese wrote:
> Hi Pali,
> 
> On 4/27/23 01:44, Pali Rohár wrote:
> > On Thursday 13 April 2023 22:43:25 Martin Rowe wrote:
> > > On Thu, 13 Apr 2023 at 20:58, Pali Rohár <pali@kernel.org> wrote:
> > > > 
> > > > BootROM and neither SPL does not use eMMC boot acknowledgement or boot
> > > > enable bits in EXT_CSD_PART_CONF eMMC register. And also fixed SATA disk
> > > > sector 0x141 is not used at all.
> > > > 
> > > > Signed-off-by: Pali Rohár <pali@kernel.org>
> > > 
> > > SPL successfully loads u-boot from the same partition as SPL. SD card
> > > and UART continue to boot.
> > > 
> > > Thanks Pali!
> > > 
> > > Tested-by: Martin Rowe <martin.p.rowe@gmail.com>
> > 
> > Ok, is something more needed for this patch series?
> 
> Unfortunately yes. As at least this board breaks with this patchset
> added:
> 
> $ make sama5d2_icp_mmc_defconfig
> $ make -sj
> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
> u-boot-spl section `__u_boot_list' will not fit in region `.sram'
> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
> region `.sram' overflowed by 32 bytes
> make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
> make: *** [Makefile:2049: spl/u-boot-spl] Error 2
> 
> So CI build fails and I can't send a pull request. I'm sending a patch
> though, to fix this image overflow by enabling LTO. Stay tuned...

I see... LTO helped. So can be this patch series now applied?

> Thanks,
> Stefan
> 
> > > > ---
> > > >   board/solidrun/clearfog/README | 20 ++++++++++----------
> > > >   1 file changed, 10 insertions(+), 10 deletions(-)
> > > > 
> > > > diff --git a/board/solidrun/clearfog/README b/board/solidrun/clearfog/README
> > > > index ed4a712c5aa2..c86b37061a30 100644
> > > > --- a/board/solidrun/clearfog/README
> > > > +++ b/board/solidrun/clearfog/README
> > > > @@ -1,7 +1,7 @@
> > > >   Update from original Marvell U-Boot to mainline U-Boot:
> > > >   -------------------------------------------------------
> > > > 
> > > > -Generate the U-Boot image with these commands:
> > > > +Generate the U-Boot image for eMMC/SD with these commands:
> > > > 
> > > >   $ make clearfog_defconfig
> > > >   $ make
> > > > @@ -9,7 +9,7 @@ $ make
> > > >   The resulting image including the SPL binary with the
> > > >   full DDR setup is "u-boot-with-spl.kwb".
> > > > 
> > > > -Now all you need to do is copy this image on a SD card.
> > > > +Now all you need to do is copy this image on a SD card's sector 1.
> > > >   For example with this command:
> > > > 
> > > >   $ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
> > > > @@ -20,12 +20,6 @@ of "/dev/sdX" here!
> > > >   Install U-Boot on eMMC:
> > > >   -----------------------
> > > > 
> > > > -To make SPL load the main U-Boot image from the eMMC boot partition enable
> > > > -eMMC boot acknowledgement and boot partition with the following U-Boot
> > > > -command:
> > > > -
> > > > -  mmc partconf 0 1 1 0
> > > > -
> > > >   Install U-Boot on eMMC boot partition from Linux running on Clearfog:
> > > > 
> > > >     echo 0 > /sys/block/mmcblk0boot0/force_ro
> > > > @@ -37,8 +31,14 @@ Consider initial boot from UART (see below).
> > > >   Install U-Boot on SATA:
> > > >   -----------------------
> > > > 
> > > > -When loading the main U-Boot image from raw SATA sector, set
> > > > -CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
> > > > +Generate the U-Boot image for SATA with these commands:
> > > > +
> > > > +$ make clearfog_sata_defconfig
> > > > +$ make
> > > > +
> > > > +Copy image on a SATA disk's sector 1:
> > > > +
> > > > +$ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
> > > > 
> > > >   Boot selection:
> > > >   ---------------
> > > > --
> > > > 2.20.1
> > > > 
> 
> Viele Grüße,
> Stefan Roese
> 
> -- 
> DENX Software Engineering GmbH,      Managing Director: Erika Unter
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-04-29 11:08         ` Pali Rohár
@ 2023-05-03  9:17           ` Stefan Roese
  2023-05-03  9:43             ` Eugen Hristev
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Roese @ 2023-05-03  9:17 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Martin Rowe, u-boot, Sergiu Moga, Tudor Ambarus, Eugen Hristev

On 4/29/23 13:08, Pali Rohár wrote:
> On Thursday 27 April 2023 10:56:17 Stefan Roese wrote:
>> Hi Pali,
>>
>> On 4/27/23 01:44, Pali Rohár wrote:
>>> On Thursday 13 April 2023 22:43:25 Martin Rowe wrote:
>>>> On Thu, 13 Apr 2023 at 20:58, Pali Rohár <pali@kernel.org> wrote:
>>>>>
>>>>> BootROM and neither SPL does not use eMMC boot acknowledgement or boot
>>>>> enable bits in EXT_CSD_PART_CONF eMMC register. And also fixed SATA disk
>>>>> sector 0x141 is not used at all.
>>>>>
>>>>> Signed-off-by: Pali Rohár <pali@kernel.org>
>>>>
>>>> SPL successfully loads u-boot from the same partition as SPL. SD card
>>>> and UART continue to boot.
>>>>
>>>> Thanks Pali!
>>>>
>>>> Tested-by: Martin Rowe <martin.p.rowe@gmail.com>
>>>
>>> Ok, is something more needed for this patch series?
>>
>> Unfortunately yes. As at least this board breaks with this patchset
>> added:
>>
>> $ make sama5d2_icp_mmc_defconfig
>> $ make -sj
>> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
>> u-boot-spl section `__u_boot_list' will not fit in region `.sram'
>> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
>> region `.sram' overflowed by 32 bytes
>> make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
>> make: *** [Makefile:2049: spl/u-boot-spl] Error 2
>>
>> So CI build fails and I can't send a pull request. I'm sending a patch
>> though, to fix this image overflow by enabling LTO. Stay tuned...
> 
> I see... LTO helped. So can be this patch series now applied?

No problems with this series now in master, so:

Applied to u-boot-marvell/master

Thanks,
Stefan

>> Thanks,
>> Stefan
>>
>>>>> ---
>>>>>    board/solidrun/clearfog/README | 20 ++++++++++----------
>>>>>    1 file changed, 10 insertions(+), 10 deletions(-)
>>>>>
>>>>> diff --git a/board/solidrun/clearfog/README b/board/solidrun/clearfog/README
>>>>> index ed4a712c5aa2..c86b37061a30 100644
>>>>> --- a/board/solidrun/clearfog/README
>>>>> +++ b/board/solidrun/clearfog/README
>>>>> @@ -1,7 +1,7 @@
>>>>>    Update from original Marvell U-Boot to mainline U-Boot:
>>>>>    -------------------------------------------------------
>>>>>
>>>>> -Generate the U-Boot image with these commands:
>>>>> +Generate the U-Boot image for eMMC/SD with these commands:
>>>>>
>>>>>    $ make clearfog_defconfig
>>>>>    $ make
>>>>> @@ -9,7 +9,7 @@ $ make
>>>>>    The resulting image including the SPL binary with the
>>>>>    full DDR setup is "u-boot-with-spl.kwb".
>>>>>
>>>>> -Now all you need to do is copy this image on a SD card.
>>>>> +Now all you need to do is copy this image on a SD card's sector 1.
>>>>>    For example with this command:
>>>>>
>>>>>    $ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>>>> @@ -20,12 +20,6 @@ of "/dev/sdX" here!
>>>>>    Install U-Boot on eMMC:
>>>>>    -----------------------
>>>>>
>>>>> -To make SPL load the main U-Boot image from the eMMC boot partition enable
>>>>> -eMMC boot acknowledgement and boot partition with the following U-Boot
>>>>> -command:
>>>>> -
>>>>> -  mmc partconf 0 1 1 0
>>>>> -
>>>>>    Install U-Boot on eMMC boot partition from Linux running on Clearfog:
>>>>>
>>>>>      echo 0 > /sys/block/mmcblk0boot0/force_ro
>>>>> @@ -37,8 +31,14 @@ Consider initial boot from UART (see below).
>>>>>    Install U-Boot on SATA:
>>>>>    -----------------------
>>>>>
>>>>> -When loading the main U-Boot image from raw SATA sector, set
>>>>> -CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
>>>>> +Generate the U-Boot image for SATA with these commands:
>>>>> +
>>>>> +$ make clearfog_sata_defconfig
>>>>> +$ make
>>>>> +
>>>>> +Copy image on a SATA disk's sector 1:
>>>>> +
>>>>> +$ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>>>>
>>>>>    Boot selection:
>>>>>    ---------------
>>>>> --
>>>>> 2.20.1
>>>>>
>>
>> Viele Grüße,
>> Stefan Roese
>>
>> -- 
>> DENX Software Engineering GmbH,      Managing Director: Erika Unter
>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-05-03  9:17           ` Stefan Roese
@ 2023-05-03  9:43             ` Eugen Hristev
  2023-05-03  9:57               ` Stefan Roese
  0 siblings, 1 reply; 14+ messages in thread
From: Eugen Hristev @ 2023-05-03  9:43 UTC (permalink / raw)
  To: Stefan Roese, Pali Rohár; +Cc: Martin Rowe, u-boot

On 5/3/23 12:17, Stefan Roese wrote:
> On 4/29/23 13:08, Pali Rohár wrote:
>> On Thursday 27 April 2023 10:56:17 Stefan Roese wrote:
>>> Hi Pali,
>>>
>>> On 4/27/23 01:44, Pali Rohár wrote:
>>>> On Thursday 13 April 2023 22:43:25 Martin Rowe wrote:
>>>>> On Thu, 13 Apr 2023 at 20:58, Pali Rohár <pali@kernel.org> wrote:
>>>>>>
>>>>>> BootROM and neither SPL does not use eMMC boot acknowledgement or 
>>>>>> boot
>>>>>> enable bits in EXT_CSD_PART_CONF eMMC register. And also fixed 
>>>>>> SATA disk
>>>>>> sector 0x141 is not used at all.
>>>>>>
>>>>>> Signed-off-by: Pali Rohár <pali@kernel.org>
>>>>>
>>>>> SPL successfully loads u-boot from the same partition as SPL. SD card
>>>>> and UART continue to boot.
>>>>>
>>>>> Thanks Pali!
>>>>>
>>>>> Tested-by: Martin Rowe <martin.p.rowe@gmail.com>
>>>>
>>>> Ok, is something more needed for this patch series?
>>>
>>> Unfortunately yes. As at least this board breaks with this patchset
>>> added:
>>>
>>> $ make sama5d2_icp_mmc_defconfig
>>> $ make -sj
>>> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
>>> u-boot-spl section `__u_boot_list' will not fit in region `.sram'
>>> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
>>> region `.sram' overflowed by 32 bytes
>>> make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
>>> make: *** [Makefile:2049: spl/u-boot-spl] Error 2
>>>
>>> So CI build fails and I can't send a pull request. I'm sending a patch
>>> though, to fix this image overflow by enabling LTO. Stay tuned...
>>
>> I see... LTO helped. So can be this patch series now applied?
> 
> No problems with this series now in master, so:
> 
> Applied to u-boot-marvell/master

Hi Stefan,

This patch is still pending as it was not tested by anyone yet :

https://patchwork.ozlabs.org/project/uboot/patch/20230427085945.475619-1-sr@denx.de/

so , this series still breaks the sama5d2_icp board ?

Thanks,
Eugen

> 
> Thanks,
> Stefan
> 
>>> Thanks,
>>> Stefan
>>>
>>>>>> ---
>>>>>>    board/solidrun/clearfog/README | 20 ++++++++++----------
>>>>>>    1 file changed, 10 insertions(+), 10 deletions(-)
>>>>>>
>>>>>> diff --git a/board/solidrun/clearfog/README 
>>>>>> b/board/solidrun/clearfog/README
>>>>>> index ed4a712c5aa2..c86b37061a30 100644
>>>>>> --- a/board/solidrun/clearfog/README
>>>>>> +++ b/board/solidrun/clearfog/README
>>>>>> @@ -1,7 +1,7 @@
>>>>>>    Update from original Marvell U-Boot to mainline U-Boot:
>>>>>>    -------------------------------------------------------
>>>>>>
>>>>>> -Generate the U-Boot image with these commands:
>>>>>> +Generate the U-Boot image for eMMC/SD with these commands:
>>>>>>
>>>>>>    $ make clearfog_defconfig
>>>>>>    $ make
>>>>>> @@ -9,7 +9,7 @@ $ make
>>>>>>    The resulting image including the SPL binary with the
>>>>>>    full DDR setup is "u-boot-with-spl.kwb".
>>>>>>
>>>>>> -Now all you need to do is copy this image on a SD card.
>>>>>> +Now all you need to do is copy this image on a SD card's sector 1.
>>>>>>    For example with this command:
>>>>>>
>>>>>>    $ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>>>>> @@ -20,12 +20,6 @@ of "/dev/sdX" here!
>>>>>>    Install U-Boot on eMMC:
>>>>>>    -----------------------
>>>>>>
>>>>>> -To make SPL load the main U-Boot image from the eMMC boot 
>>>>>> partition enable
>>>>>> -eMMC boot acknowledgement and boot partition with the following 
>>>>>> U-Boot
>>>>>> -command:
>>>>>> -
>>>>>> -  mmc partconf 0 1 1 0
>>>>>> -
>>>>>>    Install U-Boot on eMMC boot partition from Linux running on 
>>>>>> Clearfog:
>>>>>>
>>>>>>      echo 0 > /sys/block/mmcblk0boot0/force_ro
>>>>>> @@ -37,8 +31,14 @@ Consider initial boot from UART (see below).
>>>>>>    Install U-Boot on SATA:
>>>>>>    -----------------------
>>>>>>
>>>>>> -When loading the main U-Boot image from raw SATA sector, set
>>>>>> -CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
>>>>>> +Generate the U-Boot image for SATA with these commands:
>>>>>> +
>>>>>> +$ make clearfog_sata_defconfig
>>>>>> +$ make
>>>>>> +
>>>>>> +Copy image on a SATA disk's sector 1:
>>>>>> +
>>>>>> +$ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>>>>>
>>>>>>    Boot selection:
>>>>>>    ---------------
>>>>>> -- 
>>>>>> 2.20.1
>>>>>>
>>>
>>> Viele Grüße,
>>> Stefan Roese
>>>
>>> -- 
>>> DENX Software Engineering GmbH,      Managing Director: Erika Unter
>>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>>> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
> 
> Viele Grüße,
> Stefan Roese
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-05-03  9:43             ` Eugen Hristev
@ 2023-05-03  9:57               ` Stefan Roese
  2023-05-03 10:01                 ` Eugen Hristev
  0 siblings, 1 reply; 14+ messages in thread
From: Stefan Roese @ 2023-05-03  9:57 UTC (permalink / raw)
  To: Eugen Hristev, Pali Rohár; +Cc: Martin Rowe, u-boot

Hi Eugen,

On 5/3/23 11:43, Eugen Hristev wrote:
> On 5/3/23 12:17, Stefan Roese wrote:
>> On 4/29/23 13:08, Pali Rohár wrote:
>>> On Thursday 27 April 2023 10:56:17 Stefan Roese wrote:
>>>> Hi Pali,
>>>>
>>>> On 4/27/23 01:44, Pali Rohár wrote:
>>>>> On Thursday 13 April 2023 22:43:25 Martin Rowe wrote:
>>>>>> On Thu, 13 Apr 2023 at 20:58, Pali Rohár <pali@kernel.org> wrote:
>>>>>>>
>>>>>>> BootROM and neither SPL does not use eMMC boot acknowledgement or 
>>>>>>> boot
>>>>>>> enable bits in EXT_CSD_PART_CONF eMMC register. And also fixed 
>>>>>>> SATA disk
>>>>>>> sector 0x141 is not used at all.
>>>>>>>
>>>>>>> Signed-off-by: Pali Rohár <pali@kernel.org>
>>>>>>
>>>>>> SPL successfully loads u-boot from the same partition as SPL. SD card
>>>>>> and UART continue to boot.
>>>>>>
>>>>>> Thanks Pali!
>>>>>>
>>>>>> Tested-by: Martin Rowe <martin.p.rowe@gmail.com>
>>>>>
>>>>> Ok, is something more needed for this patch series?
>>>>
>>>> Unfortunately yes. As at least this board breaks with this patchset
>>>> added:
>>>>
>>>> $ make sama5d2_icp_mmc_defconfig
>>>> $ make -sj
>>>> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
>>>> u-boot-spl section `__u_boot_list' will not fit in region `.sram'
>>>> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
>>>> region `.sram' overflowed by 32 bytes
>>>> make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
>>>> make: *** [Makefile:2049: spl/u-boot-spl] Error 2
>>>>
>>>> So CI build fails and I can't send a pull request. I'm sending a patch
>>>> though, to fix this image overflow by enabling LTO. Stay tuned...
>>>
>>> I see... LTO helped. So can be this patch series now applied?
>>
>> No problems with this series now in master, so:
>>
>> Applied to u-boot-marvell/master
> 
> Hi Stefan,
> 
> This patch is still pending as it was not tested by anyone yet :
> 
> https://patchwork.ozlabs.org/project/uboot/patch/20230427085945.475619-1-sr@denx.de/
> 
> so , this series still breaks the sama5d2_icp board ?

No. Azure CI build has run w/o any problems. Otherwise I would not have
been able to send a pull request for these patches.

Thanks,
Stefan

> Thanks,
> Eugen
> 
>>
>> Thanks,
>> Stefan
>>
>>>> Thanks,
>>>> Stefan
>>>>
>>>>>>> ---
>>>>>>>    board/solidrun/clearfog/README | 20 ++++++++++----------
>>>>>>>    1 file changed, 10 insertions(+), 10 deletions(-)
>>>>>>>
>>>>>>> diff --git a/board/solidrun/clearfog/README 
>>>>>>> b/board/solidrun/clearfog/README
>>>>>>> index ed4a712c5aa2..c86b37061a30 100644
>>>>>>> --- a/board/solidrun/clearfog/README
>>>>>>> +++ b/board/solidrun/clearfog/README
>>>>>>> @@ -1,7 +1,7 @@
>>>>>>>    Update from original Marvell U-Boot to mainline U-Boot:
>>>>>>>    -------------------------------------------------------
>>>>>>>
>>>>>>> -Generate the U-Boot image with these commands:
>>>>>>> +Generate the U-Boot image for eMMC/SD with these commands:
>>>>>>>
>>>>>>>    $ make clearfog_defconfig
>>>>>>>    $ make
>>>>>>> @@ -9,7 +9,7 @@ $ make
>>>>>>>    The resulting image including the SPL binary with the
>>>>>>>    full DDR setup is "u-boot-with-spl.kwb".
>>>>>>>
>>>>>>> -Now all you need to do is copy this image on a SD card.
>>>>>>> +Now all you need to do is copy this image on a SD card's sector 1.
>>>>>>>    For example with this command:
>>>>>>>
>>>>>>>    $ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>>>>>> @@ -20,12 +20,6 @@ of "/dev/sdX" here!
>>>>>>>    Install U-Boot on eMMC:
>>>>>>>    -----------------------
>>>>>>>
>>>>>>> -To make SPL load the main U-Boot image from the eMMC boot 
>>>>>>> partition enable
>>>>>>> -eMMC boot acknowledgement and boot partition with the following 
>>>>>>> U-Boot
>>>>>>> -command:
>>>>>>> -
>>>>>>> -  mmc partconf 0 1 1 0
>>>>>>> -
>>>>>>>    Install U-Boot on eMMC boot partition from Linux running on 
>>>>>>> Clearfog:
>>>>>>>
>>>>>>>      echo 0 > /sys/block/mmcblk0boot0/force_ro
>>>>>>> @@ -37,8 +31,14 @@ Consider initial boot from UART (see below).
>>>>>>>    Install U-Boot on SATA:
>>>>>>>    -----------------------
>>>>>>>
>>>>>>> -When loading the main U-Boot image from raw SATA sector, set
>>>>>>> -CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
>>>>>>> +Generate the U-Boot image for SATA with these commands:
>>>>>>> +
>>>>>>> +$ make clearfog_sata_defconfig
>>>>>>> +$ make
>>>>>>> +
>>>>>>> +Copy image on a SATA disk's sector 1:
>>>>>>> +
>>>>>>> +$ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>>>>>>
>>>>>>>    Boot selection:
>>>>>>>    ---------------
>>>>>>> -- 
>>>>>>> 2.20.1
>>>>>>>
>>>>
>>>> Viele Grüße,
>>>> Stefan Roese
>>>>
>>>> -- 
>>>> DENX Software Engineering GmbH,      Managing Director: Erika Unter
>>>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>>>> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
>>
>> Viele Grüße,
>> Stefan Roese
>>
> 

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-05-03  9:57               ` Stefan Roese
@ 2023-05-03 10:01                 ` Eugen Hristev
  2023-05-03 10:12                   ` Stefan Roese
  0 siblings, 1 reply; 14+ messages in thread
From: Eugen Hristev @ 2023-05-03 10:01 UTC (permalink / raw)
  To: Stefan Roese, Pali Rohár; +Cc: Martin Rowe, u-boot

On 5/3/23 12:57, Stefan Roese wrote:
> Hi Eugen,
> 
> On 5/3/23 11:43, Eugen Hristev wrote:
>> On 5/3/23 12:17, Stefan Roese wrote:
>>> On 4/29/23 13:08, Pali Rohár wrote:
>>>> On Thursday 27 April 2023 10:56:17 Stefan Roese wrote:
>>>>> Hi Pali,
>>>>>
>>>>> On 4/27/23 01:44, Pali Rohár wrote:
>>>>>> On Thursday 13 April 2023 22:43:25 Martin Rowe wrote:
>>>>>>> On Thu, 13 Apr 2023 at 20:58, Pali Rohár <pali@kernel.org> wrote:
>>>>>>>>
>>>>>>>> BootROM and neither SPL does not use eMMC boot acknowledgement 
>>>>>>>> or boot
>>>>>>>> enable bits in EXT_CSD_PART_CONF eMMC register. And also fixed 
>>>>>>>> SATA disk
>>>>>>>> sector 0x141 is not used at all.
>>>>>>>>
>>>>>>>> Signed-off-by: Pali Rohár <pali@kernel.org>
>>>>>>>
>>>>>>> SPL successfully loads u-boot from the same partition as SPL. SD 
>>>>>>> card
>>>>>>> and UART continue to boot.
>>>>>>>
>>>>>>> Thanks Pali!
>>>>>>>
>>>>>>> Tested-by: Martin Rowe <martin.p.rowe@gmail.com>
>>>>>>
>>>>>> Ok, is something more needed for this patch series?
>>>>>
>>>>> Unfortunately yes. As at least this board breaks with this patchset
>>>>> added:
>>>>>
>>>>> $ make sama5d2_icp_mmc_defconfig
>>>>> $ make -sj
>>>>> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
>>>>> u-boot-spl section `__u_boot_list' will not fit in region `.sram'
>>>>> /opt/kernel.org/gcc-12.2.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-ld.bfd:
>>>>> region `.sram' overflowed by 32 bytes
>>>>> make[1]: *** [scripts/Makefile.spl:527: spl/u-boot-spl] Error 1
>>>>> make: *** [Makefile:2049: spl/u-boot-spl] Error 2
>>>>>
>>>>> So CI build fails and I can't send a pull request. I'm sending a patch
>>>>> though, to fix this image overflow by enabling LTO. Stay tuned...
>>>>
>>>> I see... LTO helped. So can be this patch series now applied?
>>>
>>> No problems with this series now in master, so:
>>>
>>> Applied to u-boot-marvell/master
>>
>> Hi Stefan,
>>
>> This patch is still pending as it was not tested by anyone yet :
>>
>> https://patchwork.ozlabs.org/project/uboot/patch/20230427085945.475619-1-sr@denx.de/
>>
>> so , this series still breaks the sama5d2_icp board ?
> 
> No. Azure CI build has run w/o any problems. Otherwise I would not have
> been able to send a pull request for these patches.

Nice, but, how was the SRAM problem solved ? Anything changed in the 
patches ?

> 
> Thanks,
> Stefan
> 
>> Thanks,
>> Eugen
>>
>>>
>>> Thanks,
>>> Stefan
>>>
>>>>> Thanks,
>>>>> Stefan
>>>>>
>>>>>>>> ---
>>>>>>>>    board/solidrun/clearfog/README | 20 ++++++++++----------
>>>>>>>>    1 file changed, 10 insertions(+), 10 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/board/solidrun/clearfog/README 
>>>>>>>> b/board/solidrun/clearfog/README
>>>>>>>> index ed4a712c5aa2..c86b37061a30 100644
>>>>>>>> --- a/board/solidrun/clearfog/README
>>>>>>>> +++ b/board/solidrun/clearfog/README
>>>>>>>> @@ -1,7 +1,7 @@
>>>>>>>>    Update from original Marvell U-Boot to mainline U-Boot:
>>>>>>>>    -------------------------------------------------------
>>>>>>>>
>>>>>>>> -Generate the U-Boot image with these commands:
>>>>>>>> +Generate the U-Boot image for eMMC/SD with these commands:
>>>>>>>>
>>>>>>>>    $ make clearfog_defconfig
>>>>>>>>    $ make
>>>>>>>> @@ -9,7 +9,7 @@ $ make
>>>>>>>>    The resulting image including the SPL binary with the
>>>>>>>>    full DDR setup is "u-boot-with-spl.kwb".
>>>>>>>>
>>>>>>>> -Now all you need to do is copy this image on a SD card.
>>>>>>>> +Now all you need to do is copy this image on a SD card's sector 1.
>>>>>>>>    For example with this command:
>>>>>>>>
>>>>>>>>    $ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>>>>>>> @@ -20,12 +20,6 @@ of "/dev/sdX" here!
>>>>>>>>    Install U-Boot on eMMC:
>>>>>>>>    -----------------------
>>>>>>>>
>>>>>>>> -To make SPL load the main U-Boot image from the eMMC boot 
>>>>>>>> partition enable
>>>>>>>> -eMMC boot acknowledgement and boot partition with the following 
>>>>>>>> U-Boot
>>>>>>>> -command:
>>>>>>>> -
>>>>>>>> -  mmc partconf 0 1 1 0
>>>>>>>> -
>>>>>>>>    Install U-Boot on eMMC boot partition from Linux running on 
>>>>>>>> Clearfog:
>>>>>>>>
>>>>>>>>      echo 0 > /sys/block/mmcblk0boot0/force_ro
>>>>>>>> @@ -37,8 +31,14 @@ Consider initial boot from UART (see below).
>>>>>>>>    Install U-Boot on SATA:
>>>>>>>>    -----------------------
>>>>>>>>
>>>>>>>> -When loading the main U-Boot image from raw SATA sector, set
>>>>>>>> -CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
>>>>>>>> +Generate the U-Boot image for SATA with these commands:
>>>>>>>> +
>>>>>>>> +$ make clearfog_sata_defconfig
>>>>>>>> +$ make
>>>>>>>> +
>>>>>>>> +Copy image on a SATA disk's sector 1:
>>>>>>>> +
>>>>>>>> +$ sudo dd if=u-boot-with-spl.kwb of=/dev/sdX bs=512 seek=1
>>>>>>>>
>>>>>>>>    Boot selection:
>>>>>>>>    ---------------
>>>>>>>> -- 
>>>>>>>> 2.20.1
>>>>>>>>
>>>>>
>>>>> Viele Grüße,
>>>>> Stefan Roese
>>>>>
>>>>> -- 
>>>>> DENX Software Engineering GmbH,      Managing Director: Erika Unter
>>>>> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>>>>> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
>>>
>>> Viele Grüße,
>>> Stefan Roese
>>>
>>
> 
> Viele Grüße,
> Stefan Roese
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions
  2023-05-03 10:01                 ` Eugen Hristev
@ 2023-05-03 10:12                   ` Stefan Roese
  0 siblings, 0 replies; 14+ messages in thread
From: Stefan Roese @ 2023-05-03 10:12 UTC (permalink / raw)
  To: Eugen Hristev, Pali Rohár; +Cc: Martin Rowe, u-boot

On 5/3/23 12:01, Eugen Hristev wrote:

<snip>

>>>>>> So CI build fails and I can't send a pull request. I'm sending a 
>>>>>> patch
>>>>>> though, to fix this image overflow by enabling LTO. Stay tuned...
>>>>>
>>>>> I see... LTO helped. So can be this patch series now applied?
>>>>
>>>> No problems with this series now in master, so:
>>>>
>>>> Applied to u-boot-marvell/master
>>>
>>> Hi Stefan,
>>>
>>> This patch is still pending as it was not tested by anyone yet :
>>>
>>> https://patchwork.ozlabs.org/project/uboot/patch/20230427085945.475619-1-sr@denx.de/
>>>
>>> so , this series still breaks the sama5d2_icp board ?
>>
>> No. Azure CI build has run w/o any problems. Otherwise I would not have
>> been able to send a pull request for these patches.
> 
> Nice, but, how was the SRAM problem solved ? Anything changed in the 
> patches ?

No, the patches are the same.

So how is this problem solved? Frankly, I have no idea. My best guess is
that the common code has shrunken a bit in the meantime. So the few
bytes more of these patches would fit now.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-03 10:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 20:57 [PATCH v2 u-boot-mvebu 0/4] arm: mvebu: Fix eMMC boot Pali Rohár
2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 1/4] tools: kwboot: Fix MMC partitions documentation Pali Rohár
2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 2/4] mmc: Read eMMC partition access bits before card reset Pali Rohár
2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 3/4] arm: mvebu: spl: Load proper U-Boot from correct eMMC partition Pali Rohár
2023-04-13 20:57 ` [PATCH v2 u-boot-mvebu 4/4] arm: mvebu: clearfog: Update eMMC/SD/SATA instructions Pali Rohár
2023-04-13 22:43   ` Martin Rowe
2023-04-26 23:44     ` Pali Rohár
2023-04-27  8:56       ` Stefan Roese
2023-04-29 11:08         ` Pali Rohár
2023-05-03  9:17           ` Stefan Roese
2023-05-03  9:43             ` Eugen Hristev
2023-05-03  9:57               ` Stefan Roese
2023-05-03 10:01                 ` Eugen Hristev
2023-05-03 10:12                   ` Stefan Roese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).