aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-06-12 19:12:03 -0400
committerOlof Johansson <olof@lixom.net>2013-06-12 19:13:48 -0400
commit6e36dc69d6df49fe3380241b72c99515e1eee032 (patch)
tree8353fcae0a56cc2fd301686027095b4ccfcf9817 /arch
parent1780db9e210420f2cf7f26f0ab06eb02f02df21f (diff)
parenta496bda66201e855f6b5d5d701d8bd65b9178700 (diff)
Merge tag 's3c24xx-arch-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/soc
From Kukjin Kim, DMA driver updates for s3c24xx. * tag 's3c24xx-arch-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: ARM: S3C24XX: remove obsolete s3c2412 specific dma settings ARM: S3C24XX: dma-s3c2443 - do not write into arbitary bits ARM: S3C24XX: split s3c2412 spi dma channels Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2412.c56
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2443.c3
-rw-r--r--arch/arm/mach-s3c24xx/dma.c3
-rw-r--r--arch/arm/plat-samsung/include/plat/dma-s3c24xx.h5
4 files changed, 17 insertions, 50 deletions
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2412.c b/arch/arm/mach-s3c24xx/dma-s3c2412.c
index ab1700ec8e64..b7e094671522 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2412.c
@@ -35,121 +35,95 @@ static struct s3c24xx_dma_map __initdata s3c2412_dma_mappings[] = {
35 [DMACH_XD0] = { 35 [DMACH_XD0] = {
36 .name = "xdreq0", 36 .name = "xdreq0",
37 .channels = MAP(S3C2412_DMAREQSEL_XDREQ0), 37 .channels = MAP(S3C2412_DMAREQSEL_XDREQ0),
38 .channels_rx = MAP(S3C2412_DMAREQSEL_XDREQ0),
39 }, 38 },
40 [DMACH_XD1] = { 39 [DMACH_XD1] = {
41 .name = "xdreq1", 40 .name = "xdreq1",
42 .channels = MAP(S3C2412_DMAREQSEL_XDREQ1), 41 .channels = MAP(S3C2412_DMAREQSEL_XDREQ1),
43 .channels_rx = MAP(S3C2412_DMAREQSEL_XDREQ1),
44 }, 42 },
45 [DMACH_SDI] = { 43 [DMACH_SDI] = {
46 .name = "sdi", 44 .name = "sdi",
47 .channels = MAP(S3C2412_DMAREQSEL_SDI), 45 .channels = MAP(S3C2412_DMAREQSEL_SDI),
48 .channels_rx = MAP(S3C2412_DMAREQSEL_SDI),
49 }, 46 },
50 [DMACH_SPI0] = { 47 [DMACH_SPI0_RX] = {
51 .name = "spi0", 48 .name = "spi0-rx",
49 .channels = MAP(S3C2412_DMAREQSEL_SPI0RX),
50 },
51 [DMACH_SPI0_TX] = {
52 .name = "spi0-tx",
52 .channels = MAP(S3C2412_DMAREQSEL_SPI0TX), 53 .channels = MAP(S3C2412_DMAREQSEL_SPI0TX),
53 .channels_rx = MAP(S3C2412_DMAREQSEL_SPI0RX),
54 }, 54 },
55 [DMACH_SPI1] = { 55 [DMACH_SPI1_RX] = {
56 .name = "spi1", 56 .name = "spi1-rx",
57 .channels = MAP(S3C2412_DMAREQSEL_SPI1RX),
58 },
59 [DMACH_SPI1_TX] = {
60 .name = "spi1-tx",
57 .channels = MAP(S3C2412_DMAREQSEL_SPI1TX), 61 .channels = MAP(S3C2412_DMAREQSEL_SPI1TX),
58 .channels_rx = MAP(S3C2412_DMAREQSEL_SPI1RX),
59 }, 62 },
60 [DMACH_UART0] = { 63 [DMACH_UART0] = {
61 .name = "uart0", 64 .name = "uart0",
62 .channels = MAP(S3C2412_DMAREQSEL_UART0_0), 65 .channels = MAP(S3C2412_DMAREQSEL_UART0_0),
63 .channels_rx = MAP(S3C2412_DMAREQSEL_UART0_0),
64 }, 66 },
65 [DMACH_UART1] = { 67 [DMACH_UART1] = {
66 .name = "uart1", 68 .name = "uart1",
67 .channels = MAP(S3C2412_DMAREQSEL_UART1_0), 69 .channels = MAP(S3C2412_DMAREQSEL_UART1_0),
68 .channels_rx = MAP(S3C2412_DMAREQSEL_UART1_0),
69 }, 70 },
70 [DMACH_UART2] = { 71 [DMACH_UART2] = {
71 .name = "uart2", 72 .name = "uart2",
72 .channels = MAP(S3C2412_DMAREQSEL_UART2_0), 73 .channels = MAP(S3C2412_DMAREQSEL_UART2_0),
73 .channels_rx = MAP(S3C2412_DMAREQSEL_UART2_0),
74 }, 74 },
75 [DMACH_UART0_SRC2] = { 75 [DMACH_UART0_SRC2] = {
76 .name = "uart0", 76 .name = "uart0",
77 .channels = MAP(S3C2412_DMAREQSEL_UART0_1), 77 .channels = MAP(S3C2412_DMAREQSEL_UART0_1),
78 .channels_rx = MAP(S3C2412_DMAREQSEL_UART0_1),
79 }, 78 },
80 [DMACH_UART1_SRC2] = { 79 [DMACH_UART1_SRC2] = {
81 .name = "uart1", 80 .name = "uart1",
82 .channels = MAP(S3C2412_DMAREQSEL_UART1_1), 81 .channels = MAP(S3C2412_DMAREQSEL_UART1_1),
83 .channels_rx = MAP(S3C2412_DMAREQSEL_UART1_1),
84 }, 82 },
85 [DMACH_UART2_SRC2] = { 83 [DMACH_UART2_SRC2] = {
86 .name = "uart2", 84 .name = "uart2",
87 .channels = MAP(S3C2412_DMAREQSEL_UART2_1), 85 .channels = MAP(S3C2412_DMAREQSEL_UART2_1),
88 .channels_rx = MAP(S3C2412_DMAREQSEL_UART2_1),
89 }, 86 },
90 [DMACH_TIMER] = { 87 [DMACH_TIMER] = {
91 .name = "timer", 88 .name = "timer",
92 .channels = MAP(S3C2412_DMAREQSEL_TIMER), 89 .channels = MAP(S3C2412_DMAREQSEL_TIMER),
93 .channels_rx = MAP(S3C2412_DMAREQSEL_TIMER),
94 }, 90 },
95 [DMACH_I2S_IN] = { 91 [DMACH_I2S_IN] = {
96 .name = "i2s-sdi", 92 .name = "i2s-sdi",
97 .channels = MAP(S3C2412_DMAREQSEL_I2SRX), 93 .channels = MAP(S3C2412_DMAREQSEL_I2SRX),
98 .channels_rx = MAP(S3C2412_DMAREQSEL_I2SRX),
99 }, 94 },
100 [DMACH_I2S_OUT] = { 95 [DMACH_I2S_OUT] = {
101 .name = "i2s-sdo", 96 .name = "i2s-sdo",
102 .channels = MAP(S3C2412_DMAREQSEL_I2STX), 97 .channels = MAP(S3C2412_DMAREQSEL_I2STX),
103 .channels_rx = MAP(S3C2412_DMAREQSEL_I2STX),
104 }, 98 },
105 [DMACH_USB_EP1] = { 99 [DMACH_USB_EP1] = {
106 .name = "usb-ep1", 100 .name = "usb-ep1",
107 .channels = MAP(S3C2412_DMAREQSEL_USBEP1), 101 .channels = MAP(S3C2412_DMAREQSEL_USBEP1),
108 .channels_rx = MAP(S3C2412_DMAREQSEL_USBEP1),
109 }, 102 },
110 [DMACH_USB_EP2] = { 103 [DMACH_USB_EP2] = {
111 .name = "usb-ep2", 104 .name = "usb-ep2",
112 .channels = MAP(S3C2412_DMAREQSEL_USBEP2), 105 .channels = MAP(S3C2412_DMAREQSEL_USBEP2),
113 .channels_rx = MAP(S3C2412_DMAREQSEL_USBEP2),
114 }, 106 },
115 [DMACH_USB_EP3] = { 107 [DMACH_USB_EP3] = {
116 .name = "usb-ep3", 108 .name = "usb-ep3",
117 .channels = MAP(S3C2412_DMAREQSEL_USBEP3), 109 .channels = MAP(S3C2412_DMAREQSEL_USBEP3),
118 .channels_rx = MAP(S3C2412_DMAREQSEL_USBEP3),
119 }, 110 },
120 [DMACH_USB_EP4] = { 111 [DMACH_USB_EP4] = {
121 .name = "usb-ep4", 112 .name = "usb-ep4",
122 .channels = MAP(S3C2412_DMAREQSEL_USBEP4), 113 .channels = MAP(S3C2412_DMAREQSEL_USBEP4),
123 .channels_rx = MAP(S3C2412_DMAREQSEL_USBEP4),
124 }, 114 },
125}; 115};
126 116
127static void s3c2412_dma_direction(struct s3c2410_dma_chan *chan,
128 struct s3c24xx_dma_map *map,
129 enum dma_data_direction dir)
130{
131 unsigned long chsel;
132
133 if (dir == DMA_FROM_DEVICE)
134 chsel = map->channels_rx[0];
135 else
136 chsel = map->channels[0];
137
138 chsel &= ~DMA_CH_VALID;
139 chsel |= S3C2412_DMAREQSEL_HW;
140
141 writel(chsel, chan->regs + S3C2412_DMA_DMAREQSEL);
142}
143
144static void s3c2412_dma_select(struct s3c2410_dma_chan *chan, 117static void s3c2412_dma_select(struct s3c2410_dma_chan *chan,
145 struct s3c24xx_dma_map *map) 118 struct s3c24xx_dma_map *map)
146{ 119{
147 s3c2412_dma_direction(chan, map, chan->source); 120 unsigned long chsel = map->channels[0] & (~DMA_CH_VALID);
121 writel(chsel | S3C2412_DMAREQSEL_HW,
122 chan->regs + S3C2412_DMA_DMAREQSEL);
148} 123}
149 124
150static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = { 125static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = {
151 .select = s3c2412_dma_select, 126 .select = s3c2412_dma_select,
152 .direction = s3c2412_dma_direction,
153 .dcon_mask = 0, 127 .dcon_mask = 0,
154 .map = s3c2412_dma_mappings, 128 .map = s3c2412_dma_mappings,
155 .map_size = ARRAY_SIZE(s3c2412_dma_mappings), 129 .map_size = ARRAY_SIZE(s3c2412_dma_mappings),
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2443.c b/arch/arm/mach-s3c24xx/dma-s3c2443.c
index 5fe3539dc2b5..95b9f759fe97 100644
--- a/arch/arm/mach-s3c24xx/dma-s3c2443.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2443.c
@@ -128,7 +128,8 @@ static struct s3c24xx_dma_map __initdata s3c2443_dma_mappings[] = {
128static void s3c2443_dma_select(struct s3c2410_dma_chan *chan, 128static void s3c2443_dma_select(struct s3c2410_dma_chan *chan,
129 struct s3c24xx_dma_map *map) 129 struct s3c24xx_dma_map *map)
130{ 130{
131 writel(map->channels[0] | S3C2443_DMAREQSEL_HW, 131 unsigned long chsel = map->channels[0] & (~DMA_CH_VALID);
132 writel(chsel | S3C2443_DMAREQSEL_HW,
132 chan->regs + S3C2443_DMA_DMAREQSEL); 133 chan->regs + S3C2443_DMA_DMAREQSEL);
133} 134}
134 135
diff --git a/arch/arm/mach-s3c24xx/dma.c b/arch/arm/mach-s3c24xx/dma.c
index aab64909e9a3..4a65cba3295d 100644
--- a/arch/arm/mach-s3c24xx/dma.c
+++ b/arch/arm/mach-s3c24xx/dma.c
@@ -1159,9 +1159,6 @@ int s3c2410_dma_devconfig(enum dma_ch channel,
1159 return -EINVAL; 1159 return -EINVAL;
1160 } 1160 }
1161 1161
1162 if (dma_sel.direction != NULL)
1163 (dma_sel.direction)(chan, chan->map, source);
1164
1165 return 0; 1162 return 0;
1166} 1163}
1167 1164
diff --git a/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h b/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
index d01576318b2c..bd3a6db14cbb 100644
--- a/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
+++ b/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
@@ -28,7 +28,6 @@ struct s3c24xx_dma_map {
28 const char *name; 28 const char *name;
29 29
30 unsigned long channels[S3C_DMA_CHANNELS]; 30 unsigned long channels[S3C_DMA_CHANNELS];
31 unsigned long channels_rx[S3C_DMA_CHANNELS];
32}; 31};
33 32
34struct s3c24xx_dma_selection { 33struct s3c24xx_dma_selection {
@@ -38,10 +37,6 @@ struct s3c24xx_dma_selection {
38 37
39 void (*select)(struct s3c2410_dma_chan *chan, 38 void (*select)(struct s3c2410_dma_chan *chan,
40 struct s3c24xx_dma_map *map); 39 struct s3c24xx_dma_map *map);
41
42 void (*direction)(struct s3c2410_dma_chan *chan,
43 struct s3c24xx_dma_map *map,
44 enum dma_data_direction dir);
45}; 40};
46 41
47extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel); 42extern int s3c24xx_dma_init_map(struct s3c24xx_dma_selection *sel);