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/ptrace.h>
18 #include <asm/hardware/vic.h>
20 #include <asm/mach/arch.h>
21 #include <mach/irqs.h>
22 #include <mach/generic.h>
23 #include <mach/spear.h>
25 /* Add spear6xx machines common devices here */
26 /* uart device registeration */
27 struct amba_device uart_device
[] = {
33 .start
= SPEAR6XX_ICM1_UART0_BASE
,
34 .end
= SPEAR6XX_ICM1_UART0_BASE
+
35 SPEAR6XX_ICM1_UART0_SIZE
- 1,
36 .flags
= IORESOURCE_MEM
,
38 .irq
= {IRQ_UART_0
, NO_IRQ
},
44 .start
= SPEAR6XX_ICM1_UART1_BASE
,
45 .end
= SPEAR6XX_ICM1_UART1_BASE
+
46 SPEAR6XX_ICM1_UART1_SIZE
- 1,
47 .flags
= IORESOURCE_MEM
,
49 .irq
= {IRQ_UART_1
, NO_IRQ
},
53 /* gpio device registeration */
54 static struct pl061_platform_data gpio_plat_data
[] = {
57 .irq_base
= SPEAR_GPIO0_INT_BASE
,
60 .irq_base
= SPEAR_GPIO1_INT_BASE
,
63 .irq_base
= SPEAR_GPIO2_INT_BASE
,
67 struct amba_device gpio_device
[] = {
71 .platform_data
= &gpio_plat_data
[0],
74 .start
= SPEAR6XX_CPU_GPIO_BASE
,
75 .end
= SPEAR6XX_CPU_GPIO_BASE
+
76 SPEAR6XX_CPU_GPIO_SIZE
- 1,
77 .flags
= IORESOURCE_MEM
,
79 .irq
= {IRQ_LOCAL_GPIO
, NO_IRQ
},
83 .platform_data
= &gpio_plat_data
[1],
86 .start
= SPEAR6XX_ICM3_GPIO_BASE
,
87 .end
= SPEAR6XX_ICM3_GPIO_BASE
+
88 SPEAR6XX_ICM3_GPIO_SIZE
- 1,
89 .flags
= IORESOURCE_MEM
,
91 .irq
= {IRQ_BASIC_GPIO
, NO_IRQ
},
95 .platform_data
= &gpio_plat_data
[2],
98 .start
= SPEAR6XX_ICM2_GPIO_BASE
,
99 .end
= SPEAR6XX_ICM2_GPIO_BASE
+
100 SPEAR6XX_ICM2_GPIO_SIZE
- 1,
101 .flags
= IORESOURCE_MEM
,
103 .irq
= {IRQ_APPL_GPIO
, NO_IRQ
},
107 /* This will add devices, and do machine specific tasks */
108 void __init
spear6xx_init(void)
110 /* nothing to do for now */
113 /* This will initialize vic */
114 void __init
spear6xx_init_irq(void)
116 vic_init((void __iomem
*)VA_SPEAR6XX_CPU_VIC_PRI_BASE
, 0, ~0, 0);
117 vic_init((void __iomem
*)VA_SPEAR6XX_CPU_VIC_SEC_BASE
, 32, ~0, 0);
120 /* Following will create static virtual/physical mappings */
121 static struct map_desc spear6xx_io_desc
[] __initdata
= {
123 .virtual = VA_SPEAR6XX_ICM1_UART0_BASE
,
124 .pfn
= __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE
),
125 .length
= SPEAR6XX_ICM1_UART0_SIZE
,
128 .virtual = VA_SPEAR6XX_CPU_VIC_PRI_BASE
,
129 .pfn
= __phys_to_pfn(SPEAR6XX_CPU_VIC_PRI_BASE
),
130 .length
= SPEAR6XX_CPU_VIC_PRI_SIZE
,
133 .virtual = VA_SPEAR6XX_CPU_VIC_SEC_BASE
,
134 .pfn
= __phys_to_pfn(SPEAR6XX_CPU_VIC_SEC_BASE
),
135 .length
= SPEAR6XX_CPU_VIC_SEC_SIZE
,
138 .virtual = VA_SPEAR6XX_ICM3_SYS_CTRL_BASE
,
139 .pfn
= __phys_to_pfn(SPEAR6XX_ICM3_SYS_CTRL_BASE
),
140 .length
= SPEAR6XX_ICM3_MISC_REG_BASE
,
143 .virtual = VA_SPEAR6XX_ICM3_MISC_REG_BASE
,
144 .pfn
= __phys_to_pfn(SPEAR6XX_ICM3_MISC_REG_BASE
),
145 .length
= SPEAR6XX_ICM3_MISC_REG_SIZE
,
150 /* This will create static memory mapping for selected devices */
151 void __init
spear6xx_map_io(void)
153 iotable_init(spear6xx_io_desc
, ARRAY_SIZE(spear6xx_io_desc
));
155 /* This will initialize clock framework */