| Message ID | 20250714133345.128853-1-sputnik@on-the-web.ch |
|---|---|
| Headers | show |
| Series | Update riscv's SYS_BOOTM_LEN to the most commonly used value. | expand |
On 7/14/25 15:33, Martin Herren wrote: > > The most commonly used SYS_BOOTM_LEN for riscv is 0x4000000 which is > used in 25 of the current defconfigs. > > The previous default config value of 0x800000 was only used in 8 > defconfigs. > > This patch sets the default to this value. > > Command used to get the stats of the used values on RISCV defconfigs: > > ``` > grep -l "CONFIG_RISCV=y" configs/* | \ > xargs -I {} sh -c "grep -H CONFIG_SYS_BOOTM_LEN {} || echo {}:DEFAULT" | \ > cut -d ':' -f 2 | sort | uniq -c > ``` > > Changes in v2: > - Resubmit using another mail provider to prevent mangling and signature > attachement. > > Martin Herren (3): > riscv: Set SYS_BOOTM_LEN explicitly to 0x800000 > riscv: Set SYS_BOOTM_LEN default to 0x4000000 > riscv: Remove default SYS_BOOTM_LEN from defconfig > > boot/Kconfig | 2 +- > configs/ae350_rv32_defconfig | 1 - > configs/ae350_rv32_falcon_defconfig | 1 - > configs/ae350_rv32_falcon_xip_defconfig | 1 - > configs/ae350_rv32_spl_defconfig | 1 - > configs/ae350_rv32_spl_xip_defconfig | 1 - > configs/ae350_rv32_xip_defconfig | 1 - > configs/ae350_rv64_defconfig | 1 - > configs/ae350_rv64_falcon_defconfig | 1 - > configs/ae350_rv64_falcon_xip_defconfig | 1 - > configs/ae350_rv64_spl_defconfig | 1 - > configs/ae350_rv64_spl_xip_defconfig | 1 - > configs/ae350_rv64_xip_defconfig | 1 - > configs/ibex-ast2700_defconfig | 1 - > configs/k230_canmv_defconfig | 1 + > configs/microchip_mpfs_icicle_defconfig | 1 + > configs/milkv_duo_defconfig | 1 - > configs/qemu-riscv32_defconfig | 1 - > configs/qemu-riscv32_smode_defconfig | 1 - > configs/qemu-riscv32_spl_defconfig | 1 - > configs/qemu-riscv64_defconfig | 1 - > configs/qemu-riscv64_smode_defconfig | 1 - > configs/qemu-riscv64_spl_defconfig | 1 - > configs/sifive_unleashed_defconfig | 1 - > configs/sifive_unmatched_defconfig | 1 - > configs/sipeed_licheerv_nano_defconfig | 1 - > configs/sipeed_maix_bitm_defconfig | 1 + > configs/sipeed_maix_smode_defconfig | 1 + > configs/starfive_visionfive2_defconfig | 1 - > configs/th1520_lpi4a_defconfig | 1 - > configs/xilinx_mbv32_defconfig | 1 + > configs/xilinx_mbv32_smode_defconfig | 1 + > configs/xilinx_mbv64_defconfig | 1 + > configs/xilinx_mbv64_smode_defconfig | 1 + > 34 files changed, 9 insertions(+), 26 deletions(-) > I don't mind with these changes. It is just value which can be changed. Acked-by; Michal Simek <michal.simek@amd.com> # xilinx_mbv Thanks Michal
On 7/15/25 04:27, Michal Simek wrote: > > > On 7/14/25 15:33, Martin Herren wrote: >> >> The most commonly used SYS_BOOTM_LEN for riscv is 0x4000000 which is >> used in 25 of the current defconfigs. >> >> The previous default config value of 0x800000 was only used in 8 >> defconfigs. >> >> This patch sets the default to this value. >> >> Command used to get the stats of the used values on RISCV defconfigs: >> >> ``` >> grep -l "CONFIG_RISCV=y" configs/* | \ >> xargs -I {} sh -c "grep -H CONFIG_SYS_BOOTM_LEN {} || echo >> {}:DEFAULT" | \ >> cut -d ':' -f 2 | sort | uniq -c >> ``` >> >> Changes in v2: >> - Resubmit using another mail provider to prevent mangling and signature >> attachement. >> >> Martin Herren (3): >> riscv: Set SYS_BOOTM_LEN explicitly to 0x800000 >> riscv: Set SYS_BOOTM_LEN default to 0x4000000 >> riscv: Remove default SYS_BOOTM_LEN from defconfig >> >> boot/Kconfig | 2 +- >> configs/ae350_rv32_defconfig | 1 - >> configs/ae350_rv32_falcon_defconfig | 1 - >> configs/ae350_rv32_falcon_xip_defconfig | 1 - >> configs/ae350_rv32_spl_defconfig | 1 - >> configs/ae350_rv32_spl_xip_defconfig | 1 - >> configs/ae350_rv32_xip_defconfig | 1 - >> configs/ae350_rv64_defconfig | 1 - >> configs/ae350_rv64_falcon_defconfig | 1 - >> configs/ae350_rv64_falcon_xip_defconfig | 1 - >> configs/ae350_rv64_spl_defconfig | 1 - >> configs/ae350_rv64_spl_xip_defconfig | 1 - >> configs/ae350_rv64_xip_defconfig | 1 - >> configs/ibex-ast2700_defconfig | 1 - >> configs/k230_canmv_defconfig | 1 + >> configs/microchip_mpfs_icicle_defconfig | 1 + >> configs/milkv_duo_defconfig | 1 - >> configs/qemu-riscv32_defconfig | 1 - >> configs/qemu-riscv32_smode_defconfig | 1 - >> configs/qemu-riscv32_spl_defconfig | 1 - >> configs/qemu-riscv64_defconfig | 1 - >> configs/qemu-riscv64_smode_defconfig | 1 - >> configs/qemu-riscv64_spl_defconfig | 1 - >> configs/sifive_unleashed_defconfig | 1 - >> configs/sifive_unmatched_defconfig | 1 - >> configs/sipeed_licheerv_nano_defconfig | 1 - >> configs/sipeed_maix_bitm_defconfig | 1 + >> configs/sipeed_maix_smode_defconfig | 1 + >> configs/starfive_visionfive2_defconfig | 1 - >> configs/th1520_lpi4a_defconfig | 1 - >> configs/xilinx_mbv32_defconfig | 1 + >> configs/xilinx_mbv32_smode_defconfig | 1 + >> configs/xilinx_mbv64_defconfig | 1 + >> configs/xilinx_mbv64_smode_defconfig | 1 + >> 34 files changed, 9 insertions(+), 26 deletions(-) >> > > I don't mind with these changes. It is just value which can be changed. > > Acked-by; Michal Simek <michal.simek@amd.com> # xilinx_mbv > > Thanks > Michal > > Is there some reason for the value from documentation about the architecture? Or is it arbitrary? I don't really see the sense in a default value which is simply popular but not founded in an architectural reasoning. The values do not change often (ever?) so I miss why there is any default at all. -E
Hej all, On Wednesday, July 16th, 2025 at 3:35 AM, E Shattow <e@freeshell.de> wrote: > > > Is there some reason for the value from documentation about the > architecture? Or is it arbitrary? > > I don't really see the sense in a default value which is simply popular > but not founded in an architectural reasoning. > > The values do not change often (ever?) so I miss why there is any > default at all. > > -E No, there is no documentation justifying this value. My reasoning was the reverse, there is no justification either that this default value should be almost an order of magnitude lower than ARM64 as typically generated RISCV code size is similar and thus the typical kernel size as well. This is reflected in the most commonly used value in the existing riscv defconfigs as well as other boards not yet mainlined into u-boot. With a lower value, typical kernels generated from Yocto or others are too big to be able to be booted. In my idea the default value, when provided, should reflect the most common use case which can then be overridden if wanted. I understand it was a very bold move on my side as a first submission to challenge a default value and touch over 30 boards, so i won't be offended if this is not accepted. The learning experience on just submitting a patch here and learning about patman and co is already a success for me. Still I consider the proposed new default as sane and maybe more future oriented for new boards to come. Cheers, Martin
On 7/16/25 03:11, Martin Herren wrote: > Hej all, > > On Wednesday, July 16th, 2025 at 3:35 AM, E Shattow <e@freeshell.de> wrote: >> > >> > >> Is there some reason for the value from documentation about the >> architecture? Or is it arbitrary? >> > >> I don't really see the sense in a default value which is simply popular >> but not founded in an architectural reasoning. >> > >> The values do not change often (ever?) so I miss why there is any >> default at all. >> > >> -E > > No, there is no documentation justifying this value. My reasoning was the reverse, there is no justification either that this default value should be almost an order of magnitude lower than ARM64 as typically generated RISCV code size is similar and thus the typical kernel size as well. > > This is reflected in the most commonly used value in the existing riscv defconfigs as well as other boards not yet mainlined into u-boot. > > With a lower value, typical kernels generated from Yocto or others are too big to be able to be booted. > > In my idea the default value, when provided, should reflect the most common use case which can then be overridden if wanted. > > I understand it was a very bold move on my side as a first submission to challenge a default value and touch over 30 boards, so i won't be offended if this is not accepted. The learning experience on just submitting a patch here and learning about patman and co is already a success for me. > > Still I consider the proposed new default as sane and maybe more future oriented for new boards to come. > > Cheers, > > Martin My concern is to not-find what I am looking for where I am looking for it and then hunt around to determine where this value comes from. A default ceases to be a default when there are more than a few exceptions, as it then becomes an obfuscation. I do tend to complain when the code base becomes clever for the sake of being clever, and defer to actual programmers however... all else being the same (it compiles the same?) go with what you think is most maintainable and readable. -E
On Tue, Jul 15, 2025 at 06:35:17PM -0700, E Shattow wrote: > > > On 7/15/25 04:27, Michal Simek wrote: > > > > > > On 7/14/25 15:33, Martin Herren wrote: > >> > >> The most commonly used SYS_BOOTM_LEN for riscv is 0x4000000 which is > >> used in 25 of the current defconfigs. > >> > >> The previous default config value of 0x800000 was only used in 8 > >> defconfigs. > >> > >> This patch sets the default to this value. > >> > >> Command used to get the stats of the used values on RISCV defconfigs: > >> > >> ``` > >> grep -l "CONFIG_RISCV=y" configs/* | \ > >> xargs -I {} sh -c "grep -H CONFIG_SYS_BOOTM_LEN {} || echo > >> {}:DEFAULT" | \ > >> cut -d ':' -f 2 | sort | uniq -c > >> ``` > >> > >> Changes in v2: > >> - Resubmit using another mail provider to prevent mangling and signature > >> attachement. > >> > >> Martin Herren (3): > >> riscv: Set SYS_BOOTM_LEN explicitly to 0x800000 > >> riscv: Set SYS_BOOTM_LEN default to 0x4000000 > >> riscv: Remove default SYS_BOOTM_LEN from defconfig > >> > >> boot/Kconfig | 2 +- > >> configs/ae350_rv32_defconfig | 1 - > >> configs/ae350_rv32_falcon_defconfig | 1 - > >> configs/ae350_rv32_falcon_xip_defconfig | 1 - > >> configs/ae350_rv32_spl_defconfig | 1 - > >> configs/ae350_rv32_spl_xip_defconfig | 1 - > >> configs/ae350_rv32_xip_defconfig | 1 - > >> configs/ae350_rv64_defconfig | 1 - > >> configs/ae350_rv64_falcon_defconfig | 1 - > >> configs/ae350_rv64_falcon_xip_defconfig | 1 - > >> configs/ae350_rv64_spl_defconfig | 1 - > >> configs/ae350_rv64_spl_xip_defconfig | 1 - > >> configs/ae350_rv64_xip_defconfig | 1 - > >> configs/ibex-ast2700_defconfig | 1 - > >> configs/k230_canmv_defconfig | 1 + > >> configs/microchip_mpfs_icicle_defconfig | 1 + > >> configs/milkv_duo_defconfig | 1 - > >> configs/qemu-riscv32_defconfig | 1 - > >> configs/qemu-riscv32_smode_defconfig | 1 - > >> configs/qemu-riscv32_spl_defconfig | 1 - > >> configs/qemu-riscv64_defconfig | 1 - > >> configs/qemu-riscv64_smode_defconfig | 1 - > >> configs/qemu-riscv64_spl_defconfig | 1 - > >> configs/sifive_unleashed_defconfig | 1 - > >> configs/sifive_unmatched_defconfig | 1 - > >> configs/sipeed_licheerv_nano_defconfig | 1 - > >> configs/sipeed_maix_bitm_defconfig | 1 + > >> configs/sipeed_maix_smode_defconfig | 1 + > >> configs/starfive_visionfive2_defconfig | 1 - > >> configs/th1520_lpi4a_defconfig | 1 - > >> configs/xilinx_mbv32_defconfig | 1 + > >> configs/xilinx_mbv32_smode_defconfig | 1 + > >> configs/xilinx_mbv64_defconfig | 1 + > >> configs/xilinx_mbv64_smode_defconfig | 1 + > >> 34 files changed, 9 insertions(+), 26 deletions(-) > >> > > > > I don't mind with these changes. It is just value which can be changed. > > > > Acked-by; Michal Simek <michal.simek@amd.com> # xilinx_mbv > > > > Thanks > > Michal > > > > > > Is there some reason for the value from documentation about the > architecture? Or is it arbitrary? > > I don't really see the sense in a default value which is simply popular > but not founded in an architectural reasoning. > > The values do not change often (ever?) so I miss why there is any > default at all. So, the default for SYS_BOOTM_LEN isn't so much arbitrary as just no longer reflective of modern times. It's why there's larger defaults for ARM64 for example. Likely RISCV should just also use that as the default and platforms with very small amounts of RAM should stick with smaller.
On Wed, Jul 16, 2025 at 11:00:15AM -0600, Tom Rini wrote: > [EXTERNAL MAIL] > Date: Wed, 16 Jul 2025 11:00:15 -0600 > From: Tom Rini <trini@konsulko.com> > To: E Shattow <e@freeshell.de> > Cc: Michal Simek <michal.simek@amd.com>, Martin Herren > <sputnik@on-the-web.ch>, u-boot@lists.denx.de, Andreas Schwab > <schwab@suse.de>, Anup Patel <anup@brainfault.org>, Atish Patra > <atishp@atishpatra.org>, Bin Meng <bmeng.cn@gmail.com>, "Chia-Wei, Wang" > <chiawei_wang@aspeedtech.com>, Conor Dooley <conor.dooley@microchip.com>, > Cyril Jean <cyril.jean@microchip.com>, Green Wan <green.wan@sifive.com>, > Hal Feng <hal.feng@starfivetech.com>, Heinrich Schuchardt > <xypron.glpk@gmx.de>, Ilias Apalodimas <ilias.apalodimas@linaro.org>, > Jerome Forissier <jerome.forissier@linaro.org>, Junhui Liu > <junhui.liu@pigmoral.tech>, Kongyang Liu <seashell11234455@gmail.com>, Leo > Yu-Chi Liang <ycliang@andestech.com>, Maksim Kiselev > <bigunclemax@gmail.com>, Marek Vasut <marek.vasut+renesas@mailbox.org>, > Martin Schwan <m.schwan@phytec.de>, Mattijs Korpershoek > <mkorpershoek@kernel.org>, Minda Chen <minda.chen@starfivetech.com>, > Padmarao Begari <padmarao.begari@amd.com>, Palmer Dabbelt > <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Peter > Robinson <pbrobinson@gmail.com>, Rick Chen <rick@andestech.com>, Sean > Anderson <seanga2@gmail.com>, Simon Glass <sjg@chromium.org>, Sumit Garg > <sumit.garg@kernel.org>, Thomas Bonnefille > <thomas.bonnefille@bootlin.com>, Wei Fu <wefu@redhat.com>, Yao Zi > <ziyao@disroot.org>, Yixun Lan <dlan@gentoo.org>, Yuri Zaporozhets > <yuriz@vodafonemail.de> > Subject: Re: [PATCH 0/3] Update riscv's SYS_BOOTM_LEN to the most commonly > used value. > > On Tue, Jul 15, 2025 at 06:35:17PM -0700, E Shattow wrote: > > > > > > On 7/15/25 04:27, Michal Simek wrote: > > > > > > > > > On 7/14/25 15:33, Martin Herren wrote: > > >> > > >> The most commonly used SYS_BOOTM_LEN for riscv is 0x4000000 which is > > >> used in 25 of the current defconfigs. > > >> > > >> The previous default config value of 0x800000 was only used in 8 > > >> defconfigs. > > >> > > >> This patch sets the default to this value. > > >> > > >> Command used to get the stats of the used values on RISCV defconfigs: > > >> > > >> ``` > > >> grep -l "CONFIG_RISCV=y" configs/* | \ > > >> xargs -I {} sh -c "grep -H CONFIG_SYS_BOOTM_LEN {} || echo > > >> {}:DEFAULT" | \ > > >> cut -d ':' -f 2 | sort | uniq -c > > >> ``` > > >> > > >> Changes in v2: > > >> - Resubmit using another mail provider to prevent mangling and signature > > >> attachement. > > >> > > >> Martin Herren (3): > > >> riscv: Set SYS_BOOTM_LEN explicitly to 0x800000 > > >> riscv: Set SYS_BOOTM_LEN default to 0x4000000 > > >> riscv: Remove default SYS_BOOTM_LEN from defconfig > > >> > > >> boot/Kconfig | 2 +- > > >> configs/ae350_rv32_defconfig | 1 - > > >> configs/ae350_rv32_falcon_defconfig | 1 - > > >> configs/ae350_rv32_falcon_xip_defconfig | 1 - > > >> configs/ae350_rv32_spl_defconfig | 1 - > > >> configs/ae350_rv32_spl_xip_defconfig | 1 - > > >> configs/ae350_rv32_xip_defconfig | 1 - > > >> configs/ae350_rv64_defconfig | 1 - > > >> configs/ae350_rv64_falcon_defconfig | 1 - > > >> configs/ae350_rv64_falcon_xip_defconfig | 1 - > > >> configs/ae350_rv64_spl_defconfig | 1 - > > >> configs/ae350_rv64_spl_xip_defconfig | 1 - > > >> configs/ae350_rv64_xip_defconfig | 1 - > > >> configs/ibex-ast2700_defconfig | 1 - > > >> configs/k230_canmv_defconfig | 1 + > > >> configs/microchip_mpfs_icicle_defconfig | 1 + > > >> configs/milkv_duo_defconfig | 1 - > > >> configs/qemu-riscv32_defconfig | 1 - > > >> configs/qemu-riscv32_smode_defconfig | 1 - > > >> configs/qemu-riscv32_spl_defconfig | 1 - > > >> configs/qemu-riscv64_defconfig | 1 - > > >> configs/qemu-riscv64_smode_defconfig | 1 - > > >> configs/qemu-riscv64_spl_defconfig | 1 - > > >> configs/sifive_unleashed_defconfig | 1 - > > >> configs/sifive_unmatched_defconfig | 1 - > > >> configs/sipeed_licheerv_nano_defconfig | 1 - > > >> configs/sipeed_maix_bitm_defconfig | 1 + > > >> configs/sipeed_maix_smode_defconfig | 1 + > > >> configs/starfive_visionfive2_defconfig | 1 - > > >> configs/th1520_lpi4a_defconfig | 1 - > > >> configs/xilinx_mbv32_defconfig | 1 + > > >> configs/xilinx_mbv32_smode_defconfig | 1 + > > >> configs/xilinx_mbv64_defconfig | 1 + > > >> configs/xilinx_mbv64_smode_defconfig | 1 + > > >> 34 files changed, 9 insertions(+), 26 deletions(-) > > >> > > > > > > I don't mind with these changes. It is just value which can be changed. > > > > > > Acked-by; Michal Simek <michal.simek@amd.com> # xilinx_mbv > > > > > > Thanks > > > Michal > > > > > > > > > > Is there some reason for the value from documentation about the > > architecture? Or is it arbitrary? > > > > I don't really see the sense in a default value which is simply popular > > but not founded in an architectural reasoning. > > > > The values do not change often (ever?) so I miss why there is any > > default at all. > > So, the default for SYS_BOOTM_LEN isn't so much arbitrary as just no > longer reflective of modern times. It's why there's larger defaults for > ARM64 for example. Likely RISCV should just also use that as the default > and platforms with very small amounts of RAM should stick with smaller. > > -- > Tom Hi Martin, These changes seem reasonable, and I'm fine with them. If you send a v2 PR incorporating Conor's comment on the first patch, you may add my Reviewed-by tag. Best regards, Leo
The most commonly used SYS_BOOTM_LEN for riscv is 0x4000000 which is used in 25 of the current defconfigs. The previous default config value of 0x800000 was only used in 8 defconfigs. This patch sets the default to this value. Command used to get the stats of the used values on RISCV defconfigs: ``` grep -l "CONFIG_RISCV=y" configs/* | \ xargs -I {} sh -c "grep -H CONFIG_SYS_BOOTM_LEN {} || echo {}:DEFAULT" | \ cut -d ':' -f 2 | sort | uniq -c ``` Changes in v2: - Resubmit using another mail provider to prevent mangling and signature attachement. Martin Herren (3): riscv: Set SYS_BOOTM_LEN explicitly to 0x800000 riscv: Set SYS_BOOTM_LEN default to 0x4000000 riscv: Remove default SYS_BOOTM_LEN from defconfig boot/Kconfig | 2 +- configs/ae350_rv32_defconfig | 1 - configs/ae350_rv32_falcon_defconfig | 1 - configs/ae350_rv32_falcon_xip_defconfig | 1 - configs/ae350_rv32_spl_defconfig | 1 - configs/ae350_rv32_spl_xip_defconfig | 1 - configs/ae350_rv32_xip_defconfig | 1 - configs/ae350_rv64_defconfig | 1 - configs/ae350_rv64_falcon_defconfig | 1 - configs/ae350_rv64_falcon_xip_defconfig | 1 - configs/ae350_rv64_spl_defconfig | 1 - configs/ae350_rv64_spl_xip_defconfig | 1 - configs/ae350_rv64_xip_defconfig | 1 - configs/ibex-ast2700_defconfig | 1 - configs/k230_canmv_defconfig | 1 + configs/microchip_mpfs_icicle_defconfig | 1 + configs/milkv_duo_defconfig | 1 - configs/qemu-riscv32_defconfig | 1 - configs/qemu-riscv32_smode_defconfig | 1 - configs/qemu-riscv32_spl_defconfig | 1 - configs/qemu-riscv64_defconfig | 1 - configs/qemu-riscv64_smode_defconfig | 1 - configs/qemu-riscv64_spl_defconfig | 1 - configs/sifive_unleashed_defconfig | 1 - configs/sifive_unmatched_defconfig | 1 - configs/sipeed_licheerv_nano_defconfig | 1 - configs/sipeed_maix_bitm_defconfig | 1 + configs/sipeed_maix_smode_defconfig | 1 + configs/starfive_visionfive2_defconfig | 1 - configs/th1520_lpi4a_defconfig | 1 - configs/xilinx_mbv32_defconfig | 1 + configs/xilinx_mbv32_smode_defconfig | 1 + configs/xilinx_mbv64_defconfig | 1 + configs/xilinx_mbv64_smode_defconfig | 1 + 34 files changed, 9 insertions(+), 26 deletions(-)