Skip to contentSkip to conversation

configs/stm32mp157c_dk2_trusted_defconfig: new platform

PATCH New Shlomi Vaknin 3 participants 12 messages Sep 27, 2020 – Oct 4, 2020 1 message not in the archive Arm STM32

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs/stm32mp157c_dk2_trusted_defconfig: new platform

Adding support for trusted configuration for stm32mp157c-dk2.
In addtion, the following changes made to the original stm32mp157c_dk2_defconfig:
1. Enable gadget support and wifi support in linux.config.
2. Create a new dts file that contains the bindings for the wifi module. This was copied from the stm32 kernel fork.
3. A txt file for the wifi firmware. This was copied from the yocto bsp layer of st.

---
 .../common/stm32mp157-trusted/genimage.cfg    |  23 +++
 .../stm32mp157c-dk2-trusted/linux.config      | 181 ++++++++++++++++++
 .../overlay/boot/extlinux/extlinux.conf       |   4 +
 .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt |  59 ++++++
 .../stm32mp157c-dk2-trusted/readme.txt        |  38 ++++
 .../stm32mp157c-dk2-wifi.dts                  |  32 ++++
 configs/stm32mp157c_dk2_trusted_defconfig     |  40 ++++
 7 files changed, 377 insertions(+)
 create mode 100644 board/stmicroelectronics/common/stm32mp157-trusted/genimage.cfg
 create mode 100644 board/stmicroelectronics/stm32mp157c-dk2-trusted/linux.config
 create mode 100644 board/stmicroelectronics/stm32mp157c-dk2-trusted/overlay/boot/extlinux/extlinux.conf
 create mode 100644 board/stmicroelectronics/stm32mp157c-dk2-trusted/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
 create mode 100644 board/stmicroelectronics/stm32mp157c-dk2-trusted/readme.txt
 create mode 100644 board/stmicroelectronics/stm32mp157c-dk2-trusted/stm32mp157c-dk2-wifi.dts
 create mode 100644 configs/stm32mp157c_dk2_trusted_defconfig
board/stmicroelectronics/common/stm32mp157-trusted/genimage.cfg new file +23 -0
new file mode 100644
index 0000000000..3b709f756d
@@ -0,0 +1,23 @@
+image sdcard.img {
+	hdimage {
+		gpt = "true"
+	}
+
+	partition fsbl1 {
+		image = "tf-a-stm32mp157c-dk2.stm32"
+	}
+
+	partition fsbl2 {
+		image = "tf-a-stm32mp157c-dk2.stm32"
+	}
+
+	partition ssbl {
+		image = "u-boot.stm32"
+	}
+
+	partition rootfs {
+		image = "rootfs.ext4"
+		partition-type = 0x83
+		bootable = "yes"
+	}
+}
board/stmicroelectronics/stm32mp157c-dk2-trusted/linux.config new file +181 -0

181 lines not on this page · raw message

board/stmicroelectronics/stm32mp157c-dk2-trusted/overlay/boot/extlinux/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..a6595971a8
@@ -0,0 +1,4 @@
+label stm32mp157c-dk2-buildroot
+  kernel /boot/zImage
+  devicetree /boot/stm32mp157c-dk2-wifi.dtb
+  append root=/dev/mmcblk0p4 rootwait
board/stmicroelectronics/stm32mp157c-dk2-trusted/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt new file +59 -0

59 lines not on this page · raw message

board/stmicroelectronics/stm32mp157c-dk2-trusted/readme.txt new file +38 -0
new file mode 100644
index 0000000000..dabf2f018a
@@ -0,0 +1,38 @@
+STM32MP157C Discovery Kit v2
+
+Intro
+=====
+
+This configuration supports the STM32MP157C Discovery Kit 2 (DK2)
+platform:
+
+  https://www.st.com/en/evaluation-tools/stm32mp157c-dk2.html
+
+How to build
+============
+
+ $ make stm32mp157c_dk2_trusted_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/stm32mp157c-dk2-trusted/stm32mp157c-dk2-wifi.dts new file +32 -0
new file mode 100644
index 0000000000..89747d2b5f
@@ -0,0 +1,32 @@
+/dts-v1/;
+
+#include "stm32mp157c-dk2.dts"
+
+/ {
+	wifi_pwrseq: wifi-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&gpioh 4 GPIO_ACTIVE_LOW>;
+	};
+};
+
+/* Wifi */
+&sdmmc2 {
+	arm,primecell-periphid = <0x10153180>;
+	pinctrl-names = "default", "opendrain", "sleep";
+	pinctrl-0 = <&sdmmc2_b4_pins_a>;
+	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
+	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
+	non-removable;
+	st,neg-edge;
+	bus-width = <4>;
+	vmmc-supply = <&v3v3>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	brcmf: bcrmf at 1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+	};
+};
configs/stm32mp157c_dk2_trusted_defconfig new file +40 -0
new file mode 100644
index 0000000000..e5cf8909da
@@ -0,0 +1,40 @@
+BR2_arm=y
+BR2_cortex_a7=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
+BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157c-dk2-trusted/overlay/"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/common/stm32mp157-trusted/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/stmicroelectronics/stm32mp157c-dk2-trusted/linux.config"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
+BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2-trusted/stm32mp157c-dk2-wifi.dts"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX=y
+BR2_PACKAGE_WIRELESS_REGDB=y
+BR2_PACKAGE_WPA_SUPPLICANT=y
+BR2_PACKAGE_WPA_SUPPLICANT_CLI=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-dk2.dtb"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.07"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_trusted"
+BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32mp157c-dk2/uboot-fragment.config"
+# BR2_TARGET_UBOOT_FORMAT_BIN is not set
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.stm32"
+BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=stm32mp157c-dk2"
+BR2_PACKAGE_HOST_GENIMAGE=y
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 configs/stm32mp157c_dk2_trusted_defconfig: new platform

Hello Shlomi,

+Bartosz in Cc.

