All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francesco Valla <francesco@valla.it>
To: Joseph Guo <qijian.guo@nxp.com>
Cc: "NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	u-boot@lists.denx.de, Stefano Babic <sbabic@nabladev.com>,
	Fabio Estevam <festevam@gmail.com>, Tom Rini <trini@konsulko.com>,
	Peng Fan <peng.fan@nxp.com>,
	Sumit Garg <sumit.garg@oss.qualcomm.com>, Ye Li <ye.li@nxp.com>,
	Alice Guo <alice.guo@nxp.com>, Adam Ford <aford173@gmail.com>,
	Sam Protsenko <semen.protsenko@linaro.org>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Simon Glass <sjg@chromium.org>,
	Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>,
	Jacky Bai <ping.bai@nxp.com>, Joseph Guo <qijian.guo@oss.nxp.com>,
	Justin Jiang <justin.jiang@nxp.com>
Subject: Re: [PATCH v3 2/2] imx: Support i.MX91 11x11 FRDM board
Date: Tue, 9 Dec 2025 22:37:51 +0100	[thread overview]
Message-ID: <aTiWrz0RMo7umwbQ@bywater> (raw)
In-Reply-To: <20251209-imx91_frdm-v3-2-02303eb0c1c3@nxp.com>

Hello Joseph,

On Tue, Dec 09, 2025 at 12:17:49PM +0900, Joseph Guo wrote:
> Add i.MX91 11x11 FRDM Board support.
>  - Four ddr scripts included w/o inline ecc feature. Support
>    both 1gb and 2gb DDR
>  - SDHC/EQOS/I2C/UART supported
>  - PCA9451 supported, default nominal drive mode
>  - Documentation added.
> 
> Signed-off-by: Joseph Guo <qijian.guo@nxp.com>
> ---
> Changes in v2:
> - correct commit message 'EVK' to 'FRDM'
> - use #include in ecc config file
> - add ecc description in README
> - drop extraneous includes
> - rename 'imx91_frdm.rst' to 'imx91_11x11_frdm.rst'
> - drop IMX91_FRDM_LPDDR4 symbol
> - drop bootph- property
> 
> Changes in v3:
> - drop usdhc2 in uboot dts
> - add workaround to clear ptn5110 alert in board init
> - /s/EFI_HAVE_CAPSULE_SUPPORT/ENV_IS_IN_MMC
> - drop fec and ethphy1 in u-boot in uboot dts
> - drop spi flash related config
> - drop m-core enviroment variable
> - change PHYS_SDRAM_SIZE macro to SZ_2G
> ---
>  arch/arm/dts/imx91-11x11-frdm-u-boot.dtsi          |   34 +
>  arch/arm/mach-imx/imx9/Kconfig                     |    9 +
>  board/freescale/imx91_frdm/Kconfig                 |   12 +
>  board/freescale/imx91_frdm/MAINTAINERS             |    7 +
>  board/freescale/imx91_frdm/Makefile                |   16 +
>  board/freescale/imx91_frdm/imx91_frdm.c            |   74 +
>  board/freescale/imx91_frdm/imx91_frdm.env          |   87 +
>  .../imx91_frdm/lpddr4_2400mts_1gb_timing.c         | 1996 ++++++++++++++++++++
>  .../imx91_frdm/lpddr4_2400mts_2gb_timing.c         | 1996 ++++++++++++++++++++
>  .../imx91_frdm/lpddr4_2400mts_ecc_1gb_timing.c     | 1996 ++++++++++++++++++++
>  .../imx91_frdm/lpddr4_2400mts_ecc_2gb_timing.c     | 1996 ++++++++++++++++++++
>  board/freescale/imx91_frdm/lpddr4_timing.h         |   12 +
>  board/freescale/imx91_frdm/spl.c                   |  193 ++
>  configs/imx91_11x11_frdm_defconfig                 |  138 ++
>  configs/imx91_11x11_frdm_inline_ecc_defconfig      |    3 +
>  doc/board/nxp/imx91_11x11_frdm.rst                 |  100 +
>  doc/board/nxp/index.rst                            |    1 +
>  include/configs/imx91_frdm.h                       |   25 +
>  18 files changed, 8695 insertions(+)
> 

[snip]

