From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: Damien Le Moal <dlemoal@kernel.org>,
linux-amarula@amarulasolutions.com,
"Yann E . MORIN" <yann.morin.1998@free.fr>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v3 2/3] configs/stm32f746_disco_sd: new defconfig
Date: Fri, 23 Aug 2024 18:20:24 +0200 [thread overview]
Message-ID: <20240823182024.66981be7@windsurf> (raw)
In-Reply-To: <20240822183742.3550055-3-dario.binacchi@amarulasolutions.com>
Hello,
On Thu, 22 Aug 2024 20:37:41 +0200
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:
> diff --git a/board/stmicroelectronics/stm32f746-disco/flash_sd.sh b/board/stmicroelectronics/stm32f746-disco/flash_sd.sh
> new file mode 100755
> index 000000000000..4fe85448f984
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32f746-disco/flash_sd.sh
> @@ -0,0 +1,22 @@
> +#!/bin/bash
> +
> +if [ $# -eq 0 ]; then
> + OUTPUT_DIR=output
> +else
> + OUTPUT_DIR=$1
> +fi
> +
> +if ! test -d "${OUTPUT_DIR}" ; then
> + echo "ERROR: no output directory specified."
> + echo "Usage: $0 OUTPUT_DIR"
> + exit 1
> +fi
> +
> +"${OUTPUT_DIR}"/host/bin/openocd -f board/stm32f746g-disco.cfg \
> + -c "init" \
> + -c "reset init" \
> + -c "flash probe 0" \
> + -c "flash info 0" \
> + -c "flash write_image erase ${OUTPUT_DIR}/images/u-boot.bin 0x08000000" \
> + -c "reset run" \
> + -c "shutdown"
Could you keep the indentation consistent? Above you used 4 spaces, and
here only 2.
> diff --git a/board/stmicroelectronics/stm32f746-disco/genimage.cfg b/board/stmicroelectronics/stm32f746-disco/genimage.cfg
> new file mode 100644
> index 000000000000..6743d41972c0
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32f746-disco/genimage.cfg
> @@ -0,0 +1,27 @@
> +image boot.vfat {
> + vfat {
> + files = {
> + "zImage",
> + "stm32f746-disco.dtb",
> + "extlinux"
> + }
> + }
> +
> + size = 16M
> +}
> +
> +image sdcard.img {
> + hdimage {
> + }
> +
> + partition u-boot {
Why is this partition called u-boot? It doesn't contain anything u-boot
related.
> + partition-type = 0xC
> + image = "boot.vfat"
But why is a VFAT partition needed in fact? Why can't U-Boot simply get
the kernel+DTB from the ext4 rootfs partition?
> diff --git a/board/stmicroelectronics/stm32f746-disco/post-build.sh b/board/stmicroelectronics/stm32f746-disco/post-build.sh
> new file mode 100755
> index 000000000000..2894ad851c66
> --- /dev/null
> +++ b/board/stmicroelectronics/stm32f746-disco/post-build.sh
> @@ -0,0 +1,9 @@
> +#!/bin/sh
> +BOARD_DIR="$(dirname "$0")"
> +
> +install -m 0644 -D "${BOARD_DIR}"/extlinux.conf "${BINARIES_DIR}"/extlinux/extlinux.conf
> +
> +# finalize the init script
> +INIT_PATH="${TARGET_DIR}/sbin/init"
> +sed -i "/^# Clear memory to reduce page fragmentation/d" "${INIT_PATH}"
> +sed -i "/^echo 3 > \/proc\/sys\/vm\/drop_caches/d" "${INIT_PATH}"
Meh, this kind of sucks. tinyinit does one thing and we have to undo it
here. Not great. Can we do better, i.e decide whether it makes sense to
do it or not? To be honest, I am not sure if this is really useful to
do at boot time.
> diff --git a/configs/stm32f746_disco_sd_defconfig b/configs/stm32f746_disco_sd_defconfig
> new file mode 100644
> index 000000000000..8c92afc5740e
> --- /dev/null
> +++ b/configs/stm32f746_disco_sd_defconfig
> @@ -0,0 +1,32 @@
> +BR2_arm=y
> +BR2_cortex_m7=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15=y
> +BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f746-disco/patches"
> +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
> +BR2_INIT_NONE=y
> +BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32f746-disco/post-build.sh"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
> +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32f746-disco/genimage.cfg"
> +BR2_LINUX_KERNEL=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION=y
> +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.15.165"
> +BR2_LINUX_KERNEL_DEFCONFIG="stm32"
> +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32f746-disco/linux.fragment"
> +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
> +BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="zImage"
> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32f746-disco"
> +BR2_PACKAGE_TINYINIT=y
> +BR2_TARGET_ROOTFS_EXT2=y
> +BR2_TARGET_ROOTFS_EXT2_SIZE="32M"
> +# BR2_TARGET_ROOTFS_TAR is not set
> +BR2_TARGET_UBOOT=y
> +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION=y
> +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2024.07"
> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32f746-disco"
> +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
> +BR2_PACKAGE_HOST_DOSFSTOOLS=y
> +BR2_PACKAGE_HOST_GENIMAGE=y
> +BR2_PACKAGE_HOST_MTOOLS=y
> +BR2_PACKAGE_HOST_OPENOCD=y
If you drop the FAT partition, you can drop BR2_PACKAGE_HOST_MTOOLS=y
and BR2_PACKAGE_HOST_DOSFSTOOLS=y.
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-08-23 16:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 18:37 [Buildroot] [PATCH v3 0/3] tinyinit and stm32f746_disco_sd_defconfig Dario Binacchi
2024-08-22 18:37 ` [Buildroot] [PATCH v3 1/3] package/tinyinit: new package Dario Binacchi
2024-08-23 16:17 ` Thomas Petazzoni via buildroot
2024-08-25 15:06 ` Dario Binacchi
2024-08-27 20:07 ` Yann E. MORIN
2024-08-29 21:47 ` Thomas Petazzoni via buildroot
2024-08-30 7:32 ` Yann E. MORIN
2024-08-22 18:37 ` [Buildroot] [PATCH v3 2/3] configs/stm32f746_disco_sd: new defconfig Dario Binacchi
2024-08-23 16:20 ` Thomas Petazzoni via buildroot [this message]
2024-08-25 15:23 ` Dario Binacchi
2024-08-22 18:37 ` [Buildroot] [PATCH v3 3/3] board/canaan/k210-soc: use tinyinit as Linux init process Dario Binacchi
2024-08-23 16:11 ` [Buildroot] [PATCH v3 0/3] tinyinit and stm32f746_disco_sd_defconfig Thomas Petazzoni via buildroot
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=20240823182024.66981be7@windsurf \
--to=buildroot@buildroot.org \
--cc=dario.binacchi@amarulasolutions.com \
--cc=dlemoal@kernel.org \
--cc=linux-amarula@amarulasolutions.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin.1998@free.fr \
/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