Thanks for your contribution.

Quoted 8 lines · On Sun, 27 Sep 2020 09:16:06 +0300 Shlomi Vaknin <[email protected]> wrote:

Adding support for trusted configuration for stm32mp157c-dk2.
In addtion, the following changes made to the original stm32mp157c_dk2_defconfig:
1. Enable gadget support and wifi support in linux.config.
2. Create a new dts file that contains the bindings for the wifi module. This was copied from the stm32 kernel fork.
3. A txt file for the wifi firmware. This was copied from the yocto bsp layer of st.

I am not sure it makes sense to have a separate defconfig for this. The ATF-based boot is really the one recommended by ST, and it's also the only one that allows to use the STM32 Cube Programmer for flashing.

So I would rather suggest that we change the existing stm32mp1 defconfigs (both DK1 and DK2) to use ATF instead of U-Boot SPL.

Bartosz, what do you think ?

Thomas

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

PATCH 1/1 configs/stm32mp157c_dk2_trusted_defconfig: new platform

Hello guys,

Quoted 17 lines · Thomas Petazzoni

Hello Shlomi,

+Bartosz in Cc.

Thanks for your contribution.

Quoted 8 lines · On Sun, 27 Sep 2020 09:16:06 +0300 Shlomi Vaknin <[email protected]> wrote:

Adding support for trusted configuration for stm32mp157c-dk2.
In addtion, the following changes made to the original stm32mp157c_dk2_defconfig:
1. Enable gadget support and wifi support in linux.config.
2. Create a new dts file that contains the bindings for the wifi module. This was copied from the stm32 kernel fork.
3. A txt file for the wifi firmware. This was copied from the yocto bsp layer of st.

Quoted 8 lines

I am not sure it makes sense to have a separate defconfig for this. The ATF-based boot is really the one recommended by ST, and it's also the only one that allows to use the STM32 Cube Programmer for flashing.

So I would rather suggest that we change the existing stm32mp1 defconfigs (both DK1 and DK2) to use ATF instead of U-Boot SPL.

Bartosz, what do you think ?

