diff options
author | Dinh Nguyen <Dinh.Nguyen@freescale.com> | 2010-04-30 16:48:24 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-05-03 09:18:13 -0400 |
commit | c53bdf1c4488ce196e9a0056285e7b4a36f6f76a (patch) | |
tree | 1a73e09c5b2ff6f7cf1fdb20e8be30d09cde3da8 /arch/arm/mach-mx5 | |
parent | 282f152219020c14064efa78374309e1df6a23a2 (diff) |
mx5: Add USB device definitions for Freescale MX51 Babbage HW
This patch is part of enabling USB for Freescale MX51 Babbage HW. This
patch adds device structures for USB Host1 and OTG port, and adds
clocking information for USB HW.
This patch applies to 2.6.34-rc6.
Signed-off-by: Dinh Nguyen <Dinh.Nguyen@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r-- | arch/arm/mach-mx5/clock-mx51.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-mx5/devices.c | 49 | ||||
-rw-r--r-- | arch/arm/mach-mx5/devices.h | 2 |
3 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/clock-mx51.c b/arch/arm/mach-mx5/clock-mx51.c index 8f85f73b83a8..dcca330addc9 100644 --- a/arch/arm/mach-mx5/clock-mx51.c +++ b/arch/arm/mach-mx5/clock-mx51.c | |||
@@ -761,6 +761,10 @@ DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET, | |||
761 | DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET, | 761 | DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET, |
762 | NULL, NULL, &ipg_clk, NULL); | 762 | NULL, NULL, &ipg_clk, NULL); |
763 | 763 | ||
764 | /* USB */ | ||
765 | DEFINE_CLOCK(usboh3_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG14_OFFSET, | ||
766 | NULL, NULL, &pll3_sw_clk, NULL); | ||
767 | |||
764 | /* FEC */ | 768 | /* FEC */ |
765 | DEFINE_CLOCK(fec_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG12_OFFSET, | 769 | DEFINE_CLOCK(fec_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG12_OFFSET, |
766 | NULL, NULL, &ipg_clk, NULL); | 770 | NULL, NULL, &ipg_clk, NULL); |
@@ -778,6 +782,10 @@ static struct clk_lookup lookups[] = { | |||
778 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) | 782 | _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) |
779 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) | 783 | _REGISTER_CLOCK(NULL, "gpt", gpt_clk) |
780 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) | 784 | _REGISTER_CLOCK("fec.0", NULL, fec_clk) |
785 | _REGISTER_CLOCK("mxc-ehci.0", "usb", usboh3_clk) | ||
786 | _REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", ahb_clk) | ||
787 | _REGISTER_CLOCK("mxc-ehci.1", "usb", usboh3_clk) | ||
788 | _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", ahb_clk) | ||
781 | }; | 789 | }; |
782 | 790 | ||
783 | static void clk_tree_init(void) | 791 | static void clk_tree_init(void) |
diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c index 5070ae1f94c6..e6262f31ed8f 100644 --- a/arch/arm/mach-mx5/devices.c +++ b/arch/arm/mach-mx5/devices.c | |||
@@ -11,6 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/dma-mapping.h> | ||
14 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
15 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
16 | #include <mach/imx-uart.h> | 17 | #include <mach/imx-uart.h> |
@@ -92,6 +93,54 @@ struct platform_device mxc_fec_device = { | |||
92 | .resource = mxc_fec_resources, | 93 | .resource = mxc_fec_resources, |
93 | }; | 94 | }; |
94 | 95 | ||
96 | static u64 usb_dma_mask = DMA_BIT_MASK(32); | ||
97 | |||
98 | static struct resource usbotg_resources[] = { | ||
99 | { | ||
100 | .start = MX51_OTG_BASE_ADDR, | ||
101 | .end = MX51_OTG_BASE_ADDR + 0x1ff, | ||
102 | .flags = IORESOURCE_MEM, | ||
103 | }, | ||
104 | { | ||
105 | .start = MX51_MXC_INT_USB_OTG, | ||
106 | .flags = IORESOURCE_IRQ, | ||
107 | }, | ||
108 | }; | ||
109 | |||
110 | struct platform_device mxc_usbdr_host_device = { | ||
111 | .name = "mxc-ehci", | ||
112 | .id = 0, | ||
113 | .num_resources = ARRAY_SIZE(usbotg_resources), | ||
114 | .resource = usbotg_resources, | ||
115 | .dev = { | ||
116 | .dma_mask = &usb_dma_mask, | ||
117 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | static struct resource usbh1_resources[] = { | ||
122 | { | ||
123 | .start = MX51_OTG_BASE_ADDR + 0x200, | ||
124 | .end = MX51_OTG_BASE_ADDR + 0x200 + 0x1ff, | ||
125 | .flags = IORESOURCE_MEM, | ||
126 | }, | ||
127 | { | ||
128 | .start = MX51_MXC_INT_USB_H1, | ||
129 | .flags = IORESOURCE_IRQ, | ||
130 | }, | ||
131 | }; | ||
132 | |||
133 | struct platform_device mxc_usbh1_device = { | ||
134 | .name = "mxc-ehci", | ||
135 | .id = 1, | ||
136 | .num_resources = ARRAY_SIZE(usbh1_resources), | ||
137 | .resource = usbh1_resources, | ||
138 | .dev = { | ||
139 | .dma_mask = &usb_dma_mask, | ||
140 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
141 | }, | ||
142 | }; | ||
143 | |||
95 | static struct mxc_gpio_port mxc_gpio_ports[] = { | 144 | static struct mxc_gpio_port mxc_gpio_ports[] = { |
96 | { | 145 | { |
97 | .chip.label = "gpio-0", | 146 | .chip.label = "gpio-0", |
diff --git a/arch/arm/mach-mx5/devices.h b/arch/arm/mach-mx5/devices.h index f339ab8c19be..95c45f9e46ca 100644 --- a/arch/arm/mach-mx5/devices.h +++ b/arch/arm/mach-mx5/devices.h | |||
@@ -2,3 +2,5 @@ extern struct platform_device mxc_uart_device0; | |||
2 | extern struct platform_device mxc_uart_device1; | 2 | extern struct platform_device mxc_uart_device1; |
3 | extern struct platform_device mxc_uart_device2; | 3 | extern struct platform_device mxc_uart_device2; |
4 | extern struct platform_device mxc_fec_device; | 4 | extern struct platform_device mxc_fec_device; |
5 | extern struct platform_device mxc_usbdr_host_device; | ||
6 | extern struct platform_device mxc_usbh1_device; | ||