Properly configure chassis power LED GPIO at startup

Avoid interference between 7 segment display and power LED
parent 8aa01010
......@@ -342,6 +342,7 @@ static void reboot(void)
static void display_character(char character, int dp)
{
uint32_t dword;
uint16_t value;
// FIXME Only supports numbers for now
......@@ -382,7 +383,10 @@ static void display_character(char character, int dp)
break; // OFF
}
gpio3_out_write(~(value | ((dp == 0) ? 0x0000 : 0x4000)));
dword = gpio3_out_read();
dword &= ~0x7fff;
dword |= (~(value | ((dp == 0) ? 0x0000 : 0x4000))) & 0x7fff;
gpio3_out_write(dword);
}
static void host_power_status_changed(void)
......@@ -402,7 +406,7 @@ static void host_power_status_changed(void)
// Write power LED status to GPIO register
dword = gpio3_out_read();
dword &= ~(0x1 << 15);
dword |= (power_led_on & 0x1) << 15;
dword |= (~(power_led_on & 0x1) << 15) & 0x8000;
gpio3_out_write(dword);
}
......@@ -471,9 +475,9 @@ static void gpio_init(void)
set_led_bank_display(0x00);
gpio1_oe_write(0xff);
// Set up alphanumeric display
gpio3_out_write(0xefff);
gpio3_oe_write(0xefff);
// Set up alphanumeric display / power LED
gpio3_out_write(0xffff);
gpio3_oe_write(0xffff);
}
static void set_lpc_slave_irq_enable(uint8_t enabled)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment