software/bios/main: revert USDDRPHY_DEBUG (merge issue with SPI SD CARD PR).
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 19 Mar 2020 09:47:28 +0000 (10:47 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 19 Mar 2020 09:47:28 +0000 (10:47 +0100)
litex/soc/software/bios/main.c

index d1ca017e240fd84453539a60652a9ffd7eefe1f0..460563f8b4008fc1360bef973859f0271eefac61 100644 (file)
@@ -388,6 +388,13 @@ static void help(void)
        puts("sdinit         - SDCard initialization");
        puts("sdtest <loops> - SDCard test");
 #endif
+#ifdef USDDRPHY_DEBUG
+       puts("");
+       puts("sdram_cdly value                - Set SDRAM clk/cmd delay");
+       puts("sdram_cal                       - run SDRAM calibration");
+       puts("sdram_mpr                       - read SDRAM MPR");
+       puts("sdram_mrwr reg value            - write SDRAM mode registers");
+#endif
 #ifdef CSR_SPI_BASE
         puts("spisdboot   - boot from SDCard via SPI hardware bitbang");
 #endif
@@ -482,6 +489,24 @@ static void do_command(char *c)
        else if(strcmp(token, "sdinit") == 0) sdcard_init();
        else if(strcmp(token, "sdtest") == 0) sdcard_test(atoi(get_token(&c)));
 #endif
+#ifdef USDDRPHY_DEBUG
+       else if(strcmp(token, "sdram_cdly") == 0)
+               ddrphy_cdly(atoi(get_token(&c)));
+       else if(strcmp(token, "sdram_cal") == 0)
+               sdrcal();
+       else if(strcmp(token, "sdram_mpr") == 0)
+               sdrmpr();
+       else if(strcmp(token, "sdram_mrwr") == 0) {
+               unsigned int reg;
+               unsigned int value;
+               reg = atoi(get_token(&c));
+               value = atoi(get_token(&c));
+               sdrsw();
+               printf("Writing 0x%04x to SDRAM mode register %d\n", value, reg);
+               sdrmrwr(reg, value);
+               sdrhw();
+       }
+#endif
 #ifdef CSR_SPI_BASE
         else if(strcmp(token, "spisdboot") == 0) spisdboot();
 #endif