All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format
@ 2020-10-07 14:49 Shlomi Vaknin
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration Shlomi Vaknin
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-07 14:49 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
---
 boot/uboot/Config.in | 4 ++++
 boot/uboot/uboot.mk  | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 9e44daffab..01dea01764 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -343,6 +343,10 @@ config BR2_TARGET_UBOOT_FORMAT_SD
 
 	  See doc/README.mxs (or doc/README.mx28_common before 2013.07)
 
+config BR2_TARGET_UBOOT_FORMAT_STM32
+	bool "u-boot.stm32"
+	depends on BR2_arm
+
 config BR2_TARGET_UBOOT_FORMAT_CUSTOM
 	bool "Custom (specify below)"
 	help
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index f27abbd5ba..72d5df412d 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -121,6 +121,11 @@ UBOOT_MAKE_TARGET += u-boot.sb
 UBOOT_DEPENDENCIES += host-elftosb host-openssl
 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_CUSTOM),y)
 UBOOT_BINS += $(call qstrip,$(BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME))
 endif
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration
  2020-10-07 14:49 [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format Shlomi Vaknin
@ 2020-10-07 14:49 ` Shlomi Vaknin
  2020-10-12 18:08   ` Bartosz Bilas
  2020-10-14 17:02   ` Thomas Petazzoni
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 3/4] configs/stm32mp157*: bump kernel version Shlomi Vaknin
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-07 14:49 UTC (permalink / raw)
  To: buildroot

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 addition, this commit enables gadget support in `linux.config`.

In addition, removing partition-type from genimage.cfg is mandatory,
since it creates a hybrid MBR partition table which causes ATF to not find ssbl parition.

Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
---
 .../{genimage.cfg => genimage.cfg.template}   |  7 ++-
 .../common/stm32mp157/post-image.sh           | 43 +++++++++++++++++++
 .../stm32mp157a-dk1/linux.config              | 24 ++++-------
 .../stm32mp157c-dk2/linux.config              | 20 ++++-----
 configs/stm32mp157a_dk1_defconfig             | 14 +++---
 configs/stm32mp157c_dk2_defconfig             | 14 +++---
 6 files changed, 78 insertions(+), 44 deletions(-)
 rename board/stmicroelectronics/common/stm32mp157/{genimage.cfg => genimage.cfg.template} (63%)
 create mode 100755 board/stmicroelectronics/common/stm32mp157/post-image.sh

diff --git a/board/stmicroelectronics/common/stm32mp157/genimage.cfg b/board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
similarity index 63%
rename from board/stmicroelectronics/common/stm32mp157/genimage.cfg
rename to board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
index d1ce530cc5..f341c19f2f 100644
--- a/board/stmicroelectronics/common/stm32mp157/genimage.cfg
+++ b/board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
@@ -4,20 +4,19 @@ image sdcard.img {
 	}
 
 	partition fsbl1 {
-		image = "u-boot-spl.stm32"
+		image = "%ATFBIN%"
 	}
 
 	partition fsbl2 {
-		image = "u-boot-spl.stm32"
+		image = "%ATFBIN%"
 	}
 
 	partition ssbl {
-		image = "u-boot.img"
+		image = "u-boot.stm32"
 	}
 
 	partition rootfs {
 		image = "rootfs.ext4"
-		partition-type = 0x83
 		bootable = "yes"
 	}
 }
diff --git a/board/stmicroelectronics/common/stm32mp157/post-image.sh b/board/stmicroelectronics/common/stm32mp157/post-image.sh
new file mode 100755
index 0000000000..c00a5c6f6c
--- /dev/null
+++ b/board/stmicroelectronics/common/stm32mp157/post-image.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+#
+# atf_image extracts the ATF binary image from DTB_FILE_NAME that appears in
+# BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES in ${BR_CONFIG},
+# then prints the corresponding file name for the genimage
+# configuration file
+#
+atf_image()
+{
+	local ATF_VARIABLES="$(sed -n 's/^BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="\([\/a-zA-Z0-9_=. \-]*\)"$/\1/p' ${BR2_CONFIG})"
+
+	if grep -Eq "DTB_FILE_NAME=stm32mp157c-dk2.dtb" <<< ${ATF_VARIABLES}; then
+		echo "tf-a-stm32mp157c-dk2.stm32"
+	elif grep -Eq "DTB_FILE_NAME=stm32mp157a-dk1.dtb" <<< ${ATF_VARIABLES}; then
+                echo "tf-a-stm32mp157a-dk1.stm32"
+	fi
+}
+
+main()
+{
+	local ATFBIN="$(atf_image)"
+	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
+	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+	sed -e "s/%ATFBIN%/${ATFBIN}/" \
+		board/stmicroelectronics/common/stm32mp157/genimage.cfg.template > ${GENIMAGE_CFG}
+
+	rm -rf "${GENIMAGE_TMP}"
+
+	genimage \
+		--rootpath "${TARGET_DIR}" \
+		--tmppath "${GENIMAGE_TMP}" \
+		--inputpath "${BINARIES_DIR}" \
+		--outputpath "${BINARIES_DIR}" \
+		--config "${GENIMAGE_CFG}"
+
+	rm -f ${GENIMAGE_CFG}
+
+	exit $?
+}
+
+main $@
diff --git a/board/stmicroelectronics/stm32mp157a-dk1/linux.config b/board/stmicroelectronics/stm32mp157a-dk1/linux.config
index 95c834e431..47729ea97c 100644
--- a/board/stmicroelectronics/stm32mp157a-dk1/linux.config
+++ b/board/stmicroelectronics/stm32mp157a-dk1/linux.config
@@ -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
diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
index 878a0c39f1..c03eb748b4 100644
--- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
+++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
@@ -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
diff --git a/configs/stm32mp157a_dk1_defconfig b/configs/stm32mp157a_dk1_defconfig
index f172539c02..cdbb5a8cdf 100644
--- a/configs/stm32mp157a_dk1_defconfig
+++ b/configs/stm32mp157a_dk1_defconfig
@@ -2,8 +2,7 @@ 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/common/stm32mp157/genimage.cfg"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
@@ -16,15 +15,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
diff --git a/configs/stm32mp157c_dk2_defconfig b/configs/stm32mp157c_dk2_defconfig
index 49cfb0733c..6251491e0f 100644
--- a/configs/stm32mp157c_dk2_defconfig
+++ b/configs/stm32mp157c_dk2_defconfig
@@ -2,8 +2,7 @@ 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/common/stm32mp157/genimage.cfg"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
@@ -16,15 +15,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
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 3/4] configs/stm32mp157*: bump kernel version
  2020-10-07 14:49 [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format Shlomi Vaknin
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration Shlomi Vaknin
@ 2020-10-07 14:49 ` Shlomi Vaknin
  2020-10-14 17:02   ` Thomas Petazzoni
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi Shlomi Vaknin
  2020-10-14 17:00 ` [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format Thomas Petazzoni
  3 siblings, 1 reply; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-07 14:49 UTC (permalink / raw)
  To: buildroot

Since kernel 5.7 is EOL now, this upgrades it to version 5.8.13.

Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
---
 configs/stm32mp157a_dk1_defconfig | 4 ++--
 configs/stm32mp157c_dk2_defconfig | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/configs/stm32mp157a_dk1_defconfig b/configs/stm32mp157a_dk1_defconfig
index cdbb5a8cdf..4d397300cb 100644
--- a/configs/stm32mp157a_dk1_defconfig
+++ b/configs/stm32mp157a_dk1_defconfig
@@ -1,11 +1,11 @@
 BR2_arm=y
 BR2_cortex_a7=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
 BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157a-dk1/overlay/"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
+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 6251491e0f..bf7b9868b1 100644
--- a/configs/stm32mp157c_dk2_defconfig
+++ b/configs/stm32mp157c_dk2_defconfig
@@ -1,11 +1,11 @@
 BR2_arm=y
 BR2_cortex_a7=y
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_7=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_8=y
 BR2_ROOTFS_OVERLAY="board/stmicroelectronics/stm32mp157c-dk2/overlay/"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
 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
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-07 14:49 [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format Shlomi Vaknin
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration Shlomi Vaknin
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 3/4] configs/stm32mp157*: bump kernel version Shlomi Vaknin
@ 2020-10-07 14:49 ` Shlomi Vaknin
       [not found]   ` <15798cdd-e335-a291-53d4-1ac03d1bbd6c@grinn-global.com>
                     ` (2 more replies)
  2020-10-14 17:00 ` [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format Thomas Petazzoni
  3 siblings, 3 replies; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-07 14:49 UTC (permalink / raw)
  To: buildroot

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 was added.
This was copied from the yocto bsp layer of st.

Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
---
 .../stm32mp157c-dk2/linux.config              |  4 +-
 .../overlay/boot/extlinux/extlinux.conf       |  2 +-
 .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59 +++++++++++++++++++
 .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
 configs/stm32mp157c_dk2_defconfig             |  7 ++-
 5 files changed, 100 insertions(+), 4 deletions(-)
 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

diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
index c03eb748b4..4beee3a708 100644
--- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
+++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
@@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
 CONFIG_FORCE_MAX_ZONEORDER=12
 CONFIG_SECCOMP=y
 # CONFIG_ATAGS is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_VFP=y
@@ -45,6 +43,7 @@ CONFIG_UNIX=y
 CONFIG_INET=y
 CONFIG_CAN=y
 CONFIG_CAN_M_CAN=y
+CONFIG_CFG80211=m
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_SIMPLE_PM_BUS=y
@@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
 CONFIG_STMMAC_ETH=y
 CONFIG_DWMAC_DWC_QOS_ETH=y
 CONFIG_MDIO_BITBANG=y
+CONFIG_BRCMFMAC=m
 CONFIG_INPUT_JOYDEV=y
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_TOUCHSCREEN=y
diff --git a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
index 5b7f56ee77..a6595971a8 100644
--- a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
+++ b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
@@ -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
diff --git a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
new file mode 100644
index 0000000000..b36de8837f
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
@@ -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
+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
diff --git a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
new file mode 100644
index 0000000000..89747d2b5f
--- /dev/null
+++ b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
@@ -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";
+	};
+};
diff --git a/configs/stm32mp157c_dk2_defconfig b/configs/stm32mp157c_dk2_defconfig
index bf7b9868b1..9c2e436244 100644
--- a/configs/stm32mp157c_dk2_defconfig
+++ b/configs/stm32mp157c_dk2_defconfig
@@ -9,8 +9,13 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
 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
-BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
+BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
       [not found]   ` <15798cdd-e335-a291-53d4-1ac03d1bbd6c@grinn-global.com>
@ 2020-10-07 19:27     ` Bartosz Bilas
  2020-10-07 20:16       ` Shlomi Vaknin
  0 siblings, 1 reply; 26+ messages in thread
From: Bartosz Bilas @ 2020-10-07 19:27 UTC (permalink / raw)
  To: buildroot

Hi Shlomi,

On 07.10.2020 21:13, Bartosz Bilas wrote:
>
> Hi Shlomi,
>
> On 07.10.2020 16:49, Shlomi Vaknin wrote:
>> 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 was added.
>> This was copied from the yocto bsp layer of st.
>>
>> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com>
>> ---
>>   .../stm32mp157c-dk2/linux.config              |  4 +-
>>   .../overlay/boot/extlinux/extlinux.conf       |  2 +-
>>   .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59 +++++++++++++++++++
>>   .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
>>   configs/stm32mp157c_dk2_defconfig             |  7 ++-
>>   5 files changed, 100 insertions(+), 4 deletions(-)
>>   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
>>
>> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>> index c03eb748b4..4beee3a708 100644
>> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>>   CONFIG_FORCE_MAX_ZONEORDER=12
>>   CONFIG_SECCOMP=y
>>   # CONFIG_ATAGS is not set
>> -CONFIG_ZBOOT_ROM_TEXT=0x0
>> -CONFIG_ZBOOT_ROM_BSS=0x0
>>   CONFIG_ARM_APPENDED_DTB=y
>>   CONFIG_ARM_ATAG_DTB_COMPAT=y
>>   CONFIG_VFP=y
>> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>>   CONFIG_INET=y
>>   CONFIG_CAN=y
>>   CONFIG_CAN_M_CAN=y
>> +CONFIG_CFG80211=m
>>   CONFIG_DEVTMPFS=y
>>   CONFIG_DEVTMPFS_MOUNT=y
>>   CONFIG_SIMPLE_PM_BUS=y
>> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>>   CONFIG_STMMAC_ETH=y
>>   CONFIG_DWMAC_DWC_QOS_ETH=y
>>   CONFIG_MDIO_BITBANG=y
>> +CONFIG_BRCMFMAC=m
>>   CONFIG_INPUT_JOYDEV=y
>>   CONFIG_INPUT_EVDEV=y
>>   CONFIG_INPUT_TOUCHSCREEN=y
>> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>> index 5b7f56ee77..a6595971a8 100644
>> --- a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>> +++ b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>> @@ -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
>> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>> new file mode 100644
>> index 0000000000..b36de8837f
>> --- /dev/null
>> +++ b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>> @@ -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
>> +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
>> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>> new file mode 100644
>> index 0000000000..89747d2b5f
>> --- /dev/null
>> +++ b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>> @@ -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";
>> +	};
>> +};
>> diff --git a/configs/stm32mp157c_dk2_defconfig b/configs/stm32mp157c_dk2_defconfig
>> index bf7b9868b1..9c2e436244 100644
>> --- a/configs/stm32mp157c_dk2_defconfig
>> +++ b/configs/stm32mp157c_dk2_defconfig
>> @@ -9,8 +9,13 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>>   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
>> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>> +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"

I suggest to add BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load 
firmware and driver automatically on boot.

Unfortunately it doesn't work for me, see:

[??? 4.186415] cfg80211: Loading compiled-in X.509 certificates for 
regulatory database
[??? 4.237180] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[??? 4.300765] brcmfmac: brcmf_fw_alloc_request: using 
brcm/brcmfmac43430-sdio for chip BCM43430/1
[??? 5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): 
clkctl 0x50
[??? 6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): 
clkctl 0x50

Google says that it could be due to wrong nvram file configuration but I 
assume that you have run it successfully?

# ifconfig -a
eth0????? Link encap:Ethernet? HWaddr 00:80:E1:42:56:44
 ????????? BROADCAST MULTICAST? MTU:1500? Metric:1
 ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 ????????? collisions:0 txqueuelen:1000
 ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
 ????????? Interrupt:49 Base address:0xe000

lo??????? Link encap:Local Loopback
 ????????? inet addr:127.0.0.1? Mask:255.0.0.0
 ????????? inet6 addr: ::1/128 Scope:Host
 ????????? UP LOOPBACK RUNNING? MTU:65536? Metric:1
 ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 ????????? collisions:0 txqueuelen:1000
 ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)

sit0????? Link encap:IPv6-in-IPv4
 ????????? NOARP? MTU:1480? Metric:1
 ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 ????????? collisions:0 txqueuelen:1000
 ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)

#

As you can see there is no wlan0 interface.

Best
Bartek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-07 19:27     ` Bartosz Bilas
@ 2020-10-07 20:16       ` Shlomi Vaknin
  2020-10-08 17:31         ` Bartosz Bilas
  0 siblings, 1 reply; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-07 20:16 UTC (permalink / raw)
  To: buildroot

Hi Bartek,

That is very strange, since it works for me:

#############################################################################################################################
Starting mdev... OK
[    4.168709] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
[    4.224122] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    4.288641] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43430-sdio for chip BCM43430/1
[    4.486998] brcmfmac: brcmf_fw_alloc_request: using
brcm/brcmfmac43430-sdio for chip BCM43430/1
[    4.501649] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available
(err=-2), device may have limited channels available
[    4.536998] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0:
Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f

# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:58:DB
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:49 Base address:0xe000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

sit0      Link encap:IPv6-in-IPv4
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:9D:6B:A6:BC:BA
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
#############################################################################################################################

The nvram configuration file was directly copied from the bsp layer of st
in yocto (dunfell):
https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt

Regards,
Shlomi

??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz Bilas?? <?
b.bilas@grinn-global.com??>:?

