[PATCH v1 00/25] stm32mp: Fix keys & leds management

Adding FASTBOOT support for stm32mp13 shows issues when entering in fastboot mode using a dedicated key. On several STM32MP boards, same gpio is shared between key and led. Restore the fastboot/stm32prog activation using a dedicated key. Restore the led-blue which indicates U-Boot entering / exit. Make usage of BUTTON-UCLASS for key management on STM32MP1.
Patrice Chotard (25): configs: stm32mp13: Enable FASTBOOT configs: stm32mp1: Enable BUTTON_GPIO flag for stm32mp15_defconfig configs: stm32mp1: Enable BUTTON_GPIO flag for stm32mp15_basic_defconfig configs: stm32mp1: Enable BUTTON_GPIO flag for stm32mp15_trusted_defconfig configs: stm32mp1: Enable BUTTON_GPIO flag for stm32mp13_defconfig board: st: stmp32mp1: Use BUTTON UCLASS in board_key_check() ARM: dts: stm32: Add gpio-keys for stm32mp135f-dk-u-boot ARM: dts: stm32: Don't probe led-red/led-blue at boot for stm32mp135f-dk-u-boot ARM: dts: stm32: Clean led-red node for stm32mp135f-dk-u-boot ARM: dts: stm32: Add gpio-keys for stm32mp157a-dk1-scmi-u-boot ARM: dts: stm32: Don't probe red led at boot for stm32mp157a-dk1-scmi-u-boot ARM: dts: stm32: Update red led node for stm32mp157a-dk1-scmi-u-boot ARM: dts: stm32: Add led-blue for stm32mp157a-dk1-scmi-u-boot ARM: dts: stm32: Add gpio-keys for stm32mp157a-dk1-u-boot ARM: dts: stm32: Don't probe red led at boot for stm32mp157a-dk1-u-boot ARM: dts: stm32: Update red led node for stm32mp157a-dk1-u-boot ARM: dts: stm32: Update u-boot,boot-led for stm32mp157a-dk1-u-boot ARM: dts: stm32: Add gpio-keys for stm32mp157c-ed1-u-boot ARM: dts: stm32: Don't probe red led at boot for stm32mp157c-ed1-u-boot ARM: dts: stm32: Update red led node for stm32mp157c-ed1-u-boot ARM: dts: stm32: Add led-blue for stm32mp157c-ed1-u-boot ARM: dts: stm32: Add gpio-keys for stm32mp157c-ed1-scmi-u-boot ARM: dts: stm32: Don't probe red led at boot for stm32mp157c-ed1-scmi-u-boot ARM: dts: stm32: Update red led node for stm32mp157c-ed1-scmi-u-boot ARM: dts: stm32: Add led-blue for stm32mp157c-ed1-scmi-u-boot
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 19 +++++- arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 32 ++++++--- arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 32 ++++++--- arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 34 +++++++--- arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 34 +++++++--- board/st/stm32mp1/stm32mp1.c | 68 +++++++++++-------- configs/stm32mp13_defconfig | 11 ++- configs/stm32mp15_basic_defconfig | 2 + configs/stm32mp15_defconfig | 2 + configs/stm32mp15_trusted_defconfig | 2 + 10 files changed, 173 insertions(+), 63 deletions(-)

