Skip to contentSkip to conversation

configs/stm32mp157_dk: new defconfig

PATCH Superseded Thomas Petazzoni 2 participants 3 messages Aug 7, 2019 – Aug 13, 2019 Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 configs/stm32mp157_dk: new defconfig

This commit adds a minimal defconfig to build a Buildroot system for the STM32MP157 Discovery Kit, which is the low-cost evaluation platform for the new STM32MP157 system-on-chip from ST. This system-on-chip features a single or dual Cortex-A7, a single Cortex-M4, and a wide variety of peripherals.

This commit includes a custom linux configuration file, because there is no specific defconfig for this platform in the kernel, only multi_v7_defconfig supports it, which is really a massive defconfig. That's why a custom linux configuration file is added.

A small U-Boot config fragment allows to disable the watchdog, so that userspace by default doesn't need to have a watchdog daemon running.

The vendor U-Boot and Linux trees are used for the moment, but the platform support is being upstreamed, so switching to upstream versions will be possible in the relatively near future.

---
Changes since v2:
- Bump vendor Linux and U-Boot versions
- Use the $(call github,...) macro also to download U-Boot as a tarball
- Drop all other patches that have been merged

Peter: if you remember from the hackathon, this defconfig was not booting properly. Turned out I rebased on master, but *before* the point you merged the U-Boot change to support "custom build variables". Due to this the DEVICE_TREE=stm32mp157c-dk2 directive from BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS was not taken into account, causing the incorrect DT to be used in the U-Boot build. Properly rebased on the latest master, the defconfig works just fine!

---
 .gitlab-ci.yml                                |   1 +
 DEVELOPERS                                    |   2 +
 .../stm32mp157-dk/genimage.cfg                |  24 +++
 .../stm32mp157-dk/linux.config                | 182 ++++++++++++++++++
 .../overlay/boot/extlinux/extlinux.conf       |   4 +
 .../stm32mp157-dk/readme.txt                  |  38 ++++
 .../stm32mp157-dk/uboot-fragment.config       |   1 +
 configs/stm32mp157_dk_defconfig               |  30 +++
 8 files changed, 282 insertions(+)
 create mode 100644 board/stmicroelectronics/stm32mp157-dk/genimage.cfg
 create mode 100644 board/stmicroelectronics/stm32mp157-dk/linux.config
 create mode 100644 board/stmicroelectronics/stm32mp157-dk/overlay/boot/extlinux/extlinux.conf
 create mode 100644 board/stmicroelectronics/stm32mp157-dk/readme.txt
 create mode 100644 board/stmicroelectronics/stm32mp157-dk/uboot-fragment.config
 create mode 100644 configs/stm32mp157_dk_defconfig
.gitlab-ci.yml +1 -0
index 28824cc722..7ee6e248b1 100644
@@ -317,6 +317,7 @@ solidrun_macchiatobin_mainline_defconfig: { extends: .defconfig }
 solidrun_macchiatobin_marvell_defconfig: { extends: .defconfig }
 stm32f429_disco_defconfig: { extends: .defconfig }
 stm32f469_disco_defconfig: { extends: .defconfig }
+stm32mp157_dk_defconfig: { extends: .defconfig }
 toradex_apalis_imx6_defconfig: { extends: .defconfig }
 ts4800_defconfig: { extends: .defconfig }
 ts4900_defconfig: { extends: .defconfig }
DEVELOPERS +2 -0
index e8ba6cd985..7e589b7673 100644
@@ -2222,9 +2222,11 @@ F:	package/ascii-invaders/
 
 N:	Thomas Petazzoni <[email protected]>
 F:	arch/Config.in.arm
+F:	board/stmicroelectronics/stm32mp157-dk/
 F:	boot/boot-wrapper-aarch64/
 F:	boot/grub2/
 F:	boot/gummiboot/
+F:	configs/stm32mp157_dk_defconfig
 F:	package/android-tools/
 F:	package/b43-firmware/
 F:	package/b43-fwcutter/
board/stmicroelectronics/stm32mp157-dk/genimage.cfg new file +24 -0
new file mode 100644
index 0000000000..33c418b9a5
@@ -0,0 +1,24 @@
+image sdcard.img {
+	hdimage {
+		gpt = "true"
+	}
+
+	partition fsbl1 {
+		image = "u-boot-spl.stm32"
+	}
+
+	partition fsbl2 {
+		image = "u-boot-spl.stm32"
+	}
+
+	partition uboot {
+		image = "u-boot.img"
+	}
+
+	partition rootfs {
+		image = "rootfs.ext4"
+		partition-type = 0x83
+		bootable = "yes"
+		size = 256M
+	}
+}
board/stmicroelectronics/stm32mp157-dk/linux.config new file +182 -0

182 lines not on this page · raw message

