led: Use STATUS_LED_ON and STATUS_LED_OFF when calling __led_set
PATCH v3 1/2 led: Use STATUS_LED_ON and STATUS_LED_OFF when calling __led_set
This fixes the gpio_led driver which needs to compare againt a STATUS_LED_ON to enable a led.
---
Changes in v3: None
Changes in v2: None
common/cmd_led.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
common/cmd_led.c +4 -2
@@ -110,13 +110,15 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])if (led_commands[i].on) led_commands[i].on ();else -__led_set (led_commands[i].mask,1 ); +__led_set (led_commands[i].mask, +STATUS_LED_ON );break ;case LED_OFF :if (led_commands[i].off) led_commands[i].off ();else -__led_set (led_commands[i].mask,0 ); +__led_set (led_commands[i].mask, +STATUS_LED_OFF );break ;case LED_TOGGLE :if (led_commands[i].toggle)
Signature · 1 line
1.8.1
PATCH v3 2/2 mx23_olinuxino: Add support for status LED
This allow user to know if the bootloader is running, even without a serial console.
---
Changes in v3:
- Added the MUX settings back (requested by Fabio)
- Added name of the PIN in the board config file
Changes in v2:
- Remove MUX setting - not need
board/olimex/mx23_olinuxino/mx23_olinuxino.c | 7 +++++++ board/olimex/mx23_olinuxino/spl_boot.c | 4 ++++ include/configs/mx23_olinuxino.h | 12 ++++++++++++ 3 files changed, 23 insertions(+)
board/olimex/mx23_olinuxino/mx23_olinuxino.c +7 -0
@@ -28,6 +28,9 @@#include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> +#ifdef CONFIG_STATUS_LED +#include <status_led.h> +#endif DECLARE_GLOBAL_DATA_PTR ;
@@ -67,5 +70,9 @@ int board_init(void)/* Adress of boot parameters */ gd->bd->bi_boot_params =PHYS_SDRAM_1 +0x100 ; +#if defined(CONFIG_STATUS_LED ) && defined(STATUS_LED_BOOT ) +status_led_set (STATUS_LED_BOOT ,STATUS_LED_STATE ); +#endif +return 0 ; }
board/olimex/mx23_olinuxino/spl_boot.c +4 -0
@@ -84,6 +84,10 @@ const iomux_cfg_t iomux_setup[] = {MX23_PAD_EMI_RASN__EMI_RASN |MUX_CONFIG_EMI ,MX23_PAD_EMI_WEN__EMI_WEN |MUX_CONFIG_EMI , +/* Green LED */ +MX23_PAD_SSP1_DETECT__GPIO_2_1 | + (MXS_PAD_3V3 |MXS_PAD_4MA |MXS_PAD_NOPULL ), +/* MMC 0 */ MX23_PAD_SSP1_CMD__SSP1_CMD |MUX_CONFIG_SSP , MX23_PAD_SSP1_DATA0__SSP1_DATA0 | MUX_CONFIG_SSP,
include/configs/mx23_olinuxino.h +12 -0
@@ -56,6 +56,7 @@#define CONFIG_CMD_EXT2 #define CONFIG_CMD_FAT #define CONFIG_CMD_GPIO +#define CONFIG_CMD_LED #define CONFIG_CMD_MMC /*
@@ -112,6 +113,17 @@#define CONFIG_BAUDRATE 115200/* Default baud rate */ /* +* Status LED +*/ +#define CONFIG_STATUS_LED +#define CONFIG_GPIO_LED +#define CONFIG_BOARD_SPECIFIC_LED +#define STATUS_LED_BOOT 0 +#define STATUS_LED_BIT 0x030a/* MX23_PAD_SSP1_DETECT__GPIO_2_1 */ +#define STATUS_LED_STATE STATUS_LED_ON +#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) + +/* * MMC Driver */ #ifdef CONFIG_CMD_MMC
Signature · 1 line
1.8.1
PATCH v3 2/2 mx23_olinuxino: Add support for status LED
Dear Otavio Salvador,
[..]
include/configs/mx23_olinuxino.h line 122
Quoted 8 lines
/*
+ * Status LED
+ */include/configs/mx23_olinuxino.h +5
-0+#define CONFIG_STATUS_LED +#define CONFIG_GPIO_LED +#define CONFIG_BOARD_SPECIFIC_LED +#define STATUS_LED_BOOT 0 +#define STATUS_LED_BIT 0x030a/* MX23_PAD_SSP1_DETECT__GPIO_2_1 */
Just use MX23_PAD_SSP1_DETECT__GPIO_2_1 directly ?
include/configs/mx23_olinuxino.h line 129
Quoted 7 lines
include/configs/mx23_olinuxino.h +4
-0+#define STATUS_LED_STATE STATUS_LED_ON +#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2) + +/* * MMC Driver */ #ifdef CONFIG_CMD_MMC
Best regards,
Marek Vasut
PATCH v3 2/2 mx23_olinuxino: Add support for status LED
Quoted 13 lines · Marek Vasut
Dear Otavio Salvador,
[..]
include/configs/mx23_olinuxino.h line 122
Quoted 8 lines
/*
+ * Status LED
+ */include/configs/mx23_olinuxino.h +5
-0+#define CONFIG_STATUS_LED +#define CONFIG_GPIO_LED +#define CONFIG_BOARD_SPECIFIC_LED +#define STATUS_LED_BOOT 0 +#define STATUS_LED_BIT 0x030a/* MX23_PAD_SSP1_DETECT__GPIO_2_1 */ Just use
MX23_PAD_SSP1_DETECT__GPIO_2_1directly ?
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/otavio/hacking/u-boot/drivers/mtd/spi' status_led.c:46:7: error: 'MX23_PAD_SSP1_DETECT__GPIO_2_1' undeclared here (not in a function)
make[1]: Entering directory `/home/otavio/hacking/u-boot/drivers/mtd/ubi'
...
--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
PATCH v3 2/2 mx23_olinuxino: Add support for status LED
Dear Otavio Salvador,
Quoted 18 lines · Marek Vasut
Quoted 6 lines
Dear Otavio Salvador,
[..]
Quoted 2 lines
/*
Quoted 10 lines
Quoted 8 lines
+ * Status LED
+ */include/configs/mx23_olinuxino.h +5
-0+#define CONFIG_STATUS_LED +#define CONFIG_GPIO_LED +#define CONFIG_BOARD_SPECIFIC_LED +#define STATUS_LED_BOOT 0 +#define STATUS_LED_BIT 0x030a/* MX23_PAD_SSP1_DETECT__GPIO_2_1 */
Just use
MX23_PAD_SSP1_DETECT__GPIO_2_1directly ?
Quoted 4 lines
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/otavio/hacking/u-boot/drivers/mtd/spi' status_led.c:46:7: error: 'MX23_PAD_SSP1_DETECT__GPIO_2_1' undeclared here (not in a function)
#include iomux-mx23 missing ?
Quoted 8 lines
make[1]: Entering directory `/home/otavio/hacking/u-boot/drivers/mtd/ubi'
...
--
Otavio SalvadorO.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Best regards,
Marek Vasut
PATCH v3 2/2 mx23_olinuxino: Add support for status LED
Quoted 20 lines · Marek Vasut
Dear Otavio Salvador,
Quoted 18 lines · Marek Vasut
Quoted 16 lines
Dear Otavio Salvador,
[..]
Quoted 10 lines
/*
+ * Status LED
+ */include/configs/mx23_olinuxino.h +5
-0+#define CONFIG_STATUS_LED +#define CONFIG_GPIO_LED +#define CONFIG_BOARD_SPECIFIC_LED +#define STATUS_LED_BOOT 0 +#define STATUS_LED_BIT 0x030a/* MX23_PAD_SSP1_DETECT__GPIO_2_1 */
Just use
MX23_PAD_SSP1_DETECT__GPIO_2_1directly ?
Quoted 6 lines
Quoted 4 lines
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/otavio/hacking/u-boot/drivers/mtd/spi' status_led.c:46:7: error: 'MX23_PAD_SSP1_DETECT__GPIO_2_1' undeclared here (not in a function)#include iomux-mx23 missing ?
...
make[1]: Entering directory `/home/otavio/hacking/u-boot/tools' /home/otavio/hacking/u-boot/include/asm/arch/iomux.h: Assembler messages:/home/otavio/hacking/u-boot/include/asm/arch/iomux.h:38: Error: bad instruction typedef u32 iomux_cfg_t' /home/otavio/hacking/u-boot/include/asm/arch/iomux.h:112: Error: bad instruction static inline unsigned int PAD_BANK(iomux_cfg_t pad)' /home/otavio/hacking/u-boot/include/asm/arch/iomux.h:113: Error: junk at end of line, first unrecognized character is {' /home/otavio/hacking/u-boot/include/asm/arch/iomux.h:114: Error: bad instruction return (pad&((iomux_cfg_t)0x7<<0))>>0'
...
I had try it before of course ;)
--
Otavio Salvador O.S. Systems
E-mail: otavio at ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
PATCH v3 2/2 mx23_olinuxino: Add support for status LED
Dear Otavio Salvador,
Quoted 41 lines · Marek Vasut
Quoted 20 lines
Dear Otavio Salvador,
Quoted 18 lines · Marek Vasut
Quoted 16 lines
Dear Otavio Salvador,
[..]
Quoted 10 lines
/*
+ * Status LED
+ */include/configs/mx23_olinuxino.h +5
-0+#define CONFIG_STATUS_LED +#define CONFIG_GPIO_LED +#define CONFIG_BOARD_SPECIFIC_LED +#define STATUS_LED_BOOT 0 +#define STATUS_LED_BIT 0x030a/*
MX23_PAD_SSP1_DETECT__GPIO_2_1*/Just use
MX23_PAD_SSP1_DETECT__GPIO_2_1directly ?Quoted 6 lines
Quoted 4 lines
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/otavio/hacking/u-boot/drivers/mtd/spi' status_led.c:46:7: error: 'MX23_PAD_SSP1_DETECT__GPIO_2_1' undeclared here (not in a function)#include iomux-mx23 missing ?
...
make[1]: Entering directory `/home/otavio/hacking/u-boot/tools'/home/otavio/hacking/u-boot/include/asm/arch/iomux.h: Assembler messages:/home/otavio/hacking/u-boot/include/asm/arch/iomux.h:38: Error: bad instructiontypedef u32 iomux_cfg_t' /home/otavio/hacking/u-boot/include/asm/arch/iomux.h:112: Error: bad instructionstatic inline unsigned intPAD_BANK(iomux_cfg_t pad)'/home/otavio/hacking/u-boot/include/asm/arch/iomux.h:113: Error: junk at end of line, first unrecognized character is{' /home/otavio/hacking/u-boot/include/asm/arch/iomux.h:114: Error: bad instructionreturn (pad&((iomux_cfg_t)0x7<<0))>>0'
...
Quoted 1 line
I had try it before of course ;)
So iomux.h is not safe to be included in assembler fixes ... fix it with some ifdef __ASSEMBLY__ as the rest of the header files are .
Best regards,
Marek Vasut