[PATCH] arm: kirkwood: Enable bootstd for Sheevaplug board

Tony Dinh mibodhi at gmail.com
Wed Nov 20 20:39:02 CET 2024


Hi Simon,

On Wed, Nov 20, 2024 at 4:40 AM Simon Glass <sjg at chromium.org> wrote:
>
> Hi Tony,
>
> On Tue, 19 Nov 2024 at 12:50, Tony Dinh <mibodhi at gmail.com> wrote:
> >
> > Enable bootstd for Sheevaplug board.
> > Remove JFFS2 support. See JFFS2 Vulnerability[1].
> > Enable LTO to keep board size within limit.
> >
> > [1] https://lore.kernel.org/u-boot/20241114233005.GN3600562@bill-the-cat/T/#m2fc25da1d2c019bc3cd8676991fdd64b8a21aa9b
> >
> > Signed-off-by: Tony Dinh <mibodhi at gmail.com>
> > ---
> >
> >  configs/sheevaplug_defconfig | 16 ++--------------
> >  include/configs/sheevaplug.h | 20 +++++++++++++++-----
> >  2 files changed, 17 insertions(+), 19 deletions(-)
>
> Can I suggest that you move to a test-based environment, too?

Did you mean a "text-based environment" as in
board/<vendor>/<board>/<CONFIG_SYS_BOARD>.env ?

If yes, I have not tried it but my impression from my past reading is
that we need to repeat the bootcmd (bootcmd=bootflow scan -lb) and
other boot #define's in the .env file. In that case the
include/confis/sheevaplug.h can be removed. I recall reading this
conversation here in the ML from way past. It'll be easier to maintain
and I'm all for it!

Is there a good example somewhere in the u-boot source tree? i.e. any
other envs that could be useful for bootstd should be in there too.

All the best,
Tony


>
> >
> > diff --git a/configs/sheevaplug_defconfig b/configs/sheevaplug_defconfig
> > index 9ac40b9e57..a7f6c73ecb 100644
> > --- a/configs/sheevaplug_defconfig
> > +++ b/configs/sheevaplug_defconfig
> > @@ -16,16 +16,14 @@ CONFIG_ENV_OFFSET=0x80000
> >  CONFIG_DEFAULT_DEVICE_TREE="marvell/kirkwood-sheevaplug"
> >  CONFIG_SYS_LOAD_ADDR=0x800000
> >  CONFIG_IDENT_STRING="\nMarvell-Sheevaplug"
> > +CONFIG_LTO=y
> >  CONFIG_HAS_BOARD_SIZE_LIMIT=y
> >  CONFIG_BOARD_SIZE_LIMIT=524288
> > +CONFIG_BOOTSTD_FULL=y
> >  CONFIG_BOOTDELAY=3
> > -CONFIG_USE_BOOTCOMMAND=y
> > -CONFIG_BOOTCOMMAND="${x_bootcmd_kernel}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000;"
> >  CONFIG_USE_PREBOOT=y
> >  # CONFIG_DISPLAY_BOARDINFO is not set
> > -CONFIG_HUSH_PARSER=y
> >  CONFIG_SYS_MAXARGS=32
> > -CONFIG_CMD_BOOTZ=y
> >  # CONFIG_BOOTM_PLAN9 is not set
> >  # CONFIG_BOOTM_RTEMS is not set
> >  # CONFIG_BOOTM_VXWORKS is not set
> > @@ -35,19 +33,10 @@ CONFIG_CMD_MMC=y
> >  CONFIG_CMD_NAND=y
> >  CONFIG_CMD_SATA=y
> >  CONFIG_CMD_USB=y
> > -CONFIG_CMD_DHCP=y
> > -CONFIG_CMD_MII=y
> > -CONFIG_CMD_PING=y
> > -CONFIG_CMD_EXT2=y
> > -CONFIG_CMD_EXT4=y
> > -CONFIG_CMD_FAT=y
> > -CONFIG_CMD_FS_GENERIC=y
> > -CONFIG_CMD_JFFS2=y
> >  CONFIG_CMD_MTDPARTS=y
> >  CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
> >  CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:512K(uboot),512K(env),4M(kernel),-(rootfs)"
> >  CONFIG_CMD_UBI=y
> > -CONFIG_ISO_PARTITION=y
> >  CONFIG_OF_CONTROL=y
> >  CONFIG_ENV_OVERWRITE=y
> >  CONFIG_ENV_IS_IN_NAND=y
> > @@ -68,6 +57,5 @@ CONFIG_DM_RTC=y
> >  CONFIG_RTC_MV=y
> >  CONFIG_USB=y
> >  CONFIG_USB_EHCI_HCD=y
> > -CONFIG_USB_STORAGE=y
> >  CONFIG_LZMA=y
> >  CONFIG_BZIP2=y
> > diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
> > index 4e0b3c663c..c08d29892c 100644
> > --- a/include/configs/sheevaplug.h
> > +++ b/include/configs/sheevaplug.h
> > @@ -12,13 +12,23 @@
> >
> >  #include "mv-common.h"
> >
> > +#define KERNEL_ADDR_R  __stringify(0x800000)
> > +#define FDT_ADDR_R     __stringify(0x2c00000)
> > +#define RAMDISK_ADDR_R __stringify(0x01100000)
> > +#define SCRIPT_ADDR_R  __stringify(0x200000)
> > +
> > +#define LOAD_ADDRESS_ENV_SETTINGS \
> > +       "kernel_addr_r=" KERNEL_ADDR_R "\0" \
> > +       "fdt_addr_r=" FDT_ADDR_R "\0" \
> > +       "ramdisk_addr_r=" RAMDISK_ADDR_R "\0" \
> > +       "scriptaddr=" SCRIPT_ADDR_R "\0"
> >  /*
> >   *  Environment variables configurations
> >   */
> > -#define CFG_EXTRA_ENV_SETTINGS "x_bootargs=console"    \
> > -       "=ttyS0,115200 mtdparts=" CONFIG_MTDPARTS_DEFAULT       \
> > -       "x_bootcmd_kernel=nand read 0x6400000 0x100000 0x400000\0" \
> > -       "x_bootcmd_usb=usb start\0" \
> > -       "x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"
> > +#define CFG_EXTRA_ENV_SETTINGS \
> > +       LOAD_ADDRESS_ENV_SETTINGS \
> > +       "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
> > +       "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
> > +       "console=ttyS0,115200\0"
> >
> >  #endif /* _CONFIG_SHEEVAPLUG_H */
> > --
> > 2.39.5
> >
>
> REgards,
> Simon


More information about the U-Boot mailing list