1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 08:01:08 +02:00

ramips: ramips_esw: move hardware initialization into a separate function

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24330 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2010-12-08 10:14:58 +00:00
parent 1fcc0bf36c
commit a3373ca948

View File

@ -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;
}