All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yauheni Saldatsenka <eugentoo@gmail.com>
To: buildroot@buildroot.org
Cc: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
Subject: [Buildroot] [PATCH 3/3] [PATCH v3 1/1] configs/stm32f469_disco_xip_defconfig: alternative defconfig for XIP
Date: Wed, 25 Aug 2021 21:18:58 +0300	[thread overview]
Message-ID: <20210825181858.801574-3-eugentoo@gmail.com> (raw)
In-Reply-To: <20210825181858.801574-1-eugentoo@gmail.com>

Result of make tinyconfig was taken as a starting point to fit kernel
into flash memory.
Current setup kernel + rootfs fits in 1.6MB on-chip flash memory.

Fixes:
    - Move kernel to new flash bank due to growth of dtb size
    - Fix kernel start address in bootloader

For better binary size optimization gcc LTO is turned on.

Signed-off-by: Yauheni Saldatsenka <eugentoo@gmail.com>

----
v2 -> v3:
- Create separate readme.txt for xip configuration
- Create separate flash.sh script for xip configuration

Signed-off-by: Yauheni Saldatsenka <eugentoo@gmail.com>
---
 .../stm32f469-disco/flash.sh                  | 45 ++++---------------
 .../stm32f469-disco/flash_xip.sh              | 20 +++++++++
 .../stm32f469-disco/readme.txt                | 26 +++--------
 .../stm32f469-disco/readme_xip.txt            | 22 +++++++++
 4 files changed, 57 insertions(+), 56 deletions(-)
 create mode 100644 board/stmicroelectronics/stm32f469-disco/flash_xip.sh
 create mode 100644 board/stmicroelectronics/stm32f469-disco/readme_xip.txt

diff --git a/board/stmicroelectronics/stm32f469-disco/flash.sh b/board/stmicroelectronics/stm32f469-disco/flash.sh
index 0e130908aa..984d2b2599 100755
--- a/board/stmicroelectronics/stm32f469-disco/flash.sh
+++ b/board/stmicroelectronics/stm32f469-disco/flash.sh
@@ -1,45 +1,18 @@
 #!/bin/bash
 
 OUTPUT_DIR=$1
-BUILD_TYPE=$2
 
-if ! test -d "${OUTPUT_DIR}"; then
+if ! test -d "${OUTPUT_DIR}" ; then
     echo "ERROR: no output directory specified."
     echo "Usage: $0 OUTPUT_DIR"
     exit 1
 fi
 
-if  [[ -z "${BUILD_TYPE}" ]]; then
-    echo "ERROR: no build type specified, please select 'xip' or 'uboot'."
-    echo "Usage: $0 OUTPUT_DIR $1 BUILD_TYPE"
-    exit 1
-fi
-
-case "${BUILD_TYPE}" in
-	"xip")
-		${OUTPUT_DIR}/host/bin/openocd -f board/stm32f469discovery.cfg \
-					 -c "init" \
-					 -c "reset init" \
-					 -c "flash probe 0" \
-					 -c "flash info 0" \
-					 -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469i-disco.bin 0x08000000" \
-					 -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469-disco.dtb 0x08004000" \
-					 -c "flash write_image erase ${OUTPUT_DIR}/images/xipImage 0x08010000" \
-					 -c "reset run" \
-					 -c "shutdown"
-		;;
-	"uboot")
-		FLASH_COMMAND=
-		${OUTPUT_DIR}/host/bin/openocd -f board/stm32f469discovery.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"
-	    ;;
-	*)
-		echo "Wrong build type. Please select from: xip, uboot"
-		;;
-esac
+${OUTPUT_DIR}/host/bin/openocd -f board/stm32f469discovery.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"
diff --git a/board/stmicroelectronics/stm32f469-disco/flash_xip.sh b/board/stmicroelectronics/stm32f469-disco/flash_xip.sh
new file mode 100644
index 0000000000..b5a067cee5
--- /dev/null
+++ b/board/stmicroelectronics/stm32f469-disco/flash_xip.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+OUTPUT_DIR=$1
+
+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/stm32f469discovery.cfg \
+  -c "init" \
+  -c "reset init" \
+  -c "flash probe 0" \
+  -c "flash info 0" \
+  -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469i-disco.bin 0x08000000" \
+  -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469-disco.dtb 0x08004000" \
+  -c "flash write_image erase ${OUTPUT_DIR}/images/xipImage 0x08010000" \
+  -c "reset run" \
+  -c "shutdown"
diff --git a/board/stmicroelectronics/stm32f469-disco/readme.txt b/board/stmicroelectronics/stm32f469-disco/readme.txt
index 646f340382..c1e1d30e69 100644
--- a/board/stmicroelectronics/stm32f469-disco/readme.txt
+++ b/board/stmicroelectronics/stm32f469-disco/readme.txt
@@ -4,37 +4,23 @@ STM32F469 Discovery
 This tutorial describes how to use the predefined Buildroot
 configuration for the STM32F469 Discovery evaluation platform.
 
