u-boot/common/spl
Sean Anderson 38ef64e6ce spl: nand: Set bl_len to page size
Since commit 34793598c8 ("mtd: nand: mxs_nand_spl: Remove the page aligned
access") there are no longer any users of nand_get_mtd. However, it is
still important to know what the page size is so we can allocate a
large-enough buffer. If the image size is not page-aligned, we will go off
the end of the buffer and clobber some memory.

Introduce a new function nand_page_size which returns the page size. For
most drivers it is easy to determine the page size. However, a few need to
be modified since they only keep the page size around temporarily.

It's possible that this patch could cause a regression on some platforms if
the offset is non-aligned and there is invalid address space immediately
before the load address. spl_load_legacy_img does not (except when
compressing) respect bl_len, so only boards with SPL_LOAD_FIT (8 boards) or
SPL_LOAD_IMX_CONTAINER (none in tree) would be affected.

defconfig               CONFIG_TEXT_BASE
======================= ================
am335x_evm              0x80800000
am43xx_evm              0x80800000
am43xx_evm_rtconly      0x80800000
am43xx_evm_usbhost_boot 0x80800000
am43xx_hs_evm           0x80800000
dra7xx_evm              0x80800000
gwventana_nand          0x17800000
imx8mn_bsh_smm_s2       0x40200000

All the sitara boards have DDR mapped at 0x80000000. gwventana is an i.MX6Q
which has DDR at 0x10000000. I don't have the IMX8MNRM handy, but on the
i.MX8M DDR starts at 0x40000000. Therefore all of these boards can handle a
little underflow.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-11-16 12:43:48 -05:00
..
Kconfig sunxi: add Allwinner R528/T113 SoC support 2023-10-22 23:41:52 +01:00
Kconfig.nxp spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_... 2023-10-06 14:38:11 -04:00
Kconfig.tpl Kconfigs: Correct default of "0" on hex type entries 2023-08-09 09:21:42 -04:00
Kconfig.vpl vbe: Add Kconfig options for VPL 2022-10-31 11:03:59 -04:00
Makefile Move i.MX8 container image loading support to common/spl 2023-10-17 20:50:52 -04:00
spl.c spl: Use map_sysmem where appropriate 2023-10-17 20:50:52 -04:00
spl_atf.c spl: add __noreturn attribute to spl_invoke_atf function 2023-10-09 15:24:31 -04:00
spl_blk_fs.c spl: Use map_sysmem where appropriate 2023-10-17 20:50:52 -04:00
spl_bootrom.c spl: pass args to board_return_to_bootrom 2019-10-08 16:35:16 +02:00
spl_dfu.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
spl_ext.c spl: Use map_sysmem where appropriate 2023-10-17 20:50:52 -04:00
spl_fat.c spl: Use map_sysmem where appropriate 2023-10-17 20:50:52 -04:00
spl_fit.c spl: riscv: add os type for next booting stage 2023-10-19 17:29:33 +08:00
spl_imx_container.c spl: Use map_sysmem where appropriate 2023-10-17 20:50:52 -04:00
spl_legacy.c spl: legacy: Honor bl_len when decompressing 2023-11-16 12:43:48 -05:00
spl_mmc.c u-boot-imx-20231024 2023-10-24 09:39:02 -04:00
spl_nand.c spl: nand: Set bl_len to page size 2023-11-16 12:43:48 -05:00
spl_net.c spl: Use map_sysmem where appropriate 2023-10-17 20:50:52 -04:00
spl_nor.c spl: Use map_sysmem where appropriate 2023-10-17 20:50:52 -04:00
spl_nvme.c spl: initialize PCI before booting 2023-07-30 18:53:08 +02:00
spl_onenand.c treewide: Drop image_header_t typedef 2022-09-29 16:07:57 -04:00
spl_opensbi.c spl: riscv: add os type for next booting stage 2023-10-19 17:29:33 +08:00
spl_optee.S Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
spl_ram.c spl: Tidy up load address in spl_ram 2023-09-19 11:36:26 -04:00
spl_sata.c spl: sata: Rework the loading case it not use IS_ENABLED(...) 2023-01-20 12:27:06 -05:00
spl_sdp.c common: Drop linux/printk.h from common header 2023-09-24 09:54:57 -04:00
spl_semihosting.c spl: add FIT support to semihosting boot method 2023-08-14 17:55:53 -04:00
spl_spi.c spl: Use map_sysmem where appropriate 2023-10-17 20:50:52 -04:00
spl_ubi.c spl: Rename SYS_SPL_ARGS_ADDR to SPL_PAYLOAD_ARGS_ADDR 2023-10-06 14:38:11 -04:00
spl_usb.c blk: Rename if_type to uclass_id 2022-09-25 08:30:05 -06:00
spl_xip.c spl: Rename SYS_SPL_ARGS_ADDR to SPL_PAYLOAD_ARGS_ADDR 2023-10-06 14:38:11 -04:00
spl_ymodem.c treewide: Drop image_header_t typedef 2022-09-29 16:07:57 -04:00