Enable FASTBOOT relative flags for stm32mp13_defconfig.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
---
configs/stm32mp13_defconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index c893e272db9..db09e63100e 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -15,6 +15,7 @@ CONFIG_CMD_STM32PROG=y CONFIG_SYS_LOAD_ADDR=0xc2000000 CONFIG_SYS_MEMTEST_START=0xc0000000 CONFIG_SYS_MEMTEST_END=0xc4000000 +# CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_FIT=y CONFIG_SYS_BOOTM_LEN=0x2000000 CONFIG_DISTRO_DEFAULTS=y @@ -53,6 +54,13 @@ CONFIG_SYS_MMC_ENV_DEV=-1 CONFIG_ENV_MMC_USE_DT=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0xc0000000 +CONFIG_FASTBOOT_BUF_SIZE=0x02000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_FASTBOOT_CMD_OEM_FORMAT=y +CONFIG_FASTBOOT_CMD_OEM_PARTCONF=y CONFIG_GPIO_HOG=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_STM32F7=y @@ -92,7 +100,6 @@ CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics" CONFIG_USB_GADGET_VENDOR_NUM=0x0483 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720 CONFIG_USB_GADGET_DWC2_OTG=y -CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_ERRNO_STR=y # CONFIG_LMB_USE_MAX_REGIONS is not set CONFIG_LMB_MEMORY_REGIONS=2

Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Enable FASTBOOT relative flags for stm32mp13_defconfig.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp13_defconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On Tue, Apr 9, 2024 at 5:19 PM Patrice Chotard patrice.chotard@foss.st.com wrote:
Enable FASTBOOT relative flags for stm32mp13_defconfig.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp13_defconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index c893e272db9..db09e63100e 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -15,6 +15,7 @@ CONFIG_CMD_STM32PROG=y CONFIG_SYS_LOAD_ADDR=0xc2000000 CONFIG_SYS_MEMTEST_START=0xc0000000 CONFIG_SYS_MEMTEST_END=0xc4000000 +# CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_FIT=y CONFIG_SYS_BOOTM_LEN=0x2000000 CONFIG_DISTRO_DEFAULTS=y @@ -53,6 +54,13 @@ CONFIG_SYS_MMC_ENV_DEV=-1 CONFIG_ENV_MMC_USE_DT=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0xc0000000 +CONFIG_FASTBOOT_BUF_SIZE=0x02000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_FASTBOOT_CMD_OEM_FORMAT=y +CONFIG_FASTBOOT_CMD_OEM_PARTCONF=y CONFIG_GPIO_HOG=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_STM32F7=y @@ -92,7 +100,6 @@ CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics" CONFIG_USB_GADGET_VENDOR_NUM=0x0483 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720 CONFIG_USB_GADGET_DWC2_OTG=y -CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_ERRNO_STR=y # CONFIG_LMB_USE_MAX_REGIONS is not set CONFIG_LMB_MEMORY_REGIONS=2 -- 2.25.1
Reviewed-by: Igor Opaniuk igor.opaniuk@gmail.com

