All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	buildroot@buildroot.org
Cc: Ariel D'Alessandro <ariel.dalessandro@collabora.com>,
	Samuel Martin <s.martin49@gmail.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Giulio Benetti <giulio.benetti@benettiengineering.com>,
	michael@amarulasolutions.com, linux-amarula@amarulasolutions.com,
	Heiko Thiery <heiko.thiery@gmail.com>
Subject: Re: [Buildroot] [PATCH 2/3] board/bsh: add support for iMX8MN BSH SMM S2 board
Date: Sun, 19 Jun 2022 19:51:25 +0200	[thread overview]
Message-ID: <eada84a9-2cb9-69f9-de48-a04ce7a05f7a@mind.be> (raw)
In-Reply-To: <20220607072852.1007185-3-dario.binacchi@amarulasolutions.com>

  Hi Dario,

  A better subject line is:

configs/imx8mn_bsh_smm_s2_defconfig: new defconfig for BSH SMM S2

On 07/06/2022 09:28, Dario Binacchi wrote:
> BSH SMM S2 (SystemMaster S2) Board is an add-on board which provide
> input and output interfaces to a dedicated carrier board. It is designed
> mainly to provide graphical/video and connectivity interfaces to the
> appliance.
> 
> Board support package includes the following components:
> - mainline Linux kernel 5.18
> - mainline U-Boot 2022-07-rc2
> - default packages from buildroot
> 
> Patches applied to the Linux kernel and U-Boot have been submitted but
> not merged yet.

  How about now?

> 
> Michael Trimarchi has been added as co-maintainer.

  This is redundant with the Co-developed-by line below.


> Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>

  There is no agreed standard, but I think Co-authored-by is used more.

> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

[snip]
> diff --git a/board/bsh/imx8mn-bsh-smm-s2/flash.sh b/board/bsh/imx8mn-bsh-smm-s2/flash.sh
> new file mode 100755
> index 000000000000..35354f622500
> --- /dev/null
> +++ b/board/bsh/imx8mn-bsh-smm-s2/flash.sh
> @@ -0,0 +1,22 @@
> +#!/bin/bash
> +
> +OUTPUT_DIR=$1

  (nitpick) it's nicer to assume that the current directory is the output 
directory if it is not given.

> +
> +if ! test -d "${OUTPUT_DIR}" ; then
> +    echo "ERROR: no output directory specified."
> +    echo "Usage: $0 OUTPUT_DIR"
> +    echo ""
> +    echo "Arguments:"
> +    echo "    OUTPUT_DIR    The Buildroot output directory."
> +    exit 1
> +fi
> +
> +IMAGES_DIR=${OUTPUT_DIR}/images
> +
> +${OUTPUT_DIR}/host/bin/uuu -v -b ${IMAGES_DIR}/nand-full.lst \
> +  ${IMAGES_DIR}/flash.bin \
> +  ${IMAGES_DIR}/flash.bin \
> +  ${IMAGES_DIR}/rootfs.ubifs \
> +  ${IMAGES_DIR}/Image \
> +  ${IMAGES_DIR}/freescale/imx8mn-bsh-smm-s2.dtb
> +
> diff --git a/board/bsh/imx8mn-bsh-smm-s2/linux.config b/board/bsh/imx8mn-bsh-smm-s2/linux.config
> new file mode 100644
> index 000000000000..638352146da1
> --- /dev/null
> +++ b/board/bsh/imx8mn-bsh-smm-s2/linux.config
> @@ -0,0 +1,833 @@

  We generally prefer to use an in-tree defconfig and a config fragment only for 
the changes. That's much smaller.

[snip]
> diff --git a/board/bsh/imx8mn-bsh-smm-s2/nand-full.lst b/board/bsh/imx8mn-bsh-smm-s2/nand-full.lst
> new file mode 100644
> index 000000000000..f00aa0848a5f
> --- /dev/null
> +++ b/board/bsh/imx8mn-bsh-smm-s2/nand-full.lst
> @@ -0,0 +1,48 @@
> +# @_flash.bin            | bootloader
> +# @_image   [_flash.bin] | image burn to nand, default is the same as bootloader
> +# @_filesystem           | filesystem to burn
> +# @_kernel               | kernel image
> +# @_dtb                  | dtb image
> +
> +# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
> +SDP: boot -f _flash.bin
> +
> +# This command will be run when ROM support stream mode
> +# i.MX8QXP, i.MX8QM
> +SDPS: boot -f _flash.bin
> +
> +# These commands will be run when use SPL and will be skipped if no spl
> +# SDPU will be deprecated. please use SDPV instead of SDPU

  So, why do we still have this?

