[PATCH u-boot-marvell v3 0/9] More verifications for kwbimage in SPL

Pali Rohár pali at kernel.org
Thu Jan 13 15:30:12 CET 2022


On Saturday 18 December 2021 10:16:25 Stefan Roese wrote:
> Hi Marek,
> Hi Pali,
> 
> working on a "next" branch, I noticed that this patch series fails
> on some non-MVEBU boards:

Hello! This patch series does not apply on master branch. I rebased
patches on master and hopefully also fixed this mentioned issue.

To ensure that there are no other compile errors, I started github CI:
https://github.com/u-boot/u-boot/pull/106

After tests pass I will send v4 to the list.

> [stefan at ryzen u-boot-marvell (next)]$ make da850evm_nand_defconfig
> #
> # configuration written to .config
> #
> [stefan at ryzen u-boot-marvell (next)]$ make -s -j20
> common/spl/spl_nand.c: In function 'spl_nand_load_image':
> common/spl/spl_nand.c:175:48: warning: passing argument 2 of
> 'spl_nand_load_element' makes pointer from integer without a cast
> [-Wint-conversion]
>   175 |         err = spl_nand_load_element(spl_image,
> spl_nand_get_uboot_raw_page(),
>       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                                                |
>       |                                                uint32_t {aka
> unsigned int}
> common/spl/spl_nand.c:68:58: note: expected 'struct spl_boot_device *' but
> argument is of type 'uint32_t' {aka 'unsigned int'}
>    68 |                                  struct spl_boot_device *bootdev,
>       |                                  ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
> common/spl/spl_nand.c:176:37: warning: passing argument 3 of
> 'spl_nand_load_element' makes integer from pointer without a cast
> [-Wint-conversion]
>   176 |                                     header);
>       |                                     ^~~~~~
>       |                                     |
>       |                                     struct image_header *
> common/spl/spl_nand.c:69:38: note: expected 'int' but argument is of type
> 'struct image_header *'
>    69 |                                  int offset, struct image_header
> *header)
>       |                                  ~~~~^~~~~~
> common/spl/spl_nand.c:175:15: error: too few arguments to function
> 'spl_nand_load_element'
>   175 |         err = spl_nand_load_element(spl_image,
> spl_nand_get_uboot_raw_page(),
>       |               ^~~~~~~~~~~~~~~~~~~~~
> common/spl/spl_nand.c:67:12: note: declared here
>    67 | static int spl_nand_load_element(struct spl_image_info *spl_image,
>       |            ^~~~~~~~~~~~~~~~~~~~~
> make[2]: *** [scripts/Makefile.build:253: spl/common/spl/spl_nand.o] Error 1
> make[1]: *** [scripts/Makefile.spl:515: spl/common/spl] Error 2
> make[1]: *** Waiting for unfinished jobs....
> 
> I'm droppping this series from my "next" branch for now.
> 
> Thanks,
> Stefan
> 
> On 12/14/21 14:22, Marek Behún wrote:
> > From: Marek Behún <marek.behun at nic.cz>
> > 
> > Hello Stefan,
> > 
> > this is v3 of series that adds more checks for kwbimage validity and
> > consistency to SPL, mainly checking image data checksum.
> > 
> > Changes since v2:
> > - changed the error message in patch 6 according to Pali's suggestion
> > - added R-B tags
> > 
> > Changes since v1:
> > - updated error messages as requested by Stefan
> > - fixed checkpatch warnings for uintN_t types (converted to preferred
> >    uN)
> > - added more checkpatch fixes
> > 
> > Marek
> > 
> > Marek Behún (4):
> >    arm: mvebu: spl: Print srcaddr in error message
> >    arm: mvebu: spl: Use preferred types u8/u16/u32 instead of uintN_t
> >    arm: mvebu: spl: Use IS_ENABLED() instead of #ifdef where possible
> >    arm: mvebu: spl: Fix 100 column exceeds
> > 
> > Pali Rohár (5):
> >    arm: mvebu: Check that kwbimage offset and blocksize are valid
> >    SPL: Add struct spl_boot_device parameter into
> >      spl_parse_board_header()
> >    arm: mvebu: Check that kwbimage blockid matches boot mode
> >    SPL: Add support for checking board / BootROM specific image types
> >    arm: mvebu: Check for kwbimage data checksum
> > 
> >   arch/arm/mach-mvebu/spl.c           | 153 +++++++++++++++++++---------
> >   arch/arm/mach-sunxi/spl_spi_sunxi.c |   2 +-
> >   common/spl/spl.c                    |  13 ++-
> >   common/spl/spl_ext.c                |   9 +-
> >   common/spl/spl_fat.c                |  11 +-
> >   common/spl/spl_legacy.c             |   3 +-
> >   common/spl/spl_mmc.c                |  43 +++++---
> >   common/spl/spl_nand.c               |   5 +-
> >   common/spl/spl_net.c                |   2 +-
> >   common/spl/spl_nor.c                |   4 +-
> >   common/spl/spl_onenand.c            |   2 +-
> >   common/spl/spl_ram.c                |   2 +-
> >   common/spl/spl_sata.c               |   9 +-
> >   common/spl/spl_sdp.c                |   2 +-
> >   common/spl/spl_spi.c                |   9 +-
> >   common/spl/spl_ubi.c                |   4 +-
> >   common/spl/spl_usb.c                |   4 +-
> >   common/spl/spl_xip.c                |   4 +-
> >   common/spl/spl_ymodem.c             |   4 +-
> >   drivers/usb/gadget/f_sdp.c          |  12 ++-
> >   include/sdp.h                       |   3 +-
> >   include/spl.h                       |   7 ++
> >   22 files changed, 201 insertions(+), 106 deletions(-)
> > 
> 
> Viele Grüße,
> Stefan Roese
> 
> -- 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list