It sounds reasonable for me. The WIFI support would be really interesting because our configs don't contain that but I'm a bit sceptical to the changes that are not accepted by the upstream (or maybe I haven't noticed PR with devicetree changes on the linux mailing list?). There is also couple of things on my TODO list that could be improved within support of those boards so if everyone is ok with the above changes let's start from that.

Quoted 2 lines

Thomas

Best
Bartek

#3 lore raw

PATCH v2 1/4 boot/uboot: add stm32 binary format

In reply to Shlomi Vaknin

Add .stm32 binary format that uboot generates for the trusted configuration.

---
 boot/uboot/Config.in | 4 ++++
 boot/uboot/uboot.mk  | 5 +++++
 2 files changed, 9 insertions(+)
boot/uboot/Config.in +4 -0
index a87a642581..d317624fb6 100644
@@ -267,6 +267,10 @@ config BR2_TARGET_UBOOT_FORMAT_KWB
 	bool "u-boot.kwb (Marvell)"
 	depends on BR2_arm
 
+config BR2_TARGET_UBOOT_FORMAT_STM32
+        bool "u-boot.stm32"
+        depends on BR2_arm
+
 config BR2_TARGET_UBOOT_FORMAT_ELF
 	bool "u-boot.elf"
 
boot/uboot/uboot.mk +5 -0
index 1831466780..080e6beb08 100644
@@ -62,6 +62,11 @@ UBOOT_BINS += u-boot.kwb
 UBOOT_MAKE_TARGET += u-boot.kwb
 endif
 
+ifeq ($(BR2_TARGET_UBOOT_FORMAT_STM32),y)
+UBOOT_BINS += u-boot.stm32
+UBOOT_MAKE_TARGET += u-boot.stm32
+endif
+
 ifeq ($(BR2_TARGET_UBOOT_FORMAT_AIS),y)
 UBOOT_BINS += u-boot.ais
 UBOOT_MAKE_TARGET += u-boot.ais
Signature · 1 line
2.25.1
#4 lore raw

PATCH v2 2/4 configs/stm32mp157*: use trusted configuration

Adding support for trusted configuration for stm32mp157c-dk2 and stm32mp157a-dk1. This patch change using uboot spl as fsbl to using arm trusted firmware. The reason for this change is that st recommends to use this configuration (or optee) and not the basic.
In addtion, this commit enables gadget support in linux.config.

---
 .../genimage.cfg                              |  6 ++---
 .../stm32mp157a-dk1/linux.config              | 24 +++++++------------
 .../stm32mp157c-dk2/genimage.cfg              | 23 ++++++++++++++++++
 .../stm32mp157c-dk2/linux.config              | 20 +++++++---------
 configs/stm32mp157a_dk1_defconfig             | 13 ++++++----
 configs/stm32mp157c_dk2_defconfig             | 13 ++++++----
 6 files changed, 58 insertions(+), 41 deletions(-)
 rename board/stmicroelectronics/{common/stm32mp157 => stm32mp157a-dk1}/genimage.cfg (66%)
 create mode 100644 board/stmicroelectronics/stm32mp157c-dk2/genimage.cfg
board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg renamed from board/stmicroelectronics/common/stm32mp157/genimage.cfg +3 -3
similarity index 66%
rename from board/stmicroelectronics/common/stm32mp157/genimage.cfg
rename to board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg
index d1ce530cc5..9ba22a981f 100644
@@ -4,15 +4,15 @@ image sdcard.img {
 	}
 
 	partition fsbl1 {
-		image = "u-boot-spl.stm32"
+		image = "tf-a-stm32mp157a-dk1.stm32"
 	}
 
 	partition fsbl2 {
-		image = "u-boot-spl.stm32"
+		image = "tf-a-stm32mp157a-dk1.stm32"
 	}
 
 	partition ssbl {
-		image = "u-boot.img"
+		image = "u-boot.stm32"
 	}
 
 	partition rootfs {
board/stmicroelectronics/stm32mp157a-dk1/linux.config +8 -16
index 95c834e431..47729ea97c 100644
@@ -47,15 +47,10 @@ CONFIG_CAN=y
 CONFIG_CAN_M_CAN=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=128
 CONFIG_SIMPLE_PM_BUS=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_STM32_FMC2=y
 CONFIG_MTD_SPI_NOR=y
 # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
 CONFIG_MTD_UBI=y
@@ -107,13 +102,6 @@ CONFIG_REGULATOR_STPMIC1=y
 CONFIG_DRM=y
 CONFIG_DRM_STM=y
 CONFIG_DRM_STM_DSI=y
-# CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set
-# CONFIG_DRM_SII902X is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-# CONFIG_LCD_CLASS_DEVICE is not set
-# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
-# CONFIG_BACKLIGHT_GENERIC is not set
-# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_DYNAMIC_MINORS=y
@@ -129,12 +117,17 @@ CONFIG_USB_DWC2=y
 CONFIG_USB_CHIPIDEA=y
 CONFIG_USB_CHIPIDEA_HOST=y
 CONFIG_USB_ISP1760=y
+CONFIG_USB_ISP1760_HOST_ROLE=y
 CONFIG_USB_HSIC_USB3503=y
 CONFIG_USB_GPIO_VBUS=y
 CONFIG_USB_ISP1301=y
 CONFIG_USB_ULPI=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_CONFIGFS=m
+CONFIG_USB_CONFIGFS_ACM=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
 CONFIG_TYPEC=y
-CONFIG_TYPEC_STUSB=y
 CONFIG_MMC=y
 CONFIG_MMC_BLOCK_MINORS=16
 CONFIG_MMC_ARMMMCI=y
@@ -157,15 +150,12 @@ CONFIG_STM32_IPCC=y
 CONFIG_REMOTEPROC=y
 CONFIG_STM32_RPROC=y
 CONFIG_RPMSG_VIRTIO=y
-CONFIG_RPMSG_TTY=y
 CONFIG_IIO=y
 CONFIG_IIO_SW_TRIGGER=y
 CONFIG_SD_ADC_MODULATOR=y
 CONFIG_STM32_ADC_CORE=y
 CONFIG_STM32_ADC=y
-CONFIG_STM32_ADC_TEMP=y
 CONFIG_STM32_DFSDM_ADC=y
-CONFIG_STM32_LPTIMER_CNT=y
 CONFIG_STM32_DAC=y
 CONFIG_IIO_HRTIMER_TRIGGER=y
 CONFIG_IIO_STM32_LPTIMER_TRIGGER=y
@@ -179,4 +169,6 @@ CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=128
 CONFIG_PRINTK_TIME=y
board/stmicroelectronics/stm32mp157c-dk2/genimage.cfg new file +23 -0
new file mode 100644
index 0000000000..3b709f756d
@@ -0,0 +1,23 @@
+image sdcard.img {
+	hdimage {
+		gpt = "true"
+	}
+
+	partition fsbl1 {
+		image = "tf-a-stm32mp157c-dk2.stm32"
+	}
+
+	partition fsbl2 {
+		image = "tf-a-stm32mp157c-dk2.stm32"
+	}
+
+	partition ssbl {
+		image = "u-boot.stm32"
+	}
+
+	partition rootfs {
+		image = "rootfs.ext4"
+		partition-type = 0x83
+		bootable = "yes"
+	}
+}
board/stmicroelectronics/stm32mp157c-dk2/linux.config +8 -12
index 878a0c39f1..c03eb748b4 100644
@@ -47,15 +47,10 @@ CONFIG_CAN=y
 CONFIG_CAN_M_CAN=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=128
 CONFIG_SIMPLE_PM_BUS=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_STM32_FMC2=y
 CONFIG_MTD_SPI_NOR=y
 # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
 CONFIG_MTD_UBI=y
@@ -82,7 +77,6 @@ CONFIG_SERIAL_STM32_CONSOLE=y
 CONFIG_SERIAL_DEV_BUS=y
 CONFIG_HW_RANDOM=y
 CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_MUX=y
 CONFIG_I2C_STM32F7=y
 CONFIG_SPI=y
 CONFIG_SPI_STM32=y
@@ -109,8 +103,6 @@ CONFIG_DRM_STM=y
 CONFIG_DRM_STM_DSI=y
 CONFIG_DRM_PANEL_ORISETECH_OTM8009A=y
 CONFIG_DRM_SII902X=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-# CONFIG_LCD_CLASS_DEVICE is not set
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
 # CONFIG_BACKLIGHT_GENERIC is not set
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
@@ -129,12 +121,17 @@ CONFIG_USB_DWC2=y
 CONFIG_USB_CHIPIDEA=y
 CONFIG_USB_CHIPIDEA_HOST=y
 CONFIG_USB_ISP1760=y
+CONFIG_USB_ISP1760_HOST_ROLE=y
 CONFIG_USB_HSIC_USB3503=y
 CONFIG_USB_GPIO_VBUS=y
 CONFIG_USB_ISP1301=y
 CONFIG_USB_ULPI=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_CONFIGFS=m
+CONFIG_USB_CONFIGFS_ACM=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
 CONFIG_TYPEC=y
-CONFIG_TYPEC_STUSB=y
 CONFIG_MMC=y
 CONFIG_MMC_BLOCK_MINORS=16
 CONFIG_MMC_ARMMMCI=y
@@ -157,15 +154,12 @@ CONFIG_STM32_IPCC=y
 CONFIG_REMOTEPROC=y
 CONFIG_STM32_RPROC=y
 CONFIG_RPMSG_VIRTIO=y
-CONFIG_RPMSG_TTY=y
 CONFIG_IIO=y
 CONFIG_IIO_SW_TRIGGER=y
 CONFIG_SD_ADC_MODULATOR=y
 CONFIG_STM32_ADC_CORE=y
 CONFIG_STM32_ADC=y
-CONFIG_STM32_ADC_TEMP=y
 CONFIG_STM32_DFSDM_ADC=y
-CONFIG_STM32_LPTIMER_CNT=y
 CONFIG_STM32_DAC=y
 CONFIG_IIO_HRTIMER_TRIGGER=y
 CONFIG_IIO_STM32_LPTIMER_TRIGGER=y
@@ -179,4 +173,6 @@ CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=128
 CONFIG_PRINTK_TIME=y
configs/stm32mp157a_dk1_defconfig +8 -5
index f172539c02..8197fcc31b 100644
@@ -3,7 +3,7 @@ BR2_cortex_a7=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
 BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157a-dk1/overlay/"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/common/stm32mp157/genimage.cfg"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
@@ -16,15 +16,18 @@ 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=stm32mp157a-dk1.dtb"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.07"
-BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_basic"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_trusted"
 BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32mp157a-dk1/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_FORMAT_STM32=y
 BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=stm32mp157a-dk1"
 BR2_PACKAGE_HOST_GENIMAGE=y
configs/stm32mp157c_dk2_defconfig +8 -5
index 49cfb0733c..15e1e85f69 100644
@@ -3,7 +3,7 @@ BR2_cortex_a7=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
 BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157c-dk2/overlay/"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/common/stm32mp157/genimage.cfg"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32mp157c-dk2/genimage.cfg"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
@@ -16,15 +16,18 @@ 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-dk2.dtb"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.07"
-BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_basic"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_trusted"
 BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32mp157c-dk2/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_FORMAT_STM32=y
 BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=stm32mp157c-dk2"
 BR2_PACKAGE_HOST_GENIMAGE=y
Signature · 1 line
2.25.1
#5 lore raw

PATCH v2 2/4 configs/stm32mp157*: use trusted configuration

Hello Shlomi,

Quoted 28 lines · Shlomi Vaknin

Adding support for trusted configuration for stm32mp157c-dk2 and stm32mp157a-dk1. This patch change using uboot spl as fsbl to using arm trusted firmware. The reason for this change is that st recommends to use this configuration (or optee) and not the basic.
In addtion, this commit enables gadget support in linux.config.

---
  .../genimage.cfg                              |  6 ++---
  .../stm32mp157a-dk1/linux.config              | 24 +++++++------------
  .../stm32mp157c-dk2/genimage.cfg              | 23 ++++++++++++++++++
  .../stm32mp157c-dk2/linux.config              | 20 +++++++---------
  configs/stm32mp157a_dk1_defconfig             | 13 ++++++----
  configs/stm32mp157c_dk2_defconfig             | 13 ++++++----
  6 files changed, 58 insertions(+), 41 deletions(-)

rename board/stmicroelectronics/{common/stm32mp157 => stm32mp157a-dk1}/genimage.cfg (66%) create mode 100644 board/stmicroelectronics/stm32mp157c-dk2/genimage.cfg

board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg renamed from board/stmicroelectronics/common/stm32mp157/genimage.cfg +0 -0
similarity index 66%
rename from board/stmicroelectronics/common/stm32mp157/genimage.cfg
rename to board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg
index d1ce530cc5..9ba22a981f 100644
@@ -4,15 +4,15 @@ image sdcard.img {
  	}
 

board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg image sdcard.img { · line 13

Quoted 10 lines
board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg renamed from board/stmicroelectronics/common/stm32mp157/genimage.cfg +2 -2
  	partition fsbl1 {
-		image = "u-boot-spl.stm32"
+		image = "tf-a-stm32mp157a-dk1.stm32"
  	}
 
  	partition fsbl2 {
-		image = "u-boot-spl.stm32"
+		image = "tf-a-stm32mp157a-dk1.stm32"
  	}
 

Maybe it would be worth to create a common config file the same as for imx boards (see board/freescale/common/imx/genimage.cfg.template) because the only difference between genimage config file for dk1 and dk2 is image name but the question is: if we are going to provide more stm32mp157 boards. If so in my opinion that would be better but if not the 2 separates configs are acceptable.

Best
Bartek

Quoted 262 lines
board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg renamed from board/stmicroelectronics/common/stm32mp157/genimage.cfg +1 -1
  	partition ssbl {
-		image = "u-boot.img"
+		image = "u-boot.stm32"
  	}
 
  	partition rootfs {
board/stmicroelectronics/stm32mp157a-dk1/linux.config +8 -16
index 95c834e431..47729ea97c 100644
@@ -47,15 +47,10 @@ CONFIG_CAN=y
  CONFIG_CAN_M_CAN=y
  CONFIG_DEVTMPFS=y
  CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=128
  CONFIG_SIMPLE_PM_BUS=y
  CONFIG_MTD=y
  CONFIG_MTD_CMDLINE_PARTS=y
  CONFIG_MTD_BLOCK=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_STM32_FMC2=y
  CONFIG_MTD_SPI_NOR=y
  # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
  CONFIG_MTD_UBI=y
@@ -107,13 +102,6 @@ CONFIG_REGULATOR_STPMIC1=y
  CONFIG_DRM=y
  CONFIG_DRM_STM=y
  CONFIG_DRM_STM_DSI=y
-# CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set
-# CONFIG_DRM_SII902X is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-# CONFIG_LCD_CLASS_DEVICE is not set
-# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
-# CONFIG_BACKLIGHT_GENERIC is not set
-# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
  CONFIG_SOUND=y
  CONFIG_SND=y
  CONFIG_SND_DYNAMIC_MINORS=y
@@ -129,12 +117,17 @@ CONFIG_USB_DWC2=y
  CONFIG_USB_CHIPIDEA=y
  CONFIG_USB_CHIPIDEA_HOST=y
  CONFIG_USB_ISP1760=y
+CONFIG_USB_ISP1760_HOST_ROLE=y
  CONFIG_USB_HSIC_USB3503=y
  CONFIG_USB_GPIO_VBUS=y
  CONFIG_USB_ISP1301=y
  CONFIG_USB_ULPI=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_CONFIGFS=m
+CONFIG_USB_CONFIGFS_ACM=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
  CONFIG_TYPEC=y
-CONFIG_TYPEC_STUSB=y
  CONFIG_MMC=y
  CONFIG_MMC_BLOCK_MINORS=16
  CONFIG_MMC_ARMMMCI=y
@@ -157,15 +150,12 @@ CONFIG_STM32_IPCC=y
  CONFIG_REMOTEPROC=y
  CONFIG_STM32_RPROC=y
  CONFIG_RPMSG_VIRTIO=y
-CONFIG_RPMSG_TTY=y
  CONFIG_IIO=y
  CONFIG_IIO_SW_TRIGGER=y
  CONFIG_SD_ADC_MODULATOR=y
  CONFIG_STM32_ADC_CORE=y
  CONFIG_STM32_ADC=y
-CONFIG_STM32_ADC_TEMP=y
  CONFIG_STM32_DFSDM_ADC=y
-CONFIG_STM32_LPTIMER_CNT=y
  CONFIG_STM32_DAC=y
  CONFIG_IIO_HRTIMER_TRIGGER=y
  CONFIG_IIO_STM32_LPTIMER_TRIGGER=y
@@ -179,4 +169,6 @@ CONFIG_MSDOS_FS=y
  CONFIG_VFAT_FS=y
  CONFIG_TMPFS=y
  CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=128
  CONFIG_PRINTK_TIME=y
board/stmicroelectronics/stm32mp157c-dk2/genimage.cfg new file +23 -0
new file mode 100644
index 0000000000..3b709f756d
@@ -0,0 +1,23 @@
+image sdcard.img {
+	hdimage {
+		gpt = "true"
+	}
+
+	partition fsbl1 {
+		image = "tf-a-stm32mp157c-dk2.stm32"
+	}
+
+	partition fsbl2 {
+		image = "tf-a-stm32mp157c-dk2.stm32"
+	}
+
+	partition ssbl {
+		image = "u-boot.stm32"
+	}
+
+	partition rootfs {
+		image = "rootfs.ext4"
+		partition-type = 0x83
+		bootable = "yes"
+	}
+}
board/stmicroelectronics/stm32mp157c-dk2/linux.config +8 -12
index 878a0c39f1..c03eb748b4 100644
@@ -47,15 +47,10 @@ CONFIG_CAN=y
  CONFIG_CAN_M_CAN=y
  CONFIG_DEVTMPFS=y
  CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=128
  CONFIG_SIMPLE_PM_BUS=y
  CONFIG_MTD=y
  CONFIG_MTD_CMDLINE_PARTS=y
  CONFIG_MTD_BLOCK=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_STM32_FMC2=y
  CONFIG_MTD_SPI_NOR=y
  # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
  CONFIG_MTD_UBI=y
@@ -82,7 +77,6 @@ CONFIG_SERIAL_STM32_CONSOLE=y
  CONFIG_SERIAL_DEV_BUS=y
  CONFIG_HW_RANDOM=y
  CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_MUX=y
  CONFIG_I2C_STM32F7=y
  CONFIG_SPI=y
  CONFIG_SPI_STM32=y
@@ -109,8 +103,6 @@ CONFIG_DRM_STM=y
  CONFIG_DRM_STM_DSI=y
  CONFIG_DRM_PANEL_ORISETECH_OTM8009A=y
  CONFIG_DRM_SII902X=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-# CONFIG_LCD_CLASS_DEVICE is not set
  CONFIG_BACKLIGHT_CLASS_DEVICE=y
  # CONFIG_BACKLIGHT_GENERIC is not set
  CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
@@ -129,12 +121,17 @@ CONFIG_USB_DWC2=y
  CONFIG_USB_CHIPIDEA=y
  CONFIG_USB_CHIPIDEA_HOST=y
  CONFIG_USB_ISP1760=y
+CONFIG_USB_ISP1760_HOST_ROLE=y
  CONFIG_USB_HSIC_USB3503=y
  CONFIG_USB_GPIO_VBUS=y
  CONFIG_USB_ISP1301=y
  CONFIG_USB_ULPI=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_CONFIGFS=m
+CONFIG_USB_CONFIGFS_ACM=y
+CONFIG_USB_CONFIGFS_ECM=y
+CONFIG_USB_CONFIGFS_MASS_STORAGE=y
  CONFIG_TYPEC=y
-CONFIG_TYPEC_STUSB=y
  CONFIG_MMC=y
  CONFIG_MMC_BLOCK_MINORS=16
  CONFIG_MMC_ARMMMCI=y
@@ -157,15 +154,12 @@ CONFIG_STM32_IPCC=y
  CONFIG_REMOTEPROC=y
  CONFIG_STM32_RPROC=y
  CONFIG_RPMSG_VIRTIO=y
-CONFIG_RPMSG_TTY=y
  CONFIG_IIO=y
  CONFIG_IIO_SW_TRIGGER=y
  CONFIG_SD_ADC_MODULATOR=y
  CONFIG_STM32_ADC_CORE=y
  CONFIG_STM32_ADC=y
-CONFIG_STM32_ADC_TEMP=y
  CONFIG_STM32_DFSDM_ADC=y
-CONFIG_STM32_LPTIMER_CNT=y
  CONFIG_STM32_DAC=y
  CONFIG_IIO_HRTIMER_TRIGGER=y
  CONFIG_IIO_STM32_LPTIMER_TRIGGER=y
@@ -179,4 +173,6 @@ CONFIG_MSDOS_FS=y
  CONFIG_VFAT_FS=y
  CONFIG_TMPFS=y
  CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=128
  CONFIG_PRINTK_TIME=y
configs/stm32mp157a_dk1_defconfig +8 -5
index f172539c02..8197fcc31b 100644
@@ -3,7 +3,7 @@ BR2_cortex_a7=y
  BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
  BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157a-dk1/overlay/"
  BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/common/stm32mp157/genimage.cfg"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg"
  BR2_LINUX_KERNEL=y
  BR2_LINUX_KERNEL_CUSTOM_VERSION=y
  BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
@@ -16,15 +16,18 @@ 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=stm32mp157a-dk1.dtb"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
  BR2_TARGET_UBOOT=y
  BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
  BR2_TARGET_UBOOT_CUSTOM_VERSION=y
  BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.07"
-BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_basic"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_trusted"
  BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32mp157a-dk1/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_FORMAT_STM32=y
  BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=stm32mp157a-dk1"
  BR2_PACKAGE_HOST_GENIMAGE=y
configs/stm32mp157c_dk2_defconfig +8 -5
index 49cfb0733c..15e1e85f69 100644
@@ -3,7 +3,7 @@ BR2_cortex_a7=y
  BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
  BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157c-dk2/overlay/"
  BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
-BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/common/stm32mp157/genimage.cfg"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32mp157c-dk2/genimage.cfg"
  BR2_LINUX_KERNEL=y
  BR2_LINUX_KERNEL_CUSTOM_VERSION=y
  BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
@@ -16,15 +16,18 @@ 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-dk2.dtb"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
  BR2_TARGET_UBOOT=y
  BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
  BR2_TARGET_UBOOT_CUSTOM_VERSION=y
  BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2020.07"
-BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_basic"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="stm32mp15_trusted"
  BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32mp157c-dk2/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_FORMAT_STM32=y
  BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="DEVICE_TREE=stm32mp157c-dk2"
  BR2_PACKAGE_HOST_GENIMAGE=y
#6 lore raw

PATCH v2 3/4 configs/stm32mp157*: bump kernel version

In reply to Shlomi Vaknin

Since kernel 5.7 is EOL now, this upgrades it to the latest version which is the default by buildroot.

---
 configs/stm32mp157a_dk1_defconfig | 3 ---
 configs/stm32mp157c_dk2_defconfig | 3 ---
 2 files changed, 6 deletions(-)
configs/stm32mp157a_dk1_defconfig +0 -3
index 8197fcc31b..f72bdb49ed 100644
@@ -1,12 +1,9 @@
 BR2_arm=y
 BR2_cortex_a7=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
 BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157a-dk1/overlay/"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg"
 BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/stmicroelectronics/stm32mp157a-dk1/linux.config"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
configs/stm32mp157c_dk2_defconfig +0 -3
index 15e1e85f69..9c688c6688 100644
@@ -1,12 +1,9 @@
 BR2_arm=y
 BR2_cortex_a7=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
 BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157c-dk2/overlay/"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32mp157c-dk2/genimage.cfg"
 BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/stmicroelectronics/stm32mp157c-dk2/linux.config"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
Signature · 1 line
2.25.1
#7 lore raw

PATCH v2 3/4 configs/stm32mp157*: bump kernel version

Hello Shlomi,

Quoted 14 lines · Shlomi Vaknin

Since kernel 5.7 is EOL now, this upgrades it to the latest version which is the default by buildroot.

---
  configs/stm32mp157a_dk1_defconfig | 3 ---
  configs/stm32mp157c_dk2_defconfig | 3 ---
  2 files changed, 6 deletions(-)
configs/stm32mp157a_dk1_defconfig +0 -0
index 8197fcc31b..f72bdb49ed 100644

configs/stm32mp157a_dk1_defconfig line 9

Quoted 9 lines
configs/stm32mp157a_dk1_defconfig +0 -3
@@ -1,12 +1,9 @@
  BR2_arm=y
  BR2_cortex_a7=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
  BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157a-dk1/overlay/"
  BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
  BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg"
  BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"

That's not a correct way to do that. You always have to specify kernel headers and kernel version, the current latest version
is 5.8.13 so if you wanna use this one you should set:

BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"

configs/stm32mp157c_dk2_defconfig line 3

Quoted 11 lines
configs/stm32mp157a_dk1_defconfig +0 -0
  BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
  BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/stmicroelectronics/stm32mp157a-dk1/linux.config"
  BR2_LINUX_KERNEL_DTS_SUPPORT=y
configs/stm32mp157c_dk2_defconfig +0 -1
index 15e1e85f69..9c688c6688 100644
@@ -1,12 +1,9 @@
  BR2_arm=y
  BR2_cortex_a7=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y

same here

configs/stm32mp157c_dk2_defconfig line 9

Quoted 6 lines
configs/stm32mp157c_dk2_defconfig +0 -2
  BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157c-dk2/overlay/"
  BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
  BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/stmicroelectronics/stm32mp157c-dk2/genimage.cfg"
  BR2_LINUX_KERNEL=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"

and here

configs/stm32mp157c_dk2_defconfig line 9

Quoted 3 lines
configs/stm32mp157c_dk2_defconfig +0 -0
  BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
  BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/stmicroelectronics/stm32mp157c-dk2/linux.config"
  BR2_LINUX_KERNEL_DTS_SUPPORT=y

Best
Bartek

A message that is not in the archive (sent off-list or not yet received): CALxJ29RWRdx3RCJW1tx7P_J7ynow=X97OWVvZSZXRTvC_2KKSg@mail.gmail.com

#9 lore raw

PATCH v2 3/4 configs/stm32mp157*: bump kernel version

Hi Shlomi,

please remember about buildroot at buildroot.org in Cc when you answer because you've missed that so your answer isn't visible in patchwork/mailing list.

Quoted 5 lines · Shlomi Vaknin

Hi!

What I did was to enable?BR2_LINUX_KERNEL_LATEST_VERSION in the menuconfig. This is the default by buildroot so it was removed from the defconfig. Is it still preferable?to change it to a custom version?

Yup, it's.

Best
Bartek

Quoted 64 lines

??????? ??? ??, 2 ????? 2020 ?-22:26 ??? ?Bartosz Bilas?? <?b.bilas at grinn-global.com <mailto:[email protected]>??>:?

    Hello Shlomi,

    On 02.10.2020 16:24, Shlomi Vaknin wrote:
    > Since kernel 5.7 is EOL now, this upgrades it to the latest version
    > which is the default by buildroot.
    >
    > Signed-off-by: Shlomi Vaknin<[email protected]
    <mailto:[email protected]>>
    > ---
    >? ?configs/stm32mp157a_dk1_defconfig | 3 ---
    >? ?configs/stm32mp157c_dk2_defconfig | 3 ---
    >? ?2 files changed, 6 deletions(-)
    >
    > diff --git a/configs/stm32mp157a_dk1_defconfig
    b/configs/stm32mp157a_dk1_defconfig
    > index 8197fcc31b..f72bdb49ed 100644
    > --- a/configs/stm32mp157a_dk1_defconfig
    > +++ b/configs/stm32mp157a_dk1_defconfig
    > @@ -1,12 +1,9 @@
    >? ?BR2_arm=y
    >? ?BR2_cortex_a7=y
    > -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
    >
    ?BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157a-dk1/overlay/"
    > ?BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
    >? ?BR2_ROOTFS_POST_SCRIPT_ARGS="-c
    board/stmicroelectronics/stm32mp157a-dk1/genimage.cfg"
    >? ?BR2_LINUX_KERNEL=y
    > -BR2_LINUX_KERNEL_CUSTOM_VERSION=y
    > -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
    That's not a correct way to do that. You always have to specify
    kernel
    headers and kernel version, the current latest version
    is 5.8.13 so if you wanna use this one you should set:


    BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
    BR2_LINUX_KERNEL_CUSTOM_VERSION=y
    BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
    >? ?BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
    >
    ?BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/stmicroelectronics/stm32mp157a-dk1/linux.config"
    >? ?BR2_LINUX_KERNEL_DTS_SUPPORT=y
    > diff --git a/configs/stm32mp157c_dk2_defconfig
    b/configs/stm32mp157c_dk2_defconfig
    > index 15e1e85f69..9c688c6688 100644
    > --- a/configs/stm32mp157c_dk2_defconfig
    > +++ b/configs/stm32mp157c_dk2_defconfig
    > @@ -1,12 +1,9 @@
    >? ?BR2_arm=y
    >? ?BR2_cortex_a7=y
    > -BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
    same here
    >
    ?BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157c-dk2/overlay/"
    > ?BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
    >? ?BR2_ROOTFS_POST_SCRIPT_ARGS="-c
    board/stmicroelectronics/stm32mp157c-dk2/genimage.cfg"
    >? ?BR2_LINUX_KERNEL=y
    > -BR2_LINUX_KERNEL_CUSTOM_VERSION=y
Quoted 9 lines
    > -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
    and here
    >? ?BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
    >
    ?BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/stmicroelectronics/stm32mp157c-dk2/linux.config"
    >? ?BR2_LINUX_KERNEL_DTS_SUPPORT=y
    Best
    Bartek

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201003/737442a3/attachment.html>

#10 lore raw

PATCH v2 4/4 configs/stm32mp157c-dk2: add support for wifi

In reply to Shlomi Vaknin

Adding support for wifi for stm32mp157c-dk2 is achieved by using
another dts which includes the bindings for the wifi module.
In addition, a txt file for the wifi firmware. This was copied from the yocto bsp layer of st.

---
 .../overlay/boot/extlinux/extlinux.conf       |  2 +-
 .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59 +++++++++++++++++++
 .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
 3 files changed, 92 insertions(+), 1 deletion(-)
 create mode 100644 board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
 create mode 100644 board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf +1 -1
index 5b7f56ee77..a6595971a8 100644
@@ -1,4 +1,4 @@
 label stm32mp157c-dk2-buildroot
   kernel /boot/zImage
-  devicetree /boot/stm32mp157c-dk2.dtb
+  devicetree /boot/stm32mp157c-dk2-wifi.dtb
   append root=/dev/mmcblk0p4 rootwait
board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt new file +59 -0

59 lines not on this page · raw message

board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts new file +32 -0
new file mode 100644
index 0000000000..89747d2b5f
@@ -0,0 +1,32 @@
+/dts-v1/;
+
+#include "stm32mp157c-dk2.dts"
+
+/ {
+	wifi_pwrseq: wifi-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&gpioh 4 GPIO_ACTIVE_LOW>;
+	};
+};
+
+/* Wifi */
+&sdmmc2 {
+	arm,primecell-periphid = <0x10153180>;
+	pinctrl-names = "default", "opendrain", "sleep";
+	pinctrl-0 = <&sdmmc2_b4_pins_a>;
+	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
+	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
+	non-removable;
+	st,neg-edge;
+	bus-width = <4>;
+	vmmc-supply = <&v3v3>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	brcmf: bcrmf at 1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+	};
+};
Signature · 1 line
2.25.1
#11 lore raw

PATCH v2 4/4 configs/stm32mp157c-dk2: add support for wifi

Hello Shlomi,

board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt

Quoted 28 lines · Shlomi Vaknin

Adding support for wifi for stm32mp157c-dk2 is achieved by using
another dts which includes the bindings for the wifi module.
In addition, a txt file for the wifi firmware. This was copied from the yocto bsp layer of st.

---
  .../overlay/boot/extlinux/extlinux.conf       |  2 +-
  .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59 +++++++++++++++++++
  .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
  3 files changed, 92 insertions(+), 1 deletion(-)

create mode 100644 board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt create mode 100644 board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts

board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf +1 -1
index 5b7f56ee77..a6595971a8 100644
@@ -1,4 +1,4 @@
  label stm32mp157c-dk2-buildroot
    kernel /boot/zImage
-  devicetree /boot/stm32mp157c-dk2.dtb
+  devicetree /boot/stm32mp157c-dk2-wifi.dtb
    append root=/dev/mmcblk0p4 rootwait
board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt new file +0 -0
new file mode 100644
index 0000000000..b36de8837f

To have rootfs overlay enabled you have to set BR2_ROOTFS_OVERLAY option within defconfig file with given path to this directory (in that case it would be board/stmicroelectronics/stm32mp157c-dk2/overlay).

Quoted 50 lines
board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt new file +49 -0
@@ -0,0 +1,59 @@
+# NVRAM file for BCM943430WLSELG
+# 2.4 GHz, 20 MHz BW mode
+
+# The following parameter values are just placeholders, need to be updated.
+manfid=0x2d0
+prodid=0x0726
+vendid=0x14e4
+devid=0x43e2
+boardtype=0x0726
+boardrev=0x1202
+boardnum=22
+macaddr=00:90:4c:c5:12:38
+sromrev=11
+boardflags=0x00404201
+boardflags3=0x08000000
+xtalfreq=37400
+#xtalfreq=19200
+nocrc=1
+ag0=255
+aa2g=1
+ccode=ALL
+
+pa0itssit=0x20
+extpagain2g=0
+
+#PA parameters for 2.4GHz, measured at CHIP OUTPUT
+pa2ga0=-168,7161,-820
+AvVmid_c0=0x0,0xc8
+cckpwroffset0=5
+
+# PPR params
+maxp2ga0=84
+txpwrbckof=6
+cckbw202gpo=0
+legofdmbw202gpo=0x66111111
+mcsbw202gpo=0x77711111
+propbw202gpo=0xdd
+
+# OFDM IIR :
+ofdmdigfilttype=18
+ofdmdigfilttypebe=18
+# PAPD mode:
+papdmode=1
+papdvalidtest=1
+pacalidx2g=32
+papdepsoffset=-36
+papdendidx=61
+
+il0macaddr=00:90:4c:c5:12:38

board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt line 59

Quoted 10 lines
board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt new file +10 -0
+wl0id=0x431b
+
+deadman_to=0xffffffff
+# muxenab: 0x1 for UART enable, 0x2 for GPIOs, 0x8 for JTAG
+muxenab=0x1
+# CLDO PWM voltage settings - 0x4 - 1.1 volt
+#cldo_pwm=0x4
+
+#VCO freq 326.4MHz
+spurconfig=0x3

Is not any firmware blob / driver needed for this module? There is Murata LBEE5KL1DX-883 combo chip on the board that seems to be CYW4343W actually so I guess you need BR2_PACKAGE_MURATA_CYW_FW_CYW43430 package to provide required firmware for that.

Quoted 28 lines
board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts new file +22 -0
new file mode 100644
index 0000000000..89747d2b5f
@@ -0,0 +1,32 @@
+/dts-v1/;
+
+#include "stm32mp157c-dk2.dts"
+
+/ {
+	wifi_pwrseq: wifi-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&gpioh 4 GPIO_ACTIVE_LOW>;
+	};
+};
+
+/* Wifi */
+&sdmmc2 {
+	arm,primecell-periphid = <0x10153180>;
+	pinctrl-names = "default", "opendrain", "sleep";
+	pinctrl-0 = <&sdmmc2_b4_pins_a>;
+	pinctrl-1 = <&sdmmc2_b4_od_pins_a>;
+	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a>;
+	non-removable;
+	st,neg-edge;
+	bus-width = <4>;
+	vmmc-supply = <&v3v3>;

board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts line 32

Quoted 10 lines
board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts new file +10 -0
+	mmc-pwrseq = <&wifi_pwrseq>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	brcmf: bcrmf at 1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+	};
+};

