diff options
| author | Mikhail Kshevetskiy <[email protected]> | 2025-07-09 12:28:10 +0300 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-07-15 09:56:01 -0600 |
| commit | 0e59a2ca9d29da7e87de2089bbeb77cdc9e927b2 (patch) | |
| tree | b3f0fe43bc37d66082c1d79212611c63be907dcc /drivers/net | |
| parent | 997786bbf473b3567bea5fa7ead21a8a9299c2ee (diff) | |
drivers/net/airoha_eth: enable hw padding of short tx packets
Transmission of short packets does not work good for XFI (GDM2) and
HSGMII (GDM3) interfaces. The issue can be solved with:
- padding of short packets to 60 bytes
- setting of PAD_EN bit in the corresponding REG_GDM_FWD_CFG(n)
register.
The issue should present for the lan switch (GDM1) as well, but it does
does not appear due to unknown reason.
This patch set PAD_EN bit for the used GDM.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Diffstat (limited to 'drivers/net')
| -rw-r--r-- | drivers/net/airoha_eth.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c index 477a132fb1f..6588eb3a806 100644 --- a/drivers/net/airoha_eth.c +++ b/drivers/net/airoha_eth.c @@ -97,6 +97,7 @@ (_n) == 2 ? GDM2_BASE : GDM1_BASE) #define REG_GDM_FWD_CFG(_n) GDM_BASE(_n) +#define GDM_PAD_EN BIT(28) #define GDM_DROP_CRC_ERR BIT(23) #define GDM_IP4_CKSUM BIT(22) #define GDM_TCP_CKSUM BIT(21) @@ -380,8 +381,11 @@ static void airoha_fe_maccr_init(struct airoha_eth *eth) int p; for (p = 1; p <= ARRAY_SIZE(eth->ports); p++) { - /* Disable any kind of CRC drop or offload */ - airoha_fe_wr(eth, REG_GDM_FWD_CFG(p), 0); + /* + * Disable any kind of CRC drop or offload. + * Enable padding of short TX packets to 60 bytes. + */ + airoha_fe_wr(eth, REG_GDM_FWD_CFG(p), GDM_PAD_EN); } } @@ -830,6 +834,11 @@ static int airoha_eth_send(struct udevice *dev, void *packet, int length) u32 val; int i; + /* + * There is no need to pad short TX packets to 60 bytes since the + * GDM_PAD_EN bit set in the corresponding REG_GDM_FWD_CFG(n) register. + */ + dma_addr = dma_map_single(packet, length, DMA_TO_DEVICE); qid = 0; |
