nmhw21: sync ui leds with onboard leds.

BugzID: 59055

Signed-off-by: Lucien Mueller <lucien.mueller@netmodule.com>
This commit is contained in:
Lucien Mueller 2019-11-27 16:15:17 +01:00 committed by Gogs
parent e940bb1802
commit a93f6f3874
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)
{
@ -506,6 +515,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);
@ -835,8 +850,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);
@ -955,25 +970,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)
@ -1102,8 +1113,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();