> Hi Shlomi,
>
> On 07.10.2020 21:13, Bartosz Bilas wrote:
> >
> > Hi Shlomi,
> >
> > On 07.10.2020 16:49, Shlomi Vaknin wrote:
> >> 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 was added.
> >> This was copied from the yocto bsp layer of st.
> >>
> >> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com>
> >> ---
> >>   .../stm32mp157c-dk2/linux.config              |  4 +-
> >>   .../overlay/boot/extlinux/extlinux.conf       |  2 +-
> >>   .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59
> +++++++++++++++++++
> >>   .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
> >>   configs/stm32mp157c_dk2_defconfig             |  7 ++-
> >>   5 files changed, 100 insertions(+), 4 deletions(-)
> >>   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
> >>
> >> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> >> index c03eb748b4..4beee3a708 100644
> >> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> >> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
> >>   CONFIG_FORCE_MAX_ZONEORDER=12
> >>   CONFIG_SECCOMP=y
> >>   # CONFIG_ATAGS is not set
> >> -CONFIG_ZBOOT_ROM_TEXT=0x0
> >> -CONFIG_ZBOOT_ROM_BSS=0x0
> >>   CONFIG_ARM_APPENDED_DTB=y
> >>   CONFIG_ARM_ATAG_DTB_COMPAT=y
> >>   CONFIG_VFP=y
> >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
> >>   CONFIG_INET=y
> >>   CONFIG_CAN=y
> >>   CONFIG_CAN_M_CAN=y
> >> +CONFIG_CFG80211=m
> >>   CONFIG_DEVTMPFS=y
> >>   CONFIG_DEVTMPFS_MOUNT=y
> >>   CONFIG_SIMPLE_PM_BUS=y
> >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
> >>   CONFIG_STMMAC_ETH=y
> >>   CONFIG_DWMAC_DWC_QOS_ETH=y
> >>   CONFIG_MDIO_BITBANG=y
> >> +CONFIG_BRCMFMAC=m
> >>   CONFIG_INPUT_JOYDEV=y
> >>   CONFIG_INPUT_EVDEV=y
> >>   CONFIG_INPUT_TOUCHSCREEN=y
> >> diff --git
> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
> >> index 5b7f56ee77..a6595971a8 100644
> >> ---
> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
> >> +++
> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
> >> @@ -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
> >> diff --git
> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
> >> new file mode 100644
> >> index 0000000000..b36de8837f
> >> --- /dev/null
> >> +++
> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
> >> @@ -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
> >> +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
> >> diff --git
> a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
> b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
> >> new file mode 100644
> >> index 0000000000..89747d2b5f
> >> --- /dev/null
> >> +++ b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
> >> @@ -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";
> >> +    };
> >> +};
> >> diff --git a/configs/stm32mp157c_dk2_defconfig
> b/configs/stm32mp157c_dk2_defconfig
> >> index bf7b9868b1..9c2e436244 100644
> >> --- a/configs/stm32mp157c_dk2_defconfig
> >> +++ b/configs/stm32mp157c_dk2_defconfig
> >> @@ -9,8 +9,13 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
> >>   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
> >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
> >>
> +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>
> I suggest to add BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
> firmware and driver automatically on boot.
>
> Unfortunately it doesn't work for me, see:
>
> [    4.186415] cfg80211: Loading compiled-in X.509 certificates for
> regulatory database
> [    4.237180] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
> [    4.300765] brcmfmac: brcmf_fw_alloc_request: using
> brcm/brcmfmac43430-sdio for chip BCM43430/1
> [    5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
> clkctl 0x50
> [    6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
> clkctl 0x50
>
> Google says that it could be due to wrong nvram file configuration but I
> assume that you have run it successfully?
>
> # ifconfig -a
> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:56:44
>            BROADCAST MULTICAST  MTU:1500  Metric:1
>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>            Interrupt:49 Base address:0xe000
>
> lo        Link encap:Local Loopback
>            inet addr:127.0.0.1  Mask:255.0.0.0
>            inet6 addr: ::1/128 Scope:Host
>            UP LOOPBACK RUNNING  MTU:65536  Metric:1
>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> sit0      Link encap:IPv6-in-IPv4
>            NOARP  MTU:1480  Metric:1
>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> #
>
> As you can see there is no wlan0 interface.
>
> Best
> Bartek
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201007/1c680496/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-07 20:16       ` Shlomi Vaknin
@ 2020-10-08 17:31         ` Bartosz Bilas
  2020-10-08 20:45           ` Shlomi Vaknin
  0 siblings, 1 reply; 26+ messages in thread
From: Bartosz Bilas @ 2020-10-08 17:31 UTC (permalink / raw)
  To: buildroot

Hi Shlomi,

On 07.10.2020 22:16, Shlomi Vaknin wrote:
> Hi Bartek,
>
> That is very strange, since it works for me:
>
> #############################################################################################################################
> Starting mdev... OK
> [ ? ?4.168709] cfg80211: Loading compiled-in X.509 certificates for 
> regulatory database
> [ ? ?4.224122] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
> [ ? ?4.288641] brcmfmac: brcmf_fw_alloc_request: using 
> brcm/brcmfmac43430-sdio for chip BCM43430/1
> [ ? ?4.486998] brcmfmac: brcmf_fw_alloc_request: using 
> brcm/brcmfmac43430-sdio for chip BCM43430/1
> [ ? ?4.501649] brcmfmac: brcmf_c_process_clm_blob: no clm_blob 
> available (err=-2), device may have limited channels available
> [ ? ?4.536998] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 
> wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
>
> # ifconfig -a
> eth0 ? ? ?Link encap:Ethernet ?HWaddr 00:80:E1:42:58:DB
> ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
> ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> ? ? ? ? ? collisions:0 txqueuelen:1000
> ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
> ? ? ? ? ? Interrupt:49 Base address:0xe000
>
> lo ? ? ? ?Link encap:Local Loopback
> ? ? ? ? ? inet addr:127.0.0.1 ?Mask:255.0.0.0
> ? ? ? ? ? inet6 addr: ::1/128 Scope:Host
> ? ? ? ? ? UP LOOPBACK RUNNING ?MTU:65536 ?Metric:1
> ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> ? ? ? ? ? collisions:0 txqueuelen:1000
> ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>
> sit0 ? ? ?Link encap:IPv6-in-IPv4
> ? ? ? ? ? NOARP ?MTU:1480 ?Metric:1
> ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> ? ? ? ? ? collisions:0 txqueuelen:1000
> ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>
> wlan0 ? ? Link encap:Ethernet ?HWaddr 00:9D:6B:A6:BC:BA
> ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
> ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> ? ? ? ? ? collisions:0 txqueuelen:1000
> ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
> #############################################################################################################################
>
> The nvram configuration file was directly copied from the bsp layer of 
> st in yocto (dunfell): 
> https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>
> Regards,
> Shlomi
So in that case we have to clarify our environments. Have you tested 
using the latest master branch or is it some tagged version? Could you 
do a clean build once again to be sure that you don't use any cached 
things? If you were able to attach your sdcard image I would test it 
using my device and check if it really works because I don't see what 
could be wrong with that series. I don't think that ST has changed 
something between HW revision but I'm not able to locate on PCB what 
revision exactly is my board (I guess ST hasn't written it on the 
soldermask).


Best
Bartek
>
> ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz Bilas?? 
> <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>
>     Hi Shlomi,
>
>     On 07.10.2020 21:13, Bartosz Bilas wrote:
>     >
>     > Hi Shlomi,
>     >
>     > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>     >> 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 was added.
>     >> This was copied from the yocto bsp layer of st.
>     >>
>     >> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com
>     <mailto:shlomi.39sd@gmail.com>>
>     >> ---
>     >>? ?.../stm32mp157c-dk2/linux.config? ? ? ? ? ? ? | 4 +-
>     >>? ?.../overlay/boot/extlinux/extlinux.conf? ? ? ?| 2 +-
>     >>? ?.../brcmfmac43430-sdio.st
>     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt | 59
>     +++++++++++++++++++
>     >>? ?.../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts? | 32 ++++++++++
>     >>? ?configs/stm32mp157c_dk2_defconfig? ? ? ? ? ? ?| 7 ++-
>     >>? ?5 files changed, 100 insertions(+), 4 deletions(-)
>     >>? ?create mode 100644
>     board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>     >>? ?create mode 100644
>     board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>     >>
>     >> diff --git
>     a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>     b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>     >> index c03eb748b4..4beee3a708 100644
>     >> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>     >> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>     >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>     >>? ?CONFIG_FORCE_MAX_ZONEORDER=12
>     >>? ?CONFIG_SECCOMP=y
>     >>? ?# CONFIG_ATAGS is not set
>     >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>     >> -CONFIG_ZBOOT_ROM_BSS=0x0
>     >>? ?CONFIG_ARM_APPENDED_DTB=y
>     >>? ?CONFIG_ARM_ATAG_DTB_COMPAT=y
>     >>? ?CONFIG_VFP=y
>     >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>     >>? ?CONFIG_INET=y
>     >>? ?CONFIG_CAN=y
>     >>? ?CONFIG_CAN_M_CAN=y
>     >> +CONFIG_CFG80211=m
>     >>? ?CONFIG_DEVTMPFS=y
>     >>? ?CONFIG_DEVTMPFS_MOUNT=y
>     >>? ?CONFIG_SIMPLE_PM_BUS=y
>     >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>     >>? ?CONFIG_STMMAC_ETH=y
>     >>? ?CONFIG_DWMAC_DWC_QOS_ETH=y
>     >>? ?CONFIG_MDIO_BITBANG=y
>     >> +CONFIG_BRCMFMAC=m
>     >>? ?CONFIG_INPUT_JOYDEV=y
>     >>? ?CONFIG_INPUT_EVDEV=y
>     >>? ?CONFIG_INPUT_TOUCHSCREEN=y
>     >> diff --git
>     a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>     b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>     >> index 5b7f56ee77..a6595971a8 100644
>     >> ---
>     a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>     >> +++
>     b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>     >> @@ -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
>     >> diff --git
>     a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>     b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>     >> new file mode 100644
>     >> index 0000000000..b36de8837f
>     >> --- /dev/null
>     >> +++
>     b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>     >> @@ -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
>     >> +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
>     >> diff --git
>     a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>     b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>     >> new file mode 100644
>     >> index 0000000000..89747d2b5f
>     >> --- /dev/null
>     >> +++
>     b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>     >> @@ -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";
>     >> +? ? };
>     >> +};
>     >> diff --git a/configs/stm32mp157c_dk2_defconfig
>     b/configs/stm32mp157c_dk2_defconfig
>     >> index bf7b9868b1..9c2e436244 100644
>     >> --- a/configs/stm32mp157c_dk2_defconfig
>     >> +++ b/configs/stm32mp157c_dk2_defconfig
>     >> @@ -9,8 +9,13 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>     >>? ?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
>     >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>     >>
>     +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>
>     I suggest to add BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
>     firmware and driver automatically on boot.
>
>     Unfortunately it doesn't work for me, see:
>
>     [??? 4.186415] cfg80211: Loading compiled-in X.509 certificates for
>     regulatory database
>     [??? 4.237180] cfg80211: Loaded X.509 cert 'sforshee:
>     00b28ddf47aef9cea7'
>     [??? 4.300765] brcmfmac: brcmf_fw_alloc_request: using
>     brcm/brcmfmac43430-sdio for chip BCM43430/1
>     [??? 5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>     (1000000):
>     clkctl 0x50
>     [??? 6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>     (1000000):
>     clkctl 0x50
>
>     Google says that it could be due to wrong nvram file configuration
>     but I
>     assume that you have run it successfully?
>
>     # ifconfig -a
>     eth0????? Link encap:Ethernet? HWaddr 00:80:E1:42:56:44
>     ?????????? BROADCAST MULTICAST? MTU:1500? Metric:1
>     ?????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>     ?????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>     ?????????? collisions:0 txqueuelen:1000
>     ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>     ?????????? Interrupt:49 Base address:0xe000
>
>     lo??????? Link encap:Local Loopback
>     ?????????? inet addr:127.0.0.1? Mask:255.0.0.0
>     ?????????? inet6 addr: ::1/128 Scope:Host
>     ?????????? UP LOOPBACK RUNNING? MTU:65536? Metric:1
>     ?????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>     ?????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>     ?????????? collisions:0 txqueuelen:1000
>     ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>
>     sit0????? Link encap:IPv6-in-IPv4
>     ?????????? NOARP? MTU:1480? Metric:1
>     ?????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>     ?????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>     ?????????? collisions:0 txqueuelen:1000
>     ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>
>     #
>
>     As you can see there is no wlan0 interface.
>
>     Best
>     Bartek
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201008/7c6e84df/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-08 17:31         ` Bartosz Bilas
@ 2020-10-08 20:45           ` Shlomi Vaknin
  2020-10-09 16:49             ` Bartosz Bilas
  0 siblings, 1 reply; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-08 20:45 UTC (permalink / raw)
  To: buildroot

Hi Bartek,

I pulled the latest commits, downloaded my patches from patchwork and
applied them. Then, I started a new out of tree build and everything is
working. You can find my sdcard image here:
https://drive.google.com/drive/folders/1_FwVtw70iPS_hz7yFiiOlhXiUKlsi9bH?usp=sharing

This problem is very strange. Maybe you can check if your board's wifi is
working with an image that is known to work? Maybe the formal image from st?

Regards,
Shlomi

??????? ??? ??, 8 ????? 2020 ?-20:31 ??? ?Bartosz Bilas?? <?
b.bilas@grinn-global.com??>:?

> Hi Shlomi,
> On 07.10.2020 22:16, Shlomi Vaknin wrote:
>
> Hi Bartek,
>
> That is very strange, since it works for me:
>
>
> #############################################################################################################################
> Starting mdev... OK
> [    4.168709] cfg80211: Loading compiled-in X.509 certificates for
> regulatory database
> [    4.224122] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
> [    4.288641] brcmfmac: brcmf_fw_alloc_request: using
> brcm/brcmfmac43430-sdio for chip BCM43430/1
> [    4.486998] brcmfmac: brcmf_fw_alloc_request: using
> brcm/brcmfmac43430-sdio for chip BCM43430/1
> [    4.501649] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available
> (err=-2), device may have limited channels available
> [    4.536998] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0:
> Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
>
> # ifconfig -a
> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:58:DB
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>           Interrupt:49 Base address:0xe000
>
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> sit0      Link encap:IPv6-in-IPv4
>           NOARP  MTU:1480  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> wlan0     Link encap:Ethernet  HWaddr 00:9D:6B:A6:BC:BA
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> #############################################################################################################################
>
> The nvram configuration file was directly copied from the bsp layer of st
> in yocto (dunfell):
> https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>
> Regards,
> Shlomi
>
> So in that case we have to clarify our environments. Have you tested using
> the latest master branch or is it some tagged version? Could you do a clean
> build once again to be sure that you don't use any cached things? If you
> were able to attach your sdcard image I would test it using my device and
> check if it really works because I don't see what could be wrong with that
> series. I don't think that ST has changed something between HW revision but
> I'm not able to locate on PCB what revision exactly is my board (I guess ST
> hasn't written it on the soldermask).
>
>
> Best
> Bartek
>
>
> ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz Bilas?? <?
> b.bilas at grinn-global.com??>:?
>
>> Hi Shlomi,
>>
>> On 07.10.2020 21:13, Bartosz Bilas wrote:
>> >
>> > Hi Shlomi,
>> >
>> > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>> >> 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 was added.
>> >> This was copied from the yocto bsp layer of st.
>> >>
>> >> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com>
>> >> ---
>> >>   .../stm32mp157c-dk2/linux.config              |  4 +-
>> >>   .../overlay/boot/extlinux/extlinux.conf       |  2 +-
>> >>   .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59
>> +++++++++++++++++++
>> >>   .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
>> >>   configs/stm32mp157c_dk2_defconfig             |  7 ++-
>> >>   5 files changed, 100 insertions(+), 4 deletions(-)
>> >>   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
>> >>
>> >> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>> b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>> >> index c03eb748b4..4beee3a708 100644
>> >> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>> >> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>> >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>> >>   CONFIG_FORCE_MAX_ZONEORDER=12
>> >>   CONFIG_SECCOMP=y
>> >>   # CONFIG_ATAGS is not set
>> >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>> >> -CONFIG_ZBOOT_ROM_BSS=0x0
>> >>   CONFIG_ARM_APPENDED_DTB=y
>> >>   CONFIG_ARM_ATAG_DTB_COMPAT=y
>> >>   CONFIG_VFP=y
>> >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>> >>   CONFIG_INET=y
>> >>   CONFIG_CAN=y
>> >>   CONFIG_CAN_M_CAN=y
>> >> +CONFIG_CFG80211=m
>> >>   CONFIG_DEVTMPFS=y
>> >>   CONFIG_DEVTMPFS_MOUNT=y
>> >>   CONFIG_SIMPLE_PM_BUS=y
>> >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>> >>   CONFIG_STMMAC_ETH=y
>> >>   CONFIG_DWMAC_DWC_QOS_ETH=y
>> >>   CONFIG_MDIO_BITBANG=y
>> >> +CONFIG_BRCMFMAC=m
>> >>   CONFIG_INPUT_JOYDEV=y
>> >>   CONFIG_INPUT_EVDEV=y
>> >>   CONFIG_INPUT_TOUCHSCREEN=y
>> >> diff --git
>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>> >> index 5b7f56ee77..a6595971a8 100644
>> >> ---
>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>> >> +++
>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>> >> @@ -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
>> >> diff --git
>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>> >> new file mode 100644
>> >> index 0000000000..b36de8837f
>> >> --- /dev/null
>> >> +++
>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>> >> @@ -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
>> >> +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
>> >> diff --git
>> a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>> b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>> >> new file mode 100644
>> >> index 0000000000..89747d2b5f
>> >> --- /dev/null
>> >> +++ b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>> >> @@ -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";
>> >> +    };
>> >> +};
>> >> diff --git a/configs/stm32mp157c_dk2_defconfig
>> b/configs/stm32mp157c_dk2_defconfig
>> >> index bf7b9868b1..9c2e436244 100644
>> >> --- a/configs/stm32mp157c_dk2_defconfig
>> >> +++ b/configs/stm32mp157c_dk2_defconfig
>> >> @@ -9,8 +9,13 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>> >>   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
>> >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>> >>
>> +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>>
>> I suggest to add BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
>> firmware and driver automatically on boot.
>>
>> Unfortunately it doesn't work for me, see:
>>
>> [    4.186415] cfg80211: Loading compiled-in X.509 certificates for
>> regulatory database
>> [    4.237180] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
>> [    4.300765] brcmfmac: brcmf_fw_alloc_request: using
>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>> [    5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>> clkctl 0x50
>> [    6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>> clkctl 0x50
>>
>> Google says that it could be due to wrong nvram file configuration but I
>> assume that you have run it successfully?
>>
>> # ifconfig -a
>> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:56:44
>>            BROADCAST MULTICAST  MTU:1500  Metric:1
>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>            collisions:0 txqueuelen:1000
>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>            Interrupt:49 Base address:0xe000
>>
>> lo        Link encap:Local Loopback
>>            inet addr:127.0.0.1  Mask:255.0.0.0
>>            inet6 addr: ::1/128 Scope:Host
>>            UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>            collisions:0 txqueuelen:1000
>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>
>> sit0      Link encap:IPv6-in-IPv4
>>            NOARP  MTU:1480  Metric:1
>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>            collisions:0 txqueuelen:1000
>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>
>> #
>>
>> As you can see there is no wlan0 interface.
>>
>> Best
>> Bartek
>>
>
> _______________________________________________
> buildroot mailing listbuildroot at busybox.nethttp://lists.busybox.net/mailman/listinfo/buildroot
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201008/844b2c83/attachment-0001.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-08 20:45           ` Shlomi Vaknin
@ 2020-10-09 16:49             ` Bartosz Bilas
  2020-10-09 19:13               ` Shlomi Vaknin
  0 siblings, 1 reply; 26+ messages in thread
From: Bartosz Bilas @ 2020-10-09 16:49 UTC (permalink / raw)
  To: buildroot

Hello Shlomi,

On 08.10.2020 22:45, Shlomi Vaknin wrote:
> Hi Bartek,
>
> I pulled the latest commits, downloaded my patches from patchwork and 
> applied them. Then, I started a new out of tree build and everything 
> is working. You can find my sdcard?image here: 
> https://drive.google.com/drive/folders/1_FwVtw70iPS_hz7yFiiOlhXiUKlsi9bH?usp=sharing 
>
> This problem is very strange. Maybe you can check if your board's wifi 
> is working with an image that is known to work? Maybe the formal image 
> from st?
>
> Regards,
> Shlomi
>
I've tested your image but the result is the same, see:

[? 129.691504] cfg80211: Loading compiled-in X.509 certificates for 
regulatory database
[? 129.740878] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
# [? 129.804593] brcmfmac: brcmf_fw_alloc_request: using 
brcm/brcmfmac43430-sdio for chip BCM43430/1
[? 130.885129] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): 
clkctl 0x50
[? 131.911135] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): 
clkctl 0x50

My board is:

CPU: STM32MP157CAC Rev.B
Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
Board: MB1272 Var2.0 Rev.C-01
DRAM:? 512 MiB

Best
Bartek
> ??????? ??? ??, 8 ????? 2020 ?-20:31 ??? ?Bartosz Bilas?? 
> <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>
>     Hi Shlomi,
>
>     On 07.10.2020 22:16, Shlomi Vaknin wrote:
>>     Hi Bartek,
>>
>>     That is very strange, since it works for me:
>>
>>     #############################################################################################################################
>>     Starting mdev... OK
>>     [ ? ?4.168709] cfg80211: Loading compiled-in X.509 certificates
>>     for regulatory database
>>     [ ? ?4.224122] cfg80211: Loaded X.509 cert 'sforshee:
>>     00b28ddf47aef9cea7'
>>     [ ? ?4.288641] brcmfmac: brcmf_fw_alloc_request: using
>>     brcm/brcmfmac43430-sdio for chip BCM43430/1
>>     [ ? ?4.486998] brcmfmac: brcmf_fw_alloc_request: using
>>     brcm/brcmfmac43430-sdio for chip BCM43430/1
>>     [ ? ?4.501649] brcmfmac: brcmf_c_process_clm_blob: no clm_blob
>>     available (err=-2), device may have limited channels available
>>     [ ? ?4.536998] brcmfmac: brcmf_c_preinit_dcmds: Firmware:
>>     BCM43430/1 wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442
>>     CY) FWID 01-e58d219f
>>
>>     # ifconfig -a
>>     eth0 ? ? ?Link encap:Ethernet ?HWaddr 00:80:E1:42:58:DB
>>     ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>     ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>     ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>     ? ? ? ? ? collisions:0 txqueuelen:1000
>>     ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>     ? ? ? ? ? Interrupt:49 Base address:0xe000
>>
>>     lo ? ? ? ?Link encap:Local Loopback
>>     ? ? ? ? ? inet addr:127.0.0.1 ?Mask:255.0.0.0
>>     ? ? ? ? ? inet6 addr: ::1/128 Scope:Host
>>     ? ? ? ? ? UP LOOPBACK RUNNING ?MTU:65536 ?Metric:1
>>     ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>     ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>     ? ? ? ? ? collisions:0 txqueuelen:1000
>>     ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>
>>     sit0 ? ? ?Link encap:IPv6-in-IPv4
>>     ? ? ? ? ? NOARP ?MTU:1480 ?Metric:1
>>     ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>     ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>     ? ? ? ? ? collisions:0 txqueuelen:1000
>>     ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>
>>     wlan0 ? ? Link encap:Ethernet ?HWaddr 00:9D:6B:A6:BC:BA
>>     ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>     ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>     ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>     ? ? ? ? ? collisions:0 txqueuelen:1000
>>     ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>     #############################################################################################################################
>>
>>     The nvram configuration file was directly copied from the bsp
>>     layer of st in yocto (dunfell):
>>     https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>>
>>     Regards,
>>     Shlomi
>     So in that case we have to clarify our environments. Have you
>     tested using the latest master branch or is it some tagged
>     version? Could you do a clean build once again to be sure that you
>     don't use any cached things? If you were able to attach your
>     sdcard image I would test it using my device and check if it
>     really works because I don't see what could be wrong with that
>     series. I don't think that ST has changed something between HW
>     revision but I'm not able to locate on PCB what revision exactly
>     is my board (I guess ST hasn't written it on the soldermask).
>
>
>     Best
>     Bartek
>>
>>     ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz Bilas??
>>     <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>>
>>         Hi Shlomi,
>>
>>         On 07.10.2020 21:13, Bartosz Bilas wrote:
>>         >
>>         > Hi Shlomi,
>>         >
>>         > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>>         >> 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 was added.
>>         >> This was copied from the yocto bsp layer of st.
>>         >>
>>         >> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com
>>         <mailto:shlomi.39sd@gmail.com>>
>>         >> ---
>>         >>? ?.../stm32mp157c-dk2/linux.config ? ? |? 4 +-
>>         >>? ?.../overlay/boot/extlinux/extlinux.conf ? ? ?|? 2 +-
>>         >>? ?.../brcmfmac43430-sdio.st
>>         <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt | 59
>>         +++++++++++++++++++
>>         >> ?.../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts? | 32 ++++++++++
>>         >>? ?configs/stm32mp157c_dk2_defconfig ? ? ?|? 7 ++-
>>         >>? ?5 files changed, 100 insertions(+), 4 deletions(-)
>>         >>? ?create mode 100644
>>         board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>         <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>         >>? ?create mode 100644
>>         board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>         >>
>>         >> diff --git
>>         a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>         b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>         >> index c03eb748b4..4beee3a708 100644
>>         >> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>         >> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>         >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>>         >>? ?CONFIG_FORCE_MAX_ZONEORDER=12
>>         >>? ?CONFIG_SECCOMP=y
>>         >>? ?# CONFIG_ATAGS is not set
>>         >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>>         >> -CONFIG_ZBOOT_ROM_BSS=0x0
>>         >>? ?CONFIG_ARM_APPENDED_DTB=y
>>         >>? ?CONFIG_ARM_ATAG_DTB_COMPAT=y
>>         >>? ?CONFIG_VFP=y
>>         >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>>         >>? ?CONFIG_INET=y
>>         >>? ?CONFIG_CAN=y
>>         >>? ?CONFIG_CAN_M_CAN=y
>>         >> +CONFIG_CFG80211=m
>>         >>? ?CONFIG_DEVTMPFS=y
>>         >>? ?CONFIG_DEVTMPFS_MOUNT=y
>>         >>? ?CONFIG_SIMPLE_PM_BUS=y
>>         >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>>         >>? ?CONFIG_STMMAC_ETH=y
>>         >>? ?CONFIG_DWMAC_DWC_QOS_ETH=y
>>         >>? ?CONFIG_MDIO_BITBANG=y
>>         >> +CONFIG_BRCMFMAC=m
>>         >>? ?CONFIG_INPUT_JOYDEV=y
>>         >>? ?CONFIG_INPUT_EVDEV=y
>>         >>? ?CONFIG_INPUT_TOUCHSCREEN=y
>>         >> diff --git
>>         a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>         b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>         >> index 5b7f56ee77..a6595971a8 100644
>>         >> ---
>>         a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>         >> +++
>>         b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>         >> @@ -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
>>         >> diff --git
>>         a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>         <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>         b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>         <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>         >> new file mode 100644
>>         >> index 0000000000..b36de8837f
>>         >> --- /dev/null
>>         >> +++
>>         b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>         <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>         >> @@ -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
>>         >> +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
>>         >> diff --git
>>         a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>         b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>         >> new file mode 100644
>>         >> index 0000000000..89747d2b5f
>>         >> --- /dev/null
>>         >> +++
>>         b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>         >> @@ -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";
>>         >> +? ? };
>>         >> +};
>>         >> diff --git a/configs/stm32mp157c_dk2_defconfig
>>         b/configs/stm32mp157c_dk2_defconfig
>>         >> index bf7b9868b1..9c2e436244 100644
>>         >> --- a/configs/stm32mp157c_dk2_defconfig
>>         >> +++ b/configs/stm32mp157c_dk2_defconfig
>>         >> @@ -9,8 +9,13 @@
>>         BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>>         >>? ?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
>>         >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>>         >>
>>         +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>>
>>         I suggest to add BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
>>         firmware and driver automatically on boot.
>>
>>         Unfortunately it doesn't work for me, see:
>>
>>         [??? 4.186415] cfg80211: Loading compiled-in X.509
>>         certificates for
>>         regulatory database
>>         [??? 4.237180] cfg80211: Loaded X.509 cert 'sforshee:
>>         00b28ddf47aef9cea7'
>>         [??? 4.300765] brcmfmac: brcmf_fw_alloc_request: using
>>         brcm/brcmfmac43430-sdio for chip BCM43430/1
>>         [??? 5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>>         (1000000):
>>         clkctl 0x50
>>         [??? 6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>>         (1000000):
>>         clkctl 0x50
>>
>>         Google says that it could be due to wrong nvram file
>>         configuration but I
>>         assume that you have run it successfully?
>>
>>         # ifconfig -a
>>         eth0????? Link encap:Ethernet? HWaddr 00:80:E1:42:56:44
>>         ?????????? BROADCAST MULTICAST? MTU:1500? Metric:1
>>         ?????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>         ?????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>         ?????????? collisions:0 txqueuelen:1000
>>         ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>         ?????????? Interrupt:49 Base address:0xe000
>>
>>         lo??????? Link encap:Local Loopback
>>         ?????????? inet addr:127.0.0.1? Mask:255.0.0.0
>>         ?????????? inet6 addr: ::1/128 Scope:Host
>>         ?????????? UP LOOPBACK RUNNING? MTU:65536? Metric:1
>>         ?????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>         ?????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>         ?????????? collisions:0 txqueuelen:1000
>>         ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>
>>         sit0????? Link encap:IPv6-in-IPv4
>>         ?????????? NOARP? MTU:1480? Metric:1
>>         ?????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>         ?????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>         ?????????? collisions:0 txqueuelen:1000
>>         ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>
>>         #
>>
>>         As you can see there is no wlan0 interface.
>>
>>         Best
>>         Bartek
>>
>>
>>     _______________________________________________
>>     buildroot mailing list
>>     buildroot at busybox.net  <mailto:buildroot@busybox.net>
>>     http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201009/518ebed5/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-09 16:49             ` Bartosz Bilas
@ 2020-10-09 19:13               ` Shlomi Vaknin
  2020-10-10 15:41                 ` Bartosz Bilas
  0 siblings, 1 reply; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-09 19:13 UTC (permalink / raw)
  To: buildroot

HI!

According to u-boot I have the same revision as you. Could you try the
formal version from st:
https://www.st.com/en/embedded-software/stm32mp1starter.html ? I flashed it
and the wifi worked. Just to be sure that there is no issue or something
else with your board.

Best
Shlomi

??????? ??? ??, 9 ????? 2020 ?-19:49 ??? ?Bartosz Bilas?? <?
b.bilas@grinn-global.com??>:?

> Hello Shlomi,
> On 08.10.2020 22:45, Shlomi Vaknin wrote:
>
> Hi Bartek,
>
> I pulled the latest commits, downloaded my patches from patchwork and
> applied them. Then, I started a new out of tree build and everything is
> working. You can find my sdcard image here:
> https://drive.google.com/drive/folders/1_FwVtw70iPS_hz7yFiiOlhXiUKlsi9bH?usp=sharing
>
> This problem is very strange. Maybe you can check if your board's wifi is
> working with an image that is known to work? Maybe the formal image from st?
>
> Regards,
> Shlomi
>
> I've tested your image but the result is the same, see:
>
> [  129.691504] cfg80211: Loading compiled-in X.509 certificates for
> regulatory database
> [  129.740878] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
> # [  129.804593] brcmfmac: brcmf_fw_alloc_request: using
> brcm/brcmfmac43430-sdio for chip BCM43430/1
> [  130.885129] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
> clkctl 0x50
> [  131.911135] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
> clkctl 0x50
>
> My board is:
>
> CPU: STM32MP157CAC Rev.B
> Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
> Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
> Board: MB1272 Var2.0 Rev.C-01
> DRAM:  512 MiB
> Best
> Bartek
>
> ??????? ??? ??, 8 ????? 2020 ?-20:31 ??? ?Bartosz Bilas?? <?
> b.bilas at grinn-global.com??>:?
>
>> Hi Shlomi,
>> On 07.10.2020 22:16, Shlomi Vaknin wrote:
>>
>> Hi Bartek,
>>
>> That is very strange, since it works for me:
>>
>>
>> #############################################################################################################################
>> Starting mdev... OK
>> [    4.168709] cfg80211: Loading compiled-in X.509 certificates for
>> regulatory database
>> [    4.224122] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
>> [    4.288641] brcmfmac: brcmf_fw_alloc_request: using
>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>> [    4.486998] brcmfmac: brcmf_fw_alloc_request: using
>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>> [    4.501649] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available
>> (err=-2), device may have limited channels available
>> [    4.536998] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0:
>> Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
>>
>> # ifconfig -a
>> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:58:DB
>>           BROADCAST MULTICAST  MTU:1500  Metric:1
>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>           Interrupt:49 Base address:0xe000
>>
>> lo        Link encap:Local Loopback
>>           inet addr:127.0.0.1  Mask:255.0.0.0
>>           inet6 addr: ::1/128 Scope:Host
>>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>
>> sit0      Link encap:IPv6-in-IPv4
>>           NOARP  MTU:1480  Metric:1
>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>
>> wlan0     Link encap:Ethernet  HWaddr 00:9D:6B:A6:BC:BA
>>           BROADCAST MULTICAST  MTU:1500  Metric:1
>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>
>> #############################################################################################################################
>>
>> The nvram configuration file was directly copied from the bsp layer of st
>> in yocto (dunfell):
>> https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>>
>> Regards,
>> Shlomi
>>
>> So in that case we have to clarify our environments. Have you tested
>> using the latest master branch or is it some tagged version? Could you do a
>> clean build once again to be sure that you don't use any cached things? If
>> you were able to attach your sdcard image I would test it using my device
>> and check if it really works because I don't see what could be wrong with
>> that series. I don't think that ST has changed something between HW
>> revision but I'm not able to locate on PCB what revision exactly is my
>> board (I guess ST hasn't written it on the soldermask).
>>
>>
>> Best
>> Bartek
>>
>>
>> ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz Bilas?? <?
>> b.bilas at grinn-global.com??>:?
>>
>>> Hi Shlomi,
>>>
>>> On 07.10.2020 21:13, Bartosz Bilas wrote:
>>> >
>>> > Hi Shlomi,
>>> >
>>> > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>>> >> 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 was added.
>>> >> This was copied from the yocto bsp layer of st.
>>> >>
>>> >> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com>
>>> >> ---
>>> >>   .../stm32mp157c-dk2/linux.config              |  4 +-
>>> >>   .../overlay/boot/extlinux/extlinux.conf       |  2 +-
>>> >>   .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59
>>> +++++++++++++++++++
>>> >>   .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
>>> >>   configs/stm32mp157c_dk2_defconfig             |  7 ++-
>>> >>   5 files changed, 100 insertions(+), 4 deletions(-)
>>> >>   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
>>> >>
>>> >> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>> b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>> >> index c03eb748b4..4beee3a708 100644
>>> >> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>> >> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>> >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>>> >>   CONFIG_FORCE_MAX_ZONEORDER=12
>>> >>   CONFIG_SECCOMP=y
>>> >>   # CONFIG_ATAGS is not set
>>> >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>>> >> -CONFIG_ZBOOT_ROM_BSS=0x0
>>> >>   CONFIG_ARM_APPENDED_DTB=y
>>> >>   CONFIG_ARM_ATAG_DTB_COMPAT=y
>>> >>   CONFIG_VFP=y
>>> >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>>> >>   CONFIG_INET=y
>>> >>   CONFIG_CAN=y
>>> >>   CONFIG_CAN_M_CAN=y
>>> >> +CONFIG_CFG80211=m
>>> >>   CONFIG_DEVTMPFS=y
>>> >>   CONFIG_DEVTMPFS_MOUNT=y
>>> >>   CONFIG_SIMPLE_PM_BUS=y
>>> >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>>> >>   CONFIG_STMMAC_ETH=y
>>> >>   CONFIG_DWMAC_DWC_QOS_ETH=y
>>> >>   CONFIG_MDIO_BITBANG=y
>>> >> +CONFIG_BRCMFMAC=m
>>> >>   CONFIG_INPUT_JOYDEV=y
>>> >>   CONFIG_INPUT_EVDEV=y
>>> >>   CONFIG_INPUT_TOUCHSCREEN=y
>>> >> diff --git
>>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>> >> index 5b7f56ee77..a6595971a8 100644
>>> >> ---
>>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>> >> +++
>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>> >> @@ -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
>>> >> diff --git
>>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>>> >> new file mode 100644
>>> >> index 0000000000..b36de8837f
>>> >> --- /dev/null
>>> >> +++
>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>>> >> @@ -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
>>> >> +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
>>> >> diff --git
>>> a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>> b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>> >> new file mode 100644
>>> >> index 0000000000..89747d2b5f
>>> >> --- /dev/null
>>> >> +++
>>> b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>> >> @@ -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";
>>> >> +    };
>>> >> +};
>>> >> diff --git a/configs/stm32mp157c_dk2_defconfig
>>> b/configs/stm32mp157c_dk2_defconfig
>>> >> index bf7b9868b1..9c2e436244 100644
>>> >> --- a/configs/stm32mp157c_dk2_defconfig
>>> >> +++ b/configs/stm32mp157c_dk2_defconfig
>>> >> @@ -9,8 +9,13 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>>> >>   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
>>> >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>>> >>
>>> +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>>>
>>> I suggest to add BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
>>> firmware and driver automatically on boot.
>>>
>>> Unfortunately it doesn't work for me, see:
>>>
>>> [    4.186415] cfg80211: Loading compiled-in X.509 certificates for
>>> regulatory database
>>> [    4.237180] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
>>> [    4.300765] brcmfmac: brcmf_fw_alloc_request: using
>>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>>> [    5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>>> clkctl 0x50
>>> [    6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>>> clkctl 0x50
>>>
>>> Google says that it could be due to wrong nvram file configuration but I
>>> assume that you have run it successfully?
>>>
>>> # ifconfig -a
>>> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:56:44
>>>            BROADCAST MULTICAST  MTU:1500  Metric:1
>>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>            collisions:0 txqueuelen:1000
>>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>            Interrupt:49 Base address:0xe000
>>>
>>> lo        Link encap:Local Loopback
>>>            inet addr:127.0.0.1  Mask:255.0.0.0
>>>            inet6 addr: ::1/128 Scope:Host
>>>            UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>            collisions:0 txqueuelen:1000
>>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>
>>> sit0      Link encap:IPv6-in-IPv4
>>>            NOARP  MTU:1480  Metric:1
>>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>            collisions:0 txqueuelen:1000
>>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>
>>> #
>>>
>>> As you can see there is no wlan0 interface.
>>>
>>> Best
>>> Bartek
>>>
>>
>> _______________________________________________
>> buildroot mailing listbuildroot at busybox.nethttp://lists.busybox.net/mailman/listinfo/buildroot
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201009/377db30f/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-09 19:13               ` Shlomi Vaknin
@ 2020-10-10 15:41                 ` Bartosz Bilas
  2020-10-10 18:08                   ` Shlomi Vaknin
  2020-10-10 19:01                   ` Bartosz Bilas
  0 siblings, 2 replies; 26+ messages in thread
From: Bartosz Bilas @ 2020-10-10 15:41 UTC (permalink / raw)
  To: buildroot

Hello Shlomi,

On 09.10.2020 21:13, Shlomi Vaknin wrote:
> HI!
>
> According to u-boot I have the same revision as you. Could you try the 
> formal version from st: 
> https://www.st.com/en/embedded-software/stm32mp1starter.html ? I 
> flashed it and the wifi worked. Just to be sure that there is no issue 
> or something else with your board.
>
> Best
> Shlomi
>
I've used:

ST OpenSTLinux - Weston - (A Yocto Project Based Distro) 
3.1-openstlinux-5.4-dunfell-mp1-20-06-24 stm32mp1 ttySTM0

and everything seems to be ok

root at stm32mp1:~# ifconfig -a
eth0????? Link encap:Ethernet? HWaddr 00:80:E1:42:56:44
 ????????? UP BROADCAST MULTICAST? MTU:1500? Metric:1
 ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 ????????? collisions:0 txqueuelen:1000
 ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
 ????????? Interrupt:48 Base address:0x4000

lo??????? Link encap:Local Loopback
 ????????? inet addr:127.0.0.1? Mask:255.0.0.0
 ????????? inet6 addr: ::1/128 Scope:Host
 ????????? UP LOOPBACK RUNNING? MTU:65536? Metric:1
 ????????? RX packets:80 errors:0 dropped:0 overruns:0 frame:0
 ????????? TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
 ????????? collisions:0 txqueuelen:1000
 ????????? RX bytes:6080 (5.9 KiB)? TX bytes:6080 (5.9 KiB)

usb0????? Link encap:Ethernet? HWaddr 4E:12:37:C3:7B:6C
 ????????? UP BROADCAST MULTICAST? MTU:1500? Metric:1
 ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 ????????? collisions:0 txqueuelen:1000
 ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)

wlan0???? Link encap:Ethernet? HWaddr 10:98:C3:5F:FB:F9
 ????????? BROADCAST MULTICAST? MTU:1500? Metric:1
 ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 ????????? collisions:0 txqueuelen:1000
 ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)

I'm gonna double-check one more time what's wrong with buildroot's image 
though.

Best
Bartek
> ??????? ??? ??, 9 ????? 2020 ?-19:49 ??? ?Bartosz Bilas?? 
> <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>
>     Hello Shlomi,
>
>     On 08.10.2020 22:45, Shlomi Vaknin wrote:
>>     Hi Bartek,
>>
>>     I pulled the latest commits, downloaded my patches from patchwork
>>     and applied them. Then, I started a new out of tree build and
>>     everything is working. You can find my sdcard?image here:
>>     https://drive.google.com/drive/folders/1_FwVtw70iPS_hz7yFiiOlhXiUKlsi9bH?usp=sharing
>>
>>     This problem is very strange. Maybe you can check if your board's
>>     wifi is working with an image that is known to work? Maybe the
>>     formal image from st?
>>
>>     Regards,
>>     Shlomi
>>
>     I've tested your image but the result is the same, see:
>
>     [? 129.691504] cfg80211: Loading compiled-in X.509 certificates
>     for regulatory database
>     [? 129.740878] cfg80211: Loaded X.509 cert 'sforshee:
>     00b28ddf47aef9cea7'
>     # [? 129.804593] brcmfmac: brcmf_fw_alloc_request: using
>     brcm/brcmfmac43430-sdio for chip BCM43430/1
>     [? 130.885129] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>     (1000000): clkctl 0x50
>     [? 131.911135] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>     (1000000): clkctl 0x50
>
>     My board is:
>
>     CPU: STM32MP157CAC Rev.B
>     Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
>     Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
>     Board: MB1272 Var2.0 Rev.C-01
>     DRAM:? 512 MiB
>
>     Best
>     Bartek
>>     ??????? ??? ??, 8 ????? 2020 ?-20:31 ??? ?Bartosz Bilas??
>>     <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>>
>>         Hi Shlomi,
>>
>>         On 07.10.2020 22:16, Shlomi Vaknin wrote:
>>>         Hi Bartek,
>>>
>>>         That is very strange, since it works for me:
>>>
>>>         #############################################################################################################################
>>>         Starting mdev... OK
>>>         [ ? ?4.168709] cfg80211: Loading compiled-in X.509
>>>         certificates for regulatory database
>>>         [ ? ?4.224122] cfg80211: Loaded X.509 cert 'sforshee:
>>>         00b28ddf47aef9cea7'
>>>         [ ? ?4.288641] brcmfmac: brcmf_fw_alloc_request: using
>>>         brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>         [ ? ?4.486998] brcmfmac: brcmf_fw_alloc_request: using
>>>         brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>         [ ? ?4.501649] brcmfmac: brcmf_c_process_clm_blob: no
>>>         clm_blob available (err=-2), device may have limited
>>>         channels available
>>>         [ ? ?4.536998] brcmfmac: brcmf_c_preinit_dcmds: Firmware:
>>>         BCM43430/1 wl0: Oct 23 2017 03:55:53 version 7.45.98.38
>>>         (r674442 CY) FWID 01-e58d219f
>>>
>>>         # ifconfig -a
>>>         eth0 ? ? ?Link encap:Ethernet ?HWaddr 00:80:E1:42:58:DB
>>>         ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>>         ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>         ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>         ? ? ? ? ? collisions:0 txqueuelen:1000
>>>         ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>         ? ? ? ? ? Interrupt:49 Base address:0xe000
>>>
>>>         lo ? ? ? ?Link encap:Local Loopback
>>>         ? ? ? ? ? inet addr:127.0.0.1 ?Mask:255.0.0.0
>>>         ? ? ? ? ? inet6 addr: ::1/128 Scope:Host
>>>         ? ? ? ? ? UP LOOPBACK RUNNING ?MTU:65536 ?Metric:1
>>>         ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>         ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>         ? ? ? ? ? collisions:0 txqueuelen:1000
>>>         ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>
>>>         sit0 ? ? ?Link encap:IPv6-in-IPv4
>>>         ? ? ? ? ? NOARP ?MTU:1480 ?Metric:1
>>>         ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>         ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>         ? ? ? ? ? collisions:0 txqueuelen:1000
>>>         ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>
>>>         wlan0 ? ? Link encap:Ethernet ?HWaddr 00:9D:6B:A6:BC:BA
>>>         ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>>         ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>         ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>         ? ? ? ? ? collisions:0 txqueuelen:1000
>>>         ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>         #############################################################################################################################
>>>
>>>         The nvram configuration file was directly copied from the
>>>         bsp layer of st in yocto (dunfell):
>>>         https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>>>
>>>         Regards,
>>>         Shlomi
>>         So in that case we have to clarify our environments. Have you
>>         tested using the latest master branch or is it some tagged
>>         version? Could you do a clean build once again to be sure
>>         that you don't use any cached things? If you were able to
>>         attach your sdcard image I would test it using my device and
>>         check if it really works because I don't see what could be
>>         wrong with that series. I don't think that ST has changed
>>         something between HW revision but I'm not able to locate on
>>         PCB what revision exactly is my board (I guess ST hasn't
>>         written it on the soldermask).
>>
>>
>>         Best
>>         Bartek
>>>
>>>         ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz Bilas??
>>>         <?b.bilas@grinn-global.com
>>>         <mailto:b.bilas@grinn-global.com>??>:?
>>>
>>>             Hi Shlomi,
>>>
>>>             On 07.10.2020 21:13, Bartosz Bilas wrote:
>>>             >
>>>             > Hi Shlomi,
>>>             >
>>>             > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>>>             >> 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 was added.
>>>             >> This was copied from the yocto bsp layer of st.
>>>             >>
>>>             >> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com
>>>             <mailto:shlomi.39sd@gmail.com>>
>>>             >> ---
>>>             >>? ?.../stm32mp157c-dk2/linux.config ? ? ? ? ? ? |? 4 +-
>>>             >> ?.../overlay/boot/extlinux/extlinux.conf ? ?|? 2 +-
>>>             >>? ?.../brcmfmac43430-sdio.st
>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt | 59
>>>             +++++++++++++++++++
>>>             >> ?.../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts | 32
>>>             ++++++++++
>>>             >> ?configs/stm32mp157c_dk2_defconfig ? ?|? 7 ++-
>>>             >>? ?5 files changed, 100 insertions(+), 4 deletions(-)
>>>             >>? ?create mode 100644
>>>             board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>             >>? ?create mode 100644
>>>             board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>             >>
>>>             >> diff --git
>>>             a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>             b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>             >> index c03eb748b4..4beee3a708 100644
>>>             >> ---
>>>             a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>             >> +++
>>>             b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>             >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>>>             >>? ?CONFIG_FORCE_MAX_ZONEORDER=12
>>>             >>? ?CONFIG_SECCOMP=y
>>>             >>? ?# CONFIG_ATAGS is not set
>>>             >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>>>             >> -CONFIG_ZBOOT_ROM_BSS=0x0
>>>             >>? ?CONFIG_ARM_APPENDED_DTB=y
>>>             >>? ?CONFIG_ARM_ATAG_DTB_COMPAT=y
>>>             >>? ?CONFIG_VFP=y
>>>             >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>>>             >>? ?CONFIG_INET=y
>>>             >>? ?CONFIG_CAN=y
>>>             >>? ?CONFIG_CAN_M_CAN=y
>>>             >> +CONFIG_CFG80211=m
>>>             >>? ?CONFIG_DEVTMPFS=y
>>>             >>? ?CONFIG_DEVTMPFS_MOUNT=y
>>>             >>? ?CONFIG_SIMPLE_PM_BUS=y
>>>             >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>>>             >>? ?CONFIG_STMMAC_ETH=y
>>>             >>? ?CONFIG_DWMAC_DWC_QOS_ETH=y
>>>             >>? ?CONFIG_MDIO_BITBANG=y
>>>             >> +CONFIG_BRCMFMAC=m
>>>             >>? ?CONFIG_INPUT_JOYDEV=y
>>>             >>? ?CONFIG_INPUT_EVDEV=y
>>>             >>? ?CONFIG_INPUT_TOUCHSCREEN=y
>>>             >> diff --git
>>>             a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>             b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>             >> index 5b7f56ee77..a6595971a8 100644
>>>             >> ---
>>>             a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>             >> +++
>>>             b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>             >> @@ -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
>>>             >> diff --git
>>>             a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>             b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>             >> new file mode 100644
>>>             >> index 0000000000..b36de8837f
>>>             >> --- /dev/null
>>>             >> +++
>>>             b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>             >> @@ -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
>>>             >> +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
>>>             >> diff --git
>>>             a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>             b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>             >> new file mode 100644
>>>             >> index 0000000000..89747d2b5f
>>>             >> --- /dev/null
>>>             >> +++
>>>             b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>             >> @@ -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";
>>>             >> +? ? };
>>>             >> +};
>>>             >> diff --git a/configs/stm32mp157c_dk2_defconfig
>>>             b/configs/stm32mp157c_dk2_defconfig
>>>             >> index bf7b9868b1..9c2e436244 100644
>>>             >> --- a/configs/stm32mp157c_dk2_defconfig
>>>             >> +++ b/configs/stm32mp157c_dk2_defconfig
>>>             >> @@ -9,8 +9,13 @@
>>>             BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>>>             >> ?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
>>>             >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>>>             >>
>>>             +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>>>
>>>             I suggest to add BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV
>>>             to load
>>>             firmware and driver automatically on boot.
>>>
>>>             Unfortunately it doesn't work for me, see:
>>>
>>>             [??? 4.186415] cfg80211: Loading compiled-in X.509
>>>             certificates for
>>>             regulatory database
>>>             [??? 4.237180] cfg80211: Loaded X.509 cert 'sforshee:
>>>             00b28ddf47aef9cea7'
>>>             [??? 4.300765] brcmfmac: brcmf_fw_alloc_request: using
>>>             brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>             [??? 5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail
>>>             timeout (1000000):
>>>             clkctl 0x50
>>>             [??? 6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail
>>>             timeout (1000000):
>>>             clkctl 0x50
>>>
>>>             Google says that it could be due to wrong nvram file
>>>             configuration but I
>>>             assume that you have run it successfully?
>>>
>>>             # ifconfig -a
>>>             eth0????? Link encap:Ethernet? HWaddr 00:80:E1:42:56:44
>>>             ?????????? BROADCAST MULTICAST? MTU:1500 Metric:1
>>>             ?????????? RX packets:0 errors:0 dropped:0 overruns:0
>>>             frame:0
>>>             ?????????? TX packets:0 errors:0 dropped:0 overruns:0
>>>             carrier:0
>>>             ?????????? collisions:0 txqueuelen:1000
>>>             ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>             ?????????? Interrupt:49 Base address:0xe000
>>>
>>>             lo??????? Link encap:Local Loopback
>>>             ?????????? inet addr:127.0.0.1 Mask:255.0.0.0
>>>             ?????????? inet6 addr: ::1/128 Scope:Host
>>>             ?????????? UP LOOPBACK RUNNING? MTU:65536 Metric:1
>>>             ?????????? RX packets:0 errors:0 dropped:0 overruns:0
>>>             frame:0
>>>             ?????????? TX packets:0 errors:0 dropped:0 overruns:0
>>>             carrier:0
>>>             ?????????? collisions:0 txqueuelen:1000
>>>             ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>
>>>             sit0????? Link encap:IPv6-in-IPv4
>>>             ?????????? NOARP? MTU:1480? Metric:1
>>>             ?????????? RX packets:0 errors:0 dropped:0 overruns:0
>>>             frame:0
>>>             ?????????? TX packets:0 errors:0 dropped:0 overruns:0
>>>             carrier:0
>>>             ?????????? collisions:0 txqueuelen:1000
>>>             ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>
>>>             #
>>>
>>>             As you can see there is no wlan0 interface.
>>>
>>>             Best
>>>             Bartek
>>>
>>>
>>>         _______________________________________________
>>>         buildroot mailing list
>>>         buildroot at busybox.net  <mailto:buildroot@busybox.net>
>>>         http://lists.busybox.net/mailman/listinfo/buildroot
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201010/99957703/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-10 15:41                 ` Bartosz Bilas
@ 2020-10-10 18:08                   ` Shlomi Vaknin
  2020-10-10 18:59                     ` Shlomi Vaknin
  2020-10-10 19:01                   ` Bartosz Bilas
  1 sibling, 1 reply; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-10 18:08 UTC (permalink / raw)
  To: buildroot

Hi!

I still don't know why it works only for me, but I discovered the
following: st doesn't use the firmware from the official linux-firmware
repo. They are using the firmware from Murata github. In addition, the
nvram file that I supplied was copied from st, which means that it matches
the murata firmware they use. So I suggest the following:

1. Take the nvram file from the official linux-firmware repository (worked
for me as well). Btw, should it be installed by default by the
linux-firmware package?
2. Use more recent firmware from murata.

I would be happy if you can test these. Do you have another idea or
something that I can try by myself?

Thanks,
Shlomi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201010/102035f2/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-10 18:08                   ` Shlomi Vaknin
@ 2020-10-10 18:59                     ` Shlomi Vaknin
  0 siblings, 0 replies; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-10 18:59 UTC (permalink / raw)
  To: buildroot

Hi,

I succeeded in reproducing the issue with my board. All I needed to do is
to make a hard reset. I don't know why rebooting does not reproduce it as
well. I will update later

Regards,
Shlomi

??????? ???, 10 ????? 2020 ?-21:08 ??? ?Shlomi Vaknin?? <?
shlomi.39sd@gmail.com??>:?

> Hi!
>
> I still don't know why it works only for me, but I discovered the
> following: st doesn't use the firmware from the official linux-firmware
> repo. They are using the firmware from Murata github. In addition, the
> nvram file that I supplied was copied from st, which means that it matches
> the murata firmware they use. So I suggest the following:
>
> 1. Take the nvram file from the official linux-firmware repository (worked
> for me as well). Btw, should it be installed by default by the
> linux-firmware package?
> 2. Use more recent firmware from murata.
>
> I would be happy if you can test these. Do you have another idea or
> something that I can try by myself?
>
> Thanks,
> Shlomi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201010/d61c5888/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-10 15:41                 ` Bartosz Bilas
  2020-10-10 18:08                   ` Shlomi Vaknin
@ 2020-10-10 19:01                   ` Bartosz Bilas
  2020-10-10 20:48                     ` Shlomi Vaknin
  1 sibling, 1 reply; 26+ messages in thread
From: Bartosz Bilas @ 2020-10-10 19:01 UTC (permalink / raw)
  To: buildroot

Hi Shlomi,

On 10.10.2020 17:41, Bartosz Bilas wrote:
>
> Hello Shlomi,
>
> On 09.10.2020 21:13, Shlomi Vaknin wrote:
>> HI!
>>
>> According to u-boot I have the same revision as you. Could you try 
>> the formal version from st: 
>> https://www.st.com/en/embedded-software/stm32mp1starter.html ? I 
>> flashed it and the wifi worked. Just to be sure that there is no 
>> issue or something else with your board.
>>
>> Best
>> Shlomi
>>
> I've used:
>
> ST OpenSTLinux - Weston - (A Yocto Project Based Distro) 
> 3.1-openstlinux-5.4-dunfell-mp1-20-06-24 stm32mp1 ttySTM0
>
> and everything seems to be ok
>
> root at stm32mp1:~# ifconfig -a
> eth0????? Link encap:Ethernet? HWaddr 00:80:E1:42:56:44
> ????????? UP BROADCAST MULTICAST? MTU:1500? Metric:1
> ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> ????????? collisions:0 txqueuelen:1000
> ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
> ????????? Interrupt:48 Base address:0x4000
>
> lo??????? Link encap:Local Loopback
> ????????? inet addr:127.0.0.1? Mask:255.0.0.0
> ????????? inet6 addr: ::1/128 Scope:Host
> ????????? UP LOOPBACK RUNNING? MTU:65536? Metric:1
> ????????? RX packets:80 errors:0 dropped:0 overruns:0 frame:0
> ????????? TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
> ????????? collisions:0 txqueuelen:1000
> ????????? RX bytes:6080 (5.9 KiB)? TX bytes:6080 (5.9 KiB)
>
> usb0????? Link encap:Ethernet? HWaddr 4E:12:37:C3:7B:6C
> ????????? UP BROADCAST MULTICAST? MTU:1500? Metric:1
> ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> ????????? collisions:0 txqueuelen:1000
> ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>
> wlan0???? Link encap:Ethernet? HWaddr 10:98:C3:5F:FB:F9
> ????????? BROADCAST MULTICAST? MTU:1500? Metric:1
> ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
> ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
> ????????? collisions:0 txqueuelen:1000
> ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>
> I'm gonna double-check one more time what's wrong with buildroot's 
> image though.
>
> Best
> Bartek

I've got this working fine, I had to add 
BR2_PACKAGE_MURATA_CYW_FW_CYW43430 instead of 
BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX as I mentioned before, I also 
added BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE

and I've successfully connected with my wifi network.

# ifconfig
lo??????? Link encap:Local Loopback
 ????????? inet addr:127.0.0.1? Mask:255.0.0.0
 ????????? inet6 addr: ::1/128 Scope:Host
 ????????? UP LOOPBACK RUNNING? MTU:65536? Metric:1
 ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
 ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
 ????????? collisions:0 txqueuelen:1000
 ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)

wlan0???? Link encap:Ethernet? HWaddr 10:98:C3:5F:FB:F9
 ????????? inet addr:192.168.10.110? Bcast:192.168.10.255 Mask:255.255.255.0
 ????????? inet6 addr: fd3a:e7f5:fc04:0:1298:c3ff:fe5f:fbf9/64 Scope:Global
 ????????? inet6 addr: fe80::1298:c3ff:fe5f:fbf9/64 Scope:Link
 ????????? UP BROADCAST RUNNING MULTICAST? MTU:1500? Metric:1
 ????????? RX packets:8 errors:0 dropped:0 overruns:0 frame:0
 ????????? TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
 ????????? collisions:0 txqueuelen:1000
 ????????? RX bytes:1624 (1.5 KiB)? TX bytes:1988 (1.9 KiB)

# ping google.com
PING google.com (216.58.215.78): 56 data bytes
64 bytes from 216.58.215.78: seq=0 ttl=116 time=29.594 ms
64 bytes from 216.58.215.78: seq=1 ttl=116 time=39.401 ms
^C
--- google.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 29.594/34.497/39.401 ms


Could you verify if it works well on your device?

>> ??????? ??? ??, 9 ????? 2020 ?-19:49 ??? ?Bartosz Bilas?? 
>> <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>>
>>     Hello Shlomi,
>>
>>     On 08.10.2020 22:45, Shlomi Vaknin wrote:
>>>     Hi Bartek,
>>>
>>>     I pulled the latest commits, downloaded my patches from
>>>     patchwork and applied them. Then, I started a new out of tree
>>>     build and everything is working. You can find my sdcard?image
>>>     here:
>>>     https://drive.google.com/drive/folders/1_FwVtw70iPS_hz7yFiiOlhXiUKlsi9bH?usp=sharing
>>>
>>>     This problem is very strange. Maybe you can check if your
>>>     board's wifi is working with an image that is known to work?
>>>     Maybe the formal image from st?
>>>
>>>     Regards,
>>>     Shlomi
>>>
>>     I've tested your image but the result is the same, see:
>>
>>     [? 129.691504] cfg80211: Loading compiled-in X.509 certificates
>>     for regulatory database
>>     [? 129.740878] cfg80211: Loaded X.509 cert 'sforshee:
>>     00b28ddf47aef9cea7'
>>     # [? 129.804593] brcmfmac: brcmf_fw_alloc_request: using
>>     brcm/brcmfmac43430-sdio for chip BCM43430/1
>>     [? 130.885129] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>>     (1000000): clkctl 0x50
>>     [? 131.911135] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>>     (1000000): clkctl 0x50
>>
>>     My board is:
>>
>>     CPU: STM32MP157CAC Rev.B
>>     Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
>>     Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
>>     Board: MB1272 Var2.0 Rev.C-01
>>     DRAM:? 512 MiB
>>
>>     Best
>>     Bartek
>>>     ??????? ??? ??, 8 ????? 2020 ?-20:31 ??? ?Bartosz Bilas??
>>>     <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>>>
>>>         Hi Shlomi,
>>>
>>>         On 07.10.2020 22:16, Shlomi Vaknin wrote:
>>>>         Hi Bartek,
>>>>
>>>>         That is very strange, since it works for me:
>>>>
>>>>         #############################################################################################################################
>>>>         Starting mdev... OK
>>>>         [ ? ?4.168709] cfg80211: Loading compiled-in X.509
>>>>         certificates for regulatory database
>>>>         [ ? ?4.224122] cfg80211: Loaded X.509 cert 'sforshee:
>>>>         00b28ddf47aef9cea7'
>>>>         [ ? ?4.288641] brcmfmac: brcmf_fw_alloc_request: using
>>>>         brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>         [ ? ?4.486998] brcmfmac: brcmf_fw_alloc_request: using
>>>>         brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>         [ ? ?4.501649] brcmfmac: brcmf_c_process_clm_blob: no
>>>>         clm_blob available (err=-2), device may have limited
>>>>         channels available
>>>>         [ ? ?4.536998] brcmfmac: brcmf_c_preinit_dcmds: Firmware:
>>>>         BCM43430/1 wl0: Oct 23 2017 03:55:53 version 7.45.98.38
>>>>         (r674442 CY) FWID 01-e58d219f
>>>>
>>>>         # ifconfig -a
>>>>         eth0 ? ? ?Link encap:Ethernet ?HWaddr 00:80:E1:42:58:DB
>>>>         ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>>>         ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>         ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>         ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>         ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>         ? ? ? ? ? Interrupt:49 Base address:0xe000
>>>>
>>>>         lo ? ? ? ?Link encap:Local Loopback
>>>>         ? ? ? ? ? inet addr:127.0.0.1 ?Mask:255.0.0.0
>>>>         ? ? ? ? ? inet6 addr: ::1/128 Scope:Host
>>>>         ? ? ? ? ? UP LOOPBACK RUNNING ?MTU:65536 ?Metric:1
>>>>         ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>         ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>         ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>         ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>
>>>>         sit0 ? ? ?Link encap:IPv6-in-IPv4
>>>>         ? ? ? ? ? NOARP ?MTU:1480 ?Metric:1
>>>>         ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>         ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>         ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>         ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>
>>>>         wlan0 ? ? Link encap:Ethernet ?HWaddr 00:9D:6B:A6:BC:BA
>>>>         ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>>>         ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>         ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>         ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>         ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>         #############################################################################################################################
>>>>
>>>>         The nvram configuration file was directly copied from the
>>>>         bsp layer of st in yocto (dunfell):
>>>>         https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>>>>
>>>>         Regards,
>>>>         Shlomi
>>>         So in that case we have to clarify our environments. Have
>>>         you tested using the latest master branch or is it some
>>>         tagged version? Could you do a clean build once again to be
>>>         sure that you don't use any cached things? If you were able
>>>         to attach your sdcard image I would test it using my device
>>>         and check if it really works because I don't see what could
>>>         be wrong with that series. I don't think that ST has changed
>>>         something between HW revision but I'm not able to locate on
>>>         PCB what revision exactly is my board (I guess ST hasn't
>>>         written it on the soldermask).
>>>
>>>
>>>         Best
>>>         Bartek
>>>>
>>>>         ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz Bilas??
>>>>         <?b.bilas@grinn-global.com
>>>>         <mailto:b.bilas@grinn-global.com>??>:?
>>>>
>>>>             Hi Shlomi,
>>>>
>>>>             On 07.10.2020 21:13, Bartosz Bilas wrote:
>>>>             >
>>>>             > Hi Shlomi,
>>>>             >
>>>>             > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>>>>             >> 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 was added.
>>>>             >> This was copied from the yocto bsp layer of st.
>>>>             >>
>>>>             >> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com
>>>>             <mailto:shlomi.39sd@gmail.com>>
>>>>             >> ---
>>>>             >> ?.../stm32mp157c-dk2/linux.config ? ? |? 4 +-
>>>>             >> ?.../overlay/boot/extlinux/extlinux.conf ? ? ?|? 2 +-
>>>>             >>? ?.../brcmfmac43430-sdio.st
>>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt | 59
>>>>             +++++++++++++++++++
>>>>             >> ?.../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts | 32
>>>>             ++++++++++
>>>>             >> ?configs/stm32mp157c_dk2_defconfig ? ? ?|? 7 ++-
>>>>             >>? ?5 files changed, 100 insertions(+), 4 deletions(-)
>>>>             >>? ?create mode 100644
>>>>             board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>             >>? ?create mode 100644
>>>>             board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>             >>
>>>>             >> diff --git
>>>>             a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>             b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>             >> index c03eb748b4..4beee3a708 100644
>>>>             >> ---
>>>>             a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>             >> +++
>>>>             b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>             >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>>>>             >>? ?CONFIG_FORCE_MAX_ZONEORDER=12
>>>>             >>? ?CONFIG_SECCOMP=y
>>>>             >>? ?# CONFIG_ATAGS is not set
>>>>             >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>>>>             >> -CONFIG_ZBOOT_ROM_BSS=0x0
>>>>             >>? ?CONFIG_ARM_APPENDED_DTB=y
>>>>             >>? ?CONFIG_ARM_ATAG_DTB_COMPAT=y
>>>>             >>? ?CONFIG_VFP=y
>>>>             >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>>>>             >>? ?CONFIG_INET=y
>>>>             >>? ?CONFIG_CAN=y
>>>>             >>? ?CONFIG_CAN_M_CAN=y
>>>>             >> +CONFIG_CFG80211=m
>>>>             >>? ?CONFIG_DEVTMPFS=y
>>>>             >>? ?CONFIG_DEVTMPFS_MOUNT=y
>>>>             >>? ?CONFIG_SIMPLE_PM_BUS=y
>>>>             >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>>>>             >>? ?CONFIG_STMMAC_ETH=y
>>>>             >>? ?CONFIG_DWMAC_DWC_QOS_ETH=y
>>>>             >>? ?CONFIG_MDIO_BITBANG=y
>>>>             >> +CONFIG_BRCMFMAC=m
>>>>             >>? ?CONFIG_INPUT_JOYDEV=y
>>>>             >>? ?CONFIG_INPUT_EVDEV=y
>>>>             >>? ?CONFIG_INPUT_TOUCHSCREEN=y
>>>>             >> diff --git
>>>>             a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>             b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>             >> index 5b7f56ee77..a6595971a8 100644
>>>>             >> ---
>>>>             a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>             >> +++
>>>>             b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>             >> @@ -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
>>>>             >> diff --git
>>>>             a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>             b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>             >> new file mode 100644
>>>>             >> index 0000000000..b36de8837f
>>>>             >> --- /dev/null
>>>>             >> +++
>>>>             b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>             <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>             >> @@ -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
>>>>             >> +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
>>>>             >> diff --git
>>>>             a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>             b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>             >> new file mode 100644
>>>>             >> index 0000000000..89747d2b5f
>>>>             >> --- /dev/null
>>>>             >> +++
>>>>             b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>             >> @@ -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";
>>>>             >> +? ? };
>>>>             >> +};
>>>>             >> diff --git a/configs/stm32mp157c_dk2_defconfig
>>>>             b/configs/stm32mp157c_dk2_defconfig
>>>>             >> index bf7b9868b1..9c2e436244 100644
>>>>             >> --- a/configs/stm32mp157c_dk2_defconfig
>>>>             >> +++ b/configs/stm32mp157c_dk2_defconfig
>>>>             >> @@ -9,8 +9,13 @@
>>>>             BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>>>>             >> ?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
>>>>             >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>>>>             >>
>>>>             +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>>>>
>>>>             I suggest to add
>>>>             BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
>>>>             firmware and driver automatically on boot.
>>>>
>>>>             Unfortunately it doesn't work for me, see:
>>>>
>>>>             [??? 4.186415] cfg80211: Loading compiled-in X.509
>>>>             certificates for
>>>>             regulatory database
>>>>             [??? 4.237180] cfg80211: Loaded X.509 cert 'sforshee:
>>>>             00b28ddf47aef9cea7'
>>>>             [??? 4.300765] brcmfmac: brcmf_fw_alloc_request: using
>>>>             brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>             [??? 5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail
>>>>             timeout (1000000):
>>>>             clkctl 0x50
>>>>             [??? 6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail
>>>>             timeout (1000000):
>>>>             clkctl 0x50
>>>>
>>>>             Google says that it could be due to wrong nvram file
>>>>             configuration but I
>>>>             assume that you have run it successfully?
>>>>
>>>>             # ifconfig -a
>>>>             eth0????? Link encap:Ethernet? HWaddr 00:80:E1:42:56:44
>>>>             ?????????? BROADCAST MULTICAST? MTU:1500 Metric:1
>>>>             ?????????? RX packets:0 errors:0 dropped:0 overruns:0
>>>>             frame:0
>>>>             ?????????? TX packets:0 errors:0 dropped:0 overruns:0
>>>>             carrier:0
>>>>             ?????????? collisions:0 txqueuelen:1000
>>>>             ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>>             ?????????? Interrupt:49 Base address:0xe000
>>>>
>>>>             lo??????? Link encap:Local Loopback
>>>>             ?????????? inet addr:127.0.0.1 Mask:255.0.0.0
>>>>             ?????????? inet6 addr: ::1/128 Scope:Host
>>>>             ?????????? UP LOOPBACK RUNNING? MTU:65536 Metric:1
>>>>             ?????????? RX packets:0 errors:0 dropped:0 overruns:0
>>>>             frame:0
>>>>             ?????????? TX packets:0 errors:0 dropped:0 overruns:0
>>>>             carrier:0
>>>>             ?????????? collisions:0 txqueuelen:1000
>>>>             ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>>
>>>>             sit0????? Link encap:IPv6-in-IPv4
>>>>             ?????????? NOARP? MTU:1480? Metric:1
>>>>             ?????????? RX packets:0 errors:0 dropped:0 overruns:0
>>>>             frame:0
>>>>             ?????????? TX packets:0 errors:0 dropped:0 overruns:0
>>>>             carrier:0
>>>>             ?????????? collisions:0 txqueuelen:1000
>>>>             ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>>
>>>>             #
>>>>
>>>>             As you can see there is no wlan0 interface.
>>>>
>>>>             Best
>>>>             Bartek
>>>>
>>>>
>>>>         _______________________________________________
>>>>         buildroot mailing list
>>>>         buildroot at busybox.net  <mailto:buildroot@busybox.net>
>>>>         http://lists.busybox.net/mailman/listinfo/buildroot
>>>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201010/7316ed07/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-10 19:01                   ` Bartosz Bilas
@ 2020-10-10 20:48                     ` Shlomi Vaknin
  2020-10-12 14:49                       ` Bartosz Bilas
  0 siblings, 1 reply; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-10 20:48 UTC (permalink / raw)
  To: buildroot

Hi Bartek,

I did as you said and it didn't work. Here are the steps I did:

1. I changed as you said - didn't work.
2. I flashed the original image from st - works.
3. I flashed again the buildroot image - works.
4. I did hard reset - not working.

Can you verify that you have this experience?

??????? ???, 10 ????? 2020 ?-22:01 ??? ?Bartosz Bilas?? <?
b.bilas@grinn-global.com??>:?

> Hi Shlomi,
> On 10.10.2020 17:41, Bartosz Bilas wrote:
>
> Hello Shlomi,
> On 09.10.2020 21:13, Shlomi Vaknin wrote:
>
> HI!
>
> According to u-boot I have the same revision as you. Could you try the
> formal version from st:
> https://www.st.com/en/embedded-software/stm32mp1starter.html ? I flashed
> it and the wifi worked. Just to be sure that there is no issue or something
> else with your board.
>
> Best
> Shlomi
>
> I've used:
>
> ST OpenSTLinux - Weston - (A Yocto Project Based Distro)
> 3.1-openstlinux-5.4-dunfell-mp1-20-06-24 stm32mp1 ttySTM0
>
> and everything seems to be ok
>
> root at stm32mp1:~# ifconfig -a
> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:56:44
>           UP BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>           Interrupt:48 Base address:0x4000
>
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>           RX packets:80 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:6080 (5.9 KiB)  TX bytes:6080 (5.9 KiB)
>
> usb0      Link encap:Ethernet  HWaddr 4E:12:37:C3:7B:6C
>           UP BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> wlan0     Link encap:Ethernet  HWaddr 10:98:C3:5F:FB:F9
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> I'm gonna double-check one more time what's wrong with buildroot's image
> though.
> Best
> Bartek
>
> I've got this working fine, I had to add
> BR2_PACKAGE_MURATA_CYW_FW_CYW43430 instead of
> BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX as I mentioned before, I also
> added BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE
>
> and I've successfully connected with my wifi network.
>
> # ifconfig
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>
> wlan0     Link encap:Ethernet  HWaddr 10:98:C3:5F:FB:F9
>           inet addr:192.168.10.110  Bcast:192.168.10.255
> Mask:255.255.255.0
>           inet6 addr: fd3a:e7f5:fc04:0:1298:c3ff:fe5f:fbf9/64 Scope:Global
>           inet6 addr: fe80::1298:c3ff:fe5f:fbf9/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:8 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:1624 (1.5 KiB)  TX bytes:1988 (1.9 KiB)
>
> # ping google.com
> PING google.com (216.58.215.78): 56 data bytes
> 64 bytes from 216.58.215.78: seq=0 ttl=116 time=29.594 ms
> 64 bytes from 216.58.215.78: seq=1 ttl=116 time=39.401 ms
> ^C
> --- google.com ping statistics ---
> 2 packets transmitted, 2 packets received, 0% packet loss
> round-trip min/avg/max = 29.594/34.497/39.401 ms
>
>
> Could you verify if it works well on your device?
>
> ??????? ??? ??, 9 ????? 2020 ?-19:49 ??? ?Bartosz Bilas?? <?
> b.bilas at grinn-global.com??>:?
>
>> Hello Shlomi,
>> On 08.10.2020 22:45, Shlomi Vaknin wrote:
>>
>> Hi Bartek,
>>
>> I pulled the latest commits, downloaded my patches from patchwork and
>> applied them. Then, I started a new out of tree build and everything is
>> working. You can find my sdcard image here:
>> https://drive.google.com/drive/folders/1_FwVtw70iPS_hz7yFiiOlhXiUKlsi9bH?usp=sharing
>>
>> This problem is very strange. Maybe you can check if your board's wifi is
>> working with an image that is known to work? Maybe the formal image from st?
>>
>> Regards,
>> Shlomi
>>
>> I've tested your image but the result is the same, see:
>>
>> [  129.691504] cfg80211: Loading compiled-in X.509 certificates for
>> regulatory database
>> [  129.740878] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
>> # [  129.804593] brcmfmac: brcmf_fw_alloc_request: using
>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>> [  130.885129] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>> clkctl 0x50
>> [  131.911135] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>> clkctl 0x50
>>
>> My board is:
>>
>> CPU: STM32MP157CAC Rev.B
>> Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
>> Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
>> Board: MB1272 Var2.0 Rev.C-01
>> DRAM:  512 MiB
>> Best
>> Bartek
>>
>> ??????? ??? ??, 8 ????? 2020 ?-20:31 ??? ?Bartosz Bilas?? <?
>> b.bilas at grinn-global.com??>:?
>>
>>> Hi Shlomi,
>>> On 07.10.2020 22:16, Shlomi Vaknin wrote:
>>>
>>> Hi Bartek,
>>>
>>> That is very strange, since it works for me:
>>>
>>>
>>> #############################################################################################################################
>>> Starting mdev... OK
>>> [    4.168709] cfg80211: Loading compiled-in X.509 certificates for
>>> regulatory database
>>> [    4.224122] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
>>> [    4.288641] brcmfmac: brcmf_fw_alloc_request: using
>>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>>> [    4.486998] brcmfmac: brcmf_fw_alloc_request: using
>>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>>> [    4.501649] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available
>>> (err=-2), device may have limited channels available
>>> [    4.536998] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1
>>> wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
>>>
>>> # ifconfig -a
>>> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:58:DB
>>>           BROADCAST MULTICAST  MTU:1500  Metric:1
>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:1000
>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>           Interrupt:49 Base address:0xe000
>>>
>>> lo        Link encap:Local Loopback
>>>           inet addr:127.0.0.1  Mask:255.0.0.0
>>>           inet6 addr: ::1/128 Scope:Host
>>>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:1000
>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>
>>> sit0      Link encap:IPv6-in-IPv4
>>>           NOARP  MTU:1480  Metric:1
>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:1000
>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>
>>> wlan0     Link encap:Ethernet  HWaddr 00:9D:6B:A6:BC:BA
>>>           BROADCAST MULTICAST  MTU:1500  Metric:1
>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:1000
>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>
>>> #############################################################################################################################
>>>
>>> The nvram configuration file was directly copied from the bsp layer of
>>> st in yocto (dunfell):
>>> https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>>>
>>> Regards,
>>> Shlomi
>>>
>>> So in that case we have to clarify our environments. Have you tested
>>> using the latest master branch or is it some tagged version? Could you do a
>>> clean build once again to be sure that you don't use any cached things? If
>>> you were able to attach your sdcard image I would test it using my device
>>> and check if it really works because I don't see what could be wrong with
>>> that series. I don't think that ST has changed something between HW
>>> revision but I'm not able to locate on PCB what revision exactly is my
>>> board (I guess ST hasn't written it on the soldermask).
>>>
>>>
>>> Best
>>> Bartek
>>>
>>>
>>> ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz Bilas?? <?
>>> b.bilas at grinn-global.com??>:?
>>>
>>>> Hi Shlomi,
>>>>
>>>> On 07.10.2020 21:13, Bartosz Bilas wrote:
>>>> >
>>>> > Hi Shlomi,
>>>> >
>>>> > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>>>> >> 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 was added.
>>>> >> This was copied from the yocto bsp layer of st.
>>>> >>
>>>> >> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com>
>>>> >> ---
>>>> >>   .../stm32mp157c-dk2/linux.config              |  4 +-
>>>> >>   .../overlay/boot/extlinux/extlinux.conf       |  2 +-
>>>> >>   .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59
>>>> +++++++++++++++++++
>>>> >>   .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
>>>> >>   configs/stm32mp157c_dk2_defconfig             |  7 ++-
>>>> >>   5 files changed, 100 insertions(+), 4 deletions(-)
>>>> >>   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
>>>> >>
>>>> >> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>> b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>> >> index c03eb748b4..4beee3a708 100644
>>>> >> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>> >> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>> >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>>>> >>   CONFIG_FORCE_MAX_ZONEORDER=12
>>>> >>   CONFIG_SECCOMP=y
>>>> >>   # CONFIG_ATAGS is not set
>>>> >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>>>> >> -CONFIG_ZBOOT_ROM_BSS=0x0
>>>> >>   CONFIG_ARM_APPENDED_DTB=y
>>>> >>   CONFIG_ARM_ATAG_DTB_COMPAT=y
>>>> >>   CONFIG_VFP=y
>>>> >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>>>> >>   CONFIG_INET=y
>>>> >>   CONFIG_CAN=y
>>>> >>   CONFIG_CAN_M_CAN=y
>>>> >> +CONFIG_CFG80211=m
>>>> >>   CONFIG_DEVTMPFS=y
>>>> >>   CONFIG_DEVTMPFS_MOUNT=y
>>>> >>   CONFIG_SIMPLE_PM_BUS=y
>>>> >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>>>> >>   CONFIG_STMMAC_ETH=y
>>>> >>   CONFIG_DWMAC_DWC_QOS_ETH=y
>>>> >>   CONFIG_MDIO_BITBANG=y
>>>> >> +CONFIG_BRCMFMAC=m
>>>> >>   CONFIG_INPUT_JOYDEV=y
>>>> >>   CONFIG_INPUT_EVDEV=y
>>>> >>   CONFIG_INPUT_TOUCHSCREEN=y
>>>> >> diff --git
>>>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>> >> index 5b7f56ee77..a6595971a8 100644
>>>> >> ---
>>>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>> >> +++
>>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>> >> @@ -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
>>>> >> diff --git
>>>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>>>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>>>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>>>> >> new file mode 100644
>>>> >> index 0000000000..b36de8837f
>>>> >> --- /dev/null
>>>> >> +++
>>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>>>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>>>> >> @@ -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
>>>> >> +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
>>>> >> diff --git
>>>> a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>> b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>> >> new file mode 100644
>>>> >> index 0000000000..89747d2b5f
>>>> >> --- /dev/null
>>>> >> +++
>>>> b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>> >> @@ -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";
>>>> >> +    };
>>>> >> +};
>>>> >> diff --git a/configs/stm32mp157c_dk2_defconfig
>>>> b/configs/stm32mp157c_dk2_defconfig
>>>> >> index bf7b9868b1..9c2e436244 100644
>>>> >> --- a/configs/stm32mp157c_dk2_defconfig
>>>> >> +++ b/configs/stm32mp157c_dk2_defconfig
>>>> >> @@ -9,8 +9,13 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>>>> >>   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
>>>> >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>>>> >>
>>>> +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>>>>
>>>> I suggest to add BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
>>>> firmware and driver automatically on boot.
>>>>
>>>> Unfortunately it doesn't work for me, see:
>>>>
>>>> [    4.186415] cfg80211: Loading compiled-in X.509 certificates for
>>>> regulatory database
>>>> [    4.237180] cfg80211: Loaded X.509 cert 'sforshee:
>>>> 00b28ddf47aef9cea7'
>>>> [    4.300765] brcmfmac: brcmf_fw_alloc_request: using
>>>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>> [    5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>>>> clkctl 0x50
>>>> [    6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>>>> clkctl 0x50
>>>>
>>>> Google says that it could be due to wrong nvram file configuration but
>>>> I
>>>> assume that you have run it successfully?
>>>>
>>>> # ifconfig -a
>>>> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:56:44
>>>>            BROADCAST MULTICAST  MTU:1500  Metric:1
>>>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>            collisions:0 txqueuelen:1000
>>>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>            Interrupt:49 Base address:0xe000
>>>>
>>>> lo        Link encap:Local Loopback
>>>>            inet addr:127.0.0.1  Mask:255.0.0.0
>>>>            inet6 addr: ::1/128 Scope:Host
>>>>            UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>            collisions:0 txqueuelen:1000
>>>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>
>>>> sit0      Link encap:IPv6-in-IPv4
>>>>            NOARP  MTU:1480  Metric:1
>>>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>            collisions:0 txqueuelen:1000
>>>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>
>>>> #
>>>>
>>>> As you can see there is no wlan0 interface.
>>>>
>>>> Best
>>>> Bartek
>>>>
>>>
>>> _______________________________________________
>>> buildroot mailing listbuildroot at busybox.nethttp://lists.busybox.net/mailman/listinfo/buildroot
>>>
>>>
> _______________________________________________
> buildroot mailing listbuildroot at busybox.nethttp://lists.busybox.net/mailman/listinfo/buildroot
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201010/01f56385/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-10 20:48                     ` Shlomi Vaknin
@ 2020-10-12 14:49                       ` Bartosz Bilas
  2020-10-12 17:35                         ` Shlomi Vaknin
  0 siblings, 1 reply; 26+ messages in thread
From: Bartosz Bilas @ 2020-10-12 14:49 UTC (permalink / raw)
  To: buildroot

Hi Shlomi,

On 10.10.2020 22:48, Shlomi Vaknin wrote:
> Hi Bartek,
>
> I did as you said and it didn't work. Here are the steps I did:
>
> 1. I changed as you said - didn't work.
> 2. I flashed the original image from st - works.
> 3. I flashed again the buildroot image - works.
> 4. I did hard reset - not working.
>
> Can you verify that you have this experience?

Let's put this topic off for now because it blocks the rest of the 
patches that look good and can be merged. I need more time to check what 
exactly is going on with this wlan module.

Best
Bartek
>
> ??????? ???, 10 ????? 2020 ?-22:01 ??? ?Bartosz Bilas?? 
> <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>
>     Hi Shlomi,
>
>     On 10.10.2020 17:41, Bartosz Bilas wrote:
>>
>>     Hello Shlomi,
>>
>>     On 09.10.2020 21:13, Shlomi Vaknin wrote:
>>>     HI!
>>>
>>>     According to u-boot I have the same revision as you. Could you
>>>     try the formal version from st:
>>>     https://www.st.com/en/embedded-software/stm32mp1starter.html ? I
>>>     flashed it and the wifi worked. Just to be sure that there is no
>>>     issue or something else with your board.
>>>
>>>     Best
>>>     Shlomi
>>>
>>     I've used:
>>
>>     ST OpenSTLinux - Weston - (A Yocto Project Based Distro)
>>     3.1-openstlinux-5.4-dunfell-mp1-20-06-24 stm32mp1 ttySTM0
>>
>>     and everything seems to be ok
>>
>>     root at stm32mp1:~# ifconfig -a
>>     eth0????? Link encap:Ethernet? HWaddr 00:80:E1:42:56:44
>>     ????????? UP BROADCAST MULTICAST? MTU:1500? Metric:1
>>     ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>     ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>     ????????? collisions:0 txqueuelen:1000
>>     ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>     ????????? Interrupt:48 Base address:0x4000
>>
>>     lo??????? Link encap:Local Loopback
>>     ????????? inet addr:127.0.0.1? Mask:255.0.0.0
>>     ????????? inet6 addr: ::1/128 Scope:Host
>>     ????????? UP LOOPBACK RUNNING? MTU:65536? Metric:1
>>     ????????? RX packets:80 errors:0 dropped:0 overruns:0 frame:0
>>     ????????? TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
>>     ????????? collisions:0 txqueuelen:1000
>>     ????????? RX bytes:6080 (5.9 KiB)? TX bytes:6080 (5.9 KiB)
>>
>>     usb0????? Link encap:Ethernet? HWaddr 4E:12:37:C3:7B:6C
>>     ????????? UP BROADCAST MULTICAST? MTU:1500? Metric:1
>>     ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>     ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>     ????????? collisions:0 txqueuelen:1000
>>     ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>
>>     wlan0???? Link encap:Ethernet? HWaddr 10:98:C3:5F:FB:F9
>>     ????????? BROADCAST MULTICAST? MTU:1500? Metric:1
>>     ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>     ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>     ????????? collisions:0 txqueuelen:1000
>>     ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>
>>     I'm gonna double-check one more time what's wrong with
>>     buildroot's image though.
>>
>>     Best
>>     Bartek
>
>     I've got this working fine, I had to add
>     BR2_PACKAGE_MURATA_CYW_FW_CYW43430 instead of
>     BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX as I mentioned before, I
>     also added BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE
>
>     and I've successfully connected with my wifi network.
>
>     # ifconfig
>     lo??????? Link encap:Local Loopback
>     ????????? inet addr:127.0.0.1? Mask:255.0.0.0
>     ????????? inet6 addr: ::1/128 Scope:Host
>     ????????? UP LOOPBACK RUNNING? MTU:65536? Metric:1
>     ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>     ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>     ????????? collisions:0 txqueuelen:1000
>     ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>
>     wlan0???? Link encap:Ethernet? HWaddr 10:98:C3:5F:FB:F9
>     ????????? inet addr:192.168.10.110? Bcast:192.168.10.255
>     Mask:255.255.255.0
>     ????????? inet6 addr: fd3a:e7f5:fc04:0:1298:c3ff:fe5f:fbf9/64
>     Scope:Global
>     ????????? inet6 addr: fe80::1298:c3ff:fe5f:fbf9/64 Scope:Link
>     ????????? UP BROADCAST RUNNING MULTICAST? MTU:1500 Metric:1
>     ????????? RX packets:8 errors:0 dropped:0 overruns:0 frame:0
>     ????????? TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
>     ????????? collisions:0 txqueuelen:1000
>     ????????? RX bytes:1624 (1.5 KiB)? TX bytes:1988 (1.9 KiB)
>
>     # ping google.com <http://google.com>
>     PING google.com <http://google.com> (216.58.215.78): 56 data bytes
>     64 bytes from 216.58.215.78 <http://216.58.215.78>: seq=0 ttl=116
>     time=29.594 ms
>     64 bytes from 216.58.215.78 <http://216.58.215.78>: seq=1 ttl=116
>     time=39.401 ms
>     ^C
>     --- google.com <http://google.com> ping statistics ---
>     2 packets transmitted, 2 packets received, 0% packet loss
>     round-trip min/avg/max = 29.594/34.497/39.401 ms
>
>
>     Could you verify if it works well on your device?
>
>>>     ??????? ??? ??, 9 ????? 2020 ?-19:49 ??? ?Bartosz Bilas??
>>>     <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>>>
>>>         Hello Shlomi,
>>>
>>>         On 08.10.2020 22:45, Shlomi Vaknin wrote:
>>>>         Hi Bartek,
>>>>
>>>>         I pulled the latest commits, downloaded my patches from
>>>>         patchwork and applied them. Then, I started a new out of
>>>>         tree build and everything is working. You can find my
>>>>         sdcard?image here:
>>>>         https://drive.google.com/drive/folders/1_FwVtw70iPS_hz7yFiiOlhXiUKlsi9bH?usp=sharing
>>>>
>>>>         This problem is very strange. Maybe you can check if your
>>>>         board's wifi is working with an image that is known to
>>>>         work? Maybe the formal image from st?
>>>>
>>>>         Regards,
>>>>         Shlomi
>>>>
>>>         I've tested your image but the result is the same, see:
>>>
>>>         [? 129.691504] cfg80211: Loading compiled-in X.509
>>>         certificates for regulatory database
>>>         [? 129.740878] cfg80211: Loaded X.509 cert 'sforshee:
>>>         00b28ddf47aef9cea7'
>>>         # [? 129.804593] brcmfmac: brcmf_fw_alloc_request: using
>>>         brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>         [? 130.885129] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>>>         (1000000): clkctl 0x50
>>>         [? 131.911135] brcmfmac: brcmf_sdio_htclk: HT Avail timeout
>>>         (1000000): clkctl 0x50
>>>
>>>         My board is:
>>>
>>>         CPU: STM32MP157CAC Rev.B
>>>         Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
>>>         Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
>>>         Board: MB1272 Var2.0 Rev.C-01
>>>         DRAM:? 512 MiB
>>>
>>>         Best
>>>         Bartek
>>>>         ??????? ??? ??, 8 ????? 2020 ?-20:31 ??? ?Bartosz Bilas??
>>>>         <?b.bilas@grinn-global.com
>>>>         <mailto:b.bilas@grinn-global.com>??>:?
>>>>
>>>>             Hi Shlomi,
>>>>
>>>>             On 07.10.2020 22:16, Shlomi Vaknin wrote:
>>>>>             Hi Bartek,
>>>>>
>>>>>             That is very strange, since it works for me:
>>>>>
>>>>>             #############################################################################################################################
>>>>>             Starting mdev... OK
>>>>>             [ ? ?4.168709] cfg80211: Loading compiled-in X.509
>>>>>             certificates for regulatory database
>>>>>             [ ? ?4.224122] cfg80211: Loaded X.509 cert 'sforshee:
>>>>>             00b28ddf47aef9cea7'
>>>>>             [ ? ?4.288641] brcmfmac: brcmf_fw_alloc_request: using
>>>>>             brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>>             [ ? ?4.486998] brcmfmac: brcmf_fw_alloc_request: using
>>>>>             brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>>             [ ? ?4.501649] brcmfmac: brcmf_c_process_clm_blob: no
>>>>>             clm_blob available (err=-2), device may have limited
>>>>>             channels available
>>>>>             [ ? ?4.536998] brcmfmac: brcmf_c_preinit_dcmds:
>>>>>             Firmware: BCM43430/1 wl0: Oct 23 2017 03:55:53 version
>>>>>             7.45.98.38 (r674442 CY) FWID 01-e58d219f
>>>>>
>>>>>             # ifconfig -a
>>>>>             eth0 ? ? ?Link encap:Ethernet ?HWaddr 00:80:E1:42:58:DB
>>>>>             ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>>>>             ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0
>>>>>             frame:0
>>>>>             ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0
>>>>>             carrier:0
>>>>>             ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>>             ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>>             ? ? ? ? ? Interrupt:49 Base address:0xe000
>>>>>
>>>>>             lo ? ? ? ?Link encap:Local Loopback
>>>>>             ? ? ? ? ? inet addr:127.0.0.1 ?Mask:255.0.0.0
>>>>>             ? ? ? ? ? inet6 addr: ::1/128 Scope:Host
>>>>>             ? ? ? ? ? UP LOOPBACK RUNNING ?MTU:65536 ?Metric:1
>>>>>             ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0
>>>>>             frame:0
>>>>>             ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0
>>>>>             carrier:0
>>>>>             ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>>             ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>>
>>>>>             sit0 ? ? ?Link encap:IPv6-in-IPv4
>>>>>             ? ? ? ? ? NOARP ?MTU:1480 ?Metric:1
>>>>>             ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0
>>>>>             frame:0
>>>>>             ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0
>>>>>             carrier:0
>>>>>             ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>>             ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>>
>>>>>             wlan0 ? ? Link encap:Ethernet ?HWaddr 00:9D:6B:A6:BC:BA
>>>>>             ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>>>>             ? ? ? ? ? RX packets:0 errors:0 dropped:0 overruns:0
>>>>>             frame:0
>>>>>             ? ? ? ? ? TX packets:0 errors:0 dropped:0 overruns:0
>>>>>             carrier:0
>>>>>             ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>>             ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>>             #############################################################################################################################
>>>>>
>>>>>             The nvram configuration file was directly copied from
>>>>>             the bsp layer of st in yocto (dunfell):
>>>>>             https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>>>>>
>>>>>             Regards,
>>>>>             Shlomi
>>>>             So in that case we have to clarify our environments.
>>>>             Have you tested using the latest master branch or is it
>>>>             some tagged version? Could you do a clean build once
>>>>             again to be sure that you don't use any cached things?
>>>>             If you were able to attach your sdcard image I would
>>>>             test it using my device and check if it really works
>>>>             because I don't see what could be wrong with that
>>>>             series. I don't think that ST has changed something
>>>>             between HW revision but I'm not able to locate on PCB
>>>>             what revision exactly is my board (I guess ST hasn't
>>>>             written it on the soldermask).
>>>>
>>>>
>>>>             Best
>>>>             Bartek
>>>>>
>>>>>             ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz
>>>>>             Bilas?? <?b.bilas@grinn-global.com
>>>>>             <mailto:b.bilas@grinn-global.com>??>:?
>>>>>
>>>>>                 Hi Shlomi,
>>>>>
>>>>>                 On 07.10.2020 21:13, Bartosz Bilas wrote:
>>>>>                 >
>>>>>                 > Hi Shlomi,
>>>>>                 >
>>>>>                 > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>>>>>                 >> 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
>>>>>                 was added.
>>>>>                 >> This was copied from the yocto bsp layer of st.
>>>>>                 >>
>>>>>                 >> Signed-off-by: Shlomi
>>>>>                 Vaknin<shlomi.39sd@gmail.com
>>>>>                 <mailto:shlomi.39sd@gmail.com>>
>>>>>                 >> ---
>>>>>                 >> ?.../stm32mp157c-dk2/linux.config ? ? ? ? ? ?
>>>>>                 |? 4 +-
>>>>>                 >> ?.../overlay/boot/extlinux/extlinux.conf ? ?
>>>>>                 ?|? 2 +-
>>>>>                 >>? ?.../brcmfmac43430-sdio.st
>>>>>                 <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>                 | 59 +++++++++++++++++++
>>>>>                 >> ?.../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts |
>>>>>                 32 ++++++++++
>>>>>                 >> ?configs/stm32mp157c_dk2_defconfig ? ? ? ? ?
>>>>>                 ?|? 7 ++-
>>>>>                 >>? ?5 files changed, 100 insertions(+), 4
>>>>>                 deletions(-)
>>>>>                 >>? ?create mode 100644
>>>>>                 board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>>                 <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>                 >>? ?create mode 100644
>>>>>                 board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>>                 >>
>>>>>                 >> diff --git
>>>>>                 a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>>                 b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>>                 >> index c03eb748b4..4beee3a708 100644
>>>>>                 >> ---
>>>>>                 a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>>                 >> +++
>>>>>                 b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>>                 >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>>>>>                 >> ?CONFIG_FORCE_MAX_ZONEORDER=12
>>>>>                 >>? ?CONFIG_SECCOMP=y
>>>>>                 >>? ?# CONFIG_ATAGS is not set
>>>>>                 >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>>>>>                 >> -CONFIG_ZBOOT_ROM_BSS=0x0
>>>>>                 >> ?CONFIG_ARM_APPENDED_DTB=y
>>>>>                 >> ?CONFIG_ARM_ATAG_DTB_COMPAT=y
>>>>>                 >>? ?CONFIG_VFP=y
>>>>>                 >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>>>>>                 >>? ?CONFIG_INET=y
>>>>>                 >>? ?CONFIG_CAN=y
>>>>>                 >>? ?CONFIG_CAN_M_CAN=y
>>>>>                 >> +CONFIG_CFG80211=m
>>>>>                 >>? ?CONFIG_DEVTMPFS=y
>>>>>                 >>? ?CONFIG_DEVTMPFS_MOUNT=y
>>>>>                 >>? ?CONFIG_SIMPLE_PM_BUS=y
>>>>>                 >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>>>>>                 >>? ?CONFIG_STMMAC_ETH=y
>>>>>                 >> ?CONFIG_DWMAC_DWC_QOS_ETH=y
>>>>>                 >>? ?CONFIG_MDIO_BITBANG=y
>>>>>                 >> +CONFIG_BRCMFMAC=m
>>>>>                 >>? ?CONFIG_INPUT_JOYDEV=y
>>>>>                 >>? ?CONFIG_INPUT_EVDEV=y
>>>>>                 >> ?CONFIG_INPUT_TOUCHSCREEN=y
>>>>>                 >> diff --git
>>>>>                 a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>>                 b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>>                 >> index 5b7f56ee77..a6595971a8 100644
>>>>>                 >> ---
>>>>>                 a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>>                 >> +++
>>>>>                 b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>>                 >> @@ -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
>>>>>                 >> diff --git
>>>>>                 a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>>                 <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>                 b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>>                 <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>                 >> new file mode 100644
>>>>>                 >> index 0000000000..b36de8837f
>>>>>                 >> --- /dev/null
>>>>>                 >> +++
>>>>>                 b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>>                 <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>                 >> @@ -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
>>>>>                 >> +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
>>>>>                 >> diff --git
>>>>>                 a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>>                 b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>>                 >> new file mode 100644
>>>>>                 >> index 0000000000..89747d2b5f
>>>>>                 >> --- /dev/null
>>>>>                 >> +++
>>>>>                 b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>>                 >> @@ -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";
>>>>>                 >> +? ? };
>>>>>                 >> +};
>>>>>                 >> diff --git a/configs/stm32mp157c_dk2_defconfig
>>>>>                 b/configs/stm32mp157c_dk2_defconfig
>>>>>                 >> index bf7b9868b1..9c2e436244 100644
>>>>>                 >> --- a/configs/stm32mp157c_dk2_defconfig
>>>>>                 >> +++ b/configs/stm32mp157c_dk2_defconfig
>>>>>                 >> @@ -9,8 +9,13 @@
>>>>>                 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>>>>>                 >> ?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
>>>>>                 >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>>>>>                 >>
>>>>>                 +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>>>>>
>>>>>                 I suggest to add
>>>>>                 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
>>>>>                 firmware and driver automatically on boot.
>>>>>
>>>>>                 Unfortunately it doesn't work for me, see:
>>>>>
>>>>>                 [??? 4.186415] cfg80211: Loading compiled-in X.509
>>>>>                 certificates for
>>>>>                 regulatory database
>>>>>                 [??? 4.237180] cfg80211: Loaded X.509 cert
>>>>>                 'sforshee: 00b28ddf47aef9cea7'
>>>>>                 [??? 4.300765] brcmfmac: brcmf_fw_alloc_request:
>>>>>                 using
>>>>>                 brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>>                 [??? 5.389412] brcmfmac: brcmf_sdio_htclk: HT
>>>>>                 Avail timeout (1000000):
>>>>>                 clkctl 0x50
>>>>>                 [??? 6.407710] brcmfmac: brcmf_sdio_htclk: HT
>>>>>                 Avail timeout (1000000):
>>>>>                 clkctl 0x50
>>>>>
>>>>>                 Google says that it could be due to wrong nvram
>>>>>                 file configuration but I
>>>>>                 assume that you have run it successfully?
>>>>>
>>>>>                 # ifconfig -a
>>>>>                 eth0????? Link encap:Ethernet HWaddr 00:80:E1:42:56:44
>>>>>                 ?????????? BROADCAST MULTICAST MTU:1500? Metric:1
>>>>>                 ?????????? RX packets:0 errors:0 dropped:0
>>>>>                 overruns:0 frame:0
>>>>>                 ?????????? TX packets:0 errors:0 dropped:0
>>>>>                 overruns:0 carrier:0
>>>>>                 ?????????? collisions:0 txqueuelen:1000
>>>>>                 ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>>>                 ?????????? Interrupt:49 Base address:0xe000
>>>>>
>>>>>                 lo??????? Link encap:Local Loopback
>>>>>                 ?????????? inet addr:127.0.0.1 Mask:255.0.0.0
>>>>>                 ?????????? inet6 addr: ::1/128 Scope:Host
>>>>>                 ?????????? UP LOOPBACK RUNNING MTU:65536? Metric:1
>>>>>                 ?????????? RX packets:0 errors:0 dropped:0
>>>>>                 overruns:0 frame:0
>>>>>                 ?????????? TX packets:0 errors:0 dropped:0
>>>>>                 overruns:0 carrier:0
>>>>>                 ?????????? collisions:0 txqueuelen:1000
>>>>>                 ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>>>
>>>>>                 sit0????? Link encap:IPv6-in-IPv4
>>>>>                 ?????????? NOARP? MTU:1480 Metric:1
>>>>>                 ?????????? RX packets:0 errors:0 dropped:0
>>>>>                 overruns:0 frame:0
>>>>>                 ?????????? TX packets:0 errors:0 dropped:0
>>>>>                 overruns:0 carrier:0
>>>>>                 ?????????? collisions:0 txqueuelen:1000
>>>>>                 ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>>>
>>>>>                 #
>>>>>
>>>>>                 As you can see there is no wlan0 interface.
>>>>>
>>>>>                 Best
>>>>>                 Bartek
>>>>>
>>>>>
>>>>>             _______________________________________________
>>>>>             buildroot mailing list
>>>>>             buildroot at busybox.net  <mailto:buildroot@busybox.net>
>>>>>             http://lists.busybox.net/mailman/listinfo/buildroot
>>>>
>>
>>     _______________________________________________
>>     buildroot mailing list
>>     buildroot at busybox.net  <mailto:buildroot@busybox.net>
>>     http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201012/402ba190/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-12 14:49                       ` Bartosz Bilas
@ 2020-10-12 17:35                         ` Shlomi Vaknin
  2020-10-12 18:15                           ` Bartosz Bilas
  0 siblings, 1 reply; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-12 17:35 UTC (permalink / raw)
  To: buildroot

Hi,

I agree. Do I need to send the other patches again?

Shlomi

??????? ??? ??, 12 ????? 2020 ?-17:49 ??? ?Bartosz Bilas?? <?
b.bilas@grinn-global.com??>:?

> Hi Shlomi,
> On 10.10.2020 22:48, Shlomi Vaknin wrote:
>
> Hi Bartek,
>
> I did as you said and it didn't work. Here are the steps I did:
>
> 1. I changed as you said - didn't work.
> 2. I flashed the original image from st - works.
> 3. I flashed again the buildroot image - works.
> 4. I did hard reset - not working.
>
> Can you verify that you have this experience?
>
> Let's put this topic off for now because it blocks the rest of the patches
> that look good and can be merged. I need more time to check what exactly is
> going on with this wlan module.
> Best
> Bartek
>
>
> ??????? ???, 10 ????? 2020 ?-22:01 ??? ?Bartosz Bilas?? <?
> b.bilas at grinn-global.com??>:?
>
>> Hi Shlomi,
>> On 10.10.2020 17:41, Bartosz Bilas wrote:
>>
>> Hello Shlomi,
>> On 09.10.2020 21:13, Shlomi Vaknin wrote:
>>
>> HI!
>>
>> According to u-boot I have the same revision as you. Could you try the
>> formal version from st:
>> https://www.st.com/en/embedded-software/stm32mp1starter.html ? I flashed
>> it and the wifi worked. Just to be sure that there is no issue or something
>> else with your board.
>>
>> Best
>> Shlomi
>>
>> I've used:
>>
>> ST OpenSTLinux - Weston - (A Yocto Project Based Distro)
>> 3.1-openstlinux-5.4-dunfell-mp1-20-06-24 stm32mp1 ttySTM0
>>
>> and everything seems to be ok
>>
>> root at stm32mp1:~# ifconfig -a
>> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:56:44
>>           UP BROADCAST MULTICAST  MTU:1500  Metric:1
>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>           Interrupt:48 Base address:0x4000
>>
>> lo        Link encap:Local Loopback
>>           inet addr:127.0.0.1  Mask:255.0.0.0
>>           inet6 addr: ::1/128 Scope:Host
>>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>           RX packets:80 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:6080 (5.9 KiB)  TX bytes:6080 (5.9 KiB)
>>
>> usb0      Link encap:Ethernet  HWaddr 4E:12:37:C3:7B:6C
>>           UP BROADCAST MULTICAST  MTU:1500  Metric:1
>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>
>> wlan0     Link encap:Ethernet  HWaddr 10:98:C3:5F:FB:F9
>>           BROADCAST MULTICAST  MTU:1500  Metric:1
>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>
>> I'm gonna double-check one more time what's wrong with buildroot's image
>> though.
>> Best
>> Bartek
>>
>> I've got this working fine, I had to add
>> BR2_PACKAGE_MURATA_CYW_FW_CYW43430 instead of
>> BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX as I mentioned before, I also
>> added BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE
>>
>> and I've successfully connected with my wifi network.
>>
>> # ifconfig
>> lo        Link encap:Local Loopback
>>           inet addr:127.0.0.1  Mask:255.0.0.0
>>           inet6 addr: ::1/128 Scope:Host
>>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>
>> wlan0     Link encap:Ethernet  HWaddr 10:98:C3:5F:FB:F9
>>           inet addr:192.168.10.110  Bcast:192.168.10.255
>> Mask:255.255.255.0
>>           inet6 addr: fd3a:e7f5:fc04:0:1298:c3ff:fe5f:fbf9/64 Scope:Global
>>           inet6 addr: fe80::1298:c3ff:fe5f:fbf9/64 Scope:Link
>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>           RX packets:8 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000
>>           RX bytes:1624 (1.5 KiB)  TX bytes:1988 (1.9 KiB)
>>
>> # ping google.com
>> PING google.com (216.58.215.78): 56 data bytes
>> 64 bytes from 216.58.215.78: seq=0 ttl=116 time=29.594 ms
>> 64 bytes from 216.58.215.78: seq=1 ttl=116 time=39.401 ms
>> ^C
>> --- google.com ping statistics ---
>> 2 packets transmitted, 2 packets received, 0% packet loss
>> round-trip min/avg/max = 29.594/34.497/39.401 ms
>>
>>
>> Could you verify if it works well on your device?
>>
>> ??????? ??? ??, 9 ????? 2020 ?-19:49 ??? ?Bartosz Bilas?? <?
>> b.bilas at grinn-global.com??>:?
>>
>>> Hello Shlomi,
>>> On 08.10.2020 22:45, Shlomi Vaknin wrote:
>>>
>>> Hi Bartek,
>>>
>>> I pulled the latest commits, downloaded my patches from patchwork and
>>> applied them. Then, I started a new out of tree build and everything is
>>> working. You can find my sdcard image here:
>>> https://drive.google.com/drive/folders/1_FwVtw70iPS_hz7yFiiOlhXiUKlsi9bH?usp=sharing
>>>
>>> This problem is very strange. Maybe you can check if your board's wifi
>>> is working with an image that is known to work? Maybe the formal image from
>>> st?
>>>
>>> Regards,
>>> Shlomi
>>>
>>> I've tested your image but the result is the same, see:
>>>
>>> [  129.691504] cfg80211: Loading compiled-in X.509 certificates for
>>> regulatory database
>>> [  129.740878] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
>>> # [  129.804593] brcmfmac: brcmf_fw_alloc_request: using
>>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>>> [  130.885129] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>>> clkctl 0x50
>>> [  131.911135] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>>> clkctl 0x50
>>>
>>> My board is:
>>>
>>> CPU: STM32MP157CAC Rev.B
>>> Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
>>> Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
>>> Board: MB1272 Var2.0 Rev.C-01
>>> DRAM:  512 MiB
>>> Best
>>> Bartek
>>>
>>> ??????? ??? ??, 8 ????? 2020 ?-20:31 ??? ?Bartosz Bilas?? <?
>>> b.bilas at grinn-global.com??>:?
>>>
>>>> Hi Shlomi,
>>>> On 07.10.2020 22:16, Shlomi Vaknin wrote:
>>>>
>>>> Hi Bartek,
>>>>
>>>> That is very strange, since it works for me:
>>>>
>>>>
>>>> #############################################################################################################################
>>>> Starting mdev... OK
>>>> [    4.168709] cfg80211: Loading compiled-in X.509 certificates for
>>>> regulatory database
>>>> [    4.224122] cfg80211: Loaded X.509 cert 'sforshee:
>>>> 00b28ddf47aef9cea7'
>>>> [    4.288641] brcmfmac: brcmf_fw_alloc_request: using
>>>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>> [    4.486998] brcmfmac: brcmf_fw_alloc_request: using
>>>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>> [    4.501649] brcmfmac: brcmf_c_process_clm_blob: no clm_blob
>>>> available (err=-2), device may have limited channels available
>>>> [    4.536998] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1
>>>> wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
>>>>
>>>> # ifconfig -a
>>>> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:58:DB
>>>>           BROADCAST MULTICAST  MTU:1500  Metric:1
>>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>           collisions:0 txqueuelen:1000
>>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>           Interrupt:49 Base address:0xe000
>>>>
>>>> lo        Link encap:Local Loopback
>>>>           inet addr:127.0.0.1  Mask:255.0.0.0
>>>>           inet6 addr: ::1/128 Scope:Host
>>>>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>           collisions:0 txqueuelen:1000
>>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>
>>>> sit0      Link encap:IPv6-in-IPv4
>>>>           NOARP  MTU:1480  Metric:1
>>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>           collisions:0 txqueuelen:1000
>>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>
>>>> wlan0     Link encap:Ethernet  HWaddr 00:9D:6B:A6:BC:BA
>>>>           BROADCAST MULTICAST  MTU:1500  Metric:1
>>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>           collisions:0 txqueuelen:1000
>>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>
>>>> #############################################################################################################################
>>>>
>>>> The nvram configuration file was directly copied from the bsp layer of
>>>> st in yocto (dunfell):
>>>> https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>>>>
>>>> Regards,
>>>> Shlomi
>>>>
>>>> So in that case we have to clarify our environments. Have you tested
>>>> using the latest master branch or is it some tagged version? Could you do a
>>>> clean build once again to be sure that you don't use any cached things? If
>>>> you were able to attach your sdcard image I would test it using my device
>>>> and check if it really works because I don't see what could be wrong with
>>>> that series. I don't think that ST has changed something between HW
>>>> revision but I'm not able to locate on PCB what revision exactly is my
>>>> board (I guess ST hasn't written it on the soldermask).
>>>>
>>>>
>>>> Best
>>>> Bartek
>>>>
>>>>
>>>> ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz Bilas?? <?
>>>> b.bilas at grinn-global.com??>:?
>>>>
>>>>> Hi Shlomi,
>>>>>
>>>>> On 07.10.2020 21:13, Bartosz Bilas wrote:
>>>>> >
>>>>> > Hi Shlomi,
>>>>> >
>>>>> > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>>>>> >> 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 was added.
>>>>> >> This was copied from the yocto bsp layer of st.
>>>>> >>
>>>>> >> Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com>
>>>>> >> ---
>>>>> >>   .../stm32mp157c-dk2/linux.config              |  4 +-
>>>>> >>   .../overlay/boot/extlinux/extlinux.conf       |  2 +-
>>>>> >>   .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59
>>>>> +++++++++++++++++++
>>>>> >>   .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
>>>>> >>   configs/stm32mp157c_dk2_defconfig             |  7 ++-
>>>>> >>   5 files changed, 100 insertions(+), 4 deletions(-)
>>>>> >>   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
>>>>> >>
>>>>> >> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>> b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>> >> index c03eb748b4..4beee3a708 100644
>>>>> >> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>> >> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>> >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>>>>> >>   CONFIG_FORCE_MAX_ZONEORDER=12
>>>>> >>   CONFIG_SECCOMP=y
>>>>> >>   # CONFIG_ATAGS is not set
>>>>> >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>>>>> >> -CONFIG_ZBOOT_ROM_BSS=0x0
>>>>> >>   CONFIG_ARM_APPENDED_DTB=y
>>>>> >>   CONFIG_ARM_ATAG_DTB_COMPAT=y
>>>>> >>   CONFIG_VFP=y
>>>>> >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>>>>> >>   CONFIG_INET=y
>>>>> >>   CONFIG_CAN=y
>>>>> >>   CONFIG_CAN_M_CAN=y
>>>>> >> +CONFIG_CFG80211=m
>>>>> >>   CONFIG_DEVTMPFS=y
>>>>> >>   CONFIG_DEVTMPFS_MOUNT=y
>>>>> >>   CONFIG_SIMPLE_PM_BUS=y
>>>>> >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>>>>> >>   CONFIG_STMMAC_ETH=y
>>>>> >>   CONFIG_DWMAC_DWC_QOS_ETH=y
>>>>> >>   CONFIG_MDIO_BITBANG=y
>>>>> >> +CONFIG_BRCMFMAC=m
>>>>> >>   CONFIG_INPUT_JOYDEV=y
>>>>> >>   CONFIG_INPUT_EVDEV=y
>>>>> >>   CONFIG_INPUT_TOUCHSCREEN=y
>>>>> >> diff --git
>>>>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>> >> index 5b7f56ee77..a6595971a8 100644
>>>>> >> ---
>>>>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>> >> +++
>>>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>> >> @@ -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
>>>>> >> diff --git
>>>>> a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>>>>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>>>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>>>>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>>>>> >> new file mode 100644
>>>>> >> index 0000000000..b36de8837f
>>>>> >> --- /dev/null
>>>>> >> +++
>>>>> b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/
>>>>> brcmfmac43430-sdio.st,stm32mp157c-dk2.txt
>>>>> >> @@ -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
>>>>> >> +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
>>>>> >> diff --git
>>>>> a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>> b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>> >> new file mode 100644
>>>>> >> index 0000000000..89747d2b5f
>>>>> >> --- /dev/null
>>>>> >> +++
>>>>> b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>> >> @@ -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";
>>>>> >> +    };
>>>>> >> +};
>>>>> >> diff --git a/configs/stm32mp157c_dk2_defconfig
>>>>> b/configs/stm32mp157c_dk2_defconfig
>>>>> >> index bf7b9868b1..9c2e436244 100644
>>>>> >> --- a/configs/stm32mp157c_dk2_defconfig
>>>>> >> +++ b/configs/stm32mp157c_dk2_defconfig
>>>>> >> @@ -9,8 +9,13 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>>>>> >>   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
>>>>> >> -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>>>>> >>
>>>>> +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>>>>>
>>>>> I suggest to add BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
>>>>> firmware and driver automatically on boot.
>>>>>
>>>>> Unfortunately it doesn't work for me, see:
>>>>>
>>>>> [    4.186415] cfg80211: Loading compiled-in X.509 certificates for
>>>>> regulatory database
>>>>> [    4.237180] cfg80211: Loaded X.509 cert 'sforshee:
>>>>> 00b28ddf47aef9cea7'
>>>>> [    4.300765] brcmfmac: brcmf_fw_alloc_request: using
>>>>> brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>> [    5.389412] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>>>>> clkctl 0x50
>>>>> [    6.407710] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
>>>>> clkctl 0x50
>>>>>
>>>>> Google says that it could be due to wrong nvram file configuration but
>>>>> I
>>>>> assume that you have run it successfully?
>>>>>
>>>>> # ifconfig -a
>>>>> eth0      Link encap:Ethernet  HWaddr 00:80:E1:42:56:44
>>>>>            BROADCAST MULTICAST  MTU:1500  Metric:1
>>>>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>>            collisions:0 txqueuelen:1000
>>>>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>>            Interrupt:49 Base address:0xe000
>>>>>
>>>>> lo        Link encap:Local Loopback
>>>>>            inet addr:127.0.0.1  Mask:255.0.0.0
>>>>>            inet6 addr: ::1/128 Scope:Host
>>>>>            UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>>>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>>            collisions:0 txqueuelen:1000
>>>>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>>
>>>>> sit0      Link encap:IPv6-in-IPv4
>>>>>            NOARP  MTU:1480  Metric:1
>>>>>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>>>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>>>            collisions:0 txqueuelen:1000
>>>>>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>>>
>>>>> #
>>>>>
>>>>> As you can see there is no wlan0 interface.
>>>>>
>>>>> Best
>>>>> Bartek
>>>>>
>>>>
>>>> _______________________________________________
>>>> buildroot mailing listbuildroot at busybox.nethttp://lists.busybox.net/mailman/listinfo/buildroot
>>>>
>>>>
>> _______________________________________________
>> buildroot mailing listbuildroot at busybox.nethttp://lists.busybox.net/mailman/listinfo/buildroot
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201012/fb1e810e/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration Shlomi Vaknin
@ 2020-10-12 18:08   ` Bartosz Bilas
  2020-10-12 20:11     ` Shlomi Vaknin
  2020-10-14 17:02   ` Thomas Petazzoni
  1 sibling, 1 reply; 26+ messages in thread
