Skip to content

Commit 70522f8

Browse files
committed
net: macb: add support for mii on rgmii
Cadence IP has option to enable MII support on RGMII interface. This could be selected though bit 28 of network control register. This option is not enabled on all the IP versions thus add a software capability to be selected by the proper implementation of this IP. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f023d81 commit 70522f8

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/net/ethernet/cadence/macb.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@
246246
#define MACB_SRTSM_OFFSET 15 /* Store Receive Timestamp to Memory */
247247
#define MACB_OSSMODE_OFFSET 24 /* Enable One Step Synchro Mode */
248248
#define MACB_OSSMODE_SIZE 1
249+
#define MACB_MIIONRGMII_OFFSET 28 /* MII Usage on RGMII Interface */
250+
#define MACB_MIIONRGMII_SIZE 1
249251

250252
/* Bitfields in NCFGR */
251253
#define MACB_SPD_OFFSET 0 /* Speed */
@@ -713,6 +715,7 @@
713715
#define MACB_CAPS_GEM_HAS_PTP 0x00000040
714716
#define MACB_CAPS_BD_RD_PREFETCH 0x00000080
715717
#define MACB_CAPS_NEEDS_RSTONUBR 0x00000100
718+
#define MACB_CAPS_MIIONRGMII 0x00000200
716719
#define MACB_CAPS_CLK_HW_CHG 0x04000000
717720
#define MACB_CAPS_MACB_IS_EMAC 0x08000000
718721
#define MACB_CAPS_FIFO_MODE 0x10000000

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,9 @@ static void macb_mac_config(struct phylink_config *config, unsigned int mode,
684684
} else if (state->interface == PHY_INTERFACE_MODE_10GBASER) {
685685
ctrl |= GEM_BIT(PCSSEL);
686686
ncr |= GEM_BIT(ENABLE_HS_MAC);
687+
} else if (bp->caps & MACB_CAPS_MIIONRGMII &&
688+
bp->phy_interface == PHY_INTERFACE_MODE_MII) {
689+
ncr |= MACB_BIT(MIIONRGMII);
687690
}
688691
}
689692

0 commit comments

Comments
 (0)