aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-01-31 17:56:30 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-01-31 17:56:30 +0000
commita6165a962c980d78c257b209b18988265f8c5c8b (patch)
tree630f9e91c1fe0ac2f0ddf0cb661b8e56305b4c94 /target
parent79d995936f90b938779622fd226e3587a88e288f (diff)
downloadupstream-a6165a962c980d78c257b209b18988265f8c5c8b.tar.gz
upstream-a6165a962c980d78c257b209b18988265f8c5c8b.tar.bz2
upstream-a6165a962c980d78c257b209b18988265f8c5c8b.zip
ramips_eth: pass sys_clk via platform_data
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19462 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ramips/files/arch/mips/include/asm/mach-ralink/ramips_eth_platform.h1
-rw-r--r--target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c4
-rw-r--r--target/linux/ramips/files/drivers/net/ramips.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/ramips_eth_platform.h b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/ramips_eth_platform.h
index a60a572f5f..ec1e7d4fa2 100644
--- a/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/ramips_eth_platform.h
+++ b/target/linux/ramips/files/arch/mips/include/asm/mach-ralink/ramips_eth_platform.h
@@ -24,6 +24,7 @@ struct ramips_eth_platform_data
unsigned char mac[6];
void (*reset_fe)(void);
int min_pkt_len;
+ unsigned long sys_freq;
};
#endif /* _RAMIPS_ETH_PLATFORM_H */
diff --git a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
index 4ad93b580d..6a810a3a0a 100644
--- a/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
+++ b/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
@@ -118,7 +118,7 @@ static struct resource rt305x_eth_resources[] = {
static struct ramips_eth_platform_data ramips_eth_data = {
.mac = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 },
.reset_fe = rt305x_fe_reset,
- .min_pkt_len = 64
+ .min_pkt_len = 64,
};
static struct platform_device rt305x_eth_device = {
@@ -132,5 +132,7 @@ static struct platform_device rt305x_eth_device = {
void __init rt305x_register_ethernet(void)
{
+ ramips_eth_data.sys_freq = rt305x_sys_freq;
+
platform_device_register(&rt305x_eth_device);
}
diff --git a/target/linux/ramips/files/drivers/net/ramips.c b/target/linux/ramips/files/drivers/net/ramips.c
index d8be97c7a7..d3df2f2588 100644
--- a/target/linux/ramips/files/drivers/net/ramips.c
+++ b/target/linux/ramips/files/drivers/net/ramips.c
@@ -332,7 +332,7 @@ ramips_eth_open(struct net_device *dev)
RAMIPS_PDMA_GLO_CFG);
ramips_fe_wr((ramips_fe_rr(RAMIPS_FE_GLO_CFG) &
~(RAMIPS_US_CYC_CNT_MASK << RAMIPS_US_CYC_CNT_SHIFT)) |
- ((rt305x_sys_freq / RAMIPS_US_CYC_CNT_DIVISOR) << RAMIPS_US_CYC_CNT_SHIFT),
+ ((priv->plat->sys_freq / RAMIPS_US_CYC_CNT_DIVISOR) << RAMIPS_US_CYC_CNT_SHIFT),
RAMIPS_FE_GLO_CFG);
tasklet_init(&priv->tx_housekeeping_tasklet, ramips_eth_tx_housekeeping,