|
@@ -5,6 +5,9 @@
|
|
|
#include "sys.h"
|
|
|
#include "console.h"
|
|
|
|
|
|
+#define DEBUG 0
|
|
|
+#define MINITESTS 1
|
|
|
+
|
|
|
volatile uint32_t timer_irq_count;
|
|
|
IRQHANDLER(sysclock)
|
|
|
{
|
|
@@ -12,7 +15,7 @@ IRQHANDLER(sysclock)
|
|
|
|
|
|
count++;
|
|
|
timer_irq_count = count;
|
|
|
- if (!(count & ((1U << TIMER_SHIFT)-1))) {
|
|
|
+ if (DEBUG && !(count & ((1U << TIMER_SHIFT)-1))) {
|
|
|
register size_t oldpc asm("s10");
|
|
|
CON_DATA = '.'; /* Console heartbeat */
|
|
|
con_printf("\n<%08x>\r", oldpc);
|
|
@@ -70,7 +73,7 @@ void init(void)
|
|
|
wait_romcopy_done();
|
|
|
set_leds(5);
|
|
|
|
|
|
-#if 1
|
|
|
+#if DEBUG
|
|
|
con_puts("Waiting 5 s for testing...");
|
|
|
udelay(5000000);
|
|
|
con_putc('\n');
|
|
@@ -89,7 +92,7 @@ void init(void)
|
|
|
(uint16_t)boardcfg);
|
|
|
}
|
|
|
|
|
|
- if ( 1 ) {
|
|
|
+ if ( MINITESTS ) {
|
|
|
con_puts("Quick DRAM test:\n");
|
|
|
for (int i = 0; i < 8; i++) {
|
|
|
uint32_t v = (i*0x11111111) + 0x44332211;
|
|
@@ -102,18 +105,10 @@ void init(void)
|
|
|
for (int i = 0; i < 8; i++) {
|
|
|
con_printf("%08x ", test_dram[i]);
|
|
|
}
|
|
|
+ con_puts("\n\nRandom number generator test:\n");
|
|
|
+ for (int i = 0; i < 8; i++)
|
|
|
+ con_printf("%08x ", rdrand());
|
|
|
con_puts("\n\n");
|
|
|
-
|
|
|
- udelay(1000000);
|
|
|
- }
|
|
|
-
|
|
|
- if ( 1 ) {
|
|
|
- con_puts("Random number generator test:\n");
|
|
|
- for (int i = 0; i < 8; i++) {
|
|
|
- uint32_t a = rdrand();
|
|
|
- uint32_t b = rdrand();
|
|
|
- con_printf("%08x %08x delta %08x\n", a, b, a^b);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
rom_get_serial();
|