Commit 2b8754b25ff8134d8db18f6d4d28d41a5e1b36e6

Authored by Igor Grinberg
Committed by Albert ARIBAUD
1 parent afff1fc079
Exists in master and in 55 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

OMAP3: CM-T35: enable the green LED

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>

Showing 4 changed files with 67 additions and 2 deletions Side-by-side Diff

board/cm_t35/Makefile
... ... @@ -25,7 +25,7 @@
25 25  
26 26 LIB = $(obj)lib$(BOARD).o
27 27  
28   -COBJS := cm_t35.o
  28 +COBJS := cm_t35.o leds.o
29 29  
30 30 SRCS := $(COBJS:.o=.c)
31 31 OBJS := $(addprefix $(obj),$(COBJS))
board/cm_t35/cm_t35.c
... ... @@ -29,6 +29,7 @@
29 29 */
30 30  
31 31 #include <common.h>
  32 +#include <status_led.h>
32 33 #include <netdev.h>
33 34 #include <net.h>
34 35 #include <i2c.h>
... ... @@ -85,6 +86,10 @@
85 86 /* boot param addr */
86 87 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
87 88  
  89 +#if defined(CONFIG_STATUS_LED) && defined(STATUS_LED_BOOT)
  90 + status_led_set(STATUS_LED_BOOT, STATUS_LED_ON);
  91 +#endif
  92 +
88 93 return 0;
89 94 }
90 95  
... ... @@ -249,7 +254,7 @@
249 254 MUX_VAL(CP(SYS_NIRQ), (IEN | PTU | EN | M0)); /*SYS_nIRQ*/
250 255 MUX_VAL(CP(SYS_OFF_MODE), (IEN | PTD | DIS | M0)); /*OFF_MODE*/
251 256 MUX_VAL(CP(SYS_CLKOUT1), (IEN | PTD | DIS | M0)); /*CLKOUT1*/
252   - MUX_VAL(CP(SYS_CLKOUT2), (IDIS | PTD | DIS | M4)); /*green LED*/
  257 + MUX_VAL(CP(SYS_CLKOUT2), (IDIS | PTU | DIS | M4)); /*green LED*/
253 258 MUX_VAL(CP(JTAG_nTRST), (IEN | PTD | DIS | M0)); /*JTAG_nTRST*/
254 259 MUX_VAL(CP(JTAG_TCK), (IEN | PTD | DIS | M0)); /*JTAG_TCK*/
255 260 MUX_VAL(CP(JTAG_TMS), (IEN | PTD | DIS | M0)); /*JTAG_TMS*/
  1 +/*
  2 + * (C) Copyright 2011
  3 + * CompuLab, Ltd. <www.compulab.co.il>
  4 + *
  5 + * Author: Igor Grinberg <grinberg@compulab.co.il>
  6 + *
  7 + * This program is free software; you can redistribute it and/or
  8 + * modify it under the terms of the GNU General Public License as
  9 + * published by the Free Software Foundation; either version 2 of
  10 + * the License, or (at your option) any later version.
  11 + *
  12 + * This program is distributed in the hope that it will be useful,
  13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15 + * GNU General Public License for more details.
  16 + *
  17 + * You should have received a copy of the GNU General Public License
  18 + * along with this program; if not, write to the Free Software
  19 + * Foundation, Inc.
  20 + */
  21 +#include <common.h>
  22 +#include <status_led.h>
  23 +#include <asm/arch/gpio.h>
  24 +
  25 +static unsigned int leds[] = { GREEN_LED_GPIO };
  26 +
  27 +void __led_init(led_id_t mask, int state)
  28 +{
  29 + if (omap_request_gpio(leds[mask]) != 0) {
  30 + printf("%s: failed requesting GPIO%u\n", __func__, leds[mask]);
  31 + return;
  32 + }
  33 +
  34 + omap_set_gpio_direction(leds[mask], 0);
  35 +}
  36 +
  37 +void __led_set(led_id_t mask, int state)
  38 +{
  39 + omap_set_gpio_dataout(leds[mask], state == STATUS_LED_ON);
  40 +}
  41 +
  42 +void __led_toggle(led_id_t mask)
  43 +{
  44 + omap_set_gpio_dataout(leds[mask], !omap_get_gpio_datain(leds[mask]));
  45 +}
include/configs/cm_t35.h
... ... @@ -351,5 +351,20 @@
351 351 CONFIG_SYS_INIT_RAM_SIZE - \
352 352 GENERATED_GBL_DATA_SIZE)
353 353  
  354 +/* Status LED */
  355 +#define CONFIG_STATUS_LED 1 /* Status LED enabled */
  356 +#define CONFIG_BOARD_SPECIFIC_LED 1
  357 +#define STATUS_LED_GREEN 0
  358 +#define STATUS_LED_BIT STATUS_LED_GREEN
  359 +#define STATUS_LED_STATE STATUS_LED_ON
  360 +#define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
  361 +#define STATUS_LED_BOOT STATUS_LED_BIT
  362 +#define GREEN_LED_GPIO 186 /* CM-T35 Green LED is GPIO186 */
  363 +
  364 +/* GPIO banks */
  365 +#ifdef CONFIG_STATUS_LED
  366 +#define CONFIG_OMAP3_GPIO_6 1 /* GPIO186 is in GPIO bank 6 */
  367 +#endif
  368 +
354 369 #endif /* __CONFIG_H */