Fix POST code decoding

Enable console POST codes by default
parent d1321594
......@@ -68,7 +68,7 @@ extern uint8_t irq_unhandled_source_valid;
#define VUART_RING_BUFFER_SIZE 512
// Interrupt transient POST code buffer
static uint8_t post_code_incoming_interrupt_transient_buffer[POST_CODE_INTERRUPT_TRANSIENT_BUFFER_SIZE];
static uint16_t post_code_incoming_interrupt_transient_buffer[POST_CODE_INTERRUPT_TRANSIENT_BUFFER_SIZE];
static int post_code_incoming_interrupt_transient_buffer_pos = 0;
static uint8_t post_code_incoming_interrupt_transient_buffer_overflow = 0;
......@@ -126,7 +126,7 @@ uint8_t post_code_low = 0;
// Global configuration
static uint8_t allow_flash_write = 0;
static uint8_t enable_post_code_console_output = 0;
static uint8_t enable_post_code_console_output = 1;
// External service interface
struct firmware_buffer_region main_firmware_buffer;
......@@ -571,7 +571,7 @@ void lpc_slave_isr(void)
post_code_low = post_code;
if (post_code_incoming_interrupt_transient_buffer_pos < POST_CODE_INTERRUPT_TRANSIENT_BUFFER_SIZE)
{
post_code_incoming_interrupt_transient_buffer[post_code_incoming_interrupt_transient_buffer_pos] = ((post_code_high & 0xf) << 4) | (post_code_low & 0xf);
post_code_incoming_interrupt_transient_buffer[post_code_incoming_interrupt_transient_buffer_pos] = ((post_code_high & 0xff) << 8) | (post_code_low & 0xff);
post_code_incoming_interrupt_transient_buffer_pos++;
}
else
......@@ -1733,11 +1733,12 @@ static int process_interrupts_stage2(void)
while (read_position < post_code_incoming_interrupt_transient_buffer_pos)
{
uint16_t post_code = post_code_incoming_interrupt_transient_buffer[read_position];
set_led_bank_display(post_code);
uint8_t led_post_code = (((post_code >> 8) & 0xf) << 4) | (post_code & 0xf);
set_led_bank_display(led_post_code);
if (enable_post_code_console_output)
{
KESTREL_LOG("[POST CODE] %d.%d", (post_code >> 4) & 0xf, post_code & 0xf);
KESTREL_LOG("[POST CODE] %d.%d", (post_code >> 8) & 0xff, post_code & 0xff);
}
read_position++;
}
......@@ -3530,7 +3531,7 @@ int kestrel_init(void)
tercel_spi_flash_init(BMCSPIFLASHCFG_BASE, BMCSPIFLASH_BASE, 1, 0, 0);
// Detect and print attached host SPI Flash ID
KESTREL_LOG("Host SPI flash ID: 0x%08x", read_host_spi_flash_id(BMCSPIFLASHCFG_BASE, BMCSPIFLASH_BASE));
KESTREL_LOG("BMC SPI flash ID: 0x%08x", read_host_spi_flash_id(BMCSPIFLASHCFG_BASE, BMCSPIFLASH_BASE));
reset_flash_device(BMCSPIFLASHCFG_BASE, BMCSPIFLASH_BASE);
configure_flash_device(BMCSPIFLASHCFG_BASE, BMCSPIFLASH_BASE);
......
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