* [PATCH v2 1/5] spl: Kconfig: Add missing SPL_LOAD_BLOCK for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
2025-12-01 7:32 [PATCH v2 0/5] Fixes for CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION* and for SOCFPGA Jan Kiszka
@ 2025-12-01 7:32 ` Jan Kiszka
2025-12-01 17:49 ` Tom Rini
2025-12-01 7:32 ` [PATCH v2 2/5] spl: mmc: Account for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE being a choice Jan Kiszka
` (3 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2025-12-01 7:32 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Peng Fan, Jaehoon Chung, Marek Vasut, Simon Goldschmidt,
Tien Fong Chee, Simon Glass, Sune Brian
From: Jan Kiszka <jan.kiszka@siemens.com>
We need to explicitly select SPL_LOAD_BLOCK when USE_PARTITION_TYPE is
enabled, just like the other choices do.
Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
common/spl/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 8dade2b501e..d24466b0c66 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -573,6 +573,7 @@ config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
bool "MMC raw mode: by partition type"
+ select SPL_LOAD_BLOCK
depends on DOS_PARTITION
help
Use partition type for specifying U-Boot partition on MMC/SD in
--
2.51.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 1/5] spl: Kconfig: Add missing SPL_LOAD_BLOCK for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE
2025-12-01 7:32 ` [PATCH v2 1/5] spl: Kconfig: Add missing SPL_LOAD_BLOCK for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE Jan Kiszka
@ 2025-12-01 17:49 ` Tom Rini
0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2025-12-01 17:49 UTC (permalink / raw)
To: Jan Kiszka
Cc: U-Boot Mailing List, Peng Fan, Jaehoon Chung, Marek Vasut,
Simon Goldschmidt, Tien Fong Chee, Simon Glass, Sune Brian
[-- Attachment #1: Type: text/plain, Size: 416 bytes --]
On Mon, Dec 01, 2025 at 08:32:45AM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> We need to explicitly select SPL_LOAD_BLOCK when USE_PARTITION_TYPE is
> enabled, just like the other choices do.
>
> Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 2/5] spl: mmc: Account for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE being a choice
2025-12-01 7:32 [PATCH v2 0/5] Fixes for CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION* and for SOCFPGA Jan Kiszka
2025-12-01 7:32 ` [PATCH v2 1/5] spl: Kconfig: Add missing SPL_LOAD_BLOCK for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE Jan Kiszka
@ 2025-12-01 7:32 ` Jan Kiszka
2025-12-01 17:55 ` Tom Rini
2025-12-01 7:32 ` [PATCH v2 3/5] spl: mmc: Respect sector value passed to mmc_load_image_raw_partition Jan Kiszka
` (2 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2025-12-01 7:32 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Peng Fan, Jaehoon Chung, Marek Vasut, Simon Goldschmidt,
Tien Fong Chee, Simon Glass, Sune Brian
From: Jan Kiszka <jan.kiszka@siemens.com>
Add SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE as condition where so
far SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION was enough - though often
by chance as both options were enabled.
Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
common/spl/spl_mmc.c | 17 +++++++++--------
include/part.h | 3 ++-
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index d8ce3a84614..1942e417075 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -106,7 +106,8 @@ static int spl_mmc_find_device(struct mmc **mmcp, int mmc_dev)
return 0;
}
-#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
+#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION) || \
+ defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE)
static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev,
struct mmc *mmc, int partition,
@@ -419,19 +420,19 @@ int spl_mmc_load(struct spl_image_info *spl_image,
raw_sect = spl_mmc_get_uboot_raw_sector(mmc, raw_sect);
-#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
- ret = mmc_load_image_raw_partition(spl_image, bootdev,
- mmc, raw_part,
- raw_sect);
- if (!ret)
- return 0;
-#endif
#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
ret = mmc_load_image_raw_sector(spl_image, bootdev, mmc,
raw_sect +
spl_mmc_raw_uboot_offset(part));
if (!ret)
return 0;
+#elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION) || \
+ defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE)
+ ret = mmc_load_image_raw_partition(spl_image, bootdev,
+ mmc, raw_part,
+ raw_sect);
+ if (!ret)
+ return 0;
#endif
/* If RAW mode fails, try FS mode. */
fallthrough;
diff --git a/include/part.h b/include/part.h
index 6caaa6526aa..ba4a63ddc75 100644
--- a/include/part.h
+++ b/include/part.h
@@ -461,7 +461,8 @@ ulong disk_blk_erase(struct udevice *dev, lbaint_t start, lbaint_t blkcnt);
#ifdef CONFIG_XPL_BUILD
# define part_print_ptr(x) NULL
# if defined(CONFIG_SPL_FS_EXT4) || defined(CONFIG_SPL_FS_FAT) || \
- defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION)
+ defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION) || \
+ defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE)
# define part_get_info_ptr(x) x
# else
# define part_get_info_ptr(x) NULL
--
2.51.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 2/5] spl: mmc: Account for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE being a choice
2025-12-01 7:32 ` [PATCH v2 2/5] spl: mmc: Account for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE being a choice Jan Kiszka
@ 2025-12-01 17:55 ` Tom Rini
2025-12-01 19:59 ` Jan Kiszka
0 siblings, 1 reply; 15+ messages in thread
From: Tom Rini @ 2025-12-01 17:55 UTC (permalink / raw)
To: Jan Kiszka
Cc: U-Boot Mailing List, Peng Fan, Jaehoon Chung, Marek Vasut,
Simon Goldschmidt, Tien Fong Chee, Simon Glass, Sune Brian
[-- Attachment #1: Type: text/plain, Size: 2132 bytes --]
On Mon, Dec 01, 2025 at 08:32:46AM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Add SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE as condition where so
> far SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION was enough - though often
> by chance as both options were enabled.
>
> Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> common/spl/spl_mmc.c | 17 +++++++++--------
> include/part.h | 3 ++-
> 2 files changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index d8ce3a84614..1942e417075 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -106,7 +106,8 @@ static int spl_mmc_find_device(struct mmc **mmcp, int mmc_dev)
> return 0;
> }
>
> -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
> +#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION) || \
> + defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE)
> static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
> struct spl_boot_device *bootdev,
> struct mmc *mmc, int partition,
> @@ -419,19 +420,19 @@ int spl_mmc_load(struct spl_image_info *spl_image,
>
> raw_sect = spl_mmc_get_uboot_raw_sector(mmc, raw_sect);
>
> -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
> - ret = mmc_load_image_raw_partition(spl_image, bootdev,
> - mmc, raw_part,
> - raw_sect);
> - if (!ret)
> - return 0;
> -#endif
> #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
> ret = mmc_load_image_raw_sector(spl_image, bootdev, mmc,
> raw_sect +
> spl_mmc_raw_uboot_offset(part));
> if (!ret)
> return 0;
> +#elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION) || \
> + defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE)
> + ret = mmc_load_image_raw_partition(spl_image, bootdev,
> + mmc, raw_part,
> + raw_sect);
> + if (!ret)
> + return 0;
> #endif
Why do we change the order here?
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 2/5] spl: mmc: Account for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE being a choice
2025-12-01 17:55 ` Tom Rini
@ 2025-12-01 19:59 ` Jan Kiszka
2025-12-01 20:01 ` Tom Rini
0 siblings, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2025-12-01 19:59 UTC (permalink / raw)
To: Tom Rini
Cc: U-Boot Mailing List, Peng Fan, Jaehoon Chung, Marek Vasut,
Simon Goldschmidt, Tien Fong Chee, Simon Glass, Sune Brian
On 01.12.25 18:55, Tom Rini wrote:
> On Mon, Dec 01, 2025 at 08:32:46AM +0100, Jan Kiszka wrote:
>
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> Add SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE as condition where so
>> far SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION was enough - though often
>> by chance as both options were enabled.
>>
>> Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> common/spl/spl_mmc.c | 17 +++++++++--------
>> include/part.h | 3 ++-
>> 2 files changed, 11 insertions(+), 9 deletions(-)
>>
>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>> index d8ce3a84614..1942e417075 100644
>> --- a/common/spl/spl_mmc.c
>> +++ b/common/spl/spl_mmc.c
>> @@ -106,7 +106,8 @@ static int spl_mmc_find_device(struct mmc **mmcp, int mmc_dev)
>> return 0;
>> }
>>
>> -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
>> +#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION) || \
>> + defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE)
>> static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
>> struct spl_boot_device *bootdev,
>> struct mmc *mmc, int partition,
>> @@ -419,19 +420,19 @@ int spl_mmc_load(struct spl_image_info *spl_image,
>>
>> raw_sect = spl_mmc_get_uboot_raw_sector(mmc, raw_sect);
>>
>> -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
>> - ret = mmc_load_image_raw_partition(spl_image, bootdev,
>> - mmc, raw_part,
>> - raw_sect);
>> - if (!ret)
>> - return 0;
>> -#endif
>> #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
>> ret = mmc_load_image_raw_sector(spl_image, bootdev, mmc,
>> raw_sect +
>> spl_mmc_raw_uboot_offset(part));
>> if (!ret)
>> return 0;
>> +#elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION) || \
>> + defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE)
>> + ret = mmc_load_image_raw_partition(spl_image, bootdev,
>> + mmc, raw_part,
>> + raw_sect);
>> + if (!ret)
>> + return 0;
>> #endif
>
> Why do we change the order here?
>
Because v1 tried #if ...USE_SECTOR #else - and failed. Leftover. If
preferred, I can keep the original order. OTOH, it's the order of mode
enumerations now.
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 2/5] spl: mmc: Account for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE being a choice
2025-12-01 19:59 ` Jan Kiszka
@ 2025-12-01 20:01 ` Tom Rini
0 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2025-12-01 20:01 UTC (permalink / raw)
To: Jan Kiszka
Cc: U-Boot Mailing List, Peng Fan, Jaehoon Chung, Marek Vasut,
Simon Goldschmidt, Tien Fong Chee, Simon Glass, Sune Brian
[-- Attachment #1: Type: text/plain, Size: 2741 bytes --]
On Mon, Dec 01, 2025 at 08:59:26PM +0100, Jan Kiszka wrote:
> On 01.12.25 18:55, Tom Rini wrote:
> > On Mon, Dec 01, 2025 at 08:32:46AM +0100, Jan Kiszka wrote:
> >
> >> From: Jan Kiszka <jan.kiszka@siemens.com>
> >>
> >> Add SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE as condition where so
> >> far SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION was enough - though often
> >> by chance as both options were enabled.
> >>
> >> Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
> >> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> >> ---
> >> common/spl/spl_mmc.c | 17 +++++++++--------
> >> include/part.h | 3 ++-
> >> 2 files changed, 11 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> >> index d8ce3a84614..1942e417075 100644
> >> --- a/common/spl/spl_mmc.c
> >> +++ b/common/spl/spl_mmc.c
> >> @@ -106,7 +106,8 @@ static int spl_mmc_find_device(struct mmc **mmcp, int mmc_dev)
> >> return 0;
> >> }
> >>
> >> -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
> >> +#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION) || \
> >> + defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE)
> >> static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
> >> struct spl_boot_device *bootdev,
> >> struct mmc *mmc, int partition,
> >> @@ -419,19 +420,19 @@ int spl_mmc_load(struct spl_image_info *spl_image,
> >>
> >> raw_sect = spl_mmc_get_uboot_raw_sector(mmc, raw_sect);
> >>
> >> -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
> >> - ret = mmc_load_image_raw_partition(spl_image, bootdev,
> >> - mmc, raw_part,
> >> - raw_sect);
> >> - if (!ret)
> >> - return 0;
> >> -#endif
> >> #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
> >> ret = mmc_load_image_raw_sector(spl_image, bootdev, mmc,
> >> raw_sect +
> >> spl_mmc_raw_uboot_offset(part));
> >> if (!ret)
> >> return 0;
> >> +#elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION) || \
> >> + defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE)
> >> + ret = mmc_load_image_raw_partition(spl_image, bootdev,
> >> + mmc, raw_part,
> >> + raw_sect);
> >> + if (!ret)
> >> + return 0;
> >> #endif
> >
> > Why do we change the order here?
> >
>
> Because v1 tried #if ...USE_SECTOR #else - and failed. Leftover. If
> preferred, I can keep the original order. OTOH, it's the order of mode
> enumerations now.
OK, order of enumerations makes sense. Please re-word to explain this
change as intentional and why and with that:
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 3/5] spl: mmc: Respect sector value passed to mmc_load_image_raw_partition
2025-12-01 7:32 [PATCH v2 0/5] Fixes for CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION* and for SOCFPGA Jan Kiszka
2025-12-01 7:32 ` [PATCH v2 1/5] spl: Kconfig: Add missing SPL_LOAD_BLOCK for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE Jan Kiszka
2025-12-01 7:32 ` [PATCH v2 2/5] spl: mmc: Account for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE being a choice Jan Kiszka
@ 2025-12-01 7:32 ` Jan Kiszka
2025-12-01 17:55 ` Tom Rini
2025-12-03 19:42 ` Ralph Siemsen
2025-12-01 7:32 ` [PATCH v2 4/5] arch: arm: mach-socfpga: Adjust a raw sectors for MMC loading of U-Boot from SPL Jan Kiszka
2025-12-01 7:32 ` [PATCH v2 5/5] configs: socfpga: Fix de0_nano_soc boot Jan Kiszka
4 siblings, 2 replies; 15+ messages in thread
From: Jan Kiszka @ 2025-12-01 7:32 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Peng Fan, Jaehoon Chung, Marek Vasut, Simon Goldschmidt,
Tien Fong Chee, Simon Glass, Sune Brian
From: Jan Kiszka <jan.kiszka@siemens.com>
This function and the sector parameter evolved over the time. By now,
sector is influenced by spl_mmc_get_uboot_raw_sector which allows to
adjust the read sector with an offset that U-Boot proper may have inside
the partition. That used to work by chance if both
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR and
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION were enabled. Since
2a00d73d081a they are a choice, and we need to drop the condition to
maintain this feature.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
common/spl/spl_mmc.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 1942e417075..47cfe4aef58 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -137,11 +137,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
return ret;
}
-#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
return mmc_load_image_raw_sector(spl_image, bootdev, mmc, info.start + sector);
-#else
- return mmc_load_image_raw_sector(spl_image, bootdev, mmc, info.start);
-#endif
}
#endif
--
2.51.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/5] spl: mmc: Respect sector value passed to mmc_load_image_raw_partition
2025-12-01 7:32 ` [PATCH v2 3/5] spl: mmc: Respect sector value passed to mmc_load_image_raw_partition Jan Kiszka
@ 2025-12-01 17:55 ` Tom Rini
2025-12-03 19:42 ` Ralph Siemsen
1 sibling, 0 replies; 15+ messages in thread
From: Tom Rini @ 2025-12-01 17:55 UTC (permalink / raw)
To: Jan Kiszka
Cc: U-Boot Mailing List, Peng Fan, Jaehoon Chung, Marek Vasut,
Simon Goldschmidt, Tien Fong Chee, Simon Glass, Sune Brian
[-- Attachment #1: Type: text/plain, Size: 722 bytes --]
On Mon, Dec 01, 2025 at 08:32:47AM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This function and the sector parameter evolved over the time. By now,
> sector is influenced by spl_mmc_get_uboot_raw_sector which allows to
> adjust the read sector with an offset that U-Boot proper may have inside
> the partition. That used to work by chance if both
> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR and
> CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION were enabled. Since
> 2a00d73d081a they are a choice, and we need to drop the condition to
> maintain this feature.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/5] spl: mmc: Respect sector value passed to mmc_load_image_raw_partition
2025-12-01 7:32 ` [PATCH v2 3/5] spl: mmc: Respect sector value passed to mmc_load_image_raw_partition Jan Kiszka
2025-12-01 17:55 ` Tom Rini
@ 2025-12-03 19:42 ` Ralph Siemsen
2025-12-03 20:32 ` Ralph Siemsen
1 sibling, 1 reply; 15+ messages in thread
From: Ralph Siemsen @ 2025-12-03 19:42 UTC (permalink / raw)
To: Jan Kiszka
Cc: U-Boot Mailing List, Peng Fan, Jaehoon Chung, Marek Vasut,
Simon Goldschmidt, Tien Fong Chee, Simon Glass, Sune Brian
Hi Jan,
On Mon, Dec 1, 2025 at 2:33 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -137,11 +137,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image,
> return ret;
> }
>
> -#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
> return mmc_load_image_raw_sector(spl_image, bootdev, mmc, info.start + sector);
> -#else
> - return mmc_load_image_raw_sector(spl_image, bootdev, mmc, info.start);
> -#endif
> }
> #endif
This patch seems correct, however in testing, it does not boot for me
on cyclone V.
The reason is because the sector offset is zero, rather than the
expected value (0x200 for socfpga gen 5).
This happens because of Kconfig dependency:
https://gitlab.com/u-boot/u-boot/-/blob/master/common/spl/Kconfig?ref_type=heads#L586
I removed this "depends on" and thereafter I am able to load the main
u-boot successfully, although I don't think that is necessarily the
right way to fix the issue.
Regards
Ralph
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 3/5] spl: mmc: Respect sector value passed to mmc_load_image_raw_partition
2025-12-03 19:42 ` Ralph Siemsen
@ 2025-12-03 20:32 ` Ralph Siemsen
0 siblings, 0 replies; 15+ messages in thread
From: Ralph Siemsen @ 2025-12-03 20:32 UTC (permalink / raw)
To: Jan Kiszka
Cc: U-Boot Mailing List, Peng Fan, Jaehoon Chung, Marek Vasut,
Simon Goldschmidt, Tien Fong Chee, Simon Glass, Sune Brian
On Wed, Dec 3, 2025 at 2:42 PM Ralph Siemsen <ralph.siemsen@linaro.org> wrote:
> The reason is because the sector offset is zero, rather than the
> expected value (0x200 for socfpga gen 5).
Actually I see now that your subsequent patch in
arch/arm/mach-socfpga/board.c should handle this, but there's a
problem with the #if defined tests. I'll reply to that email.
Ralph
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 4/5] arch: arm: mach-socfpga: Adjust a raw sectors for MMC loading of U-Boot from SPL
2025-12-01 7:32 [PATCH v2 0/5] Fixes for CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION* and for SOCFPGA Jan Kiszka
` (2 preceding siblings ...)
2025-12-01 7:32 ` [PATCH v2 3/5] spl: mmc: Respect sector value passed to mmc_load_image_raw_partition Jan Kiszka
@ 2025-12-01 7:32 ` Jan Kiszka
2025-12-03 20:32 ` Ralph Siemsen
2025-12-01 7:32 ` [PATCH v2 5/5] configs: socfpga: Fix de0_nano_soc boot Jan Kiszka
4 siblings, 1 reply; 15+ messages in thread
From: Jan Kiszka @ 2025-12-01 7:32 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Peng Fan, Jaehoon Chung, Marek Vasut, Simon Goldschmidt,
Tien Fong Chee, Simon Glass, Sune Brian
From: Jan Kiszka <jan.kiszka@siemens.com>
If U-Boot is located on MMC, SPL and U-Boot proper are glued together.
More precisely, SPL is stored 4 times. Take this and its padding into
account and adjust sector number via board_spl_mmc_get_uboot_raw_sector.
This allows loading from a partition, without the need to hard-code the
offset via SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
arch/arm/mach-socfpga/board.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
index 28554b7a109..0b04f2bcacf 100644
--- a/arch/arm/mach-socfpga/board.c
+++ b/arch/arm/mach-socfpga/board.c
@@ -14,6 +14,7 @@
#include <hang.h>
#include <handoff.h>
#include <image.h>
+#include <spl.h>
#include <usb.h>
#include <usb/dwc2_udc.h>
#include <asm/global_data.h>
@@ -209,3 +210,13 @@ void lmb_arch_add_memory(void)
}
}
#endif
+
+#if (defined(TARGET_SOCFPGA_ARRIA10) || defined(TARGET_SOCFPGA_GEN5)) && \
+ defined(CONFIG_XPL_BUILD)
+unsigned long board_spl_mmc_get_uboot_raw_sector(struct mmc *mmc,
+ unsigned long raw_sect)
+{
+ /* offset of u-boot proper inside u-boot-with-spl.sfp image */
+ return (CONFIG_SPL_PAD_TO * 4) / 512 + raw_sect;
+}
+#endif
--
2.51.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 4/5] arch: arm: mach-socfpga: Adjust a raw sectors for MMC loading of U-Boot from SPL
2025-12-01 7:32 ` [PATCH v2 4/5] arch: arm: mach-socfpga: Adjust a raw sectors for MMC loading of U-Boot from SPL Jan Kiszka
@ 2025-12-03 20:32 ` Ralph Siemsen
2025-12-11 16:17 ` Jan Kiszka
0 siblings, 1 reply; 15+ messages in thread
From: Ralph Siemsen @ 2025-12-03 20:32 UTC (permalink / raw)
To: Jan Kiszka
Cc: U-Boot Mailing List, Peng Fan, Jaehoon Chung, Marek Vasut,
Simon Goldschmidt, Tien Fong Chee, Simon Glass, Sune Brian
Hi Jan,
On Mon, Dec 1, 2025 at 2:33 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
> diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
> index 28554b7a109..0b04f2bcacf 100644
> --- a/arch/arm/mach-socfpga/board.c
> +++ b/arch/arm/mach-socfpga/board.c
> @@ -209,3 +210,13 @@ void lmb_arch_add_memory(void)
> }
> }
> #endif
> +
> +#if (defined(TARGET_SOCFPGA_ARRIA10) || defined(TARGET_SOCFPGA_GEN5)) && \
> + defined(CONFIG_XPL_BUILD)
This seems to be missing two CONFIG_ prefixes:
#if (defined(CONFIG_TARGET_SOCFPGA_ARRIA10) ||
defined(CONFIG_TARGET_SOCFPGA_GEN5)) &&
Regards,
Ralph
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 4/5] arch: arm: mach-socfpga: Adjust a raw sectors for MMC loading of U-Boot from SPL
2025-12-03 20:32 ` Ralph Siemsen
@ 2025-12-11 16:17 ` Jan Kiszka
0 siblings, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2025-12-11 16:17 UTC (permalink / raw)
To: Ralph Siemsen
Cc: U-Boot Mailing List, Peng Fan, Jaehoon Chung, Marek Vasut,
Simon Goldschmidt, Tien Fong Chee, Simon Glass, Sune Brian
On 03.12.25 21:32, Ralph Siemsen wrote:
> Hi Jan,
>
> On Mon, Dec 1, 2025 at 2:33 AM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>
>> diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
>> index 28554b7a109..0b04f2bcacf 100644
>> --- a/arch/arm/mach-socfpga/board.c
>> +++ b/arch/arm/mach-socfpga/board.c
>> @@ -209,3 +210,13 @@ void lmb_arch_add_memory(void)
>> }
>> }
>> #endif
>> +
>> +#if (defined(TARGET_SOCFPGA_ARRIA10) || defined(TARGET_SOCFPGA_GEN5)) && \
>> + defined(CONFIG_XPL_BUILD)
>
> This seems to be missing two CONFIG_ prefixes:
>
> #if (defined(CONFIG_TARGET_SOCFPGA_ARRIA10) ||
> defined(CONFIG_TARGET_SOCFPGA_GEN5)) &&
>
Indeed. I was lacking a target to catch this. v3 is on the way.
Thanks,
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 5/5] configs: socfpga: Fix de0_nano_soc boot
2025-12-01 7:32 [PATCH v2 0/5] Fixes for CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION* and for SOCFPGA Jan Kiszka
` (3 preceding siblings ...)
2025-12-01 7:32 ` [PATCH v2 4/5] arch: arm: mach-socfpga: Adjust a raw sectors for MMC loading of U-Boot from SPL Jan Kiszka
@ 2025-12-01 7:32 ` Jan Kiszka
4 siblings, 0 replies; 15+ messages in thread
From: Jan Kiszka @ 2025-12-01 7:32 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Peng Fan, Jaehoon Chung, Marek Vasut, Simon Goldschmidt,
Tien Fong Chee, Simon Glass, Sune Brian
From: Jan Kiszka <jan.kiszka@siemens.com>
By default, the de0_nano_soc used raw sectors, but the address became
invalid due the raw-mode refactorings. With loading via partition type
fixed, we can switch to that mode which is in line with what the ROM
loader does.
Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
configs/socfpga_de0_nano_soc_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/socfpga_de0_nano_soc_defconfig b/configs/socfpga_de0_nano_soc_defconfig
index 32cdf6d3a6c..6564cbd03c6 100644
--- a/configs/socfpga_de0_nano_soc_defconfig
+++ b/configs/socfpga_de0_nano_soc_defconfig
@@ -28,6 +28,7 @@ CONFIG_SPL_NO_BSS_LIMIT=y
# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
CONFIG_SPL_HAVE_INIT_STACK=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE=y
CONFIG_SPL_SPI_LOAD=y
CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000
CONFIG_SYS_MAXARGS=32
--
2.51.0
^ permalink raw reply related [flat|nested] 15+ messages in thread