void uart_writeuint32(uint32_t val) {
const char lut[] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
- uint8_t *val_arr = &val;
+ uint8_t *val_arr = (uint8_t*)(&val);
size_t i;
for (i = 0; i < 4; i++) {
const int kNumIterations = 14;
int res, failcnt = 0;
uint32_t tmp;
- volatile uint32_t *ram = DRAM_BASE;
+ volatile uint32_t *ram = (uint32_t*)DRAM_BASE;
console_init();
//puts("Firmware launched...\n");
puts("fw..");
#if 1
- volatile uint32_t *hyperram = 0xa0000000;
- // quick write/read
- writel(0xDEAF0000, (unsigned long)&(hyperram[0]));
- tmp = readl((unsigned long)&(hyperram[0]));
- puts("read ");
- uart_writeuint32(tmp);
+ volatile uint32_t *hyperram = (uint32_t*)0xa0000000;
+ while (1) {
+ unsigned char c = getchar();
+ putchar(c);
+ if (c == 13) { // if CR send LF
+
+ // quick write/read
+ writel(0xDEAF0000, (unsigned long)&(hyperram[0]));
+ tmp = readl((unsigned long)&(hyperram[0]));
+ puts("read ");
+ uart_writeuint32(tmp);
+ putchar(10);
+ }
+ }
return 0;
#endif
for (size_t i = 0; i < kNumIterations; i++) {
if (readl((unsigned long)&(ram[i])) != (0xDEAF0000 | i*4)) {
puts("fail : *(0x");
- uart_writeuint32(&ram[i]);
+ uart_writeuint32((unsigned long)(&ram[i]));
puts(") = ");
uart_writeuint32(ram[i]);
puts("\n");