[U-Boot] [PATCH v2 12/22] STM32F429-discovery: led: disable board-specific code, if DM is selected
Benjamin Tietz
uboot at dresden.micronet24.de
Mon Jun 20 20:27:01 CEST 2016
From: Benjamin Tietz <benjamin at micronet24.de>
If the device-tree gpio selection is selected, the hardcoded board-specific
led-initialization will fail.
This will disable that code, if CONFIG_DM_GPIO is enabled.
---
board/st/stm32f429-discovery/Makefile | 3 +++
include/configs/stm32f429-discovery.h | 10 +++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/board/st/stm32f429-discovery/Makefile b/board/st/stm32f429-discovery/Makefile
index d94059d..34ee711 100644
--- a/board/st/stm32f429-discovery/Makefile
+++ b/board/st/stm32f429-discovery/Makefile
@@ -9,4 +9,7 @@
#
obj-y := stm32f429-discovery.o
+
+ifndef CONFIG_DM_GPIO
obj-y += led.o
+endif
diff --git a/include/configs/stm32f429-discovery.h b/include/configs/stm32f429-discovery.h
index 9d275c0..04066ff 100644
--- a/include/configs/stm32f429-discovery.h
+++ b/include/configs/stm32f429-discovery.h
@@ -42,17 +42,21 @@
#define CONFIG_ENV_SECT_SIZE (128 << 10)
#define CONFIG_ENV_SIZE (8 << 10)
-#define CONFIG_BOARD_SPECIFIC_LED
+#define CONFIG_GPIO_LED 1
+#ifndef CONFIG_DM_GPIO
#define CONFIG_RED_LED 110
#define CONFIG_GREEN_LED 109
-#define CONFIG_GPIO_LED 1
-#define CONFIG_STATUS_LED
+#ifdef CONFIG_STATUS_LED
+#define CONFIG_BOARD_SPECIFIC_LED
+#define STATUS_LED_RED CONFIG_RED_LED
#define STATUS_LED_BIT CONFIG_RED_LED
#define STATUS_LED_STATE 0
#define STATUS_LED_PERIOD 0
#define STATUS_LED_BIT1 CONFIG_GREEN_LED
#define STATUS_LED_STATE1 0
#define STATUS_LED_PERIOD1 0
+#endif
+#endif
#define CONFIG_STM32_GPIO
#define CONFIG_STM32_FLASH
More information about the U-Boot
mailing list