software/bios/commands: rename cmd_mdio to cmd_liteeth.
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 18 May 2020 20:16:20 +0000 (22:16 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 18 May 2020 20:16:20 +0000 (22:16 +0200)
litex/soc/software/bios/Makefile
litex/soc/software/bios/commands/cmd_liteeth.c [new file with mode: 0644]
litex/soc/software/bios/commands/cmd_mdio.c [deleted file]

index 8d4090b7bf8822a849f6bb1d5d28660cc9d77f65..fe809fe874d4c87690efb3224b74785e03ebcc42 100755 (executable)
@@ -20,7 +20,7 @@ OBJECTS = isr.o                       \
          cmd_bios.o            \
          cmd_boot.o            \
          cmd_dram.o            \
-         cmd_mdio.o            \
+         cmd_liteeth.o         \
          cmd_mem.o             \
          cmd_sdcard.o          \
          cmd_spi_flash.o       \
diff --git a/litex/soc/software/bios/commands/cmd_liteeth.c b/litex/soc/software/bios/commands/cmd_liteeth.c
new file mode 100644 (file)
index 0000000..86e8fc8
--- /dev/null
@@ -0,0 +1,134 @@
+// SPDX-License-Identifier: BSD-Source-Code
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <generated/csr.h>
+
+#include "mdio.h"
+
+#include "../command.h"
+#include "../helpers.h"
+
+/**
+ * Command "mdiow"
+ *
+ * Write MDIO register
+ *
+ */
+#ifdef CSR_ETHPHY_MDIO_W_ADDR
+static void mdiow(int nb_params, char **params)
+{
+       char *c;
+       unsigned int phyadr2;
+       unsigned int reg2;
+       unsigned int val2;
+
+       if (nb_params < 3) {
+               printf("mdiow <phyadr> <reg> <value>");
+               return;
+       }
+
+       phyadr2 = strtoul(params[0], &c, 0);
+       if (*c != 0) {
+               printf("Incorrect phyadr");
+               return;
+       }
+
+       reg2 = strtoul(params[1], &c, 0);
+       if (*c != 0) {
+               printf("Incorrect reg");
+               return;
+       }
+
+       val2 = strtoul(params[2], &c, 0);
+       if (*c != 0) {
+               printf("Incorrect val");
+               return;
+       }
+
+       mdio_write(phyadr2, reg2, val2);
+}
+
+define_command(mdiow, mdiow, "Write MDIO register", MDIO_CMDS);
+#endif
+
+/**
+ * Command "mdior"
+ *
+ * Read MDIO register
+ *
+ */
+#ifdef CSR_ETHPHY_MDIO_W_ADDR
+static void mdior(int nb_params, char **params)
+{
+       char *c;
+       unsigned int phyadr2;
+       unsigned int reg2;
+       unsigned int val;
+
+       if (nb_params < 2) {
+               printf("mdior <phyadr> <reg>");
+               return;
+       }
+
+       phyadr2 = strtoul(params[0], &c, 0);
+       if (*c != 0) {
+               printf("Incorrect phyadr");
+               return;
+       }
+
+       reg2 = strtoul(params[1], &c, 0);
+       if (*c != 0) {
+               printf("Incorrect reg");
+               return;
+       }
+
+       val = mdio_read(phyadr2, reg2);
+       printf("Reg %d: 0x%04x", reg2, val);
+}
+
+define_command(mdior, mdior, "Read MDIO register", MDIO_CMDS);
+#endif
+
+/**
+ * Command "mdiod"
+ *
+ * Dump MDIO registers
+ *
+ */
+#ifdef CSR_ETHPHY_MDIO_W_ADDR
+static void mdiod(int nb_params, char **params)
+{
+       char *c;
+       unsigned int phyadr;
+       unsigned int count;
+       unsigned int val;
+       int i;
+
+       if (nb_params < 2) {
+               printf("mdiod <phyadr> <count>");
+               return;
+       }
+
+       phyadr = strtoul(params[0], &c, 0);
+       if (*c != 0) {
+               printf("Incorrect phyadr");
+               return;
+       }
+
+       count = strtoul(params[1], &c, 0);
+       if (*c != 0) {
+               printf("Incorrect count");
+               return;
+       }
+
+       printf("MDIO dump @0x%x:\n", phyadr);
+       for (i = 0; i < count; i++) {
+               val = mdio_read(phyadr, i);
+               printf("reg %d: 0x%04x", i, val);
+       }
+}
+
+define_command(mdiod, mdiod, "Dump MDIO registers", MDIO_CMDS);
+#endif
diff --git a/litex/soc/software/bios/commands/cmd_mdio.c b/litex/soc/software/bios/commands/cmd_mdio.c
deleted file mode 100644 (file)
index 86e8fc8..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-// SPDX-License-Identifier: BSD-Source-Code
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <generated/csr.h>
-
-#include "mdio.h"
-
-#include "../command.h"
-#include "../helpers.h"
-
-/**
- * Command "mdiow"
- *
- * Write MDIO register
- *
- */
-#ifdef CSR_ETHPHY_MDIO_W_ADDR
-static void mdiow(int nb_params, char **params)
-{
-       char *c;
-       unsigned int phyadr2;
-       unsigned int reg2;
-       unsigned int val2;
-
-       if (nb_params < 3) {
-               printf("mdiow <phyadr> <reg> <value>");
-               return;
-       }
-
-       phyadr2 = strtoul(params[0], &c, 0);
-       if (*c != 0) {
-               printf("Incorrect phyadr");
-               return;
-       }
-
-       reg2 = strtoul(params[1], &c, 0);
-       if (*c != 0) {
-               printf("Incorrect reg");
-               return;
-       }
-
-       val2 = strtoul(params[2], &c, 0);
-       if (*c != 0) {
-               printf("Incorrect val");
-               return;
-       }
-
-       mdio_write(phyadr2, reg2, val2);
-}
-
-define_command(mdiow, mdiow, "Write MDIO register", MDIO_CMDS);
-#endif
-
-/**
- * Command "mdior"
- *
- * Read MDIO register
- *
- */
-#ifdef CSR_ETHPHY_MDIO_W_ADDR
-static void mdior(int nb_params, char **params)
-{
-       char *c;
-       unsigned int phyadr2;
-       unsigned int reg2;
-       unsigned int val;
-
-       if (nb_params < 2) {
-               printf("mdior <phyadr> <reg>");
-               return;
-       }
-
-       phyadr2 = strtoul(params[0], &c, 0);
-       if (*c != 0) {
-               printf("Incorrect phyadr");
-               return;
-       }
-
-       reg2 = strtoul(params[1], &c, 0);
-       if (*c != 0) {
-               printf("Incorrect reg");
-               return;
-       }
-
-       val = mdio_read(phyadr2, reg2);
-       printf("Reg %d: 0x%04x", reg2, val);
-}
-
-define_command(mdior, mdior, "Read MDIO register", MDIO_CMDS);
-#endif
-
-/**
- * Command "mdiod"
- *
- * Dump MDIO registers
- *
- */
-#ifdef CSR_ETHPHY_MDIO_W_ADDR
-static void mdiod(int nb_params, char **params)
-{
-       char *c;
-       unsigned int phyadr;
-       unsigned int count;
-       unsigned int val;
-       int i;
-
-       if (nb_params < 2) {
-               printf("mdiod <phyadr> <count>");
-               return;
-       }
-
-       phyadr = strtoul(params[0], &c, 0);
-       if (*c != 0) {
-               printf("Incorrect phyadr");
-               return;
-       }
-
-       count = strtoul(params[1], &c, 0);
-       if (*c != 0) {
-               printf("Incorrect count");
-               return;
-       }
-
-       printf("MDIO dump @0x%x:\n", phyadr);
-       for (i = 0; i < count; i++) {
-               val = mdio_read(phyadr, i);
-               printf("reg %d: 0x%04x", i, val);
-       }
-}
-
-define_command(mdiod, mdiod, "Dump MDIO registers", MDIO_CMDS);
-#endif