From: Bartosz Bilas @ 2020-10-12 18:08 UTC (permalink / raw)
  To: buildroot

Hi Shlomi,

On 07.10.2020 16:49, Shlomi Vaknin wrote:
> 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 addition, this commit enables gadget support in `linux.config`.
This should be committed as a separate patch because it's not related to 
the trusted configuration at all.
>
> In addition, removing partition-type from genimage.cfg is mandatory,
> since it creates a hybrid MBR partition table which causes ATF to not find ssbl parition.
>
> Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
> ---
>   .../{genimage.cfg => genimage.cfg.template}   |  7 ++-
>   .../common/stm32mp157/post-image.sh           | 43 +++++++++++++++++++
>   .../stm32mp157a-dk1/linux.config              | 24 ++++-------
>   .../stm32mp157c-dk2/linux.config              | 20 ++++-----
>   configs/stm32mp157a_dk1_defconfig             | 14 +++---
>   configs/stm32mp157c_dk2_defconfig             | 14 +++---
>   6 files changed, 78 insertions(+), 44 deletions(-)
>   rename board/stmicroelectronics/common/stm32mp157/{genimage.cfg => genimage.cfg.template} (63%)
>   create mode 100755 board/stmicroelectronics/common/stm32mp157/post-image.sh
>
> diff --git a/board/stmicroelectronics/common/stm32mp157/genimage.cfg b/board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
> similarity index 63%
> rename from board/stmicroelectronics/common/stm32mp157/genimage.cfg
> rename to board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
> index d1ce530cc5..f341c19f2f 100644
> --- a/board/stmicroelectronics/common/stm32mp157/genimage.cfg
> +++ b/board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
> @@ -4,20 +4,19 @@ image sdcard.img {
>   	}
>   
>   	partition fsbl1 {
> -		image = "u-boot-spl.stm32"
> +		image = "%ATFBIN%"
>   	}
>   
>   	partition fsbl2 {
> -		image = "u-boot-spl.stm32"
> +		image = "%ATFBIN%"
>   	}
>   
>   	partition ssbl {
> -		image = "u-boot.img"
> +		image = "u-boot.stm32"
>   	}
>   
>   	partition rootfs {
>   		image = "rootfs.ext4"
> -		partition-type = 0x83
>   		bootable = "yes"
>   	}
>   }
> diff --git a/board/stmicroelectronics/common/stm32mp157/post-image.sh b/board/stmicroelectronics/common/stm32mp157/post-image.sh
> new file mode 100755
> index 0000000000..c00a5c6f6c
> --- /dev/null
> +++ b/board/stmicroelectronics/common/stm32mp157/post-image.sh
> @@ -0,0 +1,43 @@
> +#!/usr/bin/env bash
> +
> +#
> +# atf_image extracts the ATF binary image from DTB_FILE_NAME that appears in
> +# BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES in ${BR_CONFIG},
> +# then prints the corresponding file name for the genimage
> +# configuration file
> +#
> +atf_image()
> +{
> +	local ATF_VARIABLES="$(sed -n 's/^BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="\([\/a-zA-Z0-9_=. \-]*\)"$/\1/p' ${BR2_CONFIG})"
> +
> +	if grep -Eq "DTB_FILE_NAME=stm32mp157c-dk2.dtb" <<< ${ATF_VARIABLES}; then
> +		echo "tf-a-stm32mp157c-dk2.stm32"
> +	elif grep -Eq "DTB_FILE_NAME=stm32mp157a-dk1.dtb" <<< ${ATF_VARIABLES}; then
> +                echo "tf-a-stm32mp157a-dk1.stm32"
> +	fi
> +}
> +
> +main()
> +{
> +	local ATFBIN="$(atf_image)"
> +	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
> +	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
> +
> +	sed -e "s/%ATFBIN%/${ATFBIN}/" \
> +		board/stmicroelectronics/common/stm32mp157/genimage.cfg.template > ${GENIMAGE_CFG}
> +
> +	rm -rf "${GENIMAGE_TMP}"
> +
> +	genimage \
> +		--rootpath "${TARGET_DIR}" \
> +		--tmppath "${GENIMAGE_TMP}" \
> +		--inputpath "${BINARIES_DIR}" \
> +		--outputpath "${BINARIES_DIR}" \
> +		--config "${GENIMAGE_CFG}"
> +
> +	rm -f ${GENIMAGE_CFG}
> +
> +	exit $?
> +}
> +
> +main $@
> diff --git a/board/stmicroelectronics/stm32mp157a-dk1/linux.config b/board/stmicroelectronics/stm32mp157a-dk1/linux.config
> index 95c834e431..47729ea97c 100644
> --- a/board/stmicroelectronics/stm32mp157a-dk1/linux.config
> +++ b/board/stmicroelectronics/stm32mp157a-dk1/linux.config
> @@ -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
Are these changes related to the trusted configuration or it's a result 
of resync with newer kernel configuration?
> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> index 878a0c39f1..c03eb748b4 100644
> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> @@ -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
same here.
> diff --git a/configs/stm32mp157a_dk1_defconfig b/configs/stm32mp157a_dk1_defconfig
> index f172539c02..cdbb5a8cdf 100644
> --- a/configs/stm32mp157a_dk1_defconfig
> +++ b/configs/stm32mp157a_dk1_defconfig
> @@ -2,8 +2,7 @@ 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/common/stm32mp157/genimage.cfg"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
>   BR2_LINUX_KERNEL=y
>   BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>   BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
> @@ -16,15 +15,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
> diff --git a/configs/stm32mp157c_dk2_defconfig b/configs/stm32mp157c_dk2_defconfig
> index 49cfb0733c..6251491e0f 100644
> --- a/configs/stm32mp157c_dk2_defconfig
> +++ b/configs/stm32mp157c_dk2_defconfig
> @@ -2,8 +2,7 @@ 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/common/stm32mp157/genimage.cfg"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
>   BR2_LINUX_KERNEL=y
>   BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>   BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
> @@ -16,15 +15,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
Best
Bartek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201012/e2b27169/attachment-0001.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-12 17:35                         ` Shlomi Vaknin
@ 2020-10-12 18:15                           ` Bartosz Bilas
  0 siblings, 0 replies; 26+ messages in thread