On 4/18/24 13:48, Igor Opaniuk wrote:
On Tue, Apr 9, 2024 at 5:19 PM Patrice Chotard patrice.chotard@foss.st.com wrote:
Enable FASTBOOT relative flags for stm32mp13_defconfig.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp13_defconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index c893e272db9..db09e63100e 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -15,6 +15,7 @@ CONFIG_CMD_STM32PROG=y CONFIG_SYS_LOAD_ADDR=0xc2000000 CONFIG_SYS_MEMTEST_START=0xc0000000 CONFIG_SYS_MEMTEST_END=0xc4000000 +# CONFIG_ANDROID_BOOT_IMAGE is not set CONFIG_FIT=y CONFIG_SYS_BOOTM_LEN=0x2000000 CONFIG_DISTRO_DEFAULTS=y @@ -53,6 +54,13 @@ CONFIG_SYS_MMC_ENV_DEV=-1 CONFIG_ENV_MMC_USE_DT=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0xc0000000 +CONFIG_FASTBOOT_BUF_SIZE=0x02000000 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_FASTBOOT_CMD_OEM_FORMAT=y +CONFIG_FASTBOOT_CMD_OEM_PARTCONF=y CONFIG_GPIO_HOG=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_STM32F7=y @@ -92,7 +100,6 @@ CONFIG_USB_GADGET_MANUFACTURER="STMicroelectronics" CONFIG_USB_GADGET_VENDOR_NUM=0x0483 CONFIG_USB_GADGET_PRODUCT_NUM=0x5720 CONFIG_USB_GADGET_DWC2_OTG=y -CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_ERRNO_STR=y # CONFIG_LMB_USE_MAX_REGIONS is not set CONFIG_LMB_MEMORY_REGIONS=2 -- 2.25.1
Reviewed-by: Igor Opaniuk igor.opaniuk@gmail.com
Applied on u-boot-stm32/master

Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
configs/stm32mp15_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig index 3302b306996..ffe7512650e 100644 --- a/configs/stm32mp15_defconfig +++ b/configs/stm32mp15_defconfig @@ -69,6 +69,8 @@ CONFIG_TFTP_TSIZE=y CONFIG_USE_SERVERIP=y CONFIG_SERVERIP="192.168.1.1" CONFIG_STM32_ADC=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y

Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp15_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig index 3302b306996..ffe7512650e 100644 --- a/configs/stm32mp15_defconfig +++ b/configs/stm32mp15_defconfig @@ -69,6 +69,8 @@ CONFIG_TFTP_TSIZE=y CONFIG_USE_SERVERIP=y CONFIG_SERVERIP="192.168.1.1" CONFIG_STM32_ADC=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:03, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp15_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp15_defconfig b/configs/stm32mp15_defconfig index 3302b306996..ffe7512650e 100644 --- a/configs/stm32mp15_defconfig +++ b/configs/stm32mp15_defconfig @@ -69,6 +69,8 @@ CONFIG_TFTP_TSIZE=y CONFIG_USE_SERVERIP=y CONFIG_SERVERIP="192.168.1.1" CONFIG_STM32_ADC=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
configs/stm32mp15_basic_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index 005f1d55f80..2e22bf86000 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -97,6 +97,8 @@ CONFIG_TFTP_TSIZE=y CONFIG_USE_SERVERIP=y CONFIG_SERVERIP="192.168.1.1" CONFIG_STM32_ADC=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0xC0000000

Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp15_basic_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index 005f1d55f80..2e22bf86000 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -97,6 +97,8 @@ CONFIG_TFTP_TSIZE=y CONFIG_USE_SERVERIP=y CONFIG_SERVERIP="192.168.1.1" CONFIG_STM32_ADC=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:04, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp15_basic_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp15_basic_defconfig b/configs/stm32mp15_basic_defconfig index 005f1d55f80..2e22bf86000 100644 --- a/configs/stm32mp15_basic_defconfig +++ b/configs/stm32mp15_basic_defconfig @@ -97,6 +97,8 @@ CONFIG_TFTP_TSIZE=y CONFIG_USE_SERVERIP=y CONFIG_SERVERIP="192.168.1.1" CONFIG_STM32_ADC=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_FASTBOOT_BUF_ADDR=0xC0000000
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
configs/stm32mp15_trusted_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index 84b0854b557..74deaaba2e4 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -70,6 +70,8 @@ CONFIG_TFTP_TSIZE=y CONFIG_USE_SERVERIP=y CONFIG_SERVERIP="192.168.1.1" CONFIG_STM32_ADC=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y

Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp15_trusted_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index 84b0854b557..74deaaba2e4 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -70,6 +70,8 @@ CONFIG_TFTP_TSIZE=y CONFIG_USE_SERVERIP=y CONFIG_SERVERIP="192.168.1.1" CONFIG_STM32_ADC=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:04, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp15_trusted_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp15_trusted_defconfig b/configs/stm32mp15_trusted_defconfig index 84b0854b557..74deaaba2e4 100644 --- a/configs/stm32mp15_trusted_defconfig +++ b/configs/stm32mp15_trusted_defconfig @@ -70,6 +70,8 @@ CONFIG_TFTP_TSIZE=y CONFIG_USE_SERVERIP=y CONFIG_SERVERIP="192.168.1.1" CONFIG_STM32_ADC=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
configs/stm32mp13_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index db09e63100e..caaabf39ef3 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -52,6 +52,8 @@ CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_DEV=-1 CONFIG_ENV_MMC_USE_DT=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y

Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp13_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index db09e63100e..caaabf39ef3 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -52,6 +52,8 @@ CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_DEV=-1 CONFIG_ENV_MMC_USE_DT=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On Tue, Apr 9, 2024 at 5:05 PM Patrice Chotard patrice.chotard@foss.st.com wrote:
Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp13_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index db09e63100e..caaabf39ef3 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -52,6 +52,8 @@ CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_DEV=-1 CONFIG_ENV_MMC_USE_DT=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y -- 2.25.1
Reviewed-by: Igor Opaniuk igor.opaniuk@gmail.com

On 4/18/24 13:48, Igor Opaniuk wrote:
On Tue, Apr 9, 2024 at 5:05 PM Patrice Chotard patrice.chotard@foss.st.com wrote:
Enable BUTTON_GPIO flag for STM32MP15.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
configs/stm32mp13_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/stm32mp13_defconfig b/configs/stm32mp13_defconfig index db09e63100e..caaabf39ef3 100644 --- a/configs/stm32mp13_defconfig +++ b/configs/stm32mp13_defconfig @@ -52,6 +52,8 @@ CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_DEV=-1 CONFIG_ENV_MMC_USE_DT=y +CONFIG_BUTTON=y +CONFIG_BUTTON_GPIO=y CONFIG_CLK_SCMI=y CONFIG_SET_DFU_ALT_INFO=y CONFIG_USB_FUNCTION_FASTBOOT=y -- 2.25.1
Reviewed-by: Igor Opaniuk igor.opaniuk@gmail.com
Applied on u-boot-stm32/master

