diff options
-rw-r--r-- | arch/arm/mach-shmobile/Kconfig | 7 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-kota2.c | 168 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/platsmp.c | 10 |
4 files changed, 182 insertions, 4 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 0c8f6cf3e948..c1b45342e1fb 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -69,6 +69,11 @@ config MACH_MACKEREL | |||
69 | depends on ARCH_SH7372 | 69 | depends on ARCH_SH7372 |
70 | select ARCH_REQUIRE_GPIOLIB | 70 | select ARCH_REQUIRE_GPIOLIB |
71 | 71 | ||
72 | config MACH_KOTA2 | ||
73 | bool "KOTA2 board" | ||
74 | select ARCH_REQUIRE_GPIOLIB | ||
75 | depends on ARCH_SH73A0 | ||
76 | |||
72 | comment "SH-Mobile System Configuration" | 77 | comment "SH-Mobile System Configuration" |
73 | 78 | ||
74 | menu "Memory configuration" | 79 | menu "Memory configuration" |
@@ -78,6 +83,7 @@ config MEMORY_START | |||
78 | default "0x50000000" if MACH_G3EVM | 83 | default "0x50000000" if MACH_G3EVM |
79 | default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \ | 84 | default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \ |
80 | MACH_MACKEREL | 85 | MACH_MACKEREL |
86 | default "0x41000000" if MACH_KOTA2 | ||
81 | default "0x00000000" | 87 | default "0x00000000" |
82 | ---help--- | 88 | ---help--- |
83 | Tweak this only when porting to a new machine which does not | 89 | Tweak this only when porting to a new machine which does not |
@@ -89,6 +95,7 @@ config MEMORY_SIZE | |||
89 | default "0x08000000" if MACH_G3EVM | 95 | default "0x08000000" if MACH_G3EVM |
90 | default "0x08000000" if MACH_G4EVM | 96 | default "0x08000000" if MACH_G4EVM |
91 | default "0x20000000" if MACH_AG5EVM | 97 | default "0x20000000" if MACH_AG5EVM |
98 | default "0x1e000000" if MACH_KOTA2 | ||
92 | default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL | 99 | default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL |
93 | default "0x04000000" | 100 | default "0x04000000" |
94 | help | 101 | help |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 612b27000c3e..2aec2f732515 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -41,6 +41,7 @@ obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o | |||
41 | obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o | 41 | obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o |
42 | obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o | 42 | obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o |
43 | obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o | 43 | obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o |
44 | obj-$(CONFIG_MACH_KOTA2) += board-kota2.o | ||
44 | 45 | ||
45 | # Framework support | 46 | # Framework support |
46 | obj-$(CONFIG_SMP) += $(smp-y) | 47 | obj-$(CONFIG_SMP) += $(smp-y) |
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c new file mode 100644 index 000000000000..4ab05e855077 --- /dev/null +++ b/arch/arm/mach-shmobile/board-kota2.c | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * kota2 board support | ||
3 | * | ||
4 | * Copyright (C) 2011 Renesas Solutions Corp. | ||
5 | * Copyright (C) 2011 Magnus Damm | ||
6 | * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com> | ||
7 | * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; version 2 of the License. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/kernel.h> | ||
24 | #include <linux/init.h> | ||
25 | #include <linux/interrupt.h> | ||
26 | #include <linux/irq.h> | ||
27 | #include <linux/platform_device.h> | ||
28 | #include <linux/delay.h> | ||
29 | #include <linux/io.h> | ||
30 | #include <linux/smsc911x.h> | ||
31 | #include <linux/gpio.h> | ||
32 | #include <mach/hardware.h> | ||
33 | #include <mach/sh73a0.h> | ||
34 | #include <mach/common.h> | ||
35 | #include <asm/mach-types.h> | ||
36 | #include <asm/mach/arch.h> | ||
37 | #include <asm/mach/map.h> | ||
38 | #include <asm/mach/time.h> | ||
39 | #include <asm/hardware/gic.h> | ||
40 | #include <asm/hardware/cache-l2x0.h> | ||
41 | #include <asm/traps.h> | ||
42 | |||
43 | static struct resource smsc9220_resources[] = { | ||
44 | [0] = { | ||
45 | .start = 0x14000000, /* CS5A */ | ||
46 | .end = 0x140000ff, /* A1->A7 */ | ||
47 | .flags = IORESOURCE_MEM, | ||
48 | }, | ||
49 | [1] = { | ||
50 | .start = gic_spi(33), /* PINTA2 @ PORT144 */ | ||
51 | .flags = IORESOURCE_IRQ, | ||
52 | }, | ||
53 | }; | ||
54 | |||
55 | static struct smsc911x_platform_config smsc9220_platdata = { | ||
56 | .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */ | ||
57 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
58 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | ||
59 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | ||
60 | }; | ||
61 | |||
62 | static struct platform_device eth_device = { | ||
63 | .name = "smsc911x", | ||
64 | .id = 0, | ||
65 | .dev = { | ||
66 | .platform_data = &smsc9220_platdata, | ||
67 | }, | ||
68 | .resource = smsc9220_resources, | ||
69 | .num_resources = ARRAY_SIZE(smsc9220_resources), | ||
70 | }; | ||
71 | |||
72 | static struct platform_device *kota2_devices[] __initdata = { | ||
73 | ð_device, | ||
74 | }; | ||
75 | |||
76 | static struct map_desc kota2_io_desc[] __initdata = { | ||
77 | /* create a 1:1 entity map for 0xe6xxxxxx | ||
78 | * used by CPGA, INTC and PFC. | ||
79 | */ | ||
80 | { | ||
81 | .virtual = 0xe6000000, | ||
82 | .pfn = __phys_to_pfn(0xe6000000), | ||
83 | .length = 256 << 20, | ||
84 | .type = MT_DEVICE_NONSHARED | ||
85 | }, | ||
86 | }; | ||
87 | |||
88 | static void __init kota2_map_io(void) | ||
89 | { | ||
90 | iotable_init(kota2_io_desc, ARRAY_SIZE(kota2_io_desc)); | ||
91 | |||
92 | /* setup early devices and console here as well */ | ||
93 | sh73a0_add_early_devices(); | ||
94 | shmobile_setup_console(); | ||
95 | } | ||
96 | |||
97 | #define PINTER0A 0xe69000a0 | ||
98 | #define PINTCR0A 0xe69000b0 | ||
99 | |||
100 | void __init kota2_init_irq(void) | ||
101 | { | ||
102 | sh73a0_init_irq(); | ||
103 | |||
104 | /* setup PINT: enable PINTA2 as active low */ | ||
105 | __raw_writel(1 << 29, PINTER0A); | ||
106 | __raw_writew(2 << 10, PINTCR0A); | ||
107 | } | ||
108 | |||
109 | static void __init kota2_init(void) | ||
110 | { | ||
111 | sh73a0_pinmux_init(); | ||
112 | |||
113 | /* SCIFA2 (UART2) */ | ||
114 | gpio_request(GPIO_FN_SCIFA2_TXD1, NULL); | ||
115 | gpio_request(GPIO_FN_SCIFA2_RXD1, NULL); | ||
116 | gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL); | ||
117 | gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL); | ||
118 | |||
119 | /* SMSC911X */ | ||
120 | gpio_request(GPIO_FN_D0_NAF0, NULL); | ||
121 | gpio_request(GPIO_FN_D1_NAF1, NULL); | ||
122 | gpio_request(GPIO_FN_D2_NAF2, NULL); | ||
123 | gpio_request(GPIO_FN_D3_NAF3, NULL); | ||
124 | gpio_request(GPIO_FN_D4_NAF4, NULL); | ||
125 | gpio_request(GPIO_FN_D5_NAF5, NULL); | ||
126 | gpio_request(GPIO_FN_D6_NAF6, NULL); | ||
127 | gpio_request(GPIO_FN_D7_NAF7, NULL); | ||
128 | gpio_request(GPIO_FN_D8_NAF8, NULL); | ||
129 | gpio_request(GPIO_FN_D9_NAF9, NULL); | ||
130 | gpio_request(GPIO_FN_D10_NAF10, NULL); | ||
131 | gpio_request(GPIO_FN_D11_NAF11, NULL); | ||
132 | gpio_request(GPIO_FN_D12_NAF12, NULL); | ||
133 | gpio_request(GPIO_FN_D13_NAF13, NULL); | ||
134 | gpio_request(GPIO_FN_D14_NAF14, NULL); | ||
135 | gpio_request(GPIO_FN_D15_NAF15, NULL); | ||
136 | gpio_request(GPIO_FN_CS5A_, NULL); | ||
137 | gpio_request(GPIO_FN_WE0__FWE, NULL); | ||
138 | gpio_request(GPIO_PORT144, NULL); /* PINTA2 */ | ||
139 | gpio_direction_input(GPIO_PORT144); | ||
140 | gpio_request(GPIO_PORT145, NULL); /* RESET */ | ||
141 | gpio_direction_output(GPIO_PORT145, 1); | ||
142 | |||
143 | #ifdef CONFIG_CACHE_L2X0 | ||
144 | /* Early BRESP enable, Shared attribute override enable, 64K*8way */ | ||
145 | l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff); | ||
146 | #endif | ||
147 | sh73a0_add_standard_devices(); | ||
148 | platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices)); | ||
149 | } | ||
150 | |||
151 | static void __init kota2_timer_init(void) | ||
152 | { | ||
153 | sh73a0_clock_init(); | ||
154 | shmobile_timer.init(); | ||
155 | return; | ||
156 | } | ||
157 | |||
158 | struct sys_timer kota2_timer = { | ||
159 | .init = kota2_timer_init, | ||
160 | }; | ||
161 | |||
162 | MACHINE_START(KOTA2, "kota2") | ||
163 | .map_io = kota2_map_io, | ||
164 | .init_irq = kota2_init_irq, | ||
165 | .handle_irq = shmobile_handle_irq_gic, | ||
166 | .init_machine = kota2_init, | ||
167 | .timer = &kota2_timer, | ||
168 | MACHINE_END | ||
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c index 66f980625a33..ccd81dac42f8 100644 --- a/arch/arm/mach-shmobile/platsmp.c +++ b/arch/arm/mach-shmobile/platsmp.c | |||
@@ -21,9 +21,11 @@ | |||
21 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
22 | #include <mach/common.h> | 22 | #include <mach/common.h> |
23 | 23 | ||
24 | #define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2()) | ||
25 | |||
24 | static unsigned int __init shmobile_smp_get_core_count(void) | 26 | static unsigned int __init shmobile_smp_get_core_count(void) |
25 | { | 27 | { |
26 | if (machine_is_ag5evm()) | 28 | if (is_sh73a0()) |
27 | return sh73a0_get_core_count(); | 29 | return sh73a0_get_core_count(); |
28 | 30 | ||
29 | return 1; | 31 | return 1; |
@@ -31,7 +33,7 @@ static unsigned int __init shmobile_smp_get_core_count(void) | |||
31 | 33 | ||
32 | static void __init shmobile_smp_prepare_cpus(void) | 34 | static void __init shmobile_smp_prepare_cpus(void) |
33 | { | 35 | { |
34 | if (machine_is_ag5evm()) | 36 | if (is_sh73a0()) |
35 | sh73a0_smp_prepare_cpus(); | 37 | sh73a0_smp_prepare_cpus(); |
36 | } | 38 | } |
37 | 39 | ||
@@ -39,13 +41,13 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
39 | { | 41 | { |
40 | trace_hardirqs_off(); | 42 | trace_hardirqs_off(); |
41 | 43 | ||
42 | if (machine_is_ag5evm()) | 44 | if (is_sh73a0()) |
43 | sh73a0_secondary_init(cpu); | 45 | sh73a0_secondary_init(cpu); |
44 | } | 46 | } |
45 | 47 | ||
46 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | 48 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) |
47 | { | 49 | { |
48 | if (machine_is_ag5evm()) | 50 | if (is_sh73a0()) |
49 | return sh73a0_boot_secondary(cpu); | 51 | return sh73a0_boot_secondary(cpu); |
50 | 52 | ||
51 | return -ENOSYS; | 53 | return -ENOSYS; |