imx8mn-somdevices: Light on LED at boot up.
authorJosep Orga <jorga@somdevices.com>
Thu, 7 Oct 2021 17:16:11 +0000 (19:16 +0200)
committerJosep Orga <jorga@somdevices.com>
Thu, 7 Oct 2021 17:16:11 +0000 (19:16 +0200)
Signed-off-by: Josep Orga <jorga@somdevices.com>
arch/arm/dts/imx8mn-somdevices.dts
board/somdevices/imx8mn_somdevices/imx8mn_somdevices.c
board/somdevices/imx8mn_somdevices/spl.c
configs/imx8mn_somdevices_defconfig

index 89268ec..3c62d90 100644 (file)
@@ -24,8 +24,8 @@
                pinctrl-0 = <&pinctrl_gpio_led>;
 
                status {
-                       label = "yellow:status";
-                       gpios = <&gpio3 16 GPIO_ACTIVE_HIGH>;
+                       label = "status";
+                       gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
                        default-state = "on";
                };
        };
 
        pinctrl_gpio_led: gpioledgrp {
                fsl,pins = <
-                       MX8MN_IOMUXC_NAND_READY_B_GPIO3_IO16    0x19
+                       MX8MN_IOMUXC_GPIO1_IO10_GPIO1_IO10      0x19
                >;
        };
 
index 4505834..8f20e73 100644 (file)
@@ -22,6 +22,7 @@
 #include <usb.h>
 #include <imx_sip.h>
 #include <linux/arm-smccc.h>
+#include <led.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -314,6 +315,8 @@ int board_init(void)
        arm_smccc_smc(IMX_SIP_GPC, IMX_SIP_GPC_PM_DOMAIN,
                      MIPI, true, 0, 0, 0, 0, &res);
 
+       if (CONFIG_IS_ENABLED(LED))
+               led_default_state();
        return 0;
 }
 
index e915713..3626f69 100644 (file)
@@ -67,6 +67,8 @@ void spl_dram_init(void)
        ddr_init(&dram_timing);
 }
 
+#define LED_GPIO IMX_GPIO_NR(1, 10)
+
 #if CONFIG_IS_ENABLED(DM_PMIC_BD71837)
 int power_init_board(void)
 {
@@ -206,6 +208,10 @@ void board_init_f(ulong dummy)
                hang();
        }
 
+       /* Light on LED */
+       gpio_request(LED_GPIO, "led");
+       gpio_direction_output(LED_GPIO, 1);
+
        ret = uclass_get_device_by_name(UCLASS_CLK,
                                        "clock-controller@30380000",
                                        &dev);
index 7218d77..cdf281d 100644 (file)
@@ -156,3 +156,6 @@ CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_SPLASH_SCREEN=y
 CONFIG_SPLASH_SCREEN_ALIGN=y
 CONFIG_CMD_BMP=y
+
+CONFIG_LED=y
+CONFIG_LED_GPIO=y