summaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-12-03 15:54:08 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2008-12-03 15:54:08 +0000
commitf241cac466e5041027d5513b68c932a5b438698f (patch)
tree84acca7e9c785c3158b174aec402673a0f285c53 /target/linux
parenta4f34dd3dba33aeb8517e358ad02bb40b7436c75 (diff)
[ar71xx] create platform data for the EHCI driver
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13499 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/platform.c29
-rw-r--r--target/linux/ar71xx/files/drivers/usb/host/ehci-ar71xx.c2
-rw-r--r--target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h4
3 files changed, 32 insertions, 3 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
index d3a7e9e9c..ad22e06e1 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/platform.c
@@ -68,7 +68,10 @@ static struct resource ar71xx_ehci_resources[] = {
},
};
+
static u64 ar71xx_ehci_dmamask = DMA_BIT_MASK(32);
+static struct ar71xx_ehci_platform_data ar71xx_ehci_data;
+
static struct platform_device ar71xx_ehci_device = {
.name = "ar71xx-ehci",
.id = -1,
@@ -77,6 +80,7 @@ static struct platform_device ar71xx_ehci_device = {
.dev = {
.dma_mask = &ar71xx_ehci_dmamask,
.coherent_dma_mask = DMA_BIT_MASK(32),
+ .platform_data = &ar71xx_ehci_data,
},
};
@@ -84,7 +88,7 @@ static struct platform_device ar71xx_ehci_device = {
(RESET_MODULE_USB_HOST | RESET_MODULE_USB_PHY \
| RESET_MODULE_USB_OHCI_DLL)
-void __init ar71xx_add_device_usb(void)
+static void ar71xx_usb_setup(void)
{
ar71xx_device_stop(AR71XX_USB_RESET_MASK);
mdelay(1000);
@@ -97,9 +101,28 @@ void __init ar71xx_add_device_usb(void)
ar71xx_usb_ctrl_wr(USB_CTRL_REG_FLADJ, 0x20c00);
mdelay(900);
+}
- platform_device_register(&ar71xx_ohci_device);
- platform_device_register(&ar71xx_ehci_device);
+void __init ar71xx_add_device_usb(void)
+{
+ switch (ar71xx_soc) {
+ case AR71XX_SOC_AR7130:
+ case AR71XX_SOC_AR7141:
+ case AR71XX_SOC_AR7161:
+ ar71xx_usb_setup();
+ platform_device_register(&ar71xx_ohci_device);
+ platform_device_register(&ar71xx_ehci_device);
+ break;
+
+ case AR71XX_SOC_AR9130:
+ case AR71XX_SOC_AR9132:
+ ar71xx_ehci_data.is_ar91xx = 1;
+ platform_device_register(&ar71xx_ehci_device);
+ break;
+
+ default:
+ BUG();
+ }
}
#ifdef CONFIG_AR71XX_EARLY_SERIAL
diff --git a/target/linux/ar71xx/files/drivers/usb/host/ehci-ar71xx.c b/target/linux/ar71xx/files/drivers/usb/host/ehci-ar71xx.c
index a69f17d25..c8bf20154 100644
--- a/target/linux/ar71xx/files/drivers/usb/host/ehci-ar71xx.c
+++ b/target/linux/ar71xx/files/drivers/usb/host/ehci-ar71xx.c
@@ -15,6 +15,8 @@
#include <linux/platform_device.h>
#include <linux/delay.h>
+#include <asm/mach-ar71xx/platform.h>
+
extern int usb_disabled(void);
static void ehci_ar71xx_setup(void)
diff --git a/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h b/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h
index 2840c4567..750418a79 100644
--- a/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h
+++ b/target/linux/ar71xx/files/include/asm-mips/mach-ar71xx/platform.h
@@ -39,6 +39,10 @@ struct ag71xx_mdio_platform_data {
u32 phy_mask;
};
+struct ar71xx_ehci_platform_data {
+ u8 is_ar91xx;
+};
+
struct ar71xx_spi_platform_data {
unsigned bus_num;
unsigned num_chipselect;