Skip to contentSkip to conversation

configs/stm32mp157c_odyssey: new defconfig

PATCH Applied Simon Doppler 2 participants 2 messages Aug 31, 2021 – Sep 11, 2021 Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 configs/stm32mp157c_odyssey: new defconfig

STM32MP157C-Odyssey reference:
https://wiki.seeedstudio.com/ODYSSEY-STM32MP157C/

---
 DEVELOPERS                                    |   4 +
 board/seeed/stm32mp157c-odyssey/genimage.cfg  |  22 +++
 board/seeed/stm32mp157c-odyssey/linux.config  | 182 ++++++++++++++++++
 .../overlay/boot/extlinux/extlinux.conf       |   4 +
 ...-fix-stm32mp157c-odyssey-card-detect.patch |  36 ++++
 board/seeed/stm32mp157c-odyssey/readme.txt    |  38 ++++
 configs/stm32mp157c_odyssey_defconfig         |  31 +++
 7 files changed, 317 insertions(+)
 create mode 100644 board/seeed/stm32mp157c-odyssey/genimage.cfg
 create mode 100644 board/seeed/stm32mp157c-odyssey/linux.config
 create mode 100644 board/seeed/stm32mp157c-odyssey/overlay/boot/extlinux/extlinux.conf
 create mode 100644 board/seeed/stm32mp157c-odyssey/patches/linux/5.10.1/0001-ARM-dts-stm32-fix-stm32mp157c-odyssey-card-detect.patch
 create mode 100644 board/seeed/stm32mp157c-odyssey/readme.txt
 create mode 100644 configs/stm32mp157c_odyssey_defconfig
DEVELOPERS +4 -0
index 53448dd100..50e36de390 100644
@@ -2471,6 +2471,10 @@ F:	package/xscreensaver/
 F:	package/zmqpp/
 F:	package/zyre/
 
+N:	Simon Doppler <[email protected]>
+F:	board/seeed/
+F:	configs/stm32mp157c_odyssey_defconfig
+
 N:	Spenser Gilliland <[email protected]>
 F:	arch/Config.in.microblaze
 F:	package/a10disp/
board/seeed/stm32mp157c-odyssey/genimage.cfg new file +22 -0
new file mode 100644
index 0000000000..170dedc254
@@ -0,0 +1,22 @@
+image sdcard.img {
+	hdimage {
+		gpt = "true"
+	}
+
+	partition fsbl1 {
+		image = "tf-a-stm32mp157c-odyssey.stm32"
+	}
+
+	partition fsbl2 {
+		image = "tf-a-stm32mp157c-odyssey.stm32"
+	}
+
+	partition ssbl {
+		image = "u-boot.stm32"
+	}
+
+	partition rootfs {
+		image = "rootfs.ext4"
+		bootable = "yes"
+	}
+}
board/seeed/stm32mp157c-odyssey/linux.config new file +182 -0

182 lines not on this page · raw message

