mach-ux500: add MUSB to db5500 devices
authorMian Yousaf Kaukab <mian-yousaf.kaukab@linaro.org>
Fri, 21 Jan 2011 17:24:19 +0000 (18:24 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 14 Mar 2011 13:05:12 +0000 (14:05 +0100)
- DMA tx and rx maps for usb channels are set to be configured at
  runtime
- MUSB is enabled with soc specific base address, irq and dma
  configurations

Signed-off-by: Mian Yousaf Kaukab <mian-yousaf.kaukab@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/mach-ux500/cpu-db5500.c
arch/arm/mach-ux500/devices-db5500.h
arch/arm/mach-ux500/dma-db5500.c

index 38a01c3..c9dc2ef 100644 (file)
 #include <mach/devices.h>
 #include <mach/setup.h>
 #include <mach/irqs.h>
+#include <mach/usb.h>
 
 #include "devices-db5500.h"
+#include "ste-dma40-db5500.h"
 
 static struct map_desc u5500_uart_io_desc[] __initdata = {
        __IO_DEV_DESC(U5500_UART0_BASE, SZ_4K),
@@ -188,11 +190,34 @@ void __init u5500_map_io(void)
        iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc));
 }
 
+static int usb_db5500_rx_dma_cfg[] = {
+       DB5500_DMA_DEV4_USB_OTG_IEP_1_9,
+       DB5500_DMA_DEV5_USB_OTG_IEP_2_10,
+       DB5500_DMA_DEV6_USB_OTG_IEP_3_11,
+       DB5500_DMA_DEV20_USB_OTG_IEP_4_12,
+       DB5500_DMA_DEV21_USB_OTG_IEP_5_13,
+       DB5500_DMA_DEV22_USB_OTG_IEP_6_14,
+       DB5500_DMA_DEV23_USB_OTG_IEP_7_15,
+       DB5500_DMA_DEV38_USB_OTG_IEP_8
+};
+
+static int usb_db5500_tx_dma_cfg[] = {
+       DB5500_DMA_DEV4_USB_OTG_OEP_1_9,
+       DB5500_DMA_DEV5_USB_OTG_OEP_2_10,
+       DB5500_DMA_DEV6_USB_OTG_OEP_3_11,
+       DB5500_DMA_DEV20_USB_OTG_OEP_4_12,
+       DB5500_DMA_DEV21_USB_OTG_OEP_5_13,
+       DB5500_DMA_DEV22_USB_OTG_OEP_6_14,
+       DB5500_DMA_DEV23_USB_OTG_OEP_7_15,
+       DB5500_DMA_DEV38_USB_OTG_OEP_8
+};
+
 void __init u5500_init_devices(void)
 {
        db5500_add_gpios();
        db5500_dma_init();
        db5500_add_rtc();
+       db5500_add_usb(usb_db5500_rx_dma_cfg, usb_db5500_tx_dma_cfg);
 
        platform_add_devices(db5500_platform_devs,
                             ARRAY_SIZE(db5500_platform_devs));
index c8d7901..481ae5c 100644 (file)
@@ -34,6 +34,9 @@
 #define db5500_add_rtc() \
        dbx500_add_rtc(U5500_RTC_BASE, IRQ_DB5500_RTC);
 
+#define db5500_add_usb(rx_cfg, tx_cfg) \
+       ux500_add_usb(U5500_USBOTG_BASE, IRQ_DB5500_USBOTG, rx_cfg, tx_cfg)
+
 #define db5500_add_sdi0(pdata) \
        dbx500_add_sdi("sdi0", U5500_SDI0_BASE, IRQ_DB5500_SDMMC0, pdata)
 #define db5500_add_sdi1(pdata) \
index 32a061f..1cfab68 100644 (file)
@@ -73,11 +73,27 @@ static struct stedma40_chan_cfg dma40_memcpy_conf_log = {
  */
 static const dma_addr_t dma40_rx_map[DB5500_DMA_NR_DEV] = {
        [DB5500_DMA_DEV24_SDMMC0_RX] = -1,
+       [DB5500_DMA_DEV38_USB_OTG_IEP_8] = -1,
+       [DB5500_DMA_DEV23_USB_OTG_IEP_7_15] = -1,
+       [DB5500_DMA_DEV22_USB_OTG_IEP_6_14] = -1,
+       [DB5500_DMA_DEV21_USB_OTG_IEP_5_13] = -1,
+       [DB5500_DMA_DEV20_USB_OTG_IEP_4_12] = -1,
+       [DB5500_DMA_DEV6_USB_OTG_IEP_3_11] = -1,
+       [DB5500_DMA_DEV5_USB_OTG_IEP_2_10] = -1,
+       [DB5500_DMA_DEV4_USB_OTG_IEP_1_9] = -1,
 };
 
 /* Mapping between destination event lines and physical device address */
 static const dma_addr_t dma40_tx_map[DB5500_DMA_NR_DEV] = {
        [DB5500_DMA_DEV24_SDMMC0_TX] = -1,
+       [DB5500_DMA_DEV38_USB_OTG_OEP_8] = -1,
+       [DB5500_DMA_DEV23_USB_OTG_OEP_7_15] = -1,
+       [DB5500_DMA_DEV22_USB_OTG_OEP_6_14] = -1,
+       [DB5500_DMA_DEV21_USB_OTG_OEP_5_13] = -1,
+       [DB5500_DMA_DEV20_USB_OTG_OEP_4_12] = -1,
+       [DB5500_DMA_DEV6_USB_OTG_OEP_3_11] = -1,
+       [DB5500_DMA_DEV5_USB_OTG_OEP_2_10] = -1,
+       [DB5500_DMA_DEV4_USB_OTG_OEP_1_9] = -1,
 };
 
 static int dma40_memcpy_event[] = {