bios: Use single characters for boot modes.
authorTim 'mithro' Ansell <mithro@mithis.com>
Thu, 14 Apr 2016 07:00:59 +0000 (17:00 +1000)
committerTim 'mithro' Ansell <mithro@mithis.com>
Tue, 19 Apr 2016 03:42:56 +0000 (13:42 +1000)
 * The function keys never really worked properly.
 * Also add commands for the ROM/Flash/etc.

litex/soc/software/bios/main.c

index 819047a1a862bed1ab62a26c13ede22dc66d9748..d45ec8674e67982a61b5d152c808bd425f702811 100644 (file)
@@ -462,9 +462,15 @@ static int test_user_abort(void)
 
        printf("Automatic boot in 2 seconds...\n");
        printf("Q/ESC: abort boot\n");
-       printf("F7:    boot from serial\n");
+#ifdef FLASH_BOOT_ADDRESS
+       printf("F:     boot from flash\n");
+#endif
+       printf("S:     boot from serial\n");
 #ifdef CSR_ETHMAC_BASE
-       printf("F8:    boot from network\n");
+       printf("N:     boot from network\n");
+#endif
+#ifdef ROM_BOOT_ADDRESS
+       printf("R:     boot from embedded ROM\n");
 #endif
        timer0_en_write(0);
        timer0_reload_write(0);
@@ -478,19 +484,31 @@ static int test_user_abort(void)
        while(timer0_value_read()) {
                if(readchar_nonblock()) {
                        c = readchar();
-                       if((c == 'Q')||(c == '\e')) {
+                       if((c == 'Q')||(c == 'q')||(c == '\e')) {
                                puts("Aborted");
                                return 0;
                        }
-                       if(c == 0x06) {
+#ifdef FLASH_BOOT_ADDRESS
+                       if((c == 'F')||(c == 'f')) {
+                               flashboot();
+                               return 0;
+                       }
+#endif
+                       if((c == 'S')||(c == 's')) {
                                serialboot();
                                return 0;
                        }
 #ifdef CSR_ETHMAC_BASE
-                       if(c == 0x07) {
+                       if((c == 'N')||(c == 'n')) {
                                netboot();
                                return 0;
                        }
+#endif
+#ifdef ROM_BOOT_ADDRESS
+                       if((c == 'R')||(c == 'r')) {
+                               romboot();
+                               return 0;
+                       }
 #endif
                }
                timer0_update_value_write(1);