diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2009-11-30 13:53:39 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2009-11-30 13:53:39 +0000 |
commit | 35dbf66787d0b33738b475e8af504bcd8e2dea3e (patch) | |
tree | bf304f139388d014daa78a990f2d519530ca23cd | |
parent | cbae183c9e9ab18059d72fddc4331005861671fa (diff) | |
download | mtk-20170518-35dbf66787d0b33738b475e8af504bcd8e2dea3e.zip mtk-20170518-35dbf66787d0b33738b475e8af504bcd8e2dea3e.tar.gz mtk-20170518-35dbf66787d0b33738b475e8af504bcd8e2dea3e.tar.bz2 |
ar71xx: override fifo_cfg[123] values on AR7240
SVN-Revision: 18614
5 files changed, 29 insertions, 6 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c index 10f7e8e..1d13ce9 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-wr741nd.c @@ -151,12 +151,18 @@ static void __init tl_wr741nd_setup(void) ar71xx_eth0_data.phy_mask = 0x0; ar71xx_eth0_data.speed = SPEED_100; ar71xx_eth0_data.duplex = DUPLEX_FULL; + ar71xx_eth0_data.fifo_cfg1 = 0x0fff0000; + ar71xx_eth0_data.fifo_cfg2 = 0x00001fff; + ar71xx_eth0_data.fifo_cfg3 = 0x008001ff; /* LAN ports */ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII; ar71xx_eth1_data.phy_mask = 0x0; ar71xx_eth1_data.speed = SPEED_1000; ar71xx_eth1_data.duplex = DUPLEX_FULL; + ar71xx_eth1_data.fifo_cfg1 = 0x0fff0000; + ar71xx_eth1_data.fifo_cfg2 = 0x00001fff; + ar71xx_eth1_data.fifo_cfg3 = 0x008001ff; ar71xx_add_device_eth(1); ar71xx_add_device_eth(0); diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c index 9b70f8d..371ac0f 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-ubnt.c @@ -292,9 +292,11 @@ static void __init ubnt_m_setup(void) ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; ar71xx_eth0_data.phy_mask = 0; - ar71xx_eth0_data.speed = SPEED_100; ar71xx_eth0_data.duplex = DUPLEX_FULL; + ar71xx_eth0_data.fifo_cfg1 = 0x0010ffff; + ar71xx_eth0_data.fifo_cfg2 = 0x015500aa; + ar71xx_eth0_data.fifo_cfg3 = 0x01f00140; ar71xx_add_device_eth(0); @@ -325,9 +327,11 @@ static void __init ubnt_nano_m_setup(void) ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII; ar71xx_eth1_data.phy_mask = 0; - ar71xx_eth1_data.speed = SPEED_1000; ar71xx_eth1_data.duplex = DUPLEX_FULL; + ar71xx_eth1_data.fifo_cfg1 = 0x0010ffff; + ar71xx_eth1_data.fifo_cfg2 = 0x015500aa; + ar71xx_eth1_data.fifo_cfg3 = 0x01f00140; ar71xx_add_device_eth(1); } diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/platform.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/platform.h index 52f41f4..baded8b 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/platform.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/platform.h @@ -33,6 +33,10 @@ struct ag71xx_platform_data { void (* ddr_flush)(void); void (* set_pll)(int speed); + + u32 fifo_cfg1; + u32 fifo_cfg2; + u32 fifo_cfg3; }; struct ag71xx_mdio_platform_data { diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c index 9442047..72d2acc 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c @@ -402,8 +402,13 @@ static void ag71xx_hw_init(struct ag71xx *ag) /* setup FIFO configuration registers */ ag71xx_wr(ag, AG71XX_REG_FIFO_CFG0, FIFO_CFG0_INIT); - ag71xx_wr(ag, AG71XX_REG_FIFO_CFG1, 0x0fff0000); - ag71xx_wr(ag, AG71XX_REG_FIFO_CFG2, 0x00001fff); + if (pdata->is_ar724x) { + ag71xx_wr(ag, AG71XX_REG_FIFO_CFG1, pdata->fifo_cfg1); + ag71xx_wr(ag, AG71XX_REG_FIFO_CFG2, pdata->fifo_cfg2); + } else { + ag71xx_wr(ag, AG71XX_REG_FIFO_CFG1, 0x0fff0000); + ag71xx_wr(ag, AG71XX_REG_FIFO_CFG2, 0x00001fff); + } ag71xx_wr(ag, AG71XX_REG_FIFO_CFG4, FIFO_CFG4_INIT); ag71xx_wr(ag, AG71XX_REG_FIFO_CFG5, FIFO_CFG5_INIT); diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c index 6fe4d40..176edda 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c @@ -72,8 +72,12 @@ static void ag71xx_phy_link_update(struct ag71xx *ag) return; } - ag71xx_wr(ag, AG71XX_REG_FIFO_CFG3, - pdata->is_ar91xx ? 0x780fff : 0x008001ff); + if (pdata->is_ar91xx) + ag71xx_wr(ag, AG71XX_REG_FIFO_CFG3, 0x00780fff); + else if (pdata->is_ar724x) + ag71xx_wr(ag, AG71XX_REG_FIFO_CFG3, pdata->fifo_cfg3); + else + ag71xx_wr(ag, AG71XX_REG_FIFO_CFG3, 0x008001ff); if (pdata->set_pll) pdata->set_pll(ag->speed); |