Skip to content
Snippets Groups Projects
Commit f9e4389d authored by Tristan Gingold's avatar Tristan Gingold
Browse files

Add IRAM tests

parent 14485655
Branches
No related merge requests found
......@@ -18,7 +18,9 @@ extern void clear_bss(void);
static enum t_test
{
TEST_ECC_DE,
TEST_IRAM_DE,
TEST_IRAM_SE,
TEST_IRAM_SCRUB,
TEST_WD,
TEST_CPU1_RECOVER,
TEST_CPU2_RECOVER,
......@@ -153,16 +155,42 @@ main (void)
v = SUPERVISOR->reset_cause;
uart_put_hex_digit (v & 0x0f);
uart_puts (", tst: ");
uart_put_hex_digit (next_test);
uart_put_hex_digit (next_test & 0x0f);
uart_putc('\n');
switch (next_test) {
case TEST_ECC_DE:
next_test = TEST_WD;
case TEST_IRAM_DE:
next_test = TEST_IRAM_SE;
v = *(volatile unsigned *)0xfffc;
unreachable();
break;
case TEST_IRAM_SE:
/* Must have been corrected. */
v = *(volatile unsigned *)0xfffc;
if (SUPERVISOR->iram_ecc_se != 0)
unreachable();
v = *(volatile unsigned *)0xfff8;
if (SUPERVISOR->iram_ecc_se != 1)
unreachable();
next_test = TEST_IRAM_SCRUB;
/* Fallthrough */
case TEST_IRAM_SCRUB:
if (SUPERVISOR->iram_scrub_se != 0
|| SUPERVISOR->iram_scrub_de != 0)
unreachable();
uart_puts("Start IRAM scrubber");
SUPERVISOR->scrub_cfg = HYDRA_SUPERVISOR_REGS_SCRUB_CFG_IRAM_EN;
while (SUPERVISOR->iram_scrub_de == 0)
uart_putc('.');
uart_putc('\n');
if (SUPERVISOR->iram_scrub_se != 1
|| SUPERVISOR->iram_scrub_de != 1)
unreachable();
next_test = TEST_WD;
/* Fallthrough */
case TEST_WD:
/* Test watchdog - infinite loop */
next_test = TEST_CPU1_RECOVER;
......@@ -214,6 +242,8 @@ main (void)
/* Fallthrough */
case TEST_DONE:
default:
next_test++;
SUPERVISOR->wd_key = WD_KEY;
SUPERVISOR->wd_period = 100000000;
uart_puts ("Hello diot.\n");
......
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