-There are two setups supported:
-1. Internal flash memory is fully occupied with u-boot bootloader which boots kernel with
-   root filesystem from MMC.
-2. Internal flash memory stores simple afboot-stm32 bootloader, device tree and
-   in place (XIP) kernel with built-in initramfs.
-   Kernel is based on tinyconfig.
-
 Building
 --------
-  Type
-  "make stm32f469_disco_defconfig"
-  to build u-boot setup
-  or
-  "make stm32f469_disco_xip_defconfig"
-  to build xip setup
-
-  Then
 
-  "make"
+  make stm32f469_disco_defconfig
+  make
 
 Flashing
 --------
 
-  ./board/stmicroelectronics/stm32f469-disco/flash.sh output/ <BUILD_TYPE>
+  ./board/stmicroelectronics/stm32f469-disco/flash.sh output/
 
-  <BUILD_TYPE> can be "xip" or "uboot"
+It will flash the U-boot bootloader.
 
-Creating SD card for u-boot setup
+Creating SD card
 ----------------
 
-Buildroot prepares an "sdcard.img" image in the output/images/ directory,
+Buildroot prepares an"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>
diff --git a/board/stmicroelectronics/stm32f469-disco/readme_xip.txt b/board/stmicroelectronics/stm32f469-disco/readme_xip.txt
new file mode 100644
index 0000000000..c4c93cef6c
--- /dev/null
+++ b/board/stmicroelectronics/stm32f469-disco/readme_xip.txt
@@ -0,0 +1,22 @@
+STM32F469 Discovery
+===================
+
+This tutorial describes how to use the predefined Buildroot
+configuration for the STM32F469 Discovery evaluation platform.
+
+Internal flash memory stores simple afboot-stm32 bootloader, device tree and
+in place (XIP) kernel with built-in initramfs.
+Kernel is based on tinyconfig.
+
+Building
+--------
+
+  make stm32f469_disco_xip_defconfig
+  make
+
+Flashing
+--------
+
+  ./board/stmicroelectronics/stm32f469-disco/flash.sh output/
+
+It will flash binary to internal flash memory.
-- 
2.32.0

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

      parent reply	other threads:[~2021-08-25 18:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25 18:18 [Buildroot] [PATCH 1/3] [PATCH 1/1] configs/stm32f469_disco_xip_defconfig: alternative defconfig for XIP Yauheni Saldatsenka
2021-08-25 18:18 ` [Buildroot] [PATCH 2/3] [PATCH v2 " Yauheni Saldatsenka
2021-08-28 14:57   ` Arnout Vandecappelle
2021-08-28 20:06     ` Yauheni Saldatsenka
2021-08-25 18:18 ` Yauheni Saldatsenka [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=20210825181858.801574-3-eugentoo@gmail.com \
    --to=eugentoo@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=christophe.priouzeau@foss.st.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.