aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-05-19 05:50:09 -0400
committerPaul Mundt <lethal@linux-sh.org>2012-05-19 05:50:09 -0400
commite24cca19babe33a7d05712df041f5abbeca4f1bf (patch)
tree59eac5df17932f08b2283ecf036dec2698f79d5f /arch/sh
parent2ff9f317f15b7c3bd95273a7f04ca0b148850104 (diff)
sh: Kill off MAX_DMA_ADDRESS leftovers.
We don't support the ISA DMA API, so this is only ever misused. The dma-sh case inadvertently broke the dreamcast case by testing the wrong variable for the total number of channels, so this fixes that up too. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/drivers/dma/Kconfig17
-rw-r--r--arch/sh/drivers/dma/dma-sysfs.c2
-rw-r--r--arch/sh/include/asm/dma-sh.h16
-rw-r--r--arch/sh/include/asm/dma.h8
-rw-r--r--arch/sh/include/mach-dreamcast/mach/dma.h2
5 files changed, 9 insertions, 36 deletions
diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig
index 4d58eb0973d4..cfd5b90a8628 100644
--- a/arch/sh/drivers/dma/Kconfig
+++ b/arch/sh/drivers/dma/Kconfig
@@ -40,23 +40,6 @@ config NR_ONCHIP_DMA_CHANNELS
40 DMAC supports. This will be 4 for SH7750/SH7751/Sh7750S/SH7091 and 8 for the 40 DMAC supports. This will be 4 for SH7750/SH7751/Sh7750S/SH7091 and 8 for the
41 SH7750R/SH7751R/SH7760, 12 for the SH7723/SH7780/SH7785/SH7724, default is 6. 41 SH7750R/SH7751R/SH7760, 12 for the SH7723/SH7780/SH7785/SH7724, default is 6.
42 42
43config NR_DMA_CHANNELS_BOOL
44 depends on SH_DMA
45 bool "Override default number of maximum DMA channels"
46 help
47 This allows you to forcibly update the maximum number of supported
48 DMA channels for a given board. If this is unset, this will default
49 to the number of channels that the on-chip DMAC has.
50
51config NR_DMA_CHANNELS
52 int "Maximum number of DMA channels"
53 depends on SH_DMA && NR_DMA_CHANNELS_BOOL
54 default NR_ONCHIP_DMA_CHANNELS
55 help
56 This allows you to specify the maximum number of DMA channels to
57 support. Setting this to a higher value allows for cascading DMACs
58 with additional channels.
59
60config SH_DMABRG 43config SH_DMABRG
61 bool "SH7760 DMABRG support" 44 bool "SH7760 DMABRG support"
62 depends on CPU_SUBTYPE_SH7760 45 depends on CPU_SUBTYPE_SH7760
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c
index 67ee95603813..4b15feda54b0 100644
--- a/arch/sh/drivers/dma/dma-sysfs.c
+++ b/arch/sh/drivers/dma/dma-sysfs.c
@@ -29,7 +29,7 @@ static ssize_t dma_show_devices(struct device *dev,
29 ssize_t len = 0; 29 ssize_t len = 0;
30 int i; 30 int i;
31 31
32 for (i = 0; i < MAX_DMA_CHANNELS; i++) { 32 for (i = 0; i < 16; i++) {
33 struct dma_info *info = get_dma_info(i); 33 struct dma_info *info = get_dma_info(i);
34 struct dma_channel *channel = get_dma_channel(i); 34 struct dma_channel *channel = get_dma_channel(i);
35 35
diff --git a/arch/sh/include/asm/dma-sh.h b/arch/sh/include/asm/dma-sh.h
index f3acb8e34c6b..9a4875a89636 100644
--- a/arch/sh/include/asm/dma-sh.h
+++ b/arch/sh/include/asm/dma-sh.h
@@ -32,21 +32,21 @@
32#endif 32#endif
33 33
34static int dmte_irq_map[] __maybe_unused = { 34static int dmte_irq_map[] __maybe_unused = {
35#if (MAX_DMA_CHANNELS >= 4) 35#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 4)
36 DMTE0_IRQ, 36 DMTE0_IRQ,
37 DMTE0_IRQ + 1, 37 DMTE0_IRQ + 1,
38 DMTE0_IRQ + 2, 38 DMTE0_IRQ + 2,
39 DMTE0_IRQ + 3, 39 DMTE0_IRQ + 3,
40#endif 40#endif
41#if (MAX_DMA_CHANNELS >= 6) 41#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 6)
42 DMTE4_IRQ, 42 DMTE4_IRQ,
43 DMTE4_IRQ + 1, 43 DMTE4_IRQ + 1,
44#endif 44#endif
45#if (MAX_DMA_CHANNELS >= 8) 45#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 8)
46 DMTE6_IRQ, 46 DMTE6_IRQ,
47 DMTE6_IRQ + 1, 47 DMTE6_IRQ + 1,
48#endif 48#endif
49#if (MAX_DMA_CHANNELS >= 12) 49#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 12)
50 DMTE8_IRQ, 50 DMTE8_IRQ,
51 DMTE9_IRQ, 51 DMTE9_IRQ,
52 DMTE10_IRQ, 52 DMTE10_IRQ,
@@ -62,21 +62,21 @@ static int dmte_irq_map[] __maybe_unused = {
62 62
63/* DMA base address */ 63/* DMA base address */
64static u32 dma_base_addr[] __maybe_unused = { 64static u32 dma_base_addr[] __maybe_unused = {
65#if (MAX_DMA_CHANNELS >= 4) 65#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 4)
66 SH_DMAC_BASE0 + 0x00, /* channel 0 */ 66 SH_DMAC_BASE0 + 0x00, /* channel 0 */
67 SH_DMAC_BASE0 + 0x10, 67 SH_DMAC_BASE0 + 0x10,
68 SH_DMAC_BASE0 + 0x20, 68 SH_DMAC_BASE0 + 0x20,
69 SH_DMAC_BASE0 + 0x30, 69 SH_DMAC_BASE0 + 0x30,
70#endif 70#endif
71#if (MAX_DMA_CHANNELS >= 6) 71#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 6)
72 SH_DMAC_BASE0 + 0x50, 72 SH_DMAC_BASE0 + 0x50,
73 SH_DMAC_BASE0 + 0x60, 73 SH_DMAC_BASE0 + 0x60,
74#endif 74#endif
75#if (MAX_DMA_CHANNELS >= 8) 75#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 8)
76 SH_DMAC_BASE1 + 0x00, 76 SH_DMAC_BASE1 + 0x00,
77 SH_DMAC_BASE1 + 0x10, 77 SH_DMAC_BASE1 + 0x10,
78#endif 78#endif
79#if (MAX_DMA_CHANNELS >= 12) 79#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 12)
80 SH_DMAC_BASE1 + 0x20, 80 SH_DMAC_BASE1 + 0x20,
81 SH_DMAC_BASE1 + 0x30, 81 SH_DMAC_BASE1 + 0x30,
82 SH_DMAC_BASE1 + 0x50, 82 SH_DMAC_BASE1 + 0x50,
diff --git a/arch/sh/include/asm/dma.h b/arch/sh/include/asm/dma.h
index e6c2871a00e7..fb6e4f7b00a2 100644
--- a/arch/sh/include/asm/dma.h
+++ b/arch/sh/include/asm/dma.h
@@ -17,14 +17,6 @@
17#include <linux/device.h> 17#include <linux/device.h>
18#include <asm-generic/dma.h> 18#include <asm-generic/dma.h>
19 19
20#ifdef CONFIG_NR_DMA_CHANNELS
21# define MAX_DMA_CHANNELS (CONFIG_NR_DMA_CHANNELS)
22#elif defined(CONFIG_NR_ONCHIP_DMA_CHANNELS)
23# define MAX_DMA_CHANNELS (CONFIG_NR_ONCHIP_DMA_CHANNELS)
24#else
25# define MAX_DMA_CHANNELS 0
26#endif
27
28/* 20/*
29 * Read and write modes can mean drastically different things depending on the 21 * Read and write modes can mean drastically different things depending on the
30 * channel configuration. Consult your DMAC documentation and module 22 * channel configuration. Consult your DMAC documentation and module
diff --git a/arch/sh/include/mach-dreamcast/mach/dma.h b/arch/sh/include/mach-dreamcast/mach/dma.h
index ddd68e788705..1dbfdf701c9d 100644
--- a/arch/sh/include/mach-dreamcast/mach/dma.h
+++ b/arch/sh/include/mach-dreamcast/mach/dma.h
@@ -11,9 +11,7 @@
11#define __ASM_SH_DREAMCAST_DMA_H 11#define __ASM_SH_DREAMCAST_DMA_H
12 12
13/* Number of DMA channels */ 13/* Number of DMA channels */
14#define ONCHIP_NR_DMA_CHANNELS 4
15#define G2_NR_DMA_CHANNELS 4 14#define G2_NR_DMA_CHANNELS 4
16#define PVR2_NR_DMA_CHANNELS 1
17 15
18/* Channels for cascading */ 16/* Channels for cascading */
19#define PVR2_CASCADE_CHAN 2 17#define PVR2_CASCADE_CHAN 2