From 21e2a34c3fda459ac4dc930892112197a38c153b Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 18 May 2020 23:26:51 +0200 Subject: [PATCH] software/bios: rename commands to cmds and update with libs' names. --- litex/soc/software/bios/Makefile | 2 +- .../bios/{commands => cmds}/cmd_bios.c | 0 .../bios/{commands => cmds}/cmd_boot.c | 0 .../bios/{commands => cmds}/cmd_litedram.c | 24 +++++++++---------- .../bios/{commands => cmds}/cmd_liteeth.c | 6 ++--- .../bios/{commands => cmds}/cmd_litesdcard.c | 10 ++++---- .../bios/{commands => cmds}/cmd_mem.c | 0 .../bios/{commands => cmds}/cmd_spiflash.c | 0 litex/soc/software/bios/command.h | 21 ++++++++-------- 9 files changed, 31 insertions(+), 32 deletions(-) rename litex/soc/software/bios/{commands => cmds}/cmd_bios.c (100%) rename litex/soc/software/bios/{commands => cmds}/cmd_boot.c (100%) rename litex/soc/software/bios/{commands => cmds}/cmd_litedram.c (82%) rename litex/soc/software/bios/{commands => cmds}/cmd_liteeth.c (90%) rename litex/soc/software/bios/{commands => cmds}/cmd_litesdcard.c (83%) rename litex/soc/software/bios/{commands => cmds}/cmd_mem.c (100%) rename litex/soc/software/bios/{commands => cmds}/cmd_spiflash.c (100%) diff --git a/litex/soc/software/bios/Makefile b/litex/soc/software/bios/Makefile index a4c39660c..0e288a43b 100755 --- a/litex/soc/software/bios/Makefile +++ b/litex/soc/software/bios/Makefile @@ -85,7 +85,7 @@ endif %.o: $(BIOS_DIRECTORY)/%.c $(compile) -%.o: $(BIOS_DIRECTORY)/commands/%.c +%.o: $(BIOS_DIRECTORY)/cmds/%.c $(compile) %.o: $(BIOS_DIRECTORY)/%.S diff --git a/litex/soc/software/bios/commands/cmd_bios.c b/litex/soc/software/bios/cmds/cmd_bios.c similarity index 100% rename from litex/soc/software/bios/commands/cmd_bios.c rename to litex/soc/software/bios/cmds/cmd_bios.c diff --git a/litex/soc/software/bios/commands/cmd_boot.c b/litex/soc/software/bios/cmds/cmd_boot.c similarity index 100% rename from litex/soc/software/bios/commands/cmd_boot.c rename to litex/soc/software/bios/cmds/cmd_boot.c diff --git a/litex/soc/software/bios/commands/cmd_litedram.c b/litex/soc/software/bios/cmds/cmd_litedram.c similarity index 82% rename from litex/soc/software/bios/commands/cmd_litedram.c rename to litex/soc/software/bios/cmds/cmd_litedram.c index 0d05b2533..0b9ea2280 100644 --- a/litex/soc/software/bios/commands/cmd_litedram.c +++ b/litex/soc/software/bios/cmds/cmd_litedram.c @@ -36,7 +36,7 @@ static void sdrrow_handler(int nb_params, char **params) sdrrow(row); printf("Activated row %d", row); } -define_command(sdrrow, sdrrow_handler, "Precharge/Activate row", DRAM_CMDS); +define_command(sdrrow, sdrrow_handler, "Precharge/Activate row", LITEDRAM_CMDS); #endif /** @@ -46,7 +46,7 @@ define_command(sdrrow, sdrrow_handler, "Precharge/Activate row", DRAM_CMDS); * */ #ifdef CSR_SDRAM_BASE -define_command(sdrsw, sdrsw, "Gives SDRAM control to SW", DRAM_CMDS); +define_command(sdrsw, sdrsw, "Gives SDRAM control to SW", LITEDRAM_CMDS); #endif /** @@ -56,7 +56,7 @@ define_command(sdrsw, sdrsw, "Gives SDRAM control to SW", DRAM_CMDS); * */ #ifdef CSR_SDRAM_BASE -define_command(sdrhw, sdrhw, "Gives SDRAM control to HW", DRAM_CMDS); +define_command(sdrhw, sdrhw, "Gives SDRAM control to HW", LITEDRAM_CMDS); #endif /** @@ -71,7 +71,7 @@ static void sdrrdbuf_handler(int nb_params, char **params) sdrrdbuf(-1); } -define_command(sdrrdbuf, sdrrdbuf_handler, "Dump SDRAM read buffer", DRAM_CMDS); +define_command(sdrrdbuf, sdrrdbuf_handler, "Dump SDRAM read buffer", LITEDRAM_CMDS); #endif /** @@ -111,7 +111,7 @@ static void sdrrd_handler(int nb_params, char **params) sdrrd(addr, dq); } -define_command(sdrrd, sdrrd_handler, "Read SDRAM data", DRAM_CMDS); +define_command(sdrrd, sdrrd_handler, "Read SDRAM data", LITEDRAM_CMDS); #endif /** @@ -140,7 +140,7 @@ static void sdrrderr_handler(int nb_params, char **params) sdrrderr(count); } -define_command(sdrrderr, sdrrderr_handler, "Print SDRAM read errors", DRAM_CMDS); +define_command(sdrrderr, sdrrderr_handler, "Print SDRAM read errors", LITEDRAM_CMDS); #endif /** @@ -169,7 +169,7 @@ static void sdrwr_handler(int nb_params, char **params) sdrwr(addr); } -define_command(sdrwr, sdrwr_handler, "Write SDRAM test data", DRAM_CMDS); +define_command(sdrwr, sdrwr_handler, "Write SDRAM test data", LITEDRAM_CMDS); #endif /** @@ -179,7 +179,7 @@ define_command(sdrwr, sdrwr_handler, "Write SDRAM test data", DRAM_CMDS); * */ #if defined(CSR_SDRAM_BASE) && defined(CSR_DDRPHY_BASE) -define_command(sdrinit, sdrinit, "Start SDRAM initialisation", DRAM_CMDS); +define_command(sdrinit, sdrinit, "Start SDRAM initialisation", LITEDRAM_CMDS); #endif /** @@ -189,7 +189,7 @@ define_command(sdrinit, sdrinit, "Start SDRAM initialisation", DRAM_CMDS); * */ #if defined(CSR_DDRPHY_BASE) && defined(SDRAM_PHY_WRITE_LEVELING_CAPABLE) && defined(CSR_SDRAM_BASE) -define_command(sdrwlon, sdrwlon, "Enable write leveling", DRAM_CMDS); +define_command(sdrwlon, sdrwlon, "Enable write leveling", LITEDRAM_CMDS); #endif /** @@ -199,7 +199,7 @@ define_command(sdrwlon, sdrwlon, "Enable write leveling", DRAM_CMDS); * */ #if defined(CSR_DDRPHY_BASE) && defined(SDRAM_PHY_WRITE_LEVELING_CAPABLE) && defined(CSR_SDRAM_BASE) -define_command(sdrwloff, sdrwloff, "Disable write leveling", DRAM_CMDS); +define_command(sdrwloff, sdrwloff, "Disable write leveling", LITEDRAM_CMDS); #endif /** @@ -209,7 +209,7 @@ define_command(sdrwloff, sdrwloff, "Disable write leveling", DRAM_CMDS); * */ #if defined(CSR_DDRPHY_BASE) && defined(CSR_SDRAM_BASE) -define_command(sdrlevel, sdrlevel, "Perform read/write leveling", DRAM_CMDS); +define_command(sdrlevel, sdrlevel, "Perform read/write leveling", LITEDRAM_CMDS); #endif /** @@ -219,5 +219,5 @@ define_command(sdrlevel, sdrlevel, "Perform read/write leveling", DRAM_CMDS); * */ #ifdef CSR_SDRAM_BASE -define_command(memtest, memtest, "Run a memory test", DRAM_CMDS); +define_command(memtest, memtest, "Run a memory test", LITEDRAM_CMDS); #endif diff --git a/litex/soc/software/bios/commands/cmd_liteeth.c b/litex/soc/software/bios/cmds/cmd_liteeth.c similarity index 90% rename from litex/soc/software/bios/commands/cmd_liteeth.c rename to litex/soc/software/bios/cmds/cmd_liteeth.c index 86e8fc8a9..f9df1d248 100644 --- a/litex/soc/software/bios/commands/cmd_liteeth.c +++ b/litex/soc/software/bios/cmds/cmd_liteeth.c @@ -50,7 +50,7 @@ static void mdiow(int nb_params, char **params) mdio_write(phyadr2, reg2, val2); } -define_command(mdiow, mdiow, "Write MDIO register", MDIO_CMDS); +define_command(mdiow, mdiow, "Write MDIO register", LITEETH_CMDS); #endif /** @@ -88,7 +88,7 @@ static void mdior(int nb_params, char **params) printf("Reg %d: 0x%04x", reg2, val); } -define_command(mdior, mdior, "Read MDIO register", MDIO_CMDS); +define_command(mdior, mdior, "Read MDIO register", LITEETH_CMDS); #endif /** @@ -130,5 +130,5 @@ static void mdiod(int nb_params, char **params) } } -define_command(mdiod, mdiod, "Dump MDIO registers", MDIO_CMDS); +define_command(mdiod, mdiod, "Dump MDIO registers", LITEETH_CMDS); #endif diff --git a/litex/soc/software/bios/commands/cmd_litesdcard.c b/litex/soc/software/bios/cmds/cmd_litesdcard.c similarity index 83% rename from litex/soc/software/bios/commands/cmd_litesdcard.c rename to litex/soc/software/bios/cmds/cmd_litesdcard.c index 63347667d..d5d1651f8 100644 --- a/litex/soc/software/bios/commands/cmd_litesdcard.c +++ b/litex/soc/software/bios/cmds/cmd_litesdcard.c @@ -43,7 +43,7 @@ struct command_struct cmd_sdclk = .help = "SDCard set clk frequency (Mhz)", }; -define_command(sdclk, sdclk, "SDCard set clk frequency (Mhz)", SD_CMDS); +define_command(sdclk, sdclk, "SDCard set clk frequency (Mhz)", LITESDCARD_CMDS); #endif /** @@ -53,7 +53,7 @@ define_command(sdclk, sdclk, "SDCard set clk frequency (Mhz)", SD_CMDS); * */ #ifdef CSR_SDCORE_BASE -define_command(sdinit, sdcard_init, "SDCard initialization", SD_CMDS); +define_command(sdinit, sdcard_init, "SDCard initialization", LITESDCARD_CMDS); #endif /** @@ -82,7 +82,7 @@ static void sdtest(int nb_params, char **params) sdcard_test(blocks); } -define_command(sdtest, sdtest, "SDCard test", SD_CMDS); +define_command(sdtest, sdtest, "SDCard test", LITESDCARD_CMDS); #endif /** @@ -111,7 +111,7 @@ static void sdtestread(int nb_params, char **params) sdcard_test_read(block); } -define_command(sdtestread, sdtestread, "SDCard test read", SD_CMDS); +define_command(sdtestread, sdtestread, "SDCard test read", LITESDCARD_CMDS); #endif /** @@ -140,5 +140,5 @@ static void sdtestwrite(int nb_params, char **params) sdcard_test_write(block, params[1]); } -define_command(sdtestwrite, sdtestwrite, "SDCard test write", SD_CMDS); +define_command(sdtestwrite, sdtestwrite, "SDCard test write", LITESDCARD_CMDS); #endif diff --git a/litex/soc/software/bios/commands/cmd_mem.c b/litex/soc/software/bios/cmds/cmd_mem.c similarity index 100% rename from litex/soc/software/bios/commands/cmd_mem.c rename to litex/soc/software/bios/cmds/cmd_mem.c diff --git a/litex/soc/software/bios/commands/cmd_spiflash.c b/litex/soc/software/bios/cmds/cmd_spiflash.c similarity index 100% rename from litex/soc/software/bios/commands/cmd_spiflash.c rename to litex/soc/software/bios/cmds/cmd_spiflash.c diff --git a/litex/soc/software/bios/command.h b/litex/soc/software/bios/command.h index 693d79825..1640231ff 100644 --- a/litex/soc/software/bios/command.h +++ b/litex/soc/software/bios/command.h @@ -9,17 +9,16 @@ #define HIST_DEPTH 10 /* Used in string list, complete.c */ -#define MISC_CMDS 0 -#define SYSTEM_CMDS 1 -#define CACHE_CMDS 2 -#define BOOT_CMDS 3 -#define DRAM_CMDS 4 -#define MDIO_CMDS 5 -#define MEM_CMDS 6 -#define SD_CMDS 7 -#define SPIFLASH_CMDS 8 -#define DDR_CMDS 9 -#define NB_OF_GROUPS 10 +#define MISC_CMDS 0 +#define SYSTEM_CMDS 1 +#define CACHE_CMDS 2 +#define MEM_CMDS 3 +#define BOOT_CMDS 3 +#define SPIFLASH_CMDS 4 +#define LITEDRAM_CMDS 4 +#define LITEETH_CMDS 5 +#define LITESDCARD_CMDS 7 +#define NB_OF_GROUPS 8 typedef void (*cmd_handler)(int nb_params, char **params);