Changeset 45523


Ignore:
Timestamp:
2015-04-20T17:00:52+02:00 (3 years ago)
Author:
nbd
Message:

ar71xx: add a helper function to set RXDV/RXD of ETH_CFG on AR934x

The ETH_RXDV_DELAY (17:16) and ETH_RXD_DELAY (15:14) are currently not cleared
by the function ath79_setup_ar934x_eth_cfg. Clearing these in the
ath79_setup_ar934x_eth_cfg may cause problems on some hardware because they
rely on the preset value by the bootloader.

Instead another function is introduced which also works on ETH_CFG on AR934x.
It can be used to safely clear and set ETH_RXDV_DELAY and ETH_RXD_DELAY on
machines which require special settings.

Signed-off-by: Sven Eckelmann <sven@…>

Location:
trunk/target/linux/ar71xx/files/arch/mips/ath79
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c

    r43540 r45523  
    770770} 
    771771 
     772void __init ath79_setup_ar934x_eth_rx_delay(unsigned int rxd, 
     773                                            unsigned int rxdv) 
     774{ 
     775        void __iomem *base; 
     776        u32 t; 
     777 
     778        rxd &= AR934X_ETH_CFG_RXD_DELAY_MASK; 
     779        rxdv &= AR934X_ETH_CFG_RDV_DELAY_MASK; 
     780 
     781        base = ioremap(AR934X_GMAC_BASE, AR934X_GMAC_SIZE); 
     782 
     783        t = __raw_readl(base + AR934X_GMAC_REG_ETH_CFG); 
     784 
     785        t &= ~(AR934X_ETH_CFG_RXD_DELAY_MASK << AR934X_ETH_CFG_RXD_DELAY_SHIFT | 
     786               AR934X_ETH_CFG_RDV_DELAY_MASK << AR934X_ETH_CFG_RDV_DELAY_SHIFT); 
     787 
     788        t |= (rxd << AR934X_ETH_CFG_RXD_DELAY_SHIFT | 
     789              rxdv << AR934X_ETH_CFG_RDV_DELAY_SHIFT); 
     790 
     791        __raw_writel(t, base + AR934X_GMAC_REG_ETH_CFG); 
     792        /* flush write */ 
     793        __raw_readl(base + AR934X_GMAC_REG_ETH_CFG); 
     794 
     795        iounmap(base); 
     796} 
     797 
    772798void __init ath79_setup_qca955x_eth_cfg(u32 mask) 
    773799{ 
  • trunk/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.h

    r41623 r45523  
    4848void ath79_setup_ar933x_phy4_switch(bool mac, bool mdio); 
    4949void ath79_setup_ar934x_eth_cfg(u32 mask); 
     50void ath79_setup_ar934x_eth_rx_delay(unsigned int rxd, unsigned int rxdv); 
    5051void ath79_setup_qca955x_eth_cfg(u32 mask); 
    5152 
Note: See TracChangeset for help on using the changeset viewer.