?Are you sure if it is working correctly? I don't see that you are
using this dts anywhere - if you want to use a custom dts file from out of the Linux tree you should set BR2_LINUX_KERNEL_CUSTOM_DTS_PATH option with given path to this file.

Best
Bartek

#12 lore raw

PATCH v2 1/4 boot/uboot: add stm32 binary format

In reply to Shlomi Vaknin

Hi Shlomi,

Quoted 13 lines · Shlomi Vaknin

Add .stm32 binary format that uboot generates for the trusted configuration.

---
  boot/uboot/Config.in | 4 ++++
  boot/uboot/uboot.mk  | 5 +++++
  2 files changed, 9 insertions(+)
boot/uboot/Config.in +0 -0
index a87a642581..d317624fb6 100644

boot/uboot/Config.in config BR2_TARGET_UBOOT_FORMAT_KWB · line 273

Quoted 7 lines
boot/uboot/Config.in +4 -0
@@ -267,6 +267,10 @@ config BR2_TARGET_UBOOT_FORMAT_KWB
  	bool "u-boot.kwb (Marvell)"
  	depends on BR2_arm
 
+config BR2_TARGET_UBOOT_FORMAT_STM32
+        bool "u-boot.stm32"
+        depends on BR2_arm
+

The indents seem to be wrong and that option is not sorted alphabetically.

Anyway here is my:

Best
Bartek

Quoted 19 lines
boot/uboot/Config.in +0 -0
  config BR2_TARGET_UBOOT_FORMAT_ELF
  	bool "u-boot.elf"
 
boot/uboot/uboot.mk +5 -0
index 1831466780..080e6beb08 100644
@@ -62,6 +62,11 @@ UBOOT_BINS += u-boot.kwb
  UBOOT_MAKE_TARGET += u-boot.kwb
  endif
 
+ifeq ($(BR2_TARGET_UBOOT_FORMAT_STM32),y)
+UBOOT_BINS += u-boot.stm32
+UBOOT_MAKE_TARGET += u-boot.stm32
+endif
+
  ifeq ($(BR2_TARGET_UBOOT_FORMAT_AIS),y)
  UBOOT_BINS += u-boot.ais
  UBOOT_MAKE_TARGET += u-boot.ais