Re: [PATCH] configs: meson64: Ensure commands for boot targets are available

[email protected]
Newsgroups io.groups.u-boot-amlogic
Organization Linaro
Message-ID <[email protected]>
On 12/10/2024 10:03, Callum Parsey via groups.io wrote:
> When populating BOOT_TARGET_DEVICES on Amlogic Meson platforms, verify
> that the shell commands for accessing the relevant media have been
> enabled in the build configuration.
> 
> This was already being done for USB, NVME and SCSI devices, but not
> for MMC devices or network boot. This meant that configuring U-Boot
> without the networking or MMC subsystems/drivers would cause an error
> to be thrown during preprocessing.
> 
> Signed-off-by: Callum Parsey <[email protected]>
> ---
>   include/configs/meson64.h | 28 +++++++++++++++++++++++-----
>   1 file changed, 23 insertions(+), 5 deletions(-)
> 
> diff --git a/include/configs/meson64.h b/include/configs/meson64.h
> index ccb8ea2e71..f3275b37a5 100644
> --- a/include/configs/meson64.h
> +++ b/include/configs/meson64.h
> @@ -77,6 +77,15 @@
>   	#define BOOTENV_DEV_NAME_USB_DFU(devtypeu, devtypel, instance)
>   #endif
>   
> +#ifdef CONFIG_CMD_MMC
> +	#define BOOT_TARGET_MMC(func) \
> +		func(MMC, mmc, 0) \
> +		func(MMC, mmc, 1) \
> +		func(MMC, mmc, 2)
> +#else
> +	#define BOOT_TARGET_MMC(func)
> +#endif
> +
>   #ifdef CONFIG_CMD_USB
>   #define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
>   #else
> @@ -95,18 +104,27 @@
>   	#define BOOT_TARGET_SCSI(func)
>   #endif
>   
> +#if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE)
> +	#define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
> +	#define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
> +#elif defined(CONFIG_CMD_DHCP)
> +	#define BOOT_TARGET_PXE(func)
> +	#define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
> +#else
> +	#define BOOT_TARGET_PXE(func)
> +	#define BOOT_TARGET_DHCP(func)
> +#endif
> +
>   #ifndef BOOT_TARGET_DEVICES
>   #define BOOT_TARGET_DEVICES(func) \
>   	func(ROMUSB, romusb, na)  \
>   	func(USB_DFU, usbdfu, na)  \
> -	func(MMC, mmc, 0) \
> -	func(MMC, mmc, 1) \
> -	func(MMC, mmc, 2) \
> +	BOOT_TARGET_MMC(func) \
>   	BOOT_TARGET_DEVICES_USB(func) \
>   	BOOT_TARGET_NVME(func) \
>   	BOOT_TARGET_SCSI(func) \
> -	func(PXE, pxe, na) \
> -	func(DHCP, dhcp, na)
> +	BOOT_TARGET_PXE(func) \
> +	BOOT_TARGET_DHCP(func)
>   #endif
>   
>   #define BOOTM_SIZE		__stringify(0x1700000)

Reviewed-by: Neil Armstrong <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.