summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Lojewski <github@meklort.com>2020-12-13 13:14:18 -0700
committerGitHub <noreply@github.com>2020-12-13 13:14:18 -0700
commit792c2cdc7dee1b36ffd3ef4f0e6a0fd852e988bd (patch)
tree5e6c0504325005297243e463ac393aa41f2b5021
parent0a181e22a50bbfd8200109b5d85a0010971c69ea (diff)
downloadbcm5719-ortega-792c2cdc7dee1b36ffd3ef4f0e6a0fd852e988bd.tar.gz
bcm5719-ortega-792c2cdc7dee1b36ffd3ef4f0e6a0fd852e988bd.zip
network: Update MAC TX lengths to match tg3 driver based on speed. (#191)
-rw-r--r--libs/Network/ports.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/libs/Network/ports.c b/libs/Network/ports.c
index 460d2d4..877d3ec 100644
--- a/libs/Network/ports.c
+++ b/libs/Network/ports.c
@@ -949,7 +949,7 @@ void Network_InitPort(NetworkPort_t *port, reload_type_t reset_phy)
RegDEVICETransmitMacLengths_t txMacLengths;
txMacLengths = port->device->TransmitMacLengths;
- txMacLengths.bits.SlotTimeLength = 0x21;
+ txMacLengths.bits.SlotTimeLength = 0x20;
txMacLengths.bits.IPGLength = 0x6;
txMacLengths.bits.IPGCRSLength = 0x2;
port->device->TransmitMacLengths = txMacLengths;
@@ -1102,6 +1102,24 @@ bool Network_updatePortState(NetworkPort_t *port)
{
// Update emac mode to match current state.
port->device->EmacMode = emacMode;
+
+ RegDEVICETransmitMacLengths_t txMacLengths;
+ txMacLengths = port->device->TransmitMacLengths;
+
+ // Per the tg3.c driver, update slot time length when in half duplex 1G mode.
+ if (emacMode.bits.PortMode == DEVICE_EMAC_MODE_PORT_MODE_1000 && emacMode.bits.HalfDuplex)
+ {
+ txMacLengths.bits.SlotTimeLength = 0xFF;
+ txMacLengths.bits.IPGLength = 0x6;
+ txMacLengths.bits.IPGCRSLength = 0x2;
+ }
+ else
+ {
+ txMacLengths.bits.SlotTimeLength = 0x20;
+ txMacLengths.bits.IPGLength = 0x6;
+ txMacLengths.bits.IPGCRSLength = 0x2;
+ }
+ port->device->TransmitMacLengths = txMacLengths;
}
updated = true;
OpenPOWER on IntegriCloud