2 * arch/arm/mach-spear6xx/spear6xx.c
4 * SPEAr6XX machines common source file
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
14 #include <linux/types.h>
15 #include <linux/amba/pl061.h>
16 #include <linux/types.h>
17 #include <linux/ptrace.h>
19 #include <asm/hardware/vic.h>
21 #include <asm/mach/arch.h>
22 #include <mach/irqs.h>
23 #include <mach/generic.h>
24 #include <mach/spear.h>
26 /* Add spear6xx machines common devices here */
27 /* uart device registeration */
28 struct amba_device uart_device
[] = {
34 .start
= SPEAR6XX_ICM1_UART0_BASE
,
35 .end
= SPEAR6XX_ICM1_UART0_BASE
+
36 SPEAR6XX_ICM1_UART0_SIZE
- 1,
37 .flags
= IORESOURCE_MEM
,
39 .irq
= {IRQ_UART_0
, NO_IRQ
},
45 .start
= SPEAR6XX_ICM1_UART1_BASE
,
46 .end
= SPEAR6XX_ICM1_UART1_BASE
+
47 SPEAR6XX_ICM1_UART1_SIZE
- 1,
48 .flags
= IORESOURCE_MEM
,
50 .irq
= {IRQ_UART_1
, NO_IRQ
},
54 /* gpio device registeration */
55 static struct pl061_platform_data gpio_plat_data
[] = {
58 .irq_base
= SPEAR_GPIO0_INT_BASE
,
61 .irq_base
= SPEAR_GPIO1_INT_BASE
,
64 .irq_base
= SPEAR_GPIO2_INT_BASE
,
68 struct amba_device gpio_device
[] = {
72 .platform_data
= &gpio_plat_data
[0],
75 .start
= SPEAR6XX_CPU_GPIO_BASE
,
76 .end
= SPEAR6XX_CPU_GPIO_BASE
+
77 SPEAR6XX_CPU_GPIO_SIZE
- 1,
78 .flags
= IORESOURCE_MEM
,
80 .irq
= {IRQ_LOCAL_GPIO
, NO_IRQ
},
84 .platform_data
= &gpio_plat_data
[1],
87 .start
= SPEAR6XX_ICM3_GPIO_BASE
,
88 .end
= SPEAR6XX_ICM3_GPIO_BASE
+
89 SPEAR6XX_ICM3_GPIO_SIZE
- 1,
90 .flags
= IORESOURCE_MEM
,
92 .irq
= {IRQ_BASIC_GPIO
, NO_IRQ
},
96 .platform_data
= &gpio_plat_data
[2],
99 .start
= SPEAR6XX_ICM2_GPIO_BASE
,
100 .end
= SPEAR6XX_ICM2_GPIO_BASE
+
101 SPEAR6XX_ICM2_GPIO_SIZE
- 1,
102 .flags
= IORESOURCE_MEM
,
104 .irq
= {IRQ_APPL_GPIO
, NO_IRQ
},
108 /* This will add devices, and do machine specific tasks */
109 void __init
spear6xx_init(void)
111 /* nothing to do for now */
114 /* This will initialize vic */
115 void __init
spear6xx_init_irq(void)
117 vic_init((void __iomem
*)VA_SPEAR6XX_CPU_VIC_PRI_BASE
, 0, ~0, 0);
118 vic_init((void __iomem
*)VA_SPEAR6XX_CPU_VIC_SEC_BASE
, 32, ~0, 0);
121 /* Following will create static virtual/physical mappings */
122 static struct map_desc spear6xx_io_desc
[] __initdata
= {
124 .virtual = VA_SPEAR6XX_ICM1_UART0_BASE
,
125 .pfn
= __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE
),
126 .length
= SPEAR6XX_ICM1_UART0_SIZE
,
129 .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE
,
130 .pfn
= __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE
),
131 .length
= SPEAR6XX_CPU_VIC_PRI_SIZE
,
134 .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE
,
135 .pfn
= __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE
),
136 .length
= SPEAR6XX_CPU_VIC_SEC_SIZE
,
139 .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE
,
140 .pfn
= __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE
),
141 .length
= SPEAR6XX_ICM3_MISC_REG_BASE
,
144 .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE
,
145 .pfn
= __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE
),
146 .length
= SPEAR6XX_ICM3_MISC_REG_SIZE
,
151 /* This will create static memory mapping for selected devices */
152 void __init
spear6xx_map_io(void)
154 iotable_init(spear6xx_io_desc
, ARRAY_SIZE(spear6xx_io_desc
));
156 /* This will initialize clock framework */