Instead of using gpio directly to detect key pressed on button dedicated for fastboot and stm32mprog, make usage of BUTTON UCLASS.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
board/st/stm32mp1/stm32mp1.c | 68 +++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 28 deletions(-)
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index a17c314daeb..82f7d4ff4ea 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -8,6 +8,7 @@ #include <common.h> #include <adc.h> #include <bootm.h> +#include <button.h> #include <clk.h> #include <config.h> #include <dm.h> @@ -38,6 +39,7 @@ #include <asm/gpio.h> #include <asm/arch/stm32.h> #include <asm/arch/sys_proto.h> +#include <dm/device-internal.h> #include <dm/ofnode.h> #include <jffs2/load_kernel.h> #include <linux/bitops.h> @@ -150,45 +152,55 @@ int checkboard(void)
static void board_key_check(void) { - ofnode node; - struct gpio_desc gpio; + struct udevice *button1 = NULL, *button2 = NULL; enum forced_boot_mode boot_mode = BOOT_NORMAL; + int ret; + + if (!IS_ENABLED(CONFIG_BUTTON)) + return;
if (!IS_ENABLED(CONFIG_FASTBOOT) && !IS_ENABLED(CONFIG_CMD_STM32PROG)) return;
- node = ofnode_path("/config"); - if (!ofnode_valid(node)) { - log_debug("no /config node?\n"); + if (IS_ENABLED(CONFIG_CMD_STM32PROG)) + button_get_by_label("User-1", &button1); + + if (IS_ENABLED(CONFIG_FASTBOOT)) + button_get_by_label("User-2", &button2); + + if (!button1 && !button2) return; - } - if (IS_ENABLED(CONFIG_FASTBOOT)) { - if (gpio_request_by_name_nodev(node, "st,fastboot-gpios", 0, - &gpio, GPIOD_IS_IN)) { - log_debug("could not find a /config/st,fastboot-gpios\n"); - } else { - udelay(20); - if (dm_gpio_get_value(&gpio)) { - log_notice("Fastboot key pressed, "); - boot_mode = BOOT_FASTBOOT; - }
- dm_gpio_free(NULL, &gpio); + if (button2) { + if (button_get_state(button2) == BUTTON_ON) { + log_notice("Fastboot key pressed, "); + boot_mode = BOOT_FASTBOOT; } + /* + * On some boards, same gpio is shared betwwen gpio-keys and + * leds, remove the button device to free the gpio for led + * usage + */ + ret = device_remove(button2, DM_REMOVE_NORMAL); + if (ret) + log_err("Can't remove button2 (%d)\n", ret); } - if (IS_ENABLED(CONFIG_CMD_STM32PROG)) { - if (gpio_request_by_name_nodev(node, "st,stm32prog-gpios", 0, - &gpio, GPIOD_IS_IN)) { - log_debug("could not find a /config/st,stm32prog-gpios\n"); - } else { - udelay(20); - if (dm_gpio_get_value(&gpio)) { - log_notice("STM32Programmer key pressed, "); - boot_mode = BOOT_STM32PROG; - } - dm_gpio_free(NULL, &gpio); + + if (button1) { + if (button_get_state(button1) == BUTTON_ON) { + log_notice("STM32Programmer key pressed, "); + boot_mode = BOOT_STM32PROG; } + /* + * On some boards, same gpio is shared betwwen gpio-keys and + * leds, remove the button device to free the gpio for led + * usage + */ + ret = device_remove(button1, DM_REMOVE_NORMAL); + if (ret) + log_err("Can't remove button1 (%d)\n", ret); } + if (boot_mode != BOOT_NORMAL) { log_notice("entering download mode...\n"); clrsetbits_le32(TAMP_BOOT_CONTEXT,

Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Instead of using gpio directly to detect key pressed on button dedicated for fastboot and stm32mprog, make usage of BUTTON UCLASS.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
board/st/stm32mp1/stm32mp1.c | 68 +++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 28 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:05, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Instead of using gpio directly to detect key pressed on button dedicated for fastboot and stm32mprog, make usage of BUTTON UCLASS.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
board/st/stm32mp1/stm32mp1.c | 68 +++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 28 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

Add 2 gpio-keys : _ button-user-1 for stm32prog mode activation. _ update button-user's label (defined in kernel DT) to match label requested in board_key_check() for fastboot mode activation.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi index ba0c02489d1..e64ded13462 100644 --- a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi +++ b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi @@ -16,6 +16,19 @@ u-boot,mmc-env-partition = "u-boot-env"; };
+ gpio-keys { + button-user-1 { + label = "User-1"; + linux,code = <BTN_2>; + gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + + button-user { + /* update label to match the label requested in board_key_check() */ + label = "User-2"; + }; + }; + leds { led-red { color = <LED_COLOR_ID_RED>;

Hi
On 4/9/24 17:01, Patrice Chotard wrote:
Add 2 gpio-keys : _ button-user-1 for stm32prog mode activation. _ update button-user's label (defined in kernel DT) to match label requested in board_key_check() for fastboot mode activation.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:06, Patrick DELAUNAY wrote:
Hi
On 4/9/24 17:01, Patrice Chotard wrote:
Add 2 gpio-keys : _ button-user-1 for stm32prog mode activation. _ update button-user's label (defined in kernel DT) to match label requested in board_key_check() for fastboot mode activation.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

led-red and button dedicated to fastboot share the same gpio GPIOA13. led-blue and button dedicated to stm32prog share the same gpio GPIOA14. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from led-red and led-blue led's node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi index e64ded13462..8f42735609a 100644 --- a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi +++ b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi @@ -30,10 +30,13 @@ };
leds { + led-blue { + /delete-property/default-state; + }; + led-red { color = <LED_COLOR_ID_RED>; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - default-state = "off"; }; }; };

Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
led-red and button dedicated to fastboot share the same gpio GPIOA13. led-blue and button dedicated to stm32prog share the same gpio GPIOA14. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from led-red and led-blue led's node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:06, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
led-red and button dedicated to fastboot share the same gpio GPIOA13. led-blue and button dedicated to stm32prog share the same gpio GPIOA14. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from led-red and led-blue led's node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

Remove "color" property from led-red node which is not supported by U-Boot.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi index 8f42735609a..f004e9840a2 100644 --- a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi +++ b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi @@ -35,7 +35,6 @@ };
led-red { - color = <LED_COLOR_ID_RED>; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; }; };

Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Remove "color" property from led-red node which is not supported by U-Boot.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi index 8f42735609a..f004e9840a2 100644 --- a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi +++ b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi @@ -35,7 +35,6 @@ };
led-red {
}; };color = <LED_COLOR_ID_RED>; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:07, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:01, Patrice Chotard wrote:
Remove "color" property from led-red node which is not supported by U-Boot.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp135f-dk-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi index 8f42735609a..f004e9840a2 100644 --- a/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi +++ b/arch/arm/dts/stm32mp135f-dk-u-boot.dtsi @@ -35,7 +35,6 @@ }; led-red { - color = <LED_COLOR_ID_RED>; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; }; };
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

Instead of using "st,fastboot-gpios" and "st,stm32prog-gpios", declare 2 gpio-keys.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index 20728f27ee1..5d49b09c35d 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -3,6 +3,7 @@ * Copyright : STMicroelectronics 2022 */
+#include <dt-bindings/input/linux-event-codes.h> #include "stm32mp15-scmi-u-boot.dtsi"
/ { @@ -16,8 +17,22 @@ u-boot,error-led = "error"; u-boot,mmc-env-partition = "u-boot-env"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; - st,fastboot-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; - st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-user-1 { + label = "User-1"; + linux,code = <BTN_1>; + gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + + button-user-2 { + label = "User-2"; + linux,code = <BTN_2>; + gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; };
led {

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
Instead of using "st,fastboot-gpios" and "st,stm32prog-gpios", declare 2 gpio-keys.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index 20728f27ee1..5d49b09c35d 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -3,6 +3,7 @@
- Copyright : STMicroelectronics 2022
*/
+#include <dt-bindings/input/linux-event-codes.h> #include "stm32mp15-scmi-u-boot.dtsi"
/ { @@ -16,8 +17,22 @@ u-boot,error-led = "error"; u-boot,mmc-env-partition = "u-boot-env"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>;
st,fastboot-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
gpio-keys {
compatible = "gpio-keys";
button-user-1 {
label = "User-1";
linux,code = <BTN_1>;
gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
button-user-2 {
label = "User-2";
linux,code = <BTN_2>;
gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
};
led {
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:07, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
Instead of using "st,fastboot-gpios" and "st,stm32prog-gpios", declare 2 gpio-keys.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index 20728f27ee1..5d49b09c35d 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -3,6 +3,7 @@ * Copyright : STMicroelectronics 2022 */ +#include <dt-bindings/input/linux-event-codes.h> #include "stm32mp15-scmi-u-boot.dtsi" / { @@ -16,8 +17,22 @@ u-boot,error-led = "error"; u-boot,mmc-env-partition = "u-boot-env"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; - st,fastboot-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; - st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + };
+ gpio-keys { + compatible = "gpio-keys";
+ button-user-1 { + label = "User-1"; + linux,code = <BTN_1>; + gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + };
+ button-user-2 { + label = "User-2"; + linux,code = <BTN_2>; + gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; }; led {
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index 5d49b09c35d..8760d6c7d93 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -39,7 +39,6 @@ red { label = "error"; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - default-state = "off"; status = "okay"; }; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index 5d49b09c35d..8760d6c7d93 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -39,7 +39,6 @@ red { label = "error"; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
}; };default-state = "off"; status = "okay";
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:07, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index 5d49b09c35d..8760d6c7d93 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -39,7 +39,6 @@ red { label = "error"; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - default-state = "off"; status = "okay"; }; };
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use red led node's name instead for u-boot,error-led property. Rename "red" led node's name to "led-red". Remove status property which is useless.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index 8760d6c7d93..e61814fd66e 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -14,7 +14,7 @@
config { u-boot,boot-led = "heartbeat"; - u-boot,error-led = "error"; + u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "u-boot-env"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; }; @@ -36,10 +36,8 @@ };
led { - red { - label = "error"; + led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - status = "okay"; }; }; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use red led node's name instead for u-boot,error-led property. Rename "red" led node's name to "led-red". Remove status property which is useless.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index 8760d6c7d93..e61814fd66e 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -14,7 +14,7 @@
config { u-boot,boot-led = "heartbeat";
u-boot,error-led = "error";
u-boot,mmc-env-partition = "u-boot-env"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; };u-boot,error-led = "led-red";
@@ -36,10 +36,8 @@ };
led {
red {
label = "error";
led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
}; }; };status = "okay";
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:08, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use red led node's name instead for u-boot,error-led property. Rename "red" led node's name to "led-red". Remove status property which is useless.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index 8760d6c7d93..e61814fd66e 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -14,7 +14,7 @@ config { u-boot,boot-led = "heartbeat"; - u-boot,error-led = "error"; + u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "u-boot-env"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; }; @@ -36,10 +36,8 @@ }; led { - red { - label = "error"; + led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - status = "okay"; }; }; };
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use blue led node's name instead for u-boot,boot-led property.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index e61814fd66e..a5158fec7ef 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -13,7 +13,7 @@ };
config { - u-boot,boot-led = "heartbeat"; + u-boot,boot-led = "led-blue"; u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "u-boot-env"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; @@ -36,6 +36,10 @@ };
led { + led-blue { + /delete-property/label; + }; + led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use blue led node's name instead for u-boot,boot-led property.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index e61814fd66e..a5158fec7ef 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -13,7 +13,7 @@ };
config {
u-boot,boot-led = "heartbeat";
u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "u-boot-env"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>;u-boot,boot-led = "led-blue";
@@ -36,6 +36,10 @@ };
led {
led-blue {
/delete-property/label;
};
- led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; };
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:09, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use blue led node's name instead for u-boot,boot-led property.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi index e61814fd66e..a5158fec7ef 100644 --- a/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-scmi-u-boot.dtsi @@ -13,7 +13,7 @@ }; config { - u-boot,boot-led = "heartbeat"; + u-boot,boot-led = "led-blue"; u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "u-boot-env"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; @@ -36,6 +36,10 @@ }; led { + led-blue { + /delete-property/label; + };
led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; };
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

Instead of using "st,fastboot-gpios" and "st,stm32prog-gpios", declare 2 gpio-keys.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi index a16358266a2..6bf6136c5fd 100644 --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include <dt-bindings/clock/stm32mp1-clksrc.h> +#include <dt-bindings/input/linux-event-codes.h> #include "stm32mp15-u-boot.dtsi" #include "stm32mp15-ddr3-1x4Gb-1066-binG.dtsi"
@@ -18,8 +19,6 @@ u-boot,error-led = "error"; u-boot,mmc-env-partition = "fip"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; - st,fastboot-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; - st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; };
#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL) @@ -48,6 +47,22 @@ }; #endif
+ gpio-keys { + compatible = "gpio-keys"; + + button-user-1 { + label = "User-1"; + linux,code = <BTN_1>; + gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + + button-user-2 { + label = "User-2"; + linux,code = <BTN_2>; + gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + }; + led { red { label = "error";

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
Instead of using "st,fastboot-gpios" and "st,stm32prog-gpios", declare 2 gpio-keys.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:09, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
Instead of using "st,fastboot-gpios" and "st,stm32prog-gpios", declare 2 gpio-keys.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi index 6bf6136c5fd..ee9b51d42b7 100644 --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi @@ -67,7 +67,6 @@ red { label = "error"; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - default-state = "off"; status = "okay"; }; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi index 6bf6136c5fd..ee9b51d42b7 100644 --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi @@ -67,7 +67,6 @@ red { label = "error"; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
}; };default-state = "off"; status = "okay";
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:09, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi index 6bf6136c5fd..ee9b51d42b7 100644 --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi @@ -67,7 +67,6 @@ red { label = "error"; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - default-state = "off"; status = "okay"; }; };
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use red led node's name instead for u-boot,error-led property. Rename red led node's name to led-red. Remove status property which is useless.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi index ee9b51d42b7..92153b2a657 100644 --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi @@ -16,7 +16,7 @@
config { u-boot,boot-led = "heartbeat"; - u-boot,error-led = "error"; + u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "fip"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; }; @@ -64,10 +64,8 @@ };
led { - red { - label = "error"; + led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - status = "okay"; }; }; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use red led node's name instead for u-boot,error-led property. Rename red led node's name to led-red. Remove status property which is useless.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:10, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use red led node's name instead for u-boot,error-led property. Rename red led node's name to led-red. Remove status property which is useless.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use blue led node's name instead for u-boot,boot-led property.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi index 92153b2a657..f97debaa0e4 100644 --- a/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi @@ -15,7 +15,7 @@ };
config { - u-boot,boot-led = "heartbeat"; + u-boot,boot-led = "led-blue"; u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "fip"; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; @@ -64,6 +64,10 @@ };
led { + led-blue { + /delete-property/label; + }; + led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use blue led node's name instead for u-boot,boot-led property.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:10, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use blue led node's name instead for u-boot,boot-led property.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

Add 2 gpio-keys : _ button-user-1 for stm32prog mode activation. _ button-user-2 for fastboot mode activation.
Remove proprietary st,fastboot-gpios and st,stm32prog-gpios.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi index ef91088aa37..e6a452c9d8e 100644 --- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi @@ -4,6 +4,7 @@ */
#include <dt-bindings/clock/stm32mp1-clksrc.h> +#include <dt-bindings/input/linux-event-codes.h> #include "stm32mp15-u-boot.dtsi" #include "stm32mp15-ddr3-2x4Gb-1066-binG.dtsi"
@@ -16,8 +17,6 @@ u-boot,boot-led = "heartbeat"; u-boot,error-led = "error"; u-boot,mmc-env-partition = "fip"; - st,fastboot-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; - st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; };
#if defined(CONFIG_STM32MP15X_STM32IMAGE) || defined(CONFIG_SPL) @@ -43,6 +42,22 @@ }; #endif
+ gpio-keys { + compatible = "gpio-keys"; + + button-user-1 { + label = "User-1"; + linux,code = <BTN_1>; + gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + + button-user-2 { + label = "User-2"; + linux,code = <BTN_2>; + gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + }; + led { red { label = "error";

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
Add 2 gpio-keys : _ button-user-1 for stm32prog mode activation. _ button-user-2 for fastboot mode activation.
Remove proprietary st,fastboot-gpios and st,stm32prog-gpios.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:11, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
Add 2 gpio-keys : _ button-user-1 for stm32prog mode activation. _ button-user-2 for fastboot mode activation.
Remove proprietary st,fastboot-gpios and st,stm32prog-gpios.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi index e6a452c9d8e..edcbfee0fc7 100644 --- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi @@ -62,7 +62,6 @@ red { label = "error"; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - default-state = "off"; status = "okay"; }; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:11, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use led node's name instead for u-boot,error-led property. Rename red led node's name to led-red. Remove status property which is useless. Add compatible = "gpio-leds" which is not present in kernel DT.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi index edcbfee0fc7..09cfe9bc246 100644 --- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi @@ -15,7 +15,7 @@
config { u-boot,boot-led = "heartbeat"; - u-boot,error-led = "error"; + u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "fip"; };
@@ -59,10 +59,10 @@ };
led { - red { - label = "error"; + compatible = "gpio-leds"; + + led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - status = "okay"; }; }; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use led node's name instead for u-boot,error-led property. Rename red led node's name to led-red. Remove status property which is useless. Add compatible = "gpio-leds" which is not present in kernel DT.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:11, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use led node's name instead for u-boot,error-led property. Rename red led node's name to led-red. Remove status property which is useless. Add compatible = "gpio-leds" which is not present in kernel DT.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

The blue led is used to indicate U-Boot entering / exit indication then Linux heartbeat.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi index 09cfe9bc246..d93359f967c 100644 --- a/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi @@ -14,7 +14,7 @@ };
config { - u-boot,boot-led = "heartbeat"; + u-boot,boot-led = "led-blue"; u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "fip"; }; @@ -61,6 +61,10 @@ led { compatible = "gpio-leds";
+ led-blue { + gpios = <&gpiod 9 GPIO_ACTIVE_HIGH>; + }; + led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
The blue led is used to indicate U-Boot entering / exit indication then Linux heartbeat.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:11, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
The blue led is used to indicate U-Boot entering / exit indication then Linux heartbeat.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

Add 2 gpio-keys : _ button-user-1 for stm32prog mode activation. _ button-user-2 for fastboot mode activation.
Remove proprietary st,fastboot-gpios and st,stm32prog-gpios.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi index 4d763bd3a2c..84920f53496 100644 --- a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi @@ -3,6 +3,7 @@ * Copyright : STMicroelectronics 2022 */
+#include <dt-bindings/input/linux-event-codes.h> #include "stm32mp15-scmi-u-boot.dtsi"
/ { @@ -14,8 +15,22 @@ u-boot,boot-led = "heartbeat"; u-boot,error-led = "error"; u-boot,mmc-env-partition = "u-boot-env"; - st,fastboot-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; - st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-user-1 { + label = "User-1"; + linux,code = <BTN_1>; + gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + + button-user-2 { + label = "User-2"; + linux,code = <BTN_2>; + gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; };
led {

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
Add 2 gpio-keys : _ button-user-1 for stm32prog mode activation. _ button-user-2 for fastboot mode activation.
Remove proprietary st,fastboot-gpios and st,stm32prog-gpios.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:12, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
Add 2 gpio-keys : _ button-user-1 for stm32prog mode activation. _ button-user-2 for fastboot mode activation.
Remove proprietary st,fastboot-gpios and st,stm32prog-gpios.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi index 84920f53496..2abd512e297 100644 --- a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi @@ -37,7 +37,6 @@ red { label = "error"; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - default-state = "off"; status = "okay"; }; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:13, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

On 4/9/24 17:02, Patrice Chotard wrote:
red led and button dedicated to fastboot share the same gpio GPIOA13. Led driver is probed early so the corresponding gpio is taken and configured in output which forbid fastboot and stm32prog button usage.
To avoid this, remove the "default-state" property from red led node.
This will avoid to trigger the led driver probe() to configure the led default state during startup.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 1 - 1 file changed, 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi index 84920f53496..2abd512e297 100644 --- a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi @@ -37,7 +37,6 @@ red { label = "error"; gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
}; };default-state = "off"; status = "okay";
Applied on u-boot-stm32/master

As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use led node's name instead for u-boot,error-led property. Rename red led node's name to led-red. Remove status property which is useless. Add compatible = "gpio-leds"; which is not present in kernel DT.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi index 2abd512e297..b38e816f888 100644 --- a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi @@ -13,7 +13,7 @@
config { u-boot,boot-led = "heartbeat"; - u-boot,error-led = "error"; + u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "u-boot-env"; };
@@ -34,10 +34,10 @@ };
led { - red { - label = "error"; + compatible = "gpio-leds"; + + led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; - status = "okay"; }; }; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use led node's name instead for u-boot,error-led property. Rename red led node's name to led-red. Remove status property which is useless. Add compatible = "gpio-leds"; which is not present in kernel DT.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:13, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
As indicated in kernel led dt-bindings, label is a deprecated property, so remove it and use led node's name instead for u-boot,error-led property. Rename red led node's name to led-red. Remove status property which is useless. Add compatible = "gpio-leds"; which is not present in kernel DT.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master

The blue led is used to indicate U-Boot entering / exit indication then Linux heartbeat.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com ---
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi index b38e816f888..7c0d1bab11a 100644 --- a/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi +++ b/arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi @@ -12,7 +12,7 @@ };
config { - u-boot,boot-led = "heartbeat"; + u-boot,boot-led = "led-blue"; u-boot,error-led = "led-red"; u-boot,mmc-env-partition = "u-boot-env"; }; @@ -36,6 +36,10 @@ led { compatible = "gpio-leds";
+ led-blue { + gpios = <&gpiod 9 GPIO_ACTIVE_HIGH>; + }; + led-red { gpios = <&gpioa 13 GPIO_ACTIVE_LOW>; };

Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
The blue led is used to indicate U-Boot entering / exit indication then Linux heartbeat.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick

On 4/17/24 11:28, Patrick DELAUNAY wrote:
Hi,
On 4/9/24 17:02, Patrice Chotard wrote:
The blue led is used to indicate U-Boot entering / exit indication then Linux heartbeat.
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
arch/arm/dts/stm32mp157c-ed1-scmi-u-boot.dtsi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Patrick Delaunay patrick.delaunay@foss.st.com
Thanks Patrick
Applied on u-boot-stm32/master
participants (4)
-
Igor Opaniuk
-
Patrice CHOTARD
-
Patrice Chotard
-
Patrick DELAUNAY