aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2006-09-18 18:12:53 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-09-25 05:25:37 -0400
commit7ae1f7ec525c32db441836ab0ab010b85cb819a2 (patch)
tree25d87bd43198bdc3868c20cf3e8d44e8e343f0e6
parent3f7e5815f4b774270e6506962de37af85aa9c830 (diff)
[ARM] 3818/1: iop3xx: introduce arch/arm/plat-iop for shared iop32x/iop33x code
Introduce the arch/arm/plat-iop directory, for code shared between the iop32x and iop33x, and move the common memory map setup bits there. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/Kconfig5
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/mach-iop32x/iq31244-mm.c3
-rw-r--r--arch/arm/mach-iop32x/iq80321-mm.c3
-rw-r--r--arch/arm/mach-iop32x/setup.c22
-rw-r--r--arch/arm/mach-iop33x/Makefile4
-rw-r--r--arch/arm/mach-iop33x/iq80331-mm.c35
-rw-r--r--arch/arm/mach-iop33x/iq80332-mm.c35
-rw-r--r--arch/arm/mach-iop33x/setup.c35
-rw-r--r--arch/arm/plat-iop/Makefile8
-rw-r--r--arch/arm/plat-iop/setup.c38
-rw-r--r--include/asm-arm/arch-iop32x/iop321.h1
-rw-r--r--include/asm-arm/arch-iop33x/iop331.h1
-rw-r--r--include/asm-arm/hardware/iop3xx.h43
14 files changed, 104 insertions, 130 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0fb17bbb86bc..665ce173e664 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -205,6 +205,7 @@ config ARCH_IMX
205config ARCH_IOP32X 205config ARCH_IOP32X
206 bool "IOP32x-based" 206 bool "IOP32x-based"
207 depends on MMU 207 depends on MMU
208 select PLAT_IOP
208 select PCI 209 select PCI
209 help 210 help
210 Support for Intel's 80219 and IOP32X (XScale) family of 211 Support for Intel's 80219 and IOP32X (XScale) family of
@@ -213,6 +214,7 @@ config ARCH_IOP32X
213config ARCH_IOP33X 214config ARCH_IOP33X
214 bool "IOP33x-based" 215 bool "IOP33x-based"
215 depends on MMU 216 depends on MMU
217 select PLAT_IOP
216 select PCI 218 select PCI
217 help 219 help
218 Support for Intel's IOP33X (XScale) family of processors. 220 Support for Intel's IOP33X (XScale) family of processors.
@@ -362,6 +364,9 @@ source "arch/arm/mach-netx/Kconfig"
362config ARCH_ACORN 364config ARCH_ACORN
363 bool 365 bool
364 366
367config PLAT_IOP
368 bool
369
365source arch/arm/mm/Kconfig 370source arch/arm/mm/Kconfig
366 371
367# bool 'Use XScale PMU as timer source' CONFIG_XSCALE_PMU_TIMER 372# bool 'Use XScale PMU as timer source' CONFIG_XSCALE_PMU_TIMER
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ac786bf0f546..80cee786500c 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -158,6 +158,7 @@ core-$(CONFIG_FPE_FASTFPE) += $(FASTFPE_OBJ)
158core-$(CONFIG_VFP) += arch/arm/vfp/ 158core-$(CONFIG_VFP) += arch/arm/vfp/
159 159
160# If we have a common platform directory, then include it in the build. 160# If we have a common platform directory, then include it in the build.
161core-$(CONFIG_PLAT_IOP) += arch/arm/plat-iop/
161core-$(CONFIG_ARCH_OMAP) += arch/arm/plat-omap/ 162core-$(CONFIG_ARCH_OMAP) += arch/arm/plat-omap/
162 163
163drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/ 164drivers-$(CONFIG_OPROFILE) += arch/arm/oprofile/
diff --git a/arch/arm/mach-iop32x/iq31244-mm.c b/arch/arm/mach-iop32x/iq31244-mm.c
index ffc6692c95ad..fba22d5d908f 100644
--- a/arch/arm/mach-iop32x/iq31244-mm.c
+++ b/arch/arm/mach-iop32x/iq31244-mm.c
@@ -21,6 +21,7 @@
21#include <asm/page.h> 21#include <asm/page.h>
22 22
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24#include <asm/hardware/iop3xx.h>
24 25
25 26
26/* 27/*
@@ -39,7 +40,7 @@ static struct map_desc iq31244_io_desc[] __initdata = {
39 40
40void __init iq31244_map_io(void) 41void __init iq31244_map_io(void)
41{ 42{
42 iop321_map_io(); 43 iop3xx_map_io();
43 44
44 iotable_init(iq31244_io_desc, ARRAY_SIZE(iq31244_io_desc)); 45 iotable_init(iq31244_io_desc, ARRAY_SIZE(iq31244_io_desc));
45} 46}
diff --git a/arch/arm/mach-iop32x/iq80321-mm.c b/arch/arm/mach-iop32x/iq80321-mm.c
index 5f702a7ff622..b6a3079ad29e 100644
--- a/arch/arm/mach-iop32x/iq80321-mm.c
+++ b/arch/arm/mach-iop32x/iq80321-mm.c
@@ -21,6 +21,7 @@
21#include <asm/page.h> 21#include <asm/page.h>
22 22
23#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24#include <asm/hardware/iop3xx.h>
24 25
25 26
26/* 27/*
@@ -39,7 +40,7 @@ static struct map_desc iq80321_io_desc[] __initdata = {
39 40
40void __init iq80321_map_io(void) 41void __init iq80321_map_io(void)
41{ 42{
42 iop321_map_io(); 43 iop3xx_map_io();
43 44
44 iotable_init(iq80321_io_desc, ARRAY_SIZE(iq80321_io_desc)); 45 iotable_init(iq80321_io_desc, ARRAY_SIZE(iq80321_io_desc));
45} 46}
diff --git a/arch/arm/mach-iop32x/setup.c b/arch/arm/mach-iop32x/setup.c
index 729678799271..48d806474f40 100644
--- a/arch/arm/mach-iop32x/setup.c
+++ b/arch/arm/mach-iop32x/setup.c
@@ -32,23 +32,6 @@
32 32
33#define IOP321_UART_XTAL 1843200 33#define IOP321_UART_XTAL 1843200
34 34
35/*
36 * Standard IO mapping for all IOP321 based systems
37 */
38static struct map_desc iop321_std_desc[] __initdata = {
39 { /* mem mapped registers */
40 .virtual = IOP321_VIRT_MEM_BASE,
41 .pfn = __phys_to_pfn(IOP321_PHYS_MEM_BASE),
42 .length = 0x00002000,
43 .type = MT_DEVICE
44 }, { /* PCI IO space */
45 .virtual = IOP321_PCI_LOWER_IO_VA,
46 .pfn = __phys_to_pfn(IOP321_PCI_LOWER_IO_PA),
47 .length = IOP321_PCI_IO_WINDOW_SIZE,
48 .type = MT_DEVICE
49 }
50};
51
52#ifdef CONFIG_ARCH_IQ80321 35#ifdef CONFIG_ARCH_IQ80321
53#define UARTBASE IQ80321_UART 36#define UARTBASE IQ80321_UART
54#define IRQ_UART IRQ_IQ80321_UART 37#define IRQ_UART IRQ_IQ80321_UART
@@ -126,11 +109,6 @@ void __init iop32x_init(void)
126 platform_add_devices(iop32x_devices, 109 platform_add_devices(iop32x_devices,
127 ARRAY_SIZE(iop32x_devices)); 110 ARRAY_SIZE(iop32x_devices));
128 } 111 }
129}
130
131void __init iop321_map_io(void)
132{
133 iotable_init(iop321_std_desc, ARRAY_SIZE(iop321_std_desc));
134 early_serial_setup(&iop321_serial_ports[0]); 112 early_serial_setup(&iop321_serial_ports[0]);
135} 113}
136 114
diff --git a/arch/arm/mach-iop33x/Makefile b/arch/arm/mach-iop33x/Makefile
index 0f1a8fffe187..7865923b0a60 100644
--- a/arch/arm/mach-iop33x/Makefile
+++ b/arch/arm/mach-iop33x/Makefile
@@ -7,5 +7,5 @@ obj-m :=
7obj-n := 7obj-n :=
8obj- := 8obj- :=
9 9
10obj-$(CONFIG_ARCH_IQ80331) += iq80331-mm.o iq80331-pci.o 10obj-$(CONFIG_ARCH_IQ80331) += iq80331-pci.o
11obj-$(CONFIG_MACH_IQ80332) += iq80332-mm.o iq80332-pci.o 11obj-$(CONFIG_MACH_IQ80332) += iq80332-pci.o
diff --git a/arch/arm/mach-iop33x/iq80331-mm.c b/arch/arm/mach-iop33x/iq80331-mm.c
deleted file mode 100644
index eb59445a0fca..000000000000
--- a/arch/arm/mach-iop33x/iq80331-mm.c
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * linux/arch/arm/mach-iop33x/iq80331-mm.c
3 *
4 * Low level memory initialization for iq80331 platform
5 *
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2003 Intel Corp.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#include <linux/mm.h>
17#include <linux/init.h>
18
19#include <asm/io.h>
20#include <asm/pgtable.h>
21#include <asm/page.h>
22
23#include <asm/mach/map.h>
24
25
26/*
27 * IQ80331 specific IO mappings
28 *
29 * We use RedBoot's setup for the onboard devices.
30 */
31
32void __init iq80331_map_io(void)
33{
34 iop331_map_io();
35}
diff --git a/arch/arm/mach-iop33x/iq80332-mm.c b/arch/arm/mach-iop33x/iq80332-mm.c
deleted file mode 100644
index f7bc73113ea8..000000000000
--- a/arch/arm/mach-iop33x/iq80332-mm.c
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * linux/arch/arm/mach-iop33x/iq80332-mm.c
3 *
4 * Low level memory initialization for iq80332 platform
5 *
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2004 Intel Corp.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#include <linux/mm.h>
17#include <linux/init.h>
18
19#include <asm/io.h>
20#include <asm/pgtable.h>
21#include <asm/page.h>
22
23#include <asm/mach/map.h>
24
25
26/*
27 * IQ80332 specific IO mappings
28 *
29 * We use RedBoot's setup for the onboard devices.
30 */
31
32void __init iq80332_map_io(void)
33{
34 iop331_map_io();
35}
diff --git a/arch/arm/mach-iop33x/setup.c b/arch/arm/mach-iop33x/setup.c
index c14c7da5ec4c..67cb21cb0ad9 100644
--- a/arch/arm/mach-iop33x/setup.c
+++ b/arch/arm/mach-iop33x/setup.c
@@ -28,26 +28,10 @@
28#include <asm/hardware.h> 28#include <asm/hardware.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
31#include <asm/hardware/iop3xx.h>
31 32
32#define IOP331_UART_XTAL 33334000 33#define IOP331_UART_XTAL 33334000
33 34
34/*
35 * Standard IO mapping for all IOP331 based systems
36 */
37static struct map_desc iop331_std_desc[] __initdata = {
38 { /* mem mapped registers */
39 .virtual = IOP331_VIRT_MEM_BASE,
40 .pfn = __phys_to_pfn(IOP331_PHYS_MEM_BASE),
41 .length = 0x00002000,
42 .type = MT_DEVICE
43 }, { /* PCI IO space */
44 .virtual = IOP331_PCI_LOWER_IO_VA,
45 .pfn = __phys_to_pfn(IOP331_PCI_LOWER_IO_PA),
46 .length = IOP331_PCI_IO_WINDOW_SIZE,
47 .type = MT_DEVICE
48 }
49};
50
51static struct resource iop33x_uart0_resources[] = { 35static struct resource iop33x_uart0_resources[] = {
52 [0] = { 36 [0] = {
53 .start = IOP331_UART0_PHYS, 37 .start = IOP331_UART0_PHYS,
@@ -172,30 +156,17 @@ void __init iop33x_init(void)
172 } 156 }
173} 157}
174 158
175void __init iop331_map_io(void)
176{
177 iotable_init(iop331_std_desc, ARRAY_SIZE(iop331_std_desc));
178}
179
180#ifdef CONFIG_ARCH_IOP33X 159#ifdef CONFIG_ARCH_IOP33X
181extern void iop331_init_irq(void); 160extern void iop331_init_irq(void);
182extern struct sys_timer iop331_timer; 161extern struct sys_timer iop331_timer;
183#endif 162#endif
184 163
185#ifdef CONFIG_ARCH_IQ80331
186extern void iq80331_map_io(void);
187#endif
188
189#ifdef CONFIG_MACH_IQ80332
190extern void iq80332_map_io(void);
191#endif
192
193#if defined(CONFIG_ARCH_IQ80331) 164#if defined(CONFIG_ARCH_IQ80331)
194MACHINE_START(IQ80331, "Intel IQ80331") 165MACHINE_START(IQ80331, "Intel IQ80331")
195 /* Maintainer: Intel Corp. */ 166 /* Maintainer: Intel Corp. */
196 .phys_io = 0xfefff000, 167 .phys_io = 0xfefff000,
197 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical 168 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
198 .map_io = iq80331_map_io, 169 .map_io = iop3xx_map_io,
199 .init_irq = iop331_init_irq, 170 .init_irq = iop331_init_irq,
200 .timer = &iop331_timer, 171 .timer = &iop331_timer,
201 .boot_params = 0x0100, 172 .boot_params = 0x0100,
@@ -207,7 +178,7 @@ MACHINE_START(IQ80332, "Intel IQ80332")
207 /* Maintainer: Intel Corp. */ 178 /* Maintainer: Intel Corp. */
208 .phys_io = 0xfefff000, 179 .phys_io = 0xfefff000,
209 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical 180 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
210 .map_io = iq80332_map_io, 181 .map_io = iop3xx_map_io,
211 .init_irq = iop331_init_irq, 182 .init_irq = iop331_init_irq,
212 .timer = &iop331_timer, 183 .timer = &iop331_timer,
213 .boot_params = 0x0100, 184 .boot_params = 0x0100,
diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile
new file mode 100644
index 000000000000..b299103537c5
--- /dev/null
+++ b/arch/arm/plat-iop/Makefile
@@ -0,0 +1,8 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y := setup.o
6obj-m :=
7obj-n :=
8obj- :=
diff --git a/arch/arm/plat-iop/setup.c b/arch/arm/plat-iop/setup.c
new file mode 100644
index 000000000000..4689db638e95
--- /dev/null
+++ b/arch/arm/plat-iop/setup.c
@@ -0,0 +1,38 @@
1/*
2 * arch/arm/plat-iop/setup.c
3 *
4 * Author: Nicolas Pitre <nico@cam.org>
5 * Copyright (C) 2001 MontaVista Software, Inc.
6 * Copyright (C) 2004 Intel Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/mm.h>
14#include <linux/init.h>
15#include <asm/mach/map.h>
16#include <asm/hardware/iop3xx.h>
17
18/*
19 * Standard IO mapping for all IOP3xx based systems
20 */
21static struct map_desc iop3xx_std_desc[] __initdata = {
22 { /* mem mapped registers */
23 .virtual = IOP3XX_PERIPHERAL_VIRT_BASE,
24 .pfn = __phys_to_pfn(IOP3XX_PERIPHERAL_PHYS_BASE),
25 .length = IOP3XX_PERIPHERAL_SIZE,
26 .type = MT_DEVICE,
27 }, { /* PCI IO space */
28 .virtual = IOP3XX_PCI_LOWER_IO_VA,
29 .pfn = __phys_to_pfn(IOP3XX_PCI_LOWER_IO_PA),
30 .length = IOP3XX_PCI_IO_WINDOW_SIZE,
31 .type = MT_DEVICE,
32 },
33};
34
35void __init iop3xx_map_io(void)
36{
37 iotable_init(iop3xx_std_desc, ARRAY_SIZE(iop3xx_std_desc));
38}
diff --git a/include/asm-arm/arch-iop32x/iop321.h b/include/asm-arm/arch-iop32x/iop321.h
index 7ba93faf8da4..307272b07809 100644
--- a/include/asm-arm/arch-iop32x/iop321.h
+++ b/include/asm-arm/arch-iop32x/iop321.h
@@ -333,7 +333,6 @@
333 333
334 334
335#ifndef __ASSEMBLY__ 335#ifndef __ASSEMBLY__
336extern void iop321_map_io(void);
337extern void iop321_init_irq(void); 336extern void iop321_init_irq(void);
338extern void iop321_time_init(void); 337extern void iop321_time_init(void);
339#endif 338#endif
diff --git a/include/asm-arm/arch-iop33x/iop331.h b/include/asm-arm/arch-iop33x/iop331.h
index 780b707edb1e..21430f877ea7 100644
--- a/include/asm-arm/arch-iop33x/iop331.h
+++ b/include/asm-arm/arch-iop33x/iop331.h
@@ -350,7 +350,6 @@
350 350
351 351
352#ifndef __ASSEMBLY__ 352#ifndef __ASSEMBLY__
353extern void iop331_map_io(void);
354extern void iop331_init_irq(void); 353extern void iop331_init_irq(void);
355extern void iop331_time_init(void); 354extern void iop331_time_init(void);
356#endif 355#endif
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h
new file mode 100644
index 000000000000..c17cc19cdfab
--- /dev/null
+++ b/include/asm-arm/hardware/iop3xx.h
@@ -0,0 +1,43 @@
1/*
2 * include/asm-arm/hardware/iop3xx.h
3 *
4 * Intel IOP32X and IOP33X register definitions
5 *
6 * Author: Rory Bolt <rorybolt@pacbell.net>
7 * Copyright (C) 2002 Rory Bolt
8 * Copyright (C) 2004 Intel Corp.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef __IOP3XX_H
16#define __IOP3XX_H
17
18/*
19 * IOP3XX processor registers
20 */
21#define IOP3XX_PERIPHERAL_PHYS_BASE 0xffffe000
22#define IOP3XX_PERIPHERAL_VIRT_BASE 0xfeffe000
23#define IOP3XX_PERIPHERAL_SIZE 0x00002000
24#define IOP3XX_REG_ADDR(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + (reg))
25
26
27/*
28 * IOP3XX I/O and Mem space regions for PCI autoconfiguration
29 */
30#define IOP3XX_PCI_MEM_WINDOW_SIZE 0x04000000
31#define IOP3XX_PCI_LOWER_MEM_PA 0x80000000
32
33#define IOP3XX_PCI_IO_WINDOW_SIZE 0x00010000
34#define IOP3XX_PCI_LOWER_IO_PA 0x90000000
35#define IOP3XX_PCI_LOWER_IO_VA 0xfe000000
36
37
38#ifndef __ASSEMBLY__
39void iop3xx_map_io(void);
40#endif
41
42
43#endif