X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fravb.c;h=3dab91b74b455f65ec268bb9aa68daa7712d473a;hb=c05ed00afb95fa5237f16962fccf5810437317bf;hp=749562db960e59a8e7df3a0c8c7a6372b9b21e68;hpb=dc7df68f21093039b3ab1a1702f5b7cd3e621431;p=oweals%2Fu-boot.git diff --git a/drivers/net/ravb.c b/drivers/net/ravb.c index 749562db96..3dab91b74b 100644 --- a/drivers/net/ravb.c +++ b/drivers/net/ravb.c @@ -10,10 +10,14 @@ #include #include +#include #include #include +#include #include #include +#include +#include #include #include #include @@ -46,6 +50,8 @@ #define CSR_OPS 0x0000000F #define CSR_OPS_CONFIG BIT(1) +#define APSR_TDM BIT(14) + #define TCCR_TSRQ0 BIT(0) #define RFLR_RFL_MIN 0x05EE @@ -389,9 +395,14 @@ static int ravb_dmac_init(struct udevice *dev) /* FIFO size set */ writel(0x00222210, eth->iobase + RAVB_REG_TGC); - /* Delay CLK: 2ns */ - if (pdata->max_speed == 1000) - writel(BIT(14), eth->iobase + RAVB_REG_APSR); + /* Delay CLK: 2ns (not applicable on R-Car E3/D3) */ + if ((rmobile_get_cpu_type() == RMOBILE_CPU_TYPE_R8A77990) || + (rmobile_get_cpu_type() == RMOBILE_CPU_TYPE_R8A77995)) + return 0; + + if ((pdata->phy_interface == PHY_INTERFACE_MODE_RGMII_ID) || + (pdata->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID)) + writel(APSR_TDM, eth->iobase + RAVB_REG_APSR); return 0; }