aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-09-18 09:48:27 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-09-26 05:07:54 -0400
commitaeef67ebab06177a1fb31c7cde9ea6b09732e049 (patch)
treedc9e808979c60771eee36e604ed8d66223e34973
parent28633c54bda633b18544c602fc94961a3999a361 (diff)
ARM: ux500: Remove USB support when booting using ATAGs
It's time to remove all ATAG support from ux500 and rely solely on Device Tree booting. This patch is part of that endeavour. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--arch/arm/mach-ux500/Makefile2
-rw-r--r--arch/arm/mach-ux500/cpu-db8500.c12
-rw-r--r--arch/arm/mach-ux500/devices-db8500.h5
-rw-r--r--arch/arm/mach-ux500/usb.c135
4 files changed, 1 insertions, 153 deletions
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index fe1f3e26b88b..685f6153aa39 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5obj-y := cpu.o devices.o devices-common.o \ 5obj-y := cpu.o devices.o devices-common.o \
6 id.o usb.o timer.o pm.o 6 id.o timer.o pm.o
7obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 7obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
8obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o 8obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o
9obj-$(CONFIG_MACH_MOP500) += board-mop500.o board-mop500-sdi.o \ 9obj-$(CONFIG_MACH_MOP500) += board-mop500.o board-mop500-sdi.o \
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index d5accc22b3e9..b236ec11c02d 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -162,17 +162,6 @@ static void __init db8500_add_gpios(struct device *parent)
162 dbx500_add_pinctrl(parent, "pinctrl-db8500", U8500_PRCMU_BASE); 162 dbx500_add_pinctrl(parent, "pinctrl-db8500", U8500_PRCMU_BASE);
163} 163}
164 164
165static int usb_db8500_dma_cfg[] = {
166 DB8500_DMA_DEV38_USB_OTG_IEP_AND_OEP_1_9,
167 DB8500_DMA_DEV37_USB_OTG_IEP_AND_OEP_2_10,
168 DB8500_DMA_DEV36_USB_OTG_IEP_AND_OEP_3_11,
169 DB8500_DMA_DEV19_USB_OTG_IEP_AND_OEP_4_12,
170 DB8500_DMA_DEV18_USB_OTG_IEP_AND_OEP_5_13,
171 DB8500_DMA_DEV17_USB_OTG_IEP_AND_OEP_6_14,
172 DB8500_DMA_DEV16_USB_OTG_IEP_AND_OEP_7_15,
173 DB8500_DMA_DEV39_USB_OTG_IEP_AND_OEP_8
174};
175
176static const char *db8500_read_soc_id(void) 165static const char *db8500_read_soc_id(void)
177{ 166{
178 void __iomem *uid = __io_address(U8500_BB_UID_BASE); 167 void __iomem *uid = __io_address(U8500_BB_UID_BASE);
@@ -204,7 +193,6 @@ struct device * __init u8500_init_devices(void)
204 193
205 db8500_add_rtc(parent); 194 db8500_add_rtc(parent);
206 db8500_add_gpios(parent); 195 db8500_add_gpios(parent);
207 db8500_add_usb(parent, usb_db8500_dma_cfg, usb_db8500_dma_cfg);
208 196
209 for (i = 0; i < ARRAY_SIZE(platform_devs); i++) 197 for (i = 0; i < ARRAY_SIZE(platform_devs); i++)
210 platform_devs[i]->dev.parent = parent; 198 platform_devs[i]->dev.parent = parent;
diff --git a/arch/arm/mach-ux500/devices-db8500.h b/arch/arm/mach-ux500/devices-db8500.h
index be1d538e8109..935240002440 100644
--- a/arch/arm/mach-ux500/devices-db8500.h
+++ b/arch/arm/mach-ux500/devices-db8500.h
@@ -8,7 +8,6 @@
8#ifndef __DEVICES_DB8500_H 8#ifndef __DEVICES_DB8500_H
9#define __DEVICES_DB8500_H 9#define __DEVICES_DB8500_H
10 10
11#include <linux/platform_data/usb-musb-ux500.h>
12#include "irqs.h" 11#include "irqs.h"
13#include "db8500-regs.h" 12#include "db8500-regs.h"
14#include "devices-common.h" 13#include "devices-common.h"
@@ -30,10 +29,6 @@ db8500_add_ssp(struct device *parent, const char *name, resource_size_t base,
30#define db8500_add_rtc(parent) \ 29#define db8500_add_rtc(parent) \
31 dbx500_add_rtc(parent, U8500_RTC_BASE, IRQ_DB8500_RTC); 30 dbx500_add_rtc(parent, U8500_RTC_BASE, IRQ_DB8500_RTC);
32 31
33#define db8500_add_usb(parent, rx_cfg, tx_cfg) \
34 ux500_add_usb(parent, U8500_USBOTG_BASE, \
35 IRQ_DB8500_USBOTG, rx_cfg, tx_cfg)
36
37#define db8500_add_ssp0(parent, pdata) \ 32#define db8500_add_ssp0(parent, pdata) \
38 db8500_add_ssp(parent, "ssp0", U8500_SSP0_BASE, \ 33 db8500_add_ssp(parent, "ssp0", U8500_SSP0_BASE, \
39 IRQ_DB8500_SSP0, pdata) 34 IRQ_DB8500_SSP0, pdata)
diff --git a/arch/arm/mach-ux500/usb.c b/arch/arm/mach-ux500/usb.c
deleted file mode 100644
index b7bd8d3a5507..000000000000
--- a/arch/arm/mach-ux500/usb.c
+++ /dev/null
@@ -1,135 +0,0 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * Author: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7#include <linux/platform_device.h>
8#include <linux/usb/musb.h>
9#include <linux/dma-mapping.h>
10#include <linux/platform_data/usb-musb-ux500.h>
11#include <linux/platform_data/dma-ste-dma40.h>
12
13#include "db8500-regs.h"
14
15#define MUSB_DMA40_RX_CH { \
16 .mode = STEDMA40_MODE_LOGICAL, \
17 .dir = DMA_DEV_TO_MEM, \
18 }
19
20#define MUSB_DMA40_TX_CH { \
21 .mode = STEDMA40_MODE_LOGICAL, \
22 .dir = DMA_MEM_TO_DEV, \
23 }
24
25static struct stedma40_chan_cfg musb_dma_rx_ch[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS]
26 = {
27 MUSB_DMA40_RX_CH,
28 MUSB_DMA40_RX_CH,
29 MUSB_DMA40_RX_CH,
30 MUSB_DMA40_RX_CH,
31 MUSB_DMA40_RX_CH,
32 MUSB_DMA40_RX_CH,
33 MUSB_DMA40_RX_CH,
34 MUSB_DMA40_RX_CH
35};
36
37static struct stedma40_chan_cfg musb_dma_tx_ch[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS]
38 = {
39 MUSB_DMA40_TX_CH,
40 MUSB_DMA40_TX_CH,
41 MUSB_DMA40_TX_CH,
42 MUSB_DMA40_TX_CH,
43 MUSB_DMA40_TX_CH,
44 MUSB_DMA40_TX_CH,
45 MUSB_DMA40_TX_CH,
46 MUSB_DMA40_TX_CH,
47};
48
49static void *ux500_dma_rx_param_array[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] = {
50 &musb_dma_rx_ch[0],
51 &musb_dma_rx_ch[1],
52 &musb_dma_rx_ch[2],
53 &musb_dma_rx_ch[3],
54 &musb_dma_rx_ch[4],
55 &musb_dma_rx_ch[5],
56 &musb_dma_rx_ch[6],
57 &musb_dma_rx_ch[7]
58};
59
60static void *ux500_dma_tx_param_array[UX500_MUSB_DMA_NUM_RX_TX_CHANNELS] = {
61 &musb_dma_tx_ch[0],
62 &musb_dma_tx_ch[1],
63 &musb_dma_tx_ch[2],
64 &musb_dma_tx_ch[3],
65 &musb_dma_tx_ch[4],
66 &musb_dma_tx_ch[5],
67 &musb_dma_tx_ch[6],
68 &musb_dma_tx_ch[7]
69};
70
71static struct ux500_musb_board_data musb_board_data = {
72 .dma_rx_param_array = ux500_dma_rx_param_array,
73 .dma_tx_param_array = ux500_dma_tx_param_array,
74 .dma_filter = stedma40_filter,
75};
76
77static struct musb_hdrc_platform_data musb_platform_data = {
78 .mode = MUSB_OTG,
79 .board_data = &musb_board_data,
80};
81
82static struct resource usb_resources[] = {
83 [0] = {
84 .name = "usb-mem",
85 .flags = IORESOURCE_MEM,
86 },
87
88 [1] = {
89 .name = "mc", /* hard-coded in musb */
90 .flags = IORESOURCE_IRQ,
91 },
92};
93
94struct platform_device ux500_musb_device = {
95 .name = "musb-ux500",
96 .id = 0,
97 .dev = {
98 .platform_data = &musb_platform_data,
99 .coherent_dma_mask = DMA_BIT_MASK(32),
100 },
101 .num_resources = ARRAY_SIZE(usb_resources),
102 .resource = usb_resources,
103};
104
105static inline void ux500_usb_dma_update_rx_ch_config(int *dev_type)
106{
107 u32 idx;
108
109 for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; idx++)
110 musb_dma_rx_ch[idx].dev_type = dev_type[idx];
111}
112
113static inline void ux500_usb_dma_update_tx_ch_config(int *dev_type)
114{
115 u32 idx;
116
117 for (idx = 0; idx < UX500_MUSB_DMA_NUM_RX_TX_CHANNELS; idx++)
118 musb_dma_tx_ch[idx].dev_type = dev_type[idx];
119}
120
121void ux500_add_usb(struct device *parent, resource_size_t base, int irq,
122 int *dma_rx_cfg, int *dma_tx_cfg)
123{
124 ux500_musb_device.resource[0].start = base;
125 ux500_musb_device.resource[0].end = base + SZ_64K - 1;
126 ux500_musb_device.resource[1].start = irq;
127 ux500_musb_device.resource[1].end = irq;
128
129 ux500_usb_dma_update_rx_ch_config(dma_rx_cfg);
130 ux500_usb_dma_update_tx_ch_config(dma_tx_cfg);
131
132 ux500_musb_device.dev.parent = parent;
133
134 platform_device_register(&ux500_musb_device);
135}