[PATCH 14/17] imx95_evk: add i.MX95 19x19 EVK board basic support

Fabio Estevam festevam at gmail.com
Wed Oct 16 13:36:12 CEST 2024


Hi Alice,

On Wed, Oct 16, 2024 at 4:19 AM Alice Guo <alice.guo at oss.nxp.com> wrote:
>
> From: Ye Li <ye.li at nxp.com>
>
> This patch adds i.MX95 19x19 EVK board basic support.
>
> Signed-off-by: Ye Li <ye.li at nxp.com>
> Signed-off-by: Alice Guo <alice.guo at nxp.com>
> Reviewed-by: Peng Fan <peng.fan at nxp.com>

A MAINTAINERS file is missing. CI flags this as an error.

Please make sure to run the series through CI before posting v2.

A general question: how is the flash.bin generated?

I don't see binman support here. Why?

We also need a doc/board/nxp/imx95_evk.rts file that explains how to
build and boot the board,
the firmware files it needs, etc.

> +++ b/board/freescale/imx95_evk/imx95_evk.c
> @@ -0,0 +1,75 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2023 NXP
> + */
> +
> +#include <env.h>
> +#include <init.h>
> +#include <asm/global_data.h>
> +#include <asm/arch-imx9/ccm_regs.h>
> +#include <asm/arch/clock.h>
> +#include <fdt_support.h>
> +#include <usb.h>
> +#include <dwc3-uboot.h>

Why do you add USB headers if there is no USB support?

> +#ifdef CONFIG_SCMI_FIRMWARE

Remove the ifdef and include the headers unconditionally.

> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +int board_early_init_f(void)
> +{
> +       /* UART1: A55, UART2: M33, UART3: M7 */
> +       init_uart_clk(0);

Shouldn't DM_SERIAL enable the UART clock?

> +#if CONFIG_IS_ENABLED(NET)
> +int board_phy_config(struct phy_device *phydev)
> +{
> +       if (phydev->drv->config)
> +               phydev->drv->config(phydev);
> +       return 0;

Is this needed?

> +
> +#ifdef CONFIG_OF_BOARD_SETUP
> +int ft_board_setup(void *blob, struct bd_info *bd)
> +{
> +       return 0;

This function is not useful and can be removed.
> +extern int imx9_probe_mu(void);

No extern in C files, please.

> +       printf("SOC: 0x%x\n", gd->arch.soc_rev);
> +       printf("LC: 0x%x\n", gd->arch.lifecycle);

Make this debug() instead.

> +CONFIG_SPL_POWER=y
> +CONFIG_SDP_LOADADDR=0x90400000
> +

No blank lines in defconfig, please.

Generate the defconfig via 'make savedefconfig'


> +/* Initial environment variables */
> +#define CFG_EXTRA_ENV_SETTINGS         \
> +       BOOTENV \
> +       AHAB_ENV \
> +       "initrd_addr=0x93800000\0" \
> +       "initrd_high=0xffffffffffffffff\0" \
> +       "emmc_dev=0\0"\
> +       "sd_dev=1\0" \
> +       "prepare_mcore=setenv mcore_clk clk-imx95.mcore_booted;\0" \
> +       "scriptaddr=0x93500000\0" \
> +       "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
> +       "image=Image\0" \
> +       "splashimage=0xA0000000\0" \
> +       "console=ttyLP0,115200 earlycon\0" \
> +       "fdt_addr_r=0x93000000\0"                       \
> +       "fdt_addr=0x93000000\0"                 \
> +       "fdt_high=0xffffffffffffffff\0"         \
> +       "cntr_addr=0xA8000000\0"                        \
> +       "cntr_file=os_cntr_signed.bin\0" \
> +       "boot_fit=no\0" \
> +       "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
> +       "bootm_size=0x10000000\0" \
> +       "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
> +       "mmcpart=1\0" \
> +       "mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
> +       "mmcautodetect=yes\0" \
> +       "mmcargs=setenv bootargs ${mcore_clk} console=${console} root=${mmcroot}\0 " \
> +       "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
> +       "bootscript=echo Running bootscript from mmc ...; " \
> +               "source\0" \
> +       "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
> +       "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}\0" \
> +       "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \
> +       "auth_os=auth_cntr ${cntr_addr}\0" \
> +       "boot_os=booti ${loadaddr} - ${fdt_addr_r};\0" \
> +       "mmcboot=echo Booting from mmc ...; " \
> +               "run mmcargs; " \
> +               "if test ${sec_boot} = yes; then " \
> +                       "if run auth_os; then " \
> +                               "run boot_os; " \
> +                       "else " \
> +                               "echo ERR: failed to authenticate; " \
> +                       "fi; " \
> +               "else " \
> +                       "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
> +                               "bootm ${loadaddr}; " \
> +                       "else " \
> +                               "if run loadfdt; then " \
> +                                       "run boot_os; " \
> +                               "else " \
> +                                       "echo WARN: Cannot load the DT; " \
> +                               "fi; " \
> +                       "fi;" \
> +               "fi;\0" \
> +       "netargs=setenv bootargs ${mcore_clk} console=${console} " \
> +               "root=/dev/nfs " \
> +               "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
> +       "netboot=echo Booting from net ...; " \
> +               "run netargs;  " \
> +               "if test ${ip_dyn} = yes; then " \
> +                       "setenv get_cmd dhcp; " \
> +               "else " \
> +                       "setenv get_cmd tftp; " \
> +               "fi; " \
> +               "if test ${sec_boot} = yes; then " \
> +                       "${get_cmd} ${cntr_addr} ${cntr_file}; " \
> +                       "if run auth_os; then " \
> +                               "run boot_os; " \
> +                       "else " \
> +                               "echo ERR: failed to authenticate; " \
> +                       "fi; " \
> +               "else " \
> +                       "${get_cmd} ${loadaddr} ${image}; " \
> +                       "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
> +                               "bootm ${loadaddr}; " \
> +                       "else " \
> +                               "if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then " \
> +                                       "run boot_os; " \
> +                               "else " \
> +                                       "echo WARN: Cannot load the DT; " \
> +                               "fi; " \
> +                       "fi;" \
> +               "fi;\0" \
> +       "bsp_bootcmd=echo Running BSP bootcmd ...; " \
> +               "mmc dev ${mmcdev}; if mmc rescan; then " \
> +                  "if run loadbootscript; then " \
> +                          "run bootscript; " \
> +                  "else " \
> +                          "if test ${sec_boot} = yes; then " \
> +                                  "if run loadcntr; then " \
> +                                          "run mmcboot; " \
> +                                  "else run netboot; " \
> +                                  "fi; " \
> +                           "else " \
> +                                  "if run loadimage; then " \
> +                                          "run mmcboot; " \
> +                                  "else run netboot; " \
> +                                  "fi; " \
> +                               "fi; " \
> +                  "fi; " \
> +          "fi;"

Move this to board/freescale/imx95_evk/imx95_evk.env


More information about the U-Boot mailing list