aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-12-08 10:14:58 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-12-08 10:14:58 +0000
commit889729df016ab162aeb1092628f70e742a6aede5 (patch)
tree4212039ab53dd9161841b23e91cd848ff7480e93 /target
parent8957f39064daaf2d6df0599543fc27093431ecc0 (diff)
downloadupstream-889729df016ab162aeb1092628f70e742a6aede5.tar.gz
upstream-889729df016ab162aeb1092628f70e742a6aede5.tar.bz2
upstream-889729df016ab162aeb1092628f70e742a6aede5.zip
ramips: ramips_esw: move hardware initialization into a separate function
SVN-Revision: 24330
Diffstat (limited to 'target')
-rw-r--r--target/linux/ramips/files/drivers/net/ramips_esw.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/target/linux/ramips/files/drivers/net/ramips_esw.c b/target/linux/ramips/files/drivers/net/ramips_esw.c
index e4c8ea3dbf..e8041b48df 100644
--- a/target/linux/ramips/files/drivers/net/ramips_esw.c
+++ b/target/linux/ramips/files/drivers/net/ramips_esw.c
@@ -75,17 +75,11 @@ out:
return ret;
}
-static int
-rt305x_esw_init(void)
+static void
+rt305x_esw_hw_init(struct rt305x_esw *esw)
{
- struct rt305x_esw *esw;
int i;
- esw = &rt305x_esw;
- esw->base = ioremap_nocache(RT305X_SWITCH_BASE, PAGE_SIZE);
- if(!esw->base)
- return -ENOMEM;
-
/* vodoo from original driver */
ramips_esw_wr(esw, 0xC8A07850, 0x08);
ramips_esw_wr(esw, 0x00000000, 0xe4);
@@ -124,6 +118,18 @@ rt305x_esw_init(void)
/* set default vlan */
ramips_esw_wr(esw, 0x2001, 0x50);
ramips_esw_wr(esw, 0x504f, 0x70);
+}
+
+static int
+rt305x_esw_init(void)
+{
+ struct rt305x_esw *esw;
+
+ esw = &rt305x_esw;
+ esw->base = ioremap_nocache(RT305X_SWITCH_BASE, PAGE_SIZE);
+ if(!esw->base)
+ return -ENOMEM;
+ rt305x_esw_hw_init(esw);
return 0;
}