aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorviresh kumar <viresh.kumar@st.com>2010-04-01 07:30:58 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-04-14 06:34:36 -0400
commitbc4e814e5d5e2851f0a0679eaad14f60abae2a6d (patch)
treea03b60895694093f9306ebe4158d99725de35f32 /arch/arm
parentcee37e501ea34958d6d33d75d2bd21d9c343e379 (diff)
ARM: 6017/1: ST SPEAr: Added source files for SPEAr3xx 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')
-rw-r--r--arch/arm/mach-spear3xx/Kconfig33
-rw-r--r--arch/arm/mach-spear3xx/Kconfig30017
-rw-r--r--arch/arm/mach-spear3xx/Kconfig31017
-rw-r--r--arch/arm/mach-spear3xx/Kconfig32017
-rw-r--r--arch/arm/mach-spear3xx/Makefile26
-rw-r--r--arch/arm/mach-spear3xx/Makefile.boot3
-rw-r--r--arch/arm/mach-spear3xx/spear300.c45
-rw-r--r--arch/arm/mach-spear3xx/spear300_evb.c55
-rw-r--r--arch/arm/mach-spear3xx/spear310.c25
-rw-r--r--arch/arm/mach-spear3xx/spear310_evb.c54
-rw-r--r--arch/arm/mach-spear3xx/spear320.c25
-rw-r--r--arch/arm/mach-spear3xx/spear320_evb.c54
-rw-r--r--arch/arm/mach-spear3xx/spear3xx.c101
13 files changed, 472 insertions, 0 deletions
diff --git a/arch/arm/mach-spear3xx/Kconfig b/arch/arm/mach-spear3xx/Kconfig
new file mode 100644
index 000000000000..20d1317cc486
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Kconfig
@@ -0,0 +1,33 @@
1#
2# SPEAr3XX Machine configuration file
3#
4
5if ARCH_SPEAR3XX
6
7choice
8 prompt "SPEAr3XX Family"
9 default MACH_SPEAR300
10
11config MACH_SPEAR300
12 bool "SPEAr300"
13 help
14 Supports ST SPEAr300 Machine
15
16config MACH_SPEAR310
17 bool "SPEAr310"
18 help
19 Supports ST SPEAr310 Machine
20
21config MACH_SPEAR320
22 bool "SPEAr320"
23 help
24 Supports ST SPEAr320 Machine
25
26endchoice
27
28# Adding SPEAr3XX machine specific configuration files
29source "arch/arm/mach-spear3xx/Kconfig300"
30source "arch/arm/mach-spear3xx/Kconfig310"
31source "arch/arm/mach-spear3xx/Kconfig320"
32
33endif #ARCH_SPEAR3XX
diff --git a/arch/arm/mach-spear3xx/Kconfig300 b/arch/arm/mach-spear3xx/Kconfig300
new file mode 100644
index 000000000000..c519a05b4ab4
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Kconfig300
@@ -0,0 +1,17 @@
1#
2# SPEAr300 machine configuration file
3#
4
5if MACH_SPEAR300
6
7choice
8 prompt "SPEAr300 Boards"
9 default BOARD_SPEAR300_EVB
10
11config BOARD_SPEAR300_EVB
12 bool "SPEAr300 Evaluation Board"
13 help
14 Supports ST SPEAr300 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR300
diff --git a/arch/arm/mach-spear3xx/Kconfig310 b/arch/arm/mach-spear3xx/Kconfig310
new file mode 100644
index 000000000000..60e7442d75bd
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Kconfig310
@@ -0,0 +1,17 @@
1#
2# SPEAr310 machine configuration file
3#
4
5if MACH_SPEAR310
6
7choice
8 prompt "SPEAr310 Boards"
9 default BOARD_SPEAR310_EVB
10
11config BOARD_SPEAR310_EVB
12 bool "SPEAr310 Evaluation Board"
13 help
14 Supports ST SPEAr310 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR310
diff --git a/arch/arm/mach-spear3xx/Kconfig320 b/arch/arm/mach-spear3xx/Kconfig320
new file mode 100644
index 000000000000..1c1d438399b8
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Kconfig320
@@ -0,0 +1,17 @@
1#
2# SPEAr320 machine configuration file
3#
4
5if MACH_SPEAR320
6
7choice
8 prompt "SPEAr320 Boards"
9 default BOARD_SPEAR320_EVB
10
11config BOARD_SPEAR320_EVB
12 bool "SPEAr320 Evaluation Board"
13 help
14 Supports ST SPEAr320 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR320
diff --git a/arch/arm/mach-spear3xx/Makefile b/arch/arm/mach-spear3xx/Makefile
new file mode 100644
index 000000000000..b24862489704
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Makefile
@@ -0,0 +1,26 @@
1#
2# Makefile for SPEAr3XX machine series
3#
4
5# common files
6obj-y += spear3xx.o clock.o
7
8# spear300 specific files
9obj-$(CONFIG_MACH_SPEAR300) += spear300.o
10
11# spear300 boards files
12obj-$(CONFIG_BOARD_SPEAR300_EVB) += spear300_evb.o
13
14
15# spear310 specific files
16obj-$(CONFIG_MACH_SPEAR310) += spear310.o
17
18# spear310 boards files
19obj-$(CONFIG_BOARD_SPEAR310_EVB) += spear310_evb.o
20
21
22# spear320 specific files
23obj-$(CONFIG_MACH_SPEAR320) += spear320.o
24
25# spear320 boards files
26obj-$(CONFIG_BOARD_SPEAR320_EVB) += spear320_evb.o
diff --git a/arch/arm/mach-spear3xx/Makefile.boot b/arch/arm/mach-spear3xx/Makefile.boot
new file mode 100644
index 000000000000..7a1f3c0eadb8
--- /dev/null
+++ b/arch/arm/mach-spear3xx/Makefile.boot
@@ -0,0 +1,3 @@
1zreladdr-y := 0x00008000
2params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c
new file mode 100644
index 000000000000..63aca8fc3ebb
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear300.c
@@ -0,0 +1,45 @@
1/*
2 * arch/arm/mach-spear3xx/spear300.c
3 *
4 * SPEAr300 machine 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 <linux/types.h>
15#include <linux/amba/pl061.h>
16#include <linux/ptrace.h>
17#include <asm/irq.h>
18#include <mach/generic.h>
19#include <mach/spear.h>
20
21/* Add spear300 specific devices here */
22/* arm gpio1 device registeration */
23static struct pl061_platform_data gpio1_plat_data = {
24 .gpio_base = 8,
25 .irq_base = SPEAR_GPIO1_INT_BASE,
26};
27
28struct amba_device gpio1_device = {
29 .dev = {
30 .init_name = "gpio1",
31 .platform_data = &gpio1_plat_data,
32 },
33 .res = {
34 .start = SPEAR300_GPIO_BASE,
35 .end = SPEAR300_GPIO_BASE + SPEAR300_GPIO_SIZE - 1,
36 .flags = IORESOURCE_MEM,
37 },
38 .irq = {IRQ_GEN_RAS_1, NO_IRQ},
39};
40
41void __init spear300_init(void)
42{
43 /* call spear3xx family common init function */
44 spear3xx_init();
45}
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c
new file mode 100644
index 000000000000..1272a385c208
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear300_evb.c
@@ -0,0 +1,55 @@
1/*
2 * arch/arm/mach-spear3xx/spear300_evb.c
3 *
4 * SPEAr300 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 /* spear3xx specific devices */
21 &gpio_device,
22 &uart_device,
23
24 /* spear300 specific devices */
25 &gpio1_device,
26};
27
28static struct platform_device *plat_devs[] __initdata = {
29 /* spear3xx specific devices */
30
31 /* spear300 specific devices */
32};
33
34static void __init spear300_evb_init(void)
35{
36 unsigned int i;
37
38 /* call spear300 machine init function */
39 spear300_init();
40
41 /* Add Platform Devices */
42 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
43
44 /* Add Amba Devices */
45 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
46 amba_device_register(amba_devs[i], &iomem_resource);
47}
48
49MACHINE_START(SPEAR300, "ST-SPEAR300-EVB")
50 .boot_params = 0x00000100,
51 .map_io = spear3xx_map_io,
52 .init_irq = spear3xx_init_irq,
53 .timer = &spear_sys_timer,
54 .init_machine = spear300_evb_init,
55MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c
new file mode 100644
index 000000000000..6eb62f9de7ee
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear310.c
@@ -0,0 +1,25 @@
1/*
2 * arch/arm/mach-spear3xx/spear310.c
3 *
4 * SPEAr310 machine 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 <linux/ptrace.h>
15#include <asm/irq.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18
19/* Add spear310 specific devices here */
20
21void __init spear310_init(void)
22{
23 /* call spear3xx family common init function */
24 spear3xx_init();
25}
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c
new file mode 100644
index 000000000000..e781b2b7f137
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear310_evb.c
@@ -0,0 +1,54 @@
1/*
2 * arch/arm/mach-spear3xx/spear310_evb.c
3 *
4 * SPEAr310 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 /* spear3xx specific devices */
21 &gpio_device,
22 &uart_device,
23
24 /* spear310 specific devices */
25};
26
27static struct platform_device *plat_devs[] __initdata = {
28 /* spear3xx specific devices */
29
30 /* spear310 specific devices */
31};
32
33static void __init spear310_evb_init(void)
34{
35 unsigned int i;
36
37 /* call spear310 machine init function */
38 spear310_init();
39
40 /* Add Platform Devices */
41 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
42
43 /* Add Amba Devices */
44 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
45 amba_device_register(amba_devs[i], &iomem_resource);
46}
47
48MACHINE_START(SPEAR310, "ST-SPEAR310-EVB")
49 .boot_params = 0x00000100,
50 .map_io = spear3xx_map_io,
51 .init_irq = spear3xx_init_irq,
52 .timer = &spear_sys_timer,
53 .init_machine = spear310_evb_init,
54MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c
new file mode 100644
index 000000000000..72d45489dcb0
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear320.c
@@ -0,0 +1,25 @@
1/*
2 * arch/arm/mach-spear3xx/spear320.c
3 *
4 * SPEAr320 machine 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 <linux/ptrace.h>
15#include <asm/irq.h>
16#include <mach/generic.h>
17#include <mach/spear.h>
18
19/* Add spear320 specific devices here */
20
21void __init spear320_init(void)
22{
23 /* call spear3xx family common init function */
24 spear3xx_init();
25}
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c
new file mode 100644
index 000000000000..85bc4d226212
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear320_evb.c
@@ -0,0 +1,54 @@
1/*
2 * arch/arm/mach-spear3xx/spear320_evb.c
3 *
4 * SPEAr320 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 /* spear3xx specific devices */
21 &gpio_device,
22 &uart_device,
23
24 /* spear320 specific devices */
25};
26
27static struct platform_device *plat_devs[] __initdata = {
28 /* spear3xx specific devices */
29
30 /* spear320 specific devices */
31};
32
33static void __init spear320_evb_init(void)
34{
35 unsigned int i;
36
37 /* call spear320 machine init function */
38 spear320_init();
39
40 /* Add Platform Devices */
41 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
42
43 /* Add Amba Devices */
44 for (i = 0; i < ARRAY_SIZE(amba_devs); i++)
45 amba_device_register(amba_devs[i], &iomem_resource);
46}
47
48MACHINE_START(SPEAR320, "ST-SPEAR320-EVB")
49 .boot_params = 0x00000100,
50 .map_io = spear3xx_map_io,
51 .init_irq = spear3xx_init_irq,
52 .timer = &spear_sys_timer,
53 .init_machine = spear320_evb_init,
54MACHINE_END
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
new file mode 100644
index 000000000000..82ebcd30465e
--- /dev/null
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -0,0 +1,101 @@
1/*
2 * arch/arm/mach-spear3xx/spear3xx.c
3 *
4 * SPEAr3XX machines common 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 <linux/types.h>
15#include <linux/amba/pl061.h>
16#include <linux/ptrace.h>
17#include <linux/io.h>
18#include <asm/hardware/vic.h>
19#include <asm/irq.h>
20#include <asm/mach/arch.h>
21#include <mach/generic.h>
22#include <mach/spear.h>
23
24/* Add spear3xx machines common devices here */
25/* gpio device registeration */
26static struct pl061_platform_data gpio_plat_data = {
27 .gpio_base = 0,
28 .irq_base = SPEAR_GPIO_INT_BASE,
29};
30
31struct amba_device gpio_device = {
32 .dev = {
33 .init_name = "gpio",
34 .platform_data = &gpio_plat_data,
35 },
36 .res = {
37 .start = SPEAR3XX_ICM3_GPIO_BASE,
38 .end = SPEAR3XX_ICM3_GPIO_BASE + SPEAR3XX_ICM3_GPIO_SIZE - 1,
39 .flags = IORESOURCE_MEM,
40 },
41 .irq = {IRQ_BASIC_GPIO, NO_IRQ},
42};
43
44/* uart device registeration */
45struct amba_device uart_device = {
46 .dev = {
47 .init_name = "uart",
48 },
49 .res = {
50 .start = SPEAR3XX_ICM1_UART_BASE,
51 .end = SPEAR3XX_ICM1_UART_BASE + SPEAR3XX_ICM1_UART_SIZE - 1,
52 .flags = IORESOURCE_MEM,
53 },
54 .irq = {IRQ_UART, NO_IRQ},
55};
56
57/* Do spear3xx familiy common initialization part here */
58void __init spear3xx_init(void)
59{
60 /* nothing to do for now */
61}
62
63/* This will initialize vic */
64void __init spear3xx_init_irq(void)
65{
66 vic_init((void __iomem *)VA_SPEAR3XX_ML1_VIC_BASE, 0, ~0, 0);
67}
68
69/* Following will create static virtual/physical mappings */
70struct map_desc spear3xx_io_desc[] __initdata = {
71 {
72 .virtual = VA_SPEAR3XX_ICM1_UART_BASE,
73 .pfn = __phys_to_pfn(SPEAR3XX_ICM1_UART_BASE),
74 .length = SPEAR3XX_ICM1_UART_SIZE,
75 .type = MT_DEVICE
76 }, {
77 .virtual = VA_SPEAR3XX_ML1_VIC_BASE,
78 .pfn = __phys_to_pfn(SPEAR3XX_ML1_VIC_BASE),
79 .length = SPEAR3XX_ML1_VIC_SIZE,
80 .type = MT_DEVICE
81 }, {
82 .virtual = VA_SPEAR3XX_ICM3_SYS_CTRL_BASE,
83 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_SYS_CTRL_BASE),
84 .length = SPEAR3XX_ICM3_SYS_CTRL_SIZE,
85 .type = MT_DEVICE
86 }, {
87 .virtual = VA_SPEAR3XX_ICM3_MISC_REG_BASE,
88 .pfn = __phys_to_pfn(SPEAR3XX_ICM3_MISC_REG_BASE),
89 .length = SPEAR3XX_ICM3_MISC_REG_SIZE,
90 .type = MT_DEVICE
91 },
92};
93
94/* This will create static memory mapping for selected devices */
95void __init spear3xx_map_io(void)
96{
97 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
98
99 /* This will initialize clock framework */
100 clk_init();
101}