mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-01-25 09:41:05 +02:00
42 lines
974 B
C
42 lines
974 B
C
#include "soc-hw.h"
|
|
|
|
unsigned int i, j,k; // Loop counter.
|
|
|
|
|
|
int main() {
|
|
int key, len, autoboot = 1, dispmenu = 1;
|
|
|
|
uart_putstr("Cain's bootloader!!! \r\n");
|
|
|
|
while(1){ /* loop forever until u-boot gets booted or the board is reset */
|
|
if(dispmenu){
|
|
uart_putstr("\n1: Upload program to RAM\r\n");
|
|
// uart_putstr("2: Upload u-boot to Dataflash\r\n");
|
|
// uart_putstr("3: Upload Kernel to Dataflash\r\n");
|
|
// uart_putstr("4: Start u-boot\r\n");
|
|
// uart_putstr("5: Upload Filesystem image\r\n");
|
|
// uart_putstr("6: Memory test\r\n");
|
|
dispmenu = 0;
|
|
}
|
|
key = uart_getchar();
|
|
autoboot = 0;
|
|
|
|
if(key == '1'){
|
|
len = rxmodem((unsigned char *)0x1000);
|
|
uart_putstr("Received ");
|
|
hexprint(len);
|
|
uart_putstr(" bytes\r\n");
|
|
// jump(RAM_BASE);
|
|
dispmenu = 1;
|
|
}
|
|
else{
|
|
uart_putstr("Invalid input\r\n");
|
|
dispmenu = 1;
|
|
}
|
|
}
|
|
|
|
while(1){ asm("nop;"); }
|
|
|
|
return (0);
|
|
}
|