buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
From: Julien Olivain <ju.o@free.fr>
To: "Sébastien Szymanski" <sebastien.szymanski@armadeus.com>
Cc: Gary Bisson <bisson.gary@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Refik Tuzakli <tuzakli.refik@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v3 3/3] configs/freescale_imx93evk: new defconfig
Date: Wed, 10 Jan 2024 23:07:43 +0100	[thread overview]
Message-ID: <84d1ae2d5acff1b1d56fbf726d03af6c@free.fr> (raw)
In-Reply-To: <20240109172600.12811-4-sebastien.szymanski@armadeus.com>

Hi Sébastien, All,

Thanks for the update!

I successfully built this freescale_imx93evk_defconfig
and booted on the NXP i.MX93 EVK board, with the patch
series applied on branch master at commit ef0fa98.


On 09/01/2024 18:26, Sébastien Szymanski wrote:
> This patch adds support for the NXP i.MX 93 11x11 EVK board [1].
> 
> [1] 
> https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-93-evaluation-kit:i.MX93EVK
> 

Reviewed-by: Julien Olivain <ju.o@free.fr>
Tested-by: Julien Olivain <ju.o@free.fr>
[Julien: tested on NXP board i.MX93EVK, cpu rev A1, board rev B]

> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
> 
> Changes for v3:
>  - BR2_PACKAGE_FIRMWARE_SENTINEL=y -> BR2_PACKAGE_FIRMWARE_ELE_IMX=y
>  - add a note about the debug UART in the readme.txt file (Julien 
> Olivain)
>  - add BR2_TARGET_UBOOT_NEEDS_OPENSSL=y and
>    BR2_TARGET_UBOOT_NEEDS_GNUTLS=y to the defconfig file (Julien 
> Olivain)
>  - bump ATF, U-Boot and Linux to latest NXP release lf-6.1.55-2.2.0
>    (Julien Olivain)
> 
> Changes for v2:
>  - none
> 
>  .../common/imx/genimage.cfg.template_imx9     | 41 ++++++++++
>  .../common/imx/imx9-bootloader-prepare.sh     | 34 ++++++++
>  board/freescale/common/imx/post-image.sh      |  4 +
>  board/freescale/imx93evk/readme.txt           | 77 +++++++++++++++++++
>  configs/freescale_imx93evk_defconfig          | 39 ++++++++++
>  5 files changed, 195 insertions(+)
>  create mode 100644 
> board/freescale/common/imx/genimage.cfg.template_imx9
>  create mode 100755 
> board/freescale/common/imx/imx9-bootloader-prepare.sh
>  create mode 100644 board/freescale/imx93evk/readme.txt
>  create mode 100644 configs/freescale_imx93evk_defconfig
> 
> diff --git a/board/freescale/common/imx/genimage.cfg.template_imx9 
> b/board/freescale/common/imx/genimage.cfg.template_imx9
> new file mode 100644
> index 000000000000..10e192ce5774
> --- /dev/null
> +++ b/board/freescale/common/imx/genimage.cfg.template_imx9
> @@ -0,0 +1,41 @@
> +# Minimal SD card image for the Freescale iMX9 boards
> +#
> +# We mimic the .sdcard Freescale's image format:
> +# * the SD card must have 32 kB free space at the beginning,
> +# * U-Boot is integrated into imx9-boot-sd.bin and is dumped as is,
> +# * a FAT partition at offset 8MB is containing Image and DTB files
> +# * a single root filesystem partition is required (ext2, ext3 or 
> ext4)
> +#
> +
> +image boot.vfat {
> +  vfat {
> +    label = "boot"
> +    files = {
> +      %FILES%
> +    }
> +  }
> +  size = 64M
> +}
> +
> +image sdcard.img {
> +  hdimage {
> +  }
> +
> +  partition imx-boot {
> +    in-partition-table = "no"
> +    image = "imx9-boot-sd.bin"
> +    offset = %IMXOFFSET%
> +  }
> +
> +  partition boot {
> +    partition-type = 0xC
> +    bootable = "true"
> +    image = "boot.vfat"
> +    offset = 8M
> +  }
> +
> +  partition rootfs {
> +    partition-type = 0x83
> +    image = "rootfs.ext2"
> +  }
> +}
> diff --git a/board/freescale/common/imx/imx9-bootloader-prepare.sh 
> b/board/freescale/common/imx/imx9-bootloader-prepare.sh
> new file mode 100755
> index 000000000000..4ff92fa4cd23
> --- /dev/null
> +++ b/board/freescale/common/imx/imx9-bootloader-prepare.sh
> @@ -0,0 +1,34 @@
> +#!/usr/bin/env bash
> +
> +main ()
> +{
> +	SPL_LOAD_ADDR=0x2049A000
> +	ATF_LOAD_ADDR=0x204E0000
> +	if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91=y$" 
> ${BR2_CONFIG}; then
> +		SPL_LOAD_ADDR=0x204A0000
> +		ATF_LOAD_ADDR=0x204C0000
> +	fi
> +
> +	dd if=${BINARIES_DIR}/u-boot-spl.bin 
> of=${BINARIES_DIR}/u-boot-spl-padded.bin bs=4 conv=sync
> +	cat ${BINARIES_DIR}/u-boot-spl-padded.bin ${BINARIES_DIR}/ddr_fw.bin 
> > ${BINARIES_DIR}/u-boot-spl-ddr.bin
> +
> +	${HOST_DIR}/bin/mkimage_imx8 -commit > ${BINARIES_DIR}/mkimg.commit
> +        cat ${BINARIES_DIR}/u-boot.bin ${BINARIES_DIR}/mkimg.commit > 
> ${BINARIES_DIR}/u-boot-hash.bin
> +	rm -f ${BINARIES_DIR}/mkimg.commit
> +
> +	if grep -Eq "^BR2_TARGET_OPTEE_OS=y$" ${BR2_CONFIG}; then
> +		${HOST_DIR}/bin/mkimage_imx8 -soc IMX9 -c -ap 
> ${BINARIES_DIR}/bl31.bin a35 ${ATF_LOAD_ADDR} -ap 
> ${BINARIES_DIR}/u-boot-hash.bin a35 0x80200000 -ap 
> ${BINARIES_DIR}/tee.bin a35 0x96000000 -out 
> ${BINARIES_DIR}/u-boot-atf-container.img
> +	else
> +		${HOST_DIR}/bin/mkimage_imx8 -soc IMX9 -c -ap 
> ${BINARIES_DIR}/bl31.bin a35 ${ATF_LOAD_ADDR} -ap 
> ${BINARIES_DIR}/u-boot-hash.bin a35 0x80200000 -out 
> ${BINARIES_DIR}/u-boot-atf-container.img
> +	fi
> +
> +	${HOST_DIR}/bin/mkimage_imx8 -soc IMX9 -append 
> ${BINARIES_DIR}/ahab-container.img -c -ap 
> ${BINARIES_DIR}/u-boot-spl-ddr.bin a35 ${SPL_LOAD_ADDR} -out 
> ${BINARIES_DIR}/imx9-boot-sd.bin
> +
> +	flashbin_size=$(wc -c ${BINARIES_DIR}/imx9-boot-sd.bin | awk '{print 
> $1}')
> +	pad_cnt=$(($((flashbin_size + 0x400 - 1)) / 0x400))
> +	dd if=${BINARIES_DIR}/u-boot-atf-container.img 
> of=${BINARIES_DIR}/imx9-boot-sd.bin bs=1K seek=${pad_cnt}
> +
> +	exit $?
> +}
> +
> +main $@
> diff --git a/board/freescale/common/imx/post-image.sh 
> b/board/freescale/common/imx/post-image.sh
> index c359ef6032a6..3df7e820938b 100755
> --- a/board/freescale/common/imx/post-image.sh
> +++ b/board/freescale/common/imx/post-image.sh
> @@ -48,6 +48,10 @@ genimage_type()
>  		echo "genimage.cfg.template_imx8"
>  	elif grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8DXL=y$" 
> ${BR2_CONFIG}; then
>  		echo "genimage.cfg.template_imx8"
> +	elif grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX91=y$" 
> ${BR2_CONFIG}; then
> +		echo "genimage.cfg.template_imx9"
> +	elif grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93=y$" 
> ${BR2_CONFIG}; then
> +		echo "genimage.cfg.template_imx9"
>  	elif grep -Eq "^BR2_LINUX_KERNEL_INSTALL_TARGET=y$" ${BR2_CONFIG}; 
> then
>  		if grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
>  		    echo "genimage.cfg.template_no_boot_part_spl"
> diff --git a/board/freescale/imx93evk/readme.txt 
> b/board/freescale/imx93evk/readme.txt
> new file mode 100644
> index 000000000000..1173de39dbb1
> --- /dev/null
> +++ b/board/freescale/imx93evk/readme.txt
> @@ -0,0 +1,77 @@
> +*********************
> +NXP i.MX93 EVK board
> +*********************
> +
> +This file documents the Buildroot support for the i.MX 93 EVK board.
> +
> +Build
> +=====
> +
> +First, configure Buildroot for the i.MX 93 EVK board:
> +
> +  make freescale_imx93evk_defconfig
> +
> +Build all components:
> +
> +  make
> +
> +You will find in output/images/ the following files:
> +  - ahab-container.img
> +  - bl31.bin
> +  - boot.vfat
> +  - ddr_fw.bin
> +  - Image
> +  - imx93-11x11-evk.dtb
> +  - imx9-boot-sd.bin
> +  - lpddr4_pmu_train_fw.bin
> +  - rootfs.ext2
> +  - rootfs.ext4
> +  - rootfs.tar
> +  - sdcard.img
> +  - u-boot-atf-container.img
> +  - u-boot.bin
> +  - u-boot-hash.bin
> +  - u-boot-spl.bin
> +  - u-boot-spl-ddr.bin
> +  - u-boot-spl-padded.bin
> +
> +Create a bootable SD card
> +=========================
> +
> +To determine the device associated to the SD card have a look in the
> +/proc/partitions file:
> +
> +  cat /proc/partitions
> +
> +Buildroot prepares a bootable "sdcard.img" image in the output/images/
> +directory, ready to be dumped on a SD card. Launch the following
> +command as root:
> +
> +  dd if=output/images/sdcard.img of=/dev/<your-sd-device>
> +
> +*** WARNING! This will destroy all the card content. Use with care! 
> ***
> +
> +For details about the medium image layout, see the definition in
> +board/freescale/common/imx/genimage.cfg.template_imx9.
> +
> +Boot the i.MX 93 EVK board
> +===============================
> +
> +To boot your newly created system (refer to the i.MX 93 EVK 
> Documentation
> +[1] for guidance):
> +- insert the SD card in the SD slot of the board;
> +- Configure the switches as follows:
> +SW1301: 0100 SW1301[1-4]
> +- put a micro USB cable into the Debug USB Port and connect using a 
> terminal
> +  emulator at 115200 bps, 8n1;
> +- power on the board.
> +
> +Note: the debug USB connector presents 4 UARTs (for example 
> /dev/ttyUSB[0-3]),
> +the Cortex-A55 UART should be the 3rd one (in the previous example, 
> /dev/ttyUSB2).
> +Refer to the documentation [1] for more details.
> +
> +Enjoy!
> +
> +References
> +==========
> +[1] 
> https://www.nxp.com/document/guide/getting-started-with-the-i-mx93-evk:GS-IMX93EVK
> diff --git a/configs/freescale_imx93evk_defconfig 
> b/configs/freescale_imx93evk_defconfig
> new file mode 100644
> index 000000000000..34baf04c88db
> --- /dev/null
> +++ b/configs/freescale_imx93evk_defconfig
> @@ -0,0 +1,39 @@
> +BR2_aarch64=y
> +BR2_cortex_a55=y
> +BR2_ARM_FPU_VFPV4D16=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y
> +BR2_TARGET_GENERIC_GETTY_PORT="ttyLP0"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/imx9-bootloader-prepare.sh 
> board/freescale/common/imx/post-image.sh"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
> +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call 
> github,nxp-imx,linux-imx,lf-6.1.55-2.2.0)/linux-imx-lf-6.1.55-2.2.0.tar.gz"
> +BR2_LINUX_KERNEL_DEFCONFIG="imx_v8"
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx93-11x11-evk"
> +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +BR2_PACKAGE_FREESCALE_IMX=y
> +BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX93=y
> +BR2_PACKAGE_FIRMWARE_ELE_IMX=y
> +BR2_PACKAGE_FIRMWARE_IMX=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION="$(call 
> github,nxp-imx,imx-atf,lf-6.1.55-2.2.0)/imx-atf-lf-6.1.55-2.2.0.tar.gz"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx93"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
> +BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call 
> github,nxp-imx,uboot-imx,lf-6.1.55-2.2.0)/uboot-imx-lf-6.1.55-2.2.0.tar.gz"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx93_11x11_evk"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
> +BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
> +BR2_TARGET_UBOOT_SPL=y
> +BR2_PACKAGE_HOST_DOSFSTOOLS=y
> +BR2_PACKAGE_HOST_GENIMAGE=y
> +BR2_PACKAGE_HOST_IMX_MKIMAGE=y
> +BR2_PACKAGE_HOST_MTOOLS=y
> +BR2_PACKAGE_HOST_UBOOT_TOOLS=y
> --
> 2.41.0

Best regards,

Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2024-01-10 22:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 17:25 [Buildroot] [PATCH v3 0/3] i.MX91 and i.MX93 support Sébastien Szymanski
2024-01-09 17:25 ` [Buildroot] [PATCH v3 1/3] package/freescale-imx: add i.MX91 and i.MX93 SoC support Sébastien Szymanski
2024-01-22 11:01   ` Gary Bisson
2024-01-09 17:25 ` [Buildroot] [PATCH v3 2/3] package/freescale-imx/firmware-ele-imx: new package Sébastien Szymanski
2024-01-22 11:05   ` Gary Bisson
2024-01-09 17:26 ` [Buildroot] [PATCH v3 3/3] configs/freescale_imx93evk: new defconfig Sébastien Szymanski
2024-01-10 22:07   ` Julien Olivain [this message]

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=84d1ae2d5acff1b1d56fbf726d03af6c@free.fr \
    --to=ju.o@free.fr \
    --cc=bisson.gary@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=festevam@gmail.com \
    --cc=sebastien.szymanski@armadeus.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tuzakli.refik@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).