From: Bartosz Bilas @ 2020-10-12 18:15 UTC (permalink / raw)
  To: buildroot

Hi Shlomi,

On 12.10.2020 19:35, Shlomi Vaknin wrote:
> Hi,
>
> I agree. Do I need to send the other patches again?
>
> Shlomi
>
I've commented v3,2/4, so it would be fine if you sent the new series 
without this last patch when we end the discussion? ?

Best
Bartek
> ??????? ??? ??, 12 ????? 2020 ?-17:49 ??? ?Bartosz Bilas?? 
> <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>
>     Hi Shlomi,
>
>     On 10.10.2020 22:48, Shlomi Vaknin wrote:
>>     Hi Bartek,
>>
>>     I did as you said and it didn't work. Here are the steps I did:
>>
>>     1. I changed as you said - didn't work.
>>     2. I flashed the original image from st - works.
>>     3. I flashed again the buildroot image - works.
>>     4. I did hard reset - not working.
>>
>>     Can you verify that you have this experience?
>
>     Let's put this topic off for now because it blocks the rest of the
>     patches that look good and can be merged. I need more time to
>     check what exactly is going on with this wlan module.
>
>     Best
>     Bartek
>>
>>     ??????? ???, 10 ????? 2020 ?-22:01 ??? ?Bartosz Bilas??
>>     <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>>
>>         Hi Shlomi,
>>
>>         On 10.10.2020 17:41, Bartosz Bilas wrote:
>>>
>>>         Hello Shlomi,
>>>
>>>         On 09.10.2020 21:13, Shlomi Vaknin wrote:
>>>>         HI!
>>>>
>>>>         According to u-boot I have the same revision as you. Could
>>>>         you try the formal version from st:
>>>>         https://www.st.com/en/embedded-software/stm32mp1starter.html
>>>>         ? I flashed it and the wifi worked. Just to be sure that
>>>>         there is no issue or something else with your board.
>>>>
>>>>         Best
>>>>         Shlomi
>>>>
>>>         I've used:
>>>
>>>         ST OpenSTLinux - Weston - (A Yocto Project Based Distro)
>>>         3.1-openstlinux-5.4-dunfell-mp1-20-06-24 stm32mp1 ttySTM0
>>>
>>>         and everything seems to be ok
>>>
>>>         root at stm32mp1:~# ifconfig -a
>>>         eth0????? Link encap:Ethernet? HWaddr 00:80:E1:42:56:44
>>>         ????????? UP BROADCAST MULTICAST? MTU:1500 Metric:1
>>>         ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>         ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>         ????????? collisions:0 txqueuelen:1000
>>>         ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>         ????????? Interrupt:48 Base address:0x4000
>>>
>>>         lo??????? Link encap:Local Loopback
>>>         ????????? inet addr:127.0.0.1? Mask:255.0.0.0
>>>         ????????? inet6 addr: ::1/128 Scope:Host
>>>         ????????? UP LOOPBACK RUNNING? MTU:65536 Metric:1
>>>         ????????? RX packets:80 errors:0 dropped:0 overruns:0 frame:0
>>>         ????????? TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
>>>         ????????? collisions:0 txqueuelen:1000
>>>         ????????? RX bytes:6080 (5.9 KiB)? TX bytes:6080 (5.9 KiB)
>>>
>>>         usb0????? Link encap:Ethernet? HWaddr 4E:12:37:C3:7B:6C
>>>         ????????? UP BROADCAST MULTICAST? MTU:1500 Metric:1
>>>         ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>         ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>         ????????? collisions:0 txqueuelen:1000
>>>         ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>
>>>         wlan0???? Link encap:Ethernet? HWaddr 10:98:C3:5F:FB:F9
>>>         ????????? BROADCAST MULTICAST? MTU:1500 Metric:1
>>>         ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>         ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>         ????????? collisions:0 txqueuelen:1000
>>>         ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>
>>>         I'm gonna double-check one more time what's wrong with
>>>         buildroot's image though.
>>>
>>>         Best
>>>         Bartek
>>
>>         I've got this working fine, I had to add
>>         BR2_PACKAGE_MURATA_CYW_FW_CYW43430 instead of
>>         BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XXX as I mentioned
>>         before, I also added BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE
>>
>>         and I've successfully connected with my wifi network.
>>
>>         # ifconfig
>>         lo??????? Link encap:Local Loopback
>>         ????????? inet addr:127.0.0.1? Mask:255.0.0.0
>>         ????????? inet6 addr: ::1/128 Scope:Host
>>         ????????? UP LOOPBACK RUNNING? MTU:65536? Metric:1
>>         ????????? RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>         ????????? TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>         ????????? collisions:0 txqueuelen:1000
>>         ????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>
>>         wlan0???? Link encap:Ethernet? HWaddr 10:98:C3:5F:FB:F9
>>         ????????? inet addr:192.168.10.110 Bcast:192.168.10.255?
>>         Mask:255.255.255.0
>>         ????????? inet6 addr: fd3a:e7f5:fc04:0:1298:c3ff:fe5f:fbf9/64
>>         Scope:Global
>>         ????????? inet6 addr: fe80::1298:c3ff:fe5f:fbf9/64 Scope:Link
>>         ????????? UP BROADCAST RUNNING MULTICAST MTU:1500? Metric:1
>>         ????????? RX packets:8 errors:0 dropped:0 overruns:0 frame:0
>>         ????????? TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
>>         ????????? collisions:0 txqueuelen:1000
>>         ????????? RX bytes:1624 (1.5 KiB)? TX bytes:1988 (1.9 KiB)
>>
>>         # ping google.com <http://google.com>
>>         PING google.com <http://google.com> (216.58.215.78): 56 data
>>         bytes
>>         64 bytes from 216.58.215.78 <http://216.58.215.78>: seq=0
>>         ttl=116 time=29.594 ms
>>         64 bytes from 216.58.215.78 <http://216.58.215.78>: seq=1
>>         ttl=116 time=39.401 ms
>>         ^C
>>         --- google.com <http://google.com> ping statistics ---
>>         2 packets transmitted, 2 packets received, 0% packet loss
>>         round-trip min/avg/max = 29.594/34.497/39.401 ms
>>
>>
>>         Could you verify if it works well on your device?
>>
>>>>         ??????? ??? ??, 9 ????? 2020 ?-19:49 ??? ?Bartosz Bilas??
>>>>         <?b.bilas@grinn-global.com
>>>>         <mailto:b.bilas@grinn-global.com>??>:?
>>>>
>>>>             Hello Shlomi,
>>>>
>>>>             On 08.10.2020 22:45, Shlomi Vaknin wrote:
>>>>>             Hi Bartek,
>>>>>
>>>>>             I pulled the latest commits, downloaded my patches
>>>>>             from patchwork and applied them. Then, I started a new
>>>>>             out of tree build and everything is working. You can
>>>>>             find my sdcard?image here:
>>>>>             https://drive.google.com/drive/folders/1_FwVtw70iPS_hz7yFiiOlhXiUKlsi9bH?usp=sharing
>>>>>
>>>>>             This problem is very strange. Maybe you can check if
>>>>>             your board's wifi is working with an image that is
>>>>>             known to work? Maybe the formal image from st?
>>>>>
>>>>>             Regards,
>>>>>             Shlomi
>>>>>
>>>>             I've tested your image but the result is the same, see:
>>>>
>>>>             [? 129.691504] cfg80211: Loading compiled-in X.509
>>>>             certificates for regulatory database
>>>>             [? 129.740878] cfg80211: Loaded X.509 cert 'sforshee:
>>>>             00b28ddf47aef9cea7'
>>>>             # [? 129.804593] brcmfmac: brcmf_fw_alloc_request:
>>>>             using brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>             [? 130.885129] brcmfmac: brcmf_sdio_htclk: HT Avail
>>>>             timeout (1000000): clkctl 0x50
>>>>             [? 131.911135] brcmfmac: brcmf_sdio_htclk: HT Avail
>>>>             timeout (1000000): clkctl 0x50
>>>>
>>>>             My board is:
>>>>
>>>>             CPU: STM32MP157CAC Rev.B
>>>>             Model: STMicroelectronics STM32MP157C-DK2 Discovery Board
>>>>             Board: stm32mp1 in trusted mode (st,stm32mp157c-dk2)
>>>>             Board: MB1272 Var2.0 Rev.C-01
>>>>             DRAM:? 512 MiB
>>>>
>>>>             Best
>>>>             Bartek
>>>>>             ??????? ??? ??, 8 ????? 2020 ?-20:31 ??? ?Bartosz
>>>>>             Bilas?? <?b.bilas@grinn-global.com
>>>>>             <mailto:b.bilas@grinn-global.com>??>:?
>>>>>
>>>>>                 Hi Shlomi,
>>>>>
>>>>>                 On 07.10.2020 22:16, Shlomi Vaknin wrote:
>>>>>>                 Hi Bartek,
>>>>>>
>>>>>>                 That is very strange, since it works for me:
>>>>>>
>>>>>>                 #############################################################################################################################
>>>>>>                 Starting mdev... OK
>>>>>>                 [ ? ?4.168709] cfg80211: Loading compiled-in
>>>>>>                 X.509 certificates for regulatory database
>>>>>>                 [ ? ?4.224122] cfg80211: Loaded X.509 cert
>>>>>>                 'sforshee: 00b28ddf47aef9cea7'
>>>>>>                 [ ? ?4.288641] brcmfmac: brcmf_fw_alloc_request:
>>>>>>                 using brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>>>                 [ ? ?4.486998] brcmfmac: brcmf_fw_alloc_request:
>>>>>>                 using brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>>>                 [ ? ?4.501649] brcmfmac:
>>>>>>                 brcmf_c_process_clm_blob: no clm_blob available
>>>>>>                 (err=-2), device may have limited channels available
>>>>>>                 [ ? ?4.536998] brcmfmac: brcmf_c_preinit_dcmds:
>>>>>>                 Firmware: BCM43430/1 wl0: Oct 23 2017 03:55:53
>>>>>>                 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
>>>>>>
>>>>>>                 # ifconfig -a
>>>>>>                 eth0 ? ? ?Link encap:Ethernet ?HWaddr
>>>>>>                 00:80:E1:42:58:DB
>>>>>>                 ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>>>>>                 ? ? ? ? ? RX packets:0 errors:0 dropped:0
>>>>>>                 overruns:0 frame:0
>>>>>>                 ? ? ? ? ? TX packets:0 errors:0 dropped:0
>>>>>>                 overruns:0 carrier:0
>>>>>>                 ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>>>                 ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>>>                 ? ? ? ? ? Interrupt:49 Base address:0xe000
>>>>>>
>>>>>>                 lo ? ? ? ?Link encap:Local Loopback
>>>>>>                 ? ? ? ? ? inet addr:127.0.0.1 ?Mask:255.0.0.0
>>>>>>                 ? ? ? ? ? inet6 addr: ::1/128 Scope:Host
>>>>>>                 ? ? ? ? ? UP LOOPBACK RUNNING ?MTU:65536 ?Metric:1
>>>>>>                 ? ? ? ? ? RX packets:0 errors:0 dropped:0
>>>>>>                 overruns:0 frame:0
>>>>>>                 ? ? ? ? ? TX packets:0 errors:0 dropped:0
>>>>>>                 overruns:0 carrier:0
>>>>>>                 ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>>>                 ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>>>
>>>>>>                 sit0 ? ? ?Link encap:IPv6-in-IPv4
>>>>>>                 ? ? ? ? ? NOARP ?MTU:1480 ?Metric:1
>>>>>>                 ? ? ? ? ? RX packets:0 errors:0 dropped:0
>>>>>>                 overruns:0 frame:0
>>>>>>                 ? ? ? ? ? TX packets:0 errors:0 dropped:0
>>>>>>                 overruns:0 carrier:0
>>>>>>                 ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>>>                 ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>>>
>>>>>>                 wlan0 ? ? Link encap:Ethernet ?HWaddr
>>>>>>                 00:9D:6B:A6:BC:BA
>>>>>>                 ? ? ? ? ? BROADCAST MULTICAST ?MTU:1500 ?Metric:1
>>>>>>                 ? ? ? ? ? RX packets:0 errors:0 dropped:0
>>>>>>                 overruns:0 frame:0
>>>>>>                 ? ? ? ? ? TX packets:0 errors:0 dropped:0
>>>>>>                 overruns:0 carrier:0
>>>>>>                 ? ? ? ? ? collisions:0 txqueuelen:1000
>>>>>>                 ? ? ? ? ? RX bytes:0 (0.0 B) ?TX bytes:0 (0.0 B)
>>>>>>                 #############################################################################################################################
>>>>>>
>>>>>>                 The nvram configuration file was directly copied
>>>>>>                 from the bsp layer of st in yocto (dunfell):
>>>>>>                 https://github.com/STMicroelectronics/meta-st-stm32mp/blob/dunfell/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
>>>>>>
>>>>>>                 Regards,
>>>>>>                 Shlomi
>>>>>                 So in that case we have to clarify our
>>>>>                 environments. Have you tested using the latest
>>>>>                 master branch or is it some tagged version? Could
>>>>>                 you do a clean build once again to be sure that
>>>>>                 you don't use any cached things? If you were able
>>>>>                 to attach your sdcard image I would test it using
>>>>>                 my device and check if it really works because I
>>>>>                 don't see what could be wrong with that series. I
>>>>>                 don't think that ST has changed something between
>>>>>                 HW revision but I'm not able to locate on PCB what
>>>>>                 revision exactly is my board (I guess ST hasn't
>>>>>                 written it on the soldermask).
>>>>>
>>>>>
>>>>>                 Best
>>>>>                 Bartek
>>>>>>
>>>>>>                 ??????? ??? ??, 7 ????? 2020 ?-22:27 ??? ?Bartosz
>>>>>>                 Bilas?? <?b.bilas@grinn-global.com
>>>>>>                 <mailto:b.bilas@grinn-global.com>??>:?
>>>>>>
>>>>>>                     Hi Shlomi,
>>>>>>
>>>>>>                     On 07.10.2020 21:13, Bartosz Bilas wrote:
>>>>>>                     >
>>>>>>                     > Hi Shlomi,
>>>>>>                     >
>>>>>>                     > On 07.10.2020 16:49, Shlomi Vaknin wrote:
>>>>>>                     >> 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 was added.
>>>>>>                     >> This was copied from the yocto bsp layer
>>>>>>                     of st.
>>>>>>                     >>
>>>>>>                     >> Signed-off-by: Shlomi
>>>>>>                     Vaknin<shlomi.39sd@gmail.com
>>>>>>                     <mailto:shlomi.39sd@gmail.com>>
>>>>>>                     >> ---
>>>>>>                     >> ?.../stm32mp157c-dk2/linux.config ? ? ? ?
>>>>>>                     ? ? |? 4 +-
>>>>>>                     >> ?.../overlay/boot/extlinux/extlinux.conf ?
>>>>>>                     ? ?|? 2 +-
>>>>>>                     >>? ?.../brcmfmac43430-sdio.st
>>>>>>                     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>>                     | 59 +++++++++++++++++++
>>>>>>                     >>
>>>>>>                     ?.../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>>>                     | 32 ++++++++++
>>>>>>                     >> ?configs/stm32mp157c_dk2_defconfig ? ? ? ?
>>>>>>                     ? ?|? 7 ++-
>>>>>>                     >>? ?5 files changed, 100 insertions(+), 4
>>>>>>                     deletions(-)
>>>>>>                     >>? ?create mode 100644
>>>>>>                     board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>>>                     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>>                     >>? ?create mode 100644
>>>>>>                     board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>>>                     >>
>>>>>>                     >> diff --git
>>>>>>                     a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>>>                     b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>>>                     >> index c03eb748b4..4beee3a708 100644
>>>>>>                     >> ---
>>>>>>                     a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>>>                     >> +++
>>>>>>                     b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>>>>>                     >> @@ -24,8 +24,6 @@ CONFIG_HIGHMEM=y
>>>>>>                     >> ?CONFIG_FORCE_MAX_ZONEORDER=12
>>>>>>                     >> ?CONFIG_SECCOMP=y
>>>>>>                     >>? ?# CONFIG_ATAGS is not set
>>>>>>                     >> -CONFIG_ZBOOT_ROM_TEXT=0x0
>>>>>>                     >> -CONFIG_ZBOOT_ROM_BSS=0x0
>>>>>>                     >> ?CONFIG_ARM_APPENDED_DTB=y
>>>>>>                     >> ?CONFIG_ARM_ATAG_DTB_COMPAT=y
>>>>>>                     >>? ?CONFIG_VFP=y
>>>>>>                     >> @@ -45,6 +43,7 @@ CONFIG_UNIX=y
>>>>>>                     >>? ?CONFIG_INET=y
>>>>>>                     >>? ?CONFIG_CAN=y
>>>>>>                     >> ?CONFIG_CAN_M_CAN=y
>>>>>>                     >> +CONFIG_CFG80211=m
>>>>>>                     >> ?CONFIG_DEVTMPFS=y
>>>>>>                     >> ?CONFIG_DEVTMPFS_MOUNT=y
>>>>>>                     >> ?CONFIG_SIMPLE_PM_BUS=y
>>>>>>                     >> @@ -66,6 +65,7 @@ CONFIG_SMSC911X=y
>>>>>>                     >> ?CONFIG_STMMAC_ETH=y
>>>>>>                     >> ?CONFIG_DWMAC_DWC_QOS_ETH=y
>>>>>>                     >> ?CONFIG_MDIO_BITBANG=y
>>>>>>                     >> +CONFIG_BRCMFMAC=m
>>>>>>                     >> ?CONFIG_INPUT_JOYDEV=y
>>>>>>                     >> ?CONFIG_INPUT_EVDEV=y
>>>>>>                     >> ?CONFIG_INPUT_TOUCHSCREEN=y
>>>>>>                     >> diff --git
>>>>>>                     a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>>>                     b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>>>                     >> index 5b7f56ee77..a6595971a8 100644
>>>>>>                     >> ---
>>>>>>                     a/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>>>                     >> +++
>>>>>>                     b/board/stmicroelectronics/stm32mp157c-dk2/overlay/boot/extlinux/extlinux.conf
>>>>>>                     >> @@ -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
>>>>>>                     >> diff --git
>>>>>>                     a/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>>>                     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>>                     b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>>>                     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>>                     >> new file mode 100644
>>>>>>                     >> index 0000000000..b36de8837f
>>>>>>                     >> --- /dev/null
>>>>>>                     >> +++
>>>>>>                     b/board/stmicroelectronics/stm32mp157c-dk2/overlay/lib/firmware/brcm/brcmfmac43430-sdio.st
>>>>>>                     <http://brcmfmac43430-sdio.st>,stm32mp157c-dk2.txt
>>>>>>                     >> @@ -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
>>>>>>                     >> +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
>>>>>>                     >> diff --git
>>>>>>                     a/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>>>                     b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>>>                     >> new file mode 100644
>>>>>>                     >> index 0000000000..89747d2b5f
>>>>>>                     >> --- /dev/null
>>>>>>                     >> +++
>>>>>>                     b/board/stmicroelectronics/stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts
>>>>>>                     >> @@ -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";
>>>>>>                     >> +? ? };
>>>>>>                     >> +};
>>>>>>                     >> diff --git
>>>>>>                     a/configs/stm32mp157c_dk2_defconfig
>>>>>>                     b/configs/stm32mp157c_dk2_defconfig
>>>>>>                     >> index bf7b9868b1..9c2e436244 100644
>>>>>>                     >> --- a/configs/stm32mp157c_dk2_defconfig
>>>>>>                     >> +++ b/configs/stm32mp157c_dk2_defconfig
>>>>>>                     >> @@ -9,8 +9,13 @@
>>>>>>                     BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.8.13"
>>>>>>                     >> ?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
>>>>>>                     >>
>>>>>>                     -BR2_LINUX_KERNEL_INTREE_DTS_NAME="stm32mp157c-dk2"
>>>>>>                     >>
>>>>>>                     +BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/stmicroelectronics/stm32mp157c-dk2/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"
>>>>>>
>>>>>>                     I suggest to add
>>>>>>                     BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV to load
>>>>>>                     firmware and driver automatically on boot.
>>>>>>
>>>>>>                     Unfortunately it doesn't work for me, see:
>>>>>>
>>>>>>                     [??? 4.186415] cfg80211: Loading compiled-in
>>>>>>                     X.509 certificates for
>>>>>>                     regulatory database
>>>>>>                     [??? 4.237180] cfg80211: Loaded X.509 cert
>>>>>>                     'sforshee: 00b28ddf47aef9cea7'
>>>>>>                     [??? 4.300765] brcmfmac:
>>>>>>                     brcmf_fw_alloc_request: using
>>>>>>                     brcm/brcmfmac43430-sdio for chip BCM43430/1
>>>>>>                     [??? 5.389412] brcmfmac: brcmf_sdio_htclk: HT
>>>>>>                     Avail timeout (1000000):
>>>>>>                     clkctl 0x50
>>>>>>                     [??? 6.407710] brcmfmac: brcmf_sdio_htclk: HT
>>>>>>                     Avail timeout (1000000):
>>>>>>                     clkctl 0x50
>>>>>>
>>>>>>                     Google says that it could be due to wrong
>>>>>>                     nvram file configuration but I
>>>>>>                     assume that you have run it successfully?
>>>>>>
>>>>>>                     # ifconfig -a
>>>>>>                     eth0????? Link encap:Ethernet? HWaddr
>>>>>>                     00:80:E1:42:56:44
>>>>>>                     ?????????? BROADCAST MULTICAST? MTU:1500 Metric:1
>>>>>>                     ?????????? RX packets:0 errors:0 dropped:0
>>>>>>                     overruns:0 frame:0
>>>>>>                     ?????????? TX packets:0 errors:0 dropped:0
>>>>>>                     overruns:0 carrier:0
>>>>>>                     ?????????? collisions:0 txqueuelen:1000
>>>>>>                     ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>>>>                     ?????????? Interrupt:49 Base address:0xe000
>>>>>>
>>>>>>                     lo??????? Link encap:Local Loopback
>>>>>>                     ?????????? inet addr:127.0.0.1 Mask:255.0.0.0
>>>>>>                     ?????????? inet6 addr: ::1/128 Scope:Host
>>>>>>                     ?????????? UP LOOPBACK RUNNING? MTU:65536
>>>>>>                     Metric:1
>>>>>>                     ?????????? RX packets:0 errors:0 dropped:0
>>>>>>                     overruns:0 frame:0
>>>>>>                     ?????????? TX packets:0 errors:0 dropped:0
>>>>>>                     overruns:0 carrier:0
>>>>>>                     ?????????? collisions:0 txqueuelen:1000
>>>>>>                     ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>>>>
>>>>>>                     sit0????? Link encap:IPv6-in-IPv4
>>>>>>                     ?????????? NOARP MTU:1480? Metric:1
>>>>>>                     ?????????? RX packets:0 errors:0 dropped:0
>>>>>>                     overruns:0 frame:0
>>>>>>                     ?????????? TX packets:0 errors:0 dropped:0
>>>>>>                     overruns:0 carrier:0
>>>>>>                     ?????????? collisions:0 txqueuelen:1000
>>>>>>                     ?????????? RX bytes:0 (0.0 B)? TX bytes:0 (0.0 B)
>>>>>>
>>>>>>                     #
>>>>>>
>>>>>>                     As you can see there is no wlan0 interface.
>>>>>>
>>>>>>                     Best
>>>>>>                     Bartek
>>>>>>
>>>>>>
>>>>>>                 _______________________________________________
>>>>>>                 buildroot mailing list
>>>>>>                 buildroot at busybox.net  <mailto:buildroot@busybox.net>
>>>>>>                 http://lists.busybox.net/mailman/listinfo/buildroot
>>>>>
>>>
>>>         _______________________________________________
>>>         buildroot mailing list
>>>         buildroot at busybox.net  <mailto:buildroot@busybox.net>
>>>         http://lists.busybox.net/mailman/listinfo/buildroot
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201012/40660862/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration
  2020-10-12 18:08   ` Bartosz Bilas
@ 2020-10-12 20:11     ` Shlomi Vaknin
  2020-10-13 17:29       ` Bartosz Bilas
  0 siblings, 1 reply; 26+ messages in thread
From: Shlomi Vaknin @ 2020-10-12 20:11 UTC (permalink / raw)
  To: buildroot

Hi Bartek,

??????? ??? ??, 12 ????? 2020 ?-21:08 ??? ?Bartosz Bilas?? <?
b.bilas@grinn-global.com??>:?

> Hi Shlomi,
> On 07.10.2020 16:49, Shlomi Vaknin wrote:
>
> 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 addition, this commit enables gadget support in `linux.config`.
>
> This should be committed as a separate patch because it's not related to
> the trusted configuration at all.
>
> In addition, removing partition-type from genimage.cfg is mandatory,
> since it creates a hybrid MBR partition table which causes ATF to not find ssbl parition.
>
> Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com> <shlomi.39sd@gmail.com>
> ---
>  .../{genimage.cfg => genimage.cfg.template}   |  7 ++-
>  .../common/stm32mp157/post-image.sh           | 43 +++++++++++++++++++
>  .../stm32mp157a-dk1/linux.config              | 24 ++++-------
>  .../stm32mp157c-dk2/linux.config              | 20 ++++-----
>  configs/stm32mp157a_dk1_defconfig             | 14 +++---
>  configs/stm32mp157c_dk2_defconfig             | 14 +++---
>  6 files changed, 78 insertions(+), 44 deletions(-)
>  rename board/stmicroelectronics/common/stm32mp157/{genimage.cfg => genimage.cfg.template} (63%)
>  create mode 100755 board/stmicroelectronics/common/stm32mp157/post-image.sh
>
> diff --git a/board/stmicroelectronics/common/stm32mp157/genimage.cfg b/board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
> similarity index 63%
> rename from board/stmicroelectronics/common/stm32mp157/genimage.cfg
> rename to board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
> index d1ce530cc5..f341c19f2f 100644
> --- a/board/stmicroelectronics/common/stm32mp157/genimage.cfg
> +++ b/board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
> @@ -4,20 +4,19 @@ image sdcard.img {
>  	}
>
>  	partition fsbl1 {
> -		image = "u-boot-spl.stm32"
> +		image = "%ATFBIN%"
>  	}
>
>  	partition fsbl2 {
> -		image = "u-boot-spl.stm32"
> +		image = "%ATFBIN%"
>  	}
>
>  	partition ssbl {
> -		image = "u-boot.img"
> +		image = "u-boot.stm32"
>  	}
>
>  	partition rootfs {
>  		image = "rootfs.ext4"
> -		partition-type = 0x83
>  		bootable = "yes"
>  	}
>  }
> diff --git a/board/stmicroelectronics/common/stm32mp157/post-image.sh b/board/stmicroelectronics/common/stm32mp157/post-image.sh
> new file mode 100755
> index 0000000000..c00a5c6f6c
> --- /dev/null
> +++ b/board/stmicroelectronics/common/stm32mp157/post-image.sh
> @@ -0,0 +1,43 @@
> +#!/usr/bin/env bash
> +
> +#
> +# atf_image extracts the ATF binary image from DTB_FILE_NAME that appears in
> +# BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES in ${BR_CONFIG},
> +# then prints the corresponding file name for the genimage
> +# configuration file
> +#
> +atf_image()
> +{
> +	local ATF_VARIABLES="$(sed -n 's/^BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="\([\/a-zA-Z0-9_=. \-]*\)"$/\1/p' ${BR2_CONFIG})"
> +
> +	if grep -Eq "DTB_FILE_NAME=stm32mp157c-dk2.dtb" <<< ${ATF_VARIABLES}; then
> +		echo "tf-a-stm32mp157c-dk2.stm32"
> +	elif grep -Eq "DTB_FILE_NAME=stm32mp157a-dk1.dtb" <<< ${ATF_VARIABLES}; then
> +                echo "tf-a-stm32mp157a-dk1.stm32"
> +	fi
> +}
> +
> +main()
> +{
> +	local ATFBIN="$(atf_image)"
> +	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
> +	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
> +
> +	sed -e "s/%ATFBIN%/${ATFBIN}/" \
> +		board/stmicroelectronics/common/stm32mp157/genimage.cfg.template > ${GENIMAGE_CFG}
> +
> +	rm -rf "${GENIMAGE_TMP}"
> +
> +	genimage \
> +		--rootpath "${TARGET_DIR}" \
> +		--tmppath "${GENIMAGE_TMP}" \
> +		--inputpath "${BINARIES_DIR}" \
> +		--outputpath "${BINARIES_DIR}" \
> +		--config "${GENIMAGE_CFG}"
> +
> +	rm -f ${GENIMAGE_CFG}
> +
> +	exit $?
> +}
> +
> +main $@
> diff --git a/board/stmicroelectronics/stm32mp157a-dk1/linux.config b/board/stmicroelectronics/stm32mp157a-dk1/linux.config
> index 95c834e431..47729ea97c 100644
> --- a/board/stmicroelectronics/stm32mp157a-dk1/linux.config
> +++ b/board/stmicroelectronics/stm32mp157a-dk1/linux.config
> @@ -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
>
> Are these changes related to the trusted configuration or it's a result of
> resync with newer kernel configuration?
>

The changes are the effect of running linux-update-defconfig after adding
the gadget support. I remember that I looked at some of the variables that
were removed, and found out that they are no longer exist in the kernel.

>
>
diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> index 878a0c39f1..c03eb748b4 100644
> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> @@ -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
>
> same here.
>
> diff --git a/configs/stm32mp157a_dk1_defconfig b/configs/stm32mp157a_dk1_defconfig
> index f172539c02..cdbb5a8cdf 100644
> --- a/configs/stm32mp157a_dk1_defconfig
> +++ b/configs/stm32mp157a_dk1_defconfig
> @@ -2,8 +2,7 @@ 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/common/stm32mp157/genimage.cfg"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
>  BR2_LINUX_KERNEL=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
> @@ -16,15 +15,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
> diff --git a/configs/stm32mp157c_dk2_defconfig b/configs/stm32mp157c_dk2_defconfig
> index 49cfb0733c..6251491e0f 100644
> --- a/configs/stm32mp157c_dk2_defconfig
> +++ b/configs/stm32mp157c_dk2_defconfig
> @@ -2,8 +2,7 @@ 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/common/stm32mp157/genimage.cfg"
> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
>  BR2_LINUX_KERNEL=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>  BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
> @@ -16,15 +15,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
>
> Best
> Bartek
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201012/9e5a455b/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration
  2020-10-12 20:11     ` Shlomi Vaknin
