Hi,
We are unable to set RMII mode in CPSW of ti8148. please help on this.
To set CPSW pad config for RMII mode, we did the following steps:
We do pin muxing for RMII mode based on board/ti/ti8148/mux.h (below code is the RMII pin select part) from function set_muxconf_regs()
/* -232 */ BIT(0), BIT(0), BIT(0), BIT(0), /* 232- EMAC_RMREFCLK */
/* -236 */ BIT(0), BIT(0), BIT(0), BIT(2), /* 236- EMAC[0]_RMRXD[0] */
/* -240 */ BIT(2), BIT(2), BIT(2), BIT(2), /* 237- EMAC[0]_RMRXD[1], 238- EMAC[0]_RMRXER, 239- EMAC[0]_RMCRSDV, 240- EMAC[0]_RMTXD[0] */
/* -244 */ BIT(2), BIT(2), BIT(0), BIT(0), /* 241- EMAC[0]_RMTXD[1], 242- EMAC[0]_RMTXEN */
To setup RMII_REFCLK to be sourced from audio_pll, we made CPSW mac clock as given below
/* setup RMII_REFCLK to be sourced from audio_pll */
__raw_writel(0x5,RMII_REFCLK_SRC);
/*program GMII_SEL register for RGMII mode */
/*__raw_writel(0x30a,GMII_SEL);*/ /* This is removed as per the assumption, it is for RGMII mode */
}