> +# {
> +SDPU: delay 1000
> +SDPU: write -f _flash.bin -offset 0x57c00
> +SDPU: jump
> +# }
> +
> +# These commands will be run when use SPL and will be skipped if no spl
> +# if (SPL support SDPV)
> +# {
> +SDPV: delay 1000
> +SDPV: write -f _flash.bin -skipspl
> +SDPV: jump
> +# }
> +
> +FB: ucmd setenv fastboot_buffer ${loadaddr}
> +FB: download -f _image
> +# Burn image to nandfit partition if needed
> +FB: ucmd if env exists nandfit_part; then nand erase.part nandfit; nand write ${fastboot_buffer} nandfit ${filesize}; else true; fi;
> +FB: ucmd nandbcb init ${fastboot_buffer} nandboot ${filesize}
> +
> +FB[-t 10000]: ucmd ubi part nandrootfs
> +FB[-t 10000]: ucmd ubi create root -
> +FB: download -f _filesystem
> +FB[-t 60000]: ucmd ubi write ${loadaddr} root ${filesize}
> +
> +FB: download -f _kernel
> +FB[-t 10000]: ucmd nand write ${loadaddr} nandkernel ${filesize}
> +
> +FB: download -f _dtb
> +FB[-t 8000]: ucmd nand write ${loadaddr} nanddtb ${filesize}
> +
> +FB: reboot
> +FB: done

[snip]
> diff --git a/board/bsh/imx8mn-bsh-smm-s2/post-build.sh b/board/bsh/imx8mn-bsh-smm-s2/post-build.sh
> new file mode 100755
> index 000000000000..49df4cd6fb10
> --- /dev/null
> +++ b/board/bsh/imx8mn-bsh-smm-s2/post-build.sh
> @@ -0,0 +1,4 @@
> +#!/bin/sh
> +BOARD_DIR="$(dirname $0)"
> +
> +cp ${BOARD_DIR}/nand-full.lst ${BINARIES_DIR}
> diff --git a/board/bsh/imx8mn-bsh-smm-s2/readme.txt b/board/bsh/imx8mn-bsh-smm-s2/readme.txt
> new file mode 100644
> index 000000000000..37081091e849
> --- /dev/null
> +++ b/board/bsh/imx8mn-bsh-smm-s2/readme.txt
> @@ -0,0 +1,75 @@
> +i.MX8MN BSH SMM S2
> +==================
> +
> +This tutorial describes how to use the predefined Buildroot
> +configuration for the i.MX8MN BSH SMM S2 PRO board.
> +
> +Building
> +--------
> +
> +Configure buildroot:
> +
> +  $ make imx8mn_bsh_smm_s2_defconfig
> +
> +Change settings to fit your needs (optional):
> +
> +  $ make menuconfig
> +
> +Compile everything and build the rootfs image:
> +
> +  $ make
> +
> +
> +Result of the build
> +-------------------
> +
> +After building, the output/images directory contains:
> +
> +  output/images/
> +    ├── bl31.bin
> +    ├── ddr3*
> +    ├── flash.bin
> +    ├── freescale/imx8mn-bsh-smm-s2.dtb
> +    ├── Image
> +    ├── nand-full.lst
> +    ├── rootfs.ext2
> +    ├── rootfs.ext4 -> rootfs.ext2
> +    ├── rootfs.tar
> +    ├── rootfs.ubifs
> +    ├── u-boot.bin
> +    └── u-boot-spl.bin
> +
> +
> +Preparing the board
> +-------------------
> +
> +Plug the USB type A to micro B cable into the USB Debug
> +Connector (DBG UART). Use serial port settings 115200 8N1
> +to access the debug console.
> +
> +Plug another USB type A to micro B cable into the USB-OTG
> +Connector (USB1). This connection is used to flash the board
> +firmware using the Freescale/NXP UUU tool.
> +
> +Connect the power supply/adaptor to the DC Power Jack (labelled
> ++5V).
> +
> +
> +Flashing
> +--------
> +
> +Power up the board by switching on the Power ON Switch, which is
> +placed right next to the DC Jack.
> +
> +Enter the following U-Boot commands on the debug serial console:
> +
> +  $ nand erase.chip
> +  $ reset
> +
> +Flash the built images directly to board’s memory. On your computer,
> +run:
> +
> +  $ board/bsh/imx8mn-bsh-smm-s2/flash.sh output/
> +
> +It will flash the bootloader, the Device Tree Blob, the kernel image
> +and the UBI root file system.
> diff --git a/configs/imx8mn_bsh_smm_s2_defconfig b/configs/imx8mn_bsh_smm_s2_defconfig
> new file mode 100644
> index 000000000000..d500f2fc7b99
> --- /dev/null
> +++ b/configs/imx8mn_bsh_smm_s2_defconfig
> @@ -0,0 +1,44 @@
> +BR2_aarch64=y
> +BR2_GLOBAL_PATCH_DIR="board/bsh/imx8mn-bsh-smm-s2/patches"
> +BR2_TARGET_GENERIC_GETTY_PORT="ttymxc3"
> +BR2_ROOTFS_POST_BUILD_SCRIPT="board/bsh/imx8mn-bsh-smm-s2/post-build.sh"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.18"
> +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
> +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/bsh/imx8mn-bsh-smm-s2/linux.config"
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mn-bsh-smm-s2"
> +BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y
> +BR2_LINUX_KERNEL_INSTALL_TARGET=y

  At first glance, U-Boot uses the kernel and dtb from a separate NAND 
