|
@@ -194,12 +194,12 @@ static void init(void)
|
|
|
"\n*** Hello, World! ***\n"
|
|
|
"Firmware compiled on: " __DATE__ " " __TIME__ "\n\n";
|
|
|
|
|
|
- init_abc_memmap();
|
|
|
-
|
|
|
set_led(0);
|
|
|
-
|
|
|
+ con_set_baudrate(115200);
|
|
|
con_puts(hello);
|
|
|
|
|
|
+ init_abc_memmap();
|
|
|
+
|
|
|
timer_irq_count = 0;
|
|
|
timer_irq_start = rdtime();
|
|
|
unmask_irq(SYSCLOCK_IRQ);
|
|
@@ -233,26 +233,6 @@ IRQHANDLER(romcopy)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * Faster than memset() because it is less generic
|
|
|
- * newlib gets the bss clearing wrong for some reason...
|
|
|
- */
|
|
|
-static void clear_bss(void)
|
|
|
-{
|
|
|
- extern uint32_t __bss_start[], __BSS_END__[];
|
|
|
-
|
|
|
- for (uint32_t *p = __bss_start; p < __BSS_END__; p += 8) {
|
|
|
- p[0] = 0;
|
|
|
- p[1] = 0;
|
|
|
- p[2] = 0;
|
|
|
- p[3] = 0;
|
|
|
- p[4] = 0;
|
|
|
- p[5] = 0;
|
|
|
- p[6] = 0;
|
|
|
- p[7] = 0;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
void main(void)
|
|
|
{
|
|
|
/* The data section is not reinitialized on reset */
|
|
@@ -261,16 +241,13 @@ void main(void)
|
|
|
uint32_t irq_count;
|
|
|
uint32_t abc_status;
|
|
|
uint32_t done;
|
|
|
- uint32_t bss_clear_time;
|
|
|
+ uint32_t time_to_main;
|
|
|
|
|
|
- clear_bss();
|
|
|
- bss_clear_time = rdtime() - time_zero;
|
|
|
+ time_to_main = rdtime() - time_zero;
|
|
|
|
|
|
romcopy_state = 0;
|
|
|
unmask_irq(ROMCOPY_IRQ);
|
|
|
|
|
|
- con_set_baudrate(115200);
|
|
|
-
|
|
|
init();
|
|
|
|
|
|
con_printf("This is loop: %u\n", loops++);
|
|
@@ -283,8 +260,8 @@ void main(void)
|
|
|
con_puts("No ABC-bus host detected\n");
|
|
|
}
|
|
|
|
|
|
- con_printf("Clearing .bss took %u us\n",
|
|
|
- bss_clear_time/(CPU_HZ/1000000));
|
|
|
+ con_printf("Bootup code/clearing .bss took %u us\n",
|
|
|
+ time_to_main/(CPU_HZ/1000000));
|
|
|
|
|
|
while (!(irqmask() & (1 << ROMCOPY_IRQ)))
|
|
|
pause();
|