@@ -3037,6 +3037,8 @@ F: package/mksh/
F: package/ruby/
F: package/uclibc/
F: package/uclibc-ng-test/
+F: board/stmicroelectronics/stm32f746g-disco/
+F: configs/stm32f746g_disco_sd_defconfig
N: Will Newton <will.newton@gmail.com>
F: package/enchant/
new file mode 100644
@@ -0,0 +1,4 @@
+label stm32f746-disco-buildroot
+ kernel /zImage
+ devicetree /stm32f746-disco.dtb
+ append console=ttySTM0,115200 root=/dev/mmcblk0p2 rw rootwait consoleblank=0 ignore_loglevel
new file mode 100755
@@ -0,0 +1,18 @@
+#!/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/stm32f7discovery.cfg \
+ -c "init" \
+ -c "reset init" \
+ -c "flash probe 0" \
+ -c "flash info 0" \
+ -c "flash write_image erase ${OUTPUT_DIR}/images/u-boot-dtb.bin 0x08000000" \
+ -c "reset run" \
+ -c "shutdown"
new file mode 100644
@@ -0,0 +1,27 @@
+image boot.vfat {
+ vfat {
+ files = {
+ "zImage",
+ "stm32f746-disco.dtb",
+ "extlinux"
+ }
+ }
+
+ size = 16M
+}
+
+image sdcard.img {
+ hdimage {
+ }
+
+ partition u-boot {
+ partition-type = 0xC
+ image = "boot.vfat"
+ }
+
+ partition rootfs {
+ partition-type = 0x83
+ image = "rootfs.ext2"
+ size = 32M
+ }
+}
new file mode 100644
@@ -0,0 +1,6 @@
+CONFIG_SET_MEM_PARAM=y
+CONFIG_DRAM_BASE=0xC0000000
+CONFIG_DRAM_SIZE=0x01000000
+CONFIG_FLASH_MEM_BASE=0x08000000
+CONFIG_FLASH_SIZE=0x00200000
+# CONFIG_XIP_KERNEL is not set
new file mode 100755
@@ -0,0 +1,4 @@
+#!/bin/sh
+BOARD_DIR="$(dirname $0)"
+
+install -m 0644 -D $BOARD_DIR/extlinux.conf $BINARIES_DIR/extlinux/extlinux.conf
new file mode 100644
@@ -0,0 +1,31 @@
+STM32F746G-DISCO
+===================
+
+This tutorial describes how to use the predefined Buildroot
+configuration for the STM32F746G-DISCO evaluation platform.
+
+Building
+--------
+
+ make stm32f746g_disco_sd_defconfig
+ make
+
+Flashing
+--------
+
+ ./board/stmicroelectronics/stm32f746-disco/flash.sh output/
+
+It will flash the U-boot bootloader.
+
+Creating SD card
+----------------
+
+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>
+
+*** WARNING! This will destroy all the card content. Use with care! ***
+
+For details about the medium image layout and its content, see the
+definition in board/stmicroelectronics/stm32f746-disco/genimage.cfg.
new file mode 120000
@@ -0,0 +1 @@
+/sbin/init
\ No newline at end of file
new file mode 100755
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# This script replaces the default busybox init process to avoid having that
+# process staying alive and sleeping in the background, (uselessly) consuming
+# precious memory.
+
+# Mount procfs and sysfs
+/bin/mount -t proc proc /proc
+/bin/mount -t sysfs sysfs /sys
+
+# When the kernel is directly booted, devtmpfs is not automatically mounted.
+# Manually mount it if needed.
+devmnt=$(mount | grep -c devtmpfs)
+if [ ${devmnt} -eq 0 ]; then
+ /bin/mount -t devtmpfs devtmpfs /dev
+fi
+
+# Use the /dev/console device node from devtmpfs if possible to not
+# confuse glibc's ttyname_r().
+# This may fail (E.G. booted with console=), and errors from exec will
+# terminate the shell, so use a subshell for the test
+if (exec 0</dev/console) 2>/dev/null; then
+ exec 0</dev/console
+ exec 1>/dev/console
+ exec 2>/dev/console
+fi
+
+# Clear memory to reduce page fragmentation
+echo 3 > /proc/sys/vm/drop_caches
+
+# Print a fun logo :)
+echo " __ _"
+echo " / / (_) ____ _ _ __ __"
+echo " / / | || _ \\ | | | |\\ \\/ /"
+echo " / /___| || | | || |_| | > < "
+echo " /_____/|_||_| |_| \\____|/_/\\_\\"
+echo " ST Microsystems STM32F746G-DISCO NOMMU"
+echo ""
+
+# Finally, let's start an interactive shell
+exec /bin/sh
new file mode 100644
@@ -0,0 +1,32 @@
+BR2_arm=y
+BR2_cortex_m7=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_19=y
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32f746g-disco/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32f746g-disco/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.19.9"
+BR2_LINUX_KERNEL_DEFCONFIG="stm32"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32f746g-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_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+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_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.10-rc5"
+BR2_TARGET_UBOOT_BOARDNAME="stm32f746-disco"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32f746-disco"
+BR2_TARGET_UBOOT_FORMAT_DTB_BIN=y
+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
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32f746g-disco/rootfs_overlay"
Add support for ST Microsystems STM32F746G-DISCO board. See here for hardware details: https://www.st.com/en/evaluation-tools/32f746gdiscovery.html The LCD and Ethernet are _not_ yet supported by Linux upstream. The RAM is very limited, so the init script is stolen from the RISCV noMMU systems to support booting to a shell without crashing. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> --- DEVELOPERS | 2 + .../stm32f746g-disco/extlinux.conf | 4 ++ .../stm32f746g-disco/flash.sh | 18 ++++++++ .../stm32f746g-disco/genimage.cfg | 27 ++++++++++++ .../stm32f746g-disco/linux.fragment | 6 +++ .../stm32f746g-disco/post-build.sh | 4 ++ .../stm32f746g-disco/readme.txt | 31 ++++++++++++++ .../stm32f746g-disco/rootfs_overlay/init | 1 + .../stm32f746g-disco/rootfs_overlay/sbin/init | 41 +++++++++++++++++++ configs/stm32f746g_disco_sd_defconfig | 32 +++++++++++++++ 10 files changed, 166 insertions(+) create mode 100644 board/stmicroelectronics/stm32f746g-disco/extlinux.conf create mode 100755 board/stmicroelectronics/stm32f746g-disco/flash.sh create mode 100644 board/stmicroelectronics/stm32f746g-disco/genimage.cfg create mode 100644 board/stmicroelectronics/stm32f746g-disco/linux.fragment create mode 100755 board/stmicroelectronics/stm32f746g-disco/post-build.sh create mode 100644 board/stmicroelectronics/stm32f746g-disco/readme.txt create mode 120000 board/stmicroelectronics/stm32f746g-disco/rootfs_overlay/init create mode 100755 board/stmicroelectronics/stm32f746g-disco/rootfs_overlay/sbin/init create mode 100644 configs/stm32f746g_disco_sd_defconfig