Skip to content

Commit

Permalink
net: stmmac: dwmac-meson8b: Add the PRG_ETH0_ADJ_* bits
Browse files Browse the repository at this point in the history
The PRG_ETH0_ADJ_* are used for applying the RGMII RX delay. The public
datasheets only have very limited description for these registers, but
Jianxin Pan provided more detailed documentation from an (unnamed)
Amlogic engineer. Add the PRG_ETH0_ADJ_* bits along with the improved
description.

Suggested-by: Jianxin Pan <jianxin.pan@amlogic.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Martin Blumenstingl authored and David S. Miller committed May 13, 2020
1 parent 889df20 commit c92d1d2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@
#define PRG_ETH0_INVERTED_RMII_CLK BIT(11)
#define PRG_ETH0_TX_AND_PHY_REF_CLK BIT(12)

/* Bypass (= 0, the signal from the GPIO input directly connects to the
* internal sampling) or enable (= 1) the internal logic for RXEN and RXD[3:0]
* timing tuning.
*/
#define PRG_ETH0_ADJ_ENABLE BIT(13)
/* Controls whether the RXEN and RXD[3:0] signals should be aligned with the
* input RX rising/falling edge and sent to the Ethernet internals. This sets
* the automatically delay and skew automatically (internally).
*/
#define PRG_ETH0_ADJ_SETUP BIT(14)
/* An internal counter based on the "timing-adjustment" clock. The counter is
* cleared on both, the falling and rising edge of the RX_CLK. This selects the
* delay (= the counter value) when to start sampling RXEN and RXD[3:0].
*/
#define PRG_ETH0_ADJ_DELAY GENMASK(19, 15)
/* Adjusts the skew between each bit of RXEN and RXD[3:0]. If a signal has a
* large input delay, the bit for that signal (RXEN = bit 0, RXD[3] = bit 1,
* ...) can be configured to be 1 to compensate for a delay of about 1ns.
*/
#define PRG_ETH0_ADJ_SKEW GENMASK(24, 20)

#define MUX_CLK_NUM_PARENTS 2

struct meson8b_dwmac;
Expand Down

0 comments on commit c92d1d2

Please sign in to comment.