aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-11-10 21:46:45 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-11-11 02:56:25 -0500
commitd55c9a97f80a7ad64f7c7eab5fb447a8d9a1532a (patch)
tree7a5dd9b45b6527af850772ddcec1c6e6b29a08d7 /arch
parent215d6cc9230c2a42a643c4cd296680040eeb1f49 (diff)
ARM: mach-shmobile: add bonito board support.
This adds basic bonito board (R-Mobile A1) support Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/configs/bonito_defconfig72
-rw-r--r--arch/arm/mach-shmobile/Kconfig9
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/board-bonito.c187
4 files changed, 267 insertions, 2 deletions
diff --git a/arch/arm/configs/bonito_defconfig b/arch/arm/configs/bonito_defconfig
new file mode 100644
index 000000000000..635bd6994561
--- /dev/null
+++ b/arch/arm/configs/bonito_defconfig
@@ -0,0 +1,72 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_IKCONFIG=y
4CONFIG_IKCONFIG_PROC=y
5CONFIG_LOG_BUF_SHIFT=16
6# CONFIG_UTS_NS is not set
7# CONFIG_IPC_NS is not set
8# CONFIG_USER_NS is not set
9# CONFIG_PID_NS is not set
10CONFIG_BLK_DEV_INITRD=y
11CONFIG_INITRAMFS_SOURCE="/your/initramfs/"
12CONFIG_CC_OPTIMIZE_FOR_SIZE=y
13CONFIG_SLAB=y
14CONFIG_MODULES=y
15CONFIG_MODULE_UNLOAD=y
16CONFIG_MODULE_FORCE_UNLOAD=y
17# CONFIG_BLK_DEV_BSG is not set
18# CONFIG_IOSCHED_DEADLINE is not set
19# CONFIG_IOSCHED_CFQ is not set
20CONFIG_ARCH_SHMOBILE=y
21CONFIG_ARCH_R8A7740=y
22CONFIG_MACH_BONITO=y
23# CONFIG_SH_TIMER_TMU is not set
24CONFIG_AEABI=y
25# CONFIG_OABI_COMPAT is not set
26CONFIG_FORCE_MAX_ZONEORDER=12
27CONFIG_ZBOOT_ROM_TEXT=0x0
28CONFIG_ZBOOT_ROM_BSS=0x0
29CONFIG_CMDLINE="console=ttySC5,115200 earlyprintk=sh-sci.5,115200 ignore_loglevel"
30CONFIG_KEXEC=y
31# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
32# CONFIG_SUSPEND is not set
33CONFIG_PM_RUNTIME=y
34CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
35# CONFIG_FIRMWARE_IN_KERNEL is not set
36CONFIG_MTD=y
37CONFIG_MTD_CHAR=y
38CONFIG_MTD_BLOCK=y
39CONFIG_MTD_CFI=y
40CONFIG_MTD_CFI_ADV_OPTIONS=y
41CONFIG_MTD_CFI_INTELEXT=y
42CONFIG_MTD_PHYSMAP=y
43CONFIG_MTD_ARM_INTEGRATOR=y
44CONFIG_MTD_BLOCK2MTD=y
45CONFIG_SCSI=y
46CONFIG_BLK_DEV_SD=y
47# CONFIG_SCSI_LOWLEVEL is not set
48# CONFIG_INPUT_KEYBOARD is not set
49# CONFIG_INPUT_MOUSE is not set
50# CONFIG_LEGACY_PTYS is not set
51CONFIG_SERIAL_SH_SCI=y
52CONFIG_SERIAL_SH_SCI_NR_UARTS=9
53CONFIG_SERIAL_SH_SCI_CONSOLE=y
54# CONFIG_HW_RANDOM is not set
55CONFIG_I2C=y
56CONFIG_I2C_CHARDEV=y
57CONFIG_I2C_SH_MOBILE=y
58CONFIG_GPIO_SYSFS=y
59# CONFIG_HWMON is not set
60# CONFIG_MFD_SUPPORT is not set
61# CONFIG_HID_SUPPORT is not set
62# CONFIG_USB_SUPPORT is not set
63CONFIG_UIO=y
64CONFIG_UIO_PDRV=y
65CONFIG_UIO_PDRV_GENIRQ=y
66# CONFIG_DNOTIFY is not set
67# CONFIG_INOTIFY_USER is not set
68CONFIG_TMPFS=y
69# CONFIG_MISC_FILESYSTEMS is not set
70# CONFIG_ENABLE_WARN_DEPRECATED is not set
71# CONFIG_ENABLE_MUST_CHECK is not set
72# CONFIG_ARM_UNWIND is not set
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index aa63c968f420..ef0077e8771e 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -81,6 +81,11 @@ config MACH_KOTA2
81 select ARCH_REQUIRE_GPIOLIB 81 select ARCH_REQUIRE_GPIOLIB
82 depends on ARCH_SH73A0 82 depends on ARCH_SH73A0
83 83
84config MACH_BONITO
85 bool "bonito board"
86 select ARCH_REQUIRE_GPIOLIB
87 depends on ARCH_R8A7740
88
84comment "SH-Mobile System Configuration" 89comment "SH-Mobile System Configuration"
85 90
86menu "Memory configuration" 91menu "Memory configuration"
@@ -89,7 +94,7 @@ config MEMORY_START
89 hex "Physical memory start address" 94 hex "Physical memory start address"
90 default "0x50000000" if MACH_G3EVM 95 default "0x50000000" if MACH_G3EVM
91 default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \ 96 default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \
92 MACH_MACKEREL 97 MACH_MACKEREL || MACH_BONITO
93 default "0x41000000" if MACH_KOTA2 98 default "0x41000000" if MACH_KOTA2
94 default "0x00000000" 99 default "0x00000000"
95 ---help--- 100 ---help---
@@ -101,7 +106,7 @@ config MEMORY_SIZE
101 hex "Physical memory size" 106 hex "Physical memory size"
102 default "0x08000000" if MACH_G3EVM 107 default "0x08000000" if MACH_G3EVM
103 default "0x08000000" if MACH_G4EVM 108 default "0x08000000" if MACH_G4EVM
104 default "0x20000000" if MACH_AG5EVM 109 default "0x20000000" if MACH_AG5EVM || MACH_BONITO
105 default "0x1e000000" if MACH_KOTA2 110 default "0x1e000000" if MACH_KOTA2
106 default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL 111 default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL
107 default "0x04000000" 112 default "0x04000000"
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 971f7038f05a..abdae89cacf7 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -45,6 +45,7 @@ obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o
45obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o 45obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o
46obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o 46obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
47obj-$(CONFIG_MACH_KOTA2) += board-kota2.o 47obj-$(CONFIG_MACH_KOTA2) += board-kota2.o
48obj-$(CONFIG_MACH_BONITO) += board-bonito.o
48 49
49# Framework support 50# Framework support
50obj-$(CONFIG_SMP) += $(smp-y) 51obj-$(CONFIG_SMP) += $(smp-y)
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c
new file mode 100644
index 000000000000..901d7457973a
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-bonito.c
@@ -0,0 +1,187 @@
1/*
2 * bonito board support
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/interrupt.h>
25#include <linux/irq.h>
26#include <linux/platform_device.h>
27#include <linux/gpio.h>
28#include <mach/common.h>
29#include <asm/mach-types.h>
30#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32#include <asm/mach/time.h>
33#include <asm/hardware/cache-l2x0.h>
34#include <mach/r8a7740.h>
35
36/*
37 * CS Address device note
38 *----------------------------------------------------------------
39 * 0 0x0000_0000 NOR Flash (64MB) SW12 : bit3 = OFF
40 * 2 0x0800_0000 ExtNOR (64MB) SW12 : bit3 = OFF
41 * 4 -
42 * 5A -
43 * 5B 0x1600_0000 SRAM (8MB)
44 * 6 0x1800_0000 FPGA (64K)
45 * 0x1801_0000 Ether (4KB)
46 * 0x1801_1000 USB (4KB)
47 */
48
49/*
50 * SW12
51 *
52 * bit1 bit2 bit3
53 *----------------------------------------------------------------------------
54 * ON NOR WriteProtect NAND WriteProtect CS0 ExtNOR / CS2 NOR
55 * OFF NOR Not WriteProtect NAND Not WriteProtect CS0 NOR / CS2 ExtNOR
56 */
57
58/*
59 * FPGA
60 */
61#define A1MDSR 0x10E0
62#define BVERR 0x1100
63static u16 bonito_fpga_read(u32 offset)
64{
65 return __raw_readw(0xf0003000 + offset);
66}
67
68static void bonito_fpga_write(u32 offset, u16 val)
69{
70 __raw_writew(val, 0xf0003000 + offset);
71}
72
73/*
74 * devices
75 */
76static struct platform_device *bonito_devices[] __initdata = {
77};
78
79/*
80 * map I/O
81 */
82static struct map_desc bonito_io_desc[] __initdata = {
83 /*
84 * for CPGA/INTC/PFC
85 * 0xe6000000-0xefffffff -> 0xe6000000-0xefffffff
86 */
87 {
88 .virtual = 0xe6000000,
89 .pfn = __phys_to_pfn(0xe6000000),
90 .length = 160 << 20,
91 .type = MT_DEVICE_NONSHARED
92 },
93#ifdef CONFIG_CACHE_L2X0
94 /*
95 * for l2x0_init()
96 * 0xf0100000-0xf0101000 -> 0xf0002000-0xf0003000
97 */
98 {
99 .virtual = 0xf0002000,
100 .pfn = __phys_to_pfn(0xf0100000),
101 .length = PAGE_SIZE,
102 .type = MT_DEVICE_NONSHARED
103 },
104#endif
105 /*
106 * for FPGA (0x1800000-0x19ffffff)
107 * 0x18000000-0x18002000 -> 0xf0003000-0xf0005000
108 */
109 {
110 .virtual = 0xf0003000,
111 .pfn = __phys_to_pfn(0x18000000),
112 .length = PAGE_SIZE * 2,
113 .type = MT_DEVICE_NONSHARED
114 }
115};
116
117static void __init bonito_map_io(void)
118{
119 iotable_init(bonito_io_desc, ARRAY_SIZE(bonito_io_desc));
120
121 /* setup early devices and console here as well */
122 r8a7740_add_early_devices();
123 shmobile_setup_console();
124}
125
126/*
127 * board init
128 */
129static void __init bonito_init(void)
130{
131 u16 val;
132
133 r8a7740_pinmux_init();
134
135 /* FPGA */
136 gpio_request(GPIO_FN_CS5B, NULL);
137 gpio_request(GPIO_FN_CS6A, NULL);
138 gpio_request(GPIO_FN_CS5A_PORT105, NULL);
139 gpio_request(GPIO_FN_IRQ10, NULL);
140
141 val = bonito_fpga_read(BVERR);
142 pr_info("bonito version: cpu %02x, base %02x\n",
143 ((val >> 8) & 0xFF),
144 ((val >> 0) & 0xFF));
145
146 /* SCIFA5 */
147 gpio_request(GPIO_FN_SCIFA5_TXD_PORT91, NULL);
148 gpio_request(GPIO_FN_SCIFA5_RXD_PORT92, NULL);
149
150#ifdef CONFIG_CACHE_L2X0
151 /* Early BRESP enable, Shared attribute override enable, 32K*8way */
152 l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff);
153#endif
154
155 r8a7740_add_standard_devices();
156 platform_add_devices(bonito_devices, ARRAY_SIZE(bonito_devices));
157}
158
159static void __init bonito_timer_init(void)
160{
161 u16 val;
162 u8 md_ck = 0;
163
164 /* read MD_CK value */
165 val = bonito_fpga_read(A1MDSR);
166 if (val & (1 << 10))
167 md_ck |= MD_CK2;
168 if (val & (1 << 9))
169 md_ck |= MD_CK1;
170 if (val & (1 << 8))
171 md_ck |= MD_CK0;
172
173 r8a7740_clock_init(md_ck);
174 shmobile_timer.init();
175}
176
177struct sys_timer bonito_timer = {
178 .init = bonito_timer_init,
179};
180
181MACHINE_START(BONITO, "bonito")
182 .map_io = bonito_map_io,
183 .init_irq = r8a7740_init_irq,
184 .handle_irq = shmobile_handle_irq_intc,
185 .init_machine = bonito_init,
186 .timer = &bonito_timer,
187MACHINE_END