aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-iop13xx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-06 16:20:10 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-06 16:20:10 -0400
commitc6799ade4ae04b53a5f677e5289116155ff01574 (patch)
tree3601b5e2387e39d62c207e4268c6cc5c68f2a364 /arch/arm/mach-iop13xx
parentb7405e16435f710edfae6ba32bef4ca20d3de145 (diff)
parent5cd47155155a32e5b944ac9fc3f3dc578e429aa0 (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (82 commits) [ARM] Add comments marking in-use ptrace numbers [ARM] Move syscall saving out of the way of utrace [ARM] 4360/1: S3C24XX: regs-udc.h remove unused macro [ARM] 4358/1: S3C24XX: mach-qt2410.c: remove linux/mmc/protocol.h header [ARM] mm 10: allow memory type to be specified with ioremap [ARM] mm 9: add additional device memory types [ARM] mm 8: define mem_types table L1 bit 4 to be for ARMv6 [ARM] iop: add missing parens in macro [ARM] mm 7: remove duplicated __ioremap() prototypes ARM: OMAP: fix OMAP1 mpuio suspend/resume oops ARM: OMAP: MPUIO wake updates ARM: OMAP: speed up gpio irq handling ARM: OMAP: plat-omap changes for 2430 SDP ARM: OMAP: gpio object shrinkage, cleanup ARM: OMAP: /sys/kernel/debug/omap_gpio ARM: OMAP: Implement workaround for GPIO wakeup bug in OMAP2420 silicon ARM: OMAP: Enable 24xx GPIO autoidling [ARM] 4318/2: DSM-G600 Board Support [ARM] 4227/1: minor head.S fixups [ARM] 4328/1: Move i.MX UART regs to driver ...
Diffstat (limited to 'arch/arm/mach-iop13xx')
-rw-r--r--arch/arm/mach-iop13xx/Makefile1
-rw-r--r--arch/arm/mach-iop13xx/io.c10
-rw-r--r--arch/arm/mach-iop13xx/iq81340mc.c5
-rw-r--r--arch/arm/mach-iop13xx/iq81340sc.c5
-rw-r--r--arch/arm/mach-iop13xx/pci.c16
-rw-r--r--arch/arm/mach-iop13xx/setup.c6
-rw-r--r--arch/arm/mach-iop13xx/tpmi.c234
7 files changed, 257 insertions, 20 deletions
diff --git a/arch/arm/mach-iop13xx/Makefile b/arch/arm/mach-iop13xx/Makefile
index 4185e0586c33..da1609dc0dee 100644
--- a/arch/arm/mach-iop13xx/Makefile
+++ b/arch/arm/mach-iop13xx/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_ARCH_IOP13XX) += setup.o
7obj-$(CONFIG_ARCH_IOP13XX) += irq.o 7obj-$(CONFIG_ARCH_IOP13XX) += irq.o
8obj-$(CONFIG_ARCH_IOP13XX) += pci.o 8obj-$(CONFIG_ARCH_IOP13XX) += pci.o
9obj-$(CONFIG_ARCH_IOP13XX) += io.o 9obj-$(CONFIG_ARCH_IOP13XX) += io.o
10obj-$(CONFIG_ARCH_IOP13XX) += tpmi.o
10obj-$(CONFIG_MACH_IQ81340SC) += iq81340sc.o 11obj-$(CONFIG_MACH_IQ81340SC) += iq81340sc.o
11obj-$(CONFIG_MACH_IQ81340MC) += iq81340mc.o 12obj-$(CONFIG_MACH_IQ81340MC) += iq81340mc.o
diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c
index e79a1b62600f..5b22fdeca52c 100644
--- a/arch/arm/mach-iop13xx/io.c
+++ b/arch/arm/mach-iop13xx/io.c
@@ -41,7 +41,7 @@ void * __iomem __iop13xx_io(unsigned long io_addr)
41EXPORT_SYMBOL(__iop13xx_io); 41EXPORT_SYMBOL(__iop13xx_io);
42 42
43void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size, 43void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
44 unsigned long flags) 44 unsigned int mtype)
45{ 45{
46 void __iomem * retval; 46 void __iomem * retval;
47 47
@@ -61,9 +61,9 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
61 (cookie - IOP13XX_PCIE_LOWER_MEM_RA)); 61 (cookie - IOP13XX_PCIE_LOWER_MEM_RA));
62 break; 62 break;
63 case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA: 63 case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA:
64 retval = __ioremap(IOP13XX_PBI_LOWER_MEM_PA + 64 retval = __arm_ioremap(IOP13XX_PBI_LOWER_MEM_PA +
65 (cookie - IOP13XX_PBI_LOWER_MEM_RA), 65 (cookie - IOP13XX_PBI_LOWER_MEM_RA),
66 size, flags); 66 size, mtype);
67 break; 67 break;
68 case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA: 68 case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
69 retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie); 69 retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie);
@@ -75,7 +75,7 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
75 retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie); 75 retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie);
76 break; 76 break;
77 default: 77 default:
78 retval = __ioremap(cookie, size, flags); 78 retval = __arm_ioremap(cookie, size, mtype);
79 } 79 }
80 80
81 return retval; 81 return retval;
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c
index a519d707571c..268a8d84999c 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -75,11 +75,14 @@ static void __init iq81340mc_init(void)
75{ 75{
76 iop13xx_platform_init(); 76 iop13xx_platform_init();
77 iq81340mc_pci_init(); 77 iq81340mc_pci_init();
78 iop13xx_add_tpmi_devices();
78} 79}
79 80
80static void __init iq81340mc_timer_init(void) 81static void __init iq81340mc_timer_init(void)
81{ 82{
82 iop_init_time(400000000); 83 unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
84 printk(KERN_DEBUG "%s: bus frequency: %lu\n", __FUNCTION__, bus_freq);
85 iop_init_time(bus_freq);
83} 86}
84 87
85static struct sys_timer iq81340mc_timer = { 88static struct sys_timer iq81340mc_timer = {
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
index 0e71fbcabe00..a51ffd2683e5 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -77,11 +77,14 @@ static void __init iq81340sc_init(void)
77{ 77{
78 iop13xx_platform_init(); 78 iop13xx_platform_init();
79 iq81340sc_pci_init(); 79 iq81340sc_pci_init();
80 iop13xx_add_tpmi_devices();
80} 81}
81 82
82static void __init iq81340sc_timer_init(void) 83static void __init iq81340sc_timer_init(void)
83{ 84{
84 iop_init_time(400000000); 85 unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
86 printk(KERN_DEBUG "%s: bus frequency: %lu\n", __FUNCTION__, bus_freq);
87 iop_init_time(bus_freq);
85} 88}
86 89
87static struct sys_timer iq81340sc_timer = { 90static struct sys_timer iq81340sc_timer = {
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index 89ec70ea3187..d1d0d32ca77c 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -88,9 +88,9 @@ void iop13xx_map_pci_memory(void)
88 88
89 if (end) { 89 if (end) {
90 iop13xx_atux_mem_base = 90 iop13xx_atux_mem_base =
91 (u32) __ioremap_pfn( 91 (u32) __arm_ioremap_pfn(
92 __phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA) 92 __phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA)
93 , 0, iop13xx_atux_mem_size, 0); 93 , 0, iop13xx_atux_mem_size, MT_DEVICE);
94 if (!iop13xx_atux_mem_base) { 94 if (!iop13xx_atux_mem_base) {
95 printk("%s: atux allocation " 95 printk("%s: atux allocation "
96 "failed\n", __FUNCTION__); 96 "failed\n", __FUNCTION__);
@@ -114,9 +114,9 @@ void iop13xx_map_pci_memory(void)
114 114
115 if (end) { 115 if (end) {
116 iop13xx_atue_mem_base = 116 iop13xx_atue_mem_base =
117 (u32) __ioremap_pfn( 117 (u32) __arm_ioremap_pfn(
118 __phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA) 118 __phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA)
119 , 0, iop13xx_atue_mem_size, 0); 119 , 0, iop13xx_atue_mem_size, MT_DEVICE);
120 if (!iop13xx_atue_mem_base) { 120 if (!iop13xx_atue_mem_base) {
121 printk("%s: atue allocation " 121 printk("%s: atue allocation "
122 "failed\n", __FUNCTION__); 122 "failed\n", __FUNCTION__);
@@ -1023,7 +1023,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1023 << IOP13XX_ATUX_PCIXSR_FUNC_NUM; 1023 << IOP13XX_ATUX_PCIXSR_FUNC_NUM;
1024 __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR); 1024 __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR);
1025 1025
1026 res[0].start = IOP13XX_PCIX_LOWER_IO_PA; 1026 res[0].start = IOP13XX_PCIX_LOWER_IO_PA + IOP13XX_PCIX_IO_BUS_OFFSET;
1027 res[0].end = IOP13XX_PCIX_UPPER_IO_PA; 1027 res[0].end = IOP13XX_PCIX_UPPER_IO_PA;
1028 res[0].name = "IQ81340 ATUX PCI I/O Space"; 1028 res[0].name = "IQ81340 ATUX PCI I/O Space";
1029 res[0].flags = IORESOURCE_IO; 1029 res[0].flags = IORESOURCE_IO;
@@ -1033,7 +1033,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1033 res[1].name = "IQ81340 ATUX PCI Memory Space"; 1033 res[1].name = "IQ81340 ATUX PCI Memory Space";
1034 res[1].flags = IORESOURCE_MEM; 1034 res[1].flags = IORESOURCE_MEM;
1035 sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET; 1035 sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET;
1036 sys->io_offset = IOP13XX_PCIX_IO_OFFSET; 1036 sys->io_offset = IOP13XX_PCIX_LOWER_IO_PA;
1037 break; 1037 break;
1038 case IOP13XX_INIT_ATU_ATUE: 1038 case IOP13XX_INIT_ATU_ATUE:
1039 /* Note: the function number field in the PCSR is ro */ 1039 /* Note: the function number field in the PCSR is ro */
@@ -1044,7 +1044,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1044 1044
1045 __raw_writel(pcsr, IOP13XX_ATUE_PCSR); 1045 __raw_writel(pcsr, IOP13XX_ATUE_PCSR);
1046 1046
1047 res[0].start = IOP13XX_PCIE_LOWER_IO_PA; 1047 res[0].start = IOP13XX_PCIE_LOWER_IO_PA + IOP13XX_PCIE_IO_BUS_OFFSET;
1048 res[0].end = IOP13XX_PCIE_UPPER_IO_PA; 1048 res[0].end = IOP13XX_PCIE_UPPER_IO_PA;
1049 res[0].name = "IQ81340 ATUE PCI I/O Space"; 1049 res[0].name = "IQ81340 ATUE PCI I/O Space";
1050 res[0].flags = IORESOURCE_IO; 1050 res[0].flags = IORESOURCE_IO;
@@ -1054,7 +1054,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1054 res[1].name = "IQ81340 ATUE PCI Memory Space"; 1054 res[1].name = "IQ81340 ATUE PCI Memory Space";
1055 res[1].flags = IORESOURCE_MEM; 1055 res[1].flags = IORESOURCE_MEM;
1056 sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET; 1056 sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET;
1057 sys->io_offset = IOP13XX_PCIE_IO_OFFSET; 1057 sys->io_offset = IOP13XX_PCIE_LOWER_IO_PA;
1058 sys->map_irq = iop13xx_pcie_map_irq; 1058 sys->map_irq = iop13xx_pcie_map_irq;
1059 break; 1059 break;
1060 default: 1060 default:
diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
index 9a46bcd5f18e..bc4871553f6a 100644
--- a/arch/arm/mach-iop13xx/setup.c
+++ b/arch/arm/mach-iop13xx/setup.c
@@ -258,15 +258,11 @@ void __init iop13xx_platform_init(void)
258 258
259 if (init_uart == IOP13XX_INIT_UART_DEFAULT) { 259 if (init_uart == IOP13XX_INIT_UART_DEFAULT) {
260 switch (iop13xx_dev_id()) { 260 switch (iop13xx_dev_id()) {
261 /* enable both uarts on iop341 and iop342 */ 261 /* enable both uarts on iop341 */
262 case 0x3380: 262 case 0x3380:
263 case 0x3384: 263 case 0x3384:
264 case 0x3388: 264 case 0x3388:
265 case 0x338c: 265 case 0x338c:
266 case 0x3382:
267 case 0x3386:
268 case 0x338a:
269 case 0x338e:
270 init_uart |= IOP13XX_INIT_UART_0; 266 init_uart |= IOP13XX_INIT_UART_0;
271 init_uart |= IOP13XX_INIT_UART_1; 267 init_uart |= IOP13XX_INIT_UART_1;
272 break; 268 break;
diff --git a/arch/arm/mach-iop13xx/tpmi.c b/arch/arm/mach-iop13xx/tpmi.c
new file mode 100644
index 000000000000..d3dc278213da
--- /dev/null
+++ b/arch/arm/mach-iop13xx/tpmi.c
@@ -0,0 +1,234 @@
1/*
2 * iop13xx tpmi device resources
3 * Copyright (c) 2005-2006, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 */
19
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/dma-mapping.h>
24#include <asm/io.h>
25#include <asm/irq.h>
26#include <asm/sizes.h>
27
28/* assumes CONTROLLER_ONLY# is never asserted in the ESSR register */
29#define IOP13XX_TPMI_MMR(dev) IOP13XX_REG_ADDR32_PHYS(0x48000 + (dev << 12))
30#define IOP13XX_TPMI_MEM(dev) IOP13XX_REG_ADDR32_PHYS(0x60000 + (dev << 13))
31#define IOP13XX_TPMI_CTRL(dev) IOP13XX_REG_ADDR32_PHYS(0x50000 + (dev << 10))
32#define IOP13XX_TPMI_MMR_SIZE (SZ_4K - 1)
33#define IOP13XX_TPMI_MEM_SIZE (255)
34#define IOP13XX_TPMI_MEM_CTRL (SZ_1K - 1)
35#define IOP13XX_TPMI_RESOURCE_MMR 0
36#define IOP13XX_TPMI_RESOURCE_MEM 1
37#define IOP13XX_TPMI_RESOURCE_CTRL 2
38#define IOP13XX_TPMI_RESOURCE_IRQ 3
39
40static struct resource iop13xx_tpmi_0_resources[] = {
41 [IOP13XX_TPMI_RESOURCE_MMR] = {
42 .start = IOP13XX_TPMI_MMR(4), /* tpmi0 starts at dev == 4 */
43 .end = IOP13XX_TPMI_MMR(4) + IOP13XX_TPMI_MMR_SIZE,
44 .flags = IORESOURCE_MEM,
45 },
46 [IOP13XX_TPMI_RESOURCE_MEM] = {
47 .start = IOP13XX_TPMI_MEM(0),
48 .end = IOP13XX_TPMI_MEM(0) + IOP13XX_TPMI_MEM_SIZE,
49 .flags = IORESOURCE_MEM,
50 },
51 [IOP13XX_TPMI_RESOURCE_CTRL] = {
52 .start = IOP13XX_TPMI_CTRL(0),
53 .end = IOP13XX_TPMI_CTRL(0) + IOP13XX_TPMI_MEM_CTRL,
54 .flags = IORESOURCE_MEM,
55 },
56 [IOP13XX_TPMI_RESOURCE_IRQ] = {
57 .start = IRQ_IOP13XX_TPMI0_OUT,
58 .end = IRQ_IOP13XX_TPMI0_OUT,
59 .flags = IORESOURCE_IRQ
60 }
61};
62
63static struct resource iop13xx_tpmi_1_resources[] = {
64 [IOP13XX_TPMI_RESOURCE_MMR] = {
65 .start = IOP13XX_TPMI_MMR(1),
66 .end = IOP13XX_TPMI_MMR(1) + IOP13XX_TPMI_MMR_SIZE,
67 .flags = IORESOURCE_MEM,
68 },
69 [IOP13XX_TPMI_RESOURCE_MEM] = {
70 .start = IOP13XX_TPMI_MEM(1),
71 .end = IOP13XX_TPMI_MEM(1) + IOP13XX_TPMI_MEM_SIZE,
72 .flags = IORESOURCE_MEM,
73 },
74 [IOP13XX_TPMI_RESOURCE_CTRL] = {
75 .start = IOP13XX_TPMI_CTRL(1),
76 .end = IOP13XX_TPMI_CTRL(1) + IOP13XX_TPMI_MEM_CTRL,
77 .flags = IORESOURCE_MEM,
78 },
79 [IOP13XX_TPMI_RESOURCE_IRQ] = {
80 .start = IRQ_IOP13XX_TPMI1_OUT,
81 .end = IRQ_IOP13XX_TPMI1_OUT,
82 .flags = IORESOURCE_IRQ
83 }
84};
85
86static struct resource iop13xx_tpmi_2_resources[] = {
87 [IOP13XX_TPMI_RESOURCE_MMR] = {
88 .start = IOP13XX_TPMI_MMR(2),
89 .end = IOP13XX_TPMI_MMR(2) + IOP13XX_TPMI_MMR_SIZE,
90 .flags = IORESOURCE_MEM,
91 },
92 [IOP13XX_TPMI_RESOURCE_MEM] = {
93 .start = IOP13XX_TPMI_MEM(2),
94 .end = IOP13XX_TPMI_MEM(2) + IOP13XX_TPMI_MEM_SIZE,
95 .flags = IORESOURCE_MEM,
96 },
97 [IOP13XX_TPMI_RESOURCE_CTRL] = {
98 .start = IOP13XX_TPMI_CTRL(2),
99 .end = IOP13XX_TPMI_CTRL(2) + IOP13XX_TPMI_MEM_CTRL,
100 .flags = IORESOURCE_MEM,
101 },
102 [IOP13XX_TPMI_RESOURCE_IRQ] = {
103 .start = IRQ_IOP13XX_TPMI2_OUT,
104 .end = IRQ_IOP13XX_TPMI2_OUT,
105 .flags = IORESOURCE_IRQ
106 }
107};
108
109static struct resource iop13xx_tpmi_3_resources[] = {
110 [IOP13XX_TPMI_RESOURCE_MMR] = {
111 .start = IOP13XX_TPMI_MMR(3),
112 .end = IOP13XX_TPMI_MMR(3) + IOP13XX_TPMI_MMR_SIZE,
113 .flags = IORESOURCE_MEM,
114 },
115 [IOP13XX_TPMI_RESOURCE_MEM] = {
116 .start = IOP13XX_TPMI_MEM(3),
117 .end = IOP13XX_TPMI_MEM(3) + IOP13XX_TPMI_MEM_SIZE,
118 .flags = IORESOURCE_MEM,
119 },
120 [IOP13XX_TPMI_RESOURCE_CTRL] = {
121 .start = IOP13XX_TPMI_CTRL(3),
122 .end = IOP13XX_TPMI_CTRL(3) + IOP13XX_TPMI_MEM_CTRL,
123 .flags = IORESOURCE_MEM,
124 },
125 [IOP13XX_TPMI_RESOURCE_IRQ] = {
126 .start = IRQ_IOP13XX_TPMI3_OUT,
127 .end = IRQ_IOP13XX_TPMI3_OUT,
128 .flags = IORESOURCE_IRQ
129 }
130};
131
132u64 iop13xx_tpmi_mask = DMA_64BIT_MASK;
133static struct platform_device iop13xx_tpmi_0_device = {
134 .name = "iop-tpmi",
135 .id = 0,
136 .num_resources = 4,
137 .resource = iop13xx_tpmi_0_resources,
138 .dev = {
139 .dma_mask = &iop13xx_tpmi_mask,
140 .coherent_dma_mask = DMA_64BIT_MASK,
141 },
142};
143
144static struct platform_device iop13xx_tpmi_1_device = {
145 .name = "iop-tpmi",
146 .id = 1,
147 .num_resources = 4,
148 .resource = iop13xx_tpmi_1_resources,
149 .dev = {
150 .dma_mask = &iop13xx_tpmi_mask,
151 .coherent_dma_mask = DMA_64BIT_MASK,
152 },
153};
154
155static struct platform_device iop13xx_tpmi_2_device = {
156 .name = "iop-tpmi",
157 .id = 2,
158 .num_resources = 4,
159 .resource = iop13xx_tpmi_2_resources,
160 .dev = {
161 .dma_mask = &iop13xx_tpmi_mask,
162 .coherent_dma_mask = DMA_64BIT_MASK,
163 },
164};
165
166static struct platform_device iop13xx_tpmi_3_device = {
167 .name = "iop-tpmi",
168 .id = 3,
169 .num_resources = 4,
170 .resource = iop13xx_tpmi_3_resources,
171 .dev = {
172 .dma_mask = &iop13xx_tpmi_mask,
173 .coherent_dma_mask = DMA_64BIT_MASK,
174 },
175};
176
177__init void iop13xx_add_tpmi_devices(void)
178{
179 unsigned short device_id;
180
181 /* tpmi's not present on iop341 or iop342 */
182 if (__raw_readl(IOP13XX_ESSR0) & IOP13XX_INTERFACE_SEL_PCIX)
183 /* ATUE must be present */
184 device_id = __raw_readw(IOP13XX_ATUE_DID);
185 else
186 /* ATUX must be present */
187 device_id = __raw_readw(IOP13XX_ATUX_DID);
188
189 switch (device_id) {
190 /* iop34[1|2] 0-tpmi */
191 case 0x3380:
192 case 0x3384:
193 case 0x3388:
194 case 0x338c:
195 case 0x3382:
196 case 0x3386:
197 case 0x338a:
198 case 0x338e:
199 return;
200 /* iop348 1-tpmi */
201 case 0x3310:
202 case 0x3312:
203 case 0x3314:
204 case 0x3318:
205 case 0x331a:
206 case 0x331c:
207 case 0x33c0:
208 case 0x33c2:
209 case 0x33c4:
210 case 0x33c8:
211 case 0x33ca:
212 case 0x33cc:
213 case 0x33b0:
214 case 0x33b2:
215 case 0x33b4:
216 case 0x33b8:
217 case 0x33ba:
218 case 0x33bc:
219 case 0x3320:
220 case 0x3322:
221 case 0x3324:
222 case 0x3328:
223 case 0x332a:
224 case 0x332c:
225 platform_device_register(&iop13xx_tpmi_0_device);
226 return;
227 default:
228 platform_device_register(&iop13xx_tpmi_0_device);
229 platform_device_register(&iop13xx_tpmi_1_device);
230 platform_device_register(&iop13xx_tpmi_2_device);
231 platform_device_register(&iop13xx_tpmi_3_device);
232 return;
233 }
234}