board/stmicroelectronics/stm32mp157-dk/overlay/boot/extlinux/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..325f3fc30e
@@ -0,0 +1,4 @@
+label stm32mp15-buildroot
+  kernel /boot/zImage
+  devicetree /boot/stm32mp157c-dk2.dtb
+  append root=/dev/mmcblk0p4 rootwait
board/stmicroelectronics/stm32mp157-dk/readme.txt new file +38 -0
new file mode 100644
index 0000000000..ac2061a234
@@ -0,0 +1,38 @@
+STM32MP157 Discovery Kit
+
+Intro
+=====
+
+This configuration supports the STM32MP157 Discovery Kit 2 (DK2)
+platform:
+
+  https://www.st.com/en/evaluation-tools/stm32mp157c-dk2.html
+
+How to build
+============
+
+ $ make stm32mp157_dk_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 CN15
+
+ (2) Plug a micro-USB cable in connector CN11 and run your serial
+     communication program on /dev/ttyACM0.
+
+ (3) Plug a USB-C cable in CN6 to power-up the board.
+
+ (4) The system will start, with the console on UART, but also visible
+     on the screen.
board/stmicroelectronics/stm32mp157-dk/uboot-fragment.config new file +1 -0
new file mode 100644
index 0000000000..a278ce9e23
@@ -0,0 +1 @@
+# CONFIG_STM32MP_WATCHDOG is not set
configs/stm32mp157_dk_defconfig new file +30 -0
new file mode 100644
index 0000000000..cb8cfb1693
@@ -0,0 +1,30 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
+BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157-dk/overlay/"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32mp157-dk/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
+BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,STMicroelectronics,linux,v4.19-stm32mp-r1.5)/linux-v4.19-stm32mp-r1.5.tar.gz"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/stmicroelectronics/stm32mp157-dk/linux.config"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
+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_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL=y
+BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,STMicroelectronics,u-boot,v2018.11-stm32mp-r2.5)/u-boot-v2018.11-stm32mp-r2.5.tar.gz"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_basic"
+BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32mp157-dk/uboot-fragment.config"
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_IMG=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.stm32"
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=stm32mp157c-dk2"
+BR2_PACKAGE_HOST_GENIMAGE=y
Signature · 1 line
2.21.0
author Applied
#1 lore raw

PATCH v3 1/1 configs/stm32mp157_dk: new defconfig

Quoted 18 lines · On Wed, 7 Aug 2019 16:24:56 +0200 Thomas Petazzoni…

This commit adds a minimal defconfig to build a Buildroot system for the STM32MP157 Discovery Kit, which is the low-cost evaluation platform for the new STM32MP157 system-on-chip from ST. This system-on-chip features a single or dual Cortex-A7, a single Cortex-M4, and a wide variety of peripherals.

This commit includes a custom linux configuration file, because there is no specific defconfig for this platform in the kernel, only multi_v7_defconfig supports it, which is really a massive defconfig. That's why a custom linux configuration file is added.

A small U-Boot config fragment allows to disable the watchdog, so that userspace by default doesn't need to have a watchdog daemon running.

The vendor U-Boot and Linux trees are used for the moment, but the platform support is being upstreamed, so switching to upstream versions will be possible in the relatively near future.

Quoted 7 lines

---
Changes since v2:
- Bump vendor Linux and U-Boot versions
- Use the $(call github,...) macro also to download U-Boot as a tarball
- Drop all other patches that have been merged

Applied to next, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH v3 1/1 configs/stm32mp157_dk: new defconfig

In reply to Thomas Petazzoni
Quoted 28 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

This commit adds a minimal defconfig to build a Buildroot system for the STM32MP157 Discovery Kit, which is the low-cost evaluation platform for the new STM32MP157 system-on-chip from ST. This system-on-chip features a single or dual Cortex-A7, a single Cortex-M4, and a wide variety of peripherals.

This commit includes a custom linux configuration file, because there is no specific defconfig for this platform in the kernel, only multi_v7_defconfig supports it, which is really a massive defconfig. That's why a custom linux configuration file is added.

A small U-Boot config fragment allows to disable the watchdog, so that userspace by default doesn't need to have a watchdog daemon running.

The vendor U-Boot and Linux trees are used for the moment, but the platform support is being upstreamed, so switching to upstream versions will be possible in the relatively near future.

---
Changes since v2:
- Bump vendor Linux and U-Boot versions
- Use the $(call github,...) macro also to download U-Boot as a tarball
- Drop all other patches that have been merged

Quoted 7 lines

Peter: if you remember from the hackathon, this defconfig was not booting properly. Turned out I rebased on master, but *before* the point you merged the U-Boot change to support "custom build variables". Due to this the DEVICE_TREE=stm32mp157c-dk2 directive from BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS was not taken into account, causing the incorrect DT to be used in the U-Boot build. Properly rebased on the latest master, the defconfig works just fine!

Ahh, that explains it ;)

Signature · 1 line
Bye, Peter Korsgaard