[PATCH] treewide: Remove empty board_init() function from all boards

Peng Fan peng.fan at nxp.com
Mon Jul 21 04:18:56 CEST 2025


> Subject: [PATCH] treewide: Remove empty board_init() function from
> all boards
> 
> Commit 86acdce2ba88 ("common: add config for board_init() call")
> introduced CONFIG_BOARD_INIT option. This option can be disabled
> for the
> boards where board_init() function is not needed. Remove empty
> board_init() calls for all boards where it's possible, and disable
> CONFIG_BOARD_INIT in all related defconfigs.
> 
> This cleanup was made semi-automatically using these scripts: [1].
> 
> No functional change, but the binary size for the modified boards is
> reduced a bit.
> 
> Signed-off-by: Sam Protsenko <semen.protsenko at linaro.org>
> ---
> 
> Although I did this cleanup as carefully as I could, and ran buildman
> for all changed boards/configs, I wasn't able to check some boards,
> because the build process for those boards is complicated and
> buildman
> tool just fails for those when ran locally. So I'd recommend to run a CI
> job (buildman) for this patch to make sure it's clean before actually
> merging it.
> 
> There are only two remaining board files having empty board_init()
> function:
> 
>     $ grep -Pzrl "\bboard_init\(void\)\n{\n.*return 0;\n}\n" board/
> 
>     board/BuR/zynq/common/board.c
>     board/renesas/common/rcar64-common.c
> 
> The first one only has empty board_init() in case of U-Boot proper
> build, but it's not empty in case of SPL build. The second one has
> __weak board_init(), so it should be left as is, as it's a common board
> file which can be used by specific board files later.
> 
> This patch only reworks board/ directory, so arch/ has to be handled
> separately later.
> 
>  board/freescale/imx8mp_evk/imx8mp_evk.c                     | 6 ------
>  board/freescale/imx91_evk/imx91_evk.c                       | 5 -----
>  board/freescale/imx93_qsb/imx93_qsb.c                       | 5 -----
>  board/freescale/imx95_evk/imx95_evk.c                       | 5 -----
>  configs/imx8mp_evk_defconfig                                | 1 +
>  configs/imx91_11x11_evk_defconfig                           | 2 +-
>  configs/imx91_11x11_evk_inline_ecc_defconfig                | 2 +-
>  configs/imx93_9x9_qsb_defconfig                             | 1 +
>  configs/imx93_9x9_qsb_inline_ecc_defconfig                  | 1 +
>  configs/imx95_19x19_evk_defconfig                           | 2 +-

Acked-by: Peng Fan <peng.fan at nxp.com>  #NXP boards


More information about the U-Boot mailing list