@ 2020-10-13 17:29       ` Bartosz Bilas
  0 siblings, 0 replies; 26+ messages in thread
From: Bartosz Bilas @ 2020-10-13 17:29 UTC (permalink / raw)
  To: buildroot

Hi Shlomi,

On 12.10.2020 22:11, Shlomi Vaknin wrote:
> Hi Bartek,
>
> ??????? ??? ??, 12 ????? 2020 ?-21:08 ??? ?Bartosz Bilas?? 
> <?b.bilas at grinn-global.com <mailto:b.bilas@grinn-global.com>??>:?
>
>     Hi Shlomi,
>
>     On 07.10.2020 16:49, Shlomi Vaknin wrote:
>>     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 addition, this commit enables gadget support in `linux.config`.
>     This should be committed as a separate patch because it's not
>     related to the trusted configuration at all.
>>     In addition, removing partition-type from genimage.cfg is mandatory,
>>     since it creates a hybrid MBR partition table which causes ATF to not find ssbl parition.
>>
>>     Signed-off-by: Shlomi Vaknin<shlomi.39sd@gmail.com>  <mailto:shlomi.39sd@gmail.com>
>>     ---
>>       .../{genimage.cfg => genimage.cfg.template}   |  7 ++-
>>       .../common/stm32mp157/post-image.sh           | 43 +++++++++++++++++++
>>       .../stm32mp157a-dk1/linux.config              | 24 ++++-------
>>       .../stm32mp157c-dk2/linux.config              | 20 ++++-----
>>       configs/stm32mp157a_dk1_defconfig             | 14 +++---
>>       configs/stm32mp157c_dk2_defconfig             | 14 +++---
>>       6 files changed, 78 insertions(+), 44 deletions(-)
>>       rename board/stmicroelectronics/common/stm32mp157/{genimage.cfg => genimage.cfg.template} (63%)
>>       create mode 100755 board/stmicroelectronics/common/stm32mp157/post-image.sh
>>
>>     diff --git a/board/stmicroelectronics/common/stm32mp157/genimage.cfg b/board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
>>     similarity index 63%
>>     rename from board/stmicroelectronics/common/stm32mp157/genimage.cfg
>>     rename to board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
>>     index d1ce530cc5..f341c19f2f 100644
>>     --- a/board/stmicroelectronics/common/stm32mp157/genimage.cfg
>>     +++ b/board/stmicroelectronics/common/stm32mp157/genimage.cfg.template
>>     @@ -4,20 +4,19 @@ image sdcard.img {
>>       	}
>>       
>>       	partition fsbl1 {
>>     -		image = "u-boot-spl.stm32"
>>     +		image = "%ATFBIN%"
>>       	}
>>       
>>       	partition fsbl2 {
>>     -		image = "u-boot-spl.stm32"
>>     +		image = "%ATFBIN%"
>>       	}
>>       
>>       	partition ssbl {
>>     -		image = "u-boot.img"
>>     +		image = "u-boot.stm32"
>>       	}
>>       
>>       	partition rootfs {
>>       		image = "rootfs.ext4"
>>     -		partition-type = 0x83
>>       		bootable = "yes"
>>       	}
>>       }
>>     diff --git a/board/stmicroelectronics/common/stm32mp157/post-image.sh b/board/stmicroelectronics/common/stm32mp157/post-image.sh
>>     new file mode 100755
>>     index 0000000000..c00a5c6f6c
>>     --- /dev/null
>>     +++ b/board/stmicroelectronics/common/stm32mp157/post-image.sh
>>     @@ -0,0 +1,43 @@
>>     +#!/usr/bin/env bash
>>     +
>>     +#
>>     +# atf_image extracts the ATF binary image from DTB_FILE_NAME that appears in
>>     +# BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES in ${BR_CONFIG},
>>     +# then prints the corresponding file name for the genimage
>>     +# configuration file
>>     +#
>>     +atf_image()
>>     +{
>>     +	local ATF_VARIABLES="$(sed -n 's/^BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="\([\/a-zA-Z0-9_=. \-]*\)"$/\1/p' ${BR2_CONFIG})"
>>     +
>>     +	if grep -Eq "DTB_FILE_NAME=stm32mp157c-dk2.dtb" <<< ${ATF_VARIABLES}; then
>>     +		echo "tf-a-stm32mp157c-dk2.stm32"
>>     +	elif grep -Eq "DTB_FILE_NAME=stm32mp157a-dk1.dtb" <<< ${ATF_VARIABLES}; then
>>     +                echo "tf-a-stm32mp157a-dk1.stm32"
>>     +	fi
>>     +}
>>     +
>>     +main()
>>     +{
>>     +	local ATFBIN="$(atf_image)"
>>     +	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
>>     +	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
>>     +
>>     +	sed -e "s/%ATFBIN%/${ATFBIN}/" \
>>     +		board/stmicroelectronics/common/stm32mp157/genimage.cfg.template > ${GENIMAGE_CFG}
>>     +
>>     +	rm -rf "${GENIMAGE_TMP}"
>>     +
>>     +	genimage \
>>     +		--rootpath "${TARGET_DIR}" \
>>     +		--tmppath "${GENIMAGE_TMP}" \
>>     +		--inputpath "${BINARIES_DIR}" \
>>     +		--outputpath "${BINARIES_DIR}" \
>>     +		--config "${GENIMAGE_CFG}"
>>     +
>>     +	rm -f ${GENIMAGE_CFG}
>>     +
>>     +	exit $?
>>     +}
>>     +
>>     +main $@
>>     diff --git a/board/stmicroelectronics/stm32mp157a-dk1/linux.config b/board/stmicroelectronics/stm32mp157a-dk1/linux.config
>>     index 95c834e431..47729ea97c 100644
>>     --- a/board/stmicroelectronics/stm32mp157a-dk1/linux.config
>>     +++ b/board/stmicroelectronics/stm32mp157a-dk1/linux.config
>>     @@ -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
>     Are these changes related to the trusted configuration or it's a
>     result of resync with newer kernel configuration?
>
>
> The changes are the effect of running linux-update-defconfig after 
> adding the gadget support. I remember that I looked at some of the 
> variables that were removed, and found out that they are no longer 
> exist in the kernel.
So this patch shouldn't be within this series because it isn't related 
to trusted configuration ;) Please send a separate patch where you add 
gadget support in the kernel configuration.
>
>>     diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>     index 878a0c39f1..c03eb748b4 100644
>>     --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>     +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
>>     @@ -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
>     same here.
>>     diff --git a/configs/stm32mp157a_dk1_defconfig b/configs/stm32mp157a_dk1_defconfig
>>     index f172539c02..cdbb5a8cdf 100644
>>     --- a/configs/stm32mp157a_dk1_defconfig
>>     +++ b/configs/stm32mp157a_dk1_defconfig
>>     @@ -2,8 +2,7 @@ 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/common/stm32mp157/genimage.cfg"
>>     +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
>>       BR2_LINUX_KERNEL=y
>>       BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>>       BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
>>     @@ -16,15 +15,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
>>     diff --git a/configs/stm32mp157c_dk2_defconfig b/configs/stm32mp157c_dk2_defconfig
>>     index 49cfb0733c..6251491e0f 100644
>>     --- a/configs/stm32mp157c_dk2_defconfig
>>     +++ b/configs/stm32mp157c_dk2_defconfig
>>     @@ -2,8 +2,7 @@ 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/common/stm32mp157/genimage.cfg"
>>     +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/stmicroelectronics/common/stm32mp157/post-image.sh"
>>       BR2_LINUX_KERNEL=y
>>       BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>>       BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.7.10"
>>     @@ -16,15 +15,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
>     Best
>     Bartek
>
Best
Bartek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20201013/b6efc7cc/attachment.html>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format
  2020-10-07 14:49 [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format Shlomi Vaknin
                   ` (2 preceding siblings ...)
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi Shlomi Vaknin
@ 2020-10-14 17:00 ` Thomas Petazzoni
  3 siblings, 0 replies; 26+ messages in thread
From: Thomas Petazzoni @ 2020-10-14 17:00 UTC (permalink / raw)
  To: buildroot

On Wed,  7 Oct 2020 17:49:42 +0300
Shlomi Vaknin <shlomi.39sd@gmail.com> wrote:

> Add `.stm32` binary format that uboot generates for the trusted configuration.
> 
> Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
> ---
>  boot/uboot/Config.in | 4 ++++
>  boot/uboot/uboot.mk  | 5 +++++
>  2 files changed, 9 insertions(+)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration Shlomi Vaknin
  2020-10-12 18:08   ` Bartosz Bilas