partition, so why do you have this?

> +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
> +BR2_PACKAGE_FREESCALE_IMX=y
> +BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MN=y
> +BR2_PACKAGE_FIRMWARE_IMX=y
> +BR2_PACKAGE_FIRMWARE_IMX_DDR3=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_4=y
> +BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
> +BR2_TARGET_ROOTFS_UBIFS=y
> +BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000
> +BR2_TARGET_ROOTFS_UBIFS_RT_NONE=y

  Why have tar *and* ext4 *and* ubifs? I think only ubifs is enough.

> +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.5"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mn"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="IMX_BOOT_UART_BASE=0x30a60000"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG=y

  Is this needed?

  Regards,
  Arnout

> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.07-rc2"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mn_bsh_smm_s2"
> +BR2_TARGET_UBOOT_NEEDS_DTC=y
> +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
> +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
> +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
> +BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE=y
> +BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
> +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="flash.bin"
> +BR2_TARGET_UBOOT_SPL=y
> +BR2_PACKAGE_HOST_UUU=y
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-06-20  6:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07  7:28 [Buildroot] [PATCH 0/3] Add support for BSH smm s2 [pro] boards Dario Binacchi
2022-06-07  7:28 ` [Buildroot] [PATCH 1/3] package/uuu: new package Dario Binacchi
2022-06-19 17:24   ` Arnout Vandecappelle
2022-06-07  7:28 ` [Buildroot] [PATCH 2/3] board/bsh: add support for iMX8MN BSH SMM S2 board Dario Binacchi
2022-06-19 17:51   ` Arnout Vandecappelle [this message]
2022-06-24 14:40     ` Dario Binacchi
2022-06-07  7:28 ` [Buildroot] [PATCH 3/3] board/bsh: add support for iMX8MN BSH SMM S2 PRO board Dario Binacchi

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=eada84a9-2cb9-69f9-de48-a04ce7a05f7a@mind.be \
    --to=arnout@mind.be \
    --cc=ariel.dalessandro@collabora.com \
    --cc=buildroot@buildroot.org \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=heiko.thiery@gmail.com \
    --cc=jagan@amarulasolutions.com \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=michael@amarulasolutions.com \
    --cc=s.martin49@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 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.