> diff --git a/board/freescale/imx91_frdm/imx91_frdm.c b/board/freescale/imx91_frdm/imx91_frdm.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..453f19e7f5f1d06e9ac453933ea80c66e6368c81
> --- /dev/null
> +++ b/board/freescale/imx91_frdm/imx91_frdm.c
> @@ -0,0 +1,74 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright 2025 NXP
> + */
> +
> +#include <env.h>
> +#include <asm/arch/sys_proto.h>
> +#include <i2c.h>
> +#include <dm.h>
> +
> +#define TCPC_ALERT 0x10
> +#define TCPC_ALERT_MASK 0x12
> +#define TCPC_FAULT_STATUS_MASK 0x15
> +#define USB_I2C_BUS 2
> +#define USB_I2C_ADDR 0x50
> +
> +static int clear_pd_alert(void)
> +{

Given this is a workaround, maybe a comment explaining why this is
needed would be useful.

> +	struct udevice *bus;
> +	struct udevice *i2c_dev = NULL;
> +	int ret;
> +	u8 buffer_0[2] = {0, 0};
> +	u8 buffer_1[2] = {0xff, 0xff};
> +
> +	ret = uclass_get_device_by_seq(UCLASS_I2C, USB_I2C_BUS, &bus);
> +	if (ret) {
> +		printf("Failed to get I2C bus %d\n", USB_I2C_BUS);
> +		return ret;
> +	}
> +
> +		ret = dm_i2c_probe(bus, USB_I2C_ADDR, 0, &i2c_dev);
> +		if (ret)
> +			printf("Can't find USB PD device at 0x%02x\n", USB_I2C_ADDR);
> +
> +		/* Mask all alert status*/
> +		ret = dm_i2c_write(i2c_dev, TCPC_ALERT_MASK, buffer_0, 2);
> +		if (ret) {
> +			printf("%s dm_i2c_write failed: %d\n", __func__, ret);
> +			return 0;
> +		}
> +
> +		ret = dm_i2c_write(i2c_dev, TCPC_FAULT_STATUS_MASK, buffer_0, 2);
> +		if (ret) {
> +			printf("%s dm_i2c_write failed: %d\n", __func__, ret);
> +			return 0;
> +		}
> +
> +		ret = dm_i2c_write(i2c_dev, TCPC_ALERT, buffer_1, 2);
> +		if (ret) {
> +			printf("%s dm_i2c_write failed: %d\n", __func__, ret);
> +			return 0;
> +		}
> +

Indentation is off here.

> +	return 0;
> +}
> +
> +int board_late_init(void)
> +{
> +	if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC))
> +		board_late_mmc_env_init();
> +
> +	env_set("sec_boot", "no");
> +
> +	if (IS_ENABLED(CONFIG_AHAB_BOOT))
> +		env_set("sec_boot", "yes");
> +
> +	if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) {
> +		env_set("board_name", "11X11_FRDM");
> +		env_set("board_rev", "iMX91");
> +	}
> +
> +	clear_pd_alert();
> +	return 0;
> +}
> diff --git a/board/freescale/imx91_frdm/imx91_frdm.env b/board/freescale/imx91_frdm/imx91_frdm.env
> new file mode 100644
> index 0000000000000000000000000000000000000000..fa5e22f0508f3deb676ed1919146c3c4997a3c97
> --- /dev/null
> +++ b/board/freescale/imx91_frdm/imx91_frdm.env
> @@ -0,0 +1,87 @@
> +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
> +
> +boot_targets=mmc0 mmc1
> +boot_fit=no
> +bootm_size=0x10000000
> +cntr_addr=0x98000000
> +cntr_file=os_cntr_signed.bin
> +console=ttyLP0,115200 earlycon
> +fdt_addr_r=0x83000000
> +fdt_addr=0x83000000
> +fdtfile=CONFIG_DEFAULT_FDT_FILE
> +image=Image
> +mmcdev=CONFIG_ENV_MMC_DEVICE_INDEX
> +mmcpart=1
> +mmcroot=/dev/mmcblk1p2 rootwait rw
> +mmcautodetect=yes
> +mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot}
> +loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
> +loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}
> +loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}
> +auth_os=auth_cntr ${cntr_addr}
> +sec_boot=no
> +boot_os=booti ${loadaddr} - ${fdt_addr_r}
> +mmcboot=
> +	echo Booting from mmc ...;
> +	run mmcargs;
> +	if test ${sec_boot} = yes; then
> +		if run true; then
> +			run boot_os;
> +		else
> +			echo ERR: failed to authenticate;
> +		fi;
> +	else
> +		if run loadfdt; then
> +			run boot_os;
> +		else
> +			echo WARN: Cannot load the DT;
> +		fi;
> +	fi;
> +netargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=/dev/nfs
> +	ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
> +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 true; then
> +			run boot_os;
> +		else
> +			echo ERR: failed to authenticate;
> +		fi;
> +	else
> +		${get_cmd} ${loadaddr} ${image};
> +		if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then
> +			run boot_os;
> +		else
> +			echo WARN: Cannot load the DT;
> +		fi;
> +	fi;
> +bsp_bootcmd=
> +	echo Running BSP bootcmd ...;
> +	mmc dev ${mmcdev};
> +	if mmc rescan; then
> +		if run loadbootscript; then
> +			run bootscript;
> +		else

Neither loadbootscript nor bootscript are defined; this leads to the
following error on startup:

    ## Error: "loadbootscript" not defined

I saw that this is shared by several other i.MX boards, but maybe it's
worth fixing.

> +			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;
> +scriptaddr=0x83500000


I also get on startup:

    Failed to update cpu-thermal trip(s)

But this is probably due to lack of thermal support at Linux kernel side
and needs a fix there?


Thank you

Regards,
Francesco


  reply	other threads:[~2025-12-09 21:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09  3:17 [PATCH v3 0/2] Add FRDM-IMX91 initial support Joseph Guo
2025-12-09  3:17 ` [PATCH v3 1/2] arm64: dts: add NXP FRDM-IMX91 device tree Joseph Guo
2025-12-09  3:17 ` [PATCH v3 2/2] imx: Support i.MX91 11x11 FRDM board Joseph Guo
2025-12-09 21:37   ` Francesco Valla [this message]
2025-12-10  6:09     ` Joseph Guo (OSS)
2025-12-10  6:27       ` Joseph Guo (OSS)
2025-12-10  7:24         ` Francesco Valla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aTiWrz0RMo7umwbQ@bywater \
    --to=francesco@valla.it \
    --cc=aford173@gmail.com \
    --cc=alice.guo@nxp.com \
    --cc=festevam@gmail.com \
    --cc=justin.jiang@nxp.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=mathieu.dubois-briand@bootlin.com \
    --cc=peng.fan@nxp.com \
    --cc=ping.bai@nxp.com \
    --cc=qijian.guo@nxp.com \
    --cc=qijian.guo@oss.nxp.com \
    --cc=sbabic@nabladev.com \
    --cc=semen.protsenko@linaro.org \
    --cc=sjg@chromium.org \
    --cc=sumit.garg@oss.qualcomm.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.