@ 2020-10-14 17:02   ` Thomas Petazzoni
  1 sibling, 0 replies; 26+ messages in thread
From: Thomas Petazzoni @ 2020-10-14 17:02 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  7 Oct 2020 17:49:43 +0300
Shlomi Vaknin <shlomi.39sd@gmail.com> wrote:

> 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 addition, this commit enables gadget support in `linux.config`.
> 
> In addition, removing partition-type from genimage.cfg is mandatory,
> since it creates a hybrid MBR partition table which causes ATF to not find ssbl parition.
> 
> Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>

Thanks, I have applied, with some changes. See below.

> +main()
> +{
> +	local ATFBIN="$(atf_image)"
> +	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
> +	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
> +
> +	sed -e "s/%ATFBIN%/${ATFBIN}/" \
> +
> board/stmicroelectronics/common/stm32mp157/genimage.cfg.template >
> ${GENIMAGE_CFG} +
> +	rm -rf "${GENIMAGE_TMP}"
> +
> +	genimage \
> +		--rootpath "${TARGET_DIR}" \
> +		--tmppath "${GENIMAGE_TMP}" \
> +		--inputpath "${BINARIES_DIR}" \
> +		--outputpath "${BINARIES_DIR}" \
> +		--config "${GENIMAGE_CFG}"
> +
> +	rm -f ${GENIMAGE_CFG}
> +
> +	exit $?
> +}

I have replaced the manual call to genimage by a call to
support/scripts/genimage.sh.

> diff --git a/board/stmicroelectronics/stm32mp157a-dk1/linux.config b/board/stmicroelectronics/stm32mp157a-dk1/linux.config
> index 95c834e431..47729ea97c 100644
> --- a/board/stmicroelectronics/stm32mp157a-dk1/linux.config
> +++ b/board/stmicroelectronics/stm32mp157a-dk1/linux.config

I have dropped those changes to the Linux kernel configuration, as they
are not related to the switch to a trusted configuration.

> diff --git a/board/stmicroelectronics/stm32mp157c-dk2/linux.config b/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> index 878a0c39f1..c03eb748b4 100644
> --- a/board/stmicroelectronics/stm32mp157c-dk2/linux.config
> +++ b/board/stmicroelectronics/stm32mp157c-dk2/linux.config

Same.

> +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y

I have changed to used a fixed version of arm-trusted-firmware, i.e
v2.2, so that the defconfig will always use the same configuration
instead of "the latest".

> +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y

Same here.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 3/4] configs/stm32mp157*: bump kernel version
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 3/4] configs/stm32mp157*: bump kernel version Shlomi Vaknin
@ 2020-10-14 17:02   ` Thomas Petazzoni
  0 siblings, 0 replies; 26+ messages in thread
