Compare commits

...

1 Commits

Author SHA1 Message Date
Lucien Mueller 0db5a2af91 nmhw21: sync ui leds with onboard leds.
BugzID: 59055

Signed-off-by: Lucien Mueller <lucien.mueller@netmodule.com>
2019-11-28 10:29:30 +01:00
1 changed files with 22 additions and 11 deletions

View File

@ -217,6 +217,15 @@ static void set_indicator_led(int red, int green)
gpio_set_value(GPIO_LED1_GREEN, green);
}
static void ui_set_status_led(int red, int green)
{
ui_set_top_led(red, green);
}
static void ui_set_indicator_led(int red, int green)
{
ui_set_bottom_led(red, green);
}
static void init_i2c(void)
{
@ -451,6 +460,12 @@ void am33xx_spl_board_init(void)
set_status_led(1, 0); /* Red */
set_indicator_led(1, 0); /* Red */
/* UI detection */
REQUEST_AND_SET_GPIO(GPIO_RST_UI_N);
ui_init(CONFIG_UI_I2C_BUS);
ui_set_status_led(1, 0); /* Red */
ui_set_indicator_led(1, 0); /* Red */
/* Set MPU Frequency to what we detected now that voltages are set */
do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
@ -776,8 +791,8 @@ int board_init(void)
init_leds();
set_status_led(1, 1); /* Orange */
set_indicator_led(0, 0); /* Off */
ui_set_top_led(1, 1);
ui_set_bottom_led(1, 1);
ui_set_status_led(1, 1); /* Orange */
ui_set_indicator_led(0, 0); /* Off */
printf("OSC: %lu MHz\n", get_osclk()/1000000);
@ -896,25 +911,21 @@ static void blink_led(int pulses)
{
const int pulse_width = 400*1000; /* 400ms */
/* Assumes status LED is orange */
set_status_led(0, 0);
ui_set_top_led(0, 0);
while (pulses) {
udelay(pulse_width);
set_status_led(1, 1);
ui_set_top_led(1, 1);
ui_set_status_led(1, 1);
udelay(pulse_width);
set_status_led(0, 0);
ui_set_top_led(0, 0);
ui_set_status_led(0, 0);
pulses--;
}
udelay(pulse_width);
set_status_led(1, 1); /* Orange */
ui_set_top_led(1, 1);
ui_set_status_led(1, 1);
}
static void check_reset_button(void)
@ -1043,8 +1054,8 @@ int board_late_init(void)
set_status_led(1, 1); /* Orange */
set_indicator_led(0, 0); /* Off */
ui_set_top_led(1, 1); /* Orange */
ui_set_bottom_led(0, 0); /* Off */
set_status_led(1, 1); /* Orange */
set_indicator_led(0, 0); /* Off */
check_fct();
check_jtag_boot();