board/seeed/stm32mp157c-odyssey/overlay/boot/extlinux/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..b5795415eb
@@ -0,0 +1,4 @@
+label stm32mp157c-odyssey-buildroot
+  kernel /boot/zImage
+  devicetree /boot/stm32mp157c-odyssey.dtb
+  append root=/dev/mmcblk0p4 rootwait
board/seeed/stm32mp157c-odyssey/patches/linux/5.10.1/0001-ARM-dts-stm32-fix-stm32mp157c-odyssey-card-detect.patch new file +36 -0
new file mode 100644
index 0000000000..ab2dc5dea8
@@ -0,0 +1,36 @@
+From 0171b07373cc8c2815ca5fa79a7308fdefa54ca4 Mon Sep 17 00:00:00 2001
+From: Grzegorz Szymaszek <[email protected]>
+Date: Sat, 10 Apr 2021 21:35:21 +0200
+Subject: [PATCH] ARM: dts: stm32: fix stm32mp157c-odyssey card detect pin
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The microSD card detect pin is physically connected to the MPU pin PI3.
+The Device Tree configuration of the card detect pin was wrong—it was
+set to pin PB7 instead. If such configuration was used, the kernel would
+hang on “Waiting for root device” when booting from a microSD card.
+
+Signed-off-by: Grzegorz Szymaszek <[email protected]>
+Signed-off-by: Alexandre Torgue <[email protected]>
+Backported from: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/stm32mp157c-odyssey.dts?id=0171b07373cc8c2815ca5fa79a7308fdefa54ca4
+---
+ arch/arm/boot/dts/stm32mp157c-odyssey.dts | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/stm32mp157c-odyssey.dts b/arch/arm/boot/dts/stm32mp157c-odyssey.dts
+index a7ffec8f1516..be1dd5e9e744 100644
+--- a/arch/arm/boot/dts/stm32mp157c-odyssey.dts
++++ b/arch/arm/boot/dts/stm32mp157c-odyssey.dts
+@@ -64,7 +64,7 @@ &sdmmc1 {
+ 	pinctrl-0 = <&sdmmc1_b4_pins_a>;
+ 	pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
+ 	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
+-	cd-gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
++	cd-gpios = <&gpioi 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ 	disable-wp;
+ 	st,neg-edge;
+ 	bus-width = <4>;
+--
+2.30.2
+
board/seeed/stm32mp157c-odyssey/readme.txt new file +38 -0
new file mode 100644
index 0000000000..0932867393
@@ -0,0 +1,38 @@
+STM32MP157C-Odyssey
+
+Intro
+=====
+
+This configuration supports the STM32MP157C-Odyssey platform:
+
+  https://wiki.seeedstudio.com/ODYSSEY-STM32MP157C/
+
+How to build
+============
+
+ $ make stm32mp157c_odyssey_defconfig
+ $ make
+
+How to write the microSD card
+=============================
+
+Once the build process is finished you will have an image called
+"sdcard.img" in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an microSD card with "dd":
+
+  $ sudo dd if=output/images/sdcard.img of=/dev/sdX
+
+Boot the board
+==============
+
+ (1) Insert the microSD card in connector J21.
+
+ (2) Connect to the UART connector J24 (located next the the DC jack
+     J24 and the battery connector J20) and run your serial communication
+     program on /dev/ttyACM0.
+
+ (3) Plug a USB-C cable in J6 or a center-positive 12V jack into J17
+     to power-up the board.
+
+ (4) The system will start, with the console on UART.
configs/stm32mp157c_odyssey_defconfig new file +31 -0
new file mode 100644
index 0000000000..078ff74923
@@ -0,0 +1,31 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_GLOBAL_PATCH_DIR="board/seeed/stm32mp157c-odyssey/patches"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
+BR2_ROOTFS_OVERLAY="board/seeed/stm32mp157c-odyssey/overlay/"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/seeed/stm32mp157c-odyssey/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.1"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/seeed/stm32mp157c-odyssey/linux.config"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-odyssey"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="stm32mp1"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="STM32MP_SDMMC=1 AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157c-odyssey.dtb"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_trusted"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_STM32=y
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=stm32mp157c-odyssey"
+BR2_PACKAGE_HOST_GENIMAGE=y

--
2.30.2

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot

#1 lore raw
Quoted 4 lines · Simon Doppler

STM32MP157C-Odyssey reference:
https://wiki.seeedstudio.com/ODYSSEY-STM32MP157C/

Applied to master, thanks.

Still a few comments though.

[snip]

board/seeed/stm32mp157c-odyssey/linux.config

Quoted 1 line
board/seeed/stm32mp157c-odyssey/linux.config +0 -0

We generally prefer to start from an in-tree config and just apply a config
fragment to it. That doesn't just reduce the size of the file in Buildroot, but more importantly makes updating the kernel easier because it generally better reflects changes (e.g., extra errata that should be enabled).

I haven't tried to create a fragment myself though so I kept this as is.

[snip]

board/seeed/stm32mp157c-odyssey/patches/linux/5.10.1/0001-ARM-dts-stm32-fix-stm32mp157c-odyssey-card-detect.patch

Quoted 5 lines
board/seeed/stm32mp157c-odyssey/patches/linux/5.10.1/0001-ARM-dts-stm32-fix-stm32mp157c-odyssey-card-detect.patch new file +0 -0
new file mode 100644
index 0000000000..ab2dc5dea8

There's no need to put it in the version-specific directory. In fact, it's
better not to: when the kernel is updated, we want the patch to still be applied (which will likely fail due to a conflict or because it was already applied upstream). That's better than the patch being forgotten.

[snip]

Quoted 30 lines

+++ b/board/seeed/stm32mp157c-odyssey/readme.txt

board/seeed/stm32mp157c-odyssey/patches/linux/5.10.1/0001-ARM-dts-stm32-fix-stm32mp157c-odyssey-card-detect.patch new file +28 -0
@@ -0,0 +1,38 @@
+STM32MP157C-Odyssey
+
+Intro
+=====
+
+This configuration supports the STM32MP157C-Odyssey platform:
+
+  https://wiki.seeedstudio.com/ODYSSEY-STM32MP157C/
+
+How to build
+============
+
+ $ make stm32mp157c_odyssey_defconfig
+ $ make
+
+How to write the microSD card
+=============================
+
+Once the build process is finished you will have an image called
+"sdcard.img" in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an microSD card with "dd":
+
+  $ sudo dd if=output/images/sdcard.img of=/dev/sdX
+
+Boot the board
+==============
+

board/seeed/stm32mp157c-odyssey/patches/linux/5.10.1/0001-ARM-dts-stm32-fix-stm32mp157c-odyssey-card-detect.patch line 38

Quoted 10 lines
board/seeed/stm32mp157c-odyssey/patches/linux/5.10.1/0001-ARM-dts-stm32-fix-stm32mp157c-odyssey-card-detect.patch new file +10 -0
+ (1) Insert the microSD card in connector J21.
+
+ (2) Connect to the UART connector J24 (located next the the DC jack
+     J24 and the battery connector J20) and run your serial communication
+     program on /dev/ttyACM0.
+
+ (3) Plug a USB-C cable in J6 or a center-positive 12V jack into J17
+     to power-up the board.
+
+ (4) The system will start, with the console on UART.

Very nice readme! I'll use it as an example if I need to show someone how to
write a readme for a board.

Quoted 6 lines
configs/stm32mp157c_odyssey_defconfig new file +0 -0
new file mode 100644
index 0000000000..078ff74923

configs/stm32mp157c_odyssey_defconfig line 10

Quoted 10 lines
configs/stm32mp157c_odyssey_defconfig new file +10 -0
@@ -0,0 +1,31 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_GLOBAL_PATCH_DIR="board/seeed/stm32mp157c-odyssey/patches"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_10=y
+BR2_ROOTFS_OVERLAY="board/seeed/stm32mp157c-odyssey/overlay/"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/seeed/stm32mp157c-odyssey/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.10.1"

It would have been nice to update this to a current stable, e.g. 5.10.63 or 5.14.2.

configs/stm32mp157c_odyssey_defconfig line 18

Quoted 8 lines
configs/stm32mp157c_odyssey_defconfig new file +8 -0
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/seeed/stm32mp157c-odyssey/linux.config"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-odyssey"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"

The default 60M is ample for this minimal configuration (it's actually less
than 15MB), so I've kept the default.

Regards,
Arnout

Quoted 17 lines
configs/stm32mp157c_odyssey_defconfig new file +13 -1
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="stm32mp1"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="STM32MP_SDMMC=1 AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157c-odyssey.dtb"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_trusted"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_STM32=y
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=stm32mp157c-odyssey"
+BR2_PACKAGE_HOST_GENIMAGE=y
--

2.30.2

Quoted 5 lines

_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot