Commit 956378683146578d0d069dace8c91c56dc09d743

Authored by Trent Piepho
Committed by Joe Hershberger
1 parent 4ef3231b63

cmd: mii: Add the standard 1000BASE-T registers

These are standard across gigabit phys.  These mostly extend the
auto-negotiation information with gigabit fields.

Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Showing 1 changed file with 29 additions and 5 deletions Side-by-side Diff

... ... @@ -91,6 +91,28 @@
91 91 { 4, 0, 0x1f, "partner selector" },
92 92 };
93 93  
  94 +static const MII_field_desc_t reg_9_desc_tbl[] = {
  95 + { 15, 13, 0x07, "test mode" },
  96 + { 12, 12, 0x01, "manual master/slave enable" },
  97 + { 11, 11, 0x01, "manual master/slave value" },
  98 + { 10, 10, 0x01, "multi/single port" },
  99 + { 9, 9, 0x01, "1000BASE-T full duplex able" },
  100 + { 8, 8, 0x01, "1000BASE-T half duplex able" },
  101 + { 7, 7, 0x01, "automatic TDR on link down" },
  102 + { 6, 6, 0x7f, "(reserved)" },
  103 +};
  104 +
  105 +static const MII_field_desc_t reg_10_desc_tbl[] = {
  106 + { 15, 15, 0x01, "master/slave config fault" },
  107 + { 14, 14, 0x01, "master/slave config result" },
  108 + { 13, 13, 0x01, "local receiver status OK" },
  109 + { 12, 12, 0x01, "remote receiver status OK" },
  110 + { 11, 11, 0x01, "1000BASE-T full duplex able" },
  111 + { 10, 10, 0x01, "1000BASE-T half duplex able" },
  112 + { 9, 8, 0x03, "(reserved)" },
  113 + { 7, 0, 0xff, "1000BASE-T idle error counter"},
  114 +};
  115 +
94 116 typedef struct _MII_reg_desc_t {
95 117 ushort regno;
96 118 const MII_field_desc_t *pdesc;
... ... @@ -111,6 +133,10 @@
111 133 "Autonegotiation advertisement register" },
112 134 { MII_LPA, reg_5_desc_tbl, ARRAY_SIZE(reg_5_desc_tbl),
113 135 "Autonegotiation partner abilities register" },
  136 + { MII_CTRL1000, reg_9_desc_tbl, ARRAY_SIZE(reg_9_desc_tbl),
  137 + "1000BASE-T control register" },
  138 + { MII_STAT1000, reg_10_desc_tbl, ARRAY_SIZE(reg_10_desc_tbl),
  139 + "1000BASE-T status register" },
114 140 };
115 141  
116 142 static void dump_reg(
117 143  
... ... @@ -390,12 +416,10 @@
390 416 }
391 417 }
392 418 } else if (strncmp(op, "du", 2) == 0) {
393   - ushort regs[6];
  419 + ushort regs[MII_STAT1000 + 1]; /* Last reg is 0x0a */
394 420 int ok = 1;
395   - if ((reglo > 5) || (reghi > 5)) {
396   - printf(
397   - "The MII dump command only formats the "
398   - "standard MII registers, 0-5.\n");
  421 + if (reglo > MII_STAT1000 || reghi > MII_STAT1000) {
  422 + printf("The MII dump command only formats the standard MII registers, 0-5, 9-a.\n");
399 423 return 1;
400 424 }
401 425 for (addr = addrlo; addr <= addrhi; addr++) {