diff options
Diffstat (limited to 'arch/arm/mach-ux500/usb.c')
-rw-r--r-- | arch/arm/mach-ux500/usb.c | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c index 2dfc72f7cd8a..b7bd8d3a5507 100644 --- a/arch/arm/mach-ux500/usb.c +++ b/arch/arm/mach-ux500/usb.c | |||
@@ -14,25 +14,15 @@ | |||
14 | 14 | ||
15 | #define MUSB_DMA40_RX_CH { \ | 15 | #define MUSB_DMA40_RX_CH { \ |
16 | .mode = STEDMA40_MODE_LOGICAL, \ | 16 | .mode = STEDMA40_MODE_LOGICAL, \ |
17 | .dir = STEDMA40_PERIPH_TO_MEM, \ | 17 | .dir = DMA_DEV_TO_MEM, \ |
18 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, \ | ||
19 | .src_info.data_width = STEDMA40_WORD_WIDTH, \ | ||
20 | .dst_info.data_width = STEDMA40_WORD_WIDTH, \ | ||
21 | .src_info.psize = STEDMA40_PSIZE_LOG_16, \ | ||
22 | .dst_info.psize = STEDMA40_PSIZE_LOG_16, \ | ||
23 | } | 18 | } |
24 | 19 | ||
25 | #define MUSB_DMA40_TX_CH { \ | 20 | #define MUSB_DMA40_TX_CH { \ |
26 | .mode = STEDMA40_MODE_LOGICAL, \ | 21 | .mode = STEDMA40_MODE_LOGICAL, \ |
27 | .dir = STEDMA40_MEM_TO_PERIPH, \ | 22 | .dir = DMA_MEM_TO_DEV, \ |
28 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, \ | ||
29 | .src_info.data_width = STEDMA40_WORD_WIDTH, \ | ||
30 | .dst_info.data_width = STEDMA40_WORD_WIDTH, \ | ||
31 | .src_info.psize = STEDMA40_PSIZE_LOG_16, \ | ||
32 | .dst_info.psize = STEDMA40_PSIZE_LOG_16, \ | ||
33 | } | 23 | } |
34 | 24 | ||
35 | static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_CHANNELS] | 25 | static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] |
36 | = { | 26 | = { |
37 | MUSB_DMA40_RX_CH, | 27 | MUSB_DMA40_RX_CH, |
38 | MUSB_DMA40_RX_CH, | 28 | MUSB_DMA40_RX_CH, |
@@ -44,7 +34,7 @@ static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_CHANNELS] | |||
44 | MUSB_DMA40_RX_CH | 34 | MUSB_DMA40_RX_CH |
45 | }; | 35 | }; |
46 | 36 | ||
47 | static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_TX_CHANNELS] | 37 | static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] |
48 | = { | 38 | = { |
49 | MUSB_DMA40_TX_CH, | 39 | MUSB_DMA40_TX_CH, |
50 | MUSB_DMA40_TX_CH, | 40 | MUSB_DMA40_TX_CH, |
@@ -56,7 +46,7 @@ static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_TX_CHANNELS] | |||
56 | MUSB_DMA40_TX_CH, | 46 | MUSB_DMA40_TX_CH, |
57 | }; | 47 | }; |
58 | 48 | ||
59 | static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_CHANNELS] = { | 49 | static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] = { |
60 | &musb_dma_rx_ch[0], | 50 | &musb_dma_rx_ch[0], |
61 | &musb_dma_rx_ch[1], | 51 | &musb_dma_rx_ch[1], |
62 | &musb_dma_rx_ch[2], | 52 | &musb_dma_rx_ch[2], |
@@ -67,7 +57,7 @@ static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_CHANNELS] = { | |||
67 | &musb_dma_rx_ch[7] | 57 | &musb_dma_rx_ch[7] |
68 | }; | 58 | }; |
69 | 59 | ||
70 | static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_TX_CHANNELS] = { | 60 | static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] = { |
71 | &musb_dma_tx_ch[0], | 61 | &musb_dma_tx_ch[0], |
72 | &musb_dma_tx_ch[1], | 62 | &musb_dma_tx_ch[1], |
73 | &musb_dma_tx_ch[2], | 63 | &musb_dma_tx_ch[2], |
@@ -81,23 +71,11 @@ static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_TX_CHANNELS] = { | |||
81 | static struct ux500_musb_board_data musb_board_data = { | 71 | static struct ux500_musb_board_data musb_board_data = { |
82 | .dma_rx_param_array = ux500_dma_rx_param_array, | 72 | .dma_rx_param_array = ux500_dma_rx_param_array, |
83 | .dma_tx_param_array = ux500_dma_tx_param_array, | 73 | .dma_tx_param_array = ux500_dma_tx_param_array, |
84 | .num_rx_channels = UX500_MUSB_DMA_NUM_RX_CHANNELS, | ||
85 | .num_tx_channels = UX500_MUSB_DMA_NUM_TX_CHANNELS, | ||
86 | .dma_filter = stedma40_filter, | 74 | .dma_filter = stedma40_filter, |
87 | }; | 75 | }; |
88 | 76 | ||
89 | static u64 ux500_musb_dmamask = DMA_BIT_MASK(32); | ||
90 | |||
91 | static struct musb_hdrc_config musb_hdrc_config = { | ||
92 | .multipoint = true, | ||
93 | .dyn_fifo = true, | ||
94 | .num_eps = 16, | ||
95 | .ram_bits = 16, | ||
96 | }; | ||
97 | |||
98 | static struct musb_hdrc_platform_data musb_platform_data = { | 77 | static struct musb_hdrc_platform_data musb_platform_data = { |
99 | .mode = MUSB_OTG, | 78 | .mode = MUSB_OTG, |
100 | .config = &musb_hdrc_config, | ||
101 | .board_data = &musb_board_data, | 79 | .board_data = &musb_board_data, |
102 | }; | 80 | }; |
103 | 81 | ||
@@ -118,27 +96,26 @@ struct platform_device ux500_musb_device = { | |||
118 | .id = 0, | 96 | .id = 0, |
119 | .dev = { | 97 | .dev = { |
120 | .platform_data = &musb_platform_data, | 98 | .platform_data = &musb_platform_data, |
121 | .dma_mask = &ux500_musb_dmamask, | ||
122 | .coherent_dma_mask = DMA_BIT_MASK(32), | 99 | .coherent_dma_mask = DMA_BIT_MASK(32), |
123 | }, | 100 | }, |
124 | .num_resources = ARRAY_SIZE(usb_resources), | 101 | .num_resources = ARRAY_SIZE(usb_resources), |
125 | .resource = usb_resources, | 102 | .resource = usb_resources, |
126 | }; | 103 | }; |
127 | 104 | ||
128 | static inline void ux500_usb_dma_update_rx_ch_config(int *src_dev_type) | 105 | static inline void ux500_usb_dma_update_rx_ch_config(int *dev_type) |
129 | { | 106 | { |
130 | u32 idx; | 107 | u32 idx; |
131 | 108 | ||
132 | for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_CHANNELS; idx++) | 109 | for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; idx++) |
133 | musb_dma_rx_ch[idx].src_dev_type = src_dev_type[idx]; | 110 | musb_dma_rx_ch[idx].dev_type = dev_type[idx]; |
134 | } | 111 | } |
135 | 112 | ||
136 | static inline void ux500_usb_dma_update_tx_ch_config(int *dst_dev_type) | 113 | static inline void ux500_usb_dma_update_tx_ch_config(int *dev_type) |
137 | { | 114 | { |
138 | u32 idx; | 115 | u32 idx; |
139 | 116 | ||
140 | for (idx = 0; idx < UX500_MUSB_DMA_NUM_TX_CHANNELS; idx++) | 117 | for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; idx++) |
141 | musb_dma_tx_ch[idx].dst_dev_type = dst_dev_type[idx]; | 118 | musb_dma_tx_ch[idx].dev_type = dev_type[idx]; |
142 | } | 119 | } |
143 | 120 | ||
144 | void ux500_add_usb(struct device *parent, resource_size_t base, int irq, | 121 | void ux500_add_usb(struct device *parent, resource_size_t base, int irq, |