aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-spear6xx
diff options
context:
space:
mode:
authorviresh kumar <viresh.kumar@st.com>2010-04-01 07:31:01 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-04-14 06:34:35 -0400
commit8f590d4541fb678a638777ab987709217cb71365 (patch)
tree316053a28807ad5c05a312fcd48475bb9903d42b /arch/arm/mach-spear6xx
parent8c0236fc465c71d98203bcf5609db01b9cf5f70f (diff)
ARM: 6015/1: ST SPEAr: Added source files for SPEAr6xx machine family
Reviewed-by: Linus Walleij <linux.walleij@stericsson.com> Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-spear6xx')
-rw-r--r--arch/arm/mach-spear6xx/Kconfig20
-rw-r--r--arch/arm/mach-spear6xx/Kconfig60017
-rw-r--r--arch/arm/mach-spear6xx/Makefile12
-rw-r--r--arch/arm/mach-spear6xx/Makefile.boot3
-rw-r--r--arch/arm/mach-spear6xx/spear600.c25
-rw-r--r--arch/arm/mach-spear6xx/spear600_evb.c51
-rw-r--r--arch/arm/mach-spear6xx/spear6xx.c158
7 files changed, 286 insertions, 0 deletions
diff --git a/arch/arm/mach-spear6xx/Kconfig b/arch/arm/mach-spear6xx/Kconfig
new file mode 100644
index 000000000000..bddba034f862
--- /dev/null
+++ b/arch/arm/mach-spear6xx/Kconfig
@@ -0,0 +1,20 @@
1#
2# SPEAr6XX Machine configuration file
3#
4
5if ARCH_SPEAR6XX
6
7choice
8 prompt "SPEAr6XX Family"
9 default MACH_SPEAR600
10
11config MACH_SPEAR600
12 bool "SPEAr600"
13 help
14 Supports ST SPEAr600 Machine
15endchoice
16
17# Adding SPEAr6XX machine specific configuration files
18source "arch/arm/mach-spear6xx/Kconfig600"
19
20endif #ARCH_SPEAR6XX
diff --git a/arch/arm/mach-spear6xx/Kconfig600 b/arch/arm/mach-spear6xx/Kconfig600
new file mode 100644
index 000000000000..9e19f65eb78e
--- /dev/null
+++ b/arch/arm/mach-spear6xx/Kconfig600
@@ -0,0 +1,17 @@
1#
2# SPEAr600 machine configuration file
3#
4
5if MACH_SPEAR600
6
7choice
8 prompt "SPEAr600 Boards"
9 default BOARD_SPEAR600_EVB
10
11config BOARD_SPEAR600_EVB
12 bool "SPEAr600 Evaluation Board"
13 help
14 Supports ST SPEAr600 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR600
diff --git a/arch/arm/mach-spear6xx/Makefile b/arch/arm/mach-spear6xx/Makefile
new file mode 100644
index 000000000000..cc1a4d82d459
--- /dev/null
+++ b/arch/arm/mach-spear6xx/Makefile
@@ -0,0 +1,12 @@
1#
2# Makefile for SPEAr6XX machine series
3#
4
5# common files
6obj-y += clock.o spear6xx.o
7
8# spear600 specific files
9obj-$(CONFIG_MACH_SPEAR600) += spear600.o
10
11# spear600 boards files
12obj-$(CONFIG_BOARD_SPEAR600_EVB) += spear600_evb.o
diff --git a/arch/arm/mach-spear6xx/Makefile.boot b/arch/arm/mach-spear6xx/Makefile.boot
new file mode 100644
index 000000000000..7a1f3c0eadb8
--- /dev/null
+++ b/arch/arm/mach-spear6xx/Makefile.boot
@@ -0,0 +1,3 @@
1zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-spear6xx/spear600.c b/arch/arm/mach-spear6xx/spear600.c
new file mode 100644
index 000000000000..5c484c433dc1
--- /dev/null
+++ b/arch/arm/mach-spear6xx/spear600.c
@@ -0,0 +1,25 @@
1/*
2 * arch/arm/mach-spear6xx/spear600.c
3 *
4 * SPEAr600 machine source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
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.
12 */
13
14#include <linux/ptrace.h>
15#include <asm/irq.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18
19/* Add spear600 specific devices here */
20
21void __init spear600_init(void)
22{
23 /* call spear6xx family common init function */
24 spear6xx_init();
25}
diff --git a/arch/arm/mach-spear6xx/spear600_evb.c b/arch/arm/mach-spear6xx/spear600_evb.c
new file mode 100644
index 000000000000..daff8d04f7b6
--- /dev/null
+++ b/arch/arm/mach-spear6xx/spear600_evb.c
@@ -0,0 +1,51 @@
1/*
2 * arch/arm/mach-spear6xx/spear600_evb.c
3 *
4 * SPEAr600 evaluation board source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
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.
12 */
13
14#include <asm/mach/arch.h>
15#include <asm/mach-types.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18
19static struct amba_device *amba_devs[] __initdata = {
20 &gpio_device[0],
21 &gpio_device[1],
22 &gpio_device[2],
23 &uart_device[0],
24 &uart_device[1],
25};
26
27static struct platform_device *plat_devs[] __initdata = {
28};
29
30static void __init spear600_evb_init(void)
31{
32 unsigned int i;
33
34 /* call spear600 machine init function */
35 spear600_init();
36
37 /* Add Platform Devices */
38 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
39
40 /* Add Amba Devices */
41 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
42 amba_device_register(amba_devs[i], &iomem_resource);
43}
44
45MACHINE_START(SPEAR600, "ST-SPEAR600-EVB")
46 .boot_params = 0x00000100,
47 .map_io = spear6xx_map_io,
48 .init_irq = spear6xx_init_irq,
49 .timer = &spear_sys_timer,
50 .init_machine = spear600_evb_init,
51MACHINE_END
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
new file mode 100644
index 000000000000..b67e571d4bf7
--- /dev/null
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -0,0 +1,158 @@
1/*
2 * arch/arm/mach-spear6xx/spear6xx.c
3 *
4 * SPEAr6XX machines common source file
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Rajeev Kumar<rajeev-dlh.kumar@st.com>
8 *
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.
12 */
13
14#include <linux/types.h>
15#include <linux/amba/pl061.h>
16#include <linux/types.h>
17#include <linux/ptrace.h>
18#include <linux/io.h>
19#include <asm/hardware/vic.h>
20#include <asm/irq.h>
21#include <asm/mach/arch.h>
22#include <mach/irqs.h>
23#include <mach/generic.h>
24#include <mach/spear.h>
25
26/* Add spear6xx machines common devices here */
27/* uart device registeration */
28struct amba_device uart_device[] = {
29 {
30 .dev = {
31 .init_name = "uart0",
32 },
33 .res = {
34 .start = SPEAR6XX_ICM1_UART0_BASE,
35 .end = SPEAR6XX_ICM1_UART0_BASE +
36 SPEAR6XX_ICM1_UART0_SIZE - 1,
37 .flags = IORESOURCE_MEM,
38 },
39 .irq = {IRQ_UART_0, NO_IRQ},
40 }, {
41 .dev = {
42 .init_name = "uart1",
43 },
44 .res = {
45 .start = SPEAR6XX_ICM1_UART1_BASE,
46 .end = SPEAR6XX_ICM1_UART1_BASE +
47 SPEAR6XX_ICM1_UART1_SIZE - 1,
48 .flags = IORESOURCE_MEM,
49 },
50 .irq = {IRQ_UART_1, NO_IRQ},
51 }
52};
53
54/* gpio device registeration */
55static struct pl061_platform_data gpio_plat_data[] = {
56 {
57 .gpio_base = 0,
58 .irq_base = SPEAR_GPIO0_INT_BASE,
59 }, {
60 .gpio_base = 8,
61 .irq_base = SPEAR_GPIO1_INT_BASE,
62 }, {
63 .gpio_base = 16,
64 .irq_base = SPEAR_GPIO2_INT_BASE,
65 },
66};
67
68struct amba_device gpio_device[] = {
69 {
70 .dev = {
71 .init_name = "gpio0",
72 .platform_data = &gpio_plat_data[0],
73 },
74 .res = {
75 .start = SPEAR6XX_CPU_GPIO_BASE,
76 .end = SPEAR6XX_CPU_GPIO_BASE +
77 SPEAR6XX_CPU_GPIO_SIZE - 1,
78 .flags = IORESOURCE_MEM,
79 },
80 .irq = {IRQ_LOCAL_GPIO, NO_IRQ},
81 }, {
82 .dev = {
83 .init_name = "gpio1",
84 .platform_data = &gpio_plat_data[1],
85 },
86 .res = {
87 .start = SPEAR6XX_ICM3_GPIO_BASE,
88 .end = SPEAR6XX_ICM3_GPIO_BASE +
89 SPEAR6XX_ICM3_GPIO_SIZE - 1,
90 .flags = IORESOURCE_MEM,
91 },
92 .irq = {IRQ_BASIC_GPIO, NO_IRQ},
93 }, {
94 .dev = {
95 .init_name = "gpio2",
96 .platform_data = &gpio_plat_data[2],
97 },
98 .res = {
99 .start = SPEAR6XX_ICM2_GPIO_BASE,
100 .end = SPEAR6XX_ICM2_GPIO_BASE +
101 SPEAR6XX_ICM2_GPIO_SIZE - 1,
102 .flags = IORESOURCE_MEM,
103 },
104 .irq = {IRQ_APPL_GPIO, NO_IRQ},
105 }
106};
107
108/* This will add devices, and do machine specific tasks */
109void __init spear6xx_init(void)
110{
111 /* nothing to do for now */
112}
113
114/* This will initialize vic */
115void __init spear6xx_init_irq(void)
116{
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);
119}
120
121/* Following will create static virtual/physical mappings */
122static struct map_desc spear6xx_io_desc[] __initdata = {
123 {
124 .virtual = VA_SPEAR6XX_ICM1_UART0_BASE,
125 .pfn = __phys_to_pfn(SPEAR6XX_ICM1_UART0_BASE),
126 .length = SPEAR6XX_ICM1_UART0_SIZE,
127 .type = MT_DEVICE
128 }, {
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,
132 .type = MT_DEVICE
133 }, {
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,
137 .type = MT_DEVICE
138 }, {
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,
142 .type = MT_DEVICE
143 }, {
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,
147 .type = MT_DEVICE
148 },
149};
150
151/* This will create static memory mapping for selected devices */
152void __init spear6xx_map_io(void)
153{
154 iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc));
155
156 /* This will initialize clock framework */
157 clk_init();
158}