From: Thomas Petazzoni @ 2020-10-14 17:02 UTC (permalink / raw)
  To: buildroot

On Wed,  7 Oct 2020 17:49:44 +0300
Shlomi Vaknin <shlomi.39sd@gmail.com> wrote:

> Since kernel 5.7 is EOL now, this upgrades it to version 5.8.13.
> 
> Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
> ---
>  configs/stm32mp157a_dk1_defconfig | 4 ++--
>  configs/stm32mp157c_dk2_defconfig | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi Shlomi Vaknin
       [not found]   ` <15798cdd-e335-a291-53d4-1ac03d1bbd6c@grinn-global.com>
@ 2020-10-14 17:02   ` Thomas Petazzoni
  2020-11-01 11:08   ` Sergey Matyukevich
  2 siblings, 0 replies; 26+ messages in thread
From: Thomas Petazzoni @ 2020-10-14 17:02 UTC (permalink / raw)
  To: buildroot

On Wed,  7 Oct 2020 17:49:45 +0300
Shlomi Vaknin <shlomi.39sd@gmail.com> wrote:

> 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 was added.
> This was copied from the yocto bsp layer of st.
> 
> Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
> ---
>  .../stm32mp157c-dk2/linux.config              |  4 +-
>  .../overlay/boot/extlinux/extlinux.conf       |  2 +-
>  .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59 +++++++++++++++++++
>  .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
>  configs/stm32mp157c_dk2_defconfig             |  7 ++-
>  5 files changed, 100 insertions(+), 4 deletions(-)
>  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

Since there are still some issues apparently with this patch, I marked
it as Changes Requested.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi
  2020-10-07 14:49 ` [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi Shlomi Vaknin
       [not found]   ` <15798cdd-e335-a291-53d4-1ac03d1bbd6c@grinn-global.com>
  2020-10-14 17:02   ` Thomas Petazzoni
@ 2020-11-01 11:08   ` Sergey Matyukevich
  2 siblings, 0 replies; 26+ messages in thread
From: Sergey Matyukevich @ 2020-11-01 11:08 UTC (permalink / raw)
  To: buildroot

Hello,

> 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 was added.
> This was copied from the yocto bsp layer of st.
> 
> Signed-off-by: Shlomi Vaknin <shlomi.39sd@gmail.com>
> ---
>  .../stm32mp157c-dk2/linux.config              |  4 +-
>  .../overlay/boot/extlinux/extlinux.conf       |  2 +-
>  .../brcmfmac43430-sdio.st,stm32mp157c-dk2.txt | 59 +++++++++++++++++++
>  .../stm32mp157c-dk2/stm32mp157c-dk2-wifi.dts  | 32 ++++++++++
>  configs/stm32mp157c_dk2_defconfig             |  7 ++-
>  5 files changed, 100 insertions(+), 4 deletions(-)
>  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

I would suggest to add a kernel patch for stm32mp157c-dk2 dts file
instead of adding custom dts directly. This way no need to modify
extlinux.conf. Besides, patch will be easy to drop as soon as wifi
support is mainlined.


As for WiFi on stm32mp157c-dk2, I have the same problems as mentioned
earlier in this email thread. Firmware is loaded, but times out later on

[8.083508] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
clkctl 0x50
[9.130954] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000):
clkctl 0x50

I tried both linux-firmware and murata firmware package. None of them
makes wifi work on my board.

Regards,
Sergey

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2020-11-01 11:08 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07 14:49 [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format Shlomi Vaknin
2020-10-07 14:49 ` [Buildroot] [PATCH v3 2/4] configs/stm32mp157*: use trusted configuration Shlomi Vaknin
2020-10-12 18:08   ` Bartosz Bilas
2020-10-12 20:11     ` Shlomi Vaknin
2020-10-13 17:29       ` Bartosz Bilas
2020-10-14 17:02   ` Thomas Petazzoni
2020-10-07 14:49 ` [Buildroot] [PATCH v3 3/4] configs/stm32mp157*: bump kernel version Shlomi Vaknin
2020-10-14 17:02   ` Thomas Petazzoni
2020-10-07 14:49 ` [Buildroot] [PATCH v3 4/4] configs/stm32mp157c-dk2: add support for wifi Shlomi Vaknin
     [not found]   ` <15798cdd-e335-a291-53d4-1ac03d1bbd6c@grinn-global.com>
2020-10-07 19:27     ` Bartosz Bilas
2020-10-07 20:16       ` Shlomi Vaknin
2020-10-08 17:31         ` Bartosz Bilas
2020-10-08 20:45           ` Shlomi Vaknin
2020-10-09 16:49             ` Bartosz Bilas
2020-10-09 19:13               ` Shlomi Vaknin
2020-10-10 15:41                 ` Bartosz Bilas
2020-10-10 18:08                   ` Shlomi Vaknin
2020-10-10 18:59                     ` Shlomi Vaknin
2020-10-10 19:01                   ` Bartosz Bilas
2020-10-10 20:48                     ` Shlomi Vaknin
2020-10-12 14:49                       ` Bartosz Bilas
2020-10-12 17:35                         ` Shlomi Vaknin
2020-10-12 18:15                           ` Bartosz Bilas
2020-10-14 17:02   ` Thomas Petazzoni
2020-11-01 11:08   ` Sergey Matyukevich
2020-10-14 17:00 ` [Buildroot] [PATCH v3 1/4] boot/uboot: add stm32 binary format Thomas Petazzoni

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.