aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-01-13 01:06:28 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-01-13 01:06:28 -0500
commitf43dc23d5ea91fca257be02138a255f02d98e806 (patch)
treeb29722f6e965316e90ac97abf79923ced250dc21 /arch/arm/mach-shmobile
parentf8e53553f452dcbf67cb89c8cba63a1cd6eb4cc0 (diff)
parent4162cf64973df51fc885825bc9ca4d055891c49f (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into common/serial-rework
Conflicts: arch/sh/kernel/cpu/sh2/setup-sh7619.c arch/sh/kernel/cpu/sh2a/setup-mxg.c arch/sh/kernel/cpu/sh2a/setup-sh7201.c arch/sh/kernel/cpu/sh2a/setup-sh7203.c arch/sh/kernel/cpu/sh2a/setup-sh7206.c arch/sh/kernel/cpu/sh3/setup-sh7705.c arch/sh/kernel/cpu/sh3/setup-sh770x.c arch/sh/kernel/cpu/sh3/setup-sh7710.c arch/sh/kernel/cpu/sh3/setup-sh7720.c arch/sh/kernel/cpu/sh4/setup-sh4-202.c arch/sh/kernel/cpu/sh4/setup-sh7750.c arch/sh/kernel/cpu/sh4/setup-sh7760.c arch/sh/kernel/cpu/sh4a/setup-sh7343.c arch/sh/kernel/cpu/sh4a/setup-sh7366.c arch/sh/kernel/cpu/sh4a/setup-sh7722.c arch/sh/kernel/cpu/sh4a/setup-sh7723.c arch/sh/kernel/cpu/sh4a/setup-sh7724.c arch/sh/kernel/cpu/sh4a/setup-sh7763.c arch/sh/kernel/cpu/sh4a/setup-sh7770.c arch/sh/kernel/cpu/sh4a/setup-sh7780.c arch/sh/kernel/cpu/sh4a/setup-sh7785.c arch/sh/kernel/cpu/sh4a/setup-sh7786.c arch/sh/kernel/cpu/sh4a/setup-shx3.c arch/sh/kernel/cpu/sh5/setup-sh5.c drivers/serial/sh-sci.c drivers/serial/sh-sci.h include/linux/serial_sci.h
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/Kconfig132
-rw-r--r--arch/arm/mach-shmobile/Makefile42
-rw-r--r--arch/arm/mach-shmobile/Makefile.boot9
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c315
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c1367
-rw-r--r--arch/arm/mach-shmobile/board-g3evm.c373
-rw-r--r--arch/arm/mach-shmobile/board-g4evm.c400
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c1200
-rw-r--r--arch/arm/mach-shmobile/clock-sh7367.c358
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c681
-rw-r--r--arch/arm/mach-shmobile/clock-sh7377.c369
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c356
-rw-r--r--arch/arm/mach-shmobile/clock.c46
-rw-r--r--arch/arm/mach-shmobile/console.c31
-rw-r--r--arch/arm/mach-shmobile/entry-gic.S18
-rw-r--r--arch/arm/mach-shmobile/entry-intc.S57
-rw-r--r--arch/arm/mach-shmobile/headsmp.S27
-rw-r--r--arch/arm/mach-shmobile/hotplug.c41
-rw-r--r--arch/arm/mach-shmobile/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h49
-rw-r--r--arch/arm/mach-shmobile/include/mach/dma.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/entry-macro.S34
-rw-r--r--arch/arm/mach-shmobile/include/mach/gpio.h48
-rw-r--r--arch/arm/mach-shmobile/include/mach/hardware.h4
-rw-r--r--arch/arm/mach-shmobile/include/mach/head-ap4evb.txt87
-rw-r--r--arch/arm/mach-shmobile/include/mach/head-mackerel.txt87
-rw-r--r--arch/arm/mach-shmobile/include/mach/io.h9
-rw-r--r--arch/arm/mach-shmobile/include/mach/irqs.h18
-rw-r--r--arch/arm/mach-shmobile/include/mach/memory.h10
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7367.h332
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7372.h472
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7377.h360
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh73a0.h467
-rw-r--r--arch/arm/mach-shmobile/include/mach/smp.h16
-rw-r--r--arch/arm/mach-shmobile/include/mach/system.h14
-rw-r--r--arch/arm/mach-shmobile/include/mach/timex.h6
-rw-r--r--arch/arm/mach-shmobile/include/mach/uncompress.h21
-rw-r--r--arch/arm/mach-shmobile/include/mach/vmalloc.h7
-rw-r--r--arch/arm/mach-shmobile/include/mach/zboot.h23
-rw-r--r--arch/arm/mach-shmobile/include/mach/zboot_macros.h65
-rw-r--r--arch/arm/mach-shmobile/intc-sh7367.c440
-rw-r--r--arch/arm/mach-shmobile/intc-sh7372.c617
-rw-r--r--arch/arm/mach-shmobile/intc-sh7377.c646
-rw-r--r--arch/arm/mach-shmobile/intc-sh73a0.c267
-rw-r--r--arch/arm/mach-shmobile/localtimer.c25
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7367.c1801
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7372.c1640
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7377.c1767
-rw-r--r--arch/arm/mach-shmobile/pfc-sh73a0.c2746
-rw-r--r--arch/arm/mach-shmobile/platsmp.c70
-rw-r--r--arch/arm/mach-shmobile/pm_runtime.c169
-rw-r--r--arch/arm/mach-shmobile/setup-sh7367.c225
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c638
-rw-r--r--arch/arm/mach-shmobile/setup-sh7377.c246
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c430
-rw-r--r--arch/arm/mach-shmobile/smp-sh73a0.c97
-rw-r--r--arch/arm/mach-shmobile/timer.c46
57 files changed, 19829 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
new file mode 100644
index 000000000000..4d1b4c5c9389
--- /dev/null
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -0,0 +1,132 @@
1if ARCH_SHMOBILE
2
3comment "SH-Mobile System Type"
4
5config ARCH_SH7367
6 bool "SH-Mobile G3 (SH7367)"
7 select CPU_V6
8 select SH_CLK_CPG
9 select ARCH_WANT_OPTIONAL_GPIOLIB
10
11config ARCH_SH7377
12 bool "SH-Mobile G4 (SH7377)"
13 select CPU_V7
14 select SH_CLK_CPG
15 select ARCH_WANT_OPTIONAL_GPIOLIB
16
17config ARCH_SH7372
18 bool "SH-Mobile AP4 (SH7372)"
19 select CPU_V7
20 select SH_CLK_CPG
21 select ARCH_WANT_OPTIONAL_GPIOLIB
22
23config ARCH_SH73A0
24 bool "SH-Mobile AG5 (R8A73A00)"
25 select CPU_V7
26 select SH_CLK_CPG
27 select ARCH_WANT_OPTIONAL_GPIOLIB
28 select ARM_GIC
29
30comment "SH-Mobile Board Type"
31
32config MACH_G3EVM
33 bool "G3EVM board"
34 depends on ARCH_SH7367
35 select ARCH_REQUIRE_GPIOLIB
36
37config MACH_G4EVM
38 bool "G4EVM board"
39 depends on ARCH_SH7377
40 select ARCH_REQUIRE_GPIOLIB
41
42config MACH_AP4EVB
43 bool "AP4EVB board"
44 depends on ARCH_SH7372
45 select ARCH_REQUIRE_GPIOLIB
46 select SH_LCD_MIPI_DSI
47
48choice
49 prompt "AP4EVB LCD panel selection"
50 default AP4EVB_QHD
51 depends on MACH_AP4EVB
52
53config AP4EVB_QHD
54 bool "MIPI-DSI QHD (960x540)"
55
56config AP4EVB_WVGA
57 bool "Parallel WVGA (800x480)"
58
59endchoice
60
61config MACH_AG5EVM
62 bool "AG5EVM board"
63 depends on ARCH_SH73A0
64
65config MACH_MACKEREL
66 bool "mackerel board"
67 depends on ARCH_SH7372
68 select ARCH_REQUIRE_GPIOLIB
69
70comment "SH-Mobile System Configuration"
71
72menu "Memory configuration"
73
74config MEMORY_START
75 hex "Physical memory start address"
76 default "0x50000000" if MACH_G3EVM
77 default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \
78 MACH_MACKEREL
79 default "0x00000000"
80 ---help---
81 Tweak this only when porting to a new machine which does not
82 already have a defconfig. Changing it from the known correct
83 value on any of the known systems will only lead to disaster.
84
85config MEMORY_SIZE
86 hex "Physical memory size"
87 default "0x08000000" if MACH_G3EVM
88 default "0x08000000" if MACH_G4EVM
89 default "0x20000000" if MACH_AG5EVM
90 default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL
91 default "0x04000000"
92 help
93 This sets the default memory size assumed by your kernel. It can
94 be overridden as normal by the 'mem=' argument on the kernel command
95 line.
96
97endmenu
98
99menu "Timer and clock configuration"
100
101config SHMOBILE_TIMER_HZ
102 int "Kernel HZ (jiffies per second)"
103 range 32 1024
104 default "128"
105 help
106 Allows the configuration of the timer frequency. It is customary
107 to have the timer interrupt run at 1000 Hz or 100 Hz, but in the
108 case of low timer frequencies other values may be more suitable.
109 SH-Mobile systems using a 32768 Hz RCLK for clock events may want
110 to select a HZ value such as 128 that can evenly divide RCLK.
111 A HZ value that does not divide evenly may cause timer drift.
112
113config SH_TIMER_CMT
114 bool "CMT timer driver"
115 default y
116 help
117 This enables build of the CMT timer driver.
118
119config SH_TIMER_TMU
120 bool "TMU timer driver"
121 default y
122 help
123 This enables build of the TMU timer driver.
124
125endmenu
126
127config SH_CLK_CPG
128 bool
129
130source "drivers/sh/Kconfig"
131
132endif
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
new file mode 100644
index 000000000000..e2507f66f9d5
--- /dev/null
+++ b/arch/arm/mach-shmobile/Makefile
@@ -0,0 +1,42 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common objects
6obj-y := timer.o console.o clock.o pm_runtime.o
7
8# CPU objects
9obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
10obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7377.o intc-sh7377.o
11obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o
12obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o
13
14# SMP objects
15smp-y := platsmp.o headsmp.o
16smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o
17smp-$(CONFIG_LOCAL_TIMERS) += localtimer.o
18smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o
19
20# Pinmux setup
21pfc-y :=
22pfc-$(CONFIG_ARCH_SH7367) += pfc-sh7367.o
23pfc-$(CONFIG_ARCH_SH7377) += pfc-sh7377.o
24pfc-$(CONFIG_ARCH_SH7372) += pfc-sh7372.o
25pfc-$(CONFIG_ARCH_SH73A0) += pfc-sh73a0.o
26
27# IRQ objects
28obj-$(CONFIG_ARCH_SH7367) += entry-intc.o
29obj-$(CONFIG_ARCH_SH7377) += entry-intc.o
30obj-$(CONFIG_ARCH_SH7372) += entry-intc.o
31obj-$(CONFIG_ARCH_SH73A0) += entry-gic.o
32
33# Board objects
34obj-$(CONFIG_MACH_G3EVM) += board-g3evm.o
35obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o
36obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o
37obj-$(CONFIG_MACH_AG5EVM) += board-ag5evm.o
38obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
39
40# Framework support
41obj-$(CONFIG_SMP) += $(smp-y)
42obj-$(CONFIG_GENERIC_GPIO) += $(pfc-y)
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
new file mode 100644
index 000000000000..1c08ee9de86a
--- /dev/null
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -0,0 +1,9 @@
1__ZRELADDR := $(shell /bin/bash -c 'printf "0x%08x" \
2 $$[$(CONFIG_MEMORY_START) + 0x8000]')
3
4 zreladdr-y := $(__ZRELADDR)
5
6# Unsupported legacy stuff
7#
8#params_phys-y (Instead: Pass atags pointer in r2)
9#initrd_phys-y (Instead: Use compiled-in initramfs)
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
new file mode 100644
index 000000000000..c18a740a4159
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -0,0 +1,315 @@
1/*
2 * arch/arm/mach-shmobile/board-ag5evm.c
3 *
4 * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com>
5 * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@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/delay.h>
28#include <linux/io.h>
29#include <linux/dma-mapping.h>
30#include <linux/serial_sci.h>
31#include <linux/smsc911x.h>
32#include <linux/gpio.h>
33#include <linux/input.h>
34#include <linux/input/sh_keysc.h>
35#include <linux/mmc/host.h>
36#include <linux/mmc/sh_mmcif.h>
37
38#include <sound/sh_fsi.h>
39
40#include <mach/hardware.h>
41#include <mach/sh73a0.h>
42#include <mach/common.h>
43#include <asm/mach-types.h>
44#include <asm/mach/arch.h>
45#include <asm/mach/map.h>
46#include <asm/mach/time.h>
47#include <asm/hardware/gic.h>
48#include <asm/hardware/cache-l2x0.h>
49#include <asm/traps.h>
50
51static struct resource smsc9220_resources[] = {
52 [0] = {
53 .start = 0x14000000,
54 .end = 0x14000000 + SZ_64K - 1,
55 .flags = IORESOURCE_MEM,
56 },
57 [1] = {
58 .start = gic_spi(33), /* PINT1 */
59 .flags = IORESOURCE_IRQ,
60 },
61};
62
63static struct smsc911x_platform_config smsc9220_platdata = {
64 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
65 .phy_interface = PHY_INTERFACE_MODE_MII,
66 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
67 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
68};
69
70static struct platform_device eth_device = {
71 .name = "smsc911x",
72 .id = 0,
73 .dev = {
74 .platform_data = &smsc9220_platdata,
75 },
76 .resource = smsc9220_resources,
77 .num_resources = ARRAY_SIZE(smsc9220_resources),
78};
79
80static struct sh_keysc_info keysc_platdata = {
81 .mode = SH_KEYSC_MODE_6,
82 .scan_timing = 3,
83 .delay = 100,
84 .keycodes = {
85 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
86 KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
87 KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
88 KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
89 KEY_SPACE, KEY_9, KEY_6, KEY_3, KEY_WAKEUP, KEY_RIGHT, \
90 KEY_COFFEE,
91 KEY_0, KEY_8, KEY_5, KEY_2, KEY_DOWN, KEY_ENTER, KEY_UP,
92 KEY_KPASTERISK, KEY_7, KEY_4, KEY_1, KEY_STOP, KEY_LEFT, \
93 KEY_COMPUTER,
94 },
95};
96
97static struct resource keysc_resources[] = {
98 [0] = {
99 .name = "KEYSC",
100 .start = 0xe61b0000,
101 .end = 0xe61b0098 - 1,
102 .flags = IORESOURCE_MEM,
103 },
104 [1] = {
105 .start = gic_spi(71),
106 .flags = IORESOURCE_IRQ,
107 },
108};
109
110static struct platform_device keysc_device = {
111 .name = "sh_keysc",
112 .id = 0,
113 .num_resources = ARRAY_SIZE(keysc_resources),
114 .resource = keysc_resources,
115 .dev = {
116 .platform_data = &keysc_platdata,
117 },
118};
119
120/* FSI A */
121static struct sh_fsi_platform_info fsi_info = {
122 .porta_flags = SH_FSI_OUT_SLAVE_MODE |
123 SH_FSI_IN_SLAVE_MODE |
124 SH_FSI_OFMT(I2S) |
125 SH_FSI_IFMT(I2S),
126};
127
128static struct resource fsi_resources[] = {
129 [0] = {
130 .name = "FSI",
131 .start = 0xEC230000,
132 .end = 0xEC230400 - 1,
133 .flags = IORESOURCE_MEM,
134 },
135 [1] = {
136 .start = gic_spi(146),
137 .flags = IORESOURCE_IRQ,
138 },
139};
140
141static struct platform_device fsi_device = {
142 .name = "sh_fsi2",
143 .id = -1,
144 .num_resources = ARRAY_SIZE(fsi_resources),
145 .resource = fsi_resources,
146 .dev = {
147 .platform_data = &fsi_info,
148 },
149};
150
151static struct resource sh_mmcif_resources[] = {
152 [0] = {
153 .name = "MMCIF",
154 .start = 0xe6bd0000,
155 .end = 0xe6bd00ff,
156 .flags = IORESOURCE_MEM,
157 },
158 [1] = {
159 .start = gic_spi(141),
160 .flags = IORESOURCE_IRQ,
161 },
162 [2] = {
163 .start = gic_spi(140),
164 .flags = IORESOURCE_IRQ,
165 },
166};
167
168static struct sh_mmcif_plat_data sh_mmcif_platdata = {
169 .sup_pclk = 0,
170 .ocr = MMC_VDD_165_195,
171 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
172};
173
174static struct platform_device mmc_device = {
175 .name = "sh_mmcif",
176 .id = 0,
177 .dev = {
178 .dma_mask = NULL,
179 .coherent_dma_mask = 0xffffffff,
180 .platform_data = &sh_mmcif_platdata,
181 },
182 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
183 .resource = sh_mmcif_resources,
184};
185
186static struct platform_device *ag5evm_devices[] __initdata = {
187 &eth_device,
188 &keysc_device,
189 &fsi_device,
190 &mmc_device,
191};
192
193static struct map_desc ag5evm_io_desc[] __initdata = {
194 /* create a 1:1 entity map for 0xe6xxxxxx
195 * used by CPGA, INTC and PFC.
196 */
197 {
198 .virtual = 0xe6000000,
199 .pfn = __phys_to_pfn(0xe6000000),
200 .length = 256 << 20,
201 .type = MT_DEVICE_NONSHARED
202 },
203};
204
205static void __init ag5evm_map_io(void)
206{
207 iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
208
209 /* setup early devices and console here as well */
210 sh73a0_add_early_devices();
211 shmobile_setup_console();
212}
213
214#define PINTC_ADDR 0xe6900000
215#define PINTER0A (PINTC_ADDR + 0xa0)
216#define PINTCR0A (PINTC_ADDR + 0xb0)
217
218void __init ag5evm_init_irq(void)
219{
220 sh73a0_init_irq();
221
222 /* setup PINT: enable PINTA2 as active low */
223 __raw_writel(__raw_readl(PINTER0A) | (1<<29), PINTER0A);
224 __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A);
225}
226
227static void __init ag5evm_init(void)
228{
229 sh73a0_pinmux_init();
230
231 /* enable SCIFA2 */
232 gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
233 gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
234 gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL);
235 gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL);
236
237 /* enable KEYSC */
238 gpio_request(GPIO_FN_KEYIN0_PU, NULL);
239 gpio_request(GPIO_FN_KEYIN1_PU, NULL);
240 gpio_request(GPIO_FN_KEYIN2_PU, NULL);
241 gpio_request(GPIO_FN_KEYIN3_PU, NULL);
242 gpio_request(GPIO_FN_KEYIN4_PU, NULL);
243 gpio_request(GPIO_FN_KEYIN5_PU, NULL);
244 gpio_request(GPIO_FN_KEYIN6_PU, NULL);
245 gpio_request(GPIO_FN_KEYIN7_PU, NULL);
246 gpio_request(GPIO_FN_KEYOUT0, NULL);
247 gpio_request(GPIO_FN_KEYOUT1, NULL);
248 gpio_request(GPIO_FN_KEYOUT2, NULL);
249 gpio_request(GPIO_FN_KEYOUT3, NULL);
250 gpio_request(GPIO_FN_KEYOUT4, NULL);
251 gpio_request(GPIO_FN_KEYOUT5, NULL);
252 gpio_request(GPIO_FN_PORT59_KEYOUT6, NULL);
253 gpio_request(GPIO_FN_PORT58_KEYOUT7, NULL);
254 gpio_request(GPIO_FN_KEYOUT8, NULL);
255 gpio_request(GPIO_FN_PORT149_KEYOUT9, NULL);
256
257 /* enable I2C channel 2 and 3 */
258 gpio_request(GPIO_FN_PORT236_I2C_SDA2, NULL);
259 gpio_request(GPIO_FN_PORT237_I2C_SCL2, NULL);
260 gpio_request(GPIO_FN_PORT248_I2C_SCL3, NULL);
261 gpio_request(GPIO_FN_PORT249_I2C_SDA3, NULL);
262
263 /* enable MMCIF */
264 gpio_request(GPIO_FN_MMCCLK0, NULL);
265 gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
266 gpio_request(GPIO_FN_MMCD0_0, NULL);
267 gpio_request(GPIO_FN_MMCD0_1, NULL);
268 gpio_request(GPIO_FN_MMCD0_2, NULL);
269 gpio_request(GPIO_FN_MMCD0_3, NULL);
270 gpio_request(GPIO_FN_MMCD0_4, NULL);
271 gpio_request(GPIO_FN_MMCD0_5, NULL);
272 gpio_request(GPIO_FN_MMCD0_6, NULL);
273 gpio_request(GPIO_FN_MMCD0_7, NULL);
274 gpio_request(GPIO_PORT208, NULL); /* Reset */
275 gpio_direction_output(GPIO_PORT208, 1);
276
277 /* enable SMSC911X */
278 gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
279 gpio_direction_input(GPIO_PORT144);
280 gpio_request(GPIO_PORT145, NULL); /* RESET */
281 gpio_direction_output(GPIO_PORT145, 1);
282
283 /* FSI A */
284 gpio_request(GPIO_FN_FSIACK, NULL);
285 gpio_request(GPIO_FN_FSIAILR, NULL);
286 gpio_request(GPIO_FN_FSIAIBT, NULL);
287 gpio_request(GPIO_FN_FSIAISLD, NULL);
288 gpio_request(GPIO_FN_FSIAOSLD, NULL);
289
290#ifdef CONFIG_CACHE_L2X0
291 /* Shared attribute override enable, 64K*8way */
292 l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff);
293#endif
294 sh73a0_add_standard_devices();
295 platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
296}
297
298static void __init ag5evm_timer_init(void)
299{
300 sh73a0_clock_init();
301 shmobile_timer.init();
302 return;
303}
304
305struct sys_timer ag5evm_timer = {
306 .init = ag5evm_timer_init,
307};
308
309MACHINE_START(AG5EVM, "ag5evm")
310 .map_io = ag5evm_map_io,
311 .init_irq = ag5evm_init_irq,
312 .handle_irq = shmobile_handle_irq_gic,
313 .init_machine = ag5evm_init,
314 .timer = &ag5evm_timer,
315MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
new file mode 100644
index 000000000000..cd79d7c1ba0d
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -0,0 +1,1367 @@
1/*
2 * AP4EVB board support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
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#include <linux/clk.h>
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/platform_device.h>
26#include <linux/delay.h>
27#include <linux/mfd/sh_mobile_sdhi.h>
28#include <linux/mfd/tmio.h>
29#include <linux/mmc/host.h>
30#include <linux/mtd/mtd.h>
31#include <linux/mtd/partitions.h>
32#include <linux/mtd/physmap.h>
33#include <linux/mmc/sh_mmcif.h>
34#include <linux/i2c.h>
35#include <linux/i2c/tsc2007.h>
36#include <linux/io.h>
37#include <linux/smsc911x.h>
38#include <linux/sh_intc.h>
39#include <linux/sh_clk.h>
40#include <linux/gpio.h>
41#include <linux/input.h>
42#include <linux/leds.h>
43#include <linux/input/sh_keysc.h>
44#include <linux/usb/r8a66597.h>
45
46#include <media/sh_mobile_ceu.h>
47#include <media/sh_mobile_csi2.h>
48#include <media/soc_camera.h>
49
50#include <sound/sh_fsi.h>
51
52#include <video/sh_mobile_hdmi.h>
53#include <video/sh_mobile_lcdc.h>
54#include <video/sh_mipi_dsi.h>
55
56#include <mach/common.h>
57#include <mach/irqs.h>
58#include <mach/sh7372.h>
59
60#include <asm/mach-types.h>
61#include <asm/mach/arch.h>
62#include <asm/mach/map.h>
63#include <asm/mach/time.h>
64#include <asm/setup.h>
65
66/*
67 * Address Interface BusWidth note
68 * ------------------------------------------------------------------
69 * 0x0000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = ON
70 * 0x0800_0000 user area -
71 * 0x1000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = OFF
72 * 0x1400_0000 Ether (LAN9220) 16bit
73 * 0x1600_0000 user area - cannot use with NAND
74 * 0x1800_0000 user area -
75 * 0x1A00_0000 -
76 * 0x4000_0000 LPDDR2-SDRAM (POP) 32bit
77 */
78
79/*
80 * NOR Flash ROM
81 *
82 * SW1 | SW2 | SW7 | NOR Flash ROM
83 * bit1 | bit1 bit2 | bit1 | Memory allocation
84 * ------+------------+------+------------------
85 * OFF | ON OFF | ON | Area 0
86 * OFF | ON OFF | OFF | Area 4
87 */
88
89/*
90 * NAND Flash ROM
91 *
92 * SW1 | SW2 | SW7 | NAND Flash ROM
93 * bit1 | bit1 bit2 | bit2 | Memory allocation
94 * ------+------------+------+------------------
95 * OFF | ON OFF | ON | FCE 0
96 * OFF | ON OFF | OFF | FCE 1
97 */
98
99/*
100 * SMSC 9220
101 *
102 * SW1 SMSC 9220
103 * -----------------------
104 * ON access disable
105 * OFF access enable
106 */
107
108/*
109 * LCD / IRQ / KEYSC / IrDA
110 *
111 * IRQ = IRQ26 (TS), IRQ27 (VIO), IRQ28 (QHD-TouchScreen)
112 * LCD = 2nd LCDC (WVGA)
113 *
114 * | SW43 |
115 * SW3 | ON | OFF |
116 * -------------+-----------------------+---------------+
117 * ON | KEY / IrDA | LCD |
118 * OFF | KEY / IrDA / IRQ | IRQ |
119 *
120 *
121 * QHD / WVGA display
122 *
123 * You can choice display type on menuconfig.
124 * Then, check above dip-switch.
125 */
126
127/*
128 * USB
129 *
130 * J7 : 1-2 MAX3355E VBUS
131 * 2-3 DC 5.0V
132 *
133 * S39: bit2: off
134 */
135
136/*
137 * FSI/FSMI
138 *
139 * SW41 : ON : SH-Mobile AP4 Audio Mode
140 * : OFF : Bluetooth Audio Mode
141 */
142
143/*
144 * MMC0/SDHI1 (CN7)
145 *
146 * J22 : select card voltage
147 * 1-2 pin : 1.8v
148 * 2-3 pin : 3.3v
149 *
150 * SW1 | SW33
151 * | bit1 | bit2 | bit3 | bit4
152 * ------------+------+------+------+-------
153 * MMC0 OFF | OFF | ON | ON | X
154 * SDHI1 OFF | ON | X | OFF | ON
155 *
156 * voltage lebel
157 * CN7 : 1.8v
158 * CN12: 3.3v
159 */
160
161/* MTD */
162static struct mtd_partition nor_flash_partitions[] = {
163 {
164 .name = "loader",
165 .offset = 0x00000000,
166 .size = 512 * 1024,
167 .mask_flags = MTD_WRITEABLE,
168 },
169 {
170 .name = "bootenv",
171 .offset = MTDPART_OFS_APPEND,
172 .size = 512 * 1024,
173 .mask_flags = MTD_WRITEABLE,
174 },
175 {
176 .name = "kernel_ro",
177 .offset = MTDPART_OFS_APPEND,
178 .size = 8 * 1024 * 1024,
179 .mask_flags = MTD_WRITEABLE,
180 },
181 {
182 .name = "kernel",
183 .offset = MTDPART_OFS_APPEND,
184 .size = 8 * 1024 * 1024,
185 },
186 {
187 .name = "data",
188 .offset = MTDPART_OFS_APPEND,
189 .size = MTDPART_SIZ_FULL,
190 },
191};
192
193static struct physmap_flash_data nor_flash_data = {
194 .width = 2,
195 .parts = nor_flash_partitions,
196 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
197};
198
199static struct resource nor_flash_resources[] = {
200 [0] = {
201 .start = 0x00000000,
202 .end = 0x08000000 - 1,
203 .flags = IORESOURCE_MEM,
204 }
205};
206
207static struct platform_device nor_flash_device = {
208 .name = "physmap-flash",
209 .dev = {
210 .platform_data = &nor_flash_data,
211 },
212 .num_resources = ARRAY_SIZE(nor_flash_resources),
213 .resource = nor_flash_resources,
214};
215
216/* SMSC 9220 */
217static struct resource smc911x_resources[] = {
218 {
219 .start = 0x14000000,
220 .end = 0x16000000 - 1,
221 .flags = IORESOURCE_MEM,
222 }, {
223 .start = evt2irq(0x02c0) /* IRQ6A */,
224 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
225 },
226};
227
228static struct smsc911x_platform_config smsc911x_info = {
229 .flags = SMSC911X_USE_16BIT | SMSC911X_SAVE_MAC_ADDRESS,
230 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
231 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
232};
233
234static struct platform_device smc911x_device = {
235 .name = "smsc911x",
236 .id = -1,
237 .num_resources = ARRAY_SIZE(smc911x_resources),
238 .resource = smc911x_resources,
239 .dev = {
240 .platform_data = &smsc911x_info,
241 },
242};
243
244/*
245 * The card detect pin of the top SD/MMC slot (CN7) is active low and is
246 * connected to GPIO A22 of SH7372 (GPIO_PORT41).
247 */
248static int slot_cn7_get_cd(struct platform_device *pdev)
249{
250 if (gpio_is_valid(GPIO_PORT41))
251 return !gpio_get_value(GPIO_PORT41);
252 else
253 return -ENXIO;
254}
255
256/* SH_MMCIF */
257static struct resource sh_mmcif_resources[] = {
258 [0] = {
259 .name = "MMCIF",
260 .start = 0xE6BD0000,
261 .end = 0xE6BD00FF,
262 .flags = IORESOURCE_MEM,
263 },
264 [1] = {
265 /* MMC ERR */
266 .start = evt2irq(0x1ac0),
267 .flags = IORESOURCE_IRQ,
268 },
269 [2] = {
270 /* MMC NOR */
271 .start = evt2irq(0x1ae0),
272 .flags = IORESOURCE_IRQ,
273 },
274};
275
276static struct sh_mmcif_dma sh_mmcif_dma = {
277 .chan_priv_rx = {
278 .slave_id = SHDMA_SLAVE_MMCIF_RX,
279 },
280 .chan_priv_tx = {
281 .slave_id = SHDMA_SLAVE_MMCIF_TX,
282 },
283};
284
285static struct sh_mmcif_plat_data sh_mmcif_plat = {
286 .sup_pclk = 0,
287 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
288 .caps = MMC_CAP_4_BIT_DATA |
289 MMC_CAP_8_BIT_DATA |
290 MMC_CAP_NEEDS_POLL,
291 .get_cd = slot_cn7_get_cd,
292 .dma = &sh_mmcif_dma,
293};
294
295static struct platform_device sh_mmcif_device = {
296 .name = "sh_mmcif",
297 .id = 0,
298 .dev = {
299 .dma_mask = NULL,
300 .coherent_dma_mask = 0xffffffff,
301 .platform_data = &sh_mmcif_plat,
302 },
303 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
304 .resource = sh_mmcif_resources,
305};
306
307/* SDHI0 */
308static struct sh_mobile_sdhi_info sdhi0_info = {
309 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
310 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
311};
312
313static struct resource sdhi0_resources[] = {
314 [0] = {
315 .name = "SDHI0",
316 .start = 0xe6850000,
317 .end = 0xe68501ff,
318 .flags = IORESOURCE_MEM,
319 },
320 [1] = {
321 .start = evt2irq(0x0e00) /* SDHI0 */,
322 .flags = IORESOURCE_IRQ,
323 },
324};
325
326static struct platform_device sdhi0_device = {
327 .name = "sh_mobile_sdhi",
328 .num_resources = ARRAY_SIZE(sdhi0_resources),
329 .resource = sdhi0_resources,
330 .id = 0,
331 .dev = {
332 .platform_data = &sdhi0_info,
333 },
334};
335
336/* SDHI1 */
337static struct sh_mobile_sdhi_info sdhi1_info = {
338 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
339 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
340 .tmio_ocr_mask = MMC_VDD_165_195,
341 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
342 .tmio_caps = MMC_CAP_NEEDS_POLL,
343 .get_cd = slot_cn7_get_cd,
344};
345
346static struct resource sdhi1_resources[] = {
347 [0] = {
348 .name = "SDHI1",
349 .start = 0xe6860000,
350 .end = 0xe68601ff,
351 .flags = IORESOURCE_MEM,
352 },
353 [1] = {
354 .start = evt2irq(0x0e80),
355 .flags = IORESOURCE_IRQ,
356 },
357};
358
359static struct platform_device sdhi1_device = {
360 .name = "sh_mobile_sdhi",
361 .num_resources = ARRAY_SIZE(sdhi1_resources),
362 .resource = sdhi1_resources,
363 .id = 1,
364 .dev = {
365 .platform_data = &sdhi1_info,
366 },
367};
368
369/* USB1 */
370static void usb1_host_port_power(int port, int power)
371{
372 if (!power) /* only power-on supported for now */
373 return;
374
375 /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
376 __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
377}
378
379static struct r8a66597_platdata usb1_host_data = {
380 .on_chip = 1,
381 .port_power = usb1_host_port_power,
382};
383
384static struct resource usb1_host_resources[] = {
385 [0] = {
386 .name = "USBHS",
387 .start = 0xE68B0000,
388 .end = 0xE68B00E6 - 1,
389 .flags = IORESOURCE_MEM,
390 },
391 [1] = {
392 .start = evt2irq(0x1ce0) /* USB1_USB1I0 */,
393 .flags = IORESOURCE_IRQ,
394 },
395};
396
397static struct platform_device usb1_host_device = {
398 .name = "r8a66597_hcd",
399 .id = 1,
400 .dev = {
401 .dma_mask = NULL, /* not use dma */
402 .coherent_dma_mask = 0xffffffff,
403 .platform_data = &usb1_host_data,
404 },
405 .num_resources = ARRAY_SIZE(usb1_host_resources),
406 .resource = usb1_host_resources,
407};
408
409const static struct fb_videomode ap4evb_lcdc_modes[] = {
410 {
411#ifdef CONFIG_AP4EVB_QHD
412 .name = "R63302(QHD)",
413 .xres = 544,
414 .yres = 961,
415 .left_margin = 72,
416 .right_margin = 600,
417 .hsync_len = 16,
418 .upper_margin = 8,
419 .lower_margin = 8,
420 .vsync_len = 2,
421 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
422#else
423 .name = "WVGA Panel",
424 .xres = 800,
425 .yres = 480,
426 .left_margin = 220,
427 .right_margin = 110,
428 .hsync_len = 70,
429 .upper_margin = 20,
430 .lower_margin = 5,
431 .vsync_len = 5,
432 .sync = 0,
433#endif
434 },
435};
436
437static struct sh_mobile_lcdc_info lcdc_info = {
438 .ch[0] = {
439 .chan = LCDC_CHAN_MAINLCD,
440 .bpp = 16,
441 .lcd_cfg = ap4evb_lcdc_modes,
442 .num_cfg = ARRAY_SIZE(ap4evb_lcdc_modes),
443 }
444};
445
446static struct resource lcdc_resources[] = {
447 [0] = {
448 .name = "LCDC",
449 .start = 0xfe940000, /* P4-only space */
450 .end = 0xfe943fff,
451 .flags = IORESOURCE_MEM,
452 },
453 [1] = {
454 .start = intcs_evt2irq(0x580),
455 .flags = IORESOURCE_IRQ,
456 },
457};
458
459static struct platform_device lcdc_device = {
460 .name = "sh_mobile_lcdc_fb",
461 .num_resources = ARRAY_SIZE(lcdc_resources),
462 .resource = lcdc_resources,
463 .dev = {
464 .platform_data = &lcdc_info,
465 .coherent_dma_mask = ~0,
466 },
467};
468
469/*
470 * QHD display
471 */
472#ifdef CONFIG_AP4EVB_QHD
473
474/* KEYSC (Needs SW43 set to ON) */
475static struct sh_keysc_info keysc_info = {
476 .mode = SH_KEYSC_MODE_1,
477 .scan_timing = 3,
478 .delay = 2500,
479 .keycodes = {
480 KEY_0, KEY_1, KEY_2, KEY_3, KEY_4,
481 KEY_5, KEY_6, KEY_7, KEY_8, KEY_9,
482 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E,
483 KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
484 KEY_K, KEY_L, KEY_M, KEY_N, KEY_O,
485 },
486};
487
488static struct resource keysc_resources[] = {
489 [0] = {
490 .name = "KEYSC",
491 .start = 0xe61b0000,
492 .end = 0xe61b0063,
493 .flags = IORESOURCE_MEM,
494 },
495 [1] = {
496 .start = evt2irq(0x0be0), /* KEYSC_KEY */
497 .flags = IORESOURCE_IRQ,
498 },
499};
500
501static struct platform_device keysc_device = {
502 .name = "sh_keysc",
503 .id = 0, /* "keysc0" clock */
504 .num_resources = ARRAY_SIZE(keysc_resources),
505 .resource = keysc_resources,
506 .dev = {
507 .platform_data = &keysc_info,
508 },
509};
510
511/* MIPI-DSI */
512static struct resource mipidsi0_resources[] = {
513 [0] = {
514 .start = 0xffc60000,
515 .end = 0xffc63073,
516 .flags = IORESOURCE_MEM,
517 },
518 [1] = {
519 .start = 0xffc68000,
520 .end = 0xffc680ef,
521 .flags = IORESOURCE_MEM,
522 },
523};
524
525static struct sh_mipi_dsi_info mipidsi0_info = {
526 .data_format = MIPI_RGB888,
527 .lcd_chan = &lcdc_info.ch[0],
528 .vsynw_offset = 17,
529};
530
531static struct platform_device mipidsi0_device = {
532 .name = "sh-mipi-dsi",
533 .num_resources = ARRAY_SIZE(mipidsi0_resources),
534 .resource = mipidsi0_resources,
535 .id = 0,
536 .dev = {
537 .platform_data = &mipidsi0_info,
538 },
539};
540
541static struct platform_device *qhd_devices[] __initdata = {
542 &mipidsi0_device,
543 &keysc_device,
544};
545#endif /* CONFIG_AP4EVB_QHD */
546
547/* FSI */
548#define IRQ_FSI evt2irq(0x1840)
549static int __fsi_set_rate(struct clk *clk, long rate, int enable)
550{
551 int ret = 0;
552
553 if (rate <= 0)
554 return ret;
555
556 if (enable) {
557 ret = clk_set_rate(clk, rate);
558 if (0 == ret)
559 ret = clk_enable(clk);
560 } else {
561 clk_disable(clk);
562 }
563
564 return ret;
565}
566
567static int __fsi_set_round_rate(struct clk *clk, long rate, int enable)
568{
569 return __fsi_set_rate(clk, clk_round_rate(clk, rate), enable);
570}
571
572static int fsi_ak4642_set_rate(struct device *dev, int rate, int enable)
573{
574 struct clk *fsia_ick;
575 struct clk *fsiack;
576 int ret = -EIO;
577
578 fsia_ick = clk_get(dev, "icka");
579 if (IS_ERR(fsia_ick))
580 return PTR_ERR(fsia_ick);
581
582 /*
583 * FSIACK is connected to AK4642,
584 * and use external clock pin from it.
585 * it is parent of fsia_ick now.
586 */
587 fsiack = clk_get_parent(fsia_ick);
588 if (!fsiack)
589 goto fsia_ick_out;
590
591 /*
592 * we get 1/1 divided clock by setting same rate to fsiack and fsia_ick
593 *
594 ** FIXME **
595 * Because the freq_table of external clk (fsiack) are all 0,
596 * the return value of clk_round_rate became 0.
597 * So, it use __fsi_set_rate here.
598 */
599 ret = __fsi_set_rate(fsiack, rate, enable);
600 if (ret < 0)
601 goto fsiack_out;
602
603 ret = __fsi_set_round_rate(fsia_ick, rate, enable);
604 if ((ret < 0) && enable)
605 __fsi_set_round_rate(fsiack, rate, 0); /* disable FSI ACK */
606
607fsiack_out:
608 clk_put(fsiack);
609
610fsia_ick_out:
611 clk_put(fsia_ick);
612
613 return 0;
614}
615
616static int fsi_hdmi_set_rate(struct device *dev, int rate, int enable)
617{
618 struct clk *fsib_clk;
619 struct clk *fdiv_clk = &sh7372_fsidivb_clk;
620 long fsib_rate = 0;
621 long fdiv_rate = 0;
622 int ackmd_bpfmd;
623 int ret;
624
625 switch (rate) {
626 case 44100:
627 fsib_rate = rate * 256;
628 ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
629 break;
630 case 48000:
631 fsib_rate = 85428000; /* around 48kHz x 256 x 7 */
632 fdiv_rate = rate * 256;
633 ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
634 break;
635 default:
636 pr_err("unsupported rate in FSI2 port B\n");
637 return -EINVAL;
638 }
639
640 /* FSI B setting */
641 fsib_clk = clk_get(dev, "ickb");
642 if (IS_ERR(fsib_clk))
643 return -EIO;
644
645 ret = __fsi_set_round_rate(fsib_clk, fsib_rate, enable);
646 if (ret < 0)
647 goto fsi_set_rate_end;
648
649 /* FSI DIV setting */
650 ret = __fsi_set_round_rate(fdiv_clk, fdiv_rate, enable);
651 if (ret < 0) {
652 /* disable FSI B */
653 if (enable)
654 __fsi_set_round_rate(fsib_clk, fsib_rate, 0);
655 goto fsi_set_rate_end;
656 }
657
658 ret = ackmd_bpfmd;
659
660fsi_set_rate_end:
661 clk_put(fsib_clk);
662 return ret;
663}
664
665static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
666{
667 int ret;
668
669 if (is_porta)
670 ret = fsi_ak4642_set_rate(dev, rate, enable);
671 else
672 ret = fsi_hdmi_set_rate(dev, rate, enable);
673
674 return ret;
675}
676
677static struct sh_fsi_platform_info fsi_info = {
678 .porta_flags = SH_FSI_BRS_INV |
679 SH_FSI_OUT_SLAVE_MODE |
680 SH_FSI_IN_SLAVE_MODE |
681 SH_FSI_OFMT(PCM) |
682 SH_FSI_IFMT(PCM),
683
684 .portb_flags = SH_FSI_BRS_INV |
685 SH_FSI_BRM_INV |
686 SH_FSI_LRS_INV |
687 SH_FSI_OFMT(SPDIF),
688 .set_rate = fsi_set_rate,
689};
690
691static struct resource fsi_resources[] = {
692 [0] = {
693 .name = "FSI",
694 .start = 0xFE3C0000,
695 .end = 0xFE3C0400 - 1,
696 .flags = IORESOURCE_MEM,
697 },
698 [1] = {
699 .start = IRQ_FSI,
700 .flags = IORESOURCE_IRQ,
701 },
702};
703
704static struct platform_device fsi_device = {
705 .name = "sh_fsi2",
706 .id = -1,
707 .num_resources = ARRAY_SIZE(fsi_resources),
708 .resource = fsi_resources,
709 .dev = {
710 .platform_data = &fsi_info,
711 },
712};
713
714static struct sh_mobile_lcdc_info sh_mobile_lcdc1_info = {
715 .clock_source = LCDC_CLK_EXTERNAL,
716 .ch[0] = {
717 .chan = LCDC_CHAN_MAINLCD,
718 .bpp = 16,
719 .interface_type = RGB24,
720 .clock_divider = 1,
721 .flags = LCDC_FLAGS_DWPOL,
722 }
723};
724
725static struct resource lcdc1_resources[] = {
726 [0] = {
727 .name = "LCDC1",
728 .start = 0xfe944000,
729 .end = 0xfe947fff,
730 .flags = IORESOURCE_MEM,
731 },
732 [1] = {
733 .start = intcs_evt2irq(0x1780),
734 .flags = IORESOURCE_IRQ,
735 },
736};
737
738static struct platform_device lcdc1_device = {
739 .name = "sh_mobile_lcdc_fb",
740 .num_resources = ARRAY_SIZE(lcdc1_resources),
741 .resource = lcdc1_resources,
742 .id = 1,
743 .dev = {
744 .platform_data = &sh_mobile_lcdc1_info,
745 .coherent_dma_mask = ~0,
746 },
747};
748
749static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
750 unsigned long *parent_freq);
751
752
753static struct sh_mobile_hdmi_info hdmi_info = {
754 .lcd_chan = &sh_mobile_lcdc1_info.ch[0],
755 .lcd_dev = &lcdc1_device.dev,
756 .flags = HDMI_SND_SRC_SPDIF,
757 .clk_optimize_parent = ap4evb_clk_optimize,
758};
759
760static struct resource hdmi_resources[] = {
761 [0] = {
762 .name = "HDMI",
763 .start = 0xe6be0000,
764 .end = 0xe6be00ff,
765 .flags = IORESOURCE_MEM,
766 },
767 [1] = {
768 /* There's also an HDMI interrupt on INTCS @ 0x18e0 */
769 .start = evt2irq(0x17e0),
770 .flags = IORESOURCE_IRQ,
771 },
772};
773
774static struct platform_device hdmi_device = {
775 .name = "sh-mobile-hdmi",
776 .num_resources = ARRAY_SIZE(hdmi_resources),
777 .resource = hdmi_resources,
778 .id = -1,
779 .dev = {
780 .platform_data = &hdmi_info,
781 },
782};
783
784static long ap4evb_clk_optimize(unsigned long target, unsigned long *best_freq,
785 unsigned long *parent_freq)
786{
787 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
788 long error;
789
790 if (IS_ERR(hdmi_ick)) {
791 int ret = PTR_ERR(hdmi_ick);
792 pr_err("Cannot get HDMI ICK: %d\n", ret);
793 return ret;
794 }
795
796 error = clk_round_parent(hdmi_ick, target, best_freq, parent_freq, 1, 64);
797
798 clk_put(hdmi_ick);
799
800 return error;
801}
802
803static struct gpio_led ap4evb_leds[] = {
804 {
805 .name = "led4",
806 .gpio = GPIO_PORT185,
807 .default_state = LEDS_GPIO_DEFSTATE_ON,
808 },
809 {
810 .name = "led2",
811 .gpio = GPIO_PORT186,
812 .default_state = LEDS_GPIO_DEFSTATE_ON,
813 },
814 {
815 .name = "led3",
816 .gpio = GPIO_PORT187,
817 .default_state = LEDS_GPIO_DEFSTATE_ON,
818 },
819 {
820 .name = "led1",
821 .gpio = GPIO_PORT188,
822 .default_state = LEDS_GPIO_DEFSTATE_ON,
823 }
824};
825
826static struct gpio_led_platform_data ap4evb_leds_pdata = {
827 .num_leds = ARRAY_SIZE(ap4evb_leds),
828 .leds = ap4evb_leds,
829};
830
831static struct platform_device leds_device = {
832 .name = "leds-gpio",
833 .id = 0,
834 .dev = {
835 .platform_data = &ap4evb_leds_pdata,
836 },
837};
838
839static struct i2c_board_info imx074_info = {
840 I2C_BOARD_INFO("imx074", 0x1a),
841};
842
843struct soc_camera_link imx074_link = {
844 .bus_id = 0,
845 .board_info = &imx074_info,
846 .i2c_adapter_id = 0,
847 .module_name = "imx074",
848};
849
850static struct platform_device ap4evb_camera = {
851 .name = "soc-camera-pdrv",
852 .id = 0,
853 .dev = {
854 .platform_data = &imx074_link,
855 },
856};
857
858static struct sh_csi2_client_config csi2_clients[] = {
859 {
860 .phy = SH_CSI2_PHY_MAIN,
861 .lanes = 3,
862 .channel = 0,
863 .pdev = &ap4evb_camera,
864 },
865};
866
867static struct sh_csi2_pdata csi2_info = {
868 .type = SH_CSI2C,
869 .clients = csi2_clients,
870 .num_clients = ARRAY_SIZE(csi2_clients),
871 .flags = SH_CSI2_ECC | SH_CSI2_CRC,
872};
873
874static struct resource csi2_resources[] = {
875 [0] = {
876 .name = "CSI2",
877 .start = 0xffc90000,
878 .end = 0xffc90fff,
879 .flags = IORESOURCE_MEM,
880 },
881 [1] = {
882 .start = intcs_evt2irq(0x17a0),
883 .flags = IORESOURCE_IRQ,
884 },
885};
886
887static struct platform_device csi2_device = {
888 .name = "sh-mobile-csi2",
889 .id = 0,
890 .num_resources = ARRAY_SIZE(csi2_resources),
891 .resource = csi2_resources,
892 .dev = {
893 .platform_data = &csi2_info,
894 },
895};
896
897static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
898 .flags = SH_CEU_FLAG_USE_8BIT_BUS,
899 .csi2_dev = &csi2_device.dev,
900};
901
902static struct resource ceu_resources[] = {
903 [0] = {
904 .name = "CEU",
905 .start = 0xfe910000,
906 .end = 0xfe91009f,
907 .flags = IORESOURCE_MEM,
908 },
909 [1] = {
910 .start = intcs_evt2irq(0x880),
911 .flags = IORESOURCE_IRQ,
912 },
913 [2] = {
914 /* place holder for contiguous memory */
915 },
916};
917
918static struct platform_device ceu_device = {
919 .name = "sh_mobile_ceu",
920 .id = 0, /* "ceu0" clock */
921 .num_resources = ARRAY_SIZE(ceu_resources),
922 .resource = ceu_resources,
923 .dev = {
924 .platform_data = &sh_mobile_ceu_info,
925 },
926};
927
928static struct platform_device *ap4evb_devices[] __initdata = {
929 &leds_device,
930 &nor_flash_device,
931 &smc911x_device,
932 &sdhi0_device,
933 &sdhi1_device,
934 &usb1_host_device,
935 &fsi_device,
936 &sh_mmcif_device,
937 &lcdc1_device,
938 &lcdc_device,
939 &hdmi_device,
940 &csi2_device,
941 &ceu_device,
942 &ap4evb_camera,
943};
944
945static int __init hdmi_init_pm_clock(void)
946{
947 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
948 int ret;
949 long rate;
950
951 if (IS_ERR(hdmi_ick)) {
952 ret = PTR_ERR(hdmi_ick);
953 pr_err("Cannot get HDMI ICK: %d\n", ret);
954 goto out;
955 }
956
957 ret = clk_set_parent(&sh7372_pllc2_clk, &sh7372_dv_clki_div2_clk);
958 if (ret < 0) {
959 pr_err("Cannot set PLLC2 parent: %d, %d users\n", ret, sh7372_pllc2_clk.usecount);
960 goto out;
961 }
962
963 pr_debug("PLLC2 initial frequency %lu\n", clk_get_rate(&sh7372_pllc2_clk));
964
965 rate = clk_round_rate(&sh7372_pllc2_clk, 594000000);
966 if (rate < 0) {
967 pr_err("Cannot get suitable rate: %ld\n", rate);
968 ret = rate;
969 goto out;
970 }
971
972 ret = clk_set_rate(&sh7372_pllc2_clk, rate);
973 if (ret < 0) {
974 pr_err("Cannot set rate %ld: %d\n", rate, ret);
975 goto out;
976 }
977
978 ret = clk_enable(&sh7372_pllc2_clk);
979 if (ret < 0) {
980 pr_err("Cannot enable pllc2 clock\n");
981 goto out;
982 }
983 pr_debug("PLLC2 set frequency %lu\n", rate);
984
985 ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
986 if (ret < 0) {
987 pr_err("Cannot set HDMI parent: %d\n", ret);
988 goto out;
989 }
990
991out:
992 if (!IS_ERR(hdmi_ick))
993 clk_put(hdmi_ick);
994 return ret;
995}
996
997device_initcall(hdmi_init_pm_clock);
998
999static int __init fsi_init_pm_clock(void)
1000{
1001 struct clk *fsia_ick;
1002 int ret;
1003
1004 fsia_ick = clk_get(&fsi_device.dev, "icka");
1005 if (IS_ERR(fsia_ick)) {
1006 ret = PTR_ERR(fsia_ick);
1007 pr_err("Cannot get FSI ICK: %d\n", ret);
1008 return ret;
1009 }
1010
1011 ret = clk_set_parent(fsia_ick, &sh7372_fsiack_clk);
1012 if (ret < 0)
1013 pr_err("Cannot set FSI-A parent: %d\n", ret);
1014
1015 clk_put(fsia_ick);
1016
1017 return ret;
1018}
1019device_initcall(fsi_init_pm_clock);
1020
1021/*
1022 * FIXME !!
1023 *
1024 * gpio_no_direction
1025 * are quick_hack.
1026 *
1027 * current gpio frame work doesn't have
1028 * the method to control only pull up/down/free.
1029 * this function should be replaced by correct gpio function
1030 */
1031static void __init gpio_no_direction(u32 addr)
1032{
1033 __raw_writeb(0x00, addr);
1034}
1035
1036/* TouchScreen */
1037#ifdef CONFIG_AP4EVB_QHD
1038# define GPIO_TSC_IRQ GPIO_FN_IRQ28_123
1039# define GPIO_TSC_PORT GPIO_PORT123
1040#else /* WVGA */
1041# define GPIO_TSC_IRQ GPIO_FN_IRQ7_40
1042# define GPIO_TSC_PORT GPIO_PORT40
1043#endif
1044
1045#define IRQ28 evt2irq(0x3380) /* IRQ28A */
1046#define IRQ7 evt2irq(0x02e0) /* IRQ7A */
1047static int ts_get_pendown_state(void)
1048{
1049 int val;
1050
1051 gpio_free(GPIO_TSC_IRQ);
1052
1053 gpio_request(GPIO_TSC_PORT, NULL);
1054
1055 gpio_direction_input(GPIO_TSC_PORT);
1056
1057 val = gpio_get_value(GPIO_TSC_PORT);
1058
1059 gpio_request(GPIO_TSC_IRQ, NULL);
1060
1061 return !val;
1062}
1063
1064static int ts_init(void)
1065{
1066 gpio_request(GPIO_TSC_IRQ, NULL);
1067
1068 return 0;
1069}
1070
1071static struct tsc2007_platform_data tsc2007_info = {
1072 .model = 2007,
1073 .x_plate_ohms = 180,
1074 .get_pendown_state = ts_get_pendown_state,
1075 .init_platform_hw = ts_init,
1076};
1077
1078static struct i2c_board_info tsc_device = {
1079 I2C_BOARD_INFO("tsc2007", 0x48),
1080 .type = "tsc2007",
1081 .platform_data = &tsc2007_info,
1082 /*.irq is selected on ap4evb_init */
1083};
1084
1085/* I2C */
1086static struct i2c_board_info i2c0_devices[] = {
1087 {
1088 I2C_BOARD_INFO("ak4643", 0x13),
1089 },
1090};
1091
1092static struct i2c_board_info i2c1_devices[] = {
1093 {
1094 I2C_BOARD_INFO("r2025sd", 0x32),
1095 },
1096};
1097
1098static struct map_desc ap4evb_io_desc[] __initdata = {
1099 /* create a 1:1 entity map for 0xe6xxxxxx
1100 * used by CPGA, INTC and PFC.
1101 */
1102 {
1103 .virtual = 0xe6000000,
1104 .pfn = __phys_to_pfn(0xe6000000),
1105 .length = 256 << 20,
1106 .type = MT_DEVICE_NONSHARED
1107 },
1108};
1109
1110static void __init ap4evb_map_io(void)
1111{
1112 iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));
1113
1114 /* setup early devices and console here as well */
1115 sh7372_add_early_devices();
1116 shmobile_setup_console();
1117}
1118
1119#define GPIO_PORT9CR 0xE6051009
1120#define GPIO_PORT10CR 0xE605100A
1121#define USCCR1 0xE6058144
1122static void __init ap4evb_init(void)
1123{
1124 u32 srcr4;
1125 struct clk *clk;
1126
1127 sh7372_pinmux_init();
1128
1129 /* enable SCIFA0 */
1130 gpio_request(GPIO_FN_SCIFA0_TXD, NULL);
1131 gpio_request(GPIO_FN_SCIFA0_RXD, NULL);
1132
1133 /* enable SMSC911X */
1134 gpio_request(GPIO_FN_CS5A, NULL);
1135 gpio_request(GPIO_FN_IRQ6_39, NULL);
1136
1137 /* enable Debug switch (S6) */
1138 gpio_request(GPIO_PORT32, NULL);
1139 gpio_request(GPIO_PORT33, NULL);
1140 gpio_request(GPIO_PORT34, NULL);
1141 gpio_request(GPIO_PORT35, NULL);
1142 gpio_direction_input(GPIO_PORT32);
1143 gpio_direction_input(GPIO_PORT33);
1144 gpio_direction_input(GPIO_PORT34);
1145 gpio_direction_input(GPIO_PORT35);
1146 gpio_export(GPIO_PORT32, 0);
1147 gpio_export(GPIO_PORT33, 0);
1148 gpio_export(GPIO_PORT34, 0);
1149 gpio_export(GPIO_PORT35, 0);
1150
1151 /* SDHI0 */
1152 gpio_request(GPIO_FN_SDHICD0, NULL);
1153 gpio_request(GPIO_FN_SDHIWP0, NULL);
1154 gpio_request(GPIO_FN_SDHICMD0, NULL);
1155 gpio_request(GPIO_FN_SDHICLK0, NULL);
1156 gpio_request(GPIO_FN_SDHID0_3, NULL);
1157 gpio_request(GPIO_FN_SDHID0_2, NULL);
1158 gpio_request(GPIO_FN_SDHID0_1, NULL);
1159 gpio_request(GPIO_FN_SDHID0_0, NULL);
1160
1161 /* SDHI1 */
1162 gpio_request(GPIO_FN_SDHICMD1, NULL);
1163 gpio_request(GPIO_FN_SDHICLK1, NULL);
1164 gpio_request(GPIO_FN_SDHID1_3, NULL);
1165 gpio_request(GPIO_FN_SDHID1_2, NULL);
1166 gpio_request(GPIO_FN_SDHID1_1, NULL);
1167 gpio_request(GPIO_FN_SDHID1_0, NULL);
1168
1169 /* MMCIF */
1170 gpio_request(GPIO_FN_MMCD0_0, NULL);
1171 gpio_request(GPIO_FN_MMCD0_1, NULL);
1172 gpio_request(GPIO_FN_MMCD0_2, NULL);
1173 gpio_request(GPIO_FN_MMCD0_3, NULL);
1174 gpio_request(GPIO_FN_MMCD0_4, NULL);
1175 gpio_request(GPIO_FN_MMCD0_5, NULL);
1176 gpio_request(GPIO_FN_MMCD0_6, NULL);
1177 gpio_request(GPIO_FN_MMCD0_7, NULL);
1178 gpio_request(GPIO_FN_MMCCMD0, NULL);
1179 gpio_request(GPIO_FN_MMCCLK0, NULL);
1180
1181 /* USB enable */
1182 gpio_request(GPIO_FN_VBUS0_1, NULL);
1183 gpio_request(GPIO_FN_IDIN_1_18, NULL);
1184 gpio_request(GPIO_FN_PWEN_1_115, NULL);
1185 gpio_request(GPIO_FN_OVCN_1_114, NULL);
1186 gpio_request(GPIO_FN_EXTLP_1, NULL);
1187 gpio_request(GPIO_FN_OVCN2_1, NULL);
1188
1189 /* setup USB phy */
1190 __raw_writew(0x8a0a, 0xE6058130); /* USBCR4 */
1191
1192 /* enable FSI2 port A (ak4643) */
1193 gpio_request(GPIO_FN_FSIAIBT, NULL);
1194 gpio_request(GPIO_FN_FSIAILR, NULL);
1195 gpio_request(GPIO_FN_FSIAISLD, NULL);
1196 gpio_request(GPIO_FN_FSIAOSLD, NULL);
1197 gpio_request(GPIO_PORT161, NULL);
1198 gpio_direction_output(GPIO_PORT161, 0); /* slave */
1199
1200 gpio_request(GPIO_PORT9, NULL);
1201 gpio_request(GPIO_PORT10, NULL);
1202 gpio_no_direction(GPIO_PORT9CR); /* FSIAOBT needs no direction */
1203 gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */
1204
1205 /* card detect pin for MMC slot (CN7) */
1206 gpio_request(GPIO_PORT41, NULL);
1207 gpio_direction_input(GPIO_PORT41);
1208
1209 /* setup FSI2 port B (HDMI) */
1210 gpio_request(GPIO_FN_FSIBCK, NULL);
1211 __raw_writew(__raw_readw(USCCR1) & ~(1 << 6), USCCR1); /* use SPDIF */
1212
1213 /* set SPU2 clock to 119.6 MHz */
1214 clk = clk_get(NULL, "spu_clk");
1215 if (!IS_ERR(clk)) {
1216 clk_set_rate(clk, clk_round_rate(clk, 119600000));
1217 clk_put(clk);
1218 }
1219
1220 /*
1221 * set irq priority, to avoid sound chopping
1222 * when NFS rootfs is used
1223 * FSI(3) > SMSC911X(2)
1224 */
1225 intc_set_priority(IRQ_FSI, 3);
1226
1227 i2c_register_board_info(0, i2c0_devices,
1228 ARRAY_SIZE(i2c0_devices));
1229
1230 i2c_register_board_info(1, i2c1_devices,
1231 ARRAY_SIZE(i2c1_devices));
1232
1233#ifdef CONFIG_AP4EVB_QHD
1234
1235 /*
1236 * For QHD Panel (MIPI-DSI, CONFIG_AP4EVB_QHD=y) and
1237 * IRQ28 for Touch Panel, set dip switches S3, S43 as OFF, ON.
1238 */
1239
1240 /* enable KEYSC */
1241 gpio_request(GPIO_FN_KEYOUT0, NULL);
1242 gpio_request(GPIO_FN_KEYOUT1, NULL);
1243 gpio_request(GPIO_FN_KEYOUT2, NULL);
1244 gpio_request(GPIO_FN_KEYOUT3, NULL);
1245 gpio_request(GPIO_FN_KEYOUT4, NULL);
1246 gpio_request(GPIO_FN_KEYIN0_136, NULL);
1247 gpio_request(GPIO_FN_KEYIN1_135, NULL);
1248 gpio_request(GPIO_FN_KEYIN2_134, NULL);
1249 gpio_request(GPIO_FN_KEYIN3_133, NULL);
1250 gpio_request(GPIO_FN_KEYIN4, NULL);
1251
1252 /* enable TouchScreen */
1253 set_irq_type(IRQ28, IRQ_TYPE_LEVEL_LOW);
1254
1255 tsc_device.irq = IRQ28;
1256 i2c_register_board_info(1, &tsc_device, 1);
1257
1258 /* LCDC0 */
1259 lcdc_info.clock_source = LCDC_CLK_PERIPHERAL;
1260 lcdc_info.ch[0].interface_type = RGB24;
1261 lcdc_info.ch[0].clock_divider = 1;
1262 lcdc_info.ch[0].flags = LCDC_FLAGS_DWPOL;
1263 lcdc_info.ch[0].lcd_size_cfg.width = 44;
1264 lcdc_info.ch[0].lcd_size_cfg.height = 79;
1265
1266 platform_add_devices(qhd_devices, ARRAY_SIZE(qhd_devices));
1267
1268#else
1269 /*
1270 * For WVGA Panel (18-bit RGB, CONFIG_AP4EVB_WVGA=y) and
1271 * IRQ7 for Touch Panel, set dip switches S3, S43 to ON, OFF.
1272 */
1273
1274 gpio_request(GPIO_FN_LCDD17, NULL);
1275 gpio_request(GPIO_FN_LCDD16, NULL);
1276 gpio_request(GPIO_FN_LCDD15, NULL);
1277 gpio_request(GPIO_FN_LCDD14, NULL);
1278 gpio_request(GPIO_FN_LCDD13, NULL);
1279 gpio_request(GPIO_FN_LCDD12, NULL);
1280 gpio_request(GPIO_FN_LCDD11, NULL);
1281 gpio_request(GPIO_FN_LCDD10, NULL);
1282 gpio_request(GPIO_FN_LCDD9, NULL);
1283 gpio_request(GPIO_FN_LCDD8, NULL);
1284 gpio_request(GPIO_FN_LCDD7, NULL);
1285 gpio_request(GPIO_FN_LCDD6, NULL);
1286 gpio_request(GPIO_FN_LCDD5, NULL);
1287 gpio_request(GPIO_FN_LCDD4, NULL);
1288 gpio_request(GPIO_FN_LCDD3, NULL);
1289 gpio_request(GPIO_FN_LCDD2, NULL);
1290 gpio_request(GPIO_FN_LCDD1, NULL);
1291 gpio_request(GPIO_FN_LCDD0, NULL);
1292 gpio_request(GPIO_FN_LCDDISP, NULL);
1293 gpio_request(GPIO_FN_LCDDCK, NULL);
1294
1295 gpio_request(GPIO_PORT189, NULL); /* backlight */
1296 gpio_direction_output(GPIO_PORT189, 1);
1297
1298 gpio_request(GPIO_PORT151, NULL); /* LCDDON */
1299 gpio_direction_output(GPIO_PORT151, 1);
1300
1301 lcdc_info.clock_source = LCDC_CLK_BUS;
1302 lcdc_info.ch[0].interface_type = RGB18;
1303 lcdc_info.ch[0].clock_divider = 2;
1304 lcdc_info.ch[0].flags = 0;
1305 lcdc_info.ch[0].lcd_size_cfg.width = 152;
1306 lcdc_info.ch[0].lcd_size_cfg.height = 91;
1307
1308 /* enable TouchScreen */
1309 set_irq_type(IRQ7, IRQ_TYPE_LEVEL_LOW);
1310
1311 tsc_device.irq = IRQ7;
1312 i2c_register_board_info(0, &tsc_device, 1);
1313#endif /* CONFIG_AP4EVB_QHD */
1314
1315 /* CEU */
1316
1317 /*
1318 * TODO: reserve memory for V4L2 DMA buffers, when a suitable API
1319 * becomes available
1320 */
1321
1322 /* MIPI-CSI stuff */
1323 gpio_request(GPIO_FN_VIO_CKO, NULL);
1324
1325 clk = clk_get(NULL, "vck1_clk");
1326 if (!IS_ERR(clk)) {
1327 clk_set_rate(clk, clk_round_rate(clk, 13000000));
1328 clk_enable(clk);
1329 clk_put(clk);
1330 }
1331
1332 sh7372_add_standard_devices();
1333
1334 /* HDMI */
1335 gpio_request(GPIO_FN_HDMI_HPD, NULL);
1336 gpio_request(GPIO_FN_HDMI_CEC, NULL);
1337
1338 /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */
1339#define SRCR4 0xe61580bc
1340 srcr4 = __raw_readl(SRCR4);
1341 __raw_writel(srcr4 | (1 << 13), SRCR4);
1342 udelay(50);
1343 __raw_writel(srcr4 & ~(1 << 13), SRCR4);
1344
1345 platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
1346}
1347
1348static void __init ap4evb_timer_init(void)
1349{
1350 sh7372_clock_init();
1351 shmobile_timer.init();
1352
1353 /* External clock source */
1354 clk_set_rate(&sh7372_dv_clki_clk, 27000000);
1355}
1356
1357static struct sys_timer ap4evb_timer = {
1358 .init = ap4evb_timer_init,
1359};
1360
1361MACHINE_START(AP4EVB, "ap4evb")
1362 .map_io = ap4evb_map_io,
1363 .init_irq = sh7372_init_irq,
1364 .handle_irq = shmobile_handle_irq_intc,
1365 .init_machine = ap4evb_init,
1366 .timer = &ap4evb_timer,
1367MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
new file mode 100644
index 000000000000..686b304a7708
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -0,0 +1,373 @@
1/*
2 * G3EVM board support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
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#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/mtd/mtd.h>
27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
29#include <linux/mtd/sh_flctl.h>
30#include <linux/usb/r8a66597.h>
31#include <linux/io.h>
32#include <linux/gpio.h>
33#include <linux/input.h>
34#include <linux/input/sh_keysc.h>
35#include <mach/sh7367.h>
36#include <mach/common.h>
37#include <asm/mach-types.h>
38#include <asm/mach/arch.h>
39#include <asm/mach/map.h>
40#include <asm/mach/time.h>
41
42/*
43 * IrDA
44 *
45 * S67: 5bit : ON power
46 * : 6bit : ON remote control
47 * OFF IrDA
48 */
49
50static struct mtd_partition nor_flash_partitions[] = {
51 {
52 .name = "loader",
53 .offset = 0x00000000,
54 .size = 512 * 1024,
55 },
56 {
57 .name = "bootenv",
58 .offset = MTDPART_OFS_APPEND,
59 .size = 512 * 1024,
60 },
61 {
62 .name = "kernel_ro",
63 .offset = MTDPART_OFS_APPEND,
64 .size = 8 * 1024 * 1024,
65 .mask_flags = MTD_WRITEABLE,
66 },
67 {
68 .name = "kernel",
69 .offset = MTDPART_OFS_APPEND,
70 .size = 8 * 1024 * 1024,
71 },
72 {
73 .name = "data",
74 .offset = MTDPART_OFS_APPEND,
75 .size = MTDPART_SIZ_FULL,
76 },
77};
78
79static struct physmap_flash_data nor_flash_data = {
80 .width = 2,
81 .parts = nor_flash_partitions,
82 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
83};
84
85static struct resource nor_flash_resources[] = {
86 [0] = {
87 .start = 0x00000000,
88 .end = 0x08000000 - 1,
89 .flags = IORESOURCE_MEM,
90 }
91};
92
93static struct platform_device nor_flash_device = {
94 .name = "physmap-flash",
95 .dev = {
96 .platform_data = &nor_flash_data,
97 },
98 .num_resources = ARRAY_SIZE(nor_flash_resources),
99 .resource = nor_flash_resources,
100};
101
102/* USBHS */
103static void usb_host_port_power(int port, int power)
104{
105 if (!power) /* only power-on supported for now */
106 return;
107
108 /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
109 __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008);
110}
111
112static struct r8a66597_platdata usb_host_data = {
113 .on_chip = 1,
114 .port_power = usb_host_port_power,
115};
116
117static struct resource usb_host_resources[] = {
118 [0] = {
119 .name = "USBHS",
120 .start = 0xe6890000,
121 .end = 0xe68900e5,
122 .flags = IORESOURCE_MEM,
123 },
124 [1] = {
125 .start = evt2irq(0xa20), /* USBHS_USHI0 */
126 .flags = IORESOURCE_IRQ,
127 },
128};
129
130static struct platform_device usb_host_device = {
131 .name = "r8a66597_hcd",
132 .id = 0,
133 .dev = {
134 .platform_data = &usb_host_data,
135 .dma_mask = NULL,
136 .coherent_dma_mask = 0xffffffff,
137 },
138 .num_resources = ARRAY_SIZE(usb_host_resources),
139 .resource = usb_host_resources,
140};
141
142/* KEYSC */
143static struct sh_keysc_info keysc_info = {
144 .mode = SH_KEYSC_MODE_5,
145 .scan_timing = 3,
146 .delay = 100,
147 .keycodes = {
148 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
149 KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
150 KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
151 KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
152 KEY_WAKEUP, KEY_COFFEE, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4,
153 KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_STOP, KEY_COMPUTER,
154 },
155};
156
157static struct resource keysc_resources[] = {
158 [0] = {
159 .name = "KEYSC",
160 .start = 0xe61b0000,
161 .end = 0xe61b000f,
162 .flags = IORESOURCE_MEM,
163 },
164 [1] = {
165 .start = evt2irq(0xbe0), /* KEYSC_KEY */
166 .flags = IORESOURCE_IRQ,
167 },
168};
169
170static struct platform_device keysc_device = {
171 .name = "sh_keysc",
172 .num_resources = ARRAY_SIZE(keysc_resources),
173 .resource = keysc_resources,
174 .dev = {
175 .platform_data = &keysc_info,
176 },
177};
178
179static struct mtd_partition nand_partition_info[] = {
180 {
181 .name = "system",
182 .offset = 0,
183 .size = 64 * 1024 * 1024,
184 },
185 {
186 .name = "userdata",
187 .offset = MTDPART_OFS_APPEND,
188 .size = 128 * 1024 * 1024,
189 },
190 {
191 .name = "cache",
192 .offset = MTDPART_OFS_APPEND,
193 .size = 64 * 1024 * 1024,
194 },
195};
196
197static struct resource nand_flash_resources[] = {
198 [0] = {
199 .start = 0xe6a30000,
200 .end = 0xe6a3009b,
201 .flags = IORESOURCE_MEM,
202 }
203};
204
205static struct sh_flctl_platform_data nand_flash_data = {
206 .parts = nand_partition_info,
207 .nr_parts = ARRAY_SIZE(nand_partition_info),
208 .flcmncr_val = QTSEL_E | FCKSEL_E | TYPESEL_SET | NANWF_E
209 | SHBUSSEL | SEL_16BIT,
210};
211
212static struct platform_device nand_flash_device = {
213 .name = "sh_flctl",
214 .resource = nand_flash_resources,
215 .num_resources = ARRAY_SIZE(nand_flash_resources),
216 .dev = {
217 .platform_data = &nand_flash_data,
218 },
219};
220
221static struct resource irda_resources[] = {
222 [0] = {
223 .start = 0xE6D00000,
224 .end = 0xE6D01FD4 - 1,
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .start = evt2irq(0x480), /* IRDA */
229 .flags = IORESOURCE_IRQ,
230 },
231};
232
233static struct platform_device irda_device = {
234 .name = "sh_irda",
235 .id = -1,
236 .resource = irda_resources,
237 .num_resources = ARRAY_SIZE(irda_resources),
238};
239
240static struct platform_device *g3evm_devices[] __initdata = {
241 &nor_flash_device,
242 &usb_host_device,
243 &keysc_device,
244 &nand_flash_device,
245 &irda_device,
246};
247
248static struct map_desc g3evm_io_desc[] __initdata = {
249 /* create a 1:1 entity map for 0xe6xxxxxx
250 * used by CPGA, INTC and PFC.
251 */
252 {
253 .virtual = 0xe6000000,
254 .pfn = __phys_to_pfn(0xe6000000),
255 .length = 256 << 20,
256 .type = MT_DEVICE_NONSHARED
257 },
258};
259
260static void __init g3evm_map_io(void)
261{
262 iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc));
263
264 /* setup early devices and console here as well */
265 sh7367_add_early_devices();
266 shmobile_setup_console();
267}
268
269static void __init g3evm_init(void)
270{
271 sh7367_pinmux_init();
272
273 /* Lit DS4 LED */
274 gpio_request(GPIO_PORT22, NULL);
275 gpio_direction_output(GPIO_PORT22, 1);
276 gpio_export(GPIO_PORT22, 0);
277
278 /* Lit DS8 LED */
279 gpio_request(GPIO_PORT23, NULL);
280 gpio_direction_output(GPIO_PORT23, 1);
281 gpio_export(GPIO_PORT23, 0);
282
283 /* Lit DS3 LED */
284 gpio_request(GPIO_PORT24, NULL);
285 gpio_direction_output(GPIO_PORT24, 1);
286 gpio_export(GPIO_PORT24, 0);
287
288 /* SCIFA1 */
289 gpio_request(GPIO_FN_SCIFA1_TXD, NULL);
290 gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
291 gpio_request(GPIO_FN_SCIFA1_CTS, NULL);
292 gpio_request(GPIO_FN_SCIFA1_RTS, NULL);
293
294 /* USBHS */
295 gpio_request(GPIO_FN_VBUS0, NULL);
296 gpio_request(GPIO_FN_PWEN, NULL);
297 gpio_request(GPIO_FN_OVCN, NULL);
298 gpio_request(GPIO_FN_OVCN2, NULL);
299 gpio_request(GPIO_FN_EXTLP, NULL);
300 gpio_request(GPIO_FN_IDIN, NULL);
301
302 /* setup USB phy */
303 __raw_writew(0x0300, 0xe605810a); /* USBCR1 */
304 __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */
305 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */
306 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */
307
308 /* KEYSC @ CN7 */
309 gpio_request(GPIO_FN_PORT42_KEYOUT0, NULL);
310 gpio_request(GPIO_FN_PORT43_KEYOUT1, NULL);
311 gpio_request(GPIO_FN_PORT44_KEYOUT2, NULL);
312 gpio_request(GPIO_FN_PORT45_KEYOUT3, NULL);
313 gpio_request(GPIO_FN_PORT46_KEYOUT4, NULL);
314 gpio_request(GPIO_FN_PORT47_KEYOUT5, NULL);
315 gpio_request(GPIO_FN_PORT48_KEYIN0_PU, NULL);
316 gpio_request(GPIO_FN_PORT49_KEYIN1_PU, NULL);
317 gpio_request(GPIO_FN_PORT50_KEYIN2_PU, NULL);
318 gpio_request(GPIO_FN_PORT55_KEYIN3_PU, NULL);
319 gpio_request(GPIO_FN_PORT56_KEYIN4_PU, NULL);
320 gpio_request(GPIO_FN_PORT57_KEYIN5_PU, NULL);
321 gpio_request(GPIO_FN_PORT58_KEYIN6_PU, NULL);
322
323 /* FLCTL */
324 gpio_request(GPIO_FN_FCE0, NULL);
325 gpio_request(GPIO_FN_D0_ED0_NAF0, NULL);
326 gpio_request(GPIO_FN_D1_ED1_NAF1, NULL);
327 gpio_request(GPIO_FN_D2_ED2_NAF2, NULL);
328 gpio_request(GPIO_FN_D3_ED3_NAF3, NULL);
329 gpio_request(GPIO_FN_D4_ED4_NAF4, NULL);
330 gpio_request(GPIO_FN_D5_ED5_NAF5, NULL);
331 gpio_request(GPIO_FN_D6_ED6_NAF6, NULL);
332 gpio_request(GPIO_FN_D7_ED7_NAF7, NULL);
333 gpio_request(GPIO_FN_D8_ED8_NAF8, NULL);
334 gpio_request(GPIO_FN_D9_ED9_NAF9, NULL);
335 gpio_request(GPIO_FN_D10_ED10_NAF10, NULL);
336 gpio_request(GPIO_FN_D11_ED11_NAF11, NULL);
337 gpio_request(GPIO_FN_D12_ED12_NAF12, NULL);
338 gpio_request(GPIO_FN_D13_ED13_NAF13, NULL);
339 gpio_request(GPIO_FN_D14_ED14_NAF14, NULL);
340 gpio_request(GPIO_FN_D15_ED15_NAF15, NULL);
341 gpio_request(GPIO_FN_WE0_XWR0_FWE, NULL);
342 gpio_request(GPIO_FN_FRB, NULL);
343 /* FOE, FCDE, FSC on dedicated pins */
344 __raw_writel(__raw_readl(0xe6158048) & ~(1 << 15), 0xe6158048);
345
346 /* IrDA */
347 gpio_request(GPIO_FN_IRDA_OUT, NULL);
348 gpio_request(GPIO_FN_IRDA_IN, NULL);
349 gpio_request(GPIO_FN_IRDA_FIRSEL, NULL);
350 set_irq_type(evt2irq(0x480), IRQ_TYPE_LEVEL_LOW);
351
352 sh7367_add_standard_devices();
353
354 platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices));
355}
356
357static void __init g3evm_timer_init(void)
358{
359 sh7367_clock_init();
360 shmobile_timer.init();
361}
362
363static struct sys_timer g3evm_timer = {
364 .init = g3evm_timer_init,
365};
366
367MACHINE_START(G3EVM, "g3evm")
368 .map_io = g3evm_map_io,
369 .init_irq = sh7367_init_irq,
370 .handle_irq = shmobile_handle_irq_intc,
371 .init_machine = g3evm_init,
372 .timer = &g3evm_timer,
373MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
new file mode 100644
index 000000000000..c13f01280b7e
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -0,0 +1,400 @@
1/*
2 * G4EVM board support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
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#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/mtd/mtd.h>
27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
29#include <linux/usb/r8a66597.h>
30#include <linux/io.h>
31#include <linux/input.h>
32#include <linux/input/sh_keysc.h>
33#include <linux/mfd/sh_mobile_sdhi.h>
34#include <linux/gpio.h>
35#include <mach/sh7377.h>
36#include <mach/common.h>
37#include <asm/mach-types.h>
38#include <asm/mach/arch.h>
39#include <asm/mach/map.h>
40#include <asm/mach/time.h>
41
42/*
43 * SDHI
44 *
45 * SDHI0 : card detection is possible
46 * SDHI1 : card detection is impossible
47 *
48 * [G4-MAIN-BOARD]
49 * JP74 : short # DBG_2V8A for SDHI0
50 * JP75 : NC # DBG_3V3A for SDHI0
51 * JP76 : NC # DBG_3V3A_SD for SDHI0
52 * JP77 : NC # 3V3A_SDIO for SDHI1
53 * JP78 : short # DBG_2V8A for SDHI1
54 * JP79 : NC # DBG_3V3A for SDHI1
55 * JP80 : NC # DBG_3V3A_SD for SDHI1
56 *
57 * [G4-CORE-BOARD]
58 * S32 : all off # to dissever from G3-CORE_DBG board
59 * S33 : all off # to dissever from G3-CORE_DBG board
60 *
61 * [G3-CORE_DBG-BOARD]
62 * S1 : all off # to dissever from G3-CORE_DBG board
63 * S3 : all off # to dissever from G3-CORE_DBG board
64 * S4 : all off # to dissever from G3-CORE_DBG board
65 */
66
67static struct mtd_partition nor_flash_partitions[] = {
68 {
69 .name = "loader",
70 .offset = 0x00000000,
71 .size = 512 * 1024,
72 },
73 {
74 .name = "bootenv",
75 .offset = MTDPART_OFS_APPEND,
76 .size = 512 * 1024,
77 },
78 {
79 .name = "kernel_ro",
80 .offset = MTDPART_OFS_APPEND,
81 .size = 8 * 1024 * 1024,
82 .mask_flags = MTD_WRITEABLE,
83 },
84 {
85 .name = "kernel",
86 .offset = MTDPART_OFS_APPEND,
87 .size = 8 * 1024 * 1024,
88 },
89 {
90 .name = "data",
91 .offset = MTDPART_OFS_APPEND,
92 .size = MTDPART_SIZ_FULL,
93 },
94};
95
96static struct physmap_flash_data nor_flash_data = {
97 .width = 2,
98 .parts = nor_flash_partitions,
99 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
100};
101
102static struct resource nor_flash_resources[] = {
103 [0] = {
104 .start = 0x00000000,
105 .end = 0x08000000 - 1,
106 .flags = IORESOURCE_MEM,
107 }
108};
109
110static struct platform_device nor_flash_device = {
111 .name = "physmap-flash",
112 .dev = {
113 .platform_data = &nor_flash_data,
114 },
115 .num_resources = ARRAY_SIZE(nor_flash_resources),
116 .resource = nor_flash_resources,
117};
118
119/* USBHS */
120static void usb_host_port_power(int port, int power)
121{
122 if (!power) /* only power-on supported for now */
123 return;
124
125 /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
126 __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008);
127}
128
129static struct r8a66597_platdata usb_host_data = {
130 .on_chip = 1,
131 .port_power = usb_host_port_power,
132};
133
134static struct resource usb_host_resources[] = {
135 [0] = {
136 .name = "USBHS",
137 .start = 0xe6890000,
138 .end = 0xe68900e5,
139 .flags = IORESOURCE_MEM,
140 },
141 [1] = {
142 .start = evt2irq(0x0a20), /* USBHS_USHI0 */
143 .flags = IORESOURCE_IRQ,
144 },
145};
146
147static struct platform_device usb_host_device = {
148 .name = "r8a66597_hcd",
149 .id = 0,
150 .dev = {
151 .platform_data = &usb_host_data,
152 .dma_mask = NULL,
153 .coherent_dma_mask = 0xffffffff,
154 },
155 .num_resources = ARRAY_SIZE(usb_host_resources),
156 .resource = usb_host_resources,
157};
158
159/* KEYSC */
160static struct sh_keysc_info keysc_info = {
161 .mode = SH_KEYSC_MODE_5,
162 .scan_timing = 3,
163 .delay = 100,
164 .keycodes = {
165 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F,
166 KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L,
167 KEY_M, KEY_N, KEY_U, KEY_P, KEY_Q, KEY_R,
168 KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X,
169 KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP, KEY_WAKEUP, KEY_COFFEE,
170 KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5,
171 KEY_6, KEY_7, KEY_8, KEY_9, KEY_STOP, KEY_COMPUTER,
172 },
173};
174
175static struct resource keysc_resources[] = {
176 [0] = {
177 .name = "KEYSC",
178 .start = 0xe61b0000,
179 .end = 0xe61b000f,
180 .flags = IORESOURCE_MEM,
181 },
182 [1] = {
183 .start = evt2irq(0x0be0), /* KEYSC_KEY */
184 .flags = IORESOURCE_IRQ,
185 },
186};
187
188static struct platform_device keysc_device = {
189 .name = "sh_keysc",
190 .id = 0, /* keysc0 clock */
191 .num_resources = ARRAY_SIZE(keysc_resources),
192 .resource = keysc_resources,
193 .dev = {
194 .platform_data = &keysc_info,
195 },
196};
197
198/* SDHI */
199static struct resource sdhi0_resources[] = {
200 [0] = {
201 .name = "SDHI0",
202 .start = 0xe6d50000,
203 .end = 0xe6d501ff,
204 .flags = IORESOURCE_MEM,
205 },
206 [1] = {
207 .start = evt2irq(0x0e00), /* SDHI0 */
208 .flags = IORESOURCE_IRQ,
209 },
210};
211
212static struct platform_device sdhi0_device = {
213 .name = "sh_mobile_sdhi",
214 .num_resources = ARRAY_SIZE(sdhi0_resources),
215 .resource = sdhi0_resources,
216 .id = 0,
217};
218
219static struct resource sdhi1_resources[] = {
220 [0] = {
221 .name = "SDHI1",
222 .start = 0xe6d60000,
223 .end = 0xe6d601ff,
224 .flags = IORESOURCE_MEM,
225 },
226 [1] = {
227 .start = evt2irq(0x0e80), /* SDHI1 */
228 .flags = IORESOURCE_IRQ,
229 },
230};
231
232static struct platform_device sdhi1_device = {
233 .name = "sh_mobile_sdhi",
234 .num_resources = ARRAY_SIZE(sdhi1_resources),
235 .resource = sdhi1_resources,
236 .id = 1,
237};
238
239static struct platform_device *g4evm_devices[] __initdata = {
240 &nor_flash_device,
241 &usb_host_device,
242 &keysc_device,
243 &sdhi0_device,
244 &sdhi1_device,
245};
246
247static struct map_desc g4evm_io_desc[] __initdata = {
248 /* create a 1:1 entity map for 0xe6xxxxxx
249 * used by CPGA, INTC and PFC.
250 */
251 {
252 .virtual = 0xe6000000,
253 .pfn = __phys_to_pfn(0xe6000000),
254 .length = 256 << 20,
255 .type = MT_DEVICE_NONSHARED
256 },
257};
258
259static void __init g4evm_map_io(void)
260{
261 iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));
262
263 /* setup early devices and console here as well */
264 sh7377_add_early_devices();
265 shmobile_setup_console();
266}
267
268#define GPIO_SDHID0_D0 0xe60520fc
269#define GPIO_SDHID0_D1 0xe60520fd
270#define GPIO_SDHID0_D2 0xe60520fe
271#define GPIO_SDHID0_D3 0xe60520ff
272#define GPIO_SDHICMD0 0xe6052100
273
274#define GPIO_SDHID1_D0 0xe6052103
275#define GPIO_SDHID1_D1 0xe6052104
276#define GPIO_SDHID1_D2 0xe6052105
277#define GPIO_SDHID1_D3 0xe6052106
278#define GPIO_SDHICMD1 0xe6052107
279
280/*
281 * FIXME !!
282 *
283 * gpio_pull_up is quick_hack.
284 *
285 * current gpio frame work doesn't have
286 * the method to control only pull up/down/free.
287 * this function should be replaced by correct gpio function
288 */
289static void __init gpio_pull_up(u32 addr)
290{
291 u8 data = __raw_readb(addr);
292
293 data &= 0x0F;
294 data |= 0xC0;
295 __raw_writeb(data, addr);
296}
297
298static void __init g4evm_init(void)
299{
300 sh7377_pinmux_init();
301
302 /* Lit DS14 LED */
303 gpio_request(GPIO_PORT109, NULL);
304 gpio_direction_output(GPIO_PORT109, 1);
305 gpio_export(GPIO_PORT109, 1);
306
307 /* Lit DS15 LED */
308 gpio_request(GPIO_PORT110, NULL);
309 gpio_direction_output(GPIO_PORT110, 1);
310 gpio_export(GPIO_PORT110, 1);
311
312 /* Lit DS16 LED */
313 gpio_request(GPIO_PORT112, NULL);
314 gpio_direction_output(GPIO_PORT112, 1);
315 gpio_export(GPIO_PORT112, 1);
316
317 /* Lit DS17 LED */
318 gpio_request(GPIO_PORT113, NULL);
319 gpio_direction_output(GPIO_PORT113, 1);
320 gpio_export(GPIO_PORT113, 1);
321
322 /* USBHS */
323 gpio_request(GPIO_FN_VBUS_0, NULL);
324 gpio_request(GPIO_FN_PWEN, NULL);
325 gpio_request(GPIO_FN_OVCN, NULL);
326 gpio_request(GPIO_FN_OVCN2, NULL);
327 gpio_request(GPIO_FN_EXTLP, NULL);
328 gpio_request(GPIO_FN_IDIN, NULL);
329
330 /* setup USB phy */
331 __raw_writew(0x0200, 0xe605810a); /* USBCR1 */
332 __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */
333 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */
334 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */
335
336 /* KEYSC @ CN31 */
337 gpio_request(GPIO_FN_PORT60_KEYOUT5, NULL);
338 gpio_request(GPIO_FN_PORT61_KEYOUT4, NULL);
339 gpio_request(GPIO_FN_PORT62_KEYOUT3, NULL);
340 gpio_request(GPIO_FN_PORT63_KEYOUT2, NULL);
341 gpio_request(GPIO_FN_PORT64_KEYOUT1, NULL);
342 gpio_request(GPIO_FN_PORT65_KEYOUT0, NULL);
343 gpio_request(GPIO_FN_PORT66_KEYIN0_PU, NULL);
344 gpio_request(GPIO_FN_PORT67_KEYIN1_PU, NULL);
345 gpio_request(GPIO_FN_PORT68_KEYIN2_PU, NULL);
346 gpio_request(GPIO_FN_PORT69_KEYIN3_PU, NULL);
347 gpio_request(GPIO_FN_PORT70_KEYIN4_PU, NULL);
348 gpio_request(GPIO_FN_PORT71_KEYIN5_PU, NULL);
349 gpio_request(GPIO_FN_PORT72_KEYIN6_PU, NULL);
350
351 /* SDHI0 */
352 gpio_request(GPIO_FN_SDHICLK0, NULL);
353 gpio_request(GPIO_FN_SDHICD0, NULL);
354 gpio_request(GPIO_FN_SDHID0_0, NULL);
355 gpio_request(GPIO_FN_SDHID0_1, NULL);
356 gpio_request(GPIO_FN_SDHID0_2, NULL);
357 gpio_request(GPIO_FN_SDHID0_3, NULL);
358 gpio_request(GPIO_FN_SDHICMD0, NULL);
359 gpio_request(GPIO_FN_SDHIWP0, NULL);
360 gpio_pull_up(GPIO_SDHID0_D0);
361 gpio_pull_up(GPIO_SDHID0_D1);
362 gpio_pull_up(GPIO_SDHID0_D2);
363 gpio_pull_up(GPIO_SDHID0_D3);
364 gpio_pull_up(GPIO_SDHICMD0);
365
366 /* SDHI1 */
367 gpio_request(GPIO_FN_SDHICLK1, NULL);
368 gpio_request(GPIO_FN_SDHID1_0, NULL);
369 gpio_request(GPIO_FN_SDHID1_1, NULL);
370 gpio_request(GPIO_FN_SDHID1_2, NULL);
371 gpio_request(GPIO_FN_SDHID1_3, NULL);
372 gpio_request(GPIO_FN_SDHICMD1, NULL);
373 gpio_pull_up(GPIO_SDHID1_D0);
374 gpio_pull_up(GPIO_SDHID1_D1);
375 gpio_pull_up(GPIO_SDHID1_D2);
376 gpio_pull_up(GPIO_SDHID1_D3);
377 gpio_pull_up(GPIO_SDHICMD1);
378
379 sh7377_add_standard_devices();
380
381 platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices));
382}
383
384static void __init g4evm_timer_init(void)
385{
386 sh7377_clock_init();
387 shmobile_timer.init();
388}
389
390static struct sys_timer g4evm_timer = {
391 .init = g4evm_timer_init,
392};
393
394MACHINE_START(G4EVM, "g4evm")
395 .map_io = g4evm_map_io,
396 .init_irq = sh7377_init_irq,
397 .handle_irq = shmobile_handle_irq_intc,
398 .init_machine = g4evm_init,
399 .timer = &g4evm_timer,
400MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
new file mode 100644
index 000000000000..5bcf5c1e1399
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -0,0 +1,1200 @@
1/*
2 * mackerel board support
3 *
4 * Copyright (C) 2010 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * based on ap4evb
8 * Copyright (C) 2010 Magnus Damm
9 * Copyright (C) 2008 Yoshihiro Shimoda
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; version 2 of the License.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24#include <linux/delay.h>
25#include <linux/kernel.h>
26#include <linux/init.h>
27#include <linux/interrupt.h>
28#include <linux/irq.h>
29#include <linux/platform_device.h>
30#include <linux/gpio.h>
31#include <linux/input.h>
32#include <linux/io.h>
33#include <linux/i2c.h>
34#include <linux/leds.h>
35#include <linux/mfd/sh_mobile_sdhi.h>
36#include <linux/mfd/tmio.h>
37#include <linux/mmc/host.h>
38#include <linux/mmc/sh_mmcif.h>
39#include <linux/mtd/mtd.h>
40#include <linux/mtd/partitions.h>
41#include <linux/mtd/physmap.h>
42#include <linux/smsc911x.h>
43#include <linux/sh_intc.h>
44#include <linux/tca6416_keypad.h>
45#include <linux/usb/r8a66597.h>
46
47#include <video/sh_mobile_hdmi.h>
48#include <video/sh_mobile_lcdc.h>
49#include <media/sh_mobile_ceu.h>
50#include <media/soc_camera.h>
51#include <media/soc_camera_platform.h>
52#include <sound/sh_fsi.h>
53
54#include <mach/common.h>
55#include <mach/sh7372.h>
56
57#include <asm/mach/arch.h>
58#include <asm/mach/time.h>
59#include <asm/mach/map.h>
60#include <asm/mach-types.h>
61
62/*
63 * Address Interface BusWidth note
64 * ------------------------------------------------------------------
65 * 0x0000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = ON
66 * 0x0800_0000 user area -
67 * 0x1000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = OFF
68 * 0x1400_0000 Ether (LAN9220) 16bit
69 * 0x1600_0000 user area - cannot use with NAND
70 * 0x1800_0000 user area -
71 * 0x1A00_0000 -
72 * 0x4000_0000 LPDDR2-SDRAM (POP) 32bit
73 */
74
75/*
76 * CPU mode
77 *
78 * SW4 | Boot Area| Master | Remarks
79 * 1 | 2 | 3 | 4 | 5 | 6 | 8 | | Processor|
80 * ----+-----+-----+-----+-----+-----+-----+----------+----------+--------------
81 * ON | ON | OFF | ON | ON | OFF | OFF | External | System | External ROM
82 * ON | ON | ON | ON | ON | OFF | OFF | External | System | ROM Debug
83 * ON | ON | X | ON | OFF | OFF | OFF | Built-in | System | ROM Debug
84 * X | OFF | X | X | X | X | OFF | Built-in | System | MaskROM
85 * OFF | X | X | X | X | X | OFF | Built-in | System | MaskROM
86 * X | X | X | OFF | X | X | OFF | Built-in | System | MaskROM
87 * OFF | ON | OFF | X | X | OFF | ON | External | System | Standalone
88 * ON | OFF | OFF | X | X | OFF | ON | External | Realtime | Standalone
89*/
90
91/*
92 * NOR Flash ROM
93 *
94 * SW1 | SW2 | SW7 | NOR Flash ROM
95 * bit1 | bit1 bit2 | bit1 | Memory allocation
96 * ------+------------+------+------------------
97 * OFF | ON OFF | ON | Area 0
98 * OFF | ON OFF | OFF | Area 4
99 */
100
101/*
102 * SMSC 9220
103 *
104 * SW1 SMSC 9220
105 * -----------------------
106 * ON access disable
107 * OFF access enable
108 */
109
110/*
111 * NAND Flash ROM
112 *
113 * SW1 | SW2 | SW7 | NAND Flash ROM
114 * bit1 | bit1 bit2 | bit2 | Memory allocation
115 * ------+------------+------+------------------
116 * OFF | ON OFF | ON | FCE 0
117 * OFF | ON OFF | OFF | FCE 1
118 */
119
120/*
121 * External interrupt pin settings
122 *
123 * IRQX | pin setting | device | level
124 * ------+--------------------+--------------------+-------
125 * IRQ0 | ICR1A.IRQ0SA=0010 | SDHI2 card detect | Low
126 * IRQ6 | ICR1A.IRQ6SA=0011 | Ether(LAN9220) | High
127 * IRQ7 | ICR1A.IRQ7SA=0010 | LCD Tuch Panel | Low
128 * IRQ8 | ICR2A.IRQ8SA=0010 | MMC/SD card detect | Low
129 * IRQ9 | ICR2A.IRQ9SA=0010 | KEY(TCA6408) | Low
130 * IRQ21 | ICR4A.IRQ21SA=0011 | Sensor(ADXL345) | High
131 * IRQ22 | ICR4A.IRQ22SA=0011 | Sensor(AK8975) | High
132 */
133
134/*
135 * USB
136 *
137 * USB0 : CN22 : Function
138 * USB1 : CN31 : Function/Host *1
139 *
140 * J30 (for CN31) *1
141 * ----------+---------------+-------------
142 * 1-2 short | VBUS 5V | Host
143 * open | external VBUS | Function
144 *
145 * *1
146 * CN31 is used as Host in Linux.
147 */
148
149/*
150 * SDHI0 (CN12)
151 *
152 * SW56 : OFF
153 *
154 */
155
156/* MMC /SDHI1 (CN7)
157 *
158 * I/O voltage : 1.8v
159 *
160 * Power voltage : 1.8v or 3.3v
161 * J22 : select power voltage *1
162 * 1-2 pin : 1.8v
163 * 2-3 pin : 3.3v
164 *
165 * *1
166 * Please change J22 depends the card to be used.
167 * MMC's OCR field set to support either voltage for the card inserted.
168 *
169 * SW1 | SW33
170 * | bit1 | bit2 | bit3 | bit4
171 * -------------+------+------+------+-------
172 * MMC0 OFF | OFF | ON | ON | X
173 * MMC1 ON | OFF | ON | X | ON
174 * SDHI1 OFF | ON | X | OFF | ON
175 *
176 */
177
178/*
179 * SDHI2 (CN23)
180 *
181 * microSD card sloct
182 *
183 */
184
185/*
186 * FIXME !!
187 *
188 * gpio_no_direction
189 * are quick_hack.
190 *
191 * current gpio frame work doesn't have
192 * the method to control only pull up/down/free.
193 * this function should be replaced by correct gpio function
194 */
195static void __init gpio_no_direction(u32 addr)
196{
197 __raw_writeb(0x00, addr);
198}
199
200/* MTD */
201static struct mtd_partition nor_flash_partitions[] = {
202 {
203 .name = "loader",
204 .offset = 0x00000000,
205 .size = 512 * 1024,
206 .mask_flags = MTD_WRITEABLE,
207 },
208 {
209 .name = "bootenv",
210 .offset = MTDPART_OFS_APPEND,
211 .size = 512 * 1024,
212 .mask_flags = MTD_WRITEABLE,
213 },
214 {
215 .name = "kernel_ro",
216 .offset = MTDPART_OFS_APPEND,
217 .size = 8 * 1024 * 1024,
218 .mask_flags = MTD_WRITEABLE,
219 },
220 {
221 .name = "kernel",
222 .offset = MTDPART_OFS_APPEND,
223 .size = 8 * 1024 * 1024,
224 },
225 {
226 .name = "data",
227 .offset = MTDPART_OFS_APPEND,
228 .size = MTDPART_SIZ_FULL,
229 },
230};
231
232static struct physmap_flash_data nor_flash_data = {
233 .width = 2,
234 .parts = nor_flash_partitions,
235 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
236};
237
238static struct resource nor_flash_resources[] = {
239 [0] = {
240 .start = 0x00000000,
241 .end = 0x08000000 - 1,
242 .flags = IORESOURCE_MEM,
243 }
244};
245
246static struct platform_device nor_flash_device = {
247 .name = "physmap-flash",
248 .dev = {
249 .platform_data = &nor_flash_data,
250 },
251 .num_resources = ARRAY_SIZE(nor_flash_resources),
252 .resource = nor_flash_resources,
253};
254
255/* SMSC */
256static struct resource smc911x_resources[] = {
257 {
258 .start = 0x14000000,
259 .end = 0x16000000 - 1,
260 .flags = IORESOURCE_MEM,
261 }, {
262 .start = evt2irq(0x02c0) /* IRQ6A */,
263 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
264 },
265};
266
267static struct smsc911x_platform_config smsc911x_info = {
268 .flags = SMSC911X_USE_16BIT | SMSC911X_SAVE_MAC_ADDRESS,
269 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
270 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
271};
272
273static struct platform_device smc911x_device = {
274 .name = "smsc911x",
275 .id = -1,
276 .num_resources = ARRAY_SIZE(smc911x_resources),
277 .resource = smc911x_resources,
278 .dev = {
279 .platform_data = &smsc911x_info,
280 },
281};
282
283/* LCDC */
284static struct fb_videomode mackerel_lcdc_modes[] = {
285 {
286 .name = "WVGA Panel",
287 .xres = 800,
288 .yres = 480,
289 .left_margin = 220,
290 .right_margin = 110,
291 .hsync_len = 70,
292 .upper_margin = 20,
293 .lower_margin = 5,
294 .vsync_len = 5,
295 .sync = 0,
296 },
297};
298
299static struct sh_mobile_lcdc_info lcdc_info = {
300 .clock_source = LCDC_CLK_BUS,
301 .ch[0] = {
302 .chan = LCDC_CHAN_MAINLCD,
303 .bpp = 16,
304 .lcd_cfg = mackerel_lcdc_modes,
305 .num_cfg = ARRAY_SIZE(mackerel_lcdc_modes),
306 .interface_type = RGB24,
307 .clock_divider = 2,
308 .flags = 0,
309 .lcd_size_cfg.width = 152,
310 .lcd_size_cfg.height = 91,
311 }
312};
313
314static struct resource lcdc_resources[] = {
315 [0] = {
316 .name = "LCDC",
317 .start = 0xfe940000,
318 .end = 0xfe943fff,
319 .flags = IORESOURCE_MEM,
320 },
321 [1] = {
322 .start = intcs_evt2irq(0x580),
323 .flags = IORESOURCE_IRQ,
324 },
325};
326
327static struct platform_device lcdc_device = {
328 .name = "sh_mobile_lcdc_fb",
329 .num_resources = ARRAY_SIZE(lcdc_resources),
330 .resource = lcdc_resources,
331 .dev = {
332 .platform_data = &lcdc_info,
333 .coherent_dma_mask = ~0,
334 },
335};
336
337/* HDMI */
338static struct sh_mobile_lcdc_info hdmi_lcdc_info = {
339 .clock_source = LCDC_CLK_EXTERNAL,
340 .ch[0] = {
341 .chan = LCDC_CHAN_MAINLCD,
342 .bpp = 16,
343 .interface_type = RGB24,
344 .clock_divider = 1,
345 .flags = LCDC_FLAGS_DWPOL,
346 }
347};
348
349static struct resource hdmi_lcdc_resources[] = {
350 [0] = {
351 .name = "LCDC1",
352 .start = 0xfe944000,
353 .end = 0xfe947fff,
354 .flags = IORESOURCE_MEM,
355 },
356 [1] = {
357 .start = intcs_evt2irq(0x1780),
358 .flags = IORESOURCE_IRQ,
359 },
360};
361
362static struct platform_device hdmi_lcdc_device = {
363 .name = "sh_mobile_lcdc_fb",
364 .num_resources = ARRAY_SIZE(hdmi_lcdc_resources),
365 .resource = hdmi_lcdc_resources,
366 .id = 1,
367 .dev = {
368 .platform_data = &hdmi_lcdc_info,
369 .coherent_dma_mask = ~0,
370 },
371};
372
373static struct sh_mobile_hdmi_info hdmi_info = {
374 .lcd_chan = &hdmi_lcdc_info.ch[0],
375 .lcd_dev = &hdmi_lcdc_device.dev,
376 .flags = HDMI_SND_SRC_SPDIF,
377};
378
379static struct resource hdmi_resources[] = {
380 [0] = {
381 .name = "HDMI",
382 .start = 0xe6be0000,
383 .end = 0xe6be00ff,
384 .flags = IORESOURCE_MEM,
385 },
386 [1] = {
387 /* There's also an HDMI interrupt on INTCS @ 0x18e0 */
388 .start = evt2irq(0x17e0),
389 .flags = IORESOURCE_IRQ,
390 },
391};
392
393static struct platform_device hdmi_device = {
394 .name = "sh-mobile-hdmi",
395 .num_resources = ARRAY_SIZE(hdmi_resources),
396 .resource = hdmi_resources,
397 .id = -1,
398 .dev = {
399 .platform_data = &hdmi_info,
400 },
401};
402
403static int __init hdmi_init_pm_clock(void)
404{
405 struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
406 int ret;
407 long rate;
408
409 if (IS_ERR(hdmi_ick)) {
410 ret = PTR_ERR(hdmi_ick);
411 pr_err("Cannot get HDMI ICK: %d\n", ret);
412 goto out;
413 }
414
415 ret = clk_set_parent(&sh7372_pllc2_clk, &sh7372_dv_clki_div2_clk);
416 if (ret < 0) {
417 pr_err("Cannot set PLLC2 parent: %d, %d users\n",
418 ret, sh7372_pllc2_clk.usecount);
419 goto out;
420 }
421
422 pr_debug("PLLC2 initial frequency %lu\n",
423 clk_get_rate(&sh7372_pllc2_clk));
424
425 rate = clk_round_rate(&sh7372_pllc2_clk, 594000000);
426 if (rate < 0) {
427 pr_err("Cannot get suitable rate: %ld\n", rate);
428 ret = rate;
429 goto out;
430 }
431
432 ret = clk_set_rate(&sh7372_pllc2_clk, rate);
433 if (ret < 0) {
434 pr_err("Cannot set rate %ld: %d\n", rate, ret);
435 goto out;
436 }
437
438 ret = clk_enable(&sh7372_pllc2_clk);
439 if (ret < 0) {
440 pr_err("Cannot enable pllc2 clock\n");
441 goto out;
442 }
443
444 pr_debug("PLLC2 set frequency %lu\n", rate);
445
446 ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
447 if (ret < 0) {
448 pr_err("Cannot set HDMI parent: %d\n", ret);
449 goto out;
450 }
451
452out:
453 if (!IS_ERR(hdmi_ick))
454 clk_put(hdmi_ick);
455 return ret;
456}
457device_initcall(hdmi_init_pm_clock);
458
459/* USB1 (Host) */
460static void usb1_host_port_power(int port, int power)
461{
462 if (!power) /* only power-on is supported for now */
463 return;
464
465 /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
466 __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
467}
468
469static struct r8a66597_platdata usb1_host_data = {
470 .on_chip = 1,
471 .port_power = usb1_host_port_power,
472};
473
474static struct resource usb1_host_resources[] = {
475 [0] = {
476 .name = "USBHS",
477 .start = 0xE68B0000,
478 .end = 0xE68B00E6 - 1,
479 .flags = IORESOURCE_MEM,
480 },
481 [1] = {
482 .start = evt2irq(0x1ce0) /* USB1_USB1I0 */,
483 .flags = IORESOURCE_IRQ,
484 },
485};
486
487static struct platform_device usb1_host_device = {
488 .name = "r8a66597_hcd",
489 .id = 1,
490 .dev = {
491 .dma_mask = NULL, /* not use dma */
492 .coherent_dma_mask = 0xffffffff,
493 .platform_data = &usb1_host_data,
494 },
495 .num_resources = ARRAY_SIZE(usb1_host_resources),
496 .resource = usb1_host_resources,
497};
498
499/* LED */
500static struct gpio_led mackerel_leds[] = {
501 {
502 .name = "led0",
503 .gpio = GPIO_PORT0,
504 .default_state = LEDS_GPIO_DEFSTATE_ON,
505 },
506 {
507 .name = "led1",
508 .gpio = GPIO_PORT1,
509 .default_state = LEDS_GPIO_DEFSTATE_ON,
510 },
511 {
512 .name = "led2",
513 .gpio = GPIO_PORT2,
514 .default_state = LEDS_GPIO_DEFSTATE_ON,
515 },
516 {
517 .name = "led3",
518 .gpio = GPIO_PORT159,
519 .default_state = LEDS_GPIO_DEFSTATE_ON,
520 }
521};
522
523static struct gpio_led_platform_data mackerel_leds_pdata = {
524 .leds = mackerel_leds,
525 .num_leds = ARRAY_SIZE(mackerel_leds),
526};
527
528static struct platform_device leds_device = {
529 .name = "leds-gpio",
530 .id = 0,
531 .dev = {
532 .platform_data = &mackerel_leds_pdata,
533 },
534};
535
536/* FSI */
537#define IRQ_FSI evt2irq(0x1840)
538static int __fsi_set_round_rate(struct clk *clk, long rate, int enable)
539{
540 int ret;
541
542 if (rate <= 0)
543 return 0;
544
545 if (!enable) {
546 clk_disable(clk);
547 return 0;
548 }
549
550 ret = clk_set_rate(clk, clk_round_rate(clk, rate));
551 if (ret < 0)
552 return ret;
553
554 return clk_enable(clk);
555}
556
557static int fsi_set_rate(struct device *dev, int is_porta, int rate, int enable)
558{
559 struct clk *fsib_clk;
560 struct clk *fdiv_clk = &sh7372_fsidivb_clk;
561 long fsib_rate = 0;
562 long fdiv_rate = 0;
563 int ackmd_bpfmd;
564 int ret;
565
566 /* FSIA is slave mode. nothing to do here */
567 if (is_porta)
568 return 0;
569
570 /* clock start */
571 switch (rate) {
572 case 44100:
573 fsib_rate = rate * 256;
574 ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
575 break;
576 case 48000:
577 fsib_rate = 85428000; /* around 48kHz x 256 x 7 */
578 fdiv_rate = rate * 256;
579 ackmd_bpfmd = SH_FSI_ACKMD_256 | SH_FSI_BPFMD_64;
580 break;
581 default:
582 pr_err("unsupported rate in FSI2 port B\n");
583 return -EINVAL;
584 }
585
586 /* FSI B setting */
587 fsib_clk = clk_get(dev, "ickb");
588 if (IS_ERR(fsib_clk))
589 return -EIO;
590
591 /* fsib */
592 ret = __fsi_set_round_rate(fsib_clk, fsib_rate, enable);
593 if (ret < 0)
594 goto fsi_set_rate_end;
595
596 /* FSI DIV */
597 ret = __fsi_set_round_rate(fdiv_clk, fdiv_rate, enable);
598 if (ret < 0) {
599 /* disable FSI B */
600 if (enable)
601 __fsi_set_round_rate(fsib_clk, fsib_rate, 0);
602 goto fsi_set_rate_end;
603 }
604
605 ret = ackmd_bpfmd;
606
607fsi_set_rate_end:
608 clk_put(fsib_clk);
609 return ret;
610}
611
612static struct sh_fsi_platform_info fsi_info = {
613 .porta_flags = SH_FSI_BRS_INV |
614 SH_FSI_OUT_SLAVE_MODE |
615 SH_FSI_IN_SLAVE_MODE |
616 SH_FSI_OFMT(PCM) |
617 SH_FSI_IFMT(PCM),
618
619 .portb_flags = SH_FSI_BRS_INV |
620 SH_FSI_BRM_INV |
621 SH_FSI_LRS_INV |
622 SH_FSI_OFMT(SPDIF),
623
624 .set_rate = fsi_set_rate,
625};
626
627static struct resource fsi_resources[] = {
628 [0] = {
629 .name = "FSI",
630 .start = 0xFE3C0000,
631 .end = 0xFE3C0400 - 1,
632 .flags = IORESOURCE_MEM,
633 },
634 [1] = {
635 .start = IRQ_FSI,
636 .flags = IORESOURCE_IRQ,
637 },
638};
639
640static struct platform_device fsi_device = {
641 .name = "sh_fsi2",
642 .id = -1,
643 .num_resources = ARRAY_SIZE(fsi_resources),
644 .resource = fsi_resources,
645 .dev = {
646 .platform_data = &fsi_info,
647 },
648};
649
650static struct platform_device fsi_ak4643_device = {
651 .name = "sh_fsi2_a_ak4643",
652};
653
654/*
655 * The card detect pin of the top SD/MMC slot (CN7) is active low and is
656 * connected to GPIO A22 of SH7372 (GPIO_PORT41).
657 */
658static int slot_cn7_get_cd(struct platform_device *pdev)
659{
660 if (gpio_is_valid(GPIO_PORT41))
661 return !gpio_get_value(GPIO_PORT41);
662 else
663 return -ENXIO;
664}
665
666/* SDHI0 */
667static struct sh_mobile_sdhi_info sdhi0_info = {
668 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
669 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
670 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
671};
672
673static struct resource sdhi0_resources[] = {
674 [0] = {
675 .name = "SDHI0",
676 .start = 0xe6850000,
677 .end = 0xe68501ff,
678 .flags = IORESOURCE_MEM,
679 },
680 [1] = {
681 .start = evt2irq(0x0e00) /* SDHI0 */,
682 .flags = IORESOURCE_IRQ,
683 },
684};
685
686static struct platform_device sdhi0_device = {
687 .name = "sh_mobile_sdhi",
688 .num_resources = ARRAY_SIZE(sdhi0_resources),
689 .resource = sdhi0_resources,
690 .id = 0,
691 .dev = {
692 .platform_data = &sdhi0_info,
693 },
694};
695
696#if !defined(CONFIG_MMC_SH_MMCIF)
697/* SDHI1 */
698static struct sh_mobile_sdhi_info sdhi1_info = {
699 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
700 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
701 .tmio_ocr_mask = MMC_VDD_165_195,
702 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
703 .tmio_caps = MMC_CAP_SD_HIGHSPEED |
704 MMC_CAP_NEEDS_POLL,
705 .get_cd = slot_cn7_get_cd,
706};
707
708static struct resource sdhi1_resources[] = {
709 [0] = {
710 .name = "SDHI1",
711 .start = 0xe6860000,
712 .end = 0xe68601ff,
713 .flags = IORESOURCE_MEM,
714 },
715 [1] = {
716 .start = evt2irq(0x0e80),
717 .flags = IORESOURCE_IRQ,
718 },
719};
720
721static struct platform_device sdhi1_device = {
722 .name = "sh_mobile_sdhi",
723 .num_resources = ARRAY_SIZE(sdhi1_resources),
724 .resource = sdhi1_resources,
725 .id = 1,
726 .dev = {
727 .platform_data = &sdhi1_info,
728 },
729};
730#endif
731
732/* SDHI2 */
733static struct sh_mobile_sdhi_info sdhi2_info = {
734 .dma_slave_tx = SHDMA_SLAVE_SDHI2_TX,
735 .dma_slave_rx = SHDMA_SLAVE_SDHI2_RX,
736 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
737 .tmio_caps = MMC_CAP_SD_HIGHSPEED |
738 MMC_CAP_NEEDS_POLL,
739};
740
741static struct resource sdhi2_resources[] = {
742 [0] = {
743 .name = "SDHI2",
744 .start = 0xe6870000,
745 .end = 0xe68701ff,
746 .flags = IORESOURCE_MEM,
747 },
748 [1] = {
749 .start = evt2irq(0x1200),
750 .flags = IORESOURCE_IRQ,
751 },
752};
753
754static struct platform_device sdhi2_device = {
755 .name = "sh_mobile_sdhi",
756 .num_resources = ARRAY_SIZE(sdhi2_resources),
757 .resource = sdhi2_resources,
758 .id = 2,
759 .dev = {
760 .platform_data = &sdhi2_info,
761 },
762};
763
764/* SH_MMCIF */
765static struct resource sh_mmcif_resources[] = {
766 [0] = {
767 .name = "MMCIF",
768 .start = 0xE6BD0000,
769 .end = 0xE6BD00FF,
770 .flags = IORESOURCE_MEM,
771 },
772 [1] = {
773 /* MMC ERR */
774 .start = evt2irq(0x1ac0),
775 .flags = IORESOURCE_IRQ,
776 },
777 [2] = {
778 /* MMC NOR */
779 .start = evt2irq(0x1ae0),
780 .flags = IORESOURCE_IRQ,
781 },
782};
783
784static struct sh_mmcif_plat_data sh_mmcif_plat = {
785 .sup_pclk = 0,
786 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
787 .caps = MMC_CAP_4_BIT_DATA |
788 MMC_CAP_8_BIT_DATA |
789 MMC_CAP_NEEDS_POLL,
790 .get_cd = slot_cn7_get_cd,
791};
792
793static struct platform_device sh_mmcif_device = {
794 .name = "sh_mmcif",
795 .id = 0,
796 .dev = {
797 .dma_mask = NULL,
798 .coherent_dma_mask = 0xffffffff,
799 .platform_data = &sh_mmcif_plat,
800 },
801 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
802 .resource = sh_mmcif_resources,
803};
804
805
806static int mackerel_camera_add(struct soc_camera_link *icl, struct device *dev);
807static void mackerel_camera_del(struct soc_camera_link *icl);
808
809static int camera_set_capture(struct soc_camera_platform_info *info,
810 int enable)
811{
812 return 0; /* camera sensor always enabled */
813}
814
815static struct soc_camera_platform_info camera_info = {
816 .format_name = "UYVY",
817 .format_depth = 16,
818 .format = {
819 .code = V4L2_MBUS_FMT_UYVY8_2X8,
820 .colorspace = V4L2_COLORSPACE_SMPTE170M,
821 .field = V4L2_FIELD_NONE,
822 .width = 640,
823 .height = 480,
824 },
825 .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
826 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8 |
827 SOCAM_DATA_ACTIVE_HIGH,
828 .set_capture = camera_set_capture,
829};
830
831static struct soc_camera_link camera_link = {
832 .bus_id = 0,
833 .add_device = mackerel_camera_add,
834 .del_device = mackerel_camera_del,
835 .module_name = "soc_camera_platform",
836 .priv = &camera_info,
837};
838
839static void dummy_release(struct device *dev)
840{
841}
842
843static struct platform_device camera_device = {
844 .name = "soc_camera_platform",
845 .dev = {
846 .platform_data = &camera_info,
847 .release = dummy_release,
848 },
849};
850
851static int mackerel_camera_add(struct soc_camera_link *icl,
852 struct device *dev)
853{
854 if (icl != &camera_link)
855 return -ENODEV;
856
857 camera_info.dev = dev;
858
859 return platform_device_register(&camera_device);
860}
861
862static void mackerel_camera_del(struct soc_camera_link *icl)
863{
864 if (icl != &camera_link)
865 return;
866
867 platform_device_unregister(&camera_device);
868 memset(&camera_device.dev.kobj, 0,
869 sizeof(camera_device.dev.kobj));
870}
871
872static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
873 .flags = SH_CEU_FLAG_USE_8BIT_BUS,
874};
875
876static struct resource ceu_resources[] = {
877 [0] = {
878 .name = "CEU",
879 .start = 0xfe910000,
880 .end = 0xfe91009f,
881 .flags = IORESOURCE_MEM,
882 },
883 [1] = {
884 .start = intcs_evt2irq(0x880),
885 .flags = IORESOURCE_IRQ,
886 },
887 [2] = {
888 /* place holder for contiguous memory */
889 },
890};
891
892static struct platform_device ceu_device = {
893 .name = "sh_mobile_ceu",
894 .id = 0, /* "ceu0" clock */
895 .num_resources = ARRAY_SIZE(ceu_resources),
896 .resource = ceu_resources,
897 .dev = {
898 .platform_data = &sh_mobile_ceu_info,
899 },
900};
901
902static struct platform_device mackerel_camera = {
903 .name = "soc-camera-pdrv",
904 .id = 0,
905 .dev = {
906 .platform_data = &camera_link,
907 },
908};
909
910static struct platform_device *mackerel_devices[] __initdata = {
911 &nor_flash_device,
912 &smc911x_device,
913 &lcdc_device,
914 &usb1_host_device,
915 &leds_device,
916 &fsi_device,
917 &fsi_ak4643_device,
918 &sdhi0_device,
919#if !defined(CONFIG_MMC_SH_MMCIF)
920 &sdhi1_device,
921#endif
922 &sdhi2_device,
923 &sh_mmcif_device,
924 &ceu_device,
925 &mackerel_camera,
926 &hdmi_lcdc_device,
927 &hdmi_device,
928};
929
930/* Keypad Initialization */
931#define KEYPAD_BUTTON(ev_type, ev_code, act_low) \
932{ \
933 .type = ev_type, \
934 .code = ev_code, \
935 .active_low = act_low, \
936}
937
938#define KEYPAD_BUTTON_LOW(event_code) KEYPAD_BUTTON(EV_KEY, event_code, 1)
939
940static struct tca6416_button mackerel_gpio_keys[] = {
941 KEYPAD_BUTTON_LOW(KEY_HOME),
942 KEYPAD_BUTTON_LOW(KEY_MENU),
943 KEYPAD_BUTTON_LOW(KEY_BACK),
944 KEYPAD_BUTTON_LOW(KEY_POWER),
945};
946
947static struct tca6416_keys_platform_data mackerel_tca6416_keys_info = {
948 .buttons = mackerel_gpio_keys,
949 .nbuttons = ARRAY_SIZE(mackerel_gpio_keys),
950 .rep = 1,
951 .use_polling = 0,
952 .pinmask = 0x000F,
953};
954
955/* I2C */
956#define IRQ9 evt2irq(0x0320)
957
958static struct i2c_board_info i2c0_devices[] = {
959 {
960 I2C_BOARD_INFO("ak4643", 0x13),
961 },
962 /* Keypad */
963 {
964 I2C_BOARD_INFO("tca6408-keys", 0x20),
965 .platform_data = &mackerel_tca6416_keys_info,
966 .irq = IRQ9,
967 },
968};
969
970#define IRQ21 evt2irq(0x32a0)
971
972static struct i2c_board_info i2c1_devices[] = {
973 /* Accelerometer */
974 {
975 I2C_BOARD_INFO("adxl34x", 0x53),
976 .irq = IRQ21,
977 },
978};
979
980static struct map_desc mackerel_io_desc[] __initdata = {
981 /* create a 1:1 entity map for 0xe6xxxxxx
982 * used by CPGA, INTC and PFC.
983 */
984 {
985 .virtual = 0xe6000000,
986 .pfn = __phys_to_pfn(0xe6000000),
987 .length = 256 << 20,
988 .type = MT_DEVICE_NONSHARED
989 },
990};
991
992static void __init mackerel_map_io(void)
993{
994 iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc));
995
996 /* setup early devices and console here as well */
997 sh7372_add_early_devices();
998 shmobile_setup_console();
999}
1000
1001#define GPIO_PORT9CR 0xE6051009
1002#define GPIO_PORT10CR 0xE605100A
1003#define SRCR4 0xe61580bc
1004#define USCCR1 0xE6058144
1005static void __init mackerel_init(void)
1006{
1007 u32 srcr4;
1008 struct clk *clk;
1009
1010 sh7372_pinmux_init();
1011
1012 /* enable SCIFA0 */
1013 gpio_request(GPIO_FN_SCIFA0_TXD, NULL);
1014 gpio_request(GPIO_FN_SCIFA0_RXD, NULL);
1015
1016 /* enable SMSC911X */
1017 gpio_request(GPIO_FN_CS5A, NULL);
1018 gpio_request(GPIO_FN_IRQ6_39, NULL);
1019
1020 /* LCDC */
1021 gpio_request(GPIO_FN_LCDD23, NULL);
1022 gpio_request(GPIO_FN_LCDD22, NULL);
1023 gpio_request(GPIO_FN_LCDD21, NULL);
1024 gpio_request(GPIO_FN_LCDD20, NULL);
1025 gpio_request(GPIO_FN_LCDD19, NULL);
1026 gpio_request(GPIO_FN_LCDD18, NULL);
1027 gpio_request(GPIO_FN_LCDD17, NULL);
1028 gpio_request(GPIO_FN_LCDD16, NULL);
1029 gpio_request(GPIO_FN_LCDD15, NULL);
1030 gpio_request(GPIO_FN_LCDD14, NULL);
1031 gpio_request(GPIO_FN_LCDD13, NULL);
1032 gpio_request(GPIO_FN_LCDD12, NULL);
1033 gpio_request(GPIO_FN_LCDD11, NULL);
1034 gpio_request(GPIO_FN_LCDD10, NULL);
1035 gpio_request(GPIO_FN_LCDD9, NULL);
1036 gpio_request(GPIO_FN_LCDD8, NULL);
1037 gpio_request(GPIO_FN_LCDD7, NULL);
1038 gpio_request(GPIO_FN_LCDD6, NULL);
1039 gpio_request(GPIO_FN_LCDD5, NULL);
1040 gpio_request(GPIO_FN_LCDD4, NULL);
1041 gpio_request(GPIO_FN_LCDD3, NULL);
1042 gpio_request(GPIO_FN_LCDD2, NULL);
1043 gpio_request(GPIO_FN_LCDD1, NULL);
1044 gpio_request(GPIO_FN_LCDD0, NULL);
1045 gpio_request(GPIO_FN_LCDDISP, NULL);
1046 gpio_request(GPIO_FN_LCDDCK, NULL);
1047
1048 gpio_request(GPIO_PORT31, NULL); /* backlight */
1049 gpio_direction_output(GPIO_PORT31, 1);
1050
1051 gpio_request(GPIO_PORT151, NULL); /* LCDDON */
1052 gpio_direction_output(GPIO_PORT151, 1);
1053
1054 /* USB enable */
1055 gpio_request(GPIO_FN_VBUS0_1, NULL);
1056 gpio_request(GPIO_FN_IDIN_1_18, NULL);
1057 gpio_request(GPIO_FN_PWEN_1_115, NULL);
1058 gpio_request(GPIO_FN_OVCN_1_114, NULL);
1059 gpio_request(GPIO_FN_EXTLP_1, NULL);
1060 gpio_request(GPIO_FN_OVCN2_1, NULL);
1061
1062 /* setup USB phy */
1063 __raw_writew(0x8a0a, 0xE6058130); /* USBCR4 */
1064
1065 /* enable FSI2 port A (ak4643) */
1066 gpio_request(GPIO_FN_FSIAIBT, NULL);
1067 gpio_request(GPIO_FN_FSIAILR, NULL);
1068 gpio_request(GPIO_FN_FSIAISLD, NULL);
1069 gpio_request(GPIO_FN_FSIAOSLD, NULL);
1070 gpio_request(GPIO_PORT161, NULL);
1071 gpio_direction_output(GPIO_PORT161, 0); /* slave */
1072
1073 gpio_request(GPIO_PORT9, NULL);
1074 gpio_request(GPIO_PORT10, NULL);
1075 gpio_no_direction(GPIO_PORT9CR); /* FSIAOBT needs no direction */
1076 gpio_no_direction(GPIO_PORT10CR); /* FSIAOLR needs no direction */
1077
1078 intc_set_priority(IRQ_FSI, 3); /* irq priority FSI(3) > SMSC911X(2) */
1079
1080 /* setup FSI2 port B (HDMI) */
1081 gpio_request(GPIO_FN_FSIBCK, NULL);
1082 __raw_writew(__raw_readw(USCCR1) & ~(1 << 6), USCCR1); /* use SPDIF */
1083
1084 /* set SPU2 clock to 119.6 MHz */
1085 clk = clk_get(NULL, "spu_clk");
1086 if (!IS_ERR(clk)) {
1087 clk_set_rate(clk, clk_round_rate(clk, 119600000));
1088 clk_put(clk);
1089 }
1090
1091 /* enable Keypad */
1092 gpio_request(GPIO_FN_IRQ9_42, NULL);
1093 set_irq_type(IRQ9, IRQ_TYPE_LEVEL_HIGH);
1094
1095 /* enable Accelerometer */
1096 gpio_request(GPIO_FN_IRQ21, NULL);
1097 set_irq_type(IRQ21, IRQ_TYPE_LEVEL_HIGH);
1098
1099 /* enable SDHI0 */
1100 gpio_request(GPIO_FN_SDHICD0, NULL);
1101 gpio_request(GPIO_FN_SDHIWP0, NULL);
1102 gpio_request(GPIO_FN_SDHICMD0, NULL);
1103 gpio_request(GPIO_FN_SDHICLK0, NULL);
1104 gpio_request(GPIO_FN_SDHID0_3, NULL);
1105 gpio_request(GPIO_FN_SDHID0_2, NULL);
1106 gpio_request(GPIO_FN_SDHID0_1, NULL);
1107 gpio_request(GPIO_FN_SDHID0_0, NULL);
1108
1109#if !defined(CONFIG_MMC_SH_MMCIF)
1110 /* enable SDHI1 */
1111 gpio_request(GPIO_FN_SDHICMD1, NULL);
1112 gpio_request(GPIO_FN_SDHICLK1, NULL);
1113 gpio_request(GPIO_FN_SDHID1_3, NULL);
1114 gpio_request(GPIO_FN_SDHID1_2, NULL);
1115 gpio_request(GPIO_FN_SDHID1_1, NULL);
1116 gpio_request(GPIO_FN_SDHID1_0, NULL);
1117#endif
1118 /* card detect pin for MMC slot (CN7) */
1119 gpio_request(GPIO_PORT41, NULL);
1120 gpio_direction_input(GPIO_PORT41);
1121
1122 /* enable SDHI2 */
1123 gpio_request(GPIO_FN_SDHICMD2, NULL);
1124 gpio_request(GPIO_FN_SDHICLK2, NULL);
1125 gpio_request(GPIO_FN_SDHID2_3, NULL);
1126 gpio_request(GPIO_FN_SDHID2_2, NULL);
1127 gpio_request(GPIO_FN_SDHID2_1, NULL);
1128 gpio_request(GPIO_FN_SDHID2_0, NULL);
1129
1130 /* MMCIF */
1131 gpio_request(GPIO_FN_MMCD0_0, NULL);
1132 gpio_request(GPIO_FN_MMCD0_1, NULL);
1133 gpio_request(GPIO_FN_MMCD0_2, NULL);
1134 gpio_request(GPIO_FN_MMCD0_3, NULL);
1135 gpio_request(GPIO_FN_MMCD0_4, NULL);
1136 gpio_request(GPIO_FN_MMCD0_5, NULL);
1137 gpio_request(GPIO_FN_MMCD0_6, NULL);
1138 gpio_request(GPIO_FN_MMCD0_7, NULL);
1139 gpio_request(GPIO_FN_MMCCMD0, NULL);
1140 gpio_request(GPIO_FN_MMCCLK0, NULL);
1141
1142 /* enable GPS module (GT-720F) */
1143 gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
1144 gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
1145
1146 /* CEU */
1147 gpio_request(GPIO_FN_VIO_CLK, NULL);
1148 gpio_request(GPIO_FN_VIO_VD, NULL);
1149 gpio_request(GPIO_FN_VIO_HD, NULL);
1150 gpio_request(GPIO_FN_VIO_FIELD, NULL);
1151 gpio_request(GPIO_FN_VIO_CKO, NULL);
1152 gpio_request(GPIO_FN_VIO_D7, NULL);
1153 gpio_request(GPIO_FN_VIO_D6, NULL);
1154 gpio_request(GPIO_FN_VIO_D5, NULL);
1155 gpio_request(GPIO_FN_VIO_D4, NULL);
1156 gpio_request(GPIO_FN_VIO_D3, NULL);
1157 gpio_request(GPIO_FN_VIO_D2, NULL);
1158 gpio_request(GPIO_FN_VIO_D1, NULL);
1159 gpio_request(GPIO_FN_VIO_D0, NULL);
1160
1161 /* HDMI */
1162 gpio_request(GPIO_FN_HDMI_HPD, NULL);
1163 gpio_request(GPIO_FN_HDMI_CEC, NULL);
1164
1165 /* Reset HDMI, must be held at least one EXTALR (32768Hz) period */
1166 srcr4 = __raw_readl(SRCR4);
1167 __raw_writel(srcr4 | (1 << 13), SRCR4);
1168 udelay(50);
1169 __raw_writel(srcr4 & ~(1 << 13), SRCR4);
1170
1171 i2c_register_board_info(0, i2c0_devices,
1172 ARRAY_SIZE(i2c0_devices));
1173 i2c_register_board_info(1, i2c1_devices,
1174 ARRAY_SIZE(i2c1_devices));
1175
1176 sh7372_add_standard_devices();
1177
1178 platform_add_devices(mackerel_devices, ARRAY_SIZE(mackerel_devices));
1179}
1180
1181static void __init mackerel_timer_init(void)
1182{
1183 sh7372_clock_init();
1184 shmobile_timer.init();
1185
1186 /* External clock source */
1187 clk_set_rate(&sh7372_dv_clki_clk, 27000000);
1188}
1189
1190static struct sys_timer mackerel_timer = {
1191 .init = mackerel_timer_init,
1192};
1193
1194MACHINE_START(MACKEREL, "mackerel")
1195 .map_io = mackerel_map_io,
1196 .init_irq = sh7372_init_irq,
1197 .handle_irq = shmobile_handle_irq_intc,
1198 .init_machine = mackerel_init,
1199 .timer = &mackerel_timer,
1200MACHINE_END
diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c
new file mode 100644
index 000000000000..6b186aefcbd6
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-sh7367.c
@@ -0,0 +1,358 @@
1/*
2 * SH7367 clock framework support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/io.h>
22#include <linux/sh_clk.h>
23#include <linux/clkdev.h>
24#include <mach/common.h>
25
26/* SH7367 registers */
27#define RTFRQCR 0xe6150000
28#define SYFRQCR 0xe6150004
29#define CMFRQCR 0xe61500E0
30#define VCLKCR1 0xe6150008
31#define VCLKCR2 0xe615000C
32#define VCLKCR3 0xe615001C
33#define SCLKACR 0xe6150010
34#define SCLKBCR 0xe6150014
35#define SUBUSBCKCR 0xe6158080
36#define SPUCKCR 0xe6150084
37#define MSUCKCR 0xe6150088
38#define MVI3CKCR 0xe6150090
39#define VOUCKCR 0xe6150094
40#define MFCK1CR 0xe6150098
41#define MFCK2CR 0xe615009C
42#define PLLC1CR 0xe6150028
43#define PLLC2CR 0xe615002C
44#define RTMSTPCR0 0xe6158030
45#define RTMSTPCR2 0xe6158038
46#define SYMSTPCR0 0xe6158040
47#define SYMSTPCR2 0xe6158048
48#define CMMSTPCR0 0xe615804c
49
50/* Fixed 32 KHz root clock from EXTALR pin */
51static struct clk r_clk = {
52 .rate = 32768,
53};
54
55/*
56 * 26MHz default rate for the EXTALB1 root input clock.
57 * If needed, reset this with clk_set_rate() from the platform code.
58 */
59struct clk sh7367_extalb1_clk = {
60 .rate = 26666666,
61};
62
63/*
64 * 48MHz default rate for the EXTAL2 root input clock.
65 * If needed, reset this with clk_set_rate() from the platform code.
66 */
67struct clk sh7367_extal2_clk = {
68 .rate = 48000000,
69};
70
71/* A fixed divide-by-2 block */
72static unsigned long div2_recalc(struct clk *clk)
73{
74 return clk->parent->rate / 2;
75}
76
77static struct clk_ops div2_clk_ops = {
78 .recalc = div2_recalc,
79};
80
81/* Divide extalb1 by two */
82static struct clk extalb1_div2_clk = {
83 .ops = &div2_clk_ops,
84 .parent = &sh7367_extalb1_clk,
85};
86
87/* Divide extal2 by two */
88static struct clk extal2_div2_clk = {
89 .ops = &div2_clk_ops,
90 .parent = &sh7367_extal2_clk,
91};
92
93/* PLLC1 */
94static unsigned long pllc1_recalc(struct clk *clk)
95{
96 unsigned long mult = 1;
97
98 if (__raw_readl(PLLC1CR) & (1 << 14))
99 mult = (((__raw_readl(RTFRQCR) >> 24) & 0x3f) + 1) * 2;
100
101 return clk->parent->rate * mult;
102}
103
104static struct clk_ops pllc1_clk_ops = {
105 .recalc = pllc1_recalc,
106};
107
108static struct clk pllc1_clk = {
109 .ops = &pllc1_clk_ops,
110 .flags = CLK_ENABLE_ON_INIT,
111 .parent = &extalb1_div2_clk,
112};
113
114/* Divide PLLC1 by two */
115static struct clk pllc1_div2_clk = {
116 .ops = &div2_clk_ops,
117 .parent = &pllc1_clk,
118};
119
120/* PLLC2 */
121static unsigned long pllc2_recalc(struct clk *clk)
122{
123 unsigned long mult = 1;
124
125 if (__raw_readl(PLLC2CR) & (1 << 31))
126 mult = (((__raw_readl(PLLC2CR) >> 24) & 0x3f) + 1) * 2;
127
128 return clk->parent->rate * mult;
129}
130
131static struct clk_ops pllc2_clk_ops = {
132 .recalc = pllc2_recalc,
133};
134
135static struct clk pllc2_clk = {
136 .ops = &pllc2_clk_ops,
137 .flags = CLK_ENABLE_ON_INIT,
138 .parent = &extalb1_div2_clk,
139};
140
141static struct clk *main_clks[] = {
142 &r_clk,
143 &sh7367_extalb1_clk,
144 &sh7367_extal2_clk,
145 &extalb1_div2_clk,
146 &extal2_div2_clk,
147 &pllc1_clk,
148 &pllc1_div2_clk,
149 &pllc2_clk,
150};
151
152static void div4_kick(struct clk *clk)
153{
154 unsigned long value;
155
156 /* set KICK bit in SYFRQCR to update hardware setting */
157 value = __raw_readl(SYFRQCR);
158 value |= (1 << 31);
159 __raw_writel(value, SYFRQCR);
160}
161
162static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
163 24, 32, 36, 48, 0, 72, 0, 0 };
164
165static struct clk_div_mult_table div4_div_mult_table = {
166 .divisors = divisors,
167 .nr_divisors = ARRAY_SIZE(divisors),
168};
169
170static struct clk_div4_table div4_table = {
171 .div_mult_table = &div4_div_mult_table,
172 .kick = div4_kick,
173};
174
175enum { DIV4_I, DIV4_G, DIV4_S, DIV4_B,
176 DIV4_ZX, DIV4_ZT, DIV4_Z, DIV4_ZD, DIV4_HP,
177 DIV4_ZS, DIV4_ZB, DIV4_ZB3, DIV4_CP, DIV4_NR };
178
179#define DIV4(_reg, _bit, _mask, _flags) \
180 SH_CLK_DIV4(&pllc1_clk, _reg, _bit, _mask, _flags)
181
182static struct clk div4_clks[DIV4_NR] = {
183 [DIV4_I] = DIV4(RTFRQCR, 20, 0x6fff, CLK_ENABLE_ON_INIT),
184 [DIV4_G] = DIV4(RTFRQCR, 16, 0x6fff, CLK_ENABLE_ON_INIT),
185 [DIV4_S] = DIV4(RTFRQCR, 12, 0x6fff, CLK_ENABLE_ON_INIT),
186 [DIV4_B] = DIV4(RTFRQCR, 8, 0x6fff, CLK_ENABLE_ON_INIT),
187 [DIV4_ZX] = DIV4(SYFRQCR, 20, 0x6fff, 0),
188 [DIV4_ZT] = DIV4(SYFRQCR, 16, 0x6fff, 0),
189 [DIV4_Z] = DIV4(SYFRQCR, 12, 0x6fff, 0),
190 [DIV4_ZD] = DIV4(SYFRQCR, 8, 0x6fff, 0),
191 [DIV4_HP] = DIV4(SYFRQCR, 4, 0x6fff, 0),
192 [DIV4_ZS] = DIV4(CMFRQCR, 12, 0x6fff, 0),
193 [DIV4_ZB] = DIV4(CMFRQCR, 8, 0x6fff, 0),
194 [DIV4_ZB3] = DIV4(CMFRQCR, 4, 0x6fff, 0),
195 [DIV4_CP] = DIV4(CMFRQCR, 0, 0x6fff, 0),
196};
197
198enum { DIV6_SUB, DIV6_SIUA, DIV6_SIUB, DIV6_MSU, DIV6_SPU,
199 DIV6_MVI3, DIV6_MF1, DIV6_MF2,
200 DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_VOU,
201 DIV6_NR };
202
203static struct clk div6_clks[DIV6_NR] = {
204 [DIV6_SUB] = SH_CLK_DIV6(&sh7367_extal2_clk, SUBUSBCKCR, 0),
205 [DIV6_SIUA] = SH_CLK_DIV6(&pllc1_div2_clk, SCLKACR, 0),
206 [DIV6_SIUB] = SH_CLK_DIV6(&pllc1_div2_clk, SCLKBCR, 0),
207 [DIV6_MSU] = SH_CLK_DIV6(&pllc1_div2_clk, MSUCKCR, 0),
208 [DIV6_SPU] = SH_CLK_DIV6(&pllc1_div2_clk, SPUCKCR, 0),
209 [DIV6_MVI3] = SH_CLK_DIV6(&pllc1_div2_clk, MVI3CKCR, 0),
210 [DIV6_MF1] = SH_CLK_DIV6(&pllc1_div2_clk, MFCK1CR, 0),
211 [DIV6_MF2] = SH_CLK_DIV6(&pllc1_div2_clk, MFCK2CR, 0),
212 [DIV6_VCK1] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR1, 0),
213 [DIV6_VCK2] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR2, 0),
214 [DIV6_VCK3] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR3, 0),
215 [DIV6_VOU] = SH_CLK_DIV6(&pllc1_div2_clk, VOUCKCR, 0),
216};
217
218enum { RTMSTP001,
219 RTMSTP231, RTMSTP230, RTMSTP229, RTMSTP228, RTMSTP226,
220 RTMSTP216, RTMSTP206, RTMSTP205, RTMSTP201,
221 SYMSTP023, SYMSTP007, SYMSTP006, SYMSTP004,
222 SYMSTP003, SYMSTP002, SYMSTP001, SYMSTP000,
223 SYMSTP231, SYMSTP229, SYMSTP225, SYMSTP223, SYMSTP222,
224 SYMSTP215, SYMSTP214, SYMSTP213, SYMSTP211,
225 CMMSTP003,
226 MSTP_NR };
227
228#define MSTP(_parent, _reg, _bit, _flags) \
229 SH_CLK_MSTP32(_parent, _reg, _bit, _flags)
230
231static struct clk mstp_clks[MSTP_NR] = {
232 [RTMSTP001] = MSTP(&div6_clks[DIV6_SUB], RTMSTPCR0, 1, 0), /* IIC2 */
233 [RTMSTP231] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 31, 0), /* VEU3 */
234 [RTMSTP230] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 30, 0), /* VEU2 */
235 [RTMSTP229] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 29, 0), /* VEU1 */
236 [RTMSTP228] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 28, 0), /* VEU0 */
237 [RTMSTP226] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 26, 0), /* VEU2H */
238 [RTMSTP216] = MSTP(&div6_clks[DIV6_SUB], RTMSTPCR2, 16, 0), /* IIC0 */
239 [RTMSTP206] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 6, 0), /* JPU */
240 [RTMSTP205] = MSTP(&div6_clks[DIV6_VOU], RTMSTPCR2, 5, 0), /* VOU */
241 [RTMSTP201] = MSTP(&div4_clks[DIV4_B], RTMSTPCR2, 1, 0), /* VPU */
242 [SYMSTP023] = MSTP(&div6_clks[DIV6_SPU], SYMSTPCR0, 23, 0), /* SPU1 */
243 [SYMSTP007] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 7, 0), /* SCIFA5 */
244 [SYMSTP006] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 6, 0), /* SCIFB */
245 [SYMSTP004] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 4, 0), /* SCIFA0 */
246 [SYMSTP003] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 3, 0), /* SCIFA1 */
247 [SYMSTP002] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 2, 0), /* SCIFA2 */
248 [SYMSTP001] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 1, 0), /* SCIFA3 */
249 [SYMSTP000] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR0, 0, 0), /* SCIFA4 */
250 [SYMSTP231] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR2, 31, 0), /* SIU */
251 [SYMSTP229] = MSTP(&r_clk, SYMSTPCR2, 29, 0), /* CMT10 */
252 [SYMSTP225] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR2, 25, 0), /* IRDA */
253 [SYMSTP223] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR2, 23, 0), /* IIC1 */
254 [SYMSTP222] = MSTP(&div6_clks[DIV6_SUB], SYMSTPCR2, 22, 0), /* USBHS */
255 [SYMSTP215] = MSTP(&div4_clks[DIV4_HP], SYMSTPCR2, 15, 0), /* FLCTL */
256 [SYMSTP214] = MSTP(&div4_clks[DIV4_HP], SYMSTPCR2, 14, 0), /* SDHI0 */
257 [SYMSTP213] = MSTP(&div4_clks[DIV4_HP], SYMSTPCR2, 13, 0), /* SDHI1 */
258 [SYMSTP211] = MSTP(&div4_clks[DIV4_HP], SYMSTPCR2, 11, 0), /* SDHI2 */
259 [CMMSTP003] = MSTP(&r_clk, CMMSTPCR0, 3, 0), /* KEYSC */
260};
261
262#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
263#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
264
265static struct clk_lookup lookups[] = {
266 /* main clocks */
267 CLKDEV_CON_ID("r_clk", &r_clk),
268 CLKDEV_CON_ID("extalb1", &sh7367_extalb1_clk),
269 CLKDEV_CON_ID("extal2", &sh7367_extal2_clk),
270 CLKDEV_CON_ID("extalb1_div2_clk", &extalb1_div2_clk),
271 CLKDEV_CON_ID("extal2_div2_clk", &extal2_div2_clk),
272 CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
273 CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
274 CLKDEV_CON_ID("pllc2_clk", &pllc2_clk),
275
276 /* DIV4 clocks */
277 CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
278 CLKDEV_CON_ID("g_clk", &div4_clks[DIV4_G]),
279 CLKDEV_CON_ID("b_clk", &div4_clks[DIV4_B]),
280 CLKDEV_CON_ID("zx_clk", &div4_clks[DIV4_ZX]),
281 CLKDEV_CON_ID("zt_clk", &div4_clks[DIV4_ZT]),
282 CLKDEV_CON_ID("z_clk", &div4_clks[DIV4_Z]),
283 CLKDEV_CON_ID("zd_clk", &div4_clks[DIV4_ZD]),
284 CLKDEV_CON_ID("hp_clk", &div4_clks[DIV4_HP]),
285 CLKDEV_CON_ID("zs_clk", &div4_clks[DIV4_ZS]),
286 CLKDEV_CON_ID("zb_clk", &div4_clks[DIV4_ZB]),
287 CLKDEV_CON_ID("zb3_clk", &div4_clks[DIV4_ZB3]),
288 CLKDEV_CON_ID("cp_clk", &div4_clks[DIV4_CP]),
289
290 /* DIV6 clocks */
291 CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]),
292 CLKDEV_CON_ID("siua_clk", &div6_clks[DIV6_SIUA]),
293 CLKDEV_CON_ID("siub_clk", &div6_clks[DIV6_SIUB]),
294 CLKDEV_CON_ID("msu_clk", &div6_clks[DIV6_MSU]),
295 CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_SPU]),
296 CLKDEV_CON_ID("mvi3_clk", &div6_clks[DIV6_MVI3]),
297 CLKDEV_CON_ID("mf1_clk", &div6_clks[DIV6_MF1]),
298 CLKDEV_CON_ID("mf2_clk", &div6_clks[DIV6_MF2]),
299 CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]),
300 CLKDEV_CON_ID("vck2_clk", &div6_clks[DIV6_VCK2]),
301 CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]),
302 CLKDEV_CON_ID("vou_clk", &div6_clks[DIV6_VOU]),
303
304 /* MSTP32 clocks */
305 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[RTMSTP001]), /* IIC2 */
306 CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[RTMSTP231]), /* VEU3 */
307 CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[RTMSTP230]), /* VEU2 */
308 CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[RTMSTP229]), /* VEU1 */
309 CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[RTMSTP228]), /* VEU0 */
310 CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[RTMSTP226]), /* VEU2H */
311 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[RTMSTP216]), /* IIC0 */
312 CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[RTMSTP206]), /* JPU */
313 CLKDEV_DEV_ID("sh-vou", &mstp_clks[RTMSTP205]), /* VOU */
314 CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[RTMSTP201]), /* VPU */
315 CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[SYMSTP023]), /* SPU1 */
316 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[SYMSTP007]), /* SCIFA5 */
317 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[SYMSTP006]), /* SCIFB */
318 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[SYMSTP004]), /* SCIFA0 */
319 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[SYMSTP003]), /* SCIFA1 */
320 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[SYMSTP002]), /* SCIFA2 */
321 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[SYMSTP001]), /* SCIFA3 */
322 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[SYMSTP000]), /* SCIFA4 */
323 CLKDEV_DEV_ID("sh_siu", &mstp_clks[SYMSTP231]), /* SIU */
324 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[SYMSTP229]), /* CMT10 */
325 CLKDEV_DEV_ID("sh_irda", &mstp_clks[SYMSTP225]), /* IRDA */
326 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[SYMSTP223]), /* IIC1 */
327 CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[SYMSTP222]), /* USBHS */
328 CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[SYMSTP222]), /* USBHS */
329 CLKDEV_DEV_ID("sh_flctl", &mstp_clks[SYMSTP215]), /* FLCTL */
330 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[SYMSTP214]), /* SDHI0 */
331 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[SYMSTP213]), /* SDHI1 */
332 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[SYMSTP211]), /* SDHI2 */
333 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[CMMSTP003]), /* KEYSC */
334};
335
336void __init sh7367_clock_init(void)
337{
338 int k, ret = 0;
339
340 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
341 ret = clk_register(main_clks[k]);
342
343 if (!ret)
344 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
345
346 if (!ret)
347 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
348
349 if (!ret)
350 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
351
352 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
353
354 if (!ret)
355 clk_init();
356 else
357 panic("failed to setup sh7367 clocks\n");
358}
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
new file mode 100644
index 000000000000..9aa8d68d1a9c
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -0,0 +1,681 @@
1/*
2 * SH7372 clock framework support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/io.h>
22#include <linux/sh_clk.h>
23#include <linux/clkdev.h>
24#include <mach/common.h>
25
26/* SH7372 registers */
27#define FRQCRA 0xe6150000
28#define FRQCRB 0xe6150004
29#define FRQCRC 0xe61500e0
30#define FRQCRD 0xe61500e4
31#define VCLKCR1 0xe6150008
32#define VCLKCR2 0xe615000c
33#define VCLKCR3 0xe615001c
34#define FMSICKCR 0xe6150010
35#define FMSOCKCR 0xe6150014
36#define FSIACKCR 0xe6150018
37#define FSIBCKCR 0xe6150090
38#define SUBCKCR 0xe6150080
39#define SPUCKCR 0xe6150084
40#define VOUCKCR 0xe6150088
41#define HDMICKCR 0xe6150094
42#define DSITCKCR 0xe6150060
43#define DSI0PCKCR 0xe6150064
44#define DSI1PCKCR 0xe6150098
45#define PLLC01CR 0xe6150028
46#define PLLC2CR 0xe615002c
47#define SMSTPCR0 0xe6150130
48#define SMSTPCR1 0xe6150134
49#define SMSTPCR2 0xe6150138
50#define SMSTPCR3 0xe615013c
51#define SMSTPCR4 0xe6150140
52
53#define FSIDIVA 0xFE1F8000
54#define FSIDIVB 0xFE1F8008
55
56/* Platforms must set frequency on their DV_CLKI pin */
57struct clk sh7372_dv_clki_clk = {
58};
59
60/* Fixed 32 KHz root clock from EXTALR pin */
61static struct clk r_clk = {
62 .rate = 32768,
63};
64
65/*
66 * 26MHz default rate for the EXTAL1 root input clock.
67 * If needed, reset this with clk_set_rate() from the platform code.
68 */
69struct clk sh7372_extal1_clk = {
70 .rate = 26000000,
71};
72
73/*
74 * 48MHz default rate for the EXTAL2 root input clock.
75 * If needed, reset this with clk_set_rate() from the platform code.
76 */
77struct clk sh7372_extal2_clk = {
78 .rate = 48000000,
79};
80
81/* A fixed divide-by-2 block */
82static unsigned long div2_recalc(struct clk *clk)
83{
84 return clk->parent->rate / 2;
85}
86
87static struct clk_ops div2_clk_ops = {
88 .recalc = div2_recalc,
89};
90
91/* Divide dv_clki by two */
92struct clk sh7372_dv_clki_div2_clk = {
93 .ops = &div2_clk_ops,
94 .parent = &sh7372_dv_clki_clk,
95};
96
97/* Divide extal1 by two */
98static struct clk extal1_div2_clk = {
99 .ops = &div2_clk_ops,
100 .parent = &sh7372_extal1_clk,
101};
102
103/* Divide extal2 by two */
104static struct clk extal2_div2_clk = {
105 .ops = &div2_clk_ops,
106 .parent = &sh7372_extal2_clk,
107};
108
109/* Divide extal2 by four */
110static struct clk extal2_div4_clk = {
111 .ops = &div2_clk_ops,
112 .parent = &extal2_div2_clk,
113};
114
115/* PLLC0 and PLLC1 */
116static unsigned long pllc01_recalc(struct clk *clk)
117{
118 unsigned long mult = 1;
119
120 if (__raw_readl(PLLC01CR) & (1 << 14))
121 mult = (((__raw_readl(clk->enable_reg) >> 24) & 0x3f) + 1) * 2;
122
123 return clk->parent->rate * mult;
124}
125
126static struct clk_ops pllc01_clk_ops = {
127 .recalc = pllc01_recalc,
128};
129
130static struct clk pllc0_clk = {
131 .ops = &pllc01_clk_ops,
132 .flags = CLK_ENABLE_ON_INIT,
133 .parent = &extal1_div2_clk,
134 .enable_reg = (void __iomem *)FRQCRC,
135};
136
137static struct clk pllc1_clk = {
138 .ops = &pllc01_clk_ops,
139 .flags = CLK_ENABLE_ON_INIT,
140 .parent = &extal1_div2_clk,
141 .enable_reg = (void __iomem *)FRQCRA,
142};
143
144/* Divide PLLC1 by two */
145static struct clk pllc1_div2_clk = {
146 .ops = &div2_clk_ops,
147 .parent = &pllc1_clk,
148};
149
150/* PLLC2 */
151
152/* Indices are important - they are the actual src selecting values */
153static struct clk *pllc2_parent[] = {
154 [0] = &extal1_div2_clk,
155 [1] = &extal2_div2_clk,
156 [2] = &sh7372_dv_clki_div2_clk,
157};
158
159/* Only multipliers 20 * 2 to 46 * 2 are valid, last entry for CPUFREQ_TABLE_END */
160static struct cpufreq_frequency_table pllc2_freq_table[29];
161
162static void pllc2_table_rebuild(struct clk *clk)
163{
164 int i;
165
166 /* Initialise PLLC2 frequency table */
167 for (i = 0; i < ARRAY_SIZE(pllc2_freq_table) - 2; i++) {
168 pllc2_freq_table[i].frequency = clk->parent->rate * (i + 20) * 2;
169 pllc2_freq_table[i].index = i;
170 }
171
172 /* This is a special entry - switching PLL off makes it a repeater */
173 pllc2_freq_table[i].frequency = clk->parent->rate;
174 pllc2_freq_table[i].index = i;
175
176 pllc2_freq_table[++i].frequency = CPUFREQ_TABLE_END;
177 pllc2_freq_table[i].index = i;
178}
179
180static unsigned long pllc2_recalc(struct clk *clk)
181{
182 unsigned long mult = 1;
183
184 pllc2_table_rebuild(clk);
185
186 /*
187 * If the PLL is off, mult == 1, clk->rate will be updated in
188 * pllc2_enable().
189 */
190 if (__raw_readl(PLLC2CR) & (1 << 31))
191 mult = (((__raw_readl(PLLC2CR) >> 24) & 0x3f) + 1) * 2;
192
193 return clk->parent->rate * mult;
194}
195
196static long pllc2_round_rate(struct clk *clk, unsigned long rate)
197{
198 return clk_rate_table_round(clk, clk->freq_table, rate);
199}
200
201static int pllc2_enable(struct clk *clk)
202{
203 int i;
204
205 __raw_writel(__raw_readl(PLLC2CR) | 0x80000000, PLLC2CR);
206
207 for (i = 0; i < 100; i++)
208 if (__raw_readl(PLLC2CR) & 0x80000000) {
209 clk->rate = pllc2_recalc(clk);
210 return 0;
211 }
212
213 pr_err("%s(): timeout!\n", __func__);
214
215 return -ETIMEDOUT;
216}
217
218static void pllc2_disable(struct clk *clk)
219{
220 __raw_writel(__raw_readl(PLLC2CR) & ~0x80000000, PLLC2CR);
221}
222
223static int pllc2_set_rate(struct clk *clk, unsigned long rate)
224{
225 unsigned long value;
226 int idx;
227
228 idx = clk_rate_table_find(clk, clk->freq_table, rate);
229 if (idx < 0)
230 return idx;
231
232 if (rate == clk->parent->rate)
233 return -EINVAL;
234
235 value = __raw_readl(PLLC2CR) & ~(0x3f << 24);
236
237 __raw_writel((value & ~0x80000000) | ((idx + 19) << 24), PLLC2CR);
238
239 return 0;
240}
241
242static int pllc2_set_parent(struct clk *clk, struct clk *parent)
243{
244 u32 value;
245 int ret, i;
246
247 if (!clk->parent_table || !clk->parent_num)
248 return -EINVAL;
249
250 /* Search the parent */
251 for (i = 0; i < clk->parent_num; i++)
252 if (clk->parent_table[i] == parent)
253 break;
254
255 if (i == clk->parent_num)
256 return -ENODEV;
257
258 ret = clk_reparent(clk, parent);
259 if (ret < 0)
260 return ret;
261
262 value = __raw_readl(PLLC2CR) & ~(3 << 6);
263
264 __raw_writel(value | (i << 6), PLLC2CR);
265
266 /* Rebiuld the frequency table */
267 pllc2_table_rebuild(clk);
268
269 return 0;
270}
271
272static struct clk_ops pllc2_clk_ops = {
273 .recalc = pllc2_recalc,
274 .round_rate = pllc2_round_rate,
275 .set_rate = pllc2_set_rate,
276 .enable = pllc2_enable,
277 .disable = pllc2_disable,
278 .set_parent = pllc2_set_parent,
279};
280
281struct clk sh7372_pllc2_clk = {
282 .ops = &pllc2_clk_ops,
283 .parent = &extal1_div2_clk,
284 .freq_table = pllc2_freq_table,
285 .nr_freqs = ARRAY_SIZE(pllc2_freq_table) - 1,
286 .parent_table = pllc2_parent,
287 .parent_num = ARRAY_SIZE(pllc2_parent),
288};
289
290/* External input clock (pin name: FSIACK/FSIBCK ) */
291struct clk sh7372_fsiack_clk = {
292};
293
294struct clk sh7372_fsibck_clk = {
295};
296
297static struct clk *main_clks[] = {
298 &sh7372_dv_clki_clk,
299 &r_clk,
300 &sh7372_extal1_clk,
301 &sh7372_extal2_clk,
302 &sh7372_dv_clki_div2_clk,
303 &extal1_div2_clk,
304 &extal2_div2_clk,
305 &extal2_div4_clk,
306 &pllc0_clk,
307 &pllc1_clk,
308 &pllc1_div2_clk,
309 &sh7372_pllc2_clk,
310 &sh7372_fsiack_clk,
311 &sh7372_fsibck_clk,
312};
313
314static void div4_kick(struct clk *clk)
315{
316 unsigned long value;
317
318 /* set KICK bit in FRQCRB to update hardware setting */
319 value = __raw_readl(FRQCRB);
320 value |= (1 << 31);
321 __raw_writel(value, FRQCRB);
322}
323
324static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
325 24, 32, 36, 48, 0, 72, 96, 0 };
326
327static struct clk_div_mult_table div4_div_mult_table = {
328 .divisors = divisors,
329 .nr_divisors = ARRAY_SIZE(divisors),
330};
331
332static struct clk_div4_table div4_table = {
333 .div_mult_table = &div4_div_mult_table,
334 .kick = div4_kick,
335};
336
337enum { DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_CSIR,
338 DIV4_ZTR, DIV4_ZT, DIV4_ZX, DIV4_HP,
339 DIV4_ISPB, DIV4_S, DIV4_ZB, DIV4_ZB3, DIV4_CP,
340 DIV4_DDRP, DIV4_NR };
341
342#define DIV4(_reg, _bit, _mask, _flags) \
343 SH_CLK_DIV4(&pllc1_clk, _reg, _bit, _mask, _flags)
344
345static struct clk div4_clks[DIV4_NR] = {
346 [DIV4_I] = DIV4(FRQCRA, 20, 0x6fff, CLK_ENABLE_ON_INIT),
347 [DIV4_ZG] = DIV4(FRQCRA, 16, 0x6fff, CLK_ENABLE_ON_INIT),
348 [DIV4_B] = DIV4(FRQCRA, 8, 0x6fff, CLK_ENABLE_ON_INIT),
349 [DIV4_M1] = DIV4(FRQCRA, 4, 0x6fff, CLK_ENABLE_ON_INIT),
350 [DIV4_CSIR] = DIV4(FRQCRA, 0, 0x6fff, 0),
351 [DIV4_ZTR] = DIV4(FRQCRB, 20, 0x6fff, 0),
352 [DIV4_ZT] = DIV4(FRQCRB, 16, 0x6fff, 0),
353 [DIV4_ZX] = DIV4(FRQCRB, 12, 0x6fff, 0),
354 [DIV4_HP] = DIV4(FRQCRB, 4, 0x6fff, 0),
355 [DIV4_ISPB] = DIV4(FRQCRC, 20, 0x6fff, 0),
356 [DIV4_S] = DIV4(FRQCRC, 12, 0x6fff, 0),
357 [DIV4_ZB] = DIV4(FRQCRC, 8, 0x6fff, 0),
358 [DIV4_ZB3] = DIV4(FRQCRC, 4, 0x6fff, 0),
359 [DIV4_CP] = DIV4(FRQCRC, 0, 0x6fff, 0),
360 [DIV4_DDRP] = DIV4(FRQCRD, 0, 0x677c, 0),
361};
362
363enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_FMSI, DIV6_FMSO,
364 DIV6_SUB, DIV6_SPU,
365 DIV6_VOU, DIV6_DSIT, DIV6_DSI0P, DIV6_DSI1P,
366 DIV6_NR };
367
368static struct clk div6_clks[DIV6_NR] = {
369 [DIV6_VCK1] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR1, 0),
370 [DIV6_VCK2] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR2, 0),
371 [DIV6_VCK3] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR3, 0),
372 [DIV6_FMSI] = SH_CLK_DIV6(&pllc1_div2_clk, FMSICKCR, 0),
373 [DIV6_FMSO] = SH_CLK_DIV6(&pllc1_div2_clk, FMSOCKCR, 0),
374 [DIV6_SUB] = SH_CLK_DIV6(&sh7372_extal2_clk, SUBCKCR, 0),
375 [DIV6_SPU] = SH_CLK_DIV6(&pllc1_div2_clk, SPUCKCR, 0),
376 [DIV6_VOU] = SH_CLK_DIV6(&pllc1_div2_clk, VOUCKCR, 0),
377 [DIV6_DSIT] = SH_CLK_DIV6(&pllc1_div2_clk, DSITCKCR, 0),
378 [DIV6_DSI0P] = SH_CLK_DIV6(&pllc1_div2_clk, DSI0PCKCR, 0),
379 [DIV6_DSI1P] = SH_CLK_DIV6(&pllc1_div2_clk, DSI1PCKCR, 0),
380};
381
382enum { DIV6_HDMI, DIV6_FSIA, DIV6_FSIB, DIV6_REPARENT_NR };
383
384/* Indices are important - they are the actual src selecting values */
385static struct clk *hdmi_parent[] = {
386 [0] = &pllc1_div2_clk,
387 [1] = &sh7372_pllc2_clk,
388 [2] = &sh7372_dv_clki_clk,
389 [3] = NULL, /* pllc2_div4 not implemented yet */
390};
391
392static struct clk *fsiackcr_parent[] = {
393 [0] = &pllc1_div2_clk,
394 [1] = &sh7372_pllc2_clk,
395 [2] = &sh7372_fsiack_clk, /* external input for FSI A */
396 [3] = NULL, /* setting prohibited */
397};
398
399static struct clk *fsibckcr_parent[] = {
400 [0] = &pllc1_div2_clk,
401 [1] = &sh7372_pllc2_clk,
402 [2] = &sh7372_fsibck_clk, /* external input for FSI B */
403 [3] = NULL, /* setting prohibited */
404};
405
406static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = {
407 [DIV6_HDMI] = SH_CLK_DIV6_EXT(&pllc1_div2_clk, HDMICKCR, 0,
408 hdmi_parent, ARRAY_SIZE(hdmi_parent), 6, 2),
409 [DIV6_FSIA] = SH_CLK_DIV6_EXT(&pllc1_div2_clk, FSIACKCR, 0,
410 fsiackcr_parent, ARRAY_SIZE(fsiackcr_parent), 6, 2),
411 [DIV6_FSIB] = SH_CLK_DIV6_EXT(&pllc1_div2_clk, FSIBCKCR, 0,
412 fsibckcr_parent, ARRAY_SIZE(fsibckcr_parent), 6, 2),
413};
414
415/* FSI DIV */
416static unsigned long fsidiv_recalc(struct clk *clk)
417{
418 unsigned long value;
419
420 value = __raw_readl(clk->mapping->base);
421
422 if ((value & 0x3) != 0x3)
423 return 0;
424
425 value >>= 16;
426 if (value < 2)
427 return 0;
428
429 return clk->parent->rate / value;
430}
431
432static long fsidiv_round_rate(struct clk *clk, unsigned long rate)
433{
434 return clk_rate_div_range_round(clk, 2, 0xffff, rate);
435}
436
437static void fsidiv_disable(struct clk *clk)
438{
439 __raw_writel(0, clk->mapping->base);
440}
441
442static int fsidiv_enable(struct clk *clk)
443{
444 unsigned long value;
445
446 value = __raw_readl(clk->mapping->base) >> 16;
447 if (value < 2)
448 return -EIO;
449
450 __raw_writel((value << 16) | 0x3, clk->mapping->base);
451
452 return 0;
453}
454
455static int fsidiv_set_rate(struct clk *clk, unsigned long rate)
456{
457 int idx;
458
459 idx = (clk->parent->rate / rate) & 0xffff;
460 if (idx < 2)
461 return -EINVAL;
462
463 __raw_writel(idx << 16, clk->mapping->base);
464 return 0;
465}
466
467static struct clk_ops fsidiv_clk_ops = {
468 .recalc = fsidiv_recalc,
469 .round_rate = fsidiv_round_rate,
470 .set_rate = fsidiv_set_rate,
471 .enable = fsidiv_enable,
472 .disable = fsidiv_disable,
473};
474
475static struct clk_mapping sh7372_fsidiva_clk_mapping = {
476 .phys = FSIDIVA,
477 .len = 8,
478};
479
480struct clk sh7372_fsidiva_clk = {
481 .ops = &fsidiv_clk_ops,
482 .parent = &div6_reparent_clks[DIV6_FSIA], /* late install */
483 .mapping = &sh7372_fsidiva_clk_mapping,
484};
485
486static struct clk_mapping sh7372_fsidivb_clk_mapping = {
487 .phys = FSIDIVB,
488 .len = 8,
489};
490
491struct clk sh7372_fsidivb_clk = {
492 .ops = &fsidiv_clk_ops,
493 .parent = &div6_reparent_clks[DIV6_FSIB], /* late install */
494 .mapping = &sh7372_fsidivb_clk_mapping,
495};
496
497static struct clk *late_main_clks[] = {
498 &sh7372_fsidiva_clk,
499 &sh7372_fsidivb_clk,
500};
501
502enum { MSTP001,
503 MSTP131, MSTP130,
504 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125,
505 MSTP118, MSTP117, MSTP116,
506 MSTP106, MSTP101, MSTP100,
507 MSTP223,
508 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
509 MSTP329, MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312,
510 MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP406, MSTP403,
511 MSTP_NR };
512
513#define MSTP(_parent, _reg, _bit, _flags) \
514 SH_CLK_MSTP32(_parent, _reg, _bit, _flags)
515
516static struct clk mstp_clks[MSTP_NR] = {
517 [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */
518 [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */
519 [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */
520 [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */
521 [MSTP128] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 28, 0), /* VEU0 */
522 [MSTP127] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 27, 0), /* CEU */
523 [MSTP126] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 26, 0), /* CSI2 */
524 [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */
525 [MSTP118] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 18, 0), /* DSITX */
526 [MSTP117] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 17, 0), /* LCDC1 */
527 [MSTP116] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 16, 0), /* IIC0 */
528 [MSTP106] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 6, 0), /* JPU */
529 [MSTP101] = MSTP(&div4_clks[DIV4_M1], SMSTPCR1, 1, 0), /* VPU */
530 [MSTP100] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 0, 0), /* LCDC0 */
531 [MSTP223] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR2, 23, 0), /* SPU2 */
532 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
533 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
534 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
535 [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */
536 [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */
537 [MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */
538 [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
539 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
540 [MSTP328] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR3, 28, 0), /* FSI2 */
541 [MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
542 [MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */
543 [MSTP314] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */
544 [MSTP313] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */
545 [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */
546 [MSTP423] = MSTP(&div4_clks[DIV4_B], SMSTPCR4, 23, 0), /* DSITX1 */
547 [MSTP415] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 15, 0), /* SDHI2 */
548 [MSTP413] = MSTP(&pllc1_div2_clk, SMSTPCR4, 13, 0), /* HDMI */
549 [MSTP411] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 11, 0), /* IIC3 */
550 [MSTP410] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 10, 0), /* IIC4 */
551 [MSTP406] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 6, 0), /* USB1 */
552 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
553};
554
555#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
556#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
557#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
558
559static struct clk_lookup lookups[] = {
560 /* main clocks */
561 CLKDEV_CON_ID("dv_clki_div2_clk", &sh7372_dv_clki_div2_clk),
562 CLKDEV_CON_ID("r_clk", &r_clk),
563 CLKDEV_CON_ID("extal1", &sh7372_extal1_clk),
564 CLKDEV_CON_ID("extal2", &sh7372_extal2_clk),
565 CLKDEV_CON_ID("extal1_div2_clk", &extal1_div2_clk),
566 CLKDEV_CON_ID("extal2_div2_clk", &extal2_div2_clk),
567 CLKDEV_CON_ID("extal2_div4_clk", &extal2_div4_clk),
568 CLKDEV_CON_ID("pllc0_clk", &pllc0_clk),
569 CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
570 CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
571 CLKDEV_CON_ID("pllc2_clk", &sh7372_pllc2_clk),
572
573 /* DIV4 clocks */
574 CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
575 CLKDEV_CON_ID("zg_clk", &div4_clks[DIV4_ZG]),
576 CLKDEV_CON_ID("b_clk", &div4_clks[DIV4_B]),
577 CLKDEV_CON_ID("m1_clk", &div4_clks[DIV4_M1]),
578 CLKDEV_CON_ID("csir_clk", &div4_clks[DIV4_CSIR]),
579 CLKDEV_CON_ID("ztr_clk", &div4_clks[DIV4_ZTR]),
580 CLKDEV_CON_ID("zt_clk", &div4_clks[DIV4_ZT]),
581 CLKDEV_CON_ID("zx_clk", &div4_clks[DIV4_ZX]),
582 CLKDEV_CON_ID("hp_clk", &div4_clks[DIV4_HP]),
583 CLKDEV_CON_ID("ispb_clk", &div4_clks[DIV4_ISPB]),
584 CLKDEV_CON_ID("s_clk", &div4_clks[DIV4_S]),
585 CLKDEV_CON_ID("zb_clk", &div4_clks[DIV4_ZB]),
586 CLKDEV_CON_ID("zb3_clk", &div4_clks[DIV4_ZB3]),
587 CLKDEV_CON_ID("cp_clk", &div4_clks[DIV4_CP]),
588 CLKDEV_CON_ID("ddrp_clk", &div4_clks[DIV4_DDRP]),
589
590 /* DIV6 clocks */
591 CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]),
592 CLKDEV_CON_ID("vck2_clk", &div6_clks[DIV6_VCK2]),
593 CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]),
594 CLKDEV_CON_ID("fmsi_clk", &div6_clks[DIV6_FMSI]),
595 CLKDEV_CON_ID("fmso_clk", &div6_clks[DIV6_FMSO]),
596 CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]),
597 CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_SPU]),
598 CLKDEV_CON_ID("vou_clk", &div6_clks[DIV6_VOU]),
599 CLKDEV_CON_ID("hdmi_clk", &div6_reparent_clks[DIV6_HDMI]),
600 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]),
601 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),
602 CLKDEV_ICK_ID("dsi0p_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
603 CLKDEV_ICK_ID("dsi1p_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
604
605 /* MSTP32 clocks */
606 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */
607 CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */
608 CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */
609 CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */
610 CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[MSTP128]), /* VEU0 */
611 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU */
612 CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2 */
613 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */
614 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */
615 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX0 */
616 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), /* LCDC1 */
617 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */
618 CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[MSTP106]), /* JPU */
619 CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP101]), /* VPU */
620 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */
621 CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[MSTP223]), /* SPU2DSP0 */
622 CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[MSTP223]), /* SPU2DSP1 */
623 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
624 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */
625 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
626 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */
627 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */
628 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */
629 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
630 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
631 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */
632 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */
633 CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */
634 CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USB0 */
635 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
636 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
637 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMC */
638 CLKDEV_DEV_ID("sh-mipi-dsi.1", &mstp_clks[MSTP423]), /* DSITX1 */
639 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]), /* SDHI2 */
640 CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */
641 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */
642 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */
643 CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */
644 CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */
645 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
646
647 CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
648 CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
649 CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
650};
651
652void __init sh7372_clock_init(void)
653{
654 int k, ret = 0;
655
656 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
657 ret = clk_register(main_clks[k]);
658
659 if (!ret)
660 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
661
662 if (!ret)
663 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
664
665 if (!ret)
666 ret = sh_clk_div6_reparent_register(div6_reparent_clks, DIV6_REPARENT_NR);
667
668 if (!ret)
669 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
670
671 for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
672 ret = clk_register(late_main_clks[k]);
673
674 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
675
676 if (!ret)
677 clk_init();
678 else
679 panic("failed to setup sh7372 clocks\n");
680
681}
diff --git a/arch/arm/mach-shmobile/clock-sh7377.c b/arch/arm/mach-shmobile/clock-sh7377.c
new file mode 100644
index 000000000000..95942466e63f
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-sh7377.c
@@ -0,0 +1,369 @@
1/*
2 * SH7377 clock framework support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/io.h>
22#include <linux/sh_clk.h>
23#include <linux/clkdev.h>
24#include <mach/common.h>
25
26/* SH7377 registers */
27#define RTFRQCR 0xe6150000
28#define SYFRQCR 0xe6150004
29#define CMFRQCR 0xe61500E0
30#define VCLKCR1 0xe6150008
31#define VCLKCR2 0xe615000C
32#define VCLKCR3 0xe615001C
33#define FMSICKCR 0xe6150010
34#define FMSOCKCR 0xe6150014
35#define FSICKCR 0xe6150018
36#define PLLC1CR 0xe6150028
37#define PLLC2CR 0xe615002C
38#define SUBUSBCKCR 0xe6150080
39#define SPUCKCR 0xe6150084
40#define MSUCKCR 0xe6150088
41#define MVI3CKCR 0xe6150090
42#define HDMICKCR 0xe6150094
43#define MFCK1CR 0xe6150098
44#define MFCK2CR 0xe615009C
45#define DSITCKCR 0xe6150060
46#define DSIPCKCR 0xe6150064
47#define SMSTPCR0 0xe6150130
48#define SMSTPCR1 0xe6150134
49#define SMSTPCR2 0xe6150138
50#define SMSTPCR3 0xe615013C
51#define SMSTPCR4 0xe6150140
52
53/* Fixed 32 KHz root clock from EXTALR pin */
54static struct clk r_clk = {
55 .rate = 32768,
56};
57
58/*
59 * 26MHz default rate for the EXTALC1 root input clock.
60 * If needed, reset this with clk_set_rate() from the platform code.
61 */
62struct clk sh7377_extalc1_clk = {
63 .rate = 26666666,
64};
65
66/*
67 * 48MHz default rate for the EXTAL2 root input clock.
68 * If needed, reset this with clk_set_rate() from the platform code.
69 */
70struct clk sh7377_extal2_clk = {
71 .rate = 48000000,
72};
73
74/* A fixed divide-by-2 block */
75static unsigned long div2_recalc(struct clk *clk)
76{
77 return clk->parent->rate / 2;
78}
79
80static struct clk_ops div2_clk_ops = {
81 .recalc = div2_recalc,
82};
83
84/* Divide extalc1 by two */
85static struct clk extalc1_div2_clk = {
86 .ops = &div2_clk_ops,
87 .parent = &sh7377_extalc1_clk,
88};
89
90/* Divide extal2 by two */
91static struct clk extal2_div2_clk = {
92 .ops = &div2_clk_ops,
93 .parent = &sh7377_extal2_clk,
94};
95
96/* Divide extal2 by four */
97static struct clk extal2_div4_clk = {
98 .ops = &div2_clk_ops,
99 .parent = &extal2_div2_clk,
100};
101
102/* PLLC1 */
103static unsigned long pllc1_recalc(struct clk *clk)
104{
105 unsigned long mult = 1;
106
107 if (__raw_readl(PLLC1CR) & (1 << 14))
108 mult = (((__raw_readl(RTFRQCR) >> 24) & 0x3f) + 1) * 2;
109
110 return clk->parent->rate * mult;
111}
112
113static struct clk_ops pllc1_clk_ops = {
114 .recalc = pllc1_recalc,
115};
116
117static struct clk pllc1_clk = {
118 .ops = &pllc1_clk_ops,
119 .flags = CLK_ENABLE_ON_INIT,
120 .parent = &extalc1_div2_clk,
121};
122
123/* Divide PLLC1 by two */
124static struct clk pllc1_div2_clk = {
125 .ops = &div2_clk_ops,
126 .parent = &pllc1_clk,
127};
128
129/* PLLC2 */
130static unsigned long pllc2_recalc(struct clk *clk)
131{
132 unsigned long mult = 1;
133
134 if (__raw_readl(PLLC2CR) & (1 << 31))
135 mult = (((__raw_readl(PLLC2CR) >> 24) & 0x3f) + 1) * 2;
136
137 return clk->parent->rate * mult;
138}
139
140static struct clk_ops pllc2_clk_ops = {
141 .recalc = pllc2_recalc,
142};
143
144static struct clk pllc2_clk = {
145 .ops = &pllc2_clk_ops,
146 .flags = CLK_ENABLE_ON_INIT,
147 .parent = &extalc1_div2_clk,
148};
149
150static struct clk *main_clks[] = {
151 &r_clk,
152 &sh7377_extalc1_clk,
153 &sh7377_extal2_clk,
154 &extalc1_div2_clk,
155 &extal2_div2_clk,
156 &extal2_div4_clk,
157 &pllc1_clk,
158 &pllc1_div2_clk,
159 &pllc2_clk,
160};
161
162static void div4_kick(struct clk *clk)
163{
164 unsigned long value;
165
166 /* set KICK bit in SYFRQCR to update hardware setting */
167 value = __raw_readl(SYFRQCR);
168 value |= (1 << 31);
169 __raw_writel(value, SYFRQCR);
170}
171
172static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
173 24, 32, 36, 48, 0, 72, 96, 0 };
174
175static struct clk_div_mult_table div4_div_mult_table = {
176 .divisors = divisors,
177 .nr_divisors = ARRAY_SIZE(divisors),
178};
179
180static struct clk_div4_table div4_table = {
181 .div_mult_table = &div4_div_mult_table,
182 .kick = div4_kick,
183};
184
185enum { DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_CSIR,
186 DIV4_ZTR, DIV4_ZT, DIV4_Z, DIV4_HP,
187 DIV4_ZS, DIV4_ZB, DIV4_ZB3, DIV4_CP, DIV4_NR };
188
189#define DIV4(_reg, _bit, _mask, _flags) \
190 SH_CLK_DIV4(&pllc1_clk, _reg, _bit, _mask, _flags)
191
192static struct clk div4_clks[DIV4_NR] = {
193 [DIV4_I] = DIV4(RTFRQCR, 20, 0x6fff, CLK_ENABLE_ON_INIT),
194 [DIV4_ZG] = DIV4(RTFRQCR, 16, 0x6fff, CLK_ENABLE_ON_INIT),
195 [DIV4_B] = DIV4(RTFRQCR, 8, 0x6fff, CLK_ENABLE_ON_INIT),
196 [DIV4_M1] = DIV4(RTFRQCR, 4, 0x6fff, CLK_ENABLE_ON_INIT),
197 [DIV4_CSIR] = DIV4(RTFRQCR, 0, 0x6fff, 0),
198 [DIV4_ZTR] = DIV4(SYFRQCR, 20, 0x6fff, 0),
199 [DIV4_ZT] = DIV4(SYFRQCR, 16, 0x6fff, 0),
200 [DIV4_Z] = DIV4(SYFRQCR, 12, 0x6fff, 0),
201 [DIV4_HP] = DIV4(SYFRQCR, 4, 0x6fff, 0),
202 [DIV4_ZS] = DIV4(CMFRQCR, 12, 0x6fff, 0),
203 [DIV4_ZB] = DIV4(CMFRQCR, 8, 0x6fff, 0),
204 [DIV4_ZB3] = DIV4(CMFRQCR, 4, 0x6fff, 0),
205 [DIV4_CP] = DIV4(CMFRQCR, 0, 0x6fff, 0),
206};
207
208enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_FMSI, DIV6_FMSO,
209 DIV6_FSI, DIV6_SUB, DIV6_SPU, DIV6_MSU, DIV6_MVI3, DIV6_HDMI,
210 DIV6_MF1, DIV6_MF2, DIV6_DSIT, DIV6_DSIP,
211 DIV6_NR };
212
213static struct clk div6_clks[] = {
214 [DIV6_VCK1] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR1, 0),
215 [DIV6_VCK2] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR2, 0),
216 [DIV6_VCK3] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR3, 0),
217 [DIV6_FMSI] = SH_CLK_DIV6(&pllc1_div2_clk, FMSICKCR, 0),
218 [DIV6_FMSO] = SH_CLK_DIV6(&pllc1_div2_clk, FMSOCKCR, 0),
219 [DIV6_FSI] = SH_CLK_DIV6(&pllc1_div2_clk, FSICKCR, 0),
220 [DIV6_SUB] = SH_CLK_DIV6(&sh7377_extal2_clk, SUBUSBCKCR, 0),
221 [DIV6_SPU] = SH_CLK_DIV6(&pllc1_div2_clk, SPUCKCR, 0),
222 [DIV6_MSU] = SH_CLK_DIV6(&pllc1_div2_clk, MSUCKCR, 0),
223 [DIV6_MVI3] = SH_CLK_DIV6(&pllc1_div2_clk, MVI3CKCR, 0),
224 [DIV6_HDMI] = SH_CLK_DIV6(&pllc1_div2_clk, HDMICKCR, 0),
225 [DIV6_MF1] = SH_CLK_DIV6(&pllc1_div2_clk, MFCK1CR, 0),
226 [DIV6_MF2] = SH_CLK_DIV6(&pllc1_div2_clk, MFCK2CR, 0),
227 [DIV6_DSIT] = SH_CLK_DIV6(&pllc1_div2_clk, DSITCKCR, 0),
228 [DIV6_DSIP] = SH_CLK_DIV6(&pllc1_div2_clk, DSIPCKCR, 0),
229};
230
231enum { MSTP001,
232 MSTP131, MSTP130, MSTP129, MSTP128, MSTP116, MSTP106, MSTP101,
233 MSTP223, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
234 MSTP331, MSTP329, MSTP325, MSTP323, MSTP322,
235 MSTP315, MSTP314, MSTP313,
236 MSTP403,
237 MSTP_NR };
238
239#define MSTP(_parent, _reg, _bit, _flags) \
240 SH_CLK_MSTP32(_parent, _reg, _bit, _flags)
241
242static struct clk mstp_clks[] = {
243 [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */
244 [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */
245 [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */
246 [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */
247 [MSTP128] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 28, 0), /* VEU0 */
248 [MSTP116] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 16, 0), /* IIC0 */
249 [MSTP106] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 6, 0), /* JPU */
250 [MSTP101] = MSTP(&div4_clks[DIV4_M1], SMSTPCR1, 1, 0), /* VPU */
251 [MSTP223] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR2, 23, 0), /* SPU2 */
252 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
253 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
254 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
255 [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */
256 [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */
257 [MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */
258 [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
259 [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */
260 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
261 [MSTP325] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 25, 0), /* IRDA */
262 [MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */
263 [MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */
264 [MSTP315] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 15, 0), /* FLCTL */
265 [MSTP314] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */
266 [MSTP313] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */
267 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
268};
269
270#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
271#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
272
273static struct clk_lookup lookups[] = {
274 /* main clocks */
275 CLKDEV_CON_ID("r_clk", &r_clk),
276 CLKDEV_CON_ID("extalc1", &sh7377_extalc1_clk),
277 CLKDEV_CON_ID("extal2", &sh7377_extal2_clk),
278 CLKDEV_CON_ID("extalc1_div2_clk", &extalc1_div2_clk),
279 CLKDEV_CON_ID("extal2_div2_clk", &extal2_div2_clk),
280 CLKDEV_CON_ID("extal2_div4_clk", &extal2_div4_clk),
281 CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
282 CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
283 CLKDEV_CON_ID("pllc2_clk", &pllc2_clk),
284
285 /* DIV4 clocks */
286 CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
287 CLKDEV_CON_ID("zg_clk", &div4_clks[DIV4_ZG]),
288 CLKDEV_CON_ID("b_clk", &div4_clks[DIV4_B]),
289 CLKDEV_CON_ID("m1_clk", &div4_clks[DIV4_M1]),
290 CLKDEV_CON_ID("csir_clk", &div4_clks[DIV4_CSIR]),
291 CLKDEV_CON_ID("ztr_clk", &div4_clks[DIV4_ZTR]),
292 CLKDEV_CON_ID("zt_clk", &div4_clks[DIV4_ZT]),
293 CLKDEV_CON_ID("z_clk", &div4_clks[DIV4_Z]),
294 CLKDEV_CON_ID("hp_clk", &div4_clks[DIV4_HP]),
295 CLKDEV_CON_ID("zs_clk", &div4_clks[DIV4_ZS]),
296 CLKDEV_CON_ID("zb_clk", &div4_clks[DIV4_ZB]),
297 CLKDEV_CON_ID("zb3_clk", &div4_clks[DIV4_ZB3]),
298 CLKDEV_CON_ID("cp_clk", &div4_clks[DIV4_CP]),
299
300 /* DIV6 clocks */
301 CLKDEV_CON_ID("vck1_clk", &div6_clks[DIV6_VCK1]),
302 CLKDEV_CON_ID("vck2_clk", &div6_clks[DIV6_VCK2]),
303 CLKDEV_CON_ID("vck3_clk", &div6_clks[DIV6_VCK3]),
304 CLKDEV_CON_ID("fmsi_clk", &div6_clks[DIV6_FMSI]),
305 CLKDEV_CON_ID("fmso_clk", &div6_clks[DIV6_FMSO]),
306 CLKDEV_CON_ID("fsi_clk", &div6_clks[DIV6_FSI]),
307 CLKDEV_CON_ID("sub_clk", &div6_clks[DIV6_SUB]),
308 CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_SPU]),
309 CLKDEV_CON_ID("msu_clk", &div6_clks[DIV6_MSU]),
310 CLKDEV_CON_ID("mvi3_clk", &div6_clks[DIV6_MVI3]),
311 CLKDEV_CON_ID("hdmi_clk", &div6_clks[DIV6_HDMI]),
312 CLKDEV_CON_ID("mf1_clk", &div6_clks[DIV6_MF1]),
313 CLKDEV_CON_ID("mf2_clk", &div6_clks[DIV6_MF2]),
314 CLKDEV_CON_ID("dsit_clk", &div6_clks[DIV6_DSIT]),
315 CLKDEV_CON_ID("dsip_clk", &div6_clks[DIV6_DSIP]),
316
317 /* MSTP32 clocks */
318 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */
319 CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */
320 CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */
321 CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */
322 CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[MSTP128]), /* VEU0 */
323 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */
324 CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[MSTP106]), /* JPU */
325 CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP101]), /* VPU */
326 CLKDEV_DEV_ID("uio_pdrv_genirq.6", &mstp_clks[MSTP223]), /* SPU2DSP0 */
327 CLKDEV_DEV_ID("uio_pdrv_genirq.7", &mstp_clks[MSTP223]), /* SPU2DSP1 */
328 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
329 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP206]), /* SCIFB */
330 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
331 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */
332 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */
333 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */
334 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
335 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
336 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
337 CLKDEV_DEV_ID("sh_irda", &mstp_clks[MSTP325]), /* IRDA */
338 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */
339 CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USBHS */
340 CLKDEV_DEV_ID("r8a66597_udc.0", &mstp_clks[MSTP322]), /* USBHS */
341 CLKDEV_DEV_ID("sh_flctl", &mstp_clks[MSTP315]), /* FLCTL */
342 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), /* SDHI0 */
343 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), /* SDHI1 */
344 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
345};
346
347void __init sh7377_clock_init(void)
348{
349 int k, ret = 0;
350
351 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
352 ret = clk_register(main_clks[k]);
353
354 if (!ret)
355 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
356
357 if (!ret)
358 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
359
360 if (!ret)
361 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
362
363 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
364
365 if (!ret)
366 clk_init();
367 else
368 panic("failed to setup sh7377 clocks\n");
369}
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
new file mode 100644
index 000000000000..720a71433be6
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -0,0 +1,356 @@
1/*
2 * sh73a0 clock framework support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/io.h>
22#include <linux/sh_clk.h>
23#include <linux/clkdev.h>
24#include <mach/common.h>
25
26#define FRQCRA 0xe6150000
27#define FRQCRB 0xe6150004
28#define FRQCRD 0xe61500e4
29#define VCLKCR1 0xe6150008
30#define VCLKCR2 0xe615000C
31#define VCLKCR3 0xe615001C
32#define ZBCKCR 0xe6150010
33#define FLCKCR 0xe6150014
34#define SD0CKCR 0xe6150074
35#define SD1CKCR 0xe6150078
36#define SD2CKCR 0xe615007C
37#define FSIACKCR 0xe6150018
38#define FSIBCKCR 0xe6150090
39#define SUBCKCR 0xe6150080
40#define SPUACKCR 0xe6150084
41#define SPUVCKCR 0xe6150094
42#define MSUCKCR 0xe6150088
43#define HSICKCR 0xe615008C
44#define MFCK1CR 0xe6150098
45#define MFCK2CR 0xe615009C
46#define DSITCKCR 0xe6150060
47#define DSI0PCKCR 0xe6150064
48#define DSI1PCKCR 0xe6150068
49#define DSI0PHYCR 0xe615006C
50#define DSI1PHYCR 0xe6150070
51#define PLLECR 0xe61500d0
52#define PLL0CR 0xe61500d8
53#define PLL1CR 0xe6150028
54#define PLL2CR 0xe615002c
55#define PLL3CR 0xe61500dc
56#define SMSTPCR0 0xe6150130
57#define SMSTPCR1 0xe6150134
58#define SMSTPCR2 0xe6150138
59#define SMSTPCR3 0xe615013c
60#define SMSTPCR4 0xe6150140
61#define SMSTPCR5 0xe6150144
62#define CKSCR 0xe61500c0
63
64/* Fixed 32 KHz root clock from EXTALR pin */
65static struct clk r_clk = {
66 .rate = 32768,
67};
68
69/*
70 * 26MHz default rate for the EXTAL1 root input clock.
71 * If needed, reset this with clk_set_rate() from the platform code.
72 */
73struct clk sh73a0_extal1_clk = {
74 .rate = 26000000,
75};
76
77/*
78 * 48MHz default rate for the EXTAL2 root input clock.
79 * If needed, reset this with clk_set_rate() from the platform code.
80 */
81struct clk sh73a0_extal2_clk = {
82 .rate = 48000000,
83};
84
85/* A fixed divide-by-2 block */
86static unsigned long div2_recalc(struct clk *clk)
87{
88 return clk->parent->rate / 2;
89}
90
91static struct clk_ops div2_clk_ops = {
92 .recalc = div2_recalc,
93};
94
95/* Divide extal1 by two */
96static struct clk extal1_div2_clk = {
97 .ops = &div2_clk_ops,
98 .parent = &sh73a0_extal1_clk,
99};
100
101/* Divide extal2 by two */
102static struct clk extal2_div2_clk = {
103 .ops = &div2_clk_ops,
104 .parent = &sh73a0_extal2_clk,
105};
106
107static struct clk_ops main_clk_ops = {
108 .recalc = followparent_recalc,
109};
110
111/* Main clock */
112static struct clk main_clk = {
113 .ops = &main_clk_ops,
114};
115
116/* PLL0, PLL1, PLL2, PLL3 */
117static unsigned long pll_recalc(struct clk *clk)
118{
119 unsigned long mult = 1;
120
121 if (__raw_readl(PLLECR) & (1 << clk->enable_bit))
122 mult = (((__raw_readl(clk->enable_reg) >> 24) & 0x3f) + 1);
123
124 return clk->parent->rate * mult;
125}
126
127static struct clk_ops pll_clk_ops = {
128 .recalc = pll_recalc,
129};
130
131static struct clk pll0_clk = {
132 .ops = &pll_clk_ops,
133 .flags = CLK_ENABLE_ON_INIT,
134 .parent = &main_clk,
135 .enable_reg = (void __iomem *)PLL0CR,
136 .enable_bit = 0,
137};
138
139static struct clk pll1_clk = {
140 .ops = &pll_clk_ops,
141 .flags = CLK_ENABLE_ON_INIT,
142 .parent = &main_clk,
143 .enable_reg = (void __iomem *)PLL1CR,
144 .enable_bit = 1,
145};
146
147static struct clk pll2_clk = {
148 .ops = &pll_clk_ops,
149 .flags = CLK_ENABLE_ON_INIT,
150 .parent = &main_clk,
151 .enable_reg = (void __iomem *)PLL2CR,
152 .enable_bit = 2,
153};
154
155static struct clk pll3_clk = {
156 .ops = &pll_clk_ops,
157 .flags = CLK_ENABLE_ON_INIT,
158 .parent = &main_clk,
159 .enable_reg = (void __iomem *)PLL3CR,
160 .enable_bit = 3,
161};
162
163/* Divide PLL1 by two */
164static struct clk pll1_div2_clk = {
165 .ops = &div2_clk_ops,
166 .parent = &pll1_clk,
167};
168
169static struct clk *main_clks[] = {
170 &r_clk,
171 &sh73a0_extal1_clk,
172 &sh73a0_extal2_clk,
173 &extal1_div2_clk,
174 &extal2_div2_clk,
175 &main_clk,
176 &pll0_clk,
177 &pll1_clk,
178 &pll2_clk,
179 &pll3_clk,
180 &pll1_div2_clk,
181};
182
183static void div4_kick(struct clk *clk)
184{
185 unsigned long value;
186
187 /* set KICK bit in FRQCRB to update hardware setting */
188 value = __raw_readl(FRQCRB);
189 value |= (1 << 31);
190 __raw_writel(value, FRQCRB);
191}
192
193static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18,
194 24, 0, 36, 48, 7 };
195
196static struct clk_div_mult_table div4_div_mult_table = {
197 .divisors = divisors,
198 .nr_divisors = ARRAY_SIZE(divisors),
199};
200
201static struct clk_div4_table div4_table = {
202 .div_mult_table = &div4_div_mult_table,
203 .kick = div4_kick,
204};
205
206enum { DIV4_I, DIV4_ZG, DIV4_M3, DIV4_B, DIV4_M1, DIV4_M2,
207 DIV4_Z, DIV4_ZTR, DIV4_ZT, DIV4_ZX, DIV4_HP, DIV4_NR };
208
209#define DIV4(_reg, _bit, _mask, _flags) \
210 SH_CLK_DIV4(&pll1_clk, _reg, _bit, _mask, _flags)
211
212static struct clk div4_clks[DIV4_NR] = {
213 [DIV4_I] = DIV4(FRQCRA, 20, 0xfff, CLK_ENABLE_ON_INIT),
214 [DIV4_ZG] = DIV4(FRQCRA, 16, 0xbff, CLK_ENABLE_ON_INIT),
215 [DIV4_M3] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT),
216 [DIV4_B] = DIV4(FRQCRA, 8, 0xfff, CLK_ENABLE_ON_INIT),
217 [DIV4_M1] = DIV4(FRQCRA, 4, 0xfff, 0),
218 [DIV4_M2] = DIV4(FRQCRA, 0, 0xfff, 0),
219 [DIV4_Z] = DIV4(FRQCRB, 24, 0xbff, 0),
220 [DIV4_ZTR] = DIV4(FRQCRB, 20, 0xfff, 0),
221 [DIV4_ZT] = DIV4(FRQCRB, 16, 0xfff, 0),
222 [DIV4_ZX] = DIV4(FRQCRB, 12, 0xfff, 0),
223 [DIV4_HP] = DIV4(FRQCRB, 4, 0xfff, 0),
224};
225
226enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_ZB1,
227 DIV6_FLCTL, DIV6_SDHI0, DIV6_SDHI1, DIV6_SDHI2,
228 DIV6_FSIA, DIV6_FSIB, DIV6_SUB,
229 DIV6_SPUA, DIV6_SPUV, DIV6_MSU,
230 DIV6_HSI, DIV6_MFG1, DIV6_MFG2,
231 DIV6_DSIT, DIV6_DSI0P, DIV6_DSI1P,
232 DIV6_NR };
233
234static struct clk div6_clks[DIV6_NR] = {
235 [DIV6_VCK1] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR1, 0),
236 [DIV6_VCK2] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR2, 0),
237 [DIV6_VCK3] = SH_CLK_DIV6(&pll1_div2_clk, VCLKCR3, 0),
238 [DIV6_ZB1] = SH_CLK_DIV6(&pll1_div2_clk, ZBCKCR, 0),
239 [DIV6_FLCTL] = SH_CLK_DIV6(&pll1_div2_clk, FLCKCR, 0),
240 [DIV6_SDHI0] = SH_CLK_DIV6(&pll1_div2_clk, SD0CKCR, 0),
241 [DIV6_SDHI1] = SH_CLK_DIV6(&pll1_div2_clk, SD1CKCR, 0),
242 [DIV6_SDHI2] = SH_CLK_DIV6(&pll1_div2_clk, SD2CKCR, 0),
243 [DIV6_FSIA] = SH_CLK_DIV6(&pll1_div2_clk, FSIACKCR, 0),
244 [DIV6_FSIB] = SH_CLK_DIV6(&pll1_div2_clk, FSIBCKCR, 0),
245 [DIV6_SUB] = SH_CLK_DIV6(&sh73a0_extal2_clk, SUBCKCR, 0),
246 [DIV6_SPUA] = SH_CLK_DIV6(&pll1_div2_clk, SPUACKCR, 0),
247 [DIV6_SPUV] = SH_CLK_DIV6(&pll1_div2_clk, SPUVCKCR, 0),
248 [DIV6_MSU] = SH_CLK_DIV6(&pll1_div2_clk, MSUCKCR, 0),
249 [DIV6_HSI] = SH_CLK_DIV6(&pll1_div2_clk, HSICKCR, 0),
250 [DIV6_MFG1] = SH_CLK_DIV6(&pll1_div2_clk, MFCK1CR, 0),
251 [DIV6_MFG2] = SH_CLK_DIV6(&pll1_div2_clk, MFCK2CR, 0),
252 [DIV6_DSIT] = SH_CLK_DIV6(&pll1_div2_clk, DSITCKCR, 0),
253 [DIV6_DSI0P] = SH_CLK_DIV6(&pll1_div2_clk, DSI0PCKCR, 0),
254 [DIV6_DSI1P] = SH_CLK_DIV6(&pll1_div2_clk, DSI1PCKCR, 0),
255};
256
257enum { MSTP001,
258 MSTP125, MSTP116,
259 MSTP219,
260 MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
261 MSTP331, MSTP329, MSTP323, MSTP312,
262 MSTP411, MSTP410, MSTP403,
263 MSTP_NR };
264
265#define MSTP(_parent, _reg, _bit, _flags) \
266 SH_CLK_MSTP32(_parent, _reg, _bit, _flags)
267
268static struct clk mstp_clks[MSTP_NR] = {
269 [MSTP001] = MSTP(&div4_clks[DIV4_HP], SMSTPCR0, 1, 0), /* IIC2 */
270 [MSTP125] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR1, 25, 0), /* TMU0 */
271 [MSTP116] = MSTP(&div4_clks[DIV4_HP], SMSTPCR1, 16, 0), /* IIC0 */
272 [MSTP219] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 19, 0), /* SCIFA7 */
273 [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
274 [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
275 [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
276 [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */
277 [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */
278 [MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */
279 [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */
280 [MSTP331] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 31, 0), /* SCIFA6 */
281 [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */
282 [MSTP323] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 23, 0), /* IIC1 */
283 [MSTP312] = MSTP(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMCIF0 */
284 [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */
285 [MSTP410] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */
286 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
287};
288
289#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
290#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
291
292static struct clk_lookup lookups[] = {
293 /* main clocks */
294 CLKDEV_CON_ID("r_clk", &r_clk),
295
296 /* MSTP32 clocks */
297 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
298 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */
299 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */
300 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
301 CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */
302 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
303 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */
304 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
305 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */
306 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */
307 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */
308 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
309 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
310 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
311 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
312 CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP312]), /* MMCIF0 */
313 CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* I2C3 */
314 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
315 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
316};
317
318void __init sh73a0_clock_init(void)
319{
320 int k, ret = 0;
321
322 /* detect main clock parent */
323 switch ((__raw_readl(CKSCR) >> 24) & 0x03) {
324 case 0:
325 main_clk.parent = &sh73a0_extal1_clk;
326 break;
327 case 1:
328 main_clk.parent = &extal1_div2_clk;
329 break;
330 case 2:
331 main_clk.parent = &sh73a0_extal2_clk;
332 break;
333 case 3:
334 main_clk.parent = &extal2_div2_clk;
335 break;
336 }
337
338 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
339 ret = clk_register(main_clks[k]);
340
341 if (!ret)
342 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
343
344 if (!ret)
345 ret = sh_clk_div6_register(div6_clks, DIV6_NR);
346
347 if (!ret)
348 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
349
350 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
351
352 if (!ret)
353 clk_init();
354 else
355 panic("failed to setup sh73a0 clocks\n");
356}
diff --git a/arch/arm/mach-shmobile/clock.c b/arch/arm/mach-shmobile/clock.c
new file mode 100644
index 000000000000..6b7c7c42bc8f
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock.c
@@ -0,0 +1,46 @@
1/*
2 * SH-Mobile Clock Framework
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * Used together with arch/arm/common/clkdev.c and drivers/sh/clk.c.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 */
22#include <linux/kernel.h>
23#include <linux/init.h>
24#include <linux/sh_clk.h>
25
26int __init clk_init(void)
27{
28 /* Kick the child clocks.. */
29 recalculate_root_clocks();
30
31 /* Enable the necessary init clocks */
32 clk_enable_init_clocks();
33
34 return 0;
35}
36
37int __clk_get(struct clk *clk)
38{
39 return 1;
40}
41EXPORT_SYMBOL(__clk_get);
42
43void __clk_put(struct clk *clk)
44{
45}
46EXPORT_SYMBOL(__clk_put);
diff --git a/arch/arm/mach-shmobile/console.c b/arch/arm/mach-shmobile/console.c
new file mode 100644
index 000000000000..9411a5bf4fd6
--- /dev/null
+++ b/arch/arm/mach-shmobile/console.c
@@ -0,0 +1,31 @@
1/*
2 * SH-Mobile Console
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/platform_device.h>
22#include <mach/common.h>
23#include <asm/mach/map.h>
24
25void __init shmobile_setup_console(void)
26{
27 parse_early_param();
28
29 /* Let earlyprintk output early console messages */
30 early_platform_driver_probe("earlyprintk", 1, 1);
31}
diff --git a/arch/arm/mach-shmobile/entry-gic.S b/arch/arm/mach-shmobile/entry-gic.S
new file mode 100644
index 000000000000..e20239b08c83
--- /dev/null
+++ b/arch/arm/mach-shmobile/entry-gic.S
@@ -0,0 +1,18 @@
1/*
2 * ARM Interrupt demux handler using GIC
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2011 Paul Mundt
6 * Copyright (C) 2010 - 2011 Renesas Solutions Corp.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <asm/assembler.h>
14#include <asm/entry-macro-multi.S>
15#include <asm/hardware/gic.h>
16#include <asm/hardware/entry-macro-gic.S>
17
18 arch_irq_handler shmobile_handle_irq_gic
diff --git a/arch/arm/mach-shmobile/entry-intc.S b/arch/arm/mach-shmobile/entry-intc.S
new file mode 100644
index 000000000000..cac0a7ae2084
--- /dev/null
+++ b/arch/arm/mach-shmobile/entry-intc.S
@@ -0,0 +1,57 @@
1/*
2 * ARM Interrupt demux handler using INTC
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Renesas Solutions Corp.
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <asm/entry-macro-multi.S>
13
14#define INTCA_BASE 0xe6980000
15#define INTFLGA_OFFS 0x00000018 /* accept pending interrupt */
16#define INTEVTA_OFFS 0x00000020 /* vector number of accepted interrupt */
17#define INTLVLA_OFFS 0x00000030 /* priority level of accepted interrupt */
18#define INTLVLB_OFFS 0x00000034 /* previous priority level */
19
20 .macro get_irqnr_preamble, base, tmp
21 ldr \base, =INTCA_BASE
22 .endm
23
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
25 /* The single INTFLGA read access below results in the following:
26 *
27 * 1. INTLVLB is updated with old priority value from INTLVLA
28 * 2. Highest priority interrupt is accepted
29 * 3. INTLVLA is updated to contain priority of accepted interrupt
30 * 4. Accepted interrupt vector is stored in INTFLGA and INTEVTA
31 */
32 ldr \irqnr, [\base, #INTFLGA_OFFS]
33
34 /* Restore INTLVLA with the value saved in INTLVLB.
35 * This is required to support interrupt priorities properly.
36 */
37 ldrb \tmp, [\base, #INTLVLB_OFFS]
38 strb \tmp, [\base, #INTLVLA_OFFS]
39
40 /* Handle invalid vector number case */
41 cmp \irqnr, #0
42 beq 1000f
43
44 /* Convert vector to irq number, same as the evt2irq() macro */
45 lsr \irqnr, \irqnr, #0x5
46 subs \irqnr, \irqnr, #16
47
481000:
49 .endm
50
51 .macro test_for_ipi, irqnr, irqstat, base, tmp
52 .endm
53
54 .macro test_for_ltirq, irqnr, irqstat, base, tmp
55 .endm
56
57 arch_irq_handler shmobile_handle_irq_intc
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
new file mode 100644
index 000000000000..d4cec6b4c7d9
--- /dev/null
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -0,0 +1,27 @@
1/*
2 * SMP support for R-Mobile / SH-Mobile
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2010 Takashi Yoshii
6 *
7 * Based on vexpress, Copyright (c) 2003 ARM Limited, All Rights Reserved
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/linkage.h>
14#include <linux/init.h>
15#include <asm/memory.h>
16
17 __INIT
18
19/*
20 * Reset vector for secondary CPUs.
21 * This will be mapped at address 0 by SBAR register.
22 * We need _long_ jump to the physical address.
23 */
24 .align 12
25ENTRY(shmobile_secondary_vector)
26 ldr pc, 1f
271: .long secondary_startup - PAGE_OFFSET + PHYS_OFFSET
diff --git a/arch/arm/mach-shmobile/hotplug.c b/arch/arm/mach-shmobile/hotplug.c
new file mode 100644
index 000000000000..238a0d97d2d5
--- /dev/null
+++ b/arch/arm/mach-shmobile/hotplug.c
@@ -0,0 +1,41 @@
1/*
2 * SMP support for R-Mobile / SH-Mobile
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * Based on realview, Copyright (C) 2002 ARM Ltd, All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/kernel.h>
13#include <linux/errno.h>
14#include <linux/smp.h>
15
16int platform_cpu_kill(unsigned int cpu)
17{
18 return 1;
19}
20
21void platform_cpu_die(unsigned int cpu)
22{
23 while (1) {
24 /*
25 * here's the WFI
26 */
27 asm(".word 0xe320f003\n"
28 :
29 :
30 : "memory", "cc");
31 }
32}
33
34int platform_cpu_disable(unsigned int cpu)
35{
36 /*
37 * we don't allow CPU 0 to be shutdown (it is still too special
38 * e.g. clock tick interrupts)
39 */
40 return cpu == 0 ? -EPERM : 0;
41}
diff --git a/arch/arm/mach-shmobile/include/mach/clkdev.h b/arch/arm/mach-shmobile/include/mach/clkdev.h
new file mode 100644
index 000000000000..36d0163a857a
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4int __clk_get(struct clk *clk);
5void __clk_put(struct clk *clk);
6
7#endif /* __ASM_MACH_CLKDEV_H */
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
new file mode 100644
index 000000000000..013ac0ee8256
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -0,0 +1,49 @@
1#ifndef __ARCH_MACH_COMMON_H
2#define __ARCH_MACH_COMMON_H
3
4extern struct sys_timer shmobile_timer;
5extern void shmobile_setup_console(void);
6extern void shmobile_secondary_vector(void);
7struct clk;
8extern int clk_init(void);
9extern void shmobile_handle_irq_intc(struct pt_regs *);
10extern void shmobile_handle_irq_gic(struct pt_regs *);
11
12extern void sh7367_init_irq(void);
13extern void sh7367_add_early_devices(void);
14extern void sh7367_add_standard_devices(void);
15extern void sh7367_clock_init(void);
16extern void sh7367_pinmux_init(void);
17extern struct clk sh7367_extalb1_clk;
18extern struct clk sh7367_extal2_clk;
19
20extern void sh7377_init_irq(void);
21extern void sh7377_add_early_devices(void);
22extern void sh7377_add_standard_devices(void);
23extern void sh7377_clock_init(void);
24extern void sh7377_pinmux_init(void);
25extern struct clk sh7377_extalc1_clk;
26extern struct clk sh7377_extal2_clk;
27
28extern void sh7372_init_irq(void);
29extern void sh7372_add_early_devices(void);
30extern void sh7372_add_standard_devices(void);
31extern void sh7372_clock_init(void);
32extern void sh7372_pinmux_init(void);
33extern struct clk sh7372_extal1_clk;
34extern struct clk sh7372_extal2_clk;
35
36extern void sh73a0_init_irq(void);
37extern void sh73a0_add_early_devices(void);
38extern void sh73a0_add_standard_devices(void);
39extern void sh73a0_clock_init(void);
40extern void sh73a0_pinmux_init(void);
41extern struct clk sh73a0_extal1_clk;
42extern struct clk sh73a0_extal2_clk;
43
44extern unsigned int sh73a0_get_core_count(void);
45extern void sh73a0_secondary_init(unsigned int cpu);
46extern int sh73a0_boot_secondary(unsigned int cpu);
47extern void sh73a0_smp_prepare_cpus(void);
48
49#endif /* __ARCH_MACH_COMMON_H */
diff --git a/arch/arm/mach-shmobile/include/mach/dma.h b/arch/arm/mach-shmobile/include/mach/dma.h
new file mode 100644
index 000000000000..40a8c178f10d
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/dma.h
@@ -0,0 +1 @@
/* empty */
diff --git a/arch/arm/mach-shmobile/include/mach/entry-macro.S b/arch/arm/mach-shmobile/include/mach/entry-macro.S
new file mode 100644
index 000000000000..d791f10eeac7
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/entry-macro.S
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2010 Paul Mundt
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17
18 .macro disable_fiq
19 .endm
20
21 .macro get_irqnr_preamble, base, tmp
22 .endm
23
24 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
25 .endm
26
27 .macro test_for_ipi, irqnr, irqstat, base, tmp
28 .endm
29
30 .macro test_for_ltirq, irqnr, irqstat, base, tmp
31 .endm
32
33 .macro arch_ret_to_user, tmp1, tmp2
34 .endm
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h
new file mode 100644
index 000000000000..2b1bb9e43dda
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/gpio.h
@@ -0,0 +1,48 @@
1/*
2 * Generic GPIO API and pinmux table support
3 *
4 * Copyright (c) 2008 Magnus Damm
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#ifndef __ASM_ARCH_GPIO_H
11#define __ASM_ARCH_GPIO_H
12
13#include <linux/kernel.h>
14#include <linux/errno.h>
15
16#define ARCH_NR_GPIOS 1024
17#include <linux/sh_pfc.h>
18
19#ifdef CONFIG_GPIOLIB
20
21static inline int gpio_get_value(unsigned gpio)
22{
23 return __gpio_get_value(gpio);
24}
25
26static inline void gpio_set_value(unsigned gpio, int value)
27{
28 __gpio_set_value(gpio, value);
29}
30
31static inline int gpio_cansleep(unsigned gpio)
32{
33 return __gpio_cansleep(gpio);
34}
35
36static inline int gpio_to_irq(unsigned gpio)
37{
38 return __gpio_to_irq(gpio);
39}
40
41static inline int irq_to_gpio(unsigned int irq)
42{
43 return -ENOSYS;
44}
45
46#endif /* CONFIG_GPIOLIB */
47
48#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-shmobile/include/mach/hardware.h b/arch/arm/mach-shmobile/include/mach/hardware.h
new file mode 100644
index 000000000000..99264a5ce5e4
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/hardware.h
@@ -0,0 +1,4 @@
1#ifndef __ASM_MACH_HARDWARE_H
2#define __ASM_MACH_HARDWARE_H
3
4#endif /* __ASM_MACH_HARDWARE_H */
diff --git a/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt b/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt
new file mode 100644
index 000000000000..e3ebfa73956e
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/head-ap4evb.txt
@@ -0,0 +1,87 @@
1LIST "partner-jet-setup.txt"
2LIST "(C) Copyright 2010 Renesas Solutions Corp"
3LIST "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"
4
5LIST "RWT Setting"
6EW 0xE6020004, 0xA500
7EW 0xE6030004, 0xA500
8
9DD 0x01001000, 0x01001000
10
11LIST "GPIO Setting"
12EB 0xE6051013, 0xA2
13
14LIST "CPG"
15ED 0xE6150080, 0x00000180
16ED 0xE61500C0, 0x00000002
17
18WAIT 1, 0xFE40009C
19
20LIST "FRQCR"
21ED 0xE6150000, 0x2D1305C3
22ED 0xE61500E0, 0x9E40358E
23ED 0xE6150004, 0x80331050
24
25WAIT 1, 0xFE40009C
26
27ED 0xE61500E4, 0x00002000
28
29WAIT 1, 0xFE40009C
30
31LIST "PLL"
32ED 0xE6150028, 0x00004000
33
34WAIT 1, 0xFE40009C
35
36ED 0xE615002C, 0x93000040
37
38WAIT 1, 0xFE40009C
39
40LIST "BSC"
41ED 0xFEC10000, 0x00E0001B
42
43LIST "SBSC1"
44ED 0xFE400354, 0x01AD8000
45ED 0xFE400354, 0x01AD8001
46
47WAIT 5, 0xFE40009C
48
49ED 0xFE400008, 0xBCC90151
50ED 0xFE400040, 0x41774113
51ED 0xFE400044, 0x2712E229
52ED 0xFE400048, 0x20C18505
53ED 0xFE40004C, 0x00110209
54ED 0xFE400010, 0x00000087
55
56WAIT 10, 0xFE40009C
57
58ED 0xFE400084, 0x0000003F
59EB 0xFE500000, 0x00
60
61WAIT 5, 0xFE40009C
62
63ED 0xFE400084, 0x0000FF0A
64EB 0xFE500000, 0x00
65
66WAIT 1, 0xFE40009C
67
68ED 0xFE400084, 0x00002201
69EB 0xFE500000, 0x00
70ED 0xFE400084, 0x00000302
71EB 0xFE500000, 0x00
72EB 0xFE5C0000, 0x00
73ED 0xFE400008, 0xBCC90159
74ED 0xFE40008C, 0x88800004
75ED 0xFE400094, 0x00000004
76ED 0xFE400028, 0xA55A0032
77ED 0xFE40002C, 0xA55A000C
78ED 0xFE400020, 0xA55A2048
79ED 0xFE400008, 0xBCC90959
80
81LIST "Change CPGA setting"
82ED 0xE61500E0, 0x9E40352E
83ED 0xE6150004, 0x80331050
84
85WAIT 1, 0xFE40009C
86
87ED 0xE6150354, 0x00000002
diff --git a/arch/arm/mach-shmobile/include/mach/head-mackerel.txt b/arch/arm/mach-shmobile/include/mach/head-mackerel.txt
new file mode 100644
index 000000000000..e3ebfa73956e
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/head-mackerel.txt
@@ -0,0 +1,87 @@
1LIST "partner-jet-setup.txt"
2LIST "(C) Copyright 2010 Renesas Solutions Corp"
3LIST "Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"
4
5LIST "RWT Setting"
6EW 0xE6020004, 0xA500
7EW 0xE6030004, 0xA500
8
9DD 0x01001000, 0x01001000
10
11LIST "GPIO Setting"
12EB 0xE6051013, 0xA2
13
14LIST "CPG"
15ED 0xE6150080, 0x00000180
16ED 0xE61500C0, 0x00000002
17
18WAIT 1, 0xFE40009C
19
20LIST "FRQCR"
21ED 0xE6150000, 0x2D1305C3
22ED 0xE61500E0, 0x9E40358E
23ED 0xE6150004, 0x80331050
24
25WAIT 1, 0xFE40009C
26
27ED 0xE61500E4, 0x00002000
28
29WAIT 1, 0xFE40009C
30
31LIST "PLL"
32ED 0xE6150028, 0x00004000
33
34WAIT 1, 0xFE40009C
35
36ED 0xE615002C, 0x93000040
37
38WAIT 1, 0xFE40009C
39
40LIST "BSC"
41ED 0xFEC10000, 0x00E0001B
42
43LIST "SBSC1"
44ED 0xFE400354, 0x01AD8000
45ED 0xFE400354, 0x01AD8001
46
47WAIT 5, 0xFE40009C
48
49ED 0xFE400008, 0xBCC90151
50ED 0xFE400040, 0x41774113
51ED 0xFE400044, 0x2712E229
52ED 0xFE400048, 0x20C18505
53ED 0xFE40004C, 0x00110209
54ED 0xFE400010, 0x00000087
55
56WAIT 10, 0xFE40009C
57
58ED 0xFE400084, 0x0000003F
59EB 0xFE500000, 0x00
60
61WAIT 5, 0xFE40009C
62
63ED 0xFE400084, 0x0000FF0A
64EB 0xFE500000, 0x00
65
66WAIT 1, 0xFE40009C
67
68ED 0xFE400084, 0x00002201
69EB 0xFE500000, 0x00
70ED 0xFE400084, 0x00000302
71EB 0xFE500000, 0x00
72EB 0xFE5C0000, 0x00
73ED 0xFE400008, 0xBCC90159
74ED 0xFE40008C, 0x88800004
75ED 0xFE400094, 0x00000004
76ED 0xFE400028, 0xA55A0032
77ED 0xFE40002C, 0xA55A000C
78ED 0xFE400020, 0xA55A2048
79ED 0xFE400008, 0xBCC90959
80
81LIST "Change CPGA setting"
82ED 0xE61500E0, 0x9E40352E
83ED 0xE6150004, 0x80331050
84
85WAIT 1, 0xFE40009C
86
87ED 0xE6150354, 0x00000002
diff --git a/arch/arm/mach-shmobile/include/mach/io.h b/arch/arm/mach-shmobile/include/mach/io.h
new file mode 100644
index 000000000000..7339fe46cb7c
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/io.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_MACH_IO_H
2#define __ASM_MACH_IO_H
3
4#define IO_SPACE_LIMIT 0xffffffff
5
6#define __io(a) ((void __iomem *)(a))
7#define __mem_pci(a) (a)
8
9#endif /* __ASM_MACH_IO_H */
diff --git a/arch/arm/mach-shmobile/include/mach/irqs.h b/arch/arm/mach-shmobile/include/mach/irqs.h
new file mode 100644
index 000000000000..dcb714f4d75a
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/irqs.h
@@ -0,0 +1,18 @@
1#ifndef __ASM_MACH_IRQS_H
2#define __ASM_MACH_IRQS_H
3
4#define NR_IRQS 1024
5
6/* GIC */
7#define gic_spi(nr) ((nr) + 32)
8
9/* INTCA */
10#define evt2irq(evt) (((evt) >> 5) - 16)
11#define irq2evt(irq) (((irq) + 16) << 5)
12
13/* INTCS */
14#define INTCS_VECT_BASE 0x2200
15#define INTCS_VECT(n, vect) INTC_VECT((n), INTCS_VECT_BASE + (vect))
16#define intcs_evt2irq(evt) evt2irq(INTCS_VECT_BASE + (evt))
17
18#endif /* __ASM_MACH_IRQS_H */
diff --git a/arch/arm/mach-shmobile/include/mach/memory.h b/arch/arm/mach-shmobile/include/mach/memory.h
new file mode 100644
index 000000000000..377584e57e03
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/memory.h
@@ -0,0 +1,10 @@
1#ifndef __ASM_MACH_MEMORY_H
2#define __ASM_MACH_MEMORY_H
3
4#define PHYS_OFFSET UL(CONFIG_MEMORY_START)
5#define MEM_SIZE UL(CONFIG_MEMORY_SIZE)
6
7/* DMA memory at 0xf6000000 - 0xffdfffff */
8#define CONSISTENT_DMA_SIZE (158 << 20)
9
10#endif /* __ASM_MACH_MEMORY_H */
diff --git a/arch/arm/mach-shmobile/include/mach/sh7367.h b/arch/arm/mach-shmobile/include/mach/sh7367.h
new file mode 100644
index 000000000000..52d0de686f68
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/sh7367.h
@@ -0,0 +1,332 @@
1#ifndef __ASM_SH7367_H__
2#define __ASM_SH7367_H__
3
4/* Pin Function Controller:
5 * GPIO_FN_xx - GPIO used to select pin function
6 * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
7 */
8enum {
9 /* 49-1 -> 49-6 (GPIO) */
10 GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
11 GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
12
13 GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
14 GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
15
16 GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
17 GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
18
19 GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
20 GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
21
22 GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
23 GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
24
25 GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
26 GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
27
28 GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
29 GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
30
31 GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
32 GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
33
34 GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
35 GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
36
37 GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
38 GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
39
40 GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
41 GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
42
43 GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
44 GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118, GPIO_PORT119,
45
46 GPIO_PORT120, GPIO_PORT121, GPIO_PORT122, GPIO_PORT123, GPIO_PORT124,
47 GPIO_PORT125, GPIO_PORT126, GPIO_PORT127, GPIO_PORT128, GPIO_PORT129,
48
49 GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
50 GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
51
52 GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
53 GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
54
55 GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
56 GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
57
58 GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
59 GPIO_PORT165, GPIO_PORT166, GPIO_PORT167, GPIO_PORT168, GPIO_PORT169,
60
61 GPIO_PORT170, GPIO_PORT171, GPIO_PORT172, GPIO_PORT173, GPIO_PORT174,
62 GPIO_PORT175, GPIO_PORT176, GPIO_PORT177, GPIO_PORT178, GPIO_PORT179,
63
64 GPIO_PORT180, GPIO_PORT181, GPIO_PORT182, GPIO_PORT183, GPIO_PORT184,
65 GPIO_PORT185, GPIO_PORT186, GPIO_PORT187, GPIO_PORT188, GPIO_PORT189,
66
67 GPIO_PORT190, GPIO_PORT191, GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
68 GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
69
70 GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
71 GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
72
73 GPIO_PORT210, GPIO_PORT211, GPIO_PORT212, GPIO_PORT213, GPIO_PORT214,
74 GPIO_PORT215, GPIO_PORT216, GPIO_PORT217, GPIO_PORT218, GPIO_PORT219,
75
76 GPIO_PORT220, GPIO_PORT221, GPIO_PORT222, GPIO_PORT223, GPIO_PORT224,
77 GPIO_PORT225, GPIO_PORT226, GPIO_PORT227, GPIO_PORT228, GPIO_PORT229,
78
79 GPIO_PORT230, GPIO_PORT231, GPIO_PORT232, GPIO_PORT233, GPIO_PORT234,
80 GPIO_PORT235, GPIO_PORT236, GPIO_PORT237, GPIO_PORT238, GPIO_PORT239,
81
82 GPIO_PORT240, GPIO_PORT241, GPIO_PORT242, GPIO_PORT243, GPIO_PORT244,
83 GPIO_PORT245, GPIO_PORT246, GPIO_PORT247, GPIO_PORT248, GPIO_PORT249,
84
85 GPIO_PORT250, GPIO_PORT251, GPIO_PORT252, GPIO_PORT253, GPIO_PORT254,
86 GPIO_PORT255, GPIO_PORT256, GPIO_PORT257, GPIO_PORT258, GPIO_PORT259,
87
88 GPIO_PORT260, GPIO_PORT261, GPIO_PORT262, GPIO_PORT263, GPIO_PORT264,
89 GPIO_PORT265, GPIO_PORT266, GPIO_PORT267, GPIO_PORT268, GPIO_PORT269,
90
91 GPIO_PORT270, GPIO_PORT271, GPIO_PORT272,
92
93 /* Special Pull-up / Pull-down Functions */
94 GPIO_FN_PORT48_KEYIN0_PU, GPIO_FN_PORT49_KEYIN1_PU,
95 GPIO_FN_PORT50_KEYIN2_PU, GPIO_FN_PORT55_KEYIN3_PU,
96 GPIO_FN_PORT56_KEYIN4_PU, GPIO_FN_PORT57_KEYIN5_PU,
97 GPIO_FN_PORT58_KEYIN6_PU,
98
99 /* 49-1 (FN) */
100 GPIO_FN_VBUS0, GPIO_FN_CPORT0, GPIO_FN_CPORT1, GPIO_FN_CPORT2,
101 GPIO_FN_CPORT3, GPIO_FN_CPORT4, GPIO_FN_CPORT5, GPIO_FN_CPORT6,
102 GPIO_FN_CPORT7, GPIO_FN_CPORT8, GPIO_FN_CPORT9, GPIO_FN_CPORT10,
103 GPIO_FN_CPORT11, GPIO_FN_SIN2, GPIO_FN_CPORT12, GPIO_FN_XCTS2,
104 GPIO_FN_CPORT13, GPIO_FN_RFSPO4, GPIO_FN_CPORT14, GPIO_FN_RFSPO5,
105 GPIO_FN_CPORT15, GPIO_FN_CPORT16, GPIO_FN_CPORT17, GPIO_FN_SOUT2,
106 GPIO_FN_CPORT18, GPIO_FN_XRTS2, GPIO_FN_CPORT19, GPIO_FN_CPORT20,
107 GPIO_FN_RFSPO6, GPIO_FN_CPORT21, GPIO_FN_STATUS0, GPIO_FN_CPORT22,
108 GPIO_FN_STATUS1, GPIO_FN_CPORT23, GPIO_FN_STATUS2, GPIO_FN_RFSPO7,
109 GPIO_FN_MPORT0, GPIO_FN_MPORT1, GPIO_FN_B_SYNLD1, GPIO_FN_B_SYNLD2,
110 GPIO_FN_XMAINPS, GPIO_FN_XDIVPS, GPIO_FN_XIDRST, GPIO_FN_IDCLK,
111 GPIO_FN_IDIO, GPIO_FN_SOUT1, GPIO_FN_SCIFA4_TXD,
112 GPIO_FN_M02_BERDAT, GPIO_FN_SIN1, GPIO_FN_SCIFA4_RXD, GPIO_FN_XWUP,
113 GPIO_FN_XRTS1, GPIO_FN_SCIFA4_RTS, GPIO_FN_M03_BERCLK,
114 GPIO_FN_XCTS1, GPIO_FN_SCIFA4_CTS,
115
116 /* 49-2 (FN) */
117 GPIO_FN_HSU_IQ_AGC6, GPIO_FN_MFG2_IN2, GPIO_FN_MSIOF2_MCK0,
118 GPIO_FN_HSU_IQ_AGC5, GPIO_FN_MFG2_IN1, GPIO_FN_MSIOF2_MCK1,
119 GPIO_FN_HSU_IQ_AGC4, GPIO_FN_MSIOF2_RSYNC,
120 GPIO_FN_HSU_IQ_AGC3, GPIO_FN_MFG2_OUT1, GPIO_FN_MSIOF2_RSCK,
121 GPIO_FN_HSU_IQ_AGC2, GPIO_FN_PORT42_KEYOUT0,
122 GPIO_FN_HSU_IQ_AGC1, GPIO_FN_PORT43_KEYOUT1,
123 GPIO_FN_HSU_IQ_AGC0, GPIO_FN_PORT44_KEYOUT2,
124 GPIO_FN_HSU_IQ_AGC_ST, GPIO_FN_PORT45_KEYOUT3,
125 GPIO_FN_HSU_IQ_PDO, GPIO_FN_PORT46_KEYOUT4,
126 GPIO_FN_HSU_IQ_PYO, GPIO_FN_PORT47_KEYOUT5,
127 GPIO_FN_HSU_EN_TXMUX_G3MO, GPIO_FN_PORT48_KEYIN0,
128 GPIO_FN_HSU_I_TXMUX_G3MO, GPIO_FN_PORT49_KEYIN1,
129 GPIO_FN_HSU_Q_TXMUX_G3MO, GPIO_FN_PORT50_KEYIN2,
130 GPIO_FN_HSU_SYO, GPIO_FN_PORT51_MSIOF2_TSYNC,
131 GPIO_FN_HSU_SDO, GPIO_FN_PORT52_MSIOF2_TSCK,
132 GPIO_FN_HSU_TGTTI_G3MO, GPIO_FN_PORT53_MSIOF2_TXD,
133 GPIO_FN_B_TIME_STAMP, GPIO_FN_PORT54_MSIOF2_RXD,
134 GPIO_FN_HSU_SDI, GPIO_FN_PORT55_KEYIN3,
135 GPIO_FN_HSU_SCO, GPIO_FN_PORT56_KEYIN4,
136 GPIO_FN_HSU_DREQ, GPIO_FN_PORT57_KEYIN5,
137 GPIO_FN_HSU_DACK, GPIO_FN_PORT58_KEYIN6,
138 GPIO_FN_HSU_CLK61M, GPIO_FN_PORT59_MSIOF2_SS1,
139 GPIO_FN_HSU_XRST, GPIO_FN_PORT60_MSIOF2_SS2,
140 GPIO_FN_PCMCLKO, GPIO_FN_SYNC8KO, GPIO_FN_DNPCM_A, GPIO_FN_UPPCM_A,
141 GPIO_FN_XTALB1L,
142 GPIO_FN_GPS_AGC1, GPIO_FN_SCIFA0_RTS,
143 GPIO_FN_GPS_AGC2, GPIO_FN_SCIFA0_SCK,
144 GPIO_FN_GPS_AGC3, GPIO_FN_SCIFA0_TXD,
145 GPIO_FN_GPS_AGC4, GPIO_FN_SCIFA0_RXD,
146 GPIO_FN_GPS_PWRD, GPIO_FN_SCIFA0_CTS,
147 GPIO_FN_GPS_IM, GPIO_FN_GPS_IS, GPIO_FN_GPS_QM, GPIO_FN_GPS_QS,
148 GPIO_FN_SIUBOMC, GPIO_FN_TPU2TO0,
149 GPIO_FN_SIUCKB, GPIO_FN_TPU2TO1,
150 GPIO_FN_SIUBOLR, GPIO_FN_BBIF2_TSYNC, GPIO_FN_TPU2TO2,
151 GPIO_FN_SIUBOBT, GPIO_FN_BBIF2_TSCK, GPIO_FN_TPU2TO3,
152 GPIO_FN_SIUBOSLD, GPIO_FN_BBIF2_TXD, GPIO_FN_TPU3TO0,
153 GPIO_FN_SIUBILR, GPIO_FN_TPU3TO1,
154 GPIO_FN_SIUBIBT, GPIO_FN_TPU3TO2,
155 GPIO_FN_SIUBISLD, GPIO_FN_TPU3TO3,
156 GPIO_FN_NMI, GPIO_FN_TPU4TO0,
157 GPIO_FN_DNPCM_M, GPIO_FN_TPU4TO1, GPIO_FN_TPU4TO2, GPIO_FN_TPU4TO3,
158 GPIO_FN_IRQ_TMPB,
159 GPIO_FN_PWEN, GPIO_FN_MFG1_OUT1,
160 GPIO_FN_OVCN, GPIO_FN_MFG1_IN1,
161 GPIO_FN_OVCN2, GPIO_FN_MFG1_IN2,
162
163 /* 49-3 (FN) */
164 GPIO_FN_RFSPO1, GPIO_FN_RFSPO2, GPIO_FN_RFSPO3, GPIO_FN_PORT93_VIO_CKO2,
165 GPIO_FN_USBTERM, GPIO_FN_EXTLP, GPIO_FN_IDIN,
166 GPIO_FN_SCIFA5_CTS, GPIO_FN_MFG0_IN1,
167 GPIO_FN_SCIFA5_RTS, GPIO_FN_MFG0_IN2,
168 GPIO_FN_SCIFA5_RXD,
169 GPIO_FN_SCIFA5_TXD,
170 GPIO_FN_SCIFA5_SCK, GPIO_FN_MFG0_OUT1,
171 GPIO_FN_A0_EA0, GPIO_FN_BS,
172 GPIO_FN_A14_EA14, GPIO_FN_PORT102_KEYOUT0,
173 GPIO_FN_A15_EA15, GPIO_FN_PORT103_KEYOUT1, GPIO_FN_DV_CLKOL,
174 GPIO_FN_A16_EA16, GPIO_FN_PORT104_KEYOUT2,
175 GPIO_FN_DV_VSYNCL, GPIO_FN_MSIOF0_SS1,
176 GPIO_FN_A17_EA17, GPIO_FN_PORT105_KEYOUT3,
177 GPIO_FN_DV_HSYNCL, GPIO_FN_MSIOF0_TSYNC,
178 GPIO_FN_A18_EA18, GPIO_FN_PORT106_KEYOUT4,
179 GPIO_FN_DV_DL0, GPIO_FN_MSIOF0_TSCK,
180 GPIO_FN_A19_EA19, GPIO_FN_PORT107_KEYOUT5,
181 GPIO_FN_DV_DL1, GPIO_FN_MSIOF0_TXD,
182 GPIO_FN_A20_EA20, GPIO_FN_PORT108_KEYIN0,
183 GPIO_FN_DV_DL2, GPIO_FN_MSIOF0_RSCK,
184 GPIO_FN_A21_EA21, GPIO_FN_PORT109_KEYIN1,
185 GPIO_FN_DV_DL3, GPIO_FN_MSIOF0_RSYNC,
186 GPIO_FN_A22_EA22, GPIO_FN_PORT110_KEYIN2,
187 GPIO_FN_DV_DL4, GPIO_FN_MSIOF0_MCK0,
188 GPIO_FN_A23_EA23, GPIO_FN_PORT111_KEYIN3,
189 GPIO_FN_DV_DL5, GPIO_FN_MSIOF0_MCK1,
190 GPIO_FN_A24_EA24, GPIO_FN_PORT112_KEYIN4,
191 GPIO_FN_DV_DL6, GPIO_FN_MSIOF0_RXD,
192 GPIO_FN_A25_EA25, GPIO_FN_PORT113_KEYIN5,
193 GPIO_FN_DV_DL7, GPIO_FN_MSIOF0_SS2,
194 GPIO_FN_A26, GPIO_FN_PORT113_KEYIN6, GPIO_FN_DV_CLKIL,
195 GPIO_FN_D0_ED0_NAF0, GPIO_FN_D1_ED1_NAF1, GPIO_FN_D2_ED2_NAF2,
196 GPIO_FN_D3_ED3_NAF3, GPIO_FN_D4_ED4_NAF4, GPIO_FN_D5_ED5_NAF5,
197 GPIO_FN_D6_ED6_NAF6, GPIO_FN_D7_ED7_NAF7, GPIO_FN_D8_ED8_NAF8,
198 GPIO_FN_D9_ED9_NAF9, GPIO_FN_D10_ED10_NAF10, GPIO_FN_D11_ED11_NAF11,
199 GPIO_FN_D12_ED12_NAF12, GPIO_FN_D13_ED13_NAF13,
200 GPIO_FN_D14_ED14_NAF14, GPIO_FN_D15_ED15_NAF15,
201 GPIO_FN_CS4, GPIO_FN_CS5A, GPIO_FN_CS5B, GPIO_FN_FCE1,
202 GPIO_FN_CS6B, GPIO_FN_XCS2, GPIO_FN_FCE0, GPIO_FN_CS6A,
203 GPIO_FN_DACK0, GPIO_FN_WAIT, GPIO_FN_DREQ0, GPIO_FN_RD_XRD,
204 GPIO_FN_A27, GPIO_FN_RDWR_XWE, GPIO_FN_WE0_XWR0_FWE,
205 GPIO_FN_WE1_XWR1, GPIO_FN_FRB, GPIO_FN_CKO,
206 GPIO_FN_NBRSTOUT, GPIO_FN_NBRST,
207
208 /* 49-4 (FN) */
209 GPIO_FN_RFSPO0, GPIO_FN_PORT146_VIO_CKO2, GPIO_FN_TSTMD,
210 GPIO_FN_VIO_VD, GPIO_FN_VIO_HD,
211 GPIO_FN_VIO_D0, GPIO_FN_VIO_D1, GPIO_FN_VIO_D2,
212 GPIO_FN_VIO_D3, GPIO_FN_VIO_D4, GPIO_FN_VIO_D5,
213 GPIO_FN_VIO_D6, GPIO_FN_VIO_D7, GPIO_FN_VIO_D8,
214 GPIO_FN_VIO_D9, GPIO_FN_VIO_D10, GPIO_FN_VIO_D11,
215 GPIO_FN_VIO_D12, GPIO_FN_VIO_D13, GPIO_FN_VIO_D14,
216 GPIO_FN_VIO_D15, GPIO_FN_VIO_CLK, GPIO_FN_VIO_FIELD,
217 GPIO_FN_VIO_CKO,
218 GPIO_FN_MFG3_IN1, GPIO_FN_MFG3_IN2,
219 GPIO_FN_M9_SLCD_A01, GPIO_FN_MFG3_OUT1, GPIO_FN_TPU0TO0,
220 GPIO_FN_M10_SLCD_CK1, GPIO_FN_MFG4_IN1, GPIO_FN_TPU0TO1,
221 GPIO_FN_M11_SLCD_SO1, GPIO_FN_MFG4_IN2, GPIO_FN_TPU0TO2,
222 GPIO_FN_M12_SLCD_CE1, GPIO_FN_MFG4_OUT1, GPIO_FN_TPU0TO3,
223 GPIO_FN_LCDD0, GPIO_FN_PORT175_KEYOUT0, GPIO_FN_DV_D0,
224 GPIO_FN_SIUCKA, GPIO_FN_MFG0_OUT2,
225 GPIO_FN_LCDD1, GPIO_FN_PORT176_KEYOUT1, GPIO_FN_DV_D1,
226 GPIO_FN_SIUAOLR, GPIO_FN_BBIF2_TSYNC1,
227 GPIO_FN_LCDD2, GPIO_FN_PORT177_KEYOUT2, GPIO_FN_DV_D2,
228 GPIO_FN_SIUAOBT, GPIO_FN_BBIF2_TSCK1,
229 GPIO_FN_LCDD3, GPIO_FN_PORT178_KEYOUT3, GPIO_FN_DV_D3,
230 GPIO_FN_SIUAOSLD, GPIO_FN_BBIF2_TXD1,
231 GPIO_FN_LCDD4, GPIO_FN_PORT179_KEYOUT4, GPIO_FN_DV_D4,
232 GPIO_FN_SIUAISPD, GPIO_FN_MFG1_OUT2,
233 GPIO_FN_LCDD5, GPIO_FN_PORT180_KEYOUT5, GPIO_FN_DV_D5,
234 GPIO_FN_SIUAILR, GPIO_FN_MFG2_OUT2,
235 GPIO_FN_LCDD6, GPIO_FN_DV_D6,
236 GPIO_FN_SIUAIBT, GPIO_FN_MFG3_OUT2, GPIO_FN_XWR2,
237 GPIO_FN_LCDD7, GPIO_FN_DV_D7,
238 GPIO_FN_SIUAISLD, GPIO_FN_MFG4_OUT2, GPIO_FN_XWR3,
239 GPIO_FN_LCDD8, GPIO_FN_DV_D8, GPIO_FN_D16, GPIO_FN_ED16,
240 GPIO_FN_LCDD9, GPIO_FN_DV_D9, GPIO_FN_D17, GPIO_FN_ED17,
241 GPIO_FN_LCDD10, GPIO_FN_DV_D10, GPIO_FN_D18, GPIO_FN_ED18,
242 GPIO_FN_LCDD11, GPIO_FN_DV_D11, GPIO_FN_D19, GPIO_FN_ED19,
243 GPIO_FN_LCDD12, GPIO_FN_DV_D12, GPIO_FN_D20, GPIO_FN_ED20,
244 GPIO_FN_LCDD13, GPIO_FN_DV_D13, GPIO_FN_D21, GPIO_FN_ED21,
245 GPIO_FN_LCDD14, GPIO_FN_DV_D14, GPIO_FN_D22, GPIO_FN_ED22,
246 GPIO_FN_LCDD15, GPIO_FN_DV_D15, GPIO_FN_D23, GPIO_FN_ED23,
247 GPIO_FN_LCDD16, GPIO_FN_DV_HSYNC, GPIO_FN_D24, GPIO_FN_ED24,
248 GPIO_FN_LCDD17, GPIO_FN_DV_VSYNC, GPIO_FN_D25, GPIO_FN_ED25,
249 GPIO_FN_LCDD18, GPIO_FN_DREQ2, GPIO_FN_MSIOF0L_TSCK,
250 GPIO_FN_D26, GPIO_FN_ED26,
251 GPIO_FN_LCDD19, GPIO_FN_MSIOF0L_TSYNC,
252 GPIO_FN_D27, GPIO_FN_ED27,
253 GPIO_FN_LCDD20, GPIO_FN_TS_SPSYNC1, GPIO_FN_MSIOF0L_MCK0,
254 GPIO_FN_D28, GPIO_FN_ED28,
255 GPIO_FN_LCDD21, GPIO_FN_TS_SDAT1, GPIO_FN_MSIOF0L_MCK1,
256 GPIO_FN_D29, GPIO_FN_ED29,
257 GPIO_FN_LCDD22, GPIO_FN_TS_SDEN1, GPIO_FN_MSIOF0L_SS1,
258 GPIO_FN_D30, GPIO_FN_ED30,
259 GPIO_FN_LCDD23, GPIO_FN_TS_SCK1, GPIO_FN_MSIOF0L_SS2,
260 GPIO_FN_D31, GPIO_FN_ED31,
261 GPIO_FN_LCDDCK, GPIO_FN_LCDWR, GPIO_FN_DV_CKO, GPIO_FN_SIUAOSPD,
262 GPIO_FN_LCDRD, GPIO_FN_DACK2, GPIO_FN_MSIOF0L_RSYNC,
263
264
265 /* 49-5 (FN) */
266 GPIO_FN_LCDHSYN, GPIO_FN_LCDCS, GPIO_FN_LCDCS2, GPIO_FN_DACK3,
267 GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_DREQ3, GPIO_FN_MSIOF0L_RSCK,
268 GPIO_FN_LCDCSYN, GPIO_FN_LCDCSYN2, GPIO_FN_DV_CKI,
269 GPIO_FN_LCDLCLK, GPIO_FN_DREQ1, GPIO_FN_MSIOF0L_RXD,
270 GPIO_FN_LCDDON, GPIO_FN_LCDDON2, GPIO_FN_DACK1, GPIO_FN_MSIOF0L_TXD,
271 GPIO_FN_VIO_DR0, GPIO_FN_VIO_DR1, GPIO_FN_VIO_DR2, GPIO_FN_VIO_DR3,
272 GPIO_FN_VIO_DR4, GPIO_FN_VIO_DR5, GPIO_FN_VIO_DR6, GPIO_FN_VIO_DR7,
273 GPIO_FN_VIO_VDR, GPIO_FN_VIO_HDR,
274 GPIO_FN_VIO_CLKR, GPIO_FN_VIO_CKOR,
275 GPIO_FN_SCIFA1_TXD, GPIO_FN_GPS_PGFA0,
276 GPIO_FN_SCIFA1_SCK, GPIO_FN_GPS_PGFA1,
277 GPIO_FN_SCIFA1_RTS, GPIO_FN_GPS_EPPSINMON,
278 GPIO_FN_SCIFA1_RXD, GPIO_FN_SCIFA1_CTS,
279 GPIO_FN_MSIOF1_TXD, GPIO_FN_SCIFA1_TXD2, GPIO_FN_GPS_TXD,
280 GPIO_FN_MSIOF1_TSYNC, GPIO_FN_SCIFA1_CTS2, GPIO_FN_I2C_SDA2,
281 GPIO_FN_MSIOF1_TSCK, GPIO_FN_SCIFA1_SCK2,
282 GPIO_FN_MSIOF1_RXD, GPIO_FN_SCIFA1_RXD2, GPIO_FN_GPS_RXD,
283 GPIO_FN_MSIOF1_RSCK, GPIO_FN_SCIFA1_RTS2,
284 GPIO_FN_MSIOF1_RSYNC, GPIO_FN_I2C_SCL2,
285 GPIO_FN_MSIOF1_MCK0, GPIO_FN_MSIOF1_MCK1,
286 GPIO_FN_MSIOF1_SS1, GPIO_FN_EDBGREQ3,
287 GPIO_FN_MSIOF1_SS2,
288 GPIO_FN_PORT236_IROUT, GPIO_FN_IRDA_OUT,
289 GPIO_FN_IRDA_IN, GPIO_FN_IRDA_FIRSEL,
290 GPIO_FN_TPU1TO0, GPIO_FN_TS_SPSYNC3,
291 GPIO_FN_TPU1TO1, GPIO_FN_TS_SDAT3,
292 GPIO_FN_TPU1TO2, GPIO_FN_TS_SDEN3, GPIO_FN_PORT241_MSIOF2_SS1,
293 GPIO_FN_TPU1TO3, GPIO_FN_PORT242_MSIOF2_TSCK,
294 GPIO_FN_M13_BSW, GPIO_FN_PORT243_MSIOF2_TSYNC,
295 GPIO_FN_M14_GSW, GPIO_FN_PORT244_MSIOF2_TXD,
296 GPIO_FN_PORT245_IROUT, GPIO_FN_M15_RSW,
297 GPIO_FN_SOUT3, GPIO_FN_SCIFA2_TXD1,
298 GPIO_FN_SIN3, GPIO_FN_SCIFA2_RXD1,
299 GPIO_FN_XRTS3, GPIO_FN_SCIFA2_RTS1, GPIO_FN_PORT248_MSIOF2_SS2,
300 GPIO_FN_XCTS3, GPIO_FN_SCIFA2_CTS1, GPIO_FN_PORT249_MSIOF2_RXD,
301 GPIO_FN_DINT, GPIO_FN_SCIFA2_SCK1, GPIO_FN_TS_SCK3,
302 GPIO_FN_SDHICLK0, GPIO_FN_TCK2,
303 GPIO_FN_SDHICD0,
304 GPIO_FN_SDHID0_0, GPIO_FN_TMS2,
305 GPIO_FN_SDHID0_1, GPIO_FN_TDO2,
306 GPIO_FN_SDHID0_2, GPIO_FN_TDI2,
307 GPIO_FN_SDHID0_3, GPIO_FN_RTCK2,
308
309 /* 49-6 (FN) */
310 GPIO_FN_SDHICMD0, GPIO_FN_TRST2,
311 GPIO_FN_SDHIWP0, GPIO_FN_EDBGREQ2,
312 GPIO_FN_SDHICLK1, GPIO_FN_TCK3,
313 GPIO_FN_SDHID1_0, GPIO_FN_M11_SLCD_SO2,
314 GPIO_FN_TS_SPSYNC2, GPIO_FN_TMS3,
315 GPIO_FN_SDHID1_1, GPIO_FN_M9_SLCD_AO2,
316 GPIO_FN_TS_SDAT2, GPIO_FN_TDO3,
317 GPIO_FN_SDHID1_2, GPIO_FN_M10_SLCD_CK2,
318 GPIO_FN_TS_SDEN2, GPIO_FN_TDI3,
319 GPIO_FN_SDHID1_3, GPIO_FN_M12_SLCD_CE2,
320 GPIO_FN_TS_SCK2, GPIO_FN_RTCK3,
321 GPIO_FN_SDHICMD1, GPIO_FN_TRST3,
322 GPIO_FN_SDHICLK2, GPIO_FN_SCIFB_SCK,
323 GPIO_FN_SDHID2_0, GPIO_FN_SCIFB_TXD,
324 GPIO_FN_SDHID2_1, GPIO_FN_SCIFB_CTS,
325 GPIO_FN_SDHID2_2, GPIO_FN_SCIFB_RXD,
326 GPIO_FN_SDHID2_3, GPIO_FN_SCIFB_RTS,
327 GPIO_FN_SDHICMD2,
328 GPIO_FN_RESETOUTS,
329 GPIO_FN_DIVLOCK,
330};
331
332#endif /* __ASM_SH7367_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
new file mode 100644
index 000000000000..5736efcca60c
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -0,0 +1,472 @@
1/*
2 * Copyright (C) 2010 Renesas Solutions Corp.
3 *
4 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef __ASM_SH7372_H__
12#define __ASM_SH7372_H__
13
14#include <linux/sh_clk.h>
15
16/*
17 * Pin Function Controller:
18 * GPIO_FN_xx - GPIO used to select pin function
19 * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
20 */
21enum {
22 /* PORT */
23 GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
24 GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
25
26 GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
27 GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
28
29 GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
30 GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
31
32 GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
33 GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
34
35 GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
36 GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
37
38 GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
39 GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
40
41 GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
42 GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
43
44 GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
45 GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
46
47 GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
48 GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
49
50 GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
51 GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
52
53 GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
54 GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
55
56 GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
57 GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118, GPIO_PORT119,
58
59 GPIO_PORT120, GPIO_PORT121, GPIO_PORT122, GPIO_PORT123, GPIO_PORT124,
60 GPIO_PORT125, GPIO_PORT126, GPIO_PORT127, GPIO_PORT128, GPIO_PORT129,
61
62 GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
63 GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
64
65 GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
66 GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
67
68 GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
69 GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
70
71 GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
72 GPIO_PORT165, GPIO_PORT166, GPIO_PORT167, GPIO_PORT168, GPIO_PORT169,
73
74 GPIO_PORT170, GPIO_PORT171, GPIO_PORT172, GPIO_PORT173, GPIO_PORT174,
75 GPIO_PORT175, GPIO_PORT176, GPIO_PORT177, GPIO_PORT178, GPIO_PORT179,
76
77 GPIO_PORT180, GPIO_PORT181, GPIO_PORT182, GPIO_PORT183, GPIO_PORT184,
78 GPIO_PORT185, GPIO_PORT186, GPIO_PORT187, GPIO_PORT188, GPIO_PORT189,
79
80 GPIO_PORT190,
81
82 /* IRQ */
83 GPIO_FN_IRQ0_6, /* PORT 6 */
84 GPIO_FN_IRQ0_162, /* PORT 162 */
85 GPIO_FN_IRQ1, /* PORT 12 */
86 GPIO_FN_IRQ2_4, /* PORT 4 */
87 GPIO_FN_IRQ2_5, /* PORT 5 */
88 GPIO_FN_IRQ3_8, /* PORT 8 */
89 GPIO_FN_IRQ3_16, /* PORT 16 */
90 GPIO_FN_IRQ4_17, /* PORT 17 */
91 GPIO_FN_IRQ4_163, /* PORT 163 */
92 GPIO_FN_IRQ5, /* PORT 18 */
93 GPIO_FN_IRQ6_39, /* PORT 39 */
94 GPIO_FN_IRQ6_164, /* PORT 164 */
95 GPIO_FN_IRQ7_40, /* PORT 40 */
96 GPIO_FN_IRQ7_167, /* PORT 167 */
97 GPIO_FN_IRQ8_41, /* PORT 41 */
98 GPIO_FN_IRQ8_168, /* PORT 168 */
99 GPIO_FN_IRQ9_42, /* PORT 42 */
100 GPIO_FN_IRQ9_169, /* PORT 169 */
101 GPIO_FN_IRQ10, /* PORT 65 */
102 GPIO_FN_IRQ11, /* PORT 67 */
103 GPIO_FN_IRQ12_80, /* PORT 80 */
104 GPIO_FN_IRQ12_137, /* PORT 137 */
105 GPIO_FN_IRQ13_81, /* PORT 81 */
106 GPIO_FN_IRQ13_145, /* PORT 145 */
107 GPIO_FN_IRQ14_82, /* PORT 82 */
108 GPIO_FN_IRQ14_146, /* PORT 146 */
109 GPIO_FN_IRQ15_83, /* PORT 83 */
110 GPIO_FN_IRQ15_147, /* PORT 147 */
111 GPIO_FN_IRQ16_84, /* PORT 84 */
112 GPIO_FN_IRQ16_170, /* PORT 170 */
113 GPIO_FN_IRQ17, /* PORT 85 */
114 GPIO_FN_IRQ18, /* PORT 86 */
115 GPIO_FN_IRQ19, /* PORT 87 */
116 GPIO_FN_IRQ20, /* PORT 92 */
117 GPIO_FN_IRQ21, /* PORT 93 */
118 GPIO_FN_IRQ22, /* PORT 94 */
119 GPIO_FN_IRQ23, /* PORT 95 */
120 GPIO_FN_IRQ24, /* PORT 112 */
121 GPIO_FN_IRQ25, /* PORT 119 */
122 GPIO_FN_IRQ26_121, /* PORT 121 */
123 GPIO_FN_IRQ26_172, /* PORT 172 */
124 GPIO_FN_IRQ27_122, /* PORT 122 */
125 GPIO_FN_IRQ27_180, /* PORT 180 */
126 GPIO_FN_IRQ28_123, /* PORT 123 */
127 GPIO_FN_IRQ28_181, /* PORT 181 */
128 GPIO_FN_IRQ29_129, /* PORT 129 */
129 GPIO_FN_IRQ29_182, /* PORT 182 */
130 GPIO_FN_IRQ30_130, /* PORT 130 */
131 GPIO_FN_IRQ30_183, /* PORT 183 */
132 GPIO_FN_IRQ31_138, /* PORT 138 */
133 GPIO_FN_IRQ31_184, /* PORT 184 */
134
135 /*
136 * MSIOF0 (PORT 36, 37, 38, 39
137 * 40, 41, 42, 43, 44, 45)
138 */
139 GPIO_FN_MSIOF0_TSYNC, GPIO_FN_MSIOF0_TSCK,
140 GPIO_FN_MSIOF0_RXD, GPIO_FN_MSIOF0_RSCK,
141 GPIO_FN_MSIOF0_RSYNC, GPIO_FN_MSIOF0_MCK0,
142 GPIO_FN_MSIOF0_MCK1, GPIO_FN_MSIOF0_SS1,
143 GPIO_FN_MSIOF0_SS2, GPIO_FN_MSIOF0_TXD,
144
145 /*
146 * MSIOF1 (PORT 39, 40, 41, 42, 43, 44
147 * 84, 85, 86, 87, 88, 89, 90, 91, 92, 93)
148 */
149 GPIO_FN_MSIOF1_TSCK_39, GPIO_FN_MSIOF1_TSYNC_40,
150 GPIO_FN_MSIOF1_TSCK_88, GPIO_FN_MSIOF1_TSYNC_89,
151 GPIO_FN_MSIOF1_TXD_41, GPIO_FN_MSIOF1_RXD_42,
152 GPIO_FN_MSIOF1_TXD_90, GPIO_FN_MSIOF1_RXD_91,
153 GPIO_FN_MSIOF1_SS1_43, GPIO_FN_MSIOF1_SS2_44,
154 GPIO_FN_MSIOF1_SS1_92, GPIO_FN_MSIOF1_SS2_93,
155 GPIO_FN_MSIOF1_RSCK, GPIO_FN_MSIOF1_RSYNC,
156 GPIO_FN_MSIOF1_MCK0, GPIO_FN_MSIOF1_MCK1,
157
158 /*
159 * MSIOF2 (PORT 134, 135, 136, 137, 138, 139
160 * 148, 149, 150, 151)
161 */
162 GPIO_FN_MSIOF2_RSCK, GPIO_FN_MSIOF2_RSYNC,
163 GPIO_FN_MSIOF2_MCK0, GPIO_FN_MSIOF2_MCK1,
164 GPIO_FN_MSIOF2_SS1, GPIO_FN_MSIOF2_SS2,
165 GPIO_FN_MSIOF2_TSYNC, GPIO_FN_MSIOF2_TSCK,
166 GPIO_FN_MSIOF2_RXD, GPIO_FN_MSIOF2_TXD,
167
168 /* MSIOF3 (PORT 76, 77, 78, 79, 80, 81, 82, 83) */
169 GPIO_FN_BBIF1_RXD, GPIO_FN_BBIF1_TSYNC,
170 GPIO_FN_BBIF1_TSCK, GPIO_FN_BBIF1_TXD,
171 GPIO_FN_BBIF1_RSCK, GPIO_FN_BBIF1_RSYNC,
172 GPIO_FN_BBIF1_FLOW, GPIO_FN_BB_RX_FLOW_N,
173
174 /* MSIOF4 (PORT 0, 1, 2, 3) */
175 GPIO_FN_BBIF2_TSCK1, GPIO_FN_BBIF2_TSYNC1,
176 GPIO_FN_BBIF2_TXD1, GPIO_FN_BBIF2_RXD,
177
178 /* FSI (PORT 4, 5, 6, 7, 8, 9, 10, 11, 15) */
179 GPIO_FN_FSIACK, GPIO_FN_FSIBCK,
180 GPIO_FN_FSIAILR, GPIO_FN_FSIAIBT,
181 GPIO_FN_FSIAISLD, GPIO_FN_FSIAOMC,
182 GPIO_FN_FSIAOLR, GPIO_FN_FSIAOBT,
183 GPIO_FN_FSIAOSLD, GPIO_FN_FSIASPDIF_11,
184 GPIO_FN_FSIASPDIF_15,
185
186 /* FMSI (PORT 12, 13, 14, 15, 16, 17, 18, 65) */
187 GPIO_FN_FMSOCK, GPIO_FN_FMSOOLR,
188 GPIO_FN_FMSIOLR, GPIO_FN_FMSOOBT,
189 GPIO_FN_FMSIOBT, GPIO_FN_FMSOSLD,
190 GPIO_FN_FMSOILR, GPIO_FN_FMSIILR,
191 GPIO_FN_FMSOIBT, GPIO_FN_FMSIIBT,
192 GPIO_FN_FMSISLD, GPIO_FN_FMSICK,
193
194 /* SCIFA0 (PORT 152, 153, 156, 157, 158) */
195 GPIO_FN_SCIFA0_TXD, GPIO_FN_SCIFA0_RXD,
196 GPIO_FN_SCIFA0_SCK, GPIO_FN_SCIFA0_RTS,
197 GPIO_FN_SCIFA0_CTS,
198
199 /* SCIFA1 (PORT 154, 155, 159, 160, 161) */
200 GPIO_FN_SCIFA1_TXD, GPIO_FN_SCIFA1_RXD,
201 GPIO_FN_SCIFA1_SCK, GPIO_FN_SCIFA1_RTS,
202 GPIO_FN_SCIFA1_CTS,
203
204 /* SCIFA2 (PORT 94, 95, 96, 97, 98) */
205 GPIO_FN_SCIFA2_CTS1, GPIO_FN_SCIFA2_RTS1,
206 GPIO_FN_SCIFA2_TXD1, GPIO_FN_SCIFA2_RXD1,
207 GPIO_FN_SCIFA2_SCK1,
208
209 /* SCIFA3 (PORT 43, 44,
210 140, 141, 142, 143, 144) */
211 GPIO_FN_SCIFA3_CTS_43, GPIO_FN_SCIFA3_CTS_140,
212 GPIO_FN_SCIFA3_RTS_44, GPIO_FN_SCIFA3_RTS_141,
213 GPIO_FN_SCIFA3_SCK, GPIO_FN_SCIFA3_TXD,
214 GPIO_FN_SCIFA3_RXD,
215
216 /* SCIFA4 (PORT 5, 6) */
217 GPIO_FN_SCIFA4_RXD, GPIO_FN_SCIFA4_TXD,
218
219 /* SCIFA5 (PORT 8, 12) */
220 GPIO_FN_SCIFA5_RXD, GPIO_FN_SCIFA5_TXD,
221
222 /* SCIFB (PORT 162, 163, 164, 165, 166) */
223 GPIO_FN_SCIFB_SCK, GPIO_FN_SCIFB_RTS,
224 GPIO_FN_SCIFB_CTS, GPIO_FN_SCIFB_TXD,
225 GPIO_FN_SCIFB_RXD,
226
227 /*
228 * CEU (PORT 16, 17,
229 * 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
230 * 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
231 * 120)
232 */
233 GPIO_FN_VIO_HD, GPIO_FN_VIO_CKO1, GPIO_FN_VIO_CKO2,
234 GPIO_FN_VIO_VD, GPIO_FN_VIO_CLK, GPIO_FN_VIO_FIELD,
235 GPIO_FN_VIO_CKO,
236 GPIO_FN_VIO_D0, GPIO_FN_VIO_D1, GPIO_FN_VIO_D2,
237 GPIO_FN_VIO_D3, GPIO_FN_VIO_D4, GPIO_FN_VIO_D5,
238 GPIO_FN_VIO_D6, GPIO_FN_VIO_D7, GPIO_FN_VIO_D8,
239 GPIO_FN_VIO_D9, GPIO_FN_VIO_D10, GPIO_FN_VIO_D11,
240 GPIO_FN_VIO_D12, GPIO_FN_VIO_D13, GPIO_FN_VIO_D14,
241 GPIO_FN_VIO_D15,
242
243 /* USB0 (PORT 113, 114, 115, 116, 117, 167) */
244 GPIO_FN_IDIN_0, GPIO_FN_EXTLP_0,
245 GPIO_FN_OVCN2_0, GPIO_FN_PWEN_0,
246 GPIO_FN_OVCN_0, GPIO_FN_VBUS0_0,
247
248 /* USB1 (PORT 18, 113, 114, 115, 116, 117, 138, 162, 168) */
249 GPIO_FN_IDIN_1_18, GPIO_FN_IDIN_1_113,
250 GPIO_FN_PWEN_1_115, GPIO_FN_PWEN_1_138,
251 GPIO_FN_OVCN_1_114, GPIO_FN_OVCN_1_162,
252 GPIO_FN_EXTLP_1, GPIO_FN_OVCN2_1,
253 GPIO_FN_VBUS0_1,
254
255 /* GPIO (PORT 41, 42, 43, 44) */
256 GPIO_FN_GPI0, GPIO_FN_GPI1, GPIO_FN_GPO0, GPIO_FN_GPO1,
257
258 /*
259 * BSC (PORT 19,
260 * 20, 21, 22, 25, 26, 27, 28, 29,
261 * 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
262 * 40, 41, 42, 43, 44, 45,
263 * 62, 63, 64, 65, 66, 67,
264 * 71, 72, 74, 75)
265 */
266 GPIO_FN_BS, GPIO_FN_WE1,
267 GPIO_FN_CKO, GPIO_FN_WAIT, GPIO_FN_RDWR,
268
269 GPIO_FN_A0, GPIO_FN_A1, GPIO_FN_A2, GPIO_FN_A3,
270 GPIO_FN_A6, GPIO_FN_A7, GPIO_FN_A8, GPIO_FN_A9,
271 GPIO_FN_A10, GPIO_FN_A11, GPIO_FN_A12, GPIO_FN_A13,
272 GPIO_FN_A14, GPIO_FN_A15, GPIO_FN_A16, GPIO_FN_A17,
273 GPIO_FN_A18, GPIO_FN_A19, GPIO_FN_A20, GPIO_FN_A21,
274 GPIO_FN_A22, GPIO_FN_A23, GPIO_FN_A24, GPIO_FN_A25,
275 GPIO_FN_A26,
276
277 GPIO_FN_CS0, GPIO_FN_CS2, GPIO_FN_CS4,
278 GPIO_FN_CS5A, GPIO_FN_CS5B, GPIO_FN_CS6A,
279
280 /*
281 * BSC/FLCTL (PORT 23, 24,
282 * 46, 47, 48, 49,
283 * 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
284 * 60, 61, 69, 70)
285 */
286 GPIO_FN_RD_FSC, GPIO_FN_WE0_FWE,
287 GPIO_FN_A4_FOE, GPIO_FN_A5_FCDE,
288 GPIO_FN_D0_NAF0, GPIO_FN_D1_NAF1, GPIO_FN_D2_NAF2,
289 GPIO_FN_D3_NAF3, GPIO_FN_D4_NAF4, GPIO_FN_D5_NAF5,
290 GPIO_FN_D6_NAF6, GPIO_FN_D7_NAF7, GPIO_FN_D8_NAF8,
291 GPIO_FN_D9_NAF9, GPIO_FN_D10_NAF10, GPIO_FN_D11_NAF11,
292 GPIO_FN_D12_NAF12, GPIO_FN_D13_NAF13, GPIO_FN_D14_NAF14,
293 GPIO_FN_D15_NAF15,
294
295 /*
296 * MMCIF(1) (PORT 84, 85, 86, 87, 88, 89,
297 * 90, 91, 92, 99)
298 */
299 GPIO_FN_MMCD0_0, GPIO_FN_MMCD0_1, GPIO_FN_MMCD0_2,
300 GPIO_FN_MMCD0_3, GPIO_FN_MMCD0_4, GPIO_FN_MMCD0_5,
301 GPIO_FN_MMCD0_6, GPIO_FN_MMCD0_7,
302 GPIO_FN_MMCCMD0, GPIO_FN_MMCCLK0,
303
304 /* MMCIF(2) (PORT 54, 55, 56, 57, 58, 59, 60, 61, 66, 67) */
305 GPIO_FN_MMCD1_0, GPIO_FN_MMCD1_1, GPIO_FN_MMCD1_2,
306 GPIO_FN_MMCD1_3, GPIO_FN_MMCD1_4, GPIO_FN_MMCD1_5,
307 GPIO_FN_MMCD1_6, GPIO_FN_MMCD1_7,
308 GPIO_FN_MMCCLK1, GPIO_FN_MMCCMD1,
309
310 /* SPU2 (PORT 65) */
311 GPIO_FN_VINT_I,
312
313 /* FLCTL (PORT 66, 68, 73) */
314 GPIO_FN_FCE1, GPIO_FN_FCE0, GPIO_FN_FRB,
315
316 /* HSI (PORT 76, 77, 78, 79, 80, 81, 82, 83) */
317 GPIO_FN_GP_RX_FLAG, GPIO_FN_GP_RX_DATA, GPIO_FN_GP_TX_READY,
318 GPIO_FN_GP_RX_WAKE, GPIO_FN_MP_TX_FLAG, GPIO_FN_MP_TX_DATA,
319 GPIO_FN_MP_RX_READY, GPIO_FN_MP_TX_WAKE,
320
321 /*
322 * MFI (PORT 76, 77, 78, 79,
323 * 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
324 * 90, 91, 92, 93, 94, 95, 96, 97, 98, 99)
325 */
326 GPIO_FN_MFIv6, /* see MSEL4CR 6 */
327 GPIO_FN_MFIv4, /* see MSEL4CR 6 */
328
329 GPIO_FN_MEMC_CS0, GPIO_FN_MEMC_BUSCLK_MEMC_A0,
330 GPIO_FN_MEMC_CS1_MEMC_A1, GPIO_FN_MEMC_ADV_MEMC_DREQ0,
331 GPIO_FN_MEMC_WAIT_MEMC_DREQ1, GPIO_FN_MEMC_NOE,
332 GPIO_FN_MEMC_NWE, GPIO_FN_MEMC_INT,
333
334 GPIO_FN_MEMC_AD0, GPIO_FN_MEMC_AD1, GPIO_FN_MEMC_AD2,
335 GPIO_FN_MEMC_AD3, GPIO_FN_MEMC_AD4, GPIO_FN_MEMC_AD5,
336 GPIO_FN_MEMC_AD6, GPIO_FN_MEMC_AD7, GPIO_FN_MEMC_AD8,
337 GPIO_FN_MEMC_AD9, GPIO_FN_MEMC_AD10, GPIO_FN_MEMC_AD11,
338 GPIO_FN_MEMC_AD12, GPIO_FN_MEMC_AD13, GPIO_FN_MEMC_AD14,
339 GPIO_FN_MEMC_AD15,
340
341 /* SIM (PORT 94, 95, 98) */
342 GPIO_FN_SIM_RST, GPIO_FN_SIM_CLK, GPIO_FN_SIM_D,
343
344 /* TPU (PORT 93, 99, 112, 160, 161) */
345 GPIO_FN_TPU0TO0, GPIO_FN_TPU0TO1,
346 GPIO_FN_TPU0TO2_93, GPIO_FN_TPU0TO2_99,
347 GPIO_FN_TPU0TO3,
348
349 /* I2C2 (PORT 110, 111) */
350 GPIO_FN_I2C_SCL2, GPIO_FN_I2C_SDA2,
351
352 /* I2C3(1) (PORT 114, 115) */
353 GPIO_FN_I2C_SCL3, GPIO_FN_I2C_SDA3,
354
355 /* I2C3(2) (PORT 137, 145) */
356 GPIO_FN_I2C_SCL3S, GPIO_FN_I2C_SDA3S,
357
358 /* I2C4(2) (PORT 116, 117) */
359 GPIO_FN_I2C_SCL4, GPIO_FN_I2C_SDA4,
360
361 /* I2C4(2) (PORT 146, 147) */
362 GPIO_FN_I2C_SCL4S, GPIO_FN_I2C_SDA4S,
363
364 /*
365 * KEYSC (PORT 121, 122, 123, 124, 125, 126, 127, 128, 129,
366 * 130, 131, 132, 133, 134, 135, 136)
367 */
368 GPIO_FN_KEYOUT0, GPIO_FN_KEYIN0_121, GPIO_FN_KEYIN0_136,
369 GPIO_FN_KEYOUT1, GPIO_FN_KEYIN1_122, GPIO_FN_KEYIN1_135,
370 GPIO_FN_KEYOUT2, GPIO_FN_KEYIN2_123, GPIO_FN_KEYIN2_134,
371 GPIO_FN_KEYOUT3, GPIO_FN_KEYIN3_124, GPIO_FN_KEYIN3_133,
372 GPIO_FN_KEYOUT4, GPIO_FN_KEYIN4,
373 GPIO_FN_KEYOUT5, GPIO_FN_KEYIN5,
374 GPIO_FN_KEYOUT6, GPIO_FN_KEYIN6,
375 GPIO_FN_KEYOUT7, GPIO_FN_KEYIN7,
376
377 /*
378 * LCDC (PORT 121, 122, 123, 124, 125, 126, 127, 128, 129,
379 * 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
380 * 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
381 * 150, 151)
382 */
383 GPIO_FN_LCDC0_SELECT, /* LCDC 0 */
384 GPIO_FN_LCDC1_SELECT, /* LCDC 1 */
385 GPIO_FN_LCDHSYN, GPIO_FN_LCDCS, GPIO_FN_LCDVSYN,
386 GPIO_FN_LCDDCK, GPIO_FN_LCDWR, GPIO_FN_LCDRD,
387 GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_LCDLCLK,
388 GPIO_FN_LCDDON,
389
390 GPIO_FN_LCDD0, GPIO_FN_LCDD1, GPIO_FN_LCDD2, GPIO_FN_LCDD3,
391 GPIO_FN_LCDD4, GPIO_FN_LCDD5, GPIO_FN_LCDD6, GPIO_FN_LCDD7,
392 GPIO_FN_LCDD8, GPIO_FN_LCDD9, GPIO_FN_LCDD10, GPIO_FN_LCDD11,
393 GPIO_FN_LCDD12, GPIO_FN_LCDD13, GPIO_FN_LCDD14, GPIO_FN_LCDD15,
394 GPIO_FN_LCDD16, GPIO_FN_LCDD17, GPIO_FN_LCDD18, GPIO_FN_LCDD19,
395 GPIO_FN_LCDD20, GPIO_FN_LCDD21, GPIO_FN_LCDD22, GPIO_FN_LCDD23,
396
397 /* IRDA (PORT 139, 140, 141, 142) */
398 GPIO_FN_IRDA_OUT, GPIO_FN_IRDA_IN, GPIO_FN_IRDA_FIRSEL,
399 GPIO_FN_IROUT_139, GPIO_FN_IROUT_140,
400
401 /* TSIF1 (PORT 156, 157, 158, 159) */
402 GPIO_FN_TS0_1SELECT, /* TSIF0 - 1 select */
403 GPIO_FN_TS0_2SELECT, /* TSIF0 - 2 select */
404 GPIO_FN_TS1_1SELECT, /* TSIF1 - 1 select */
405 GPIO_FN_TS1_2SELECT, /* TSIF1 - 2 select */
406
407 GPIO_FN_TS_SPSYNC1, GPIO_FN_TS_SDAT1,
408 GPIO_FN_TS_SDEN1, GPIO_FN_TS_SCK1,
409
410 /* TSIF2 (PORT 137, 145, 146, 147) */
411 GPIO_FN_TS_SPSYNC2, GPIO_FN_TS_SDAT2,
412 GPIO_FN_TS_SDEN2, GPIO_FN_TS_SCK2,
413
414 /* HDMI (PORT 169, 170) */
415 GPIO_FN_HDMI_HPD, GPIO_FN_HDMI_CEC,
416
417 /* SDHI0 (PORT 171, 172, 173, 174, 175, 176, 177, 178) */
418 GPIO_FN_SDHICLK0, GPIO_FN_SDHICD0,
419 GPIO_FN_SDHICMD0, GPIO_FN_SDHIWP0,
420 GPIO_FN_SDHID0_0, GPIO_FN_SDHID0_1,
421 GPIO_FN_SDHID0_2, GPIO_FN_SDHID0_3,
422
423 /* SDHI1 (PORT 179, 180, 181, 182, 183, 184) */
424 GPIO_FN_SDHICLK1, GPIO_FN_SDHICMD1, GPIO_FN_SDHID1_0,
425 GPIO_FN_SDHID1_1, GPIO_FN_SDHID1_2, GPIO_FN_SDHID1_3,
426
427 /* SDHI2 (PORT 185, 186, 187, 188, 189, 190) */
428 GPIO_FN_SDHICLK2, GPIO_FN_SDHICMD2, GPIO_FN_SDHID2_0,
429 GPIO_FN_SDHID2_1, GPIO_FN_SDHID2_2, GPIO_FN_SDHID2_3,
430
431 /* SDENC see MSEL4CR 19 */
432 GPIO_FN_SDENC_CPG,
433 GPIO_FN_SDENC_DV_CLKI,
434};
435
436/* DMA slave IDs */
437enum {
438 SHDMA_SLAVE_SCIF0_TX,
439 SHDMA_SLAVE_SCIF0_RX,
440 SHDMA_SLAVE_SCIF1_TX,
441 SHDMA_SLAVE_SCIF1_RX,
442 SHDMA_SLAVE_SCIF2_TX,
443 SHDMA_SLAVE_SCIF2_RX,
444 SHDMA_SLAVE_SCIF3_TX,
445 SHDMA_SLAVE_SCIF3_RX,
446 SHDMA_SLAVE_SCIF4_TX,
447 SHDMA_SLAVE_SCIF4_RX,
448 SHDMA_SLAVE_SCIF5_TX,
449 SHDMA_SLAVE_SCIF5_RX,
450 SHDMA_SLAVE_SCIF6_TX,
451 SHDMA_SLAVE_SCIF6_RX,
452 SHDMA_SLAVE_SDHI0_RX,
453 SHDMA_SLAVE_SDHI0_TX,
454 SHDMA_SLAVE_SDHI1_RX,
455 SHDMA_SLAVE_SDHI1_TX,
456 SHDMA_SLAVE_SDHI2_RX,
457 SHDMA_SLAVE_SDHI2_TX,
458 SHDMA_SLAVE_MMCIF_RX,
459 SHDMA_SLAVE_MMCIF_TX,
460};
461
462extern struct clk sh7372_extal1_clk;
463extern struct clk sh7372_extal2_clk;
464extern struct clk sh7372_dv_clki_clk;
465extern struct clk sh7372_dv_clki_div2_clk;
466extern struct clk sh7372_pllc2_clk;
467extern struct clk sh7372_fsiack_clk;
468extern struct clk sh7372_fsibck_clk;
469extern struct clk sh7372_fsidiva_clk;
470extern struct clk sh7372_fsidivb_clk;
471
472#endif /* __ASM_SH7372_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh7377.h b/arch/arm/mach-shmobile/include/mach/sh7377.h
new file mode 100644
index 000000000000..f580e227dd1c
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/sh7377.h
@@ -0,0 +1,360 @@
1#ifndef __ASM_SH7377_H__
2#define __ASM_SH7377_H__
3
4/* Pin Function Controller:
5 * GPIO_FN_xx - GPIO used to select pin function
6 * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
7 */
8enum {
9 /* 55-1 -> 55-5 (GPIO) */
10 GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
11 GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
12
13 GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
14 GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
15
16 GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
17 GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
18
19 GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
20 GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
21
22 GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
23 GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
24
25 GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
26 GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
27
28 GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
29 GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
30
31 GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
32 GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
33
34 GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
35 GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
36
37 GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
38 GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
39
40 GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
41 GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
42
43 GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
44 GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118,
45
46 GPIO_PORT128, GPIO_PORT129,
47
48 GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
49 GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
50
51 GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
52 GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
53
54 GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
55 GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
56
57 GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
58
59 GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
60 GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
61
62 GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
63 GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
64
65 GPIO_PORT210, GPIO_PORT211, GPIO_PORT212, GPIO_PORT213, GPIO_PORT214,
66 GPIO_PORT215, GPIO_PORT216, GPIO_PORT217, GPIO_PORT218, GPIO_PORT219,
67
68 GPIO_PORT220, GPIO_PORT221, GPIO_PORT222, GPIO_PORT223, GPIO_PORT224,
69 GPIO_PORT225, GPIO_PORT226, GPIO_PORT227, GPIO_PORT228, GPIO_PORT229,
70
71 GPIO_PORT230, GPIO_PORT231, GPIO_PORT232, GPIO_PORT233, GPIO_PORT234,
72 GPIO_PORT235, GPIO_PORT236, GPIO_PORT237, GPIO_PORT238, GPIO_PORT239,
73
74 GPIO_PORT240, GPIO_PORT241, GPIO_PORT242, GPIO_PORT243, GPIO_PORT244,
75 GPIO_PORT245, GPIO_PORT246, GPIO_PORT247, GPIO_PORT248, GPIO_PORT249,
76
77 GPIO_PORT250, GPIO_PORT251, GPIO_PORT252, GPIO_PORT253, GPIO_PORT254,
78 GPIO_PORT255, GPIO_PORT256, GPIO_PORT257, GPIO_PORT258, GPIO_PORT259,
79
80 GPIO_PORT260, GPIO_PORT261, GPIO_PORT262, GPIO_PORT263, GPIO_PORT264,
81
82 /* Special Pull-up / Pull-down Functions */
83 GPIO_FN_PORT66_KEYIN0_PU, GPIO_FN_PORT67_KEYIN1_PU,
84 GPIO_FN_PORT68_KEYIN2_PU, GPIO_FN_PORT69_KEYIN3_PU,
85 GPIO_FN_PORT70_KEYIN4_PU, GPIO_FN_PORT71_KEYIN5_PU,
86 GPIO_FN_PORT72_KEYIN6_PU,
87
88 /* 55-1 (FN) */
89 GPIO_FN_VBUS_0,
90 GPIO_FN_CPORT0,
91 GPIO_FN_CPORT1,
92 GPIO_FN_CPORT2,
93 GPIO_FN_CPORT3,
94 GPIO_FN_CPORT4,
95 GPIO_FN_CPORT5,
96 GPIO_FN_CPORT6,
97 GPIO_FN_CPORT7,
98 GPIO_FN_CPORT8,
99 GPIO_FN_CPORT9,
100 GPIO_FN_CPORT10,
101 GPIO_FN_CPORT11, GPIO_FN_SIN2,
102 GPIO_FN_CPORT12, GPIO_FN_XCTS2,
103 GPIO_FN_CPORT13, GPIO_FN_RFSPO4,
104 GPIO_FN_CPORT14, GPIO_FN_RFSPO5,
105 GPIO_FN_CPORT15, GPIO_FN_SCIFA0_SCK, GPIO_FN_GPS_AGC2,
106 GPIO_FN_CPORT16, GPIO_FN_SCIFA0_TXD, GPIO_FN_GPS_AGC3,
107 GPIO_FN_CPORT17_IC_OE, GPIO_FN_SOUT2,
108 GPIO_FN_CPORT18, GPIO_FN_XRTS2, GPIO_FN_PORT19_VIO_CKO2,
109 GPIO_FN_CPORT19_MPORT1,
110 GPIO_FN_CPORT20, GPIO_FN_RFSPO6,
111 GPIO_FN_CPORT21, GPIO_FN_STATUS0,
112 GPIO_FN_CPORT22, GPIO_FN_STATUS1,
113 GPIO_FN_CPORT23, GPIO_FN_STATUS2, GPIO_FN_RFSPO7,
114 GPIO_FN_B_SYNLD1,
115 GPIO_FN_B_SYNLD2, GPIO_FN_SYSENMSK,
116 GPIO_FN_XMAINPS,
117 GPIO_FN_XDIVPS,
118 GPIO_FN_XIDRST,
119 GPIO_FN_IDCLK, GPIO_FN_IC_DP,
120 GPIO_FN_IDIO, GPIO_FN_IC_DM,
121 GPIO_FN_SOUT1, GPIO_FN_SCIFA4_TXD, GPIO_FN_M02_BERDAT,
122 GPIO_FN_SIN1, GPIO_FN_SCIFA4_RXD, GPIO_FN_XWUP,
123 GPIO_FN_XRTS1, GPIO_FN_SCIFA4_RTS, GPIO_FN_M03_BERCLK,
124 GPIO_FN_XCTS1, GPIO_FN_SCIFA4_CTS,
125 GPIO_FN_PCMCLKO,
126 GPIO_FN_SYNC8KO,
127
128 /* 55-2 (FN) */
129 GPIO_FN_DNPCM_A,
130 GPIO_FN_UPPCM_A,
131 GPIO_FN_VACK,
132 GPIO_FN_XTALB1L,
133 GPIO_FN_GPS_AGC1, GPIO_FN_SCIFA0_RTS,
134 GPIO_FN_GPS_AGC4, GPIO_FN_SCIFA0_RXD,
135 GPIO_FN_GPS_PWRDOWN, GPIO_FN_SCIFA0_CTS,
136 GPIO_FN_GPS_IM,
137 GPIO_FN_GPS_IS,
138 GPIO_FN_GPS_QM,
139 GPIO_FN_GPS_QS,
140 GPIO_FN_FMSOCK, GPIO_FN_PORT49_IRDA_OUT, GPIO_FN_PORT49_IROUT,
141 GPIO_FN_FMSOOLR, GPIO_FN_BBIF2_TSYNC2, GPIO_FN_TPU2TO2, GPIO_FN_IPORT3,
142 GPIO_FN_FMSIOLR,
143 GPIO_FN_FMSOOBT, GPIO_FN_BBIF2_TSCK2, GPIO_FN_TPU2TO3, GPIO_FN_OPORT1,
144 GPIO_FN_FMSIOBT,
145 GPIO_FN_FMSOSLD, GPIO_FN_BBIF2_TXD2, GPIO_FN_OPORT2,
146 GPIO_FN_FMSOILR, GPIO_FN_PORT53_IRDA_IN, GPIO_FN_TPU3TO3,
147 GPIO_FN_OPORT3, GPIO_FN_FMSIILR,
148 GPIO_FN_FMSOIBT, GPIO_FN_PORT54_IRDA_FIRSEL, GPIO_FN_TPU3TO2,
149 GPIO_FN_FMSIIBT,
150 GPIO_FN_FMSISLD, GPIO_FN_MFG0_OUT1, GPIO_FN_TPU0TO0,
151 GPIO_FN_A0_EA0, GPIO_FN_BS,
152 GPIO_FN_A12_EA12, GPIO_FN_PORT58_VIO_CKOR, GPIO_FN_TPU4TO2,
153 GPIO_FN_A13_EA13, GPIO_FN_PORT59_IROUT, GPIO_FN_MFG0_OUT2,
154 GPIO_FN_TPU0TO1,
155 GPIO_FN_A14_EA14, GPIO_FN_PORT60_KEYOUT5,
156 GPIO_FN_A15_EA15, GPIO_FN_PORT61_KEYOUT4,
157 GPIO_FN_A16_EA16, GPIO_FN_PORT62_KEYOUT3, GPIO_FN_MSIOF0_SS1,
158 GPIO_FN_A17_EA17, GPIO_FN_PORT63_KEYOUT2, GPIO_FN_MSIOF0_TSYNC,
159 GPIO_FN_A18_EA18, GPIO_FN_PORT64_KEYOUT1, GPIO_FN_MSIOF0_TSCK,
160 GPIO_FN_A19_EA19, GPIO_FN_PORT65_KEYOUT0, GPIO_FN_MSIOF0_TXD,
161 GPIO_FN_A20_EA20, GPIO_FN_PORT66_KEYIN0, GPIO_FN_MSIOF0_RSCK,
162 GPIO_FN_A21_EA21, GPIO_FN_PORT67_KEYIN1, GPIO_FN_MSIOF0_RSYNC,
163 GPIO_FN_A22_EA22, GPIO_FN_PORT68_KEYIN2, GPIO_FN_MSIOF0_MCK0,
164 GPIO_FN_A23_EA23, GPIO_FN_PORT69_KEYIN3, GPIO_FN_MSIOF0_MCK1,
165 GPIO_FN_A24_EA24, GPIO_FN_PORT70_KEYIN4, GPIO_FN_MSIOF0_RXD,
166 GPIO_FN_A25_EA25, GPIO_FN_PORT71_KEYIN5, GPIO_FN_MSIOF0_SS2,
167 GPIO_FN_A26, GPIO_FN_PORT72_KEYIN6,
168 GPIO_FN_D0_ED0_NAF0,
169 GPIO_FN_D1_ED1_NAF1,
170 GPIO_FN_D2_ED2_NAF2,
171 GPIO_FN_D3_ED3_NAF3,
172 GPIO_FN_D4_ED4_NAF4,
173 GPIO_FN_D5_ED5_NAF5,
174 GPIO_FN_D6_ED6_NAF6,
175 GPIO_FN_D7_ED7_NAF7,
176 GPIO_FN_D8_ED8_NAF8,
177 GPIO_FN_D9_ED9_NAF9,
178 GPIO_FN_D10_ED10_NAF10,
179 GPIO_FN_D11_ED11_NAF11,
180 GPIO_FN_D12_ED12_NAF12,
181 GPIO_FN_D13_ED13_NAF13,
182 GPIO_FN_D14_ED14_NAF14,
183 GPIO_FN_D15_ED15_NAF15,
184 GPIO_FN_CS4,
185 GPIO_FN_CS5A, GPIO_FN_FMSICK,
186 GPIO_FN_CS5B, GPIO_FN_FCE1,
187
188 /* 55-3 (FN) */
189 GPIO_FN_CS6B, GPIO_FN_XCS2, GPIO_FN_CS6A, GPIO_FN_DACK0,
190 GPIO_FN_FCE0,
191 GPIO_FN_WAIT, GPIO_FN_DREQ0,
192 GPIO_FN_RD_XRD,
193 GPIO_FN_WE0_XWR0_FWE,
194 GPIO_FN_WE1_XWR1,
195 GPIO_FN_FRB,
196 GPIO_FN_CKO,
197 GPIO_FN_NBRSTOUT,
198 GPIO_FN_NBRST,
199 GPIO_FN_GPS_EPPSIN,
200 GPIO_FN_LATCHPULSE,
201 GPIO_FN_LTESIGNAL,
202 GPIO_FN_LEGACYSTATE,
203 GPIO_FN_TCKON,
204 GPIO_FN_VIO_VD, GPIO_FN_PORT128_KEYOUT0, GPIO_FN_IPORT0,
205 GPIO_FN_VIO_HD, GPIO_FN_PORT129_KEYOUT1, GPIO_FN_IPORT1,
206 GPIO_FN_VIO_D0, GPIO_FN_PORT130_KEYOUT2, GPIO_FN_PORT130_MSIOF2_RXD,
207 GPIO_FN_VIO_D1, GPIO_FN_PORT131_KEYOUT3, GPIO_FN_PORT131_MSIOF2_SS1,
208 GPIO_FN_VIO_D2, GPIO_FN_PORT132_KEYOUT4, GPIO_FN_PORT132_MSIOF2_SS2,
209 GPIO_FN_VIO_D3, GPIO_FN_PORT133_KEYOUT5, GPIO_FN_PORT133_MSIOF2_TSYNC,
210 GPIO_FN_VIO_D4, GPIO_FN_PORT134_KEYIN0, GPIO_FN_PORT134_MSIOF2_TXD,
211 GPIO_FN_VIO_D5, GPIO_FN_PORT135_KEYIN1, GPIO_FN_PORT135_MSIOF2_TSCK,
212 GPIO_FN_VIO_D6, GPIO_FN_PORT136_KEYIN2,
213 GPIO_FN_VIO_D7, GPIO_FN_PORT137_KEYIN3,
214 GPIO_FN_VIO_D8, GPIO_FN_M9_SLCD_A01, GPIO_FN_PORT138_FSIAOMC,
215 GPIO_FN_VIO_D9, GPIO_FN_M10_SLCD_CK1, GPIO_FN_PORT139_FSIAOLR,
216 GPIO_FN_VIO_D10, GPIO_FN_M11_SLCD_SO1, GPIO_FN_TPU0TO2,
217 GPIO_FN_PORT140_FSIAOBT,
218 GPIO_FN_VIO_D11, GPIO_FN_M12_SLCD_CE1, GPIO_FN_TPU0TO3,
219 GPIO_FN_PORT141_FSIAOSLD,
220 GPIO_FN_VIO_D12, GPIO_FN_M13_BSW, GPIO_FN_PORT142_FSIACK,
221 GPIO_FN_VIO_D13, GPIO_FN_M14_GSW, GPIO_FN_PORT143_FSIAILR,
222 GPIO_FN_VIO_D14, GPIO_FN_M15_RSW, GPIO_FN_PORT144_FSIAIBT,
223 GPIO_FN_VIO_D15, GPIO_FN_TPU1TO3, GPIO_FN_PORT145_FSIAISLD,
224 GPIO_FN_VIO_CLK, GPIO_FN_PORT146_KEYIN4, GPIO_FN_IPORT2,
225 GPIO_FN_VIO_FIELD, GPIO_FN_PORT147_KEYIN5,
226 GPIO_FN_VIO_CKO, GPIO_FN_PORT148_KEYIN6,
227 GPIO_FN_A27, GPIO_FN_RDWR_XWE, GPIO_FN_MFG0_IN1,
228 GPIO_FN_MFG0_IN2,
229 GPIO_FN_TS_SPSYNC3, GPIO_FN_MSIOF2_RSCK,
230 GPIO_FN_TS_SDAT3, GPIO_FN_MSIOF2_RSYNC,
231 GPIO_FN_TPU1TO2, GPIO_FN_TS_SDEN3, GPIO_FN_PORT153_MSIOF2_SS1,
232 GPIO_FN_SOUT3, GPIO_FN_SCIFA2_TXD1, GPIO_FN_MSIOF2_MCK0,
233 GPIO_FN_SIN3, GPIO_FN_SCIFA2_RXD1, GPIO_FN_MSIOF2_MCK1,
234 GPIO_FN_XRTS3, GPIO_FN_SCIFA2_RTS1, GPIO_FN_PORT156_MSIOF2_SS2,
235 GPIO_FN_XCTS3, GPIO_FN_SCIFA2_CTS1, GPIO_FN_PORT157_MSIOF2_RXD,
236
237 /* 55-4 (FN) */
238 GPIO_FN_DINT, GPIO_FN_SCIFA2_SCK1, GPIO_FN_TS_SCK3,
239 GPIO_FN_PORT159_SCIFB_SCK, GPIO_FN_PORT159_SCIFA5_SCK, GPIO_FN_NMI,
240 GPIO_FN_PORT160_SCIFB_TXD, GPIO_FN_PORT160_SCIFA5_TXD, GPIO_FN_SOUT0,
241 GPIO_FN_PORT161_SCIFB_CTS, GPIO_FN_PORT161_SCIFA5_CTS, GPIO_FN_XCTS0,
242 GPIO_FN_MFG3_IN2,
243 GPIO_FN_PORT162_SCIFB_RXD, GPIO_FN_PORT162_SCIFA5_RXD, GPIO_FN_SIN0,
244 GPIO_FN_MFG3_IN1,
245 GPIO_FN_PORT163_SCIFB_RTS, GPIO_FN_PORT163_SCIFA5_RTS, GPIO_FN_XRTS0,
246 GPIO_FN_MFG3_OUT1,
247 GPIO_FN_TPU3TO0,
248 GPIO_FN_LCDD0, GPIO_FN_PORT192_KEYOUT0, GPIO_FN_EXT_CKI,
249 GPIO_FN_LCDD1, GPIO_FN_PORT193_KEYOUT1, GPIO_FN_PORT193_SCIFA5_CTS,
250 GPIO_FN_BBIF2_TSYNC1,
251 GPIO_FN_LCDD2, GPIO_FN_PORT194_KEYOUT2, GPIO_FN_PORT194_SCIFA5_RTS,
252 GPIO_FN_BBIF2_TSCK1,
253 GPIO_FN_LCDD3, GPIO_FN_PORT195_KEYOUT3, GPIO_FN_PORT195_SCIFA5_RXD,
254 GPIO_FN_BBIF2_TXD1,
255 GPIO_FN_LCDD4, GPIO_FN_PORT196_KEYOUT4, GPIO_FN_PORT196_SCIFA5_TXD,
256 GPIO_FN_LCDD5, GPIO_FN_PORT197_KEYOUT5, GPIO_FN_PORT197_SCIFA5_SCK,
257 GPIO_FN_MFG2_OUT2, GPIO_FN_TPU2TO1,
258 GPIO_FN_LCDD6, GPIO_FN_XWR2,
259 GPIO_FN_LCDD7, GPIO_FN_TPU4TO1, GPIO_FN_MFG4_OUT2, GPIO_FN_XWR3,
260 GPIO_FN_LCDD8, GPIO_FN_PORT200_KEYIN0, GPIO_FN_VIO_DR0, GPIO_FN_D16,
261 GPIO_FN_ED16,
262 GPIO_FN_LCDD9, GPIO_FN_PORT201_KEYIN1, GPIO_FN_VIO_DR1, GPIO_FN_D17,
263 GPIO_FN_ED17,
264 GPIO_FN_LCDD10, GPIO_FN_PORT202_KEYIN2, GPIO_FN_VIO_DR2, GPIO_FN_D18,
265 GPIO_FN_ED18,
266 GPIO_FN_LCDD11, GPIO_FN_PORT203_KEYIN3, GPIO_FN_VIO_DR3, GPIO_FN_D19,
267 GPIO_FN_ED19,
268 GPIO_FN_LCDD12, GPIO_FN_PORT204_KEYIN4, GPIO_FN_VIO_DR4, GPIO_FN_D20,
269 GPIO_FN_ED20,
270 GPIO_FN_LCDD13, GPIO_FN_PORT205_KEYIN5, GPIO_FN_VIO_DR5, GPIO_FN_D21,
271 GPIO_FN_ED21,
272 GPIO_FN_LCDD14, GPIO_FN_PORT206_KEYIN6, GPIO_FN_VIO_DR6, GPIO_FN_D22,
273 GPIO_FN_ED22,
274 GPIO_FN_LCDD15, GPIO_FN_PORT207_MSIOF0L_SS1, GPIO_FN_PORT207_KEYOUT0,
275 GPIO_FN_VIO_DR7,
276 GPIO_FN_D23, GPIO_FN_ED23,
277 GPIO_FN_LCDD16, GPIO_FN_PORT208_MSIOF0L_SS2, GPIO_FN_PORT208_KEYOUT1,
278 GPIO_FN_VIO_VDR,
279 GPIO_FN_D24, GPIO_FN_ED24,
280 GPIO_FN_LCDD17, GPIO_FN_PORT209_KEYOUT2, GPIO_FN_VIO_HDR, GPIO_FN_D25,
281 GPIO_FN_ED25,
282 GPIO_FN_LCDD18, GPIO_FN_DREQ2, GPIO_FN_PORT210_MSIOF0L_SS1, GPIO_FN_D26,
283 GPIO_FN_ED26,
284 GPIO_FN_LCDD19, GPIO_FN_PORT211_MSIOF0L_SS2, GPIO_FN_D27, GPIO_FN_ED27,
285 GPIO_FN_LCDD20, GPIO_FN_TS_SPSYNC1, GPIO_FN_MSIOF0L_MCK0, GPIO_FN_D28,
286 GPIO_FN_ED28,
287 GPIO_FN_LCDD21, GPIO_FN_TS_SDAT1, GPIO_FN_MSIOF0L_MCK1, GPIO_FN_D29,
288 GPIO_FN_ED29,
289 GPIO_FN_LCDD22, GPIO_FN_TS_SDEN1, GPIO_FN_MSIOF0L_RSCK, GPIO_FN_D30,
290 GPIO_FN_ED30,
291 GPIO_FN_LCDD23, GPIO_FN_TS_SCK1, GPIO_FN_MSIOF0L_RSYNC, GPIO_FN_D31,
292 GPIO_FN_ED31,
293 GPIO_FN_LCDDCK, GPIO_FN_LCDWR, GPIO_FN_PORT216_KEYOUT3,
294 GPIO_FN_VIO_CLKR,
295 GPIO_FN_LCDRD, GPIO_FN_DACK2, GPIO_FN_MSIOF0L_TSYNC,
296 GPIO_FN_LCDHSYN, GPIO_FN_LCDCS, GPIO_FN_LCDCS2, GPIO_FN_DACK3,
297 GPIO_FN_PORT218_VIO_CKOR, GPIO_FN_PORT218_KEYOUT4,
298 GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_DREQ3, GPIO_FN_MSIOF0L_TSCK,
299 GPIO_FN_LCDVSYN, GPIO_FN_LCDVSYN2, GPIO_FN_PORT220_KEYOUT5,
300 GPIO_FN_LCDLCLK, GPIO_FN_DREQ1, GPIO_FN_PWEN, GPIO_FN_MSIOF0L_RXD,
301 GPIO_FN_LCDDON, GPIO_FN_LCDDON2, GPIO_FN_DACK1, GPIO_FN_OVCN,
302 GPIO_FN_MSIOF0L_TXD,
303 GPIO_FN_SCIFA1_TXD, GPIO_FN_OVCN2,
304 GPIO_FN_EXTLP, GPIO_FN_SCIFA1_SCK, GPIO_FN_USBTERM,
305 GPIO_FN_PORT226_VIO_CKO2,
306 GPIO_FN_SCIFA1_RTS, GPIO_FN_IDIN,
307 GPIO_FN_SCIFA1_RXD,
308 GPIO_FN_SCIFA1_CTS, GPIO_FN_MFG1_IN1,
309 GPIO_FN_MSIOF1_TXD, GPIO_FN_SCIFA2_TXD2, GPIO_FN_PORT230_FSIAOMC,
310 GPIO_FN_MSIOF1_TSYNC, GPIO_FN_SCIFA2_CTS2, GPIO_FN_PORT231_FSIAOLR,
311 GPIO_FN_MSIOF1_TSCK, GPIO_FN_SCIFA2_SCK2, GPIO_FN_PORT232_FSIAOBT,
312 GPIO_FN_MSIOF1_RXD, GPIO_FN_SCIFA2_RXD2, GPIO_FN_GPS_VCOTRIG,
313 GPIO_FN_PORT233_FSIACK,
314 GPIO_FN_MSIOF1_RSCK, GPIO_FN_SCIFA2_RTS2, GPIO_FN_PORT234_FSIAOSLD,
315 GPIO_FN_MSIOF1_RSYNC, GPIO_FN_OPORT0, GPIO_FN_MFG1_IN2,
316 GPIO_FN_PORT235_FSIAILR,
317 GPIO_FN_MSIOF1_MCK0, GPIO_FN_I2C_SDA2, GPIO_FN_PORT236_FSIAIBT,
318 GPIO_FN_MSIOF1_MCK1, GPIO_FN_I2C_SCL2, GPIO_FN_PORT237_FSIAISLD,
319 GPIO_FN_MSIOF1_SS1, GPIO_FN_EDBGREQ3,
320
321 /* 55-5 (FN) */
322 GPIO_FN_MSIOF1_SS2,
323 GPIO_FN_SCIFA6_TXD,
324 GPIO_FN_PORT241_IRDA_OUT, GPIO_FN_PORT241_IROUT, GPIO_FN_MFG4_OUT1,
325 GPIO_FN_TPU4TO0,
326 GPIO_FN_PORT242_IRDA_IN, GPIO_FN_MFG4_IN2,
327 GPIO_FN_PORT243_IRDA_FIRSEL, GPIO_FN_PORT243_VIO_CKO2,
328 GPIO_FN_PORT244_SCIFA5_CTS, GPIO_FN_MFG2_IN1, GPIO_FN_PORT244_SCIFB_CTS,
329 GPIO_FN_PORT244_MSIOF2_RXD,
330 GPIO_FN_PORT245_SCIFA5_RTS, GPIO_FN_MFG2_IN2, GPIO_FN_PORT245_SCIFB_RTS,
331 GPIO_FN_PORT245_MSIOF2_TXD,
332 GPIO_FN_PORT246_SCIFA5_RXD, GPIO_FN_MFG1_OUT1,
333 GPIO_FN_PORT246_SCIFB_RXD, GPIO_FN_TPU1TO0,
334 GPIO_FN_PORT247_SCIFA5_TXD, GPIO_FN_MFG3_OUT2,
335 GPIO_FN_PORT247_SCIFB_TXD, GPIO_FN_TPU3TO1,
336 GPIO_FN_PORT248_SCIFA5_SCK, GPIO_FN_MFG2_OUT1,
337 GPIO_FN_PORT248_SCIFB_SCK, GPIO_FN_TPU2TO0,
338 GPIO_FN_PORT248_MSIOF2_TSCK,
339 GPIO_FN_PORT249_IROUT, GPIO_FN_MFG4_IN1, GPIO_FN_PORT249_MSIOF2_TSYNC,
340 GPIO_FN_SDHICLK0, GPIO_FN_TCK2_SWCLK_MC0,
341 GPIO_FN_SDHICD0,
342 GPIO_FN_SDHID0_0, GPIO_FN_TMS2_SWDIO_MC0,
343 GPIO_FN_SDHID0_1, GPIO_FN_TDO2_SWO0_MC0,
344 GPIO_FN_SDHID0_2, GPIO_FN_TDI2,
345 GPIO_FN_SDHID0_3, GPIO_FN_RTCK2_SWO1_MC0,
346 GPIO_FN_SDHICMD0, GPIO_FN_TRST2,
347 GPIO_FN_SDHIWP0, GPIO_FN_EDBGREQ2,
348 GPIO_FN_SDHICLK1, GPIO_FN_TCK3_SWCLK_MC1,
349 GPIO_FN_SDHID1_0, GPIO_FN_M11_SLCD_SO2, GPIO_FN_TS_SPSYNC2,
350 GPIO_FN_TMS3_SWDIO_MC1,
351 GPIO_FN_SDHID1_1, GPIO_FN_M9_SLCD_A02, GPIO_FN_TS_SDAT2,
352 GPIO_FN_TDO3_SWO0_MC1,
353 GPIO_FN_SDHID1_2, GPIO_FN_M10_SLCD_CK2, GPIO_FN_TS_SDEN2, GPIO_FN_TDI3,
354 GPIO_FN_SDHID1_3, GPIO_FN_M12_SLCD_CE2, GPIO_FN_TS_SCK2,
355 GPIO_FN_RTCK3_SWO1_MC1,
356 GPIO_FN_SDHICMD1, GPIO_FN_TRST3,
357 GPIO_FN_RESETOUTS,
358};
359
360#endif /* __ASM_SH7377_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
new file mode 100644
index 000000000000..ceb2cdc92bf9
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
@@ -0,0 +1,467 @@
1#ifndef __ASM_SH73A0_H__
2#define __ASM_SH73A0_H__
3
4/* Pin Function Controller:
5 * GPIO_FN_xx - GPIO used to select pin function and MSEL switch
6 * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
7 */
8enum {
9 /* Hardware manual Table 25-1 (GPIO) */
10 GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
11 GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
12
13 GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
14 GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
15
16 GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
17 GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
18
19 GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
20 GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
21
22 GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
23 GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
24
25 GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
26 GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
27
28 GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
29 GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
30
31 GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
32 GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
33
34 GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
35 GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
36
37 GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
38 GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
39
40 GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
41 GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
42
43 GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
44 GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118,
45
46 GPIO_PORT128, GPIO_PORT129,
47
48 GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
49 GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
50
51 GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
52 GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
53
54 GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
55 GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
56
57 GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
58
59 GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
60 GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
61
62 GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
63 GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
64
65 GPIO_PORT210, GPIO_PORT211, GPIO_PORT212, GPIO_PORT213, GPIO_PORT214,
66 GPIO_PORT215, GPIO_PORT216, GPIO_PORT217, GPIO_PORT218, GPIO_PORT219,
67
68 GPIO_PORT220, GPIO_PORT221, GPIO_PORT222, GPIO_PORT223, GPIO_PORT224,
69 GPIO_PORT225, GPIO_PORT226, GPIO_PORT227, GPIO_PORT228, GPIO_PORT229,
70
71 GPIO_PORT230, GPIO_PORT231, GPIO_PORT232, GPIO_PORT233, GPIO_PORT234,
72 GPIO_PORT235, GPIO_PORT236, GPIO_PORT237, GPIO_PORT238, GPIO_PORT239,
73
74 GPIO_PORT240, GPIO_PORT241, GPIO_PORT242, GPIO_PORT243, GPIO_PORT244,
75 GPIO_PORT245, GPIO_PORT246, GPIO_PORT247, GPIO_PORT248, GPIO_PORT249,
76
77 GPIO_PORT250, GPIO_PORT251, GPIO_PORT252, GPIO_PORT253, GPIO_PORT254,
78 GPIO_PORT255, GPIO_PORT256, GPIO_PORT257, GPIO_PORT258, GPIO_PORT259,
79
80 GPIO_PORT260, GPIO_PORT261, GPIO_PORT262, GPIO_PORT263, GPIO_PORT264,
81 GPIO_PORT265, GPIO_PORT266, GPIO_PORT267, GPIO_PORT268, GPIO_PORT269,
82
83 GPIO_PORT270, GPIO_PORT271, GPIO_PORT272, GPIO_PORT273, GPIO_PORT274,
84 GPIO_PORT275, GPIO_PORT276, GPIO_PORT277, GPIO_PORT278, GPIO_PORT279,
85
86 GPIO_PORT280, GPIO_PORT281, GPIO_PORT282,
87
88 GPIO_PORT288, GPIO_PORT289,
89
90 GPIO_PORT290, GPIO_PORT291, GPIO_PORT292, GPIO_PORT293, GPIO_PORT294,
91 GPIO_PORT295, GPIO_PORT296, GPIO_PORT297, GPIO_PORT298, GPIO_PORT299,
92
93 GPIO_PORT300, GPIO_PORT301, GPIO_PORT302, GPIO_PORT303, GPIO_PORT304,
94 GPIO_PORT305, GPIO_PORT306, GPIO_PORT307, GPIO_PORT308, GPIO_PORT309,
95
96 /* Table 25-1 (Function 0-7) */
97 GPIO_FN_VBUS_0,
98 GPIO_FN_GPI0,
99 GPIO_FN_GPI1,
100 GPIO_FN_GPI2,
101 GPIO_FN_GPI3,
102 GPIO_FN_GPI4,
103 GPIO_FN_GPI5,
104 GPIO_FN_GPI6,
105 GPIO_FN_GPI7,
106 GPIO_FN_SCIFA7_RXD,
107 GPIO_FN_SCIFA7_CTS_,
108 GPIO_FN_GPO7, GPIO_FN_MFG0_OUT2,
109 GPIO_FN_GPO6, GPIO_FN_MFG1_OUT2,
110 GPIO_FN_GPO5, GPIO_FN_SCIFA0_SCK, GPIO_FN_FSICOSLDT3, \
111 GPIO_FN_PORT16_VIO_CKOR,
112 GPIO_FN_SCIFA0_TXD,
113 GPIO_FN_SCIFA7_TXD,
114 GPIO_FN_SCIFA7_RTS_, GPIO_FN_PORT19_VIO_CKO2,
115 GPIO_FN_GPO0,
116 GPIO_FN_GPO1,
117 GPIO_FN_GPO2, GPIO_FN_STATUS0,
118 GPIO_FN_GPO3, GPIO_FN_STATUS1,
119 GPIO_FN_GPO4, GPIO_FN_STATUS2,
120 GPIO_FN_VINT,
121 GPIO_FN_TCKON,
122 GPIO_FN_XDVFS1, GPIO_FN_PORT27_I2C_SCL2, GPIO_FN_PORT27_I2C_SCL3, \
123 GPIO_FN_MFG0_OUT1, GPIO_FN_PORT27_IROUT,
124 GPIO_FN_XDVFS2, GPIO_FN_PORT28_I2C_SDA2, GPIO_FN_PORT28_I2C_SDA3, \
125 GPIO_FN_PORT28_TPU1TO1,
126 GPIO_FN_SIM_RST, GPIO_FN_PORT29_TPU1TO1,
127 GPIO_FN_SIM_CLK, GPIO_FN_PORT30_VIO_CKOR,
128 GPIO_FN_SIM_D, GPIO_FN_PORT31_IROUT,
129 GPIO_FN_SCIFA4_TXD,
130 GPIO_FN_SCIFA4_RXD, GPIO_FN_XWUP,
131 GPIO_FN_SCIFA4_RTS_,
132 GPIO_FN_SCIFA4_CTS_,
133 GPIO_FN_FSIBOBT, GPIO_FN_FSIBIBT,
134 GPIO_FN_FSIBOLR, GPIO_FN_FSIBILR,
135 GPIO_FN_FSIBOSLD,
136 GPIO_FN_FSIBISLD,
137 GPIO_FN_VACK,
138 GPIO_FN_XTAL1L,
139 GPIO_FN_SCIFA0_RTS_, GPIO_FN_FSICOSLDT2,
140 GPIO_FN_SCIFA0_RXD,
141 GPIO_FN_SCIFA0_CTS_, GPIO_FN_FSICOSLDT1,
142 GPIO_FN_FSICOBT, GPIO_FN_FSICIBT, GPIO_FN_FSIDOBT, GPIO_FN_FSIDIBT,
143 GPIO_FN_FSICOLR, GPIO_FN_FSICILR, GPIO_FN_FSIDOLR, GPIO_FN_FSIDILR,
144 GPIO_FN_FSICOSLD, GPIO_FN_PORT47_FSICSPDIF,
145 GPIO_FN_FSICISLD, GPIO_FN_FSIDISLD,
146 GPIO_FN_FSIACK, GPIO_FN_PORT49_IRDA_OUT, GPIO_FN_PORT49_IROUT, \
147 GPIO_FN_FSIAOMC,
148 GPIO_FN_FSIAOLR, GPIO_FN_BBIF2_TSYNC2, GPIO_FN_TPU2TO2, GPIO_FN_FSIAILR,
149
150 GPIO_FN_FSIAOBT, GPIO_FN_BBIF2_TSCK2, GPIO_FN_TPU2TO3, GPIO_FN_FSIAIBT,
151 GPIO_FN_FSIAOSLD, GPIO_FN_BBIF2_TXD2,
152 GPIO_FN_FSIASPDIF, GPIO_FN_PORT53_IRDA_IN, GPIO_FN_TPU3TO3, \
153 GPIO_FN_FSIBSPDIF, GPIO_FN_PORT53_FSICSPDIF,
154 GPIO_FN_FSIBCK, GPIO_FN_PORT54_IRDA_FIRSEL, GPIO_FN_TPU3TO2, \
155 GPIO_FN_FSIBOMC, GPIO_FN_FSICCK, GPIO_FN_FSICOMC,
156 GPIO_FN_FSIAISLD, GPIO_FN_TPU0TO0,
157 GPIO_FN_A0, GPIO_FN_BS_,
158 GPIO_FN_A12, GPIO_FN_PORT58_KEYOUT7, GPIO_FN_TPU4TO2,
159 GPIO_FN_A13, GPIO_FN_PORT59_KEYOUT6, GPIO_FN_TPU0TO1,
160 GPIO_FN_A14, GPIO_FN_KEYOUT5,
161 GPIO_FN_A15, GPIO_FN_KEYOUT4,
162 GPIO_FN_A16, GPIO_FN_KEYOUT3, GPIO_FN_MSIOF0_SS1,
163 GPIO_FN_A17, GPIO_FN_KEYOUT2, GPIO_FN_MSIOF0_TSYNC,
164 GPIO_FN_A18, GPIO_FN_KEYOUT1, GPIO_FN_MSIOF0_TSCK,
165 GPIO_FN_A19, GPIO_FN_KEYOUT0, GPIO_FN_MSIOF0_TXD,
166 GPIO_FN_A20, GPIO_FN_KEYIN0, GPIO_FN_MSIOF0_RSCK,
167 GPIO_FN_A21, GPIO_FN_KEYIN1, GPIO_FN_MSIOF0_RSYNC,
168 GPIO_FN_A22, GPIO_FN_KEYIN2, GPIO_FN_MSIOF0_MCK0,
169 GPIO_FN_A23, GPIO_FN_KEYIN3, GPIO_FN_MSIOF0_MCK1,
170 GPIO_FN_A24, GPIO_FN_KEYIN4, GPIO_FN_MSIOF0_RXD,
171 GPIO_FN_A25, GPIO_FN_KEYIN5, GPIO_FN_MSIOF0_SS2,
172 GPIO_FN_A26, GPIO_FN_KEYIN6,
173 GPIO_FN_KEYIN7,
174 GPIO_FN_D0_NAF0,
175 GPIO_FN_D1_NAF1,
176 GPIO_FN_D2_NAF2,
177 GPIO_FN_D3_NAF3,
178 GPIO_FN_D4_NAF4,
179 GPIO_FN_D5_NAF5,
180 GPIO_FN_D6_NAF6,
181 GPIO_FN_D7_NAF7,
182 GPIO_FN_D8_NAF8,
183 GPIO_FN_D9_NAF9,
184 GPIO_FN_D10_NAF10,
185 GPIO_FN_D11_NAF11,
186 GPIO_FN_D12_NAF12,
187 GPIO_FN_D13_NAF13,
188 GPIO_FN_D14_NAF14,
189 GPIO_FN_D15_NAF15,
190 GPIO_FN_CS4_,
191 GPIO_FN_CS5A_, GPIO_FN_PORT91_RDWR,
192 GPIO_FN_CS5B_, GPIO_FN_FCE1_,
193 GPIO_FN_CS6B_, GPIO_FN_DACK0,
194 GPIO_FN_FCE0_, GPIO_FN_CS6A_,
195 GPIO_FN_WAIT_, GPIO_FN_DREQ0,
196 GPIO_FN_RD__FSC,
197 GPIO_FN_WE0__FWE, GPIO_FN_RDWR_FWE,
198 GPIO_FN_WE1_,
199 GPIO_FN_FRB,
200 GPIO_FN_CKO,
201 GPIO_FN_NBRSTOUT_,
202 GPIO_FN_NBRST_,
203 GPIO_FN_BBIF2_TXD,
204 GPIO_FN_BBIF2_RXD,
205 GPIO_FN_BBIF2_SYNC,
206 GPIO_FN_BBIF2_SCK,
207 GPIO_FN_SCIFA3_CTS_, GPIO_FN_MFG3_IN2,
208 GPIO_FN_SCIFA3_RXD, GPIO_FN_MFG3_IN1,
209 GPIO_FN_BBIF1_SS2, GPIO_FN_SCIFA3_RTS_, GPIO_FN_MFG3_OUT1,
210 GPIO_FN_SCIFA3_TXD,
211 GPIO_FN_HSI_RX_DATA, GPIO_FN_BBIF1_RXD,
212 GPIO_FN_HSI_TX_WAKE, GPIO_FN_BBIF1_TSCK,
213 GPIO_FN_HSI_TX_DATA, GPIO_FN_BBIF1_TSYNC,
214 GPIO_FN_HSI_TX_READY, GPIO_FN_BBIF1_TXD,
215 GPIO_FN_HSI_RX_READY, GPIO_FN_BBIF1_RSCK, GPIO_FN_PORT115_I2C_SCL2, \
216 GPIO_FN_PORT115_I2C_SCL3,
217 GPIO_FN_HSI_RX_WAKE, GPIO_FN_BBIF1_RSYNC, GPIO_FN_PORT116_I2C_SDA2, \
218 GPIO_FN_PORT116_I2C_SDA3,
219 GPIO_FN_HSI_RX_FLAG, GPIO_FN_BBIF1_SS1, GPIO_FN_BBIF1_FLOW,
220 GPIO_FN_HSI_TX_FLAG,
221 GPIO_FN_VIO_VD, GPIO_FN_PORT128_LCD2VSYN, GPIO_FN_VIO2_VD, \
222 GPIO_FN_LCD2D0,
223
224 GPIO_FN_VIO_HD, GPIO_FN_PORT129_LCD2HSYN, GPIO_FN_PORT129_LCD2CS_, \
225 GPIO_FN_VIO2_HD, GPIO_FN_LCD2D1,
226 GPIO_FN_VIO_D0, GPIO_FN_PORT130_MSIOF2_RXD, GPIO_FN_LCD2D10,
227 GPIO_FN_VIO_D1, GPIO_FN_PORT131_KEYOUT6, GPIO_FN_PORT131_MSIOF2_SS1, \
228 GPIO_FN_PORT131_KEYOUT11, GPIO_FN_LCD2D11,
229 GPIO_FN_VIO_D2, GPIO_FN_PORT132_KEYOUT7, GPIO_FN_PORT132_MSIOF2_SS2, \
230 GPIO_FN_PORT132_KEYOUT10, GPIO_FN_LCD2D12,
231 GPIO_FN_VIO_D3, GPIO_FN_MSIOF2_TSYNC, GPIO_FN_LCD2D13,
232 GPIO_FN_VIO_D4, GPIO_FN_MSIOF2_TXD, GPIO_FN_LCD2D14,
233 GPIO_FN_VIO_D5, GPIO_FN_MSIOF2_TSCK, GPIO_FN_LCD2D15,
234 GPIO_FN_VIO_D6, GPIO_FN_PORT136_KEYOUT8, GPIO_FN_LCD2D16,
235 GPIO_FN_VIO_D7, GPIO_FN_PORT137_KEYOUT9, GPIO_FN_LCD2D17,
236 GPIO_FN_VIO_D8, GPIO_FN_PORT138_KEYOUT8, GPIO_FN_VIO2_D0, \
237 GPIO_FN_LCD2D6,
238 GPIO_FN_VIO_D9, GPIO_FN_PORT139_KEYOUT9, GPIO_FN_VIO2_D1, \
239 GPIO_FN_LCD2D7,
240 GPIO_FN_VIO_D10, GPIO_FN_TPU0TO2, GPIO_FN_VIO2_D2, GPIO_FN_LCD2D8,
241 GPIO_FN_VIO_D11, GPIO_FN_TPU0TO3, GPIO_FN_VIO2_D3, GPIO_FN_LCD2D9,
242 GPIO_FN_VIO_D12, GPIO_FN_PORT142_KEYOUT10, GPIO_FN_VIO2_D4, \
243 GPIO_FN_LCD2D2,
244 GPIO_FN_VIO_D13, GPIO_FN_PORT143_KEYOUT11, GPIO_FN_PORT143_KEYOUT6, \
245 GPIO_FN_VIO2_D5, GPIO_FN_LCD2D3,
246 GPIO_FN_VIO_D14, GPIO_FN_PORT144_KEYOUT7, GPIO_FN_VIO2_D6, \
247 GPIO_FN_LCD2D4,
248 GPIO_FN_VIO_D15, GPIO_FN_TPU1TO3, GPIO_FN_PORT145_LCD2DISP, \
249 GPIO_FN_PORT145_LCD2RS, GPIO_FN_VIO2_D7, GPIO_FN_LCD2D5,
250 GPIO_FN_VIO_CLK, GPIO_FN_LCD2DCK, GPIO_FN_PORT146_LCD2WR_, \
251 GPIO_FN_VIO2_CLK, GPIO_FN_LCD2D18,
252 GPIO_FN_VIO_FIELD, GPIO_FN_LCD2RD_, GPIO_FN_VIO2_FIELD, GPIO_FN_LCD2D19,
253 GPIO_FN_VIO_CKO,
254 GPIO_FN_A27, GPIO_FN_PORT149_RDWR, GPIO_FN_MFG0_IN1, \
255 GPIO_FN_PORT149_KEYOUT9,
256 GPIO_FN_MFG0_IN2,
257 GPIO_FN_TS_SPSYNC3, GPIO_FN_MSIOF2_RSCK,
258 GPIO_FN_TS_SDAT3, GPIO_FN_MSIOF2_RSYNC,
259 GPIO_FN_TPU1TO2, GPIO_FN_TS_SDEN3, GPIO_FN_PORT153_MSIOF2_SS1,
260 GPIO_FN_SCIFA2_TXD1, GPIO_FN_MSIOF2_MCK0,
261 GPIO_FN_SCIFA2_RXD1, GPIO_FN_MSIOF2_MCK1,
262 GPIO_FN_SCIFA2_RTS1_, GPIO_FN_PORT156_MSIOF2_SS2,
263 GPIO_FN_SCIFA2_CTS1_, GPIO_FN_PORT157_MSIOF2_RXD,
264 GPIO_FN_DINT_, GPIO_FN_SCIFA2_SCK1, GPIO_FN_TS_SCK3,
265 GPIO_FN_PORT159_SCIFB_SCK, GPIO_FN_PORT159_SCIFA5_SCK, GPIO_FN_NMI,
266 GPIO_FN_PORT160_SCIFB_TXD, GPIO_FN_PORT160_SCIFA5_TXD,
267 GPIO_FN_PORT161_SCIFB_CTS_, GPIO_FN_PORT161_SCIFA5_CTS_,
268 GPIO_FN_PORT162_SCIFB_RXD, GPIO_FN_PORT162_SCIFA5_RXD,
269 GPIO_FN_PORT163_SCIFB_RTS_, GPIO_FN_PORT163_SCIFA5_RTS_, \
270 GPIO_FN_TPU3TO0,
271 GPIO_FN_LCDD0,
272 GPIO_FN_LCDD1, GPIO_FN_PORT193_SCIFA5_CTS_, GPIO_FN_BBIF2_TSYNC1,
273 GPIO_FN_LCDD2, GPIO_FN_PORT194_SCIFA5_RTS_, GPIO_FN_BBIF2_TSCK1,
274 GPIO_FN_LCDD3, GPIO_FN_PORT195_SCIFA5_RXD, GPIO_FN_BBIF2_TXD1,
275 GPIO_FN_LCDD4, GPIO_FN_PORT196_SCIFA5_TXD,
276 GPIO_FN_LCDD5, GPIO_FN_PORT197_SCIFA5_SCK, GPIO_FN_MFG2_OUT2, \
277 GPIO_FN_TPU2TO1,
278 GPIO_FN_LCDD6,
279 GPIO_FN_LCDD7, GPIO_FN_TPU4TO1, GPIO_FN_MFG4_OUT2,
280 GPIO_FN_LCDD8, GPIO_FN_D16,
281 GPIO_FN_LCDD9, GPIO_FN_D17,
282 GPIO_FN_LCDD10, GPIO_FN_D18,
283 GPIO_FN_LCDD11, GPIO_FN_D19,
284 GPIO_FN_LCDD12, GPIO_FN_D20,
285 GPIO_FN_LCDD13, GPIO_FN_D21,
286 GPIO_FN_LCDD14, GPIO_FN_D22,
287 GPIO_FN_LCDD15, GPIO_FN_PORT207_MSIOF0L_SS1, GPIO_FN_D23,
288 GPIO_FN_LCDD16, GPIO_FN_PORT208_MSIOF0L_SS2, GPIO_FN_D24,
289 GPIO_FN_LCDD17, GPIO_FN_D25,
290 GPIO_FN_LCDD18, GPIO_FN_DREQ2, GPIO_FN_PORT210_MSIOF0L_SS1, GPIO_FN_D26,
291 GPIO_FN_LCDD19, GPIO_FN_PORT211_MSIOF0L_SS2, GPIO_FN_D27,
292 GPIO_FN_LCDD20, GPIO_FN_TS_SPSYNC1, GPIO_FN_MSIOF0L_MCK0, GPIO_FN_D28,
293 GPIO_FN_LCDD21, GPIO_FN_TS_SDAT1, GPIO_FN_MSIOF0L_MCK1, GPIO_FN_D29,
294 GPIO_FN_LCDD22, GPIO_FN_TS_SDEN1, GPIO_FN_MSIOF0L_RSCK, GPIO_FN_D30,
295 GPIO_FN_LCDD23, GPIO_FN_TS_SCK1, GPIO_FN_MSIOF0L_RSYNC, GPIO_FN_D31,
296 GPIO_FN_LCDDCK, GPIO_FN_LCDWR_,
297 GPIO_FN_LCDRD_, GPIO_FN_DACK2, GPIO_FN_PORT217_LCD2RS, \
298 GPIO_FN_MSIOF0L_TSYNC, GPIO_FN_VIO2_FIELD3, GPIO_FN_PORT217_LCD2DISP,
299 GPIO_FN_LCDHSYN, GPIO_FN_LCDCS_, GPIO_FN_LCDCS2_, GPIO_FN_DACK3, \
300 GPIO_FN_PORT218_VIO_CKOR,
301 GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_PORT219_LCD2WR_, \
302 GPIO_FN_DREQ3, GPIO_FN_MSIOF0L_TSCK, GPIO_FN_VIO2_CLK3, \
303 GPIO_FN_LCD2DCK_2,
304 GPIO_FN_LCDVSYN, GPIO_FN_LCDVSYN2,
305 GPIO_FN_LCDLCLK, GPIO_FN_DREQ1, GPIO_FN_PORT221_LCD2CS_, \
306 GPIO_FN_PWEN, GPIO_FN_MSIOF0L_RXD, GPIO_FN_VIO2_HD3, \
307 GPIO_FN_PORT221_LCD2HSYN,
308 GPIO_FN_LCDDON, GPIO_FN_LCDDON2, GPIO_FN_DACK1, GPIO_FN_OVCN, \
309 GPIO_FN_MSIOF0L_TXD, GPIO_FN_VIO2_VD3, GPIO_FN_PORT222_LCD2VSYN,
310
311 GPIO_FN_SCIFA1_TXD, GPIO_FN_OVCN2,
312 GPIO_FN_EXTLP, GPIO_FN_SCIFA1_SCK, GPIO_FN_PORT226_VIO_CKO2,
313 GPIO_FN_SCIFA1_RTS_, GPIO_FN_IDIN,
314 GPIO_FN_SCIFA1_RXD,
315 GPIO_FN_SCIFA1_CTS_, GPIO_FN_MFG1_IN1,
316 GPIO_FN_MSIOF1_TXD, GPIO_FN_SCIFA2_TXD2,
317 GPIO_FN_MSIOF1_TSYNC, GPIO_FN_SCIFA2_CTS2_,
318 GPIO_FN_MSIOF1_TSCK, GPIO_FN_SCIFA2_SCK2,
319 GPIO_FN_MSIOF1_RXD, GPIO_FN_SCIFA2_RXD2,
320 GPIO_FN_MSIOF1_RSCK, GPIO_FN_SCIFA2_RTS2_, GPIO_FN_VIO2_CLK2, \
321 GPIO_FN_LCD2D20,
322 GPIO_FN_MSIOF1_RSYNC, GPIO_FN_MFG1_IN2, GPIO_FN_VIO2_VD2, \
323 GPIO_FN_LCD2D21,
324 GPIO_FN_MSIOF1_MCK0, GPIO_FN_PORT236_I2C_SDA2,
325 GPIO_FN_MSIOF1_MCK1, GPIO_FN_PORT237_I2C_SCL2,
326 GPIO_FN_MSIOF1_SS1, GPIO_FN_VIO2_FIELD2, GPIO_FN_LCD2D22,
327 GPIO_FN_MSIOF1_SS2, GPIO_FN_VIO2_HD2, GPIO_FN_LCD2D23,
328 GPIO_FN_SCIFA6_TXD,
329 GPIO_FN_PORT241_IRDA_OUT, GPIO_FN_PORT241_IROUT, GPIO_FN_MFG4_OUT1, \
330 GPIO_FN_TPU4TO0,
331 GPIO_FN_PORT242_IRDA_IN, GPIO_FN_MFG4_IN2,
332 GPIO_FN_PORT243_IRDA_FIRSEL, GPIO_FN_PORT243_VIO_CKO2,
333 GPIO_FN_PORT244_SCIFA5_CTS_, GPIO_FN_MFG2_IN1, \
334 GPIO_FN_PORT244_SCIFB_CTS_, GPIO_FN_MSIOF2R_RXD,
335 GPIO_FN_PORT245_SCIFA5_RTS_, GPIO_FN_MFG2_IN2, \
336 GPIO_FN_PORT245_SCIFB_RTS_, GPIO_FN_MSIOF2R_TXD,
337 GPIO_FN_PORT246_SCIFA5_RXD, GPIO_FN_MFG1_OUT1, \
338 GPIO_FN_PORT246_SCIFB_RXD, GPIO_FN_TPU1TO0,
339 GPIO_FN_PORT247_SCIFA5_TXD, GPIO_FN_MFG3_OUT2, \
340 GPIO_FN_PORT247_SCIFB_TXD, GPIO_FN_TPU3TO1,
341 GPIO_FN_PORT248_SCIFA5_SCK, GPIO_FN_MFG2_OUT1, \
342 GPIO_FN_PORT248_SCIFB_SCK, GPIO_FN_TPU2TO0, \
343 GPIO_FN_PORT248_I2C_SCL3, GPIO_FN_MSIOF2R_TSCK,
344 GPIO_FN_PORT249_IROUT, GPIO_FN_MFG4_IN1, \
345 GPIO_FN_PORT249_I2C_SDA3, GPIO_FN_MSIOF2R_TSYNC,
346 GPIO_FN_SDHICLK0,
347 GPIO_FN_SDHICD0,
348 GPIO_FN_SDHID0_0,
349 GPIO_FN_SDHID0_1,
350 GPIO_FN_SDHID0_2,
351 GPIO_FN_SDHID0_3,
352 GPIO_FN_SDHICMD0,
353 GPIO_FN_SDHIWP0,
354 GPIO_FN_SDHICLK1,
355 GPIO_FN_SDHID1_0, GPIO_FN_TS_SPSYNC2,
356 GPIO_FN_SDHID1_1, GPIO_FN_TS_SDAT2,
357 GPIO_FN_SDHID1_2, GPIO_FN_TS_SDEN2,
358 GPIO_FN_SDHID1_3, GPIO_FN_TS_SCK2,
359 GPIO_FN_SDHICMD1,
360 GPIO_FN_SDHICLK2,
361 GPIO_FN_SDHID2_0, GPIO_FN_TS_SPSYNC4,
362 GPIO_FN_SDHID2_1, GPIO_FN_TS_SDAT4,
363 GPIO_FN_SDHID2_2, GPIO_FN_TS_SDEN4,
364 GPIO_FN_SDHID2_3, GPIO_FN_TS_SCK4,
365 GPIO_FN_SDHICMD2,
366 GPIO_FN_MMCCLK0,
367 GPIO_FN_MMCD0_0,
368 GPIO_FN_MMCD0_1,
369 GPIO_FN_MMCD0_2,
370 GPIO_FN_MMCD0_3,
371 GPIO_FN_MMCD0_4, GPIO_FN_TS_SPSYNC5,
372 GPIO_FN_MMCD0_5, GPIO_FN_TS_SDAT5,
373 GPIO_FN_MMCD0_6, GPIO_FN_TS_SDEN5,
374 GPIO_FN_MMCD0_7, GPIO_FN_TS_SCK5,
375 GPIO_FN_MMCCMD0,
376 GPIO_FN_RESETOUTS_, GPIO_FN_EXTAL2OUT,
377 GPIO_FN_MCP_WAIT__MCP_FRB,
378 GPIO_FN_MCP_CKO, GPIO_FN_MMCCLK1,
379 GPIO_FN_MCP_D15_MCP_NAF15,
380 GPIO_FN_MCP_D14_MCP_NAF14,
381 GPIO_FN_MCP_D13_MCP_NAF13,
382 GPIO_FN_MCP_D12_MCP_NAF12,
383 GPIO_FN_MCP_D11_MCP_NAF11,
384 GPIO_FN_MCP_D10_MCP_NAF10,
385 GPIO_FN_MCP_D9_MCP_NAF9,
386 GPIO_FN_MCP_D8_MCP_NAF8, GPIO_FN_MMCCMD1,
387 GPIO_FN_MCP_D7_MCP_NAF7, GPIO_FN_MMCD1_7,
388
389 GPIO_FN_MCP_D6_MCP_NAF6, GPIO_FN_MMCD1_6,
390 GPIO_FN_MCP_D5_MCP_NAF5, GPIO_FN_MMCD1_5,
391 GPIO_FN_MCP_D4_MCP_NAF4, GPIO_FN_MMCD1_4,
392 GPIO_FN_MCP_D3_MCP_NAF3, GPIO_FN_MMCD1_3,
393 GPIO_FN_MCP_D2_MCP_NAF2, GPIO_FN_MMCD1_2,
394 GPIO_FN_MCP_D1_MCP_NAF1, GPIO_FN_MMCD1_1,
395 GPIO_FN_MCP_D0_MCP_NAF0, GPIO_FN_MMCD1_0,
396 GPIO_FN_MCP_NBRSTOUT_,
397 GPIO_FN_MCP_WE0__MCP_FWE, GPIO_FN_MCP_RDWR_MCP_FWE,
398
399 /* MSEL2 special case */
400 GPIO_FN_TSIF2_TS_XX1,
401 GPIO_FN_TSIF2_TS_XX2,
402 GPIO_FN_TSIF2_TS_XX3,
403 GPIO_FN_TSIF2_TS_XX4,
404 GPIO_FN_TSIF2_TS_XX5,
405 GPIO_FN_TSIF1_TS_XX1,
406 GPIO_FN_TSIF1_TS_XX2,
407 GPIO_FN_TSIF1_TS_XX3,
408 GPIO_FN_TSIF1_TS_XX4,
409 GPIO_FN_TSIF1_TS_XX5,
410 GPIO_FN_TSIF0_TS_XX1,
411 GPIO_FN_TSIF0_TS_XX2,
412 GPIO_FN_TSIF0_TS_XX3,
413 GPIO_FN_TSIF0_TS_XX4,
414 GPIO_FN_TSIF0_TS_XX5,
415 GPIO_FN_MST1_TS_XX1,
416 GPIO_FN_MST1_TS_XX2,
417 GPIO_FN_MST1_TS_XX3,
418 GPIO_FN_MST1_TS_XX4,
419 GPIO_FN_MST1_TS_XX5,
420 GPIO_FN_MST0_TS_XX1,
421 GPIO_FN_MST0_TS_XX2,
422 GPIO_FN_MST0_TS_XX3,
423 GPIO_FN_MST0_TS_XX4,
424 GPIO_FN_MST0_TS_XX5,
425
426 /* MSEL3 special cases */
427 GPIO_FN_SDHI0_VCCQ_MC0_ON,
428 GPIO_FN_SDHI0_VCCQ_MC0_OFF,
429 GPIO_FN_DEBUG_MON_VIO,
430 GPIO_FN_DEBUG_MON_LCDD,
431 GPIO_FN_LCDC_LCDC0,
432 GPIO_FN_LCDC_LCDC1,
433
434 /* MSEL4 special cases */
435 GPIO_FN_IRQ9_MEM_INT,
436 GPIO_FN_IRQ9_MCP_INT,
437 GPIO_FN_A11,
438 GPIO_FN_KEYOUT8,
439 GPIO_FN_TPU4TO3,
440 GPIO_FN_RESETA_N_PU_ON,
441 GPIO_FN_RESETA_N_PU_OFF,
442 GPIO_FN_EDBGREQ_PD,
443 GPIO_FN_EDBGREQ_PU,
444
445 /* Functions with pull-ups */
446 GPIO_FN_KEYIN0_PU,
447 GPIO_FN_KEYIN1_PU,
448 GPIO_FN_KEYIN2_PU,
449 GPIO_FN_KEYIN3_PU,
450 GPIO_FN_KEYIN4_PU,
451 GPIO_FN_KEYIN5_PU,
452 GPIO_FN_KEYIN6_PU,
453 GPIO_FN_KEYIN7_PU,
454 GPIO_FN_SDHID1_0_PU,
455 GPIO_FN_SDHID1_1_PU,
456 GPIO_FN_SDHID1_2_PU,
457 GPIO_FN_SDHID1_3_PU,
458 GPIO_FN_SDHICMD1_PU,
459 GPIO_FN_MMCCMD0_PU,
460 GPIO_FN_MMCCMD1_PU,
461 GPIO_FN_FSIACK_PU,
462 GPIO_FN_FSIAILR_PU,
463 GPIO_FN_FSIAIBT_PU,
464 GPIO_FN_FSIAISLD_PU,
465};
466
467#endif /* __ASM_SH73A0_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/smp.h b/arch/arm/mach-shmobile/include/mach/smp.h
new file mode 100644
index 000000000000..50db94e927ad
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/smp.h
@@ -0,0 +1,16 @@
1#ifndef __MACH_SMP_H
2#define __MACH_SMP_H
3
4#include <asm/hardware/gic.h>
5
6/*
7 * We use IRQ1 as the IPI
8 */
9static inline void smp_cross_call(const struct cpumask *mask, int ipi)
10{
11#if defined(CONFIG_ARM_GIC)
12 gic_raise_softirq(mask, ipi);
13#endif
14}
15
16#endif
diff --git a/arch/arm/mach-shmobile/include/mach/system.h b/arch/arm/mach-shmobile/include/mach/system.h
new file mode 100644
index 000000000000..76a687eeaa22
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/system.h
@@ -0,0 +1,14 @@
1#ifndef __ASM_ARCH_SYSTEM_H
2#define __ASM_ARCH_SYSTEM_H
3
4static inline void arch_idle(void)
5{
6 cpu_do_idle();
7}
8
9static inline void arch_reset(char mode, const char *cmd)
10{
11 cpu_reset(0);
12}
13
14#endif
diff --git a/arch/arm/mach-shmobile/include/mach/timex.h b/arch/arm/mach-shmobile/include/mach/timex.h
new file mode 100644
index 000000000000..ae0d8d825c23
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/timex.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_MACH_TIMEX_H
2#define __ASM_MACH_TIMEX_H
3
4#define CLOCK_TICK_RATE 1193180 /* unused i8253 PIT value */
5
6#endif /* __ASM_MACH_TIMEX_H */
diff --git a/arch/arm/mach-shmobile/include/mach/uncompress.h b/arch/arm/mach-shmobile/include/mach/uncompress.h
new file mode 100644
index 000000000000..0bd7556b1387
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/uncompress.h
@@ -0,0 +1,21 @@
1#ifndef __ASM_MACH_UNCOMPRESS_H
2#define __ASM_MACH_UNCOMPRESS_H
3
4/*
5 * This does not append a newline
6 */
7static void putc(int c)
8{
9}
10
11static inline void flush(void)
12{
13}
14
15static void arch_decomp_setup(void)
16{
17}
18
19#define arch_decomp_wdog()
20
21#endif /* __ASM_MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-shmobile/include/mach/vmalloc.h b/arch/arm/mach-shmobile/include/mach/vmalloc.h
new file mode 100644
index 000000000000..2b8fd8b942fe
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/vmalloc.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_VMALLOC_H
2#define __ASM_MACH_VMALLOC_H
3
4/* Vmalloc at ... - 0xe5ffffff */
5#define VMALLOC_END 0xe6000000UL
6
7#endif /* __ASM_MACH_VMALLOC_H */
diff --git a/arch/arm/mach-shmobile/include/mach/zboot.h b/arch/arm/mach-shmobile/include/mach/zboot.h
new file mode 100644
index 000000000000..6d6a205bcf90
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/zboot.h
@@ -0,0 +1,23 @@
1#ifndef ZBOOT_H
2#define ZBOOT_H
3
4#include <asm/mach-types.h>
5#include <mach/zboot_macros.h>
6
7/**************************************************
8 *
9 * board specific settings
10 *
11 **************************************************/
12
13#ifdef CONFIG_MACH_AP4EVB
14#define MACH_TYPE MACH_TYPE_AP4EVB
15#include "mach/head-ap4evb.txt"
16#elif CONFIG_MACH_MACKEREL
17#define MACH_TYPE MACH_TYPE_MACKEREL
18#include "mach/head-mackerel.txt"
19#else
20#error "unsupported board."
21#endif
22
23#endif /* ZBOOT_H */
diff --git a/arch/arm/mach-shmobile/include/mach/zboot_macros.h b/arch/arm/mach-shmobile/include/mach/zboot_macros.h
new file mode 100644
index 000000000000..aa6111fbc989
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/zboot_macros.h
@@ -0,0 +1,65 @@
1#ifndef __ZBOOT_MACRO_H
2#define __ZBOOT_MACRO_H
3
4/* The LIST command is used to include comments in the script */
5.macro LIST comment
6.endm
7
8/* The ED command is used to write a 32-bit word */
9.macro ED, addr, data
10 LDR r0, 1f
11 LDR r1, 2f
12 STR r1, [r0]
13 B 3f
141 : .long \addr
152 : .long \data
163 :
17.endm
18
19/* The EW command is used to write a 16-bit word */
20.macro EW, addr, data
21 LDR r0, 1f
22 LDR r1, 2f
23 STRH r1, [r0]
24 B 3f
251 : .long \addr
262 : .long \data
273 :
28.endm
29
30/* The EB command is used to write an 8-bit word */
31.macro EB, addr, data
32 LDR r0, 1f
33 LDR r1, 2f
34 STRB r1, [r0]
35 B 3f
361 : .long \addr
372 : .long \data
383 :
39.endm
40
41/* The WAIT command is used to delay the execution */
42.macro WAIT, time, reg
43 LDR r1, 1f
44 LDR r0, 2f
45 STR r0, [r1]
4610 :
47 LDR r0, [r1]
48 CMP r0, #0x00000000
49 BNE 10b
50 NOP
51 B 3f
521 : .long \reg
532 : .long \time * 100
543 :
55.endm
56
57/* The DD command is used to read a 32-bit word */
58.macro DD, start, end
59 LDR r1, 1f
60 B 2f
611 : .long \start
622 :
63.endm
64
65#endif /* __ZBOOT_MACRO_H */
diff --git a/arch/arm/mach-shmobile/intc-sh7367.c b/arch/arm/mach-shmobile/intc-sh7367.c
new file mode 100644
index 000000000000..1a20c489b20d
--- /dev/null
+++ b/arch/arm/mach-shmobile/intc-sh7367.c
@@ -0,0 +1,440 @@
1/*
2 * sh7367 processor support - INTC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/io.h>
24#include <linux/sh_intc.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28enum {
29 UNUSED_INTCA = 0,
30 ENABLED,
31 DISABLED,
32
33 /* interrupt sources INTCA */
34 IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
35 IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A,
36 DIRC,
37 CRYPT1_ERR, CRYPT2_STD,
38 IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
39 ARM11_IRQPMU, ARM11_COMMTX, ARM11_COMMRX,
40 ETM11_ACQCMP, ETM11_FULL,
41 MFI_MFIM, MFI_MFIS,
42 BBIF1, BBIF2,
43 USBDMAC_USHDMI,
44 USBHS_USHI0, USBHS_USHI1,
45 CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
46 KEYSC_KEY,
47 SCIFA0, SCIFA1, SCIFA2, SCIFA3,
48 MSIOF2, MSIOF1,
49 SCIFA4, SCIFA5, SCIFB,
50 FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
51 SDHI0,
52 SDHI1,
53 MSU_MSU, MSU_MSU2,
54 IREM,
55 SIU,
56 SPU,
57 IRDA,
58 TPU0, TPU1, TPU2, TPU3, TPU4,
59 LCRC,
60 PINT1, PINT2,
61 TTI20,
62 MISTY,
63 DDM,
64 SDHI2,
65 RWDT0, RWDT1,
66 DMAC_1_DEI0, DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3,
67 DMAC_2_DEI4, DMAC_2_DEI5, DMAC_2_DADERR,
68 DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
69 DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
70 DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
71 DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
72
73 /* interrupt groups INTCA */
74 DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2,
75 ETM11, ARM11, USBHS, FLCTL, IIC1
76};
77
78static struct intc_vect intca_vectors[] __initdata = {
79 INTC_VECT(IRQ0A, 0x0200), INTC_VECT(IRQ1A, 0x0220),
80 INTC_VECT(IRQ2A, 0x0240), INTC_VECT(IRQ3A, 0x0260),
81 INTC_VECT(IRQ4A, 0x0280), INTC_VECT(IRQ5A, 0x02a0),
82 INTC_VECT(IRQ6A, 0x02c0), INTC_VECT(IRQ7A, 0x02e0),
83 INTC_VECT(IRQ8A, 0x0300), INTC_VECT(IRQ9A, 0x0320),
84 INTC_VECT(IRQ10A, 0x0340), INTC_VECT(IRQ11A, 0x0360),
85 INTC_VECT(IRQ12A, 0x0380), INTC_VECT(IRQ13A, 0x03a0),
86 INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0),
87 INTC_VECT(DIRC, 0x0560),
88 INTC_VECT(CRYPT1_ERR, 0x05e0),
89 INTC_VECT(CRYPT2_STD, 0x0700),
90 INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
91 INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
92 INTC_VECT(ARM11_IRQPMU, 0x0800), INTC_VECT(ARM11_COMMTX, 0x0840),
93 INTC_VECT(ARM11_COMMRX, 0x0860),
94 INTC_VECT(ETM11_ACQCMP, 0x0880), INTC_VECT(ETM11_FULL, 0x08a0),
95 INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
96 INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
97 INTC_VECT(USBDMAC_USHDMI, 0x0a00),
98 INTC_VECT(USBHS_USHI0, 0x0a20), INTC_VECT(USBHS_USHI1, 0x0a40),
99 INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
100 INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
101 INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
102 INTC_VECT(KEYSC_KEY, 0x0be0),
103 INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
104 INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
105 INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
106 INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
107 INTC_VECT(SCIFB, 0x0d60),
108 INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
109 INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
110 INTC_VECT(SDHI0, 0x0e00), INTC_VECT(SDHI0, 0x0e20),
111 INTC_VECT(SDHI0, 0x0e40), INTC_VECT(SDHI0, 0x0e60),
112 INTC_VECT(SDHI1, 0x0e80), INTC_VECT(SDHI1, 0x0ea0),
113 INTC_VECT(SDHI1, 0x0ec0), INTC_VECT(SDHI1, 0x0ee0),
114 INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
115 INTC_VECT(IREM, 0x0f60),
116 INTC_VECT(SIU, 0x0fa0),
117 INTC_VECT(SPU, 0x0fc0),
118 INTC_VECT(IRDA, 0x0480),
119 INTC_VECT(TPU0, 0x04a0), INTC_VECT(TPU1, 0x04c0),
120 INTC_VECT(TPU2, 0x04e0), INTC_VECT(TPU3, 0x0500),
121 INTC_VECT(TPU4, 0x0520),
122 INTC_VECT(LCRC, 0x0540),
123 INTC_VECT(PINT1, 0x1000), INTC_VECT(PINT2, 0x1020),
124 INTC_VECT(TTI20, 0x1100),
125 INTC_VECT(MISTY, 0x1120),
126 INTC_VECT(DDM, 0x1140),
127 INTC_VECT(SDHI2, 0x1200), INTC_VECT(SDHI2, 0x1220),
128 INTC_VECT(SDHI2, 0x1240), INTC_VECT(SDHI2, 0x1260),
129 INTC_VECT(RWDT0, 0x1280), INTC_VECT(RWDT1, 0x12a0),
130 INTC_VECT(DMAC_1_DEI0, 0x2000), INTC_VECT(DMAC_1_DEI1, 0x2020),
131 INTC_VECT(DMAC_1_DEI2, 0x2040), INTC_VECT(DMAC_1_DEI3, 0x2060),
132 INTC_VECT(DMAC_2_DEI4, 0x2080), INTC_VECT(DMAC_2_DEI5, 0x20a0),
133 INTC_VECT(DMAC_2_DADERR, 0x20c0),
134 INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
135 INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
136 INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
137 INTC_VECT(DMAC2_2_DADERR, 0x21c0),
138 INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
139 INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
140 INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
141 INTC_VECT(DMAC3_2_DADERR, 0x22c0),
142};
143
144static struct intc_group intca_groups[] __initdata = {
145 INTC_GROUP(DMAC_1, DMAC_1_DEI0,
146 DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3),
147 INTC_GROUP(DMAC_2, DMAC_2_DEI4,
148 DMAC_2_DEI5, DMAC_2_DADERR),
149 INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
150 DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
151 INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
152 DMAC2_2_DEI5, DMAC2_2_DADERR),
153 INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
154 DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
155 INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
156 DMAC3_2_DEI5, DMAC3_2_DADERR),
157 INTC_GROUP(ETM11, ETM11_ACQCMP, ETM11_FULL),
158 INTC_GROUP(ARM11, ARM11_IRQPMU, ARM11_COMMTX, ARM11_COMMTX),
159 INTC_GROUP(USBHS, USBHS_USHI0, USBHS_USHI1),
160 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
161 FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
162 INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
163};
164
165static struct intc_mask_reg intca_mask_registers[] __initdata = {
166 { 0xe6900040, 0xe6900060, 8, /* INTMSK00A / INTMSKCLR00A */
167 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
168 { 0xe6900044, 0xe6900064, 8, /* INTMSK10A / INTMSKCLR10A */
169 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
170 { 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
171 { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
172 ARM11_IRQPMU, 0, ARM11_COMMTX, ARM11_COMMRX } },
173 { 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
174 { CRYPT1_ERR, CRYPT2_STD, DIRC, 0,
175 DMAC_1_DEI3, DMAC_1_DEI2, DMAC_1_DEI1, DMAC_1_DEI0 } },
176 { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
177 { PINT1, PINT2, 0, 0,
178 BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
179 { 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
180 { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
181 DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
182 { 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
183 { DDM, 0, 0, 0,
184 0, 0, ETM11_FULL, ETM11_ACQCMP } },
185 { 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
186 { KEYSC_KEY, DMAC_2_DADERR, DMAC_2_DEI5, DMAC_2_DEI4,
187 SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
188 { 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
189 { SCIFB, SCIFA5, SCIFA4, MSIOF1,
190 0, 0, MSIOF2, 0 } },
191 { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
192 { DISABLED, DISABLED, ENABLED, ENABLED,
193 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
194 { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
195 { DISABLED, DISABLED, ENABLED, ENABLED,
196 TTI20, USBDMAC_USHDMI, SPU, SIU } },
197 { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
198 { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
199 CMT2, USBHS_USHI1, USBHS_USHI0, 0 } },
200 { 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
201 { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
202 0, 0, 0, 0 } },
203 { 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
204 { IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
205 LCRC, MSU_MSU2, IREM, MSU_MSU } },
206 { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
207 { 0, 0, TPU0, TPU1,
208 TPU2, TPU3, TPU4, 0 } },
209 { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
210 { DISABLED, DISABLED, ENABLED, ENABLED,
211 MISTY, CMT3, RWDT1, RWDT0 } },
212};
213
214static struct intc_prio_reg intca_prio_registers[] __initdata = {
215 { 0xe6900010, 0, 32, 4, /* INTPRI00A */
216 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
217 { 0xe6900014, 0, 32, 4, /* INTPRI10A */
218 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
219
220 { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, LCRC } },
221 { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, ETM11, BBIF1, BBIF2 } },
222 { 0xe6940008, 0, 16, 4, /* IPRCA */ { CRYPT1_ERR, CRYPT2_STD,
223 CMT1_CMT11, ARM11 } },
224 { 0xe694000c, 0, 16, 4, /* IPRDA */ { PINT1, PINT2,
225 CMT1_CMT12, TPU4 } },
226 { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC_1, MFI_MFIS,
227 MFI_MFIM, USBHS } },
228 { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC_2,
229 0, CMT1_CMT10 } },
230 { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
231 SCIFA2, SCIFA3 } },
232 { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBDMAC_USHDMI,
233 FLCTL, SDHI0 } },
234 { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, MSU_MSU, IIC1 } },
235 { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2, SIU, TTI20 } },
236 { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IREM, SDHI1 } },
237 { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, TPU1, TPU2, TPU3 } },
238 { 0xe6940030, 0, 16, 4, /* IPRMA */ { MISTY, CMT3, RWDT1, RWDT0 } },
239 { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, SPU, DDM } },
240 { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, SDHI2 } },
241};
242
243static struct intc_sense_reg intca_sense_registers[] __initdata = {
244 { 0xe6900000, 16, 2, /* ICR1A */
245 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
246 { 0xe6900004, 16, 2, /* ICR2A */
247 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
248};
249
250static struct intc_mask_reg intca_ack_registers[] __initdata = {
251 { 0xe6900020, 0, 8, /* INTREQ00A */
252 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
253 { 0xe6900024, 0, 8, /* INTREQ10A */
254 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
255};
256
257static struct intc_desc intca_desc __initdata = {
258 .name = "sh7367-intca",
259 .force_enable = ENABLED,
260 .force_disable = DISABLED,
261 .hw = INTC_HW_DESC(intca_vectors, intca_groups,
262 intca_mask_registers, intca_prio_registers,
263 intca_sense_registers, intca_ack_registers),
264};
265
266enum {
267 UNUSED_INTCS = 0,
268
269 INTCS,
270
271 /* interrupt sources INTCS */
272 VIO2_VEU0, VIO2_VEU1, VIO2_VEU2, VIO2_VEU3,
273 VIO3_VOU,
274 RTDMAC_1_DEI0, RTDMAC_1_DEI1, RTDMAC_1_DEI2, RTDMAC_1_DEI3,
275 VIO1_CEU, VIO1_BEU0, VIO1_BEU1, VIO1_BEU2,
276 VPU,
277 SGX530,
278 _2DDMAC_2DDM0, _2DDMAC_2DDM1, _2DDMAC_2DDM2, _2DDMAC_2DDM3,
279 IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2,
280 IPMMU_IPMMUB, IPMMU_IPMMUS,
281 RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR,
282 MSIOF,
283 IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0,
284 TMU_TUNI0, TMU_TUNI1, TMU_TUNI2,
285 CMT,
286 TSIF,
287 IPMMUI,
288 MVI3,
289 ICB,
290 PEP,
291 ASA,
292 BEM,
293 VE2HO,
294 HQE,
295 JPEG,
296 LCDC,
297
298 /* interrupt groups INTCS */
299 _2DDMAC, RTDMAC_1, RTDMAC_2, VEU, BEU, IIC0, IPMMU, IIC2,
300};
301
302static struct intc_vect intcs_vectors[] = {
303 INTCS_VECT(VIO2_VEU0, 0x700), INTCS_VECT(VIO2_VEU1, 0x720),
304 INTCS_VECT(VIO2_VEU2, 0x740), INTCS_VECT(VIO2_VEU3, 0x760),
305 INTCS_VECT(VIO3_VOU, 0x780),
306 INTCS_VECT(RTDMAC_1_DEI0, 0x800), INTCS_VECT(RTDMAC_1_DEI1, 0x820),
307 INTCS_VECT(RTDMAC_1_DEI2, 0x840), INTCS_VECT(RTDMAC_1_DEI3, 0x860),
308 INTCS_VECT(VIO1_CEU, 0x880), INTCS_VECT(VIO1_BEU0, 0x8a0),
309 INTCS_VECT(VIO1_BEU1, 0x8c0), INTCS_VECT(VIO1_BEU2, 0x8e0),
310 INTCS_VECT(VPU, 0x980),
311 INTCS_VECT(SGX530, 0x9e0),
312 INTCS_VECT(_2DDMAC_2DDM0, 0xa00), INTCS_VECT(_2DDMAC_2DDM1, 0xa20),
313 INTCS_VECT(_2DDMAC_2DDM2, 0xa40), INTCS_VECT(_2DDMAC_2DDM3, 0xa60),
314 INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0),
315 INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0),
316 INTCS_VECT(IPMMU_IPMMUB, 0xb20), INTCS_VECT(IPMMU_IPMMUS, 0xb60),
317 INTCS_VECT(RTDMAC_2_DEI4, 0xb80), INTCS_VECT(RTDMAC_2_DEI5, 0xba0),
318 INTCS_VECT(RTDMAC_2_DADERR, 0xbc0),
319 INTCS_VECT(MSIOF, 0xd20),
320 INTCS_VECT(IIC0_ALI0, 0xe00), INTCS_VECT(IIC0_TACKI0, 0xe20),
321 INTCS_VECT(IIC0_WAITI0, 0xe40), INTCS_VECT(IIC0_DTEI0, 0xe60),
322 INTCS_VECT(TMU_TUNI0, 0xe80), INTCS_VECT(TMU_TUNI1, 0xea0),
323 INTCS_VECT(TMU_TUNI2, 0xec0),
324 INTCS_VECT(CMT, 0xf00),
325 INTCS_VECT(TSIF, 0xf20),
326 INTCS_VECT(IPMMUI, 0xf60),
327 INTCS_VECT(MVI3, 0x420),
328 INTCS_VECT(ICB, 0x480),
329 INTCS_VECT(PEP, 0x4a0),
330 INTCS_VECT(ASA, 0x4c0),
331 INTCS_VECT(BEM, 0x4e0),
332 INTCS_VECT(VE2HO, 0x520),
333 INTCS_VECT(HQE, 0x540),
334 INTCS_VECT(JPEG, 0x560),
335 INTCS_VECT(LCDC, 0x580),
336
337 INTC_VECT(INTCS, 0xf80),
338};
339
340static struct intc_group intcs_groups[] __initdata = {
341 INTC_GROUP(_2DDMAC, _2DDMAC_2DDM0, _2DDMAC_2DDM1,
342 _2DDMAC_2DDM2, _2DDMAC_2DDM3),
343 INTC_GROUP(RTDMAC_1, RTDMAC_1_DEI0, RTDMAC_1_DEI1,
344 RTDMAC_1_DEI2, RTDMAC_1_DEI3),
345 INTC_GROUP(RTDMAC_2, RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR),
346 INTC_GROUP(VEU, VIO2_VEU0, VIO2_VEU1, VIO2_VEU2, VIO2_VEU3),
347 INTC_GROUP(BEU, VIO1_BEU0, VIO1_BEU1, VIO1_BEU2),
348 INTC_GROUP(IIC0, IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0),
349 INTC_GROUP(IPMMU, IPMMU_IPMMUS, IPMMU_IPMMUB),
350 INTC_GROUP(IIC2, IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2),
351};
352
353static struct intc_mask_reg intcs_mask_registers[] = {
354 { 0xffd20184, 0xffd201c4, 8, /* IMR1SA / IMCR1SA */
355 { VIO1_BEU2, VIO1_BEU1, VIO1_BEU0, VIO1_CEU,
356 VIO2_VEU3, VIO2_VEU2, VIO2_VEU1, VIO2_VEU0 } },
357 { 0xffd20188, 0xffd201c8, 8, /* IMR2SA / IMCR2SA */
358 { VIO3_VOU, 0, VE2HO, VPU,
359 0, 0, 0, 0 } },
360 { 0xffd2018c, 0xffd201cc, 8, /* IMR3SA / IMCR3SA */
361 { _2DDMAC_2DDM3, _2DDMAC_2DDM2, _2DDMAC_2DDM1, _2DDMAC_2DDM0,
362 BEM, ASA, PEP, ICB } },
363 { 0xffd20190, 0xffd201d0, 8, /* IMR4SA / IMCR4SA */
364 { 0, 0, MVI3, 0,
365 JPEG, HQE, 0, LCDC } },
366 { 0xffd20194, 0xffd201d4, 8, /* IMR5SA / IMCR5SA */
367 { 0, RTDMAC_2_DADERR, RTDMAC_2_DEI5, RTDMAC_2_DEI4,
368 RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } },
369 { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */
370 { 0, 0, MSIOF, 0,
371 SGX530, 0, 0, 0 } },
372 { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */
373 { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0,
374 0, 0, 0, 0 } },
375 { 0xffd201a4, 0xffd201e4, 8, /* IMR9SA / IMCR9SA */
376 { 0, 0, 0, CMT,
377 IIC2_DTEI2, IIC2_WAITI2, IIC2_TACKI2, IIC2_ALI2 } },
378 { 0xffd201a8, 0xffd201e8, 8, /* IMR10SA / IMCR10SA */
379 { IPMMU_IPMMUS, 0, IPMMU_IPMMUB, 0,
380 0, 0, 0, 0 } },
381 { 0xffd201ac, 0xffd201ec, 8, /* IMR11SA / IMCR11SA */
382 { IIC0_DTEI0, IIC0_WAITI0, IIC0_TACKI0, IIC0_ALI0,
383 0, 0, IPMMUI, TSIF } },
384 { 0xffd20104, 0, 16, /* INTAMASK */
385 { 0, 0, 0, 0, 0, 0, 0, 0,
386 0, 0, 0, 0, 0, 0, 0, INTCS } },
387};
388
389/* Priority is needed for INTCA to receive the INTCS interrupt */
390static struct intc_prio_reg intcs_prio_registers[] = {
391 { 0xffd20000, 0, 16, 4, /* IPRAS */ { 0, MVI3, _2DDMAC, ICB } },
392 { 0xffd20004, 0, 16, 4, /* IPRBS */ { JPEG, LCDC, 0, 0 } },
393 { 0xffd20008, 0, 16, 4, /* IPRCS */ { BBIF2, 0, 0, 0 } },
394 { 0xffd20010, 0, 16, 4, /* IPRES */ { RTDMAC_1, VIO1_CEU, 0, VPU } },
395 { 0xffd20014, 0, 16, 4, /* IPRFS */ { 0, RTDMAC_2, 0, CMT } },
396 { 0xffd20018, 0, 16, 4, /* IPRGS */ { TMU_TUNI0, TMU_TUNI1,
397 TMU_TUNI2, 0 } },
398 { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, VIO3_VOU, VEU, BEU } },
399 { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF, IIC0 } },
400 { 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, SGX530, 0, 0 } },
401 { 0xffd20028, 0, 16, 4, /* IPRKS */ { BEM, ASA, IPMMUI, PEP } },
402 { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, VE2HO, HQE } },
403 { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } },
404};
405
406static struct resource intcs_resources[] __initdata = {
407 [0] = {
408 .start = 0xffd20000,
409 .end = 0xffd2ffff,
410 .flags = IORESOURCE_MEM,
411 }
412};
413
414static struct intc_desc intcs_desc __initdata = {
415 .name = "sh7367-intcs",
416 .resource = intcs_resources,
417 .num_resources = ARRAY_SIZE(intcs_resources),
418 .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
419 intcs_prio_registers, NULL, NULL),
420};
421
422static void intcs_demux(unsigned int irq, struct irq_desc *desc)
423{
424 void __iomem *reg = (void *)get_irq_data(irq);
425 unsigned int evtcodeas = ioread32(reg);
426
427 generic_handle_irq(intcs_evt2irq(evtcodeas));
428}
429
430void __init sh7367_init_irq(void)
431{
432 void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
433
434 register_intc_controller(&intca_desc);
435 register_intc_controller(&intcs_desc);
436
437 /* demux using INTEVTSA */
438 set_irq_data(evt2irq(0xf80), (void *)intevtsa);
439 set_irq_chained_handler(evt2irq(0xf80), intcs_demux);
440}
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
new file mode 100644
index 000000000000..30b2f400666a
--- /dev/null
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -0,0 +1,617 @@
1/*
2 * sh7372 processor support - INTC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/io.h>
24#include <linux/sh_intc.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28enum {
29 UNUSED_INTCA = 0,
30 ENABLED,
31 DISABLED,
32
33 /* interrupt sources INTCA */
34 IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
35 IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A,
36 IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A,
37 IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A,
38 DIRC,
39 CRYPT_STD,
40 IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
41 AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX,
42 MFI_MFIM, MFI_MFIS,
43 BBIF1, BBIF2,
44 USBHSDMAC0_USHDMI,
45 _3DG_SGX540,
46 CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
47 KEYSC_KEY,
48 SCIFA0, SCIFA1, SCIFA2, SCIFA3,
49 MSIOF2, MSIOF1,
50 SCIFA4, SCIFA5, SCIFB,
51 FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
52 SDHI0,
53 SDHI1,
54 IRREM,
55 IRDA,
56 TPU0,
57 TTI20,
58 DDM,
59 SDHI2,
60 RWDT0,
61 DMAC1_1_DEI0, DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3,
62 DMAC1_2_DEI4, DMAC1_2_DEI5, DMAC1_2_DADERR,
63 DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
64 DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
65 DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
66 DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
67 SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM,
68 HDMI,
69 SPU2_SPU0, SPU2_SPU1,
70 FSI, FMSI,
71 MIPI_HSI,
72 IPMMU_IPMMUD,
73 CEC_1, CEC_2,
74 AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, AP_ARM_DMAIRQ, AP_ARM_DMASIRQ,
75 MFIS2,
76 CPORTR2S,
77 CMT14, CMT15,
78 MMC_MMC_ERR, MMC_MMC_NOR,
79 IIC4_ALI4, IIC4_TACKI4, IIC4_WAITI4, IIC4_DTEI4,
80 IIC3_ALI3, IIC3_TACKI3, IIC3_WAITI3, IIC3_DTEI3,
81 USB0_USB0I1, USB0_USB0I0,
82 USB1_USB1I1, USB1_USB1I0,
83 USBHSDMAC1_USHDMI,
84
85 /* interrupt groups INTCA */
86 DMAC1_1, DMAC1_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT,
87 AP_ARM1, AP_ARM2, SPU2, FLCTL, IIC1
88};
89
90static struct intc_vect intca_vectors[] __initdata = {
91 INTC_VECT(IRQ0A, 0x0200), INTC_VECT(IRQ1A, 0x0220),
92 INTC_VECT(IRQ2A, 0x0240), INTC_VECT(IRQ3A, 0x0260),
93 INTC_VECT(IRQ4A, 0x0280), INTC_VECT(IRQ5A, 0x02a0),
94 INTC_VECT(IRQ6A, 0x02c0), INTC_VECT(IRQ7A, 0x02e0),
95 INTC_VECT(IRQ8A, 0x0300), INTC_VECT(IRQ9A, 0x0320),
96 INTC_VECT(IRQ10A, 0x0340), INTC_VECT(IRQ11A, 0x0360),
97 INTC_VECT(IRQ12A, 0x0380), INTC_VECT(IRQ13A, 0x03a0),
98 INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0),
99 INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220),
100 INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260),
101 INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ21A, 0x32a0),
102 INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0),
103 INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320),
104 INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360),
105 INTC_VECT(IRQ28A, 0x3380), INTC_VECT(IRQ29A, 0x33a0),
106 INTC_VECT(IRQ30A, 0x33c0), INTC_VECT(IRQ31A, 0x33e0),
107 INTC_VECT(DIRC, 0x0560),
108 INTC_VECT(CRYPT_STD, 0x0700),
109 INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
110 INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
111 INTC_VECT(AP_ARM_IRQPMU, 0x0800), INTC_VECT(AP_ARM_COMMTX, 0x0840),
112 INTC_VECT(AP_ARM_COMMRX, 0x0860),
113 INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
114 INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
115 INTC_VECT(USBHSDMAC0_USHDMI, 0x0a00),
116 INTC_VECT(_3DG_SGX540, 0x0a60),
117 INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
118 INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
119 INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
120 INTC_VECT(KEYSC_KEY, 0x0be0),
121 INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
122 INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
123 INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
124 INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
125 INTC_VECT(SCIFB, 0x0d60),
126 INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
127 INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
128 INTC_VECT(SDHI0, 0x0e00), INTC_VECT(SDHI0, 0x0e20),
129 INTC_VECT(SDHI0, 0x0e40), INTC_VECT(SDHI0, 0x0e60),
130 INTC_VECT(SDHI1, 0x0e80), INTC_VECT(SDHI1, 0x0ea0),
131 INTC_VECT(SDHI1, 0x0ec0),
132 INTC_VECT(IRREM, 0x0f60),
133 INTC_VECT(IRDA, 0x0480),
134 INTC_VECT(TPU0, 0x04a0),
135 INTC_VECT(TTI20, 0x1100),
136 INTC_VECT(DDM, 0x1140),
137 INTC_VECT(SDHI2, 0x1200), INTC_VECT(SDHI2, 0x1220),
138 INTC_VECT(SDHI2, 0x1240), INTC_VECT(SDHI2, 0x1260),
139 INTC_VECT(RWDT0, 0x1280),
140 INTC_VECT(DMAC1_1_DEI0, 0x2000), INTC_VECT(DMAC1_1_DEI1, 0x2020),
141 INTC_VECT(DMAC1_1_DEI2, 0x2040), INTC_VECT(DMAC1_1_DEI3, 0x2060),
142 INTC_VECT(DMAC1_2_DEI4, 0x2080), INTC_VECT(DMAC1_2_DEI5, 0x20a0),
143 INTC_VECT(DMAC1_2_DADERR, 0x20c0),
144 INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
145 INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
146 INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
147 INTC_VECT(DMAC2_2_DADERR, 0x21c0),
148 INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
149 INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
150 INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
151 INTC_VECT(DMAC3_2_DADERR, 0x22c0),
152 INTC_VECT(SHWYSTAT_RT, 0x1300), INTC_VECT(SHWYSTAT_HS, 0x1320),
153 INTC_VECT(SHWYSTAT_COM, 0x1340),
154 INTC_VECT(HDMI, 0x17e0),
155 INTC_VECT(SPU2_SPU0, 0x1800), INTC_VECT(SPU2_SPU1, 0x1820),
156 INTC_VECT(FSI, 0x1840),
157 INTC_VECT(FMSI, 0x1860),
158 INTC_VECT(MIPI_HSI, 0x18e0),
159 INTC_VECT(IPMMU_IPMMUD, 0x1920),
160 INTC_VECT(CEC_1, 0x1940), INTC_VECT(CEC_2, 0x1960),
161 INTC_VECT(AP_ARM_CTIIRQ, 0x1980),
162 INTC_VECT(AP_ARM_DMAEXTERRIRQ, 0x19a0),
163 INTC_VECT(AP_ARM_DMAIRQ, 0x19c0),
164 INTC_VECT(AP_ARM_DMASIRQ, 0x19e0),
165 INTC_VECT(MFIS2, 0x1a00),
166 INTC_VECT(CPORTR2S, 0x1a20),
167 INTC_VECT(CMT14, 0x1a40), INTC_VECT(CMT15, 0x1a60),
168 INTC_VECT(MMC_MMC_ERR, 0x1ac0), INTC_VECT(MMC_MMC_NOR, 0x1ae0),
169 INTC_VECT(IIC4_ALI4, 0x1b00), INTC_VECT(IIC4_TACKI4, 0x1b20),
170 INTC_VECT(IIC4_WAITI4, 0x1b40), INTC_VECT(IIC4_DTEI4, 0x1b60),
171 INTC_VECT(IIC3_ALI3, 0x1b80), INTC_VECT(IIC3_TACKI3, 0x1ba0),
172 INTC_VECT(IIC3_WAITI3, 0x1bc0), INTC_VECT(IIC3_DTEI3, 0x1be0),
173 INTC_VECT(USB0_USB0I1, 0x1c80), INTC_VECT(USB0_USB0I0, 0x1ca0),
174 INTC_VECT(USB1_USB1I1, 0x1cc0), INTC_VECT(USB1_USB1I0, 0x1ce0),
175 INTC_VECT(USBHSDMAC1_USHDMI, 0x1d00),
176};
177
178static struct intc_group intca_groups[] __initdata = {
179 INTC_GROUP(DMAC1_1, DMAC1_1_DEI0,
180 DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3),
181 INTC_GROUP(DMAC1_2, DMAC1_2_DEI4,
182 DMAC1_2_DEI5, DMAC1_2_DADERR),
183 INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
184 DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
185 INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
186 DMAC2_2_DEI5, DMAC2_2_DADERR),
187 INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
188 DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
189 INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
190 DMAC3_2_DEI5, DMAC3_2_DADERR),
191 INTC_GROUP(AP_ARM1, AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX),
192 INTC_GROUP(AP_ARM2, AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ,
193 AP_ARM_DMAIRQ, AP_ARM_DMASIRQ),
194 INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1),
195 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
196 FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
197 INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
198 INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
199};
200
201static struct intc_mask_reg intca_mask_registers[] __initdata = {
202 { 0xe6900040, 0xe6900060, 8, /* INTMSK00A / INTMSKCLR00A */
203 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
204 { 0xe6900044, 0xe6900064, 8, /* INTMSK10A / INTMSKCLR10A */
205 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
206 { 0xe6900048, 0xe6900068, 8, /* INTMSK20A / INTMSKCLR20A */
207 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
208 { 0xe690004c, 0xe690006c, 8, /* INTMSK30A / INTMSKCLR30A */
209 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
210
211 { 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
212 { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
213 AP_ARM_IRQPMU, 0, AP_ARM_COMMTX, AP_ARM_COMMRX } },
214 { 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
215 { 0, CRYPT_STD, DIRC, 0,
216 DMAC1_1_DEI3, DMAC1_1_DEI2, DMAC1_1_DEI1, DMAC1_1_DEI0 } },
217 { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
218 { 0, 0, 0, 0,
219 BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
220 { 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
221 { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
222 DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
223 { 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
224 { DDM, 0, 0, 0,
225 0, 0, 0, 0 } },
226 { 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
227 { KEYSC_KEY, DMAC1_2_DADERR, DMAC1_2_DEI5, DMAC1_2_DEI4,
228 SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
229 { 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
230 { SCIFB, SCIFA5, SCIFA4, MSIOF1,
231 0, 0, MSIOF2, 0 } },
232 { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
233 { DISABLED, DISABLED, ENABLED, ENABLED,
234 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
235 { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
236 { 0, DISABLED, ENABLED, ENABLED,
237 TTI20, USBHSDMAC0_USHDMI, 0, 0 } },
238 { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
239 { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
240 CMT2, 0, 0, _3DG_SGX540 } },
241 { 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
242 { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
243 0, 0, 0, 0 } },
244 { 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
245 { IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
246 0, 0, IRREM, 0 } },
247 { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
248 { 0, 0, TPU0, 0,
249 0, 0, 0, 0 } },
250 { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
251 { DISABLED, DISABLED, ENABLED, ENABLED,
252 0, CMT3, 0, RWDT0 } },
253 { 0xe6950080, 0xe69500c0, 8, /* IMR0A3 / IMCR0A3 */
254 { SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 0,
255 0, 0, 0, 0 } },
256 { 0xe6950090, 0xe69500d0, 8, /* IMR4A3 / IMCR4A3 */
257 { 0, 0, 0, 0,
258 0, 0, 0, HDMI } },
259 { 0xe6950094, 0xe69500d4, 8, /* IMR5A3 / IMCR5A3 */
260 { SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
261 0, 0, 0, MIPI_HSI } },
262 { 0xe6950098, 0xe69500d8, 8, /* IMR6A3 / IMCR6A3 */
263 { 0, IPMMU_IPMMUD, CEC_1, CEC_2,
264 AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ,
265 AP_ARM_DMAIRQ, AP_ARM_DMASIRQ } },
266 { 0xe695009c, 0xe69500dc, 8, /* IMR7A3 / IMCR7A3 */
267 { MFIS2, CPORTR2S, CMT14, CMT15,
268 0, 0, MMC_MMC_ERR, MMC_MMC_NOR } },
269 { 0xe69500a0, 0xe69500e0, 8, /* IMR8A3 / IMCR8A3 */
270 { IIC4_ALI4, IIC4_TACKI4, IIC4_WAITI4, IIC4_DTEI4,
271 IIC3_ALI3, IIC3_TACKI3, IIC3_WAITI3, IIC3_DTEI3 } },
272 { 0xe69500a4, 0xe69500e4, 8, /* IMR9A3 / IMCR9A3 */
273 { 0, 0, 0, 0,
274 USB0_USB0I1, USB0_USB0I0, USB1_USB1I1, USB1_USB1I0 } },
275 { 0xe69500a8, 0xe69500e8, 8, /* IMR10A3 / IMCR10A3 */
276 { USBHSDMAC1_USHDMI, 0, 0, 0,
277 0, 0, 0, 0 } },
278};
279
280static struct intc_prio_reg intca_prio_registers[] __initdata = {
281 { 0xe6900010, 0, 32, 4, /* INTPRI00A */
282 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
283 { 0xe6900014, 0, 32, 4, /* INTPRI10A */
284 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
285 { 0xe6900018, 0, 32, 4, /* INTPRI20A */
286 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
287 { 0xe690001c, 0, 32, 4, /* INTPRI30A */
288 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
289
290 { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, 0 } },
291 { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, 0, BBIF1, BBIF2 } },
292 { 0xe6940008, 0, 16, 4, /* IPRCA */ { 0, CRYPT_STD,
293 CMT1_CMT11, AP_ARM1 } },
294 { 0xe694000c, 0, 16, 4, /* IPRDA */ { 0, 0,
295 CMT1_CMT12, 0 } },
296 { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC1_1, MFI_MFIS,
297 MFI_MFIM, 0 } },
298 { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC1_2,
299 _3DG_SGX540, CMT1_CMT10 } },
300 { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
301 SCIFA2, SCIFA3 } },
302 { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBHSDMAC0_USHDMI,
303 FLCTL, SDHI0 } },
304 { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4,
305 0/* MSU */, IIC1 } },
306 { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2,
307 0/* MSUG */, TTI20 } },
308 { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IRREM, SDHI1 } },
309 { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, 0, 0, 0 } },
310 { 0xe6940030, 0, 16, 4, /* IPRMA */ { 0, CMT3, 0, RWDT0 } },
311 { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, 0, DDM } },
312 { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, SDHI2 } },
313 { 0xe6950000, 0, 16, 4, /* IPRAA3 */ { SHWYSTAT, 0, 0, 0 } },
314 { 0xe6950024, 0, 16, 4, /* IPRJA3 */ { 0, 0, 0, HDMI } },
315 { 0xe6950028, 0, 16, 4, /* IPRKA3 */ { SPU2, 0, FSI, FMSI } },
316 { 0xe695002c, 0, 16, 4, /* IPRLA3 */ { 0, 0, 0, MIPI_HSI } },
317 { 0xe6950030, 0, 16, 4, /* IPRMA3 */ { IPMMU_IPMMUD, 0,
318 CEC_1, CEC_2 } },
319 { 0xe6950034, 0, 16, 4, /* IPRNA3 */ { AP_ARM2, 0, 0, 0 } },
320 { 0xe6950038, 0, 16, 4, /* IPROA3 */ { MFIS2, CPORTR2S,
321 CMT14, CMT15 } },
322 { 0xe695003c, 0, 16, 4, /* IPRPA3 */ { 0, 0,
323 MMC_MMC_ERR, MMC_MMC_NOR } },
324 { 0xe6950040, 0, 16, 4, /* IPRQA3 */ { IIC4_ALI4, IIC4_TACKI4,
325 IIC4_WAITI4, IIC4_DTEI4 } },
326 { 0xe6950044, 0, 16, 4, /* IPRRA3 */ { IIC3_ALI3, IIC3_TACKI3,
327 IIC3_WAITI3, IIC3_DTEI3 } },
328 { 0xe6950048, 0, 16, 4, /* IPRSA3 */ { 0/*ERI*/, 0/*RXI*/,
329 0/*TXI*/, 0/*TEI*/} },
330 { 0xe695004c, 0, 16, 4, /* IPRTA3 */ { USB0_USB0I1, USB0_USB0I0,
331 USB1_USB1I1, USB1_USB1I0 } },
332 { 0xe6950050, 0, 16, 4, /* IPRUA3 */ { USBHSDMAC1_USHDMI, 0, 0, 0 } },
333};
334
335static struct intc_sense_reg intca_sense_registers[] __initdata = {
336 { 0xe6900000, 32, 4, /* ICR1A */
337 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
338 { 0xe6900004, 32, 4, /* ICR2A */
339 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
340 { 0xe6900008, 32, 4, /* ICR3A */
341 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
342 { 0xe690000c, 32, 4, /* ICR4A */
343 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
344};
345
346static struct intc_mask_reg intca_ack_registers[] __initdata = {
347 { 0xe6900020, 0, 8, /* INTREQ00A */
348 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
349 { 0xe6900024, 0, 8, /* INTREQ10A */
350 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
351 { 0xe6900028, 0, 8, /* INTREQ20A */
352 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
353 { 0xe690002c, 0, 8, /* INTREQ30A */
354 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
355};
356
357static struct intc_desc intca_desc __initdata = {
358 .name = "sh7372-intca",
359 .force_enable = ENABLED,
360 .force_disable = DISABLED,
361 .hw = INTC_HW_DESC(intca_vectors, intca_groups,
362 intca_mask_registers, intca_prio_registers,
363 intca_sense_registers, intca_ack_registers),
364};
365
366enum {
367 UNUSED_INTCS = 0,
368
369 INTCS,
370
371 /* interrupt sources INTCS */
372
373 /* IRQ0S - IRQ31S */
374 VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3,
375 RTDMAC_1_DEI0, RTDMAC_1_DEI1, RTDMAC_1_DEI2, RTDMAC_1_DEI3,
376 CEU, BEU_BEU0, BEU_BEU1, BEU_BEU2,
377 /* MFI */
378 /* BBIF2 */
379 VPU,
380 TSIF1,
381 _3DG_SGX530,
382 _2DDMAC,
383 IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2,
384 IPMMU_IPMMUR, IPMMU_IPMMUR2,
385 RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR,
386 /* KEYSC */
387 /* TTI20 */
388 MSIOF,
389 IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0,
390 TMU_TUNI0, TMU_TUNI1, TMU_TUNI2,
391 CMT0,
392 TSIF0,
393 /* CMT2 */
394 LMB,
395 CTI,
396 /* RWDT0 */
397 ICB,
398 JPU_JPEG,
399 LCDC,
400 LCRC,
401 RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, RTDMAC2_1_DEI2, RTDMAC2_1_DEI3,
402 RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR,
403 ISP,
404 LCDC1,
405 CSIRX,
406 DSITX_DSITX0,
407 DSITX_DSITX1,
408 /* SPU2 */
409 /* FSI */
410 /* FMSI */
411 /* HDMI */
412 TMU1_TUNI0, TMU1_TUNI1, TMU1_TUNI2,
413 CMT4,
414 DSITX1_DSITX1_0,
415 DSITX1_DSITX1_1,
416 /* MFIS2 */
417 CPORTS2R,
418 /* CEC */
419 JPU6E,
420
421 /* interrupt groups INTCS */
422 RTDMAC_1, RTDMAC_2, VEU, BEU, IIC0, IPMMU, IIC2,
423 RTDMAC2_1, RTDMAC2_2, TMU1, DSITX,
424};
425
426static struct intc_vect intcs_vectors[] = {
427 /* IRQ0S - IRQ31S */
428 INTCS_VECT(VEU_VEU0, 0x700), INTCS_VECT(VEU_VEU1, 0x720),
429 INTCS_VECT(VEU_VEU2, 0x740), INTCS_VECT(VEU_VEU3, 0x760),
430 INTCS_VECT(RTDMAC_1_DEI0, 0x800), INTCS_VECT(RTDMAC_1_DEI1, 0x820),
431 INTCS_VECT(RTDMAC_1_DEI2, 0x840), INTCS_VECT(RTDMAC_1_DEI3, 0x860),
432 INTCS_VECT(CEU, 0x880), INTCS_VECT(BEU_BEU0, 0x8a0),
433 INTCS_VECT(BEU_BEU1, 0x8c0), INTCS_VECT(BEU_BEU2, 0x8e0),
434 /* MFI */
435 /* BBIF2 */
436 INTCS_VECT(VPU, 0x980),
437 INTCS_VECT(TSIF1, 0x9a0),
438 INTCS_VECT(_3DG_SGX530, 0x9e0),
439 INTCS_VECT(_2DDMAC, 0xa00),
440 INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0),
441 INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0),
442 INTCS_VECT(IPMMU_IPMMUR, 0xb00), INTCS_VECT(IPMMU_IPMMUR2, 0xb20),
443 INTCS_VECT(RTDMAC_2_DEI4, 0xb80), INTCS_VECT(RTDMAC_2_DEI5, 0xba0),
444 INTCS_VECT(RTDMAC_2_DADERR, 0xbc0),
445 /* KEYSC */
446 /* TTI20 */
447 INTCS_VECT(MSIOF, 0x0d20),
448 INTCS_VECT(IIC0_ALI0, 0xe00), INTCS_VECT(IIC0_TACKI0, 0xe20),
449 INTCS_VECT(IIC0_WAITI0, 0xe40), INTCS_VECT(IIC0_DTEI0, 0xe60),
450 INTCS_VECT(TMU_TUNI0, 0xe80), INTCS_VECT(TMU_TUNI1, 0xea0),
451 INTCS_VECT(TMU_TUNI2, 0xec0),
452 INTCS_VECT(CMT0, 0xf00),
453 INTCS_VECT(TSIF0, 0xf20),
454 /* CMT2 */
455 INTCS_VECT(LMB, 0xf60),
456 INTCS_VECT(CTI, 0x400),
457 /* RWDT0 */
458 INTCS_VECT(ICB, 0x480),
459 INTCS_VECT(JPU_JPEG, 0x560),
460 INTCS_VECT(LCDC, 0x580),
461 INTCS_VECT(LCRC, 0x5a0),
462 INTCS_VECT(RTDMAC2_1_DEI0, 0x1300), INTCS_VECT(RTDMAC2_1_DEI1, 0x1320),
463 INTCS_VECT(RTDMAC2_1_DEI2, 0x1340), INTCS_VECT(RTDMAC2_1_DEI3, 0x1360),
464 INTCS_VECT(RTDMAC2_2_DEI4, 0x1380), INTCS_VECT(RTDMAC2_2_DEI5, 0x13a0),
465 INTCS_VECT(RTDMAC2_2_DADERR, 0x13c0),
466 INTCS_VECT(ISP, 0x1720),
467 INTCS_VECT(LCDC1, 0x1780),
468 INTCS_VECT(CSIRX, 0x17a0),
469 INTCS_VECT(DSITX_DSITX0, 0x17c0),
470 INTCS_VECT(DSITX_DSITX1, 0x17e0),
471 /* SPU2 */
472 /* FSI */
473 /* FMSI */
474 /* HDMI */
475 INTCS_VECT(TMU1_TUNI0, 0x1900), INTCS_VECT(TMU1_TUNI1, 0x1920),
476 INTCS_VECT(TMU1_TUNI2, 0x1940),
477 INTCS_VECT(CMT4, 0x1980),
478 INTCS_VECT(DSITX1_DSITX1_0, 0x19a0),
479 INTCS_VECT(DSITX1_DSITX1_1, 0x19c0),
480 /* MFIS2 */
481 INTCS_VECT(CPORTS2R, 0x1a20),
482 /* CEC */
483 INTCS_VECT(JPU6E, 0x1a80),
484
485 INTC_VECT(INTCS, 0xf80),
486};
487
488static struct intc_group intcs_groups[] __initdata = {
489 INTC_GROUP(RTDMAC_1, RTDMAC_1_DEI0, RTDMAC_1_DEI1,
490 RTDMAC_1_DEI2, RTDMAC_1_DEI3),
491 INTC_GROUP(RTDMAC_2, RTDMAC_2_DEI4, RTDMAC_2_DEI5, RTDMAC_2_DADERR),
492 INTC_GROUP(VEU, VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3),
493 INTC_GROUP(BEU, BEU_BEU0, BEU_BEU1, BEU_BEU2),
494 INTC_GROUP(IIC0, IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0),
495 INTC_GROUP(IPMMU, IPMMU_IPMMUR, IPMMU_IPMMUR2),
496 INTC_GROUP(IIC2, IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2),
497 INTC_GROUP(RTDMAC2_1, RTDMAC2_1_DEI0, RTDMAC2_1_DEI1,
498 RTDMAC2_1_DEI2, RTDMAC2_1_DEI3),
499 INTC_GROUP(RTDMAC2_2, RTDMAC2_2_DEI4,
500 RTDMAC2_2_DEI5, RTDMAC2_2_DADERR),
501 INTC_GROUP(TMU1, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0),
502 INTC_GROUP(DSITX, DSITX_DSITX0, DSITX_DSITX1),
503};
504
505static struct intc_mask_reg intcs_mask_registers[] = {
506 { 0xffd20184, 0xffd201c4, 8, /* IMR1SA / IMCR1SA */
507 { BEU_BEU2, BEU_BEU1, BEU_BEU0, CEU,
508 VEU_VEU3, VEU_VEU2, VEU_VEU1, VEU_VEU0 } },
509 { 0xffd20188, 0xffd201c8, 8, /* IMR2SA / IMCR2SA */
510 { 0, 0, 0, VPU,
511 0, 0, 0, 0 } },
512 { 0xffd2018c, 0xffd201cc, 8, /* IMR3SA / IMCR3SA */
513 { 0, 0, 0, _2DDMAC,
514 0, 0, 0, ICB } },
515 { 0xffd20190, 0xffd201d0, 8, /* IMR4SA / IMCR4SA */
516 { 0, 0, 0, CTI,
517 JPU_JPEG, 0, LCRC, LCDC } },
518 { 0xffd20194, 0xffd201d4, 8, /* IMR5SA / IMCR5SA */
519 { 0, RTDMAC_2_DADERR, RTDMAC_2_DEI5, RTDMAC_2_DEI4,
520 RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } },
521 { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */
522 { 0, 0, MSIOF, 0,
523 _3DG_SGX530, 0, 0, 0 } },
524 { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */
525 { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0,
526 0, 0, 0, 0 } },
527 { 0xffd201a4, 0xffd201e4, 8, /* IMR9SA / IMCR9SA */
528 { 0, 0, 0, CMT0,
529 IIC2_DTEI2, IIC2_WAITI2, IIC2_TACKI2, IIC2_ALI2 } },
530 { 0xffd201a8, 0xffd201e8, 8, /* IMR10SA / IMCR10SA */
531 { 0, 0, IPMMU_IPMMUR2, IPMMU_IPMMUR,
532 0, 0, 0, 0 } },
533 { 0xffd201ac, 0xffd201ec, 8, /* IMR11SA / IMCR11SA */
534 { IIC0_DTEI0, IIC0_WAITI0, IIC0_TACKI0, IIC0_ALI0,
535 0, TSIF1, LMB, TSIF0 } },
536 { 0xffd50180, 0xffd501c0, 8, /* IMR0SA3 / IMCR0SA3 */
537 { 0, RTDMAC2_2_DADERR, RTDMAC2_2_DEI5, RTDMAC2_2_DEI4,
538 RTDMAC2_1_DEI3, RTDMAC2_1_DEI2, RTDMAC2_1_DEI1, RTDMAC2_1_DEI0 } },
539 { 0xffd50190, 0xffd501d0, 8, /* IMR4SA3 / IMCR4SA3 */
540 { 0, ISP, 0, 0,
541 LCDC1, CSIRX, DSITX_DSITX0, DSITX_DSITX1 } },
542 { 0xffd50198, 0xffd501d8, 8, /* IMR6SA3 / IMCR6SA3 */
543 { 0, TMU1_TUNI2, TMU1_TUNI1, TMU1_TUNI0,
544 CMT4, DSITX1_DSITX1_0, DSITX1_DSITX1_1, 0 } },
545 { 0xffd5019c, 0xffd501dc, 8, /* IMR7SA3 / IMCR7SA3 */
546 { 0, CPORTS2R, 0, 0,
547 JPU6E, 0, 0, 0 } },
548 { 0xffd20104, 0, 16, /* INTAMASK */
549 { 0, 0, 0, 0, 0, 0, 0, 0,
550 0, 0, 0, 0, 0, 0, 0, INTCS } },
551};
552
553/* Priority is needed for INTCA to receive the INTCS interrupt */
554static struct intc_prio_reg intcs_prio_registers[] = {
555 { 0xffd20000, 0, 16, 4, /* IPRAS */ { CTI, 0, _2DDMAC, ICB } },
556 { 0xffd20004, 0, 16, 4, /* IPRBS */ { JPU_JPEG, LCDC, 0, LCRC } },
557 { 0xffd20010, 0, 16, 4, /* IPRES */ { RTDMAC_1, CEU, 0, VPU } },
558 { 0xffd20014, 0, 16, 4, /* IPRFS */ { 0, RTDMAC_2, 0, CMT0 } },
559 { 0xffd20018, 0, 16, 4, /* IPRGS */ { TMU_TUNI0, TMU_TUNI1,
560 TMU_TUNI2, TSIF1 } },
561 { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } },
562 { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } },
563 { 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, _3DG_SGX530, 0, 0 } },
564 { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } },
565 { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } },
566 { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } },
567 { 0xffd50000, 0, 16, 4, /* IPRAS3 */ { RTDMAC2_1, 0, 0, 0 } },
568 { 0xffd50004, 0, 16, 4, /* IPRBS3 */ { RTDMAC2_2, 0, 0, 0 } },
569 { 0xffd50020, 0, 16, 4, /* IPRIS3 */ { 0, ISP, 0, 0 } },
570 { 0xffd50024, 0, 16, 4, /* IPRJS3 */ { LCDC1, CSIRX, DSITX, 0 } },
571 { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, 0 } },
572 { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, DSITX1_DSITX1_0,
573 DSITX1_DSITX1_1, 0 } },
574 { 0xffd50038, 0, 16, 4, /* IPROS3 */ { 0, CPORTS2R, 0, 0 } },
575 { 0xffd5003c, 0, 16, 4, /* IPRPS3 */ { JPU6E, 0, 0, 0 } },
576};
577
578static struct resource intcs_resources[] __initdata = {
579 [0] = {
580 .start = 0xffd20000,
581 .end = 0xffd201ff,
582 .flags = IORESOURCE_MEM,
583 },
584 [1] = {
585 .start = 0xffd50000,
586 .end = 0xffd501ff,
587 .flags = IORESOURCE_MEM,
588 }
589};
590
591static struct intc_desc intcs_desc __initdata = {
592 .name = "sh7372-intcs",
593 .resource = intcs_resources,
594 .num_resources = ARRAY_SIZE(intcs_resources),
595 .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
596 intcs_prio_registers, NULL, NULL),
597};
598
599static void intcs_demux(unsigned int irq, struct irq_desc *desc)
600{
601 void __iomem *reg = (void *)get_irq_data(irq);
602 unsigned int evtcodeas = ioread32(reg);
603
604 generic_handle_irq(intcs_evt2irq(evtcodeas));
605}
606
607void __init sh7372_init_irq(void)
608{
609 void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
610
611 register_intc_controller(&intca_desc);
612 register_intc_controller(&intcs_desc);
613
614 /* demux using INTEVTSA */
615 set_irq_data(evt2irq(0xf80), (void *)intevtsa);
616 set_irq_chained_handler(evt2irq(0xf80), intcs_demux);
617}
diff --git a/arch/arm/mach-shmobile/intc-sh7377.c b/arch/arm/mach-shmobile/intc-sh7377.c
new file mode 100644
index 000000000000..2cdeb8ccd821
--- /dev/null
+++ b/arch/arm/mach-shmobile/intc-sh7377.c
@@ -0,0 +1,646 @@
1/*
2 * sh7377 processor support - INTC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/io.h>
24#include <linux/sh_intc.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28enum {
29 UNUSED_INTCA = 0,
30 ENABLED,
31 DISABLED,
32
33 /* interrupt sources INTCA */
34 IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
35 IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A,
36 IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A,
37 IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A,
38 DIRC,
39 _2DG,
40 CRYPT_STD,
41 IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
42 AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX,
43 MFI_MFIM, MFI_MFIS,
44 BBIF1, BBIF2,
45 USBDMAC_USHDMI,
46 USBHS_USHI0, USBHS_USHI1,
47 _3DG_SGX540,
48 CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
49 KEYSC_KEY,
50 SCIFA0, SCIFA1, SCIFA2, SCIFA3,
51 MSIOF2, MSIOF1,
52 SCIFA4, SCIFA5, SCIFB,
53 FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
54 SDHI0,
55 SDHI1,
56 MSU_MSU, MSU_MSU2,
57 IRREM,
58 MSUG,
59 IRDA,
60 TPU0, TPU1, TPU2, TPU3, TPU4,
61 LCRC,
62 PINTCA_PINT1, PINTCA_PINT2,
63 TTI20,
64 MISTY,
65 DDM,
66 RWDT0, RWDT1,
67 DMAC_1_DEI0, DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3,
68 DMAC_2_DEI4, DMAC_2_DEI5, DMAC_2_DADERR,
69 DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
70 DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
71 DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
72 DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
73 SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM,
74 ICUSB_ICUSB0, ICUSB_ICUSB1,
75 ICUDMC_ICUDMC1, ICUDMC_ICUDMC2,
76 SPU2_SPU0, SPU2_SPU1,
77 FSI,
78 FMSI,
79 SCUV,
80 IPMMU_IPMMUB,
81 AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, AP_ARM_DMAIRQ, AP_ARM_DMASIRQ,
82 MFIS2,
83 CPORTR2S,
84 CMT14, CMT15,
85 SCIFA6,
86
87 /* interrupt groups INTCA */
88 DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT,
89 AP_ARM1, AP_ARM2, USBHS, SPU2, FLCTL, IIC1,
90 ICUSB, ICUDMC
91};
92
93static struct intc_vect intca_vectors[] __initdata = {
94 INTC_VECT(IRQ0A, 0x0200), INTC_VECT(IRQ1A, 0x0220),
95 INTC_VECT(IRQ2A, 0x0240), INTC_VECT(IRQ3A, 0x0260),
96 INTC_VECT(IRQ4A, 0x0280), INTC_VECT(IRQ5A, 0x02a0),
97 INTC_VECT(IRQ6A, 0x02c0), INTC_VECT(IRQ7A, 0x02e0),
98 INTC_VECT(IRQ8A, 0x0300), INTC_VECT(IRQ9A, 0x0320),
99 INTC_VECT(IRQ10A, 0x0340), INTC_VECT(IRQ11A, 0x0360),
100 INTC_VECT(IRQ12A, 0x0380), INTC_VECT(IRQ13A, 0x03a0),
101 INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0),
102 INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220),
103 INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260),
104 INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ31A, 0x32a0),
105 INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0),
106 INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320),
107 INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360),
108 INTC_VECT(IRQ28A, 0x3380), INTC_VECT(IRQ29A, 0x33a0),
109 INTC_VECT(IRQ30A, 0x33c0), INTC_VECT(IRQ31A, 0x33e0),
110 INTC_VECT(DIRC, 0x0560),
111 INTC_VECT(_2DG, 0x05e0),
112 INTC_VECT(CRYPT_STD, 0x0700),
113 INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
114 INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
115 INTC_VECT(AP_ARM_IRQPMU, 0x0800), INTC_VECT(AP_ARM_COMMTX, 0x0840),
116 INTC_VECT(AP_ARM_COMMRX, 0x0860),
117 INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
118 INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
119 INTC_VECT(USBDMAC_USHDMI, 0x0a00),
120 INTC_VECT(USBHS_USHI0, 0x0a20), INTC_VECT(USBHS_USHI1, 0x0a40),
121 INTC_VECT(_3DG_SGX540, 0x0a60),
122 INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
123 INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
124 INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
125 INTC_VECT(KEYSC_KEY, 0x0be0),
126 INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
127 INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
128 INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
129 INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
130 INTC_VECT(SCIFB, 0x0d60),
131 INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
132 INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
133 INTC_VECT(SDHI0, 0x0e00), INTC_VECT(SDHI0, 0x0e20),
134 INTC_VECT(SDHI0, 0x0e40), INTC_VECT(SDHI0, 0x0e60),
135 INTC_VECT(SDHI1, 0x0e80), INTC_VECT(SDHI1, 0x0ea0),
136 INTC_VECT(SDHI1, 0x0ec0), INTC_VECT(SDHI1, 0x0ee0),
137 INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
138 INTC_VECT(IRREM, 0x0f60),
139 INTC_VECT(MSUG, 0x0fa0),
140 INTC_VECT(IRDA, 0x0480),
141 INTC_VECT(TPU0, 0x04a0), INTC_VECT(TPU1, 0x04c0),
142 INTC_VECT(TPU2, 0x04e0), INTC_VECT(TPU3, 0x0500),
143 INTC_VECT(TPU4, 0x0520),
144 INTC_VECT(LCRC, 0x0540),
145 INTC_VECT(PINTCA_PINT1, 0x1000), INTC_VECT(PINTCA_PINT2, 0x1020),
146 INTC_VECT(TTI20, 0x1100),
147 INTC_VECT(MISTY, 0x1120),
148 INTC_VECT(DDM, 0x1140),
149 INTC_VECT(RWDT0, 0x1280), INTC_VECT(RWDT1, 0x12a0),
150 INTC_VECT(DMAC_1_DEI0, 0x2000), INTC_VECT(DMAC_1_DEI1, 0x2020),
151 INTC_VECT(DMAC_1_DEI2, 0x2040), INTC_VECT(DMAC_1_DEI3, 0x2060),
152 INTC_VECT(DMAC_2_DEI4, 0x2080), INTC_VECT(DMAC_2_DEI5, 0x20a0),
153 INTC_VECT(DMAC_2_DADERR, 0x20c0),
154 INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
155 INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
156 INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
157 INTC_VECT(DMAC2_2_DADERR, 0x21c0),
158 INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
159 INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
160 INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
161 INTC_VECT(DMAC3_2_DADERR, 0x22c0),
162 INTC_VECT(SHWYSTAT_RT, 0x1300), INTC_VECT(SHWYSTAT_HS, 0x1d20),
163 INTC_VECT(SHWYSTAT_COM, 0x1340),
164 INTC_VECT(ICUSB_ICUSB0, 0x1700), INTC_VECT(ICUSB_ICUSB1, 0x1720),
165 INTC_VECT(ICUDMC_ICUDMC1, 0x1780), INTC_VECT(ICUDMC_ICUDMC2, 0x17a0),
166 INTC_VECT(SPU2_SPU0, 0x1800), INTC_VECT(SPU2_SPU1, 0x1820),
167 INTC_VECT(FSI, 0x1840),
168 INTC_VECT(FMSI, 0x1860),
169 INTC_VECT(SCUV, 0x1880),
170 INTC_VECT(IPMMU_IPMMUB, 0x1900),
171 INTC_VECT(AP_ARM_CTIIRQ, 0x1980),
172 INTC_VECT(AP_ARM_DMAEXTERRIRQ, 0x19a0),
173 INTC_VECT(AP_ARM_DMAIRQ, 0x19c0),
174 INTC_VECT(AP_ARM_DMASIRQ, 0x19e0),
175 INTC_VECT(MFIS2, 0x1a00),
176 INTC_VECT(CPORTR2S, 0x1a20),
177 INTC_VECT(CMT14, 0x1a40), INTC_VECT(CMT15, 0x1a60),
178 INTC_VECT(SCIFA6, 0x1a80),
179};
180
181static struct intc_group intca_groups[] __initdata = {
182 INTC_GROUP(DMAC_1, DMAC_1_DEI0,
183 DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3),
184 INTC_GROUP(DMAC_2, DMAC_2_DEI4,
185 DMAC_2_DEI5, DMAC_2_DADERR),
186 INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
187 DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
188 INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
189 DMAC2_2_DEI5, DMAC2_2_DADERR),
190 INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
191 DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
192 INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
193 DMAC3_2_DEI5, DMAC3_2_DADERR),
194 INTC_GROUP(AP_ARM1, AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMTX),
195 INTC_GROUP(USBHS, USBHS_USHI0, USBHS_USHI1),
196 INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1),
197 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
198 FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
199 INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
200 INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
201 INTC_GROUP(ICUSB, ICUSB_ICUSB0, ICUSB_ICUSB1),
202 INTC_GROUP(ICUDMC, ICUDMC_ICUDMC1, ICUDMC_ICUDMC2),
203};
204
205static struct intc_mask_reg intca_mask_registers[] __initdata = {
206 { 0xe6900040, 0xe6900060, 8, /* INTMSK00A / INTMSKCLR00A */
207 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
208 { 0xe6900044, 0xe6900064, 8, /* INTMSK10A / INTMSKCLR10A */
209 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
210 { 0xe6900048, 0xe6900068, 8, /* INTMSK20A / INTMSKCLR20A */
211 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
212 { 0xe690004c, 0xe690006c, 8, /* INTMSK30A / INTMSKCLR30A */
213 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
214
215 { 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
216 { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
217 AP_ARM_IRQPMU, 0, AP_ARM_COMMTX, AP_ARM_COMMRX } },
218 { 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
219 { _2DG, CRYPT_STD, DIRC, 0,
220 DMAC_1_DEI3, DMAC_1_DEI2, DMAC_1_DEI1, DMAC_1_DEI0 } },
221 { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
222 { PINTCA_PINT1, PINTCA_PINT2, 0, 0,
223 BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
224 { 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
225 { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
226 DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
227 { 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
228 { DDM, 0, 0, 0,
229 0, 0, 0, 0 } },
230 { 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
231 { KEYSC_KEY, DMAC_2_DADERR, DMAC_2_DEI5, DMAC_2_DEI4,
232 SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
233 { 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
234 { SCIFB, SCIFA5, SCIFA4, MSIOF1,
235 0, 0, MSIOF2, 0 } },
236 { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
237 { DISABLED, DISABLED, ENABLED, ENABLED,
238 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
239 { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
240 { DISABLED, DISABLED, ENABLED, ENABLED,
241 TTI20, USBDMAC_USHDMI, 0, MSUG } },
242 { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
243 { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
244 CMT2, USBHS_USHI1, USBHS_USHI0, _3DG_SGX540 } },
245 { 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
246 { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
247 0, 0, 0, 0 } },
248 { 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
249 { IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
250 LCRC, MSU_MSU2, IRREM, MSU_MSU } },
251 { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
252 { 0, 0, TPU0, TPU1,
253 TPU2, TPU3, TPU4, 0 } },
254 { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
255 { 0, 0, 0, 0,
256 MISTY, CMT3, RWDT1, RWDT0 } },
257 { 0xe6950080, 0xe69500c0, 8, /* IMR0A3 / IMCR0A3 */
258 { SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 0,
259 0, 0, 0, 0 } },
260 { 0xe6950090, 0xe69500d0, 8, /* IMR4A3 / IMCR4A3 */
261 { ICUSB_ICUSB0, ICUSB_ICUSB1, 0, 0,
262 ICUDMC_ICUDMC1, ICUDMC_ICUDMC2, 0, 0 } },
263 { 0xe6950094, 0xe69500d4, 8, /* IMR5A3 / IMCR5A3 */
264 { SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
265 SCUV, 0, 0, 0 } },
266 { 0xe6950098, 0xe69500d8, 8, /* IMR6A3 / IMCR6A3 */
267 { IPMMU_IPMMUB, 0, 0, 0,
268 AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ,
269 AP_ARM_DMAIRQ, AP_ARM_DMASIRQ } },
270 { 0xe695009c, 0xe69500dc, 8, /* IMR7A3 / IMCR7A3 */
271 { MFIS2, CPORTR2S, CMT14, CMT15,
272 SCIFA6, 0, 0, 0 } },
273};
274
275static struct intc_prio_reg intca_prio_registers[] __initdata = {
276 { 0xe6900010, 0, 32, 4, /* INTPRI00A */
277 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
278 { 0xe6900014, 0, 32, 4, /* INTPRI10A */
279 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
280 { 0xe6900018, 0, 32, 4, /* INTPRI10A */
281 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
282 { 0xe690001c, 0, 32, 4, /* INTPRI30A */
283 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
284
285 { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, LCRC } },
286 { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, 0, BBIF1, BBIF2 } },
287 { 0xe6940008, 0, 16, 4, /* IPRCA */ { _2DG, CRYPT_STD,
288 CMT1_CMT11, AP_ARM1 } },
289 { 0xe694000c, 0, 16, 4, /* IPRDA */ { PINTCA_PINT1, PINTCA_PINT2,
290 CMT1_CMT12, TPU4 } },
291 { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC_1, MFI_MFIS,
292 MFI_MFIM, USBHS } },
293 { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC_2,
294 _3DG_SGX540, CMT1_CMT10 } },
295 { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
296 SCIFA2, SCIFA3 } },
297 { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBDMAC_USHDMI,
298 FLCTL, SDHI0 } },
299 { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, MSU_MSU, IIC1 } },
300 { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2, MSUG, TTI20 } },
301 { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IRREM, SDHI1 } },
302 { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, TPU1, TPU2, TPU3 } },
303 { 0xe6940030, 0, 16, 4, /* IPRMA */ { MISTY, CMT3, RWDT1, RWDT0 } },
304 { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, 0, DDM } },
305 { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, 0 } },
306 { 0xe6950000, 0, 16, 4, /* IPRAA3 */ { SHWYSTAT, 0, 0, 0 } },
307 { 0xe6950020, 0, 16, 4, /* IPRIA3 */ { ICUSB, 0, 0, 0 } },
308 { 0xe6950024, 0, 16, 4, /* IPRJA3 */ { ICUDMC, 0, 0, 0 } },
309 { 0xe6950028, 0, 16, 4, /* IPRKA3 */ { SPU2, 0, FSI, FMSI } },
310 { 0xe695002c, 0, 16, 4, /* IPRLA3 */ { SCUV, 0, 0, 0 } },
311 { 0xe6950030, 0, 16, 4, /* IPRMA3 */ { IPMMU_IPMMUB, 0, 0, 0 } },
312 { 0xe6950034, 0, 16, 4, /* IPRNA3 */ { AP_ARM2, 0, 0, 0 } },
313 { 0xe6950038, 0, 16, 4, /* IPROA3 */ { MFIS2, CPORTR2S,
314 CMT14, CMT15 } },
315 { 0xe694003c, 0, 16, 4, /* IPRPA3 */ { SCIFA6, 0, 0, 0 } },
316};
317
318static struct intc_sense_reg intca_sense_registers[] __initdata = {
319 { 0xe6900000, 16, 2, /* ICR1A */
320 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
321 { 0xe6900004, 16, 2, /* ICR2A */
322 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
323 { 0xe6900008, 16, 2, /* ICR3A */
324 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
325 { 0xe690000c, 16, 2, /* ICR4A */
326 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
327};
328
329static struct intc_mask_reg intca_ack_registers[] __initdata = {
330 { 0xe6900020, 0, 8, /* INTREQ00A */
331 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
332 { 0xe6900024, 0, 8, /* INTREQ10A */
333 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
334 { 0xe6900028, 0, 8, /* INTREQ20A */
335 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
336 { 0xe690002c, 0, 8, /* INTREQ30A */
337 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
338};
339
340static struct intc_desc intca_desc __initdata = {
341 .name = "sh7377-intca",
342 .force_enable = ENABLED,
343 .force_disable = DISABLED,
344 .hw = INTC_HW_DESC(intca_vectors, intca_groups,
345 intca_mask_registers, intca_prio_registers,
346 intca_sense_registers, intca_ack_registers),
347};
348
349/* this macro ignore entry which is also in INTCA */
350#define __IGNORE(a...)
351#define __IGNORE0(a...) 0
352
353enum {
354 UNUSED_INTCS = 0,
355
356 INTCS,
357
358 /* interrupt sources INTCS */
359 VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3,
360 RTDMAC1_1_DEI0, RTDMAC1_1_DEI1, RTDMAC1_1_DEI2, RTDMAC1_1_DEI3,
361 CEU,
362 BEU_BEU0, BEU_BEU1, BEU_BEU2,
363 __IGNORE(MFI)
364 __IGNORE(BBIF2)
365 VPU,
366 TSIF1,
367 __IGNORE(SGX540)
368 _2DDMAC,
369 IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2,
370 IPMMU_IPMMUR, IPMMU_IPMMUR2,
371 RTDMAC1_2_DEI4, RTDMAC1_2_DEI5, RTDMAC1_2_DADERR,
372 __IGNORE(KEYSC)
373 __IGNORE(TTI20)
374 __IGNORE(MSIOF)
375 IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0,
376 TMU_TUNI0, TMU_TUNI1, TMU_TUNI2,
377 CMT0,
378 TSIF0,
379 __IGNORE(CMT2)
380 LMB,
381 __IGNORE(MSUG)
382 __IGNORE(MSU_MSU, MSU_MSU2)
383 __IGNORE(CTI)
384 MVI3,
385 __IGNORE(RWDT0)
386 __IGNORE(RWDT1)
387 ICB,
388 PEP,
389 ASA,
390 __IGNORE(_2DG)
391 HQE,
392 JPU,
393 LCDC0,
394 __IGNORE(LCRC)
395 RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, RTDMAC2_1_DEI2, RTDMAC2_1_DEI3,
396 RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR,
397 FRC,
398 LCDC1,
399 CSIRX,
400 DSITX_DSITX0, DSITX_DSITX1,
401 __IGNORE(SPU2_SPU0, SPU2_SPU1)
402 __IGNORE(FSI)
403 __IGNORE(FMSI)
404 __IGNORE(SCUV)
405 TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12,
406 TSIF2,
407 CMT4,
408 __IGNORE(MFIS2)
409 CPORTS2R,
410
411 /* interrupt groups INTCS */
412 RTDMAC1_1, RTDMAC1_2, VEU, BEU, IIC0, __IGNORE(MSU) IPMMU,
413 IIC2, RTDMAC2_1, RTDMAC2_2, DSITX, __IGNORE(SPU2) TMU1,
414};
415
416#define INTCS_INTVECT 0x0F80
417static struct intc_vect intcs_vectors[] __initdata = {
418 INTCS_VECT(VEU_VEU0, 0x0700), INTCS_VECT(VEU_VEU1, 0x0720),
419 INTCS_VECT(VEU_VEU2, 0x0740), INTCS_VECT(VEU_VEU3, 0x0760),
420 INTCS_VECT(RTDMAC1_1_DEI0, 0x0800), INTCS_VECT(RTDMAC1_1_DEI1, 0x0820),
421 INTCS_VECT(RTDMAC1_1_DEI2, 0x0840), INTCS_VECT(RTDMAC1_1_DEI3, 0x0860),
422 INTCS_VECT(CEU, 0x0880),
423 INTCS_VECT(BEU_BEU0, 0x08A0),
424 INTCS_VECT(BEU_BEU1, 0x08C0),
425 INTCS_VECT(BEU_BEU2, 0x08E0),
426 __IGNORE(INTCS_VECT(MFI, 0x0900))
427 __IGNORE(INTCS_VECT(BBIF2, 0x0960))
428 INTCS_VECT(VPU, 0x0980),
429 INTCS_VECT(TSIF1, 0x09A0),
430 __IGNORE(INTCS_VECT(SGX540, 0x09E0))
431 INTCS_VECT(_2DDMAC, 0x0A00),
432 INTCS_VECT(IIC2_ALI2, 0x0A80), INTCS_VECT(IIC2_TACKI2, 0x0AA0),
433 INTCS_VECT(IIC2_WAITI2, 0x0AC0), INTCS_VECT(IIC2_DTEI2, 0x0AE0),
434 INTCS_VECT(IPMMU_IPMMUR, 0x0B00), INTCS_VECT(IPMMU_IPMMUR2, 0x0B20),
435 INTCS_VECT(RTDMAC1_2_DEI4, 0x0B80),
436 INTCS_VECT(RTDMAC1_2_DEI5, 0x0BA0),
437 INTCS_VECT(RTDMAC1_2_DADERR, 0x0BC0),
438 __IGNORE(INTCS_VECT(KEYSC 0x0BE0))
439 __IGNORE(INTCS_VECT(TTI20, 0x0C80))
440 __IGNORE(INTCS_VECT(MSIOF, 0x0D20))
441 INTCS_VECT(IIC0_ALI0, 0x0E00), INTCS_VECT(IIC0_TACKI0, 0x0E20),
442 INTCS_VECT(IIC0_WAITI0, 0x0E40), INTCS_VECT(IIC0_DTEI0, 0x0E60),
443 INTCS_VECT(TMU_TUNI0, 0x0E80),
444 INTCS_VECT(TMU_TUNI1, 0x0EA0),
445 INTCS_VECT(TMU_TUNI2, 0x0EC0),
446 INTCS_VECT(CMT0, 0x0F00),
447 INTCS_VECT(TSIF0, 0x0F20),
448 __IGNORE(INTCS_VECT(CMT2, 0x0F40))
449 INTCS_VECT(LMB, 0x0F60),
450 __IGNORE(INTCS_VECT(MSUG, 0x0F80))
451 __IGNORE(INTCS_VECT(MSU_MSU, 0x0FA0))
452 __IGNORE(INTCS_VECT(MSU_MSU2, 0x0FC0))
453 __IGNORE(INTCS_VECT(CTI, 0x0400))
454 INTCS_VECT(MVI3, 0x0420),
455 __IGNORE(INTCS_VECT(RWDT0, 0x0440))
456 __IGNORE(INTCS_VECT(RWDT1, 0x0460))
457 INTCS_VECT(ICB, 0x0480),
458 INTCS_VECT(PEP, 0x04A0),
459 INTCS_VECT(ASA, 0x04C0),
460 __IGNORE(INTCS_VECT(_2DG, 0x04E0))
461 INTCS_VECT(HQE, 0x0540),
462 INTCS_VECT(JPU, 0x0560),
463 INTCS_VECT(LCDC0, 0x0580),
464 __IGNORE(INTCS_VECT(LCRC, 0x05A0))
465 INTCS_VECT(RTDMAC2_1_DEI0, 0x1300), INTCS_VECT(RTDMAC2_1_DEI1, 0x1320),
466 INTCS_VECT(RTDMAC2_1_DEI2, 0x1340), INTCS_VECT(RTDMAC2_1_DEI3, 0x1360),
467 INTCS_VECT(RTDMAC2_2_DEI4, 0x1380), INTCS_VECT(RTDMAC2_2_DEI5, 0x13A0),
468 INTCS_VECT(RTDMAC2_2_DADERR, 0x13C0),
469 INTCS_VECT(FRC, 0x1700),
470 INTCS_VECT(LCDC1, 0x1780),
471 INTCS_VECT(CSIRX, 0x17A0),
472 INTCS_VECT(DSITX_DSITX0, 0x17C0), INTCS_VECT(DSITX_DSITX1, 0x17E0),
473 __IGNORE(INTCS_VECT(SPU2_SPU0, 0x1800))
474 __IGNORE(INTCS_VECT(SPU2_SPU1, 0x1820))
475 __IGNORE(INTCS_VECT(FSI, 0x1840))
476 __IGNORE(INTCS_VECT(FMSI, 0x1860))
477 __IGNORE(INTCS_VECT(SCUV, 0x1880))
478 INTCS_VECT(TMU1_TUNI10, 0x1900), INTCS_VECT(TMU1_TUNI11, 0x1920),
479 INTCS_VECT(TMU1_TUNI12, 0x1940),
480 INTCS_VECT(TSIF2, 0x1960),
481 INTCS_VECT(CMT4, 0x1980),
482 __IGNORE(INTCS_VECT(MFIS2, 0x1A00))
483 INTCS_VECT(CPORTS2R, 0x1A20),
484
485 INTC_VECT(INTCS, INTCS_INTVECT),
486};
487
488static struct intc_group intcs_groups[] __initdata = {
489 INTC_GROUP(RTDMAC1_1,
490 RTDMAC1_1_DEI0, RTDMAC1_1_DEI1,
491 RTDMAC1_1_DEI2, RTDMAC1_1_DEI3),
492 INTC_GROUP(RTDMAC1_2,
493 RTDMAC1_2_DEI4, RTDMAC1_2_DEI5, RTDMAC1_2_DADERR),
494 INTC_GROUP(VEU, VEU_VEU0, VEU_VEU1, VEU_VEU2, VEU_VEU3),
495 INTC_GROUP(BEU, BEU_BEU0, BEU_BEU1, BEU_BEU2),
496 INTC_GROUP(IIC0, IIC0_ALI0, IIC0_TACKI0, IIC0_WAITI0, IIC0_DTEI0),
497 __IGNORE(INTC_GROUP(MSU, MSU_MSU, MSU_MSU2))
498 INTC_GROUP(IPMMU, IPMMU_IPMMUR, IPMMU_IPMMUR2),
499 INTC_GROUP(IIC2, IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2),
500 INTC_GROUP(RTDMAC2_1,
501 RTDMAC2_1_DEI0, RTDMAC2_1_DEI1,
502 RTDMAC2_1_DEI2, RTDMAC2_1_DEI3),
503 INTC_GROUP(RTDMAC2_2, RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR),
504 INTC_GROUP(DSITX, DSITX_DSITX0, DSITX_DSITX1),
505 __IGNORE(INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1))
506 INTC_GROUP(TMU1, TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12),
507};
508
509static struct intc_mask_reg intcs_mask_registers[] __initdata = {
510 { 0xE6940184, 0xE69401C4, 8, /* IMR1AS / IMCR1AS */
511 { BEU_BEU2, BEU_BEU1, BEU_BEU0, CEU,
512 VEU_VEU3, VEU_VEU2, VEU_VEU1, VEU_VEU0 } },
513 { 0xE6940188, 0xE69401C8, 8, /* IMR2AS / IMCR2AS */
514 { 0, 0, 0, VPU,
515 __IGNORE0(BBIF2), 0, 0, __IGNORE0(MFI) } },
516 { 0xE694018C, 0xE69401CC, 8, /* IMR3AS / IMCR3AS */
517 { 0, 0, 0, _2DDMAC,
518 __IGNORE0(_2DG), ASA, PEP, ICB } },
519 { 0xE6940190, 0xE69401D0, 8, /* IMR4AS / IMCR4AS */
520 { 0, 0, MVI3, __IGNORE0(CTI),
521 JPU, HQE, __IGNORE0(LCRC), LCDC0 } },
522 { 0xE6940194, 0xE69401D4, 8, /* IMR5AS / IMCR5AS */
523 { __IGNORE0(KEYSC), RTDMAC1_2_DADERR, RTDMAC1_2_DEI5, RTDMAC1_2_DEI4,
524 RTDMAC1_1_DEI3, RTDMAC1_1_DEI2, RTDMAC1_1_DEI1, RTDMAC1_1_DEI0 } },
525 __IGNORE({ 0xE6940198, 0xE69401D8, 8, /* IMR6AS / IMCR6AS */
526 { 0, 0, MSIOF, 0,
527 SGX540, 0, TTI20, 0 } })
528 { 0xE694019C, 0xE69401DC, 8, /* IMR7AS / IMCR7AS */
529 { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0,
530 0, 0, 0, 0 } },
531 __IGNORE({ 0xE69401A0, 0xE69401E0, 8, /* IMR8AS / IMCR8AS */
532 { 0, 0, 0, 0,
533 0, MSU_MSU, MSU_MSU2, MSUG } })
534 { 0xE69401A4, 0xE69401E4, 8, /* IMR9AS / IMCR9AS */
535 { __IGNORE0(RWDT1), __IGNORE0(RWDT0), __IGNORE0(CMT2), CMT0,
536 IIC2_DTEI2, IIC2_WAITI2, IIC2_TACKI2, IIC2_ALI2 } },
537 { 0xE69401A8, 0xE69401E8, 8, /* IMR10AS / IMCR10AS */
538 { 0, 0, IPMMU_IPMMUR, IPMMU_IPMMUR2,
539 0, 0, 0, 0 } },
540 { 0xE69401AC, 0xE69401EC, 8, /* IMR11AS / IMCR11AS */
541 { IIC0_DTEI0, IIC0_WAITI0, IIC0_TACKI0, IIC0_ALI0,
542 0, TSIF1, LMB, TSIF0 } },
543 { 0xE6950180, 0xE69501C0, 8, /* IMR0AS3 / IMCR0AS3 */
544 { RTDMAC2_1_DEI0, RTDMAC2_1_DEI1, RTDMAC2_1_DEI2, RTDMAC2_1_DEI3,
545 RTDMAC2_2_DEI4, RTDMAC2_2_DEI5, RTDMAC2_2_DADERR, 0 } },
546 { 0xE6950190, 0xE69501D0, 8, /* IMR4AS3 / IMCR4AS3 */
547 { FRC, 0, 0, 0,
548 LCDC1, CSIRX, DSITX_DSITX0, DSITX_DSITX1 } },
549 __IGNORE({ 0xE6950194, 0xE69501D4, 8, /* IMR5AS3 / IMCR5AS3 */
550 {SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
551 SCUV, 0, 0, 0 } })
552 { 0xE6950198, 0xE69501D8, 8, /* IMR6AS3 / IMCR6AS3 */
553 { TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12, TSIF2,
554 CMT4, 0, 0, 0 } },
555 { 0xE695019C, 0xE69501DC, 8, /* IMR7AS3 / IMCR7AS3 */
556 { __IGNORE0(MFIS2), CPORTS2R, 0, 0,
557 0, 0, 0, 0 } },
558 { 0xFFD20104, 0, 16, /* INTAMASK */
559 { 0, 0, 0, 0, 0, 0, 0, 0,
560 0, 0, 0, 0, 0, 0, 0, INTCS } }
561};
562
563static struct intc_prio_reg intcs_prio_registers[] __initdata = {
564 /* IPRAS */
565 { 0xFFD20000, 0, 16, 4, { __IGNORE0(CTI), MVI3, _2DDMAC, ICB } },
566 /* IPRBS */
567 { 0xFFD20004, 0, 16, 4, { JPU, LCDC0, 0, __IGNORE0(LCRC) } },
568 /* IPRCS */
569 __IGNORE({ 0xFFD20008, 0, 16, 4, { BBIF2, 0, 0, 0 } })
570 /* IPRES */
571 { 0xFFD20010, 0, 16, 4, { RTDMAC1_1, CEU, __IGNORE0(MFI), VPU } },
572 /* IPRFS */
573 { 0xFFD20014, 0, 16, 4,
574 { __IGNORE0(KEYSC), RTDMAC1_2, __IGNORE0(CMT2), CMT0 } },
575 /* IPRGS */
576 { 0xFFD20018, 0, 16, 4, { TMU_TUNI0, TMU_TUNI1, TMU_TUNI2, TSIF1 } },
577 /* IPRHS */
578 { 0xFFD2001C, 0, 16, 4, { __IGNORE0(TTI20), 0, VEU, BEU } },
579 /* IPRIS */
580 { 0xFFD20020, 0, 16, 4, { 0, __IGNORE0(MSIOF), TSIF0, IIC0 } },
581 /* IPRJS */
582 __IGNORE({ 0xFFD20024, 0, 16, 4, { 0, SGX540, MSUG, MSU } })
583 /* IPRKS */
584 { 0xFFD20028, 0, 16, 4, { __IGNORE0(_2DG), ASA, LMB, PEP } },
585 /* IPRLS */
586 { 0xFFD2002C, 0, 16, 4, { IPMMU, 0, 0, HQE } },
587 /* IPRMS */
588 { 0xFFD20030, 0, 16, 4,
589 { IIC2, 0, __IGNORE0(RWDT1), __IGNORE0(RWDT0) } },
590 /* IPRAS3 */
591 { 0xFFD50000, 0, 16, 4, { RTDMAC2_1, 0, 0, 0 } },
592 /* IPRBS3 */
593 { 0xFFD50004, 0, 16, 4, { RTDMAC2_2, 0, 0, 0 } },
594 /* IPRIS3 */
595 { 0xFFD50020, 0, 16, 4, { FRC, 0, 0, 0 } },
596 /* IPRJS3 */
597 { 0xFFD50024, 0, 16, 4, { LCDC1, CSIRX, DSITX, 0 } },
598 /* IPRKS3 */
599 __IGNORE({ 0xFFD50028, 0, 16, 4, { SPU2, 0, FSI, FMSI } })
600 /* IPRLS3 */
601 __IGNORE({ 0xFFD5002C, 0, 16, 4, { SCUV, 0, 0, 0 } })
602 /* IPRMS3 */
603 { 0xFFD50030, 0, 16, 4, { TMU1, 0, 0, TSIF2 } },
604 /* IPRNS3 */
605 { 0xFFD50034, 0, 16, 4, { CMT4, 0, 0, 0 } },
606 /* IPROS3 */
607 { 0xFFD50038, 0, 16, 4, { __IGNORE0(MFIS2), CPORTS2R, 0, 0 } },
608};
609
610static struct resource intcs_resources[] __initdata = {
611 [0] = {
612 .start = 0xffd20000,
613 .end = 0xffd500ff,
614 .flags = IORESOURCE_MEM,
615 }
616};
617
618static struct intc_desc intcs_desc __initdata = {
619 .name = "sh7377-intcs",
620 .resource = intcs_resources,
621 .num_resources = ARRAY_SIZE(intcs_resources),
622 .hw = INTC_HW_DESC(intcs_vectors, intcs_groups,
623 intcs_mask_registers, intcs_prio_registers,
624 NULL, NULL),
625};
626
627static void intcs_demux(unsigned int irq, struct irq_desc *desc)
628{
629 void __iomem *reg = (void *)get_irq_data(irq);
630 unsigned int evtcodeas = ioread32(reg);
631
632 generic_handle_irq(intcs_evt2irq(evtcodeas));
633}
634
635#define INTEVTSA 0xFFD20100
636void __init sh7377_init_irq(void)
637{
638 void __iomem *intevtsa = ioremap_nocache(INTEVTSA, PAGE_SIZE);
639
640 register_intc_controller(&intca_desc);
641 register_intc_controller(&intcs_desc);
642
643 /* demux using INTEVTSA */
644 set_irq_data(evt2irq(INTCS_INTVECT), (void *)intevtsa);
645 set_irq_chained_handler(evt2irq(INTCS_INTVECT), intcs_demux);
646}
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
new file mode 100644
index 000000000000..322d8d57cbcf
--- /dev/null
+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
@@ -0,0 +1,267 @@
1/*
2 * sh73a0 processor support - INTC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/io.h>
24#include <linux/sh_intc.h>
25#include <asm/hardware/gic.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28
29enum {
30 UNUSED = 0,
31
32 /* interrupt sources INTCS */
33 PINTCS_PINT1, PINTCS_PINT2,
34 RTDMAC_0_DEI0, RTDMAC_0_DEI1, RTDMAC_0_DEI2, RTDMAC_0_DEI3,
35 CEU, MFI, BBIF2, VPU, TSIF1, _3DG_SGX543, _2DDMAC_2DDM0,
36 RTDMAC_1_DEI4, RTDMAC_1_DEI5, RTDMAC_1_DADERR,
37 KEYSC_KEY, VINT, MSIOF,
38 TMU0_TUNI00, TMU0_TUNI01, TMU0_TUNI02,
39 CMT0, TSIF0, CMT2, LMB, MSUG, MSU_MSU, MSU_MSU2,
40 CTI, RWDT0, ICB, PEP, ASA, JPU_JPEG, LCDC, LCRC,
41 RTDMAC_2_DEI6, RTDMAC_2_DEI7, RTDMAC_2_DEI8, RTDMAC_2_DEI9,
42 RTDMAC_3_DEI10, RTDMAC_3_DEI11,
43 FRC, GCU, LCDC1, CSIRX,
44 DSITX0_DSITX00, DSITX0_DSITX01,
45 SPU2_SPU0, SPU2_SPU1, FSI,
46 TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12,
47 TSIF2, CMT4, MFIS2, CPORTS2R, TSG, DMASCH1, SCUW,
48 VIO60, VIO61, CEU21, CSI21, DSITX1_DSITX10, DSITX1_DSITX11,
49 DISP, DSRV, EMUX2_EMUX20I, EMUX2_EMUX21I,
50 MSTIF0_MST00I, MSTIF0_MST01I, MSTIF1_MST10I, MSTIF1_MST11I,
51 SPUV,
52
53 /* interrupt groups INTCS */
54 RTDMAC_0, RTDMAC_1, RTDMAC_2, RTDMAC_3,
55 DSITX0, SPU2, TMU1, MSU,
56};
57
58static struct intc_vect intcs_vectors[] = {
59 INTCS_VECT(PINTCS_PINT1, 0x0600), INTCS_VECT(PINTCS_PINT2, 0x0620),
60 INTCS_VECT(RTDMAC_0_DEI0, 0x0800), INTCS_VECT(RTDMAC_0_DEI1, 0x0820),
61 INTCS_VECT(RTDMAC_0_DEI2, 0x0840), INTCS_VECT(RTDMAC_0_DEI3, 0x0860),
62 INTCS_VECT(CEU, 0x0880), INTCS_VECT(MFI, 0x0900),
63 INTCS_VECT(BBIF2, 0x0960), INTCS_VECT(VPU, 0x0980),
64 INTCS_VECT(TSIF1, 0x09a0), INTCS_VECT(_3DG_SGX543, 0x09e0),
65 INTCS_VECT(_2DDMAC_2DDM0, 0x0a00),
66 INTCS_VECT(RTDMAC_1_DEI4, 0x0b80), INTCS_VECT(RTDMAC_1_DEI5, 0x0ba0),
67 INTCS_VECT(RTDMAC_1_DADERR, 0x0bc0),
68 INTCS_VECT(KEYSC_KEY, 0x0be0), INTCS_VECT(VINT, 0x0c80),
69 INTCS_VECT(MSIOF, 0x0d20),
70 INTCS_VECT(TMU0_TUNI00, 0x0e80), INTCS_VECT(TMU0_TUNI01, 0x0ea0),
71 INTCS_VECT(TMU0_TUNI02, 0x0ec0),
72 INTCS_VECT(CMT0, 0x0f00), INTCS_VECT(TSIF0, 0x0f20),
73 INTCS_VECT(CMT2, 0x0f40), INTCS_VECT(LMB, 0x0f60),
74 INTCS_VECT(MSUG, 0x0f80),
75 INTCS_VECT(MSU_MSU, 0x0fa0), INTCS_VECT(MSU_MSU2, 0x0fc0),
76 INTCS_VECT(CTI, 0x0400), INTCS_VECT(RWDT0, 0x0440),
77 INTCS_VECT(ICB, 0x0480), INTCS_VECT(PEP, 0x04a0),
78 INTCS_VECT(ASA, 0x04c0), INTCS_VECT(JPU_JPEG, 0x0560),
79 INTCS_VECT(LCDC, 0x0580), INTCS_VECT(LCRC, 0x05a0),
80 INTCS_VECT(RTDMAC_2_DEI6, 0x1300), INTCS_VECT(RTDMAC_2_DEI7, 0x1320),
81 INTCS_VECT(RTDMAC_2_DEI8, 0x1340), INTCS_VECT(RTDMAC_2_DEI9, 0x1360),
82 INTCS_VECT(RTDMAC_3_DEI10, 0x1380), INTCS_VECT(RTDMAC_3_DEI11, 0x13a0),
83 INTCS_VECT(FRC, 0x1700), INTCS_VECT(GCU, 0x1760),
84 INTCS_VECT(LCDC1, 0x1780), INTCS_VECT(CSIRX, 0x17a0),
85 INTCS_VECT(DSITX0_DSITX00, 0x17c0), INTCS_VECT(DSITX0_DSITX01, 0x17e0),
86 INTCS_VECT(SPU2_SPU0, 0x1800), INTCS_VECT(SPU2_SPU1, 0x1820),
87 INTCS_VECT(FSI, 0x1840),
88 INTCS_VECT(TMU1_TUNI10, 0x1900), INTCS_VECT(TMU1_TUNI11, 0x1920),
89 INTCS_VECT(TMU1_TUNI12, 0x1940),
90 INTCS_VECT(TSIF2, 0x1960), INTCS_VECT(CMT4, 0x1980),
91 INTCS_VECT(MFIS2, 0x1a00), INTCS_VECT(CPORTS2R, 0x1a20),
92 INTCS_VECT(TSG, 0x1ae0), INTCS_VECT(DMASCH1, 0x1b00),
93 INTCS_VECT(SCUW, 0x1b40),
94 INTCS_VECT(VIO60, 0x1b60), INTCS_VECT(VIO61, 0x1b80),
95 INTCS_VECT(CEU21, 0x1ba0), INTCS_VECT(CSI21, 0x1be0),
96 INTCS_VECT(DSITX1_DSITX10, 0x1c00), INTCS_VECT(DSITX1_DSITX11, 0x1c20),
97 INTCS_VECT(DISP, 0x1c40), INTCS_VECT(DSRV, 0x1c60),
98 INTCS_VECT(EMUX2_EMUX20I, 0x1c80), INTCS_VECT(EMUX2_EMUX21I, 0x1ca0),
99 INTCS_VECT(MSTIF0_MST00I, 0x1cc0), INTCS_VECT(MSTIF0_MST01I, 0x1ce0),
100 INTCS_VECT(MSTIF1_MST10I, 0x1d00), INTCS_VECT(MSTIF1_MST11I, 0x1d20),
101 INTCS_VECT(SPUV, 0x2300),
102};
103
104static struct intc_group intcs_groups[] __initdata = {
105 INTC_GROUP(RTDMAC_0, RTDMAC_0_DEI0, RTDMAC_0_DEI1,
106 RTDMAC_0_DEI2, RTDMAC_0_DEI3),
107 INTC_GROUP(RTDMAC_1, RTDMAC_1_DEI4, RTDMAC_1_DEI5, RTDMAC_1_DADERR),
108 INTC_GROUP(RTDMAC_2, RTDMAC_2_DEI6, RTDMAC_2_DEI7,
109 RTDMAC_2_DEI8, RTDMAC_2_DEI9),
110 INTC_GROUP(RTDMAC_3, RTDMAC_3_DEI10, RTDMAC_3_DEI11),
111 INTC_GROUP(TMU1, TMU1_TUNI12, TMU1_TUNI11, TMU1_TUNI10),
112 INTC_GROUP(DSITX0, DSITX0_DSITX00, DSITX0_DSITX01),
113 INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1),
114 INTC_GROUP(MSU, MSU_MSU, MSU_MSU2),
115};
116
117static struct intc_mask_reg intcs_mask_registers[] = {
118 { 0xffd20184, 0xffd201c4, 8, /* IMR1SA / IMCR1SA */
119 { 0, 0, 0, CEU,
120 0, 0, 0, 0 } },
121 { 0xffd20188, 0xffd201c8, 8, /* IMR2SA / IMCR2SA */
122 { 0, 0, 0, VPU,
123 BBIF2, 0, 0, MFI } },
124 { 0xffd2018c, 0xffd201cc, 8, /* IMR3SA / IMCR3SA */
125 { 0, 0, 0, _2DDMAC_2DDM0,
126 0, ASA, PEP, ICB } },
127 { 0xffd20190, 0xffd201d0, 8, /* IMR4SA / IMCR4SA */
128 { 0, 0, 0, CTI,
129 JPU_JPEG, 0, LCRC, LCDC } },
130 { 0xffd20194, 0xffd201d4, 8, /* IMR5SA / IMCR5SA */
131 { KEYSC_KEY, RTDMAC_1_DADERR, RTDMAC_1_DEI5, RTDMAC_1_DEI4,
132 RTDMAC_0_DEI3, RTDMAC_0_DEI2, RTDMAC_0_DEI1, RTDMAC_0_DEI0 } },
133 { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */
134 { 0, 0, MSIOF, 0,
135 _3DG_SGX543, 0, 0, 0 } },
136 { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */
137 { 0, TMU0_TUNI02, TMU0_TUNI01, TMU0_TUNI00,
138 0, 0, 0, 0 } },
139 { 0xffd201a0, 0xffd201e0, 8, /* IMR8SA / IMCR8SA */
140 { 0, 0, 0, 0,
141 0, MSU_MSU, MSU_MSU2, MSUG } },
142 { 0xffd201a4, 0xffd201e4, 8, /* IMR9SA / IMCR9SA */
143 { 0, RWDT0, CMT2, CMT0,
144 0, 0, 0, 0 } },
145 { 0xffd201ac, 0xffd201ec, 8, /* IMR11SA / IMCR11SA */
146 { 0, 0, 0, 0,
147 0, TSIF1, LMB, TSIF0 } },
148 { 0xffd201b0, 0xffd201f0, 8, /* IMR12SA / IMCR12SA */
149 { 0, 0, 0, 0,
150 0, 0, PINTCS_PINT2, PINTCS_PINT1 } },
151 { 0xffd50180, 0xffd501c0, 8, /* IMR0SA3 / IMCR0SA3 */
152 { RTDMAC_2_DEI6, RTDMAC_2_DEI7, RTDMAC_2_DEI8, RTDMAC_2_DEI9,
153 RTDMAC_3_DEI10, RTDMAC_3_DEI11, 0, 0 } },
154 { 0xffd50190, 0xffd501d0, 8, /* IMR4SA3 / IMCR4SA3 */
155 { FRC, 0, 0, GCU,
156 LCDC1, CSIRX, DSITX0_DSITX00, DSITX0_DSITX01 } },
157 { 0xffd50194, 0xffd501d4, 8, /* IMR5SA3 / IMCR5SA3 */
158 { SPU2_SPU0, SPU2_SPU1, FSI, 0,
159 0, 0, 0, 0 } },
160 { 0xffd50198, 0xffd501d8, 8, /* IMR6SA3 / IMCR6SA3 */
161 { TMU1_TUNI10, TMU1_TUNI11, TMU1_TUNI12, 0,
162 TSIF2, CMT4, 0, 0 } },
163 { 0xffd5019c, 0xffd501dc, 8, /* IMR7SA3 / IMCR7SA3 */
164 { MFIS2, CPORTS2R, 0, 0,
165 0, 0, 0, TSG } },
166 { 0xffd501a0, 0xffd501e0, 8, /* IMR8SA3 / IMCR8SA3 */
167 { DMASCH1, 0, SCUW, VIO60,
168 VIO61, CEU21, 0, CSI21 } },
169 { 0xffd501a4, 0xffd501e4, 8, /* IMR9SA3 / IMCR9SA3 */
170 { DSITX1_DSITX10, DSITX1_DSITX11, DISP, DSRV,
171 EMUX2_EMUX20I, EMUX2_EMUX21I, MSTIF0_MST00I, MSTIF0_MST01I } },
172 { 0xffd501a8, 0xffd501e8, 8, /* IMR10SA3 / IMCR10SA3 */
173 { MSTIF0_MST00I, MSTIF0_MST01I, 0, 0,
174 0, 0, 0, 0 } },
175 { 0xffd60180, 0xffd601c0, 8, /* IMR0SA4 / IMCR0SA4 */
176 { SPUV, 0, 0, 0,
177 0, 0, 0, 0 } },
178};
179
180/* Priority is needed for INTCA to receive the INTCS interrupt */
181static struct intc_prio_reg intcs_prio_registers[] = {
182 { 0xffd20000, 0, 16, 4, /* IPRAS */ { CTI, 0, _2DDMAC_2DDM0, ICB } },
183 { 0xffd20004, 0, 16, 4, /* IPRBS */ { JPU_JPEG, LCDC, 0, LCRC } },
184 { 0xffd20008, 0, 16, 4, /* IPRCS */ { BBIF2, 0, 0, 0 } },
185 { 0xffd2000c, 0, 16, 4, /* IPRDS */ { PINTCS_PINT1, PINTCS_PINT2,
186 0, 0 } },
187 { 0xffd20010, 0, 16, 4, /* IPRES */ { RTDMAC_0, CEU, MFI, VPU } },
188 { 0xffd20014, 0, 16, 4, /* IPRFS */ { KEYSC_KEY, RTDMAC_1,
189 CMT2, CMT0 } },
190 { 0xffd20018, 0, 16, 4, /* IPRGS */ { TMU0_TUNI00, TMU0_TUNI01,
191 TMU0_TUNI02, TSIF1 } },
192 { 0xffd2001c, 0, 16, 4, /* IPRHS */ { VINT, 0, 0, 0 } },
193 { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, 0 } },
194 { 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, _3DG_SGX543, MSUG, MSU } },
195 { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, ASA, LMB, PEP } },
196 { 0xffd20030, 0, 16, 4, /* IPRMS */ { 0, 0, 0, RWDT0 } },
197 { 0xffd50000, 0, 16, 4, /* IPRAS3 */ { RTDMAC_2, 0, 0, 0 } },
198 { 0xffd50004, 0, 16, 4, /* IPRBS3 */ { RTDMAC_3, 0, 0, 0 } },
199 { 0xffd50020, 0, 16, 4, /* IPRIS3 */ { FRC, 0, 0, 0 } },
200 { 0xffd50024, 0, 16, 4, /* IPRJS3 */ { LCDC1, CSIRX, DSITX0, 0 } },
201 { 0xffd50028, 0, 16, 4, /* IPRKS3 */ { SPU2, 0, FSI, 0 } },
202 { 0xffd50030, 0, 16, 4, /* IPRMS3 */ { TMU1, 0, 0, TSIF2 } },
203 { 0xffd50034, 0, 16, 4, /* IPRNS3 */ { CMT4, 0, 0, 0 } },
204 { 0xffd50038, 0, 16, 4, /* IPROS3 */ { MFIS2, CPORTS2R, 0, 0 } },
205 { 0xffd50040, 0, 16, 4, /* IPRQS3 */ { DMASCH1, 0, SCUW, VIO60 } },
206 { 0xffd50044, 0, 16, 4, /* IPRRS3 */ { VIO61, CEU21, 0, CSI21 } },
207 { 0xffd50048, 0, 16, 4, /* IPRSS3 */ { DSITX1_DSITX10, DSITX1_DSITX11,
208 DISP, DSRV } },
209 { 0xffd5004c, 0, 16, 4, /* IPRTS3 */ { EMUX2_EMUX20I, EMUX2_EMUX21I,
210 MSTIF0_MST00I, MSTIF0_MST01I } },
211 { 0xffd50050, 0, 16, 4, /* IPRUS3 */ { MSTIF1_MST10I, MSTIF1_MST11I,
212 0, 0 } },
213 { 0xffd60000, 0, 16, 4, /* IPRAS4 */ { SPUV, 0, 0, 0 } },
214};
215
216static struct resource intcs_resources[] __initdata = {
217 [0] = {
218 .start = 0xffd20000,
219 .end = 0xffd201ff,
220 .flags = IORESOURCE_MEM,
221 },
222 [1] = {
223 .start = 0xffd50000,
224 .end = 0xffd501ff,
225 .flags = IORESOURCE_MEM,
226 },
227 [2] = {
228 .start = 0xffd60000,
229 .end = 0xffd601ff,
230 .flags = IORESOURCE_MEM,
231 }
232};
233
234static struct intc_desc intcs_desc __initdata = {
235 .name = "sh73a0-intcs",
236 .resource = intcs_resources,
237 .num_resources = ARRAY_SIZE(intcs_resources),
238 .hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
239 intcs_prio_registers, NULL, NULL),
240};
241
242static struct irqaction sh73a0_intcs_cascade;
243
244static irqreturn_t sh73a0_intcs_demux(int irq, void *dev_id)
245{
246 unsigned int evtcodeas = ioread32((void __iomem *)dev_id);
247
248 generic_handle_irq(intcs_evt2irq(evtcodeas));
249
250 return IRQ_HANDLED;
251}
252
253void __init sh73a0_init_irq(void)
254{
255 void __iomem *gic_base = __io(0xf0001000);
256 void __iomem *intevtsa = ioremap_nocache(0xffd20100, PAGE_SIZE);
257
258 gic_init(0, 29, gic_base, gic_base);
259
260 register_intc_controller(&intcs_desc);
261
262 /* demux using INTEVTSA */
263 sh73a0_intcs_cascade.name = "INTCS cascade";
264 sh73a0_intcs_cascade.handler = sh73a0_intcs_demux;
265 sh73a0_intcs_cascade.dev_id = intevtsa;
266 setup_irq(gic_spi(50), &sh73a0_intcs_cascade);
267}
diff --git a/arch/arm/mach-shmobile/localtimer.c b/arch/arm/mach-shmobile/localtimer.c
new file mode 100644
index 000000000000..2111c28b724e
--- /dev/null
+++ b/arch/arm/mach-shmobile/localtimer.c
@@ -0,0 +1,25 @@
1/*
2 * SMP support for R-Mobile / SH-Mobile - local timer portion
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#include <linux/init.h>
13#include <linux/smp.h>
14#include <linux/clockchips.h>
15#include <asm/smp_twd.h>
16#include <asm/localtimer.h>
17
18/*
19 * Setup the local clock events for a CPU.
20 */
21void __cpuinit local_timer_setup(struct clock_event_device *evt)
22{
23 evt->irq = 29;
24 twd_timer_setup(evt);
25}
diff --git a/arch/arm/mach-shmobile/pfc-sh7367.c b/arch/arm/mach-shmobile/pfc-sh7367.c
new file mode 100644
index 000000000000..128555e76e43
--- /dev/null
+++ b/arch/arm/mach-shmobile/pfc-sh7367.c
@@ -0,0 +1,1801 @@
1/*
2 * sh7367 processor support - PFC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/gpio.h>
22#include <mach/sh7367.h>
23
24#define _1(fn, pfx, sfx) fn(pfx, sfx)
25
26#define _10(fn, pfx, sfx) \
27 _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
28 _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
29 _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
30 _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
31 _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
32
33#define _90(fn, pfx, sfx) \
34 _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \
35 _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \
36 _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \
37 _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx), \
38 _10(fn, pfx##9, sfx)
39
40#define _273(fn, pfx, sfx) \
41 _10(fn, pfx, sfx), _90(fn, pfx, sfx), \
42 _10(fn, pfx##10, sfx), _90(fn, pfx##1, sfx), \
43 _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \
44 _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \
45 _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \
46 _10(fn, pfx##26, sfx), _1(fn, pfx##270, sfx), \
47 _1(fn, pfx##271, sfx), _1(fn, pfx##272, sfx)
48
49#define _PORT(pfx, sfx) pfx##_##sfx
50#define PORT_273(str) _273(_PORT, PORT, str)
51
52enum {
53 PINMUX_RESERVED = 0,
54
55 PINMUX_DATA_BEGIN,
56 PORT_273(DATA), /* PORT0_DATA -> PORT272_DATA */
57 PINMUX_DATA_END,
58
59 PINMUX_INPUT_BEGIN,
60 PORT_273(IN), /* PORT0_IN -> PORT272_IN */
61 PINMUX_INPUT_END,
62
63 PINMUX_INPUT_PULLUP_BEGIN,
64 PORT_273(IN_PU), /* PORT0_IN_PU -> PORT272_IN_PU */
65 PINMUX_INPUT_PULLUP_END,
66
67 PINMUX_INPUT_PULLDOWN_BEGIN,
68 PORT_273(IN_PD), /* PORT0_IN_PD -> PORT272_IN_PD */
69 PINMUX_INPUT_PULLDOWN_END,
70
71 PINMUX_OUTPUT_BEGIN,
72 PORT_273(OUT), /* PORT0_OUT -> PORT272_OUT */
73 PINMUX_OUTPUT_END,
74
75 PINMUX_FUNCTION_BEGIN,
76 PORT_273(FN_IN), /* PORT0_FN_IN -> PORT272_FN_IN */
77 PORT_273(FN_OUT), /* PORT0_FN_OUT -> PORT272_FN_OUT */
78 PORT_273(FN0), /* PORT0_FN0 -> PORT272_FN0 */
79 PORT_273(FN1), /* PORT0_FN1 -> PORT272_FN1 */
80 PORT_273(FN2), /* PORT0_FN2 -> PORT272_FN2 */
81 PORT_273(FN3), /* PORT0_FN3 -> PORT272_FN3 */
82 PORT_273(FN4), /* PORT0_FN4 -> PORT272_FN4 */
83 PORT_273(FN5), /* PORT0_FN5 -> PORT272_FN5 */
84 PORT_273(FN6), /* PORT0_FN6 -> PORT272_FN6 */
85 PORT_273(FN7), /* PORT0_FN7 -> PORT272_FN7 */
86
87 MSELBCR_MSEL2_1, MSELBCR_MSEL2_0,
88 PINMUX_FUNCTION_END,
89
90 PINMUX_MARK_BEGIN,
91 /* Special Pull-up / Pull-down Functions */
92 PORT48_KEYIN0_PU_MARK, PORT49_KEYIN1_PU_MARK,
93 PORT50_KEYIN2_PU_MARK, PORT55_KEYIN3_PU_MARK,
94 PORT56_KEYIN4_PU_MARK, PORT57_KEYIN5_PU_MARK,
95 PORT58_KEYIN6_PU_MARK,
96
97 /* 49-1 */
98 VBUS0_MARK, CPORT0_MARK, CPORT1_MARK, CPORT2_MARK,
99 CPORT3_MARK, CPORT4_MARK, CPORT5_MARK, CPORT6_MARK,
100 CPORT7_MARK, CPORT8_MARK, CPORT9_MARK, CPORT10_MARK,
101 CPORT11_MARK, SIN2_MARK, CPORT12_MARK, XCTS2_MARK,
102 CPORT13_MARK, RFSPO4_MARK, CPORT14_MARK, RFSPO5_MARK,
103 CPORT15_MARK, CPORT16_MARK, CPORT17_MARK, SOUT2_MARK,
104 CPORT18_MARK, XRTS2_MARK, CPORT19_MARK, CPORT20_MARK,
105 RFSPO6_MARK, CPORT21_MARK, STATUS0_MARK, CPORT22_MARK,
106 STATUS1_MARK, CPORT23_MARK, STATUS2_MARK, RFSPO7_MARK,
107 MPORT0_MARK, MPORT1_MARK, B_SYNLD1_MARK, B_SYNLD2_MARK,
108 XMAINPS_MARK, XDIVPS_MARK, XIDRST_MARK, IDCLK_MARK,
109 IDIO_MARK, SOUT1_MARK, SCIFA4_TXD_MARK,
110 M02_BERDAT_MARK, SIN1_MARK, SCIFA4_RXD_MARK, XWUP_MARK,
111 XRTS1_MARK, SCIFA4_RTS_MARK, M03_BERCLK_MARK,
112 XCTS1_MARK, SCIFA4_CTS_MARK,
113
114 /* 49-2 */
115 HSU_IQ_AGC6_MARK, MFG2_IN2_MARK, MSIOF2_MCK0_MARK,
116 HSU_IQ_AGC5_MARK, MFG2_IN1_MARK, MSIOF2_MCK1_MARK,
117 HSU_IQ_AGC4_MARK, MSIOF2_RSYNC_MARK,
118 HSU_IQ_AGC3_MARK, MFG2_OUT1_MARK, MSIOF2_RSCK_MARK,
119 HSU_IQ_AGC2_MARK, PORT42_KEYOUT0_MARK,
120 HSU_IQ_AGC1_MARK, PORT43_KEYOUT1_MARK,
121 HSU_IQ_AGC0_MARK, PORT44_KEYOUT2_MARK,
122 HSU_IQ_AGC_ST_MARK, PORT45_KEYOUT3_MARK,
123 HSU_IQ_PDO_MARK, PORT46_KEYOUT4_MARK,
124 HSU_IQ_PYO_MARK, PORT47_KEYOUT5_MARK,
125 HSU_EN_TXMUX_G3MO_MARK, PORT48_KEYIN0_MARK,
126 HSU_I_TXMUX_G3MO_MARK, PORT49_KEYIN1_MARK,
127 HSU_Q_TXMUX_G3MO_MARK, PORT50_KEYIN2_MARK,
128 HSU_SYO_MARK, PORT51_MSIOF2_TSYNC_MARK,
129 HSU_SDO_MARK, PORT52_MSIOF2_TSCK_MARK,
130 HSU_TGTTI_G3MO_MARK, PORT53_MSIOF2_TXD_MARK,
131 B_TIME_STAMP_MARK, PORT54_MSIOF2_RXD_MARK,
132 HSU_SDI_MARK, PORT55_KEYIN3_MARK,
133 HSU_SCO_MARK, PORT56_KEYIN4_MARK,
134 HSU_DREQ_MARK, PORT57_KEYIN5_MARK,
135 HSU_DACK_MARK, PORT58_KEYIN6_MARK,
136 HSU_CLK61M_MARK, PORT59_MSIOF2_SS1_MARK,
137 HSU_XRST_MARK, PORT60_MSIOF2_SS2_MARK,
138 PCMCLKO_MARK, SYNC8KO_MARK, DNPCM_A_MARK, UPPCM_A_MARK,
139 XTALB1L_MARK,
140 GPS_AGC1_MARK, SCIFA0_RTS_MARK,
141 GPS_AGC2_MARK, SCIFA0_SCK_MARK,
142 GPS_AGC3_MARK, SCIFA0_TXD_MARK,
143 GPS_AGC4_MARK, SCIFA0_RXD_MARK,
144 GPS_PWRD_MARK, SCIFA0_CTS_MARK,
145 GPS_IM_MARK, GPS_IS_MARK, GPS_QM_MARK, GPS_QS_MARK,
146 SIUBOMC_MARK, TPU2TO0_MARK,
147 SIUCKB_MARK, TPU2TO1_MARK,
148 SIUBOLR_MARK, BBIF2_TSYNC_MARK, TPU2TO2_MARK,
149 SIUBOBT_MARK, BBIF2_TSCK_MARK, TPU2TO3_MARK,
150 SIUBOSLD_MARK, BBIF2_TXD_MARK, TPU3TO0_MARK,
151 SIUBILR_MARK, TPU3TO1_MARK,
152 SIUBIBT_MARK, TPU3TO2_MARK,
153 SIUBISLD_MARK, TPU3TO3_MARK,
154 NMI_MARK, TPU4TO0_MARK,
155 DNPCM_M_MARK, TPU4TO1_MARK, TPU4TO2_MARK, TPU4TO3_MARK,
156 IRQ_TMPB_MARK,
157 PWEN_MARK, MFG1_OUT1_MARK,
158 OVCN_MARK, MFG1_IN1_MARK,
159 OVCN2_MARK, MFG1_IN2_MARK,
160
161 /* 49-3 */
162 RFSPO1_MARK, RFSPO2_MARK, RFSPO3_MARK, PORT93_VIO_CKO2_MARK,
163 USBTERM_MARK, EXTLP_MARK, IDIN_MARK,
164 SCIFA5_CTS_MARK, MFG0_IN1_MARK,
165 SCIFA5_RTS_MARK, MFG0_IN2_MARK,
166 SCIFA5_RXD_MARK,
167 SCIFA5_TXD_MARK,
168 SCIFA5_SCK_MARK, MFG0_OUT1_MARK,
169 A0_EA0_MARK, BS_MARK,
170 A14_EA14_MARK, PORT102_KEYOUT0_MARK,
171 A15_EA15_MARK, PORT103_KEYOUT1_MARK, DV_CLKOL_MARK,
172 A16_EA16_MARK, PORT104_KEYOUT2_MARK,
173 DV_VSYNCL_MARK, MSIOF0_SS1_MARK,
174 A17_EA17_MARK, PORT105_KEYOUT3_MARK,
175 DV_HSYNCL_MARK, MSIOF0_TSYNC_MARK,
176 A18_EA18_MARK, PORT106_KEYOUT4_MARK,
177 DV_DL0_MARK, MSIOF0_TSCK_MARK,
178 A19_EA19_MARK, PORT107_KEYOUT5_MARK,
179 DV_DL1_MARK, MSIOF0_TXD_MARK,
180 A20_EA20_MARK, PORT108_KEYIN0_MARK,
181 DV_DL2_MARK, MSIOF0_RSCK_MARK,
182 A21_EA21_MARK, PORT109_KEYIN1_MARK,
183 DV_DL3_MARK, MSIOF0_RSYNC_MARK,
184 A22_EA22_MARK, PORT110_KEYIN2_MARK,
185 DV_DL4_MARK, MSIOF0_MCK0_MARK,
186 A23_EA23_MARK, PORT111_KEYIN3_MARK,
187 DV_DL5_MARK, MSIOF0_MCK1_MARK,
188 A24_EA24_MARK, PORT112_KEYIN4_MARK,
189 DV_DL6_MARK, MSIOF0_RXD_MARK,
190 A25_EA25_MARK, PORT113_KEYIN5_MARK,
191 DV_DL7_MARK, MSIOF0_SS2_MARK,
192 A26_MARK, PORT113_KEYIN6_MARK, DV_CLKIL_MARK,
193 D0_ED0_NAF0_MARK, D1_ED1_NAF1_MARK, D2_ED2_NAF2_MARK,
194 D3_ED3_NAF3_MARK, D4_ED4_NAF4_MARK, D5_ED5_NAF5_MARK,
195 D6_ED6_NAF6_MARK, D7_ED7_NAF7_MARK, D8_ED8_NAF8_MARK,
196 D9_ED9_NAF9_MARK, D10_ED10_NAF10_MARK, D11_ED11_NAF11_MARK,
197 D12_ED12_NAF12_MARK, D13_ED13_NAF13_MARK,
198 D14_ED14_NAF14_MARK, D15_ED15_NAF15_MARK,
199 CS4_MARK, CS5A_MARK, CS5B_MARK, FCE1_MARK,
200 CS6B_MARK, XCS2_MARK, FCE0_MARK, CS6A_MARK,
201 DACK0_MARK, WAIT_MARK, DREQ0_MARK, RD_XRD_MARK,
202 A27_MARK, RDWR_XWE_MARK, WE0_XWR0_FWE_MARK,
203 WE1_XWR1_MARK, FRB_MARK, CKO_MARK,
204 NBRSTOUT_MARK, NBRST_MARK,
205
206 /* 49-4 */
207 RFSPO0_MARK, PORT146_VIO_CKO2_MARK, TSTMD_MARK,
208 VIO_VD_MARK, VIO_HD_MARK,
209 VIO_D0_MARK, VIO_D1_MARK, VIO_D2_MARK,
210 VIO_D3_MARK, VIO_D4_MARK, VIO_D5_MARK,
211 VIO_D6_MARK, VIO_D7_MARK, VIO_D8_MARK,
212 VIO_D9_MARK, VIO_D10_MARK, VIO_D11_MARK,
213 VIO_D12_MARK, VIO_D13_MARK, VIO_D14_MARK,
214 VIO_D15_MARK, VIO_CLK_MARK, VIO_FIELD_MARK,
215 VIO_CKO_MARK,
216 MFG3_IN1_MARK, MFG3_IN2_MARK,
217 M9_SLCD_A01_MARK, MFG3_OUT1_MARK, TPU0TO0_MARK,
218 M10_SLCD_CK1_MARK, MFG4_IN1_MARK, TPU0TO1_MARK,
219 M11_SLCD_SO1_MARK, MFG4_IN2_MARK, TPU0TO2_MARK,
220 M12_SLCD_CE1_MARK, MFG4_OUT1_MARK, TPU0TO3_MARK,
221 LCDD0_MARK, PORT175_KEYOUT0_MARK, DV_D0_MARK,
222 SIUCKA_MARK, MFG0_OUT2_MARK,
223 LCDD1_MARK, PORT176_KEYOUT1_MARK, DV_D1_MARK,
224 SIUAOLR_MARK, BBIF2_TSYNC1_MARK,
225 LCDD2_MARK, PORT177_KEYOUT2_MARK, DV_D2_MARK,
226 SIUAOBT_MARK, BBIF2_TSCK1_MARK,
227 LCDD3_MARK, PORT178_KEYOUT3_MARK, DV_D3_MARK,
228 SIUAOSLD_MARK, BBIF2_TXD1_MARK,
229 LCDD4_MARK, PORT179_KEYOUT4_MARK, DV_D4_MARK,
230 SIUAISPD_MARK, MFG1_OUT2_MARK,
231 LCDD5_MARK, PORT180_KEYOUT5_MARK, DV_D5_MARK,
232 SIUAILR_MARK, MFG2_OUT2_MARK,
233 LCDD6_MARK, DV_D6_MARK,
234 SIUAIBT_MARK, MFG3_OUT2_MARK, XWR2_MARK,
235 LCDD7_MARK, DV_D7_MARK,
236 SIUAISLD_MARK, MFG4_OUT2_MARK, XWR3_MARK,
237 LCDD8_MARK, DV_D8_MARK, D16_MARK, ED16_MARK,
238 LCDD9_MARK, DV_D9_MARK, D17_MARK, ED17_MARK,
239 LCDD10_MARK, DV_D10_MARK, D18_MARK, ED18_MARK,
240 LCDD11_MARK, DV_D11_MARK, D19_MARK, ED19_MARK,
241 LCDD12_MARK, DV_D12_MARK, D20_MARK, ED20_MARK,
242 LCDD13_MARK, DV_D13_MARK, D21_MARK, ED21_MARK,
243 LCDD14_MARK, DV_D14_MARK, D22_MARK, ED22_MARK,
244 LCDD15_MARK, DV_D15_MARK, D23_MARK, ED23_MARK,
245 LCDD16_MARK, DV_HSYNC_MARK, D24_MARK, ED24_MARK,
246 LCDD17_MARK, DV_VSYNC_MARK, D25_MARK, ED25_MARK,
247 LCDD18_MARK, DREQ2_MARK, MSIOF0L_TSCK_MARK,
248 D26_MARK, ED26_MARK,
249 LCDD19_MARK, MSIOF0L_TSYNC_MARK,
250 D27_MARK, ED27_MARK,
251 LCDD20_MARK, TS_SPSYNC1_MARK, MSIOF0L_MCK0_MARK,
252 D28_MARK, ED28_MARK,
253 LCDD21_MARK, TS_SDAT1_MARK, MSIOF0L_MCK1_MARK,
254 D29_MARK, ED29_MARK,
255 LCDD22_MARK, TS_SDEN1_MARK, MSIOF0L_SS1_MARK,
256 D30_MARK, ED30_MARK,
257 LCDD23_MARK, TS_SCK1_MARK, MSIOF0L_SS2_MARK,
258 D31_MARK, ED31_MARK,
259 LCDDCK_MARK, LCDWR_MARK, DV_CKO_MARK, SIUAOSPD_MARK,
260 LCDRD_MARK, DACK2_MARK, MSIOF0L_RSYNC_MARK,
261
262 /* 49-5 */
263 LCDHSYN_MARK, LCDCS_MARK, LCDCS2_MARK, DACK3_MARK,
264 LCDDISP_MARK, LCDRS_MARK, DREQ3_MARK, MSIOF0L_RSCK_MARK,
265 LCDCSYN_MARK, LCDCSYN2_MARK, DV_CKI_MARK,
266 LCDLCLK_MARK, DREQ1_MARK, MSIOF0L_RXD_MARK,
267 LCDDON_MARK, LCDDON2_MARK, DACK1_MARK, MSIOF0L_TXD_MARK,
268 VIO_DR0_MARK, VIO_DR1_MARK, VIO_DR2_MARK, VIO_DR3_MARK,
269 VIO_DR4_MARK, VIO_DR5_MARK, VIO_DR6_MARK, VIO_DR7_MARK,
270 VIO_VDR_MARK, VIO_HDR_MARK,
271 VIO_CLKR_MARK, VIO_CKOR_MARK,
272 SCIFA1_TXD_MARK, GPS_PGFA0_MARK,
273 SCIFA1_SCK_MARK, GPS_PGFA1_MARK,
274 SCIFA1_RTS_MARK, GPS_EPPSINMON_MARK,
275 SCIFA1_RXD_MARK, SCIFA1_CTS_MARK,
276 MSIOF1_TXD_MARK, SCIFA1_TXD2_MARK, GPS_TXD_MARK,
277 MSIOF1_TSYNC_MARK, SCIFA1_CTS2_MARK, I2C_SDA2_MARK,
278 MSIOF1_TSCK_MARK, SCIFA1_SCK2_MARK,
279 MSIOF1_RXD_MARK, SCIFA1_RXD2_MARK, GPS_RXD_MARK,
280 MSIOF1_RSCK_MARK, SCIFA1_RTS2_MARK,
281 MSIOF1_RSYNC_MARK, I2C_SCL2_MARK,
282 MSIOF1_MCK0_MARK, MSIOF1_MCK1_MARK,
283 MSIOF1_SS1_MARK, EDBGREQ3_MARK,
284 MSIOF1_SS2_MARK,
285 PORT236_IROUT_MARK, IRDA_OUT_MARK,
286 IRDA_IN_MARK, IRDA_FIRSEL_MARK,
287 TPU1TO0_MARK, TS_SPSYNC3_MARK,
288 TPU1TO1_MARK, TS_SDAT3_MARK,
289 TPU1TO2_MARK, TS_SDEN3_MARK, PORT241_MSIOF2_SS1_MARK,
290 TPU1TO3_MARK, PORT242_MSIOF2_TSCK_MARK,
291 M13_BSW_MARK, PORT243_MSIOF2_TSYNC_MARK,
292 M14_GSW_MARK, PORT244_MSIOF2_TXD_MARK,
293 PORT245_IROUT_MARK, M15_RSW_MARK,
294 SOUT3_MARK, SCIFA2_TXD1_MARK,
295 SIN3_MARK, SCIFA2_RXD1_MARK,
296 XRTS3_MARK, SCIFA2_RTS1_MARK, PORT248_MSIOF2_SS2_MARK,
297 XCTS3_MARK, SCIFA2_CTS1_MARK, PORT249_MSIOF2_RXD_MARK,
298 DINT_MARK, SCIFA2_SCK1_MARK, TS_SCK3_MARK,
299 SDHICLK0_MARK, TCK2_MARK,
300 SDHICD0_MARK,
301 SDHID0_0_MARK, TMS2_MARK,
302 SDHID0_1_MARK, TDO2_MARK,
303 SDHID0_2_MARK, TDI2_MARK,
304 SDHID0_3_MARK, RTCK2_MARK,
305
306 /* 49-6 */
307 SDHICMD0_MARK, TRST2_MARK,
308 SDHIWP0_MARK, EDBGREQ2_MARK,
309 SDHICLK1_MARK, TCK3_MARK,
310 SDHID1_0_MARK, M11_SLCD_SO2_MARK,
311 TS_SPSYNC2_MARK, TMS3_MARK,
312 SDHID1_1_MARK, M9_SLCD_AO2_MARK,
313 TS_SDAT2_MARK, TDO3_MARK,
314 SDHID1_2_MARK, M10_SLCD_CK2_MARK,
315 TS_SDEN2_MARK, TDI3_MARK,
316 SDHID1_3_MARK, M12_SLCD_CE2_MARK,
317 TS_SCK2_MARK, RTCK3_MARK,
318 SDHICMD1_MARK, TRST3_MARK,
319 SDHICLK2_MARK, SCIFB_SCK_MARK,
320 SDHID2_0_MARK, SCIFB_TXD_MARK,
321 SDHID2_1_MARK, SCIFB_CTS_MARK,
322 SDHID2_2_MARK, SCIFB_RXD_MARK,
323 SDHID2_3_MARK, SCIFB_RTS_MARK,
324 SDHICMD2_MARK,
325 RESETOUTS_MARK,
326 DIVLOCK_MARK,
327 PINMUX_MARK_END,
328};
329
330#define PORT_DATA_I(nr) \
331 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
332
333#define PORT_DATA_I_PD(nr) \
334 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
335 PORT##nr##_IN, PORT##nr##_IN_PD)
336
337#define PORT_DATA_I_PU(nr) \
338 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
339 PORT##nr##_IN, PORT##nr##_IN_PU)
340
341#define PORT_DATA_I_PU_PD(nr) \
342 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
343 PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
344
345#define PORT_DATA_O(nr) \
346 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT)
347
348#define PORT_DATA_IO(nr) \
349 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
350 PORT##nr##_IN)
351
352#define PORT_DATA_IO_PD(nr) \
353 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
354 PORT##nr##_IN, PORT##nr##_IN_PD)
355
356#define PORT_DATA_IO_PU(nr) \
357 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
358 PORT##nr##_IN, PORT##nr##_IN_PU)
359
360#define PORT_DATA_IO_PU_PD(nr) \
361 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
362 PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
363
364
365static pinmux_enum_t pinmux_data[] = {
366
367 /* specify valid pin states for each pin in GPIO mode */
368
369 /* 49-1 (GPIO) */
370 PORT_DATA_I_PD(0),
371 PORT_DATA_I_PU(1), PORT_DATA_I_PU(2), PORT_DATA_I_PU(3),
372 PORT_DATA_I_PU(4), PORT_DATA_I_PU(5), PORT_DATA_I_PU(6),
373 PORT_DATA_I_PU(7), PORT_DATA_I_PU(8), PORT_DATA_I_PU(9),
374 PORT_DATA_I_PU(10), PORT_DATA_I_PU(11), PORT_DATA_I_PU(12),
375 PORT_DATA_I_PU(13),
376 PORT_DATA_IO_PU_PD(14), PORT_DATA_IO_PU_PD(15),
377 PORT_DATA_O(16), PORT_DATA_O(17), PORT_DATA_O(18), PORT_DATA_O(19),
378 PORT_DATA_O(20), PORT_DATA_O(21), PORT_DATA_O(22), PORT_DATA_O(23),
379 PORT_DATA_O(24), PORT_DATA_O(25), PORT_DATA_O(26),
380 PORT_DATA_I_PD(27), PORT_DATA_I_PD(28),
381 PORT_DATA_O(29), PORT_DATA_O(30), PORT_DATA_O(31), PORT_DATA_O(32),
382 PORT_DATA_IO_PU(33),
383 PORT_DATA_O(34),
384 PORT_DATA_I_PU(35),
385 PORT_DATA_O(36),
386 PORT_DATA_I_PU_PD(37),
387
388 /* 49-2 (GPIO) */
389 PORT_DATA_IO_PU_PD(38),
390 PORT_DATA_IO_PD(39), PORT_DATA_IO_PD(40), PORT_DATA_IO_PD(41),
391 PORT_DATA_O(42), PORT_DATA_O(43), PORT_DATA_O(44), PORT_DATA_O(45),
392 PORT_DATA_O(46), PORT_DATA_O(47),
393 PORT_DATA_I_PU_PD(48), PORT_DATA_I_PU_PD(49), PORT_DATA_I_PU_PD(50),
394 PORT_DATA_IO_PD(51), PORT_DATA_IO_PD(52),
395 PORT_DATA_O(53),
396 PORT_DATA_IO_PD(54),
397 PORT_DATA_I_PU_PD(55),
398 PORT_DATA_IO_PU_PD(56),
399 PORT_DATA_I_PU_PD(57),
400 PORT_DATA_IO_PU_PD(58),
401 PORT_DATA_O(59), PORT_DATA_O(60), PORT_DATA_O(61), PORT_DATA_O(62),
402 PORT_DATA_O(63),
403 PORT_DATA_I_PU(64),
404 PORT_DATA_O(65), PORT_DATA_O(66), PORT_DATA_O(67), PORT_DATA_O(68),
405 PORT_DATA_IO_PD(69), PORT_DATA_IO_PD(70),
406 PORT_DATA_I_PD(71), PORT_DATA_I_PD(72), PORT_DATA_I_PD(73),
407 PORT_DATA_I_PD(74),
408 PORT_DATA_IO_PU_PD(75), PORT_DATA_IO_PU_PD(76),
409 PORT_DATA_IO_PD(77), PORT_DATA_IO_PD(78),
410 PORT_DATA_O(79),
411 PORT_DATA_IO_PD(80), PORT_DATA_IO_PD(81), PORT_DATA_IO_PD(82),
412 PORT_DATA_IO_PU_PD(83), PORT_DATA_IO_PU_PD(84),
413 PORT_DATA_IO_PU_PD(85), PORT_DATA_IO_PU_PD(86),
414 PORT_DATA_I_PD(87),
415 PORT_DATA_IO_PU_PD(88),
416 PORT_DATA_I_PU_PD(89), PORT_DATA_I_PU_PD(90),
417
418 /* 49-3 (GPIO) */
419 PORT_DATA_O(91), PORT_DATA_O(92), PORT_DATA_O(93), PORT_DATA_O(94),
420 PORT_DATA_I_PU_PD(95),
421 PORT_DATA_IO_PU_PD(96), PORT_DATA_IO_PU_PD(97), PORT_DATA_IO_PU_PD(98),
422 PORT_DATA_IO_PU_PD(99), PORT_DATA_IO_PU_PD(100),
423 PORT_DATA_IO(101), PORT_DATA_IO(102), PORT_DATA_IO(103),
424 PORT_DATA_IO_PD(104), PORT_DATA_IO_PD(105), PORT_DATA_IO_PD(106),
425 PORT_DATA_IO_PD(107),
426 PORT_DATA_IO_PU_PD(108), PORT_DATA_IO_PU_PD(109),
427 PORT_DATA_IO_PU_PD(110), PORT_DATA_IO_PU_PD(111),
428 PORT_DATA_IO_PU_PD(112), PORT_DATA_IO_PU_PD(113),
429 PORT_DATA_IO_PU_PD(114),
430 PORT_DATA_IO_PU(115), PORT_DATA_IO_PU(116), PORT_DATA_IO_PU(117),
431 PORT_DATA_IO_PU(118), PORT_DATA_IO_PU(119), PORT_DATA_IO_PU(120),
432 PORT_DATA_IO_PU(121), PORT_DATA_IO_PU(122), PORT_DATA_IO_PU(123),
433 PORT_DATA_IO_PU(124), PORT_DATA_IO_PU(125), PORT_DATA_IO_PU(126),
434 PORT_DATA_IO_PU(127), PORT_DATA_IO_PU(128), PORT_DATA_IO_PU(129),
435 PORT_DATA_IO_PU(130),
436 PORT_DATA_O(131), PORT_DATA_O(132), PORT_DATA_O(133),
437 PORT_DATA_IO_PU(134),
438 PORT_DATA_O(135), PORT_DATA_O(136),
439 PORT_DATA_I_PU_PD(137),
440 PORT_DATA_IO(138),
441 PORT_DATA_IO_PU_PD(139),
442 PORT_DATA_IO(140), PORT_DATA_IO(141),
443 PORT_DATA_I_PU(142),
444 PORT_DATA_O(143), PORT_DATA_O(144),
445 PORT_DATA_I_PU(145),
446
447 /* 49-4 (GPIO) */
448 PORT_DATA_O(146),
449 PORT_DATA_I_PU_PD(147),
450 PORT_DATA_I_PD(148), PORT_DATA_I_PD(149),
451 PORT_DATA_IO_PD(150), PORT_DATA_IO_PD(151), PORT_DATA_IO_PD(152),
452 PORT_DATA_IO_PD(153), PORT_DATA_IO_PD(154), PORT_DATA_IO_PD(155),
453 PORT_DATA_IO_PD(156), PORT_DATA_IO_PD(157), PORT_DATA_IO_PD(158),
454 PORT_DATA_IO_PD(159), PORT_DATA_IO_PD(160), PORT_DATA_IO_PD(161),
455 PORT_DATA_IO_PD(162), PORT_DATA_IO_PD(163), PORT_DATA_IO_PD(164),
456 PORT_DATA_IO_PD(165), PORT_DATA_IO_PD(166),
457 PORT_DATA_IO_PU_PD(167),
458 PORT_DATA_O(168),
459 PORT_DATA_I_PD(169), PORT_DATA_I_PD(170),
460 PORT_DATA_O(171),
461 PORT_DATA_IO_PD(172), PORT_DATA_IO_PD(173),
462 PORT_DATA_O(174),
463 PORT_DATA_IO_PD(175), PORT_DATA_IO_PD(176), PORT_DATA_IO_PD(177),
464 PORT_DATA_IO_PD(178), PORT_DATA_IO_PD(179), PORT_DATA_IO_PD(180),
465 PORT_DATA_IO_PD(181), PORT_DATA_IO_PD(182), PORT_DATA_IO_PD(183),
466 PORT_DATA_IO_PD(184), PORT_DATA_IO_PD(185), PORT_DATA_IO_PD(186),
467 PORT_DATA_IO_PD(187), PORT_DATA_IO_PD(188), PORT_DATA_IO_PD(189),
468 PORT_DATA_IO_PD(190), PORT_DATA_IO_PD(191), PORT_DATA_IO_PD(192),
469 PORT_DATA_IO_PD(193), PORT_DATA_IO_PD(194), PORT_DATA_IO_PD(195),
470 PORT_DATA_IO_PD(196), PORT_DATA_IO_PD(197), PORT_DATA_IO_PD(198),
471 PORT_DATA_O(199),
472 PORT_DATA_IO_PD(200),
473
474 /* 49-5 (GPIO) */
475 PORT_DATA_O(201),
476 PORT_DATA_IO_PD(202), PORT_DATA_IO_PD(203),
477 PORT_DATA_I(204),
478 PORT_DATA_O(205),
479 PORT_DATA_IO_PD(206), PORT_DATA_IO_PD(207), PORT_DATA_IO_PD(208),
480 PORT_DATA_IO_PD(209), PORT_DATA_IO_PD(210), PORT_DATA_IO_PD(211),
481 PORT_DATA_IO_PD(212), PORT_DATA_IO_PD(213), PORT_DATA_IO_PD(214),
482 PORT_DATA_IO_PD(215), PORT_DATA_IO_PD(216),
483 PORT_DATA_O(217),
484 PORT_DATA_I_PU_PD(218), PORT_DATA_I_PU_PD(219),
485 PORT_DATA_O(220), PORT_DATA_O(221), PORT_DATA_O(222),
486 PORT_DATA_I_PD(223),
487 PORT_DATA_I_PU_PD(224),
488 PORT_DATA_O(225),
489 PORT_DATA_IO_PD(226),
490 PORT_DATA_IO_PU_PD(227),
491 PORT_DATA_I_PD(228),
492 PORT_DATA_IO_PD(229), PORT_DATA_IO_PD(230),
493 PORT_DATA_I_PU_PD(231), PORT_DATA_I_PU_PD(232),
494 PORT_DATA_IO_PU_PD(233), PORT_DATA_IO_PU_PD(234),
495 PORT_DATA_I_PU_PD(235),
496 PORT_DATA_O(236),
497 PORT_DATA_I_PD(237),
498 PORT_DATA_IO_PU_PD(238), PORT_DATA_IO_PU_PD(239),
499 PORT_DATA_IO_PD(240), PORT_DATA_IO_PD(241),
500 PORT_DATA_IO_PD(242), PORT_DATA_IO_PD(243),
501 PORT_DATA_O(244),
502 PORT_DATA_IO_PU_PD(245),
503 PORT_DATA_O(246),
504 PORT_DATA_I_PD(247),
505 PORT_DATA_IO_PU_PD(248),
506 PORT_DATA_I_PU_PD(249),
507 PORT_DATA_IO_PD(250), PORT_DATA_IO_PD(251),
508 PORT_DATA_IO_PU_PD(252), PORT_DATA_IO_PU_PD(253),
509 PORT_DATA_IO_PU_PD(254), PORT_DATA_IO_PU_PD(255),
510 PORT_DATA_IO_PU_PD(256),
511
512 /* 49-6 (GPIO) */
513 PORT_DATA_IO_PU_PD(257), PORT_DATA_IO_PU_PD(258),
514 PORT_DATA_IO_PD(259),
515 PORT_DATA_IO_PU(260), PORT_DATA_IO_PU(261), PORT_DATA_IO_PU(262),
516 PORT_DATA_IO_PU(263), PORT_DATA_IO_PU(264),
517 PORT_DATA_O(265),
518 PORT_DATA_IO_PU(266), PORT_DATA_IO_PU(267), PORT_DATA_IO_PU(268),
519 PORT_DATA_IO_PU(269), PORT_DATA_IO_PU(270),
520 PORT_DATA_O(271),
521 PORT_DATA_I_PD(272),
522
523 /* Special Pull-up / Pull-down Functions */
524 PINMUX_DATA(PORT48_KEYIN0_PU_MARK, MSELBCR_MSEL2_1,
525 PORT48_FN2, PORT48_IN_PU),
526 PINMUX_DATA(PORT49_KEYIN1_PU_MARK, MSELBCR_MSEL2_1,
527 PORT49_FN2, PORT49_IN_PU),
528 PINMUX_DATA(PORT50_KEYIN2_PU_MARK, MSELBCR_MSEL2_1,
529 PORT50_FN2, PORT50_IN_PU),
530 PINMUX_DATA(PORT55_KEYIN3_PU_MARK, MSELBCR_MSEL2_1,
531 PORT55_FN2, PORT55_IN_PU),
532 PINMUX_DATA(PORT56_KEYIN4_PU_MARK, MSELBCR_MSEL2_1,
533 PORT56_FN2, PORT56_IN_PU),
534 PINMUX_DATA(PORT57_KEYIN5_PU_MARK, MSELBCR_MSEL2_1,
535 PORT57_FN2, PORT57_IN_PU),
536 PINMUX_DATA(PORT58_KEYIN6_PU_MARK, MSELBCR_MSEL2_1,
537 PORT58_FN2, PORT58_IN_PU),
538
539 /* 49-1 (FN) */
540 PINMUX_DATA(VBUS0_MARK, PORT0_FN1),
541 PINMUX_DATA(CPORT0_MARK, PORT1_FN1),
542 PINMUX_DATA(CPORT1_MARK, PORT2_FN1),
543 PINMUX_DATA(CPORT2_MARK, PORT3_FN1),
544 PINMUX_DATA(CPORT3_MARK, PORT4_FN1),
545 PINMUX_DATA(CPORT4_MARK, PORT5_FN1),
546 PINMUX_DATA(CPORT5_MARK, PORT6_FN1),
547 PINMUX_DATA(CPORT6_MARK, PORT7_FN1),
548 PINMUX_DATA(CPORT7_MARK, PORT8_FN1),
549 PINMUX_DATA(CPORT8_MARK, PORT9_FN1),
550 PINMUX_DATA(CPORT9_MARK, PORT10_FN1),
551 PINMUX_DATA(CPORT10_MARK, PORT11_FN1),
552 PINMUX_DATA(CPORT11_MARK, PORT12_FN1),
553 PINMUX_DATA(SIN2_MARK, PORT12_FN2),
554 PINMUX_DATA(CPORT12_MARK, PORT13_FN1),
555 PINMUX_DATA(XCTS2_MARK, PORT13_FN2),
556 PINMUX_DATA(CPORT13_MARK, PORT14_FN1),
557 PINMUX_DATA(RFSPO4_MARK, PORT14_FN2),
558 PINMUX_DATA(CPORT14_MARK, PORT15_FN1),
559 PINMUX_DATA(RFSPO5_MARK, PORT15_FN2),
560 PINMUX_DATA(CPORT15_MARK, PORT16_FN1),
561 PINMUX_DATA(CPORT16_MARK, PORT17_FN1),
562 PINMUX_DATA(CPORT17_MARK, PORT18_FN1),
563 PINMUX_DATA(SOUT2_MARK, PORT18_FN2),
564 PINMUX_DATA(CPORT18_MARK, PORT19_FN1),
565 PINMUX_DATA(XRTS2_MARK, PORT19_FN1),
566 PINMUX_DATA(CPORT19_MARK, PORT20_FN1),
567 PINMUX_DATA(CPORT20_MARK, PORT21_FN1),
568 PINMUX_DATA(RFSPO6_MARK, PORT21_FN2),
569 PINMUX_DATA(CPORT21_MARK, PORT22_FN1),
570 PINMUX_DATA(STATUS0_MARK, PORT22_FN2),
571 PINMUX_DATA(CPORT22_MARK, PORT23_FN1),
572 PINMUX_DATA(STATUS1_MARK, PORT23_FN2),
573 PINMUX_DATA(CPORT23_MARK, PORT24_FN1),
574 PINMUX_DATA(STATUS2_MARK, PORT24_FN2),
575 PINMUX_DATA(RFSPO7_MARK, PORT24_FN3),
576 PINMUX_DATA(MPORT0_MARK, PORT25_FN1),
577 PINMUX_DATA(MPORT1_MARK, PORT26_FN1),
578 PINMUX_DATA(B_SYNLD1_MARK, PORT27_FN1),
579 PINMUX_DATA(B_SYNLD2_MARK, PORT28_FN1),
580 PINMUX_DATA(XMAINPS_MARK, PORT29_FN1),
581 PINMUX_DATA(XDIVPS_MARK, PORT30_FN1),
582 PINMUX_DATA(XIDRST_MARK, PORT31_FN1),
583 PINMUX_DATA(IDCLK_MARK, PORT32_FN1),
584 PINMUX_DATA(IDIO_MARK, PORT33_FN1),
585 PINMUX_DATA(SOUT1_MARK, PORT34_FN1),
586 PINMUX_DATA(SCIFA4_TXD_MARK, PORT34_FN2),
587 PINMUX_DATA(M02_BERDAT_MARK, PORT34_FN3),
588 PINMUX_DATA(SIN1_MARK, PORT35_FN1),
589 PINMUX_DATA(SCIFA4_RXD_MARK, PORT35_FN2),
590 PINMUX_DATA(XWUP_MARK, PORT35_FN3),
591 PINMUX_DATA(XRTS1_MARK, PORT36_FN1),
592 PINMUX_DATA(SCIFA4_RTS_MARK, PORT36_FN2),
593 PINMUX_DATA(M03_BERCLK_MARK, PORT36_FN3),
594 PINMUX_DATA(XCTS1_MARK, PORT37_FN1),
595 PINMUX_DATA(SCIFA4_CTS_MARK, PORT37_FN2),
596
597 /* 49-2 (FN) */
598 PINMUX_DATA(HSU_IQ_AGC6_MARK, PORT38_FN1),
599 PINMUX_DATA(MFG2_IN2_MARK, PORT38_FN2),
600 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT38_FN3),
601 PINMUX_DATA(HSU_IQ_AGC5_MARK, PORT39_FN1),
602 PINMUX_DATA(MFG2_IN1_MARK, PORT39_FN2),
603 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT39_FN3),
604 PINMUX_DATA(HSU_IQ_AGC4_MARK, PORT40_FN1),
605 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT40_FN3),
606 PINMUX_DATA(HSU_IQ_AGC3_MARK, PORT41_FN1),
607 PINMUX_DATA(MFG2_OUT1_MARK, PORT41_FN2),
608 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT41_FN3),
609 PINMUX_DATA(HSU_IQ_AGC2_MARK, PORT42_FN1),
610 PINMUX_DATA(PORT42_KEYOUT0_MARK, MSELBCR_MSEL2_1, PORT42_FN2),
611 PINMUX_DATA(HSU_IQ_AGC1_MARK, PORT43_FN1),
612 PINMUX_DATA(PORT43_KEYOUT1_MARK, MSELBCR_MSEL2_1, PORT43_FN2),
613 PINMUX_DATA(HSU_IQ_AGC0_MARK, PORT44_FN1),
614 PINMUX_DATA(PORT44_KEYOUT2_MARK, MSELBCR_MSEL2_1, PORT44_FN2),
615 PINMUX_DATA(HSU_IQ_AGC_ST_MARK, PORT45_FN1),
616 PINMUX_DATA(PORT45_KEYOUT3_MARK, MSELBCR_MSEL2_1, PORT45_FN2),
617 PINMUX_DATA(HSU_IQ_PDO_MARK, PORT46_FN1),
618 PINMUX_DATA(PORT46_KEYOUT4_MARK, MSELBCR_MSEL2_1, PORT46_FN2),
619 PINMUX_DATA(HSU_IQ_PYO_MARK, PORT47_FN1),
620 PINMUX_DATA(PORT47_KEYOUT5_MARK, MSELBCR_MSEL2_1, PORT47_FN2),
621 PINMUX_DATA(HSU_EN_TXMUX_G3MO_MARK, PORT48_FN1),
622 PINMUX_DATA(PORT48_KEYIN0_MARK, MSELBCR_MSEL2_1, PORT48_FN2),
623 PINMUX_DATA(HSU_I_TXMUX_G3MO_MARK, PORT49_FN1),
624 PINMUX_DATA(PORT49_KEYIN1_MARK, MSELBCR_MSEL2_1, PORT49_FN2),
625 PINMUX_DATA(HSU_Q_TXMUX_G3MO_MARK, PORT50_FN1),
626 PINMUX_DATA(PORT50_KEYIN2_MARK, MSELBCR_MSEL2_1, PORT50_FN2),
627 PINMUX_DATA(HSU_SYO_MARK, PORT51_FN1),
628 PINMUX_DATA(PORT51_MSIOF2_TSYNC_MARK, PORT51_FN2),
629 PINMUX_DATA(HSU_SDO_MARK, PORT52_FN1),
630 PINMUX_DATA(PORT52_MSIOF2_TSCK_MARK, PORT52_FN2),
631 PINMUX_DATA(HSU_TGTTI_G3MO_MARK, PORT53_FN1),
632 PINMUX_DATA(PORT53_MSIOF2_TXD_MARK, PORT53_FN2),
633 PINMUX_DATA(B_TIME_STAMP_MARK, PORT54_FN1),
634 PINMUX_DATA(PORT54_MSIOF2_RXD_MARK, PORT54_FN2),
635 PINMUX_DATA(HSU_SDI_MARK, PORT55_FN1),
636 PINMUX_DATA(PORT55_KEYIN3_MARK, MSELBCR_MSEL2_1, PORT55_FN2),
637 PINMUX_DATA(HSU_SCO_MARK, PORT56_FN1),
638 PINMUX_DATA(PORT56_KEYIN4_MARK, MSELBCR_MSEL2_1, PORT56_FN2),
639 PINMUX_DATA(HSU_DREQ_MARK, PORT57_FN1),
640 PINMUX_DATA(PORT57_KEYIN5_MARK, MSELBCR_MSEL2_1, PORT57_FN2),
641 PINMUX_DATA(HSU_DACK_MARK, PORT58_FN1),
642 PINMUX_DATA(PORT58_KEYIN6_MARK, MSELBCR_MSEL2_1, PORT58_FN2),
643 PINMUX_DATA(HSU_CLK61M_MARK, PORT59_FN1),
644 PINMUX_DATA(PORT59_MSIOF2_SS1_MARK, PORT59_FN2),
645 PINMUX_DATA(HSU_XRST_MARK, PORT60_FN1),
646 PINMUX_DATA(PORT60_MSIOF2_SS2_MARK, PORT60_FN2),
647 PINMUX_DATA(PCMCLKO_MARK, PORT61_FN1),
648 PINMUX_DATA(SYNC8KO_MARK, PORT62_FN1),
649 PINMUX_DATA(DNPCM_A_MARK, PORT63_FN1),
650 PINMUX_DATA(UPPCM_A_MARK, PORT64_FN1),
651 PINMUX_DATA(XTALB1L_MARK, PORT65_FN1),
652 PINMUX_DATA(GPS_AGC1_MARK, PORT66_FN1),
653 PINMUX_DATA(SCIFA0_RTS_MARK, PORT66_FN2),
654 PINMUX_DATA(GPS_AGC2_MARK, PORT67_FN1),
655 PINMUX_DATA(SCIFA0_SCK_MARK, PORT67_FN2),
656 PINMUX_DATA(GPS_AGC3_MARK, PORT68_FN1),
657 PINMUX_DATA(SCIFA0_TXD_MARK, PORT68_FN2),
658 PINMUX_DATA(GPS_AGC4_MARK, PORT69_FN1),
659 PINMUX_DATA(SCIFA0_RXD_MARK, PORT69_FN2),
660 PINMUX_DATA(GPS_PWRD_MARK, PORT70_FN1),
661 PINMUX_DATA(SCIFA0_CTS_MARK, PORT70_FN2),
662 PINMUX_DATA(GPS_IM_MARK, PORT71_FN1),
663 PINMUX_DATA(GPS_IS_MARK, PORT72_FN1),
664 PINMUX_DATA(GPS_QM_MARK, PORT73_FN1),
665 PINMUX_DATA(GPS_QS_MARK, PORT74_FN1),
666 PINMUX_DATA(SIUBOMC_MARK, PORT75_FN1),
667 PINMUX_DATA(TPU2TO0_MARK, PORT75_FN3),
668 PINMUX_DATA(SIUCKB_MARK, PORT76_FN1),
669 PINMUX_DATA(TPU2TO1_MARK, PORT76_FN3),
670 PINMUX_DATA(SIUBOLR_MARK, PORT77_FN1),
671 PINMUX_DATA(BBIF2_TSYNC_MARK, PORT77_FN2),
672 PINMUX_DATA(TPU2TO2_MARK, PORT77_FN3),
673 PINMUX_DATA(SIUBOBT_MARK, PORT78_FN1),
674 PINMUX_DATA(BBIF2_TSCK_MARK, PORT78_FN2),
675 PINMUX_DATA(TPU2TO3_MARK, PORT78_FN3),
676 PINMUX_DATA(SIUBOSLD_MARK, PORT79_FN1),
677 PINMUX_DATA(BBIF2_TXD_MARK, PORT79_FN2),
678 PINMUX_DATA(TPU3TO0_MARK, PORT79_FN3),
679 PINMUX_DATA(SIUBILR_MARK, PORT80_FN1),
680 PINMUX_DATA(TPU3TO1_MARK, PORT80_FN3),
681 PINMUX_DATA(SIUBIBT_MARK, PORT81_FN1),
682 PINMUX_DATA(TPU3TO2_MARK, PORT81_FN3),
683 PINMUX_DATA(SIUBISLD_MARK, PORT82_FN1),
684 PINMUX_DATA(TPU3TO3_MARK, PORT82_FN3),
685 PINMUX_DATA(NMI_MARK, PORT83_FN1),
686 PINMUX_DATA(TPU4TO0_MARK, PORT83_FN3),
687 PINMUX_DATA(DNPCM_M_MARK, PORT84_FN1),
688 PINMUX_DATA(TPU4TO1_MARK, PORT84_FN3),
689 PINMUX_DATA(TPU4TO2_MARK, PORT85_FN3),
690 PINMUX_DATA(TPU4TO3_MARK, PORT86_FN3),
691 PINMUX_DATA(IRQ_TMPB_MARK, PORT87_FN1),
692 PINMUX_DATA(PWEN_MARK, PORT88_FN1),
693 PINMUX_DATA(MFG1_OUT1_MARK, PORT88_FN2),
694 PINMUX_DATA(OVCN_MARK, PORT89_FN1),
695 PINMUX_DATA(MFG1_IN1_MARK, PORT89_FN2),
696 PINMUX_DATA(OVCN2_MARK, PORT90_FN1),
697 PINMUX_DATA(MFG1_IN2_MARK, PORT90_FN2),
698
699 /* 49-3 (FN) */
700 PINMUX_DATA(RFSPO1_MARK, PORT91_FN1),
701 PINMUX_DATA(RFSPO2_MARK, PORT92_FN1),
702 PINMUX_DATA(RFSPO3_MARK, PORT93_FN1),
703 PINMUX_DATA(PORT93_VIO_CKO2_MARK, PORT93_FN2),
704 PINMUX_DATA(USBTERM_MARK, PORT94_FN1),
705 PINMUX_DATA(EXTLP_MARK, PORT94_FN2),
706 PINMUX_DATA(IDIN_MARK, PORT95_FN1),
707 PINMUX_DATA(SCIFA5_CTS_MARK, PORT96_FN1),
708 PINMUX_DATA(MFG0_IN1_MARK, PORT96_FN2),
709 PINMUX_DATA(SCIFA5_RTS_MARK, PORT97_FN1),
710 PINMUX_DATA(MFG0_IN2_MARK, PORT97_FN2),
711 PINMUX_DATA(SCIFA5_RXD_MARK, PORT98_FN1),
712 PINMUX_DATA(SCIFA5_TXD_MARK, PORT99_FN1),
713 PINMUX_DATA(SCIFA5_SCK_MARK, PORT100_FN1),
714 PINMUX_DATA(MFG0_OUT1_MARK, PORT100_FN2),
715 PINMUX_DATA(A0_EA0_MARK, PORT101_FN1),
716 PINMUX_DATA(BS_MARK, PORT101_FN2),
717 PINMUX_DATA(A14_EA14_MARK, PORT102_FN1),
718 PINMUX_DATA(PORT102_KEYOUT0_MARK, MSELBCR_MSEL2_0, PORT102_FN2),
719 PINMUX_DATA(A15_EA15_MARK, PORT103_FN1),
720 PINMUX_DATA(PORT103_KEYOUT1_MARK, MSELBCR_MSEL2_0, PORT103_FN2),
721 PINMUX_DATA(DV_CLKOL_MARK, PORT103_FN3),
722 PINMUX_DATA(A16_EA16_MARK, PORT104_FN1),
723 PINMUX_DATA(PORT104_KEYOUT2_MARK, MSELBCR_MSEL2_0, PORT104_FN2),
724 PINMUX_DATA(DV_VSYNCL_MARK, PORT104_FN3),
725 PINMUX_DATA(MSIOF0_SS1_MARK, PORT104_FN4),
726 PINMUX_DATA(A17_EA17_MARK, PORT105_FN1),
727 PINMUX_DATA(PORT105_KEYOUT3_MARK, MSELBCR_MSEL2_0, PORT105_FN2),
728 PINMUX_DATA(DV_HSYNCL_MARK, PORT105_FN3),
729 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT105_FN4),
730 PINMUX_DATA(A18_EA18_MARK, PORT106_FN1),
731 PINMUX_DATA(PORT106_KEYOUT4_MARK, MSELBCR_MSEL2_0, PORT106_FN2),
732 PINMUX_DATA(DV_DL0_MARK, PORT106_FN3),
733 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT106_FN4),
734 PINMUX_DATA(A19_EA19_MARK, PORT107_FN1),
735 PINMUX_DATA(PORT107_KEYOUT5_MARK, MSELBCR_MSEL2_0, PORT107_FN2),
736 PINMUX_DATA(DV_DL1_MARK, PORT107_FN3),
737 PINMUX_DATA(MSIOF0_TXD_MARK, PORT107_FN4),
738 PINMUX_DATA(A20_EA20_MARK, PORT108_FN1),
739 PINMUX_DATA(PORT108_KEYIN0_MARK, MSELBCR_MSEL2_0, PORT108_FN2),
740 PINMUX_DATA(DV_DL2_MARK, PORT108_FN3),
741 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT108_FN4),
742 PINMUX_DATA(A21_EA21_MARK, PORT109_FN1),
743 PINMUX_DATA(PORT109_KEYIN1_MARK, MSELBCR_MSEL2_0, PORT109_FN2),
744 PINMUX_DATA(DV_DL3_MARK, PORT109_FN3),
745 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT109_FN4),
746 PINMUX_DATA(A22_EA22_MARK, PORT110_FN1),
747 PINMUX_DATA(PORT110_KEYIN2_MARK, MSELBCR_MSEL2_0, PORT110_FN2),
748 PINMUX_DATA(DV_DL4_MARK, PORT110_FN3),
749 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT110_FN4),
750 PINMUX_DATA(A23_EA23_MARK, PORT111_FN1),
751 PINMUX_DATA(PORT111_KEYIN3_MARK, MSELBCR_MSEL2_0, PORT111_FN2),
752 PINMUX_DATA(DV_DL5_MARK, PORT111_FN3),
753 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT111_FN4),
754 PINMUX_DATA(A24_EA24_MARK, PORT112_FN1),
755 PINMUX_DATA(PORT112_KEYIN4_MARK, MSELBCR_MSEL2_0, PORT112_FN2),
756 PINMUX_DATA(DV_DL6_MARK, PORT112_FN3),
757 PINMUX_DATA(MSIOF0_RXD_MARK, PORT112_FN4),
758 PINMUX_DATA(A25_EA25_MARK, PORT113_FN1),
759 PINMUX_DATA(PORT113_KEYIN5_MARK, MSELBCR_MSEL2_0, PORT113_FN2),
760 PINMUX_DATA(DV_DL7_MARK, PORT113_FN3),
761 PINMUX_DATA(MSIOF0_SS2_MARK, PORT113_FN4),
762 PINMUX_DATA(A26_MARK, PORT114_FN1),
763 PINMUX_DATA(PORT113_KEYIN6_MARK, MSELBCR_MSEL2_0, PORT114_FN2),
764 PINMUX_DATA(DV_CLKIL_MARK, PORT114_FN3),
765 PINMUX_DATA(D0_ED0_NAF0_MARK, PORT115_FN1),
766 PINMUX_DATA(D1_ED1_NAF1_MARK, PORT116_FN1),
767 PINMUX_DATA(D2_ED2_NAF2_MARK, PORT117_FN1),
768 PINMUX_DATA(D3_ED3_NAF3_MARK, PORT118_FN1),
769 PINMUX_DATA(D4_ED4_NAF4_MARK, PORT119_FN1),
770 PINMUX_DATA(D5_ED5_NAF5_MARK, PORT120_FN1),
771 PINMUX_DATA(D6_ED6_NAF6_MARK, PORT121_FN1),
772 PINMUX_DATA(D7_ED7_NAF7_MARK, PORT122_FN1),
773 PINMUX_DATA(D8_ED8_NAF8_MARK, PORT123_FN1),
774 PINMUX_DATA(D9_ED9_NAF9_MARK, PORT124_FN1),
775 PINMUX_DATA(D10_ED10_NAF10_MARK, PORT125_FN1),
776 PINMUX_DATA(D11_ED11_NAF11_MARK, PORT126_FN1),
777 PINMUX_DATA(D12_ED12_NAF12_MARK, PORT127_FN1),
778 PINMUX_DATA(D13_ED13_NAF13_MARK, PORT128_FN1),
779 PINMUX_DATA(D14_ED14_NAF14_MARK, PORT129_FN1),
780 PINMUX_DATA(D15_ED15_NAF15_MARK, PORT130_FN1),
781 PINMUX_DATA(CS4_MARK, PORT131_FN1),
782 PINMUX_DATA(CS5A_MARK, PORT132_FN1),
783 PINMUX_DATA(CS5B_MARK, PORT133_FN1),
784 PINMUX_DATA(FCE1_MARK, PORT133_FN2),
785 PINMUX_DATA(CS6B_MARK, PORT134_FN1),
786 PINMUX_DATA(XCS2_MARK, PORT134_FN2),
787 PINMUX_DATA(FCE0_MARK, PORT135_FN1),
788 PINMUX_DATA(CS6A_MARK, PORT136_FN1),
789 PINMUX_DATA(DACK0_MARK, PORT136_FN2),
790 PINMUX_DATA(WAIT_MARK, PORT137_FN1),
791 PINMUX_DATA(DREQ0_MARK, PORT137_FN2),
792 PINMUX_DATA(RD_XRD_MARK, PORT138_FN1),
793 PINMUX_DATA(A27_MARK, PORT139_FN1),
794 PINMUX_DATA(RDWR_XWE_MARK, PORT139_FN2),
795 PINMUX_DATA(WE0_XWR0_FWE_MARK, PORT140_FN1),
796 PINMUX_DATA(WE1_XWR1_MARK, PORT141_FN1),
797 PINMUX_DATA(FRB_MARK, PORT142_FN1),
798 PINMUX_DATA(CKO_MARK, PORT143_FN1),
799 PINMUX_DATA(NBRSTOUT_MARK, PORT144_FN1),
800 PINMUX_DATA(NBRST_MARK, PORT145_FN1),
801
802 /* 49-4 (FN) */
803 PINMUX_DATA(RFSPO0_MARK, PORT146_FN1),
804 PINMUX_DATA(PORT146_VIO_CKO2_MARK, PORT146_FN2),
805 PINMUX_DATA(TSTMD_MARK, PORT147_FN1),
806 PINMUX_DATA(VIO_VD_MARK, PORT148_FN1),
807 PINMUX_DATA(VIO_HD_MARK, PORT149_FN1),
808 PINMUX_DATA(VIO_D0_MARK, PORT150_FN1),
809 PINMUX_DATA(VIO_D1_MARK, PORT151_FN1),
810 PINMUX_DATA(VIO_D2_MARK, PORT152_FN1),
811 PINMUX_DATA(VIO_D3_MARK, PORT153_FN1),
812 PINMUX_DATA(VIO_D4_MARK, PORT154_FN1),
813 PINMUX_DATA(VIO_D5_MARK, PORT155_FN1),
814 PINMUX_DATA(VIO_D6_MARK, PORT156_FN1),
815 PINMUX_DATA(VIO_D7_MARK, PORT157_FN1),
816 PINMUX_DATA(VIO_D8_MARK, PORT158_FN1),
817 PINMUX_DATA(VIO_D9_MARK, PORT159_FN1),
818 PINMUX_DATA(VIO_D10_MARK, PORT160_FN1),
819 PINMUX_DATA(VIO_D11_MARK, PORT161_FN1),
820 PINMUX_DATA(VIO_D12_MARK, PORT162_FN1),
821 PINMUX_DATA(VIO_D13_MARK, PORT163_FN1),
822 PINMUX_DATA(VIO_D14_MARK, PORT164_FN1),
823 PINMUX_DATA(VIO_D15_MARK, PORT165_FN1),
824 PINMUX_DATA(VIO_CLK_MARK, PORT166_FN1),
825 PINMUX_DATA(VIO_FIELD_MARK, PORT167_FN1),
826 PINMUX_DATA(VIO_CKO_MARK, PORT168_FN1),
827 PINMUX_DATA(MFG3_IN1_MARK, PORT169_FN2),
828 PINMUX_DATA(MFG3_IN2_MARK, PORT170_FN2),
829 PINMUX_DATA(M9_SLCD_A01_MARK, PORT171_FN1),
830 PINMUX_DATA(MFG3_OUT1_MARK, PORT171_FN2),
831 PINMUX_DATA(TPU0TO0_MARK, PORT171_FN3),
832 PINMUX_DATA(M10_SLCD_CK1_MARK, PORT172_FN1),
833 PINMUX_DATA(MFG4_IN1_MARK, PORT172_FN2),
834 PINMUX_DATA(TPU0TO1_MARK, PORT172_FN3),
835 PINMUX_DATA(M11_SLCD_SO1_MARK, PORT173_FN1),
836 PINMUX_DATA(MFG4_IN2_MARK, PORT173_FN2),
837 PINMUX_DATA(TPU0TO2_MARK, PORT173_FN3),
838 PINMUX_DATA(M12_SLCD_CE1_MARK, PORT174_FN1),
839 PINMUX_DATA(MFG4_OUT1_MARK, PORT174_FN2),
840 PINMUX_DATA(TPU0TO3_MARK, PORT174_FN3),
841 PINMUX_DATA(LCDD0_MARK, PORT175_FN1),
842 PINMUX_DATA(PORT175_KEYOUT0_MARK, PORT175_FN2),
843 PINMUX_DATA(DV_D0_MARK, PORT175_FN3),
844 PINMUX_DATA(SIUCKA_MARK, PORT175_FN4),
845 PINMUX_DATA(MFG0_OUT2_MARK, PORT175_FN5),
846 PINMUX_DATA(LCDD1_MARK, PORT176_FN1),
847 PINMUX_DATA(PORT176_KEYOUT1_MARK, PORT176_FN2),
848 PINMUX_DATA(DV_D1_MARK, PORT176_FN3),
849 PINMUX_DATA(SIUAOLR_MARK, PORT176_FN4),
850 PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT176_FN5),
851 PINMUX_DATA(LCDD2_MARK, PORT177_FN1),
852 PINMUX_DATA(PORT177_KEYOUT2_MARK, PORT177_FN2),
853 PINMUX_DATA(DV_D2_MARK, PORT177_FN3),
854 PINMUX_DATA(SIUAOBT_MARK, PORT177_FN4),
855 PINMUX_DATA(BBIF2_TSCK1_MARK, PORT177_FN5),
856 PINMUX_DATA(LCDD3_MARK, PORT178_FN1),
857 PINMUX_DATA(PORT178_KEYOUT3_MARK, PORT178_FN2),
858 PINMUX_DATA(DV_D3_MARK, PORT178_FN3),
859 PINMUX_DATA(SIUAOSLD_MARK, PORT178_FN4),
860 PINMUX_DATA(BBIF2_TXD1_MARK, PORT178_FN5),
861 PINMUX_DATA(LCDD4_MARK, PORT179_FN1),
862 PINMUX_DATA(PORT179_KEYOUT4_MARK, PORT179_FN2),
863 PINMUX_DATA(DV_D4_MARK, PORT179_FN3),
864 PINMUX_DATA(SIUAISPD_MARK, PORT179_FN4),
865 PINMUX_DATA(MFG1_OUT2_MARK, PORT179_FN5),
866 PINMUX_DATA(LCDD5_MARK, PORT180_FN1),
867 PINMUX_DATA(PORT180_KEYOUT5_MARK, PORT180_FN2),
868 PINMUX_DATA(DV_D5_MARK, PORT180_FN3),
869 PINMUX_DATA(SIUAILR_MARK, PORT180_FN4),
870 PINMUX_DATA(MFG2_OUT2_MARK, PORT180_FN5),
871 PINMUX_DATA(LCDD6_MARK, PORT181_FN1),
872 PINMUX_DATA(DV_D6_MARK, PORT181_FN3),
873 PINMUX_DATA(SIUAIBT_MARK, PORT181_FN4),
874 PINMUX_DATA(MFG3_OUT2_MARK, PORT181_FN5),
875 PINMUX_DATA(XWR2_MARK, PORT181_FN7),
876 PINMUX_DATA(LCDD7_MARK, PORT182_FN1),
877 PINMUX_DATA(DV_D7_MARK, PORT182_FN3),
878 PINMUX_DATA(SIUAISLD_MARK, PORT182_FN4),
879 PINMUX_DATA(MFG4_OUT2_MARK, PORT182_FN5),
880 PINMUX_DATA(XWR3_MARK, PORT182_FN7),
881 PINMUX_DATA(LCDD8_MARK, PORT183_FN1),
882 PINMUX_DATA(DV_D8_MARK, PORT183_FN3),
883 PINMUX_DATA(D16_MARK, PORT183_FN6),
884 PINMUX_DATA(ED16_MARK, PORT183_FN7),
885 PINMUX_DATA(LCDD9_MARK, PORT184_FN1),
886 PINMUX_DATA(DV_D9_MARK, PORT184_FN3),
887 PINMUX_DATA(D17_MARK, PORT184_FN6),
888 PINMUX_DATA(ED17_MARK, PORT184_FN7),
889 PINMUX_DATA(LCDD10_MARK, PORT185_FN1),
890 PINMUX_DATA(DV_D10_MARK, PORT185_FN3),
891 PINMUX_DATA(D18_MARK, PORT185_FN6),
892 PINMUX_DATA(ED18_MARK, PORT185_FN7),
893 PINMUX_DATA(LCDD11_MARK, PORT186_FN1),
894 PINMUX_DATA(DV_D11_MARK, PORT186_FN3),
895 PINMUX_DATA(D19_MARK, PORT186_FN6),
896 PINMUX_DATA(ED19_MARK, PORT186_FN7),
897 PINMUX_DATA(LCDD12_MARK, PORT187_FN1),
898 PINMUX_DATA(DV_D12_MARK, PORT187_FN3),
899 PINMUX_DATA(D20_MARK, PORT187_FN6),
900 PINMUX_DATA(ED20_MARK, PORT187_FN7),
901 PINMUX_DATA(LCDD13_MARK, PORT188_FN1),
902 PINMUX_DATA(DV_D13_MARK, PORT188_FN3),
903 PINMUX_DATA(D21_MARK, PORT188_FN6),
904 PINMUX_DATA(ED21_MARK, PORT188_FN7),
905 PINMUX_DATA(LCDD14_MARK, PORT189_FN1),
906 PINMUX_DATA(DV_D14_MARK, PORT189_FN3),
907 PINMUX_DATA(D22_MARK, PORT189_FN6),
908 PINMUX_DATA(ED22_MARK, PORT189_FN7),
909 PINMUX_DATA(LCDD15_MARK, PORT190_FN1),
910 PINMUX_DATA(DV_D15_MARK, PORT190_FN3),
911 PINMUX_DATA(D23_MARK, PORT190_FN6),
912 PINMUX_DATA(ED23_MARK, PORT190_FN7),
913 PINMUX_DATA(LCDD16_MARK, PORT191_FN1),
914 PINMUX_DATA(DV_HSYNC_MARK, PORT191_FN3),
915 PINMUX_DATA(D24_MARK, PORT191_FN6),
916 PINMUX_DATA(ED24_MARK, PORT191_FN7),
917 PINMUX_DATA(LCDD17_MARK, PORT192_FN1),
918 PINMUX_DATA(DV_VSYNC_MARK, PORT192_FN3),
919 PINMUX_DATA(D25_MARK, PORT192_FN6),
920 PINMUX_DATA(ED25_MARK, PORT192_FN7),
921 PINMUX_DATA(LCDD18_MARK, PORT193_FN1),
922 PINMUX_DATA(DREQ2_MARK, PORT193_FN2),
923 PINMUX_DATA(MSIOF0L_TSCK_MARK, PORT193_FN5),
924 PINMUX_DATA(D26_MARK, PORT193_FN6),
925 PINMUX_DATA(ED26_MARK, PORT193_FN7),
926 PINMUX_DATA(LCDD19_MARK, PORT194_FN1),
927 PINMUX_DATA(MSIOF0L_TSYNC_MARK, PORT194_FN5),
928 PINMUX_DATA(D27_MARK, PORT194_FN6),
929 PINMUX_DATA(ED27_MARK, PORT194_FN7),
930 PINMUX_DATA(LCDD20_MARK, PORT195_FN1),
931 PINMUX_DATA(TS_SPSYNC1_MARK, PORT195_FN2),
932 PINMUX_DATA(MSIOF0L_MCK0_MARK, PORT195_FN5),
933 PINMUX_DATA(D28_MARK, PORT195_FN6),
934 PINMUX_DATA(ED28_MARK, PORT195_FN7),
935 PINMUX_DATA(LCDD21_MARK, PORT196_FN1),
936 PINMUX_DATA(TS_SDAT1_MARK, PORT196_FN2),
937 PINMUX_DATA(MSIOF0L_MCK1_MARK, PORT196_FN5),
938 PINMUX_DATA(D29_MARK, PORT196_FN6),
939 PINMUX_DATA(ED29_MARK, PORT196_FN7),
940 PINMUX_DATA(LCDD22_MARK, PORT197_FN1),
941 PINMUX_DATA(TS_SDEN1_MARK, PORT197_FN2),
942 PINMUX_DATA(MSIOF0L_SS1_MARK, PORT197_FN5),
943 PINMUX_DATA(D30_MARK, PORT197_FN6),
944 PINMUX_DATA(ED30_MARK, PORT197_FN7),
945 PINMUX_DATA(LCDD23_MARK, PORT198_FN1),
946 PINMUX_DATA(TS_SCK1_MARK, PORT198_FN2),
947 PINMUX_DATA(MSIOF0L_SS2_MARK, PORT198_FN5),
948 PINMUX_DATA(D31_MARK, PORT198_FN6),
949 PINMUX_DATA(ED31_MARK, PORT198_FN7),
950 PINMUX_DATA(LCDDCK_MARK, PORT199_FN1),
951 PINMUX_DATA(LCDWR_MARK, PORT199_FN2),
952 PINMUX_DATA(DV_CKO_MARK, PORT199_FN3),
953 PINMUX_DATA(SIUAOSPD_MARK, PORT199_FN4),
954 PINMUX_DATA(LCDRD_MARK, PORT200_FN1),
955 PINMUX_DATA(DACK2_MARK, PORT200_FN2),
956 PINMUX_DATA(MSIOF0L_RSYNC_MARK, PORT200_FN5),
957
958 /* 49-5 (FN) */
959 PINMUX_DATA(LCDHSYN_MARK, PORT201_FN1),
960 PINMUX_DATA(LCDCS_MARK, PORT201_FN2),
961 PINMUX_DATA(LCDCS2_MARK, PORT201_FN3),
962 PINMUX_DATA(DACK3_MARK, PORT201_FN4),
963 PINMUX_DATA(LCDDISP_MARK, PORT202_FN1),
964 PINMUX_DATA(LCDRS_MARK, PORT202_FN2),
965 PINMUX_DATA(DREQ3_MARK, PORT202_FN4),
966 PINMUX_DATA(MSIOF0L_RSCK_MARK, PORT202_FN5),
967 PINMUX_DATA(LCDCSYN_MARK, PORT203_FN1),
968 PINMUX_DATA(LCDCSYN2_MARK, PORT203_FN2),
969 PINMUX_DATA(DV_CKI_MARK, PORT203_FN3),
970 PINMUX_DATA(LCDLCLK_MARK, PORT204_FN1),
971 PINMUX_DATA(DREQ1_MARK, PORT204_FN3),
972 PINMUX_DATA(MSIOF0L_RXD_MARK, PORT204_FN5),
973 PINMUX_DATA(LCDDON_MARK, PORT205_FN1),
974 PINMUX_DATA(LCDDON2_MARK, PORT205_FN2),
975 PINMUX_DATA(DACK1_MARK, PORT205_FN3),
976 PINMUX_DATA(MSIOF0L_TXD_MARK, PORT205_FN5),
977 PINMUX_DATA(VIO_DR0_MARK, PORT206_FN1),
978 PINMUX_DATA(VIO_DR1_MARK, PORT207_FN1),
979 PINMUX_DATA(VIO_DR2_MARK, PORT208_FN1),
980 PINMUX_DATA(VIO_DR3_MARK, PORT209_FN1),
981 PINMUX_DATA(VIO_DR4_MARK, PORT210_FN1),
982 PINMUX_DATA(VIO_DR5_MARK, PORT211_FN1),
983 PINMUX_DATA(VIO_DR6_MARK, PORT212_FN1),
984 PINMUX_DATA(VIO_DR7_MARK, PORT213_FN1),
985 PINMUX_DATA(VIO_VDR_MARK, PORT214_FN1),
986 PINMUX_DATA(VIO_HDR_MARK, PORT215_FN1),
987 PINMUX_DATA(VIO_CLKR_MARK, PORT216_FN1),
988 PINMUX_DATA(VIO_CKOR_MARK, PORT217_FN1),
989 PINMUX_DATA(SCIFA1_TXD_MARK, PORT220_FN2),
990 PINMUX_DATA(GPS_PGFA0_MARK, PORT220_FN3),
991 PINMUX_DATA(SCIFA1_SCK_MARK, PORT221_FN2),
992 PINMUX_DATA(GPS_PGFA1_MARK, PORT221_FN3),
993 PINMUX_DATA(SCIFA1_RTS_MARK, PORT222_FN2),
994 PINMUX_DATA(GPS_EPPSINMON_MARK, PORT222_FN3),
995 PINMUX_DATA(SCIFA1_RXD_MARK, PORT223_FN2),
996 PINMUX_DATA(SCIFA1_CTS_MARK, PORT224_FN2),
997 PINMUX_DATA(MSIOF1_TXD_MARK, PORT225_FN1),
998 PINMUX_DATA(SCIFA1_TXD2_MARK, PORT225_FN2),
999 PINMUX_DATA(GPS_TXD_MARK, PORT225_FN3),
1000 PINMUX_DATA(MSIOF1_TSYNC_MARK, PORT226_FN1),
1001 PINMUX_DATA(SCIFA1_CTS2_MARK, PORT226_FN2),
1002 PINMUX_DATA(I2C_SDA2_MARK, PORT226_FN3),
1003 PINMUX_DATA(MSIOF1_TSCK_MARK, PORT227_FN1),
1004 PINMUX_DATA(SCIFA1_SCK2_MARK, PORT227_FN2),
1005 PINMUX_DATA(MSIOF1_RXD_MARK, PORT228_FN1),
1006 PINMUX_DATA(SCIFA1_RXD2_MARK, PORT228_FN2),
1007 PINMUX_DATA(GPS_RXD_MARK, PORT228_FN3),
1008 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT229_FN1),
1009 PINMUX_DATA(SCIFA1_RTS2_MARK, PORT229_FN2),
1010 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT230_FN1),
1011 PINMUX_DATA(I2C_SCL2_MARK, PORT230_FN3),
1012 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT231_FN1),
1013 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT232_FN1),
1014 PINMUX_DATA(MSIOF1_SS1_MARK, PORT233_FN1),
1015 PINMUX_DATA(EDBGREQ3_MARK, PORT233_FN2),
1016 PINMUX_DATA(MSIOF1_SS2_MARK, PORT234_FN1),
1017 PINMUX_DATA(PORT236_IROUT_MARK, PORT236_FN1),
1018 PINMUX_DATA(IRDA_OUT_MARK, PORT236_FN2),
1019 PINMUX_DATA(IRDA_IN_MARK, PORT237_FN2),
1020 PINMUX_DATA(IRDA_FIRSEL_MARK, PORT238_FN1),
1021 PINMUX_DATA(TPU1TO0_MARK, PORT239_FN3),
1022 PINMUX_DATA(TS_SPSYNC3_MARK, PORT239_FN4),
1023 PINMUX_DATA(TPU1TO1_MARK, PORT240_FN3),
1024 PINMUX_DATA(TS_SDAT3_MARK, PORT240_FN4),
1025 PINMUX_DATA(TPU1TO2_MARK, PORT241_FN3),
1026 PINMUX_DATA(TS_SDEN3_MARK, PORT241_FN4),
1027 PINMUX_DATA(PORT241_MSIOF2_SS1_MARK, PORT241_FN5),
1028 PINMUX_DATA(TPU1TO3_MARK, PORT242_FN3),
1029 PINMUX_DATA(PORT242_MSIOF2_TSCK_MARK, PORT242_FN5),
1030 PINMUX_DATA(M13_BSW_MARK, PORT243_FN2),
1031 PINMUX_DATA(PORT243_MSIOF2_TSYNC_MARK, PORT243_FN5),
1032 PINMUX_DATA(M14_GSW_MARK, PORT244_FN2),
1033 PINMUX_DATA(PORT244_MSIOF2_TXD_MARK, PORT244_FN5),
1034 PINMUX_DATA(PORT245_IROUT_MARK, PORT245_FN1),
1035 PINMUX_DATA(M15_RSW_MARK, PORT245_FN2),
1036 PINMUX_DATA(SOUT3_MARK, PORT246_FN1),
1037 PINMUX_DATA(SCIFA2_TXD1_MARK, PORT246_FN2),
1038 PINMUX_DATA(SIN3_MARK, PORT247_FN1),
1039 PINMUX_DATA(SCIFA2_RXD1_MARK, PORT247_FN2),
1040 PINMUX_DATA(XRTS3_MARK, PORT248_FN1),
1041 PINMUX_DATA(SCIFA2_RTS1_MARK, PORT248_FN2),
1042 PINMUX_DATA(PORT248_MSIOF2_SS2_MARK, PORT248_FN5),
1043 PINMUX_DATA(XCTS3_MARK, PORT249_FN1),
1044 PINMUX_DATA(SCIFA2_CTS1_MARK, PORT249_FN2),
1045 PINMUX_DATA(PORT249_MSIOF2_RXD_MARK, PORT249_FN5),
1046 PINMUX_DATA(DINT_MARK, PORT250_FN1),
1047 PINMUX_DATA(SCIFA2_SCK1_MARK, PORT250_FN2),
1048 PINMUX_DATA(TS_SCK3_MARK, PORT250_FN4),
1049 PINMUX_DATA(SDHICLK0_MARK, PORT251_FN1),
1050 PINMUX_DATA(TCK2_MARK, PORT251_FN2),
1051 PINMUX_DATA(SDHICD0_MARK, PORT252_FN1),
1052 PINMUX_DATA(SDHID0_0_MARK, PORT253_FN1),
1053 PINMUX_DATA(TMS2_MARK, PORT253_FN2),
1054 PINMUX_DATA(SDHID0_1_MARK, PORT254_FN1),
1055 PINMUX_DATA(TDO2_MARK, PORT254_FN2),
1056 PINMUX_DATA(SDHID0_2_MARK, PORT255_FN1),
1057 PINMUX_DATA(TDI2_MARK, PORT255_FN2),
1058 PINMUX_DATA(SDHID0_3_MARK, PORT256_FN1),
1059 PINMUX_DATA(RTCK2_MARK, PORT256_FN2),
1060
1061 /* 49-6 (FN) */
1062 PINMUX_DATA(SDHICMD0_MARK, PORT257_FN1),
1063 PINMUX_DATA(TRST2_MARK, PORT257_FN2),
1064 PINMUX_DATA(SDHIWP0_MARK, PORT258_FN1),
1065 PINMUX_DATA(EDBGREQ2_MARK, PORT258_FN2),
1066 PINMUX_DATA(SDHICLK1_MARK, PORT259_FN1),
1067 PINMUX_DATA(TCK3_MARK, PORT259_FN4),
1068 PINMUX_DATA(SDHID1_0_MARK, PORT260_FN1),
1069 PINMUX_DATA(M11_SLCD_SO2_MARK, PORT260_FN2),
1070 PINMUX_DATA(TS_SPSYNC2_MARK, PORT260_FN3),
1071 PINMUX_DATA(TMS3_MARK, PORT260_FN4),
1072 PINMUX_DATA(SDHID1_1_MARK, PORT261_FN1),
1073 PINMUX_DATA(M9_SLCD_AO2_MARK, PORT261_FN2),
1074 PINMUX_DATA(TS_SDAT2_MARK, PORT261_FN3),
1075 PINMUX_DATA(TDO3_MARK, PORT261_FN4),
1076 PINMUX_DATA(SDHID1_2_MARK, PORT262_FN1),
1077 PINMUX_DATA(M10_SLCD_CK2_MARK, PORT262_FN2),
1078 PINMUX_DATA(TS_SDEN2_MARK, PORT262_FN3),
1079 PINMUX_DATA(TDI3_MARK, PORT262_FN4),
1080 PINMUX_DATA(SDHID1_3_MARK, PORT263_FN1),
1081 PINMUX_DATA(M12_SLCD_CE2_MARK, PORT263_FN2),
1082 PINMUX_DATA(TS_SCK2_MARK, PORT263_FN3),
1083 PINMUX_DATA(RTCK3_MARK, PORT263_FN4),
1084 PINMUX_DATA(SDHICMD1_MARK, PORT264_FN1),
1085 PINMUX_DATA(TRST3_MARK, PORT264_FN4),
1086 PINMUX_DATA(SDHICLK2_MARK, PORT265_FN1),
1087 PINMUX_DATA(SCIFB_SCK_MARK, PORT265_FN2),
1088 PINMUX_DATA(SDHID2_0_MARK, PORT266_FN1),
1089 PINMUX_DATA(SCIFB_TXD_MARK, PORT266_FN2),
1090 PINMUX_DATA(SDHID2_1_MARK, PORT267_FN1),
1091 PINMUX_DATA(SCIFB_CTS_MARK, PORT267_FN2),
1092 PINMUX_DATA(SDHID2_2_MARK, PORT268_FN1),
1093 PINMUX_DATA(SCIFB_RXD_MARK, PORT268_FN2),
1094 PINMUX_DATA(SDHID2_3_MARK, PORT269_FN1),
1095 PINMUX_DATA(SCIFB_RTS_MARK, PORT269_FN2),
1096 PINMUX_DATA(SDHICMD2_MARK, PORT270_FN1),
1097 PINMUX_DATA(RESETOUTS_MARK, PORT271_FN1),
1098 PINMUX_DATA(DIVLOCK_MARK, PORT272_FN1),
1099};
1100
1101#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
1102#define GPIO_PORT_273() _273(_GPIO_PORT, , unused)
1103#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
1104
1105static struct pinmux_gpio pinmux_gpios[] = {
1106 /* 49-1 -> 49-6 (GPIO) */
1107 GPIO_PORT_273(),
1108
1109 /* Special Pull-up / Pull-down Functions */
1110 GPIO_FN(PORT48_KEYIN0_PU), GPIO_FN(PORT49_KEYIN1_PU),
1111 GPIO_FN(PORT50_KEYIN2_PU), GPIO_FN(PORT55_KEYIN3_PU),
1112 GPIO_FN(PORT56_KEYIN4_PU), GPIO_FN(PORT57_KEYIN5_PU),
1113 GPIO_FN(PORT58_KEYIN6_PU),
1114
1115 /* 49-1 (FN) */
1116 GPIO_FN(VBUS0), GPIO_FN(CPORT0), GPIO_FN(CPORT1), GPIO_FN(CPORT2),
1117 GPIO_FN(CPORT3), GPIO_FN(CPORT4), GPIO_FN(CPORT5), GPIO_FN(CPORT6),
1118 GPIO_FN(CPORT7), GPIO_FN(CPORT8), GPIO_FN(CPORT9), GPIO_FN(CPORT10),
1119 GPIO_FN(CPORT11), GPIO_FN(SIN2), GPIO_FN(CPORT12), GPIO_FN(XCTS2),
1120 GPIO_FN(CPORT13), GPIO_FN(RFSPO4), GPIO_FN(CPORT14), GPIO_FN(RFSPO5),
1121 GPIO_FN(CPORT15), GPIO_FN(CPORT16), GPIO_FN(CPORT17), GPIO_FN(SOUT2),
1122 GPIO_FN(CPORT18), GPIO_FN(XRTS2), GPIO_FN(CPORT19), GPIO_FN(CPORT20),
1123 GPIO_FN(RFSPO6), GPIO_FN(CPORT21), GPIO_FN(STATUS0), GPIO_FN(CPORT22),
1124 GPIO_FN(STATUS1), GPIO_FN(CPORT23), GPIO_FN(STATUS2), GPIO_FN(RFSPO7),
1125 GPIO_FN(MPORT0), GPIO_FN(MPORT1), GPIO_FN(B_SYNLD1), GPIO_FN(B_SYNLD2),
1126 GPIO_FN(XMAINPS), GPIO_FN(XDIVPS), GPIO_FN(XIDRST), GPIO_FN(IDCLK),
1127 GPIO_FN(IDIO), GPIO_FN(SOUT1), GPIO_FN(SCIFA4_TXD),
1128 GPIO_FN(M02_BERDAT), GPIO_FN(SIN1), GPIO_FN(SCIFA4_RXD), GPIO_FN(XWUP),
1129 GPIO_FN(XRTS1), GPIO_FN(SCIFA4_RTS), GPIO_FN(M03_BERCLK),
1130 GPIO_FN(XCTS1), GPIO_FN(SCIFA4_CTS),
1131
1132 /* 49-2 (FN) */
1133 GPIO_FN(HSU_IQ_AGC6), GPIO_FN(MFG2_IN2), GPIO_FN(MSIOF2_MCK0),
1134 GPIO_FN(HSU_IQ_AGC5), GPIO_FN(MFG2_IN1), GPIO_FN(MSIOF2_MCK1),
1135 GPIO_FN(HSU_IQ_AGC4), GPIO_FN(MSIOF2_RSYNC),
1136 GPIO_FN(HSU_IQ_AGC3), GPIO_FN(MFG2_OUT1), GPIO_FN(MSIOF2_RSCK),
1137 GPIO_FN(HSU_IQ_AGC2), GPIO_FN(PORT42_KEYOUT0),
1138 GPIO_FN(HSU_IQ_AGC1), GPIO_FN(PORT43_KEYOUT1),
1139 GPIO_FN(HSU_IQ_AGC0), GPIO_FN(PORT44_KEYOUT2),
1140 GPIO_FN(HSU_IQ_AGC_ST), GPIO_FN(PORT45_KEYOUT3),
1141 GPIO_FN(HSU_IQ_PDO), GPIO_FN(PORT46_KEYOUT4),
1142 GPIO_FN(HSU_IQ_PYO), GPIO_FN(PORT47_KEYOUT5),
1143 GPIO_FN(HSU_EN_TXMUX_G3MO), GPIO_FN(PORT48_KEYIN0),
1144 GPIO_FN(HSU_I_TXMUX_G3MO), GPIO_FN(PORT49_KEYIN1),
1145 GPIO_FN(HSU_Q_TXMUX_G3MO), GPIO_FN(PORT50_KEYIN2),
1146 GPIO_FN(HSU_SYO), GPIO_FN(PORT51_MSIOF2_TSYNC),
1147 GPIO_FN(HSU_SDO), GPIO_FN(PORT52_MSIOF2_TSCK),
1148 GPIO_FN(HSU_TGTTI_G3MO), GPIO_FN(PORT53_MSIOF2_TXD),
1149 GPIO_FN(B_TIME_STAMP), GPIO_FN(PORT54_MSIOF2_RXD),
1150 GPIO_FN(HSU_SDI), GPIO_FN(PORT55_KEYIN3),
1151 GPIO_FN(HSU_SCO), GPIO_FN(PORT56_KEYIN4),
1152 GPIO_FN(HSU_DREQ), GPIO_FN(PORT57_KEYIN5),
1153 GPIO_FN(HSU_DACK), GPIO_FN(PORT58_KEYIN6),
1154 GPIO_FN(HSU_CLK61M), GPIO_FN(PORT59_MSIOF2_SS1),
1155 GPIO_FN(HSU_XRST), GPIO_FN(PORT60_MSIOF2_SS2),
1156 GPIO_FN(PCMCLKO), GPIO_FN(SYNC8KO), GPIO_FN(DNPCM_A), GPIO_FN(UPPCM_A),
1157 GPIO_FN(XTALB1L),
1158 GPIO_FN(GPS_AGC1), GPIO_FN(SCIFA0_RTS),
1159 GPIO_FN(GPS_AGC2), GPIO_FN(SCIFA0_SCK),
1160 GPIO_FN(GPS_AGC3), GPIO_FN(SCIFA0_TXD),
1161 GPIO_FN(GPS_AGC4), GPIO_FN(SCIFA0_RXD),
1162 GPIO_FN(GPS_PWRD), GPIO_FN(SCIFA0_CTS),
1163 GPIO_FN(GPS_IM), GPIO_FN(GPS_IS), GPIO_FN(GPS_QM), GPIO_FN(GPS_QS),
1164 GPIO_FN(SIUBOMC), GPIO_FN(TPU2TO0),
1165 GPIO_FN(SIUCKB), GPIO_FN(TPU2TO1),
1166 GPIO_FN(SIUBOLR), GPIO_FN(BBIF2_TSYNC), GPIO_FN(TPU2TO2),
1167 GPIO_FN(SIUBOBT), GPIO_FN(BBIF2_TSCK), GPIO_FN(TPU2TO3),
1168 GPIO_FN(SIUBOSLD), GPIO_FN(BBIF2_TXD), GPIO_FN(TPU3TO0),
1169 GPIO_FN(SIUBILR), GPIO_FN(TPU3TO1),
1170 GPIO_FN(SIUBIBT), GPIO_FN(TPU3TO2),
1171 GPIO_FN(SIUBISLD), GPIO_FN(TPU3TO3),
1172 GPIO_FN(NMI), GPIO_FN(TPU4TO0),
1173 GPIO_FN(DNPCM_M), GPIO_FN(TPU4TO1), GPIO_FN(TPU4TO2), GPIO_FN(TPU4TO3),
1174 GPIO_FN(IRQ_TMPB),
1175 GPIO_FN(PWEN), GPIO_FN(MFG1_OUT1),
1176 GPIO_FN(OVCN), GPIO_FN(MFG1_IN1),
1177 GPIO_FN(OVCN2), GPIO_FN(MFG1_IN2),
1178
1179 /* 49-3 (FN) */
1180 GPIO_FN(RFSPO1), GPIO_FN(RFSPO2), GPIO_FN(RFSPO3),
1181 GPIO_FN(PORT93_VIO_CKO2),
1182 GPIO_FN(USBTERM), GPIO_FN(EXTLP), GPIO_FN(IDIN),
1183 GPIO_FN(SCIFA5_CTS), GPIO_FN(MFG0_IN1),
1184 GPIO_FN(SCIFA5_RTS), GPIO_FN(MFG0_IN2),
1185 GPIO_FN(SCIFA5_RXD),
1186 GPIO_FN(SCIFA5_TXD),
1187 GPIO_FN(SCIFA5_SCK), GPIO_FN(MFG0_OUT1),
1188 GPIO_FN(A0_EA0), GPIO_FN(BS),
1189 GPIO_FN(A14_EA14), GPIO_FN(PORT102_KEYOUT0),
1190 GPIO_FN(A15_EA15), GPIO_FN(PORT103_KEYOUT1), GPIO_FN(DV_CLKOL),
1191 GPIO_FN(A16_EA16), GPIO_FN(PORT104_KEYOUT2),
1192 GPIO_FN(DV_VSYNCL), GPIO_FN(MSIOF0_SS1),
1193 GPIO_FN(A17_EA17), GPIO_FN(PORT105_KEYOUT3),
1194 GPIO_FN(DV_HSYNCL), GPIO_FN(MSIOF0_TSYNC),
1195 GPIO_FN(A18_EA18), GPIO_FN(PORT106_KEYOUT4),
1196 GPIO_FN(DV_DL0), GPIO_FN(MSIOF0_TSCK),
1197 GPIO_FN(A19_EA19), GPIO_FN(PORT107_KEYOUT5),
1198 GPIO_FN(DV_DL1), GPIO_FN(MSIOF0_TXD),
1199 GPIO_FN(A20_EA20), GPIO_FN(PORT108_KEYIN0),
1200 GPIO_FN(DV_DL2), GPIO_FN(MSIOF0_RSCK),
1201 GPIO_FN(A21_EA21), GPIO_FN(PORT109_KEYIN1),
1202 GPIO_FN(DV_DL3), GPIO_FN(MSIOF0_RSYNC),
1203 GPIO_FN(A22_EA22), GPIO_FN(PORT110_KEYIN2),
1204 GPIO_FN(DV_DL4), GPIO_FN(MSIOF0_MCK0),
1205 GPIO_FN(A23_EA23), GPIO_FN(PORT111_KEYIN3),
1206 GPIO_FN(DV_DL5), GPIO_FN(MSIOF0_MCK1),
1207 GPIO_FN(A24_EA24), GPIO_FN(PORT112_KEYIN4),
1208 GPIO_FN(DV_DL6), GPIO_FN(MSIOF0_RXD),
1209 GPIO_FN(A25_EA25), GPIO_FN(PORT113_KEYIN5),
1210 GPIO_FN(DV_DL7), GPIO_FN(MSIOF0_SS2),
1211 GPIO_FN(A26), GPIO_FN(PORT113_KEYIN6), GPIO_FN(DV_CLKIL),
1212 GPIO_FN(D0_ED0_NAF0), GPIO_FN(D1_ED1_NAF1), GPIO_FN(D2_ED2_NAF2),
1213 GPIO_FN(D3_ED3_NAF3), GPIO_FN(D4_ED4_NAF4), GPIO_FN(D5_ED5_NAF5),
1214 GPIO_FN(D6_ED6_NAF6), GPIO_FN(D7_ED7_NAF7), GPIO_FN(D8_ED8_NAF8),
1215 GPIO_FN(D9_ED9_NAF9), GPIO_FN(D10_ED10_NAF10), GPIO_FN(D11_ED11_NAF11),
1216 GPIO_FN(D12_ED12_NAF12), GPIO_FN(D13_ED13_NAF13),
1217 GPIO_FN(D14_ED14_NAF14), GPIO_FN(D15_ED15_NAF15),
1218 GPIO_FN(CS4), GPIO_FN(CS5A), GPIO_FN(CS5B), GPIO_FN(FCE1),
1219 GPIO_FN(CS6B), GPIO_FN(XCS2), GPIO_FN(FCE0), GPIO_FN(CS6A),
1220 GPIO_FN(DACK0), GPIO_FN(WAIT), GPIO_FN(DREQ0), GPIO_FN(RD_XRD),
1221 GPIO_FN(A27), GPIO_FN(RDWR_XWE), GPIO_FN(WE0_XWR0_FWE),
1222 GPIO_FN(WE1_XWR1), GPIO_FN(FRB), GPIO_FN(CKO),
1223 GPIO_FN(NBRSTOUT), GPIO_FN(NBRST),
1224
1225 /* 49-4 (FN) */
1226 GPIO_FN(RFSPO0), GPIO_FN(PORT146_VIO_CKO2), GPIO_FN(TSTMD),
1227 GPIO_FN(VIO_VD), GPIO_FN(VIO_HD),
1228 GPIO_FN(VIO_D0), GPIO_FN(VIO_D1), GPIO_FN(VIO_D2),
1229 GPIO_FN(VIO_D3), GPIO_FN(VIO_D4), GPIO_FN(VIO_D5),
1230 GPIO_FN(VIO_D6), GPIO_FN(VIO_D7), GPIO_FN(VIO_D8),
1231 GPIO_FN(VIO_D9), GPIO_FN(VIO_D10), GPIO_FN(VIO_D11),
1232 GPIO_FN(VIO_D12), GPIO_FN(VIO_D13), GPIO_FN(VIO_D14),
1233 GPIO_FN(VIO_D15), GPIO_FN(VIO_CLK), GPIO_FN(VIO_FIELD),
1234 GPIO_FN(VIO_CKO),
1235 GPIO_FN(MFG3_IN1), GPIO_FN(MFG3_IN2),
1236 GPIO_FN(M9_SLCD_A01), GPIO_FN(MFG3_OUT1), GPIO_FN(TPU0TO0),
1237 GPIO_FN(M10_SLCD_CK1), GPIO_FN(MFG4_IN1), GPIO_FN(TPU0TO1),
1238 GPIO_FN(M11_SLCD_SO1), GPIO_FN(MFG4_IN2), GPIO_FN(TPU0TO2),
1239 GPIO_FN(M12_SLCD_CE1), GPIO_FN(MFG4_OUT1), GPIO_FN(TPU0TO3),
1240 GPIO_FN(LCDD0), GPIO_FN(PORT175_KEYOUT0), GPIO_FN(DV_D0),
1241 GPIO_FN(SIUCKA), GPIO_FN(MFG0_OUT2),
1242 GPIO_FN(LCDD1), GPIO_FN(PORT176_KEYOUT1), GPIO_FN(DV_D1),
1243 GPIO_FN(SIUAOLR), GPIO_FN(BBIF2_TSYNC1),
1244 GPIO_FN(LCDD2), GPIO_FN(PORT177_KEYOUT2), GPIO_FN(DV_D2),
1245 GPIO_FN(SIUAOBT), GPIO_FN(BBIF2_TSCK1),
1246 GPIO_FN(LCDD3), GPIO_FN(PORT178_KEYOUT3), GPIO_FN(DV_D3),
1247 GPIO_FN(SIUAOSLD), GPIO_FN(BBIF2_TXD1),
1248 GPIO_FN(LCDD4), GPIO_FN(PORT179_KEYOUT4), GPIO_FN(DV_D4),
1249 GPIO_FN(SIUAISPD), GPIO_FN(MFG1_OUT2),
1250 GPIO_FN(LCDD5), GPIO_FN(PORT180_KEYOUT5), GPIO_FN(DV_D5),
1251 GPIO_FN(SIUAILR), GPIO_FN(MFG2_OUT2),
1252 GPIO_FN(LCDD6), GPIO_FN(DV_D6),
1253 GPIO_FN(SIUAIBT), GPIO_FN(MFG3_OUT2), GPIO_FN(XWR2),
1254 GPIO_FN(LCDD7), GPIO_FN(DV_D7),
1255 GPIO_FN(SIUAISLD), GPIO_FN(MFG4_OUT2), GPIO_FN(XWR3),
1256 GPIO_FN(LCDD8), GPIO_FN(DV_D8), GPIO_FN(D16), GPIO_FN(ED16),
1257 GPIO_FN(LCDD9), GPIO_FN(DV_D9), GPIO_FN(D17), GPIO_FN(ED17),
1258 GPIO_FN(LCDD10), GPIO_FN(DV_D10), GPIO_FN(D18), GPIO_FN(ED18),
1259 GPIO_FN(LCDD11), GPIO_FN(DV_D11), GPIO_FN(D19), GPIO_FN(ED19),
1260 GPIO_FN(LCDD12), GPIO_FN(DV_D12), GPIO_FN(D20), GPIO_FN(ED20),
1261 GPIO_FN(LCDD13), GPIO_FN(DV_D13), GPIO_FN(D21), GPIO_FN(ED21),
1262 GPIO_FN(LCDD14), GPIO_FN(DV_D14), GPIO_FN(D22), GPIO_FN(ED22),
1263 GPIO_FN(LCDD15), GPIO_FN(DV_D15), GPIO_FN(D23), GPIO_FN(ED23),
1264 GPIO_FN(LCDD16), GPIO_FN(DV_HSYNC), GPIO_FN(D24), GPIO_FN(ED24),
1265 GPIO_FN(LCDD17), GPIO_FN(DV_VSYNC), GPIO_FN(D25), GPIO_FN(ED25),
1266 GPIO_FN(LCDD18), GPIO_FN(DREQ2), GPIO_FN(MSIOF0L_TSCK),
1267 GPIO_FN(D26), GPIO_FN(ED26),
1268 GPIO_FN(LCDD19), GPIO_FN(MSIOF0L_TSYNC),
1269 GPIO_FN(D27), GPIO_FN(ED27),
1270 GPIO_FN(LCDD20), GPIO_FN(TS_SPSYNC1), GPIO_FN(MSIOF0L_MCK0),
1271 GPIO_FN(D28), GPIO_FN(ED28),
1272 GPIO_FN(LCDD21), GPIO_FN(TS_SDAT1), GPIO_FN(MSIOF0L_MCK1),
1273 GPIO_FN(D29), GPIO_FN(ED29),
1274 GPIO_FN(LCDD22), GPIO_FN(TS_SDEN1), GPIO_FN(MSIOF0L_SS1),
1275 GPIO_FN(D30), GPIO_FN(ED30),
1276 GPIO_FN(LCDD23), GPIO_FN(TS_SCK1), GPIO_FN(MSIOF0L_SS2),
1277 GPIO_FN(D31), GPIO_FN(ED31),
1278 GPIO_FN(LCDDCK), GPIO_FN(LCDWR), GPIO_FN(DV_CKO), GPIO_FN(SIUAOSPD),
1279 GPIO_FN(LCDRD), GPIO_FN(DACK2), GPIO_FN(MSIOF0L_RSYNC),
1280
1281 /* 49-5 (FN) */
1282 GPIO_FN(LCDHSYN), GPIO_FN(LCDCS), GPIO_FN(LCDCS2), GPIO_FN(DACK3),
1283 GPIO_FN(LCDDISP), GPIO_FN(LCDRS), GPIO_FN(DREQ3), GPIO_FN(MSIOF0L_RSCK),
1284 GPIO_FN(LCDCSYN), GPIO_FN(LCDCSYN2), GPIO_FN(DV_CKI),
1285 GPIO_FN(LCDLCLK), GPIO_FN(DREQ1), GPIO_FN(MSIOF0L_RXD),
1286 GPIO_FN(LCDDON), GPIO_FN(LCDDON2), GPIO_FN(DACK1), GPIO_FN(MSIOF0L_TXD),
1287 GPIO_FN(VIO_DR0), GPIO_FN(VIO_DR1), GPIO_FN(VIO_DR2), GPIO_FN(VIO_DR3),
1288 GPIO_FN(VIO_DR4), GPIO_FN(VIO_DR5), GPIO_FN(VIO_DR6), GPIO_FN(VIO_DR7),
1289 GPIO_FN(VIO_VDR), GPIO_FN(VIO_HDR),
1290 GPIO_FN(VIO_CLKR), GPIO_FN(VIO_CKOR),
1291 GPIO_FN(SCIFA1_TXD), GPIO_FN(GPS_PGFA0),
1292 GPIO_FN(SCIFA1_SCK), GPIO_FN(GPS_PGFA1),
1293 GPIO_FN(SCIFA1_RTS), GPIO_FN(GPS_EPPSINMON),
1294 GPIO_FN(SCIFA1_RXD), GPIO_FN(SCIFA1_CTS),
1295 GPIO_FN(MSIOF1_TXD), GPIO_FN(SCIFA1_TXD2), GPIO_FN(GPS_TXD),
1296 GPIO_FN(MSIOF1_TSYNC), GPIO_FN(SCIFA1_CTS2), GPIO_FN(I2C_SDA2),
1297 GPIO_FN(MSIOF1_TSCK), GPIO_FN(SCIFA1_SCK2),
1298 GPIO_FN(MSIOF1_RXD), GPIO_FN(SCIFA1_RXD2), GPIO_FN(GPS_RXD),
1299 GPIO_FN(MSIOF1_RSCK), GPIO_FN(SCIFA1_RTS2),
1300 GPIO_FN(MSIOF1_RSYNC), GPIO_FN(I2C_SCL2),
1301 GPIO_FN(MSIOF1_MCK0), GPIO_FN(MSIOF1_MCK1),
1302 GPIO_FN(MSIOF1_SS1), GPIO_FN(EDBGREQ3),
1303 GPIO_FN(MSIOF1_SS2),
1304 GPIO_FN(PORT236_IROUT), GPIO_FN(IRDA_OUT),
1305 GPIO_FN(IRDA_IN), GPIO_FN(IRDA_FIRSEL),
1306 GPIO_FN(TPU1TO0), GPIO_FN(TS_SPSYNC3),
1307 GPIO_FN(TPU1TO1), GPIO_FN(TS_SDAT3),
1308 GPIO_FN(TPU1TO2), GPIO_FN(TS_SDEN3), GPIO_FN(PORT241_MSIOF2_SS1),
1309 GPIO_FN(TPU1TO3), GPIO_FN(PORT242_MSIOF2_TSCK),
1310 GPIO_FN(M13_BSW), GPIO_FN(PORT243_MSIOF2_TSYNC),
1311 GPIO_FN(M14_GSW), GPIO_FN(PORT244_MSIOF2_TXD),
1312 GPIO_FN(PORT245_IROUT), GPIO_FN(M15_RSW),
1313 GPIO_FN(SOUT3), GPIO_FN(SCIFA2_TXD1),
1314 GPIO_FN(SIN3), GPIO_FN(SCIFA2_RXD1),
1315 GPIO_FN(XRTS3), GPIO_FN(SCIFA2_RTS1), GPIO_FN(PORT248_MSIOF2_SS2),
1316 GPIO_FN(XCTS3), GPIO_FN(SCIFA2_CTS1), GPIO_FN(PORT249_MSIOF2_RXD),
1317 GPIO_FN(DINT), GPIO_FN(SCIFA2_SCK1), GPIO_FN(TS_SCK3),
1318 GPIO_FN(SDHICLK0), GPIO_FN(TCK2),
1319 GPIO_FN(SDHICD0),
1320 GPIO_FN(SDHID0_0), GPIO_FN(TMS2),
1321 GPIO_FN(SDHID0_1), GPIO_FN(TDO2),
1322 GPIO_FN(SDHID0_2), GPIO_FN(TDI2),
1323 GPIO_FN(SDHID0_3), GPIO_FN(RTCK2),
1324
1325 /* 49-6 (FN) */
1326 GPIO_FN(SDHICMD0), GPIO_FN(TRST2),
1327 GPIO_FN(SDHIWP0), GPIO_FN(EDBGREQ2),
1328 GPIO_FN(SDHICLK1), GPIO_FN(TCK3),
1329 GPIO_FN(SDHID1_0), GPIO_FN(M11_SLCD_SO2),
1330 GPIO_FN(TS_SPSYNC2), GPIO_FN(TMS3),
1331 GPIO_FN(SDHID1_1), GPIO_FN(M9_SLCD_AO2),
1332 GPIO_FN(TS_SDAT2), GPIO_FN(TDO3),
1333 GPIO_FN(SDHID1_2), GPIO_FN(M10_SLCD_CK2),
1334 GPIO_FN(TS_SDEN2), GPIO_FN(TDI3),
1335 GPIO_FN(SDHID1_3), GPIO_FN(M12_SLCD_CE2),
1336 GPIO_FN(TS_SCK2), GPIO_FN(RTCK3),
1337 GPIO_FN(SDHICMD1), GPIO_FN(TRST3),
1338 GPIO_FN(SDHICLK2), GPIO_FN(SCIFB_SCK),
1339 GPIO_FN(SDHID2_0), GPIO_FN(SCIFB_TXD),
1340 GPIO_FN(SDHID2_1), GPIO_FN(SCIFB_CTS),
1341 GPIO_FN(SDHID2_2), GPIO_FN(SCIFB_RXD),
1342 GPIO_FN(SDHID2_3), GPIO_FN(SCIFB_RTS),
1343 GPIO_FN(SDHICMD2),
1344 GPIO_FN(RESETOUTS),
1345 GPIO_FN(DIVLOCK),
1346};
1347
1348/* helper for top 4 bits in PORTnCR */
1349#define PCRH(in, in_pd, in_pu, out) \
1350 0, (out), (in), 0, \
1351 0, 0, 0, 0, \
1352 0, 0, (in_pd), 0, \
1353 0, 0, (in_pu), 0
1354
1355#define PORTCR(nr, reg) \
1356 { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
1357 PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
1358 PORT##nr##_IN_PU, PORT##nr##_OUT), \
1359 PORT##nr##_FN0, PORT##nr##_FN1, PORT##nr##_FN2, \
1360 PORT##nr##_FN3, PORT##nr##_FN4, PORT##nr##_FN5, \
1361 PORT##nr##_FN6, PORT##nr##_FN7 } \
1362 }
1363
1364static struct pinmux_cfg_reg pinmux_config_regs[] = {
1365 PORTCR(0, 0xe6050000), /* PORT0CR */
1366 PORTCR(1, 0xe6050001), /* PORT1CR */
1367 PORTCR(2, 0xe6050002), /* PORT2CR */
1368 PORTCR(3, 0xe6050003), /* PORT3CR */
1369 PORTCR(4, 0xe6050004), /* PORT4CR */
1370 PORTCR(5, 0xe6050005), /* PORT5CR */
1371 PORTCR(6, 0xe6050006), /* PORT6CR */
1372 PORTCR(7, 0xe6050007), /* PORT7CR */
1373 PORTCR(8, 0xe6050008), /* PORT8CR */
1374 PORTCR(9, 0xe6050009), /* PORT9CR */
1375
1376 PORTCR(10, 0xe605000a), /* PORT10CR */
1377 PORTCR(11, 0xe605000b), /* PORT11CR */
1378 PORTCR(12, 0xe605000c), /* PORT12CR */
1379 PORTCR(13, 0xe605000d), /* PORT13CR */
1380 PORTCR(14, 0xe605000e), /* PORT14CR */
1381 PORTCR(15, 0xe605000f), /* PORT15CR */
1382 PORTCR(16, 0xe6050010), /* PORT16CR */
1383 PORTCR(17, 0xe6050011), /* PORT17CR */
1384 PORTCR(18, 0xe6050012), /* PORT18CR */
1385 PORTCR(19, 0xe6050013), /* PORT19CR */
1386
1387 PORTCR(20, 0xe6050014), /* PORT20CR */
1388 PORTCR(21, 0xe6050015), /* PORT21CR */
1389 PORTCR(22, 0xe6050016), /* PORT22CR */
1390 PORTCR(23, 0xe6050017), /* PORT23CR */
1391 PORTCR(24, 0xe6050018), /* PORT24CR */
1392 PORTCR(25, 0xe6050019), /* PORT25CR */
1393 PORTCR(26, 0xe605001a), /* PORT26CR */
1394 PORTCR(27, 0xe605001b), /* PORT27CR */
1395 PORTCR(28, 0xe605001c), /* PORT28CR */
1396 PORTCR(29, 0xe605001d), /* PORT29CR */
1397
1398 PORTCR(30, 0xe605001e), /* PORT30CR */
1399 PORTCR(31, 0xe605001f), /* PORT31CR */
1400 PORTCR(32, 0xe6050020), /* PORT32CR */
1401 PORTCR(33, 0xe6050021), /* PORT33CR */
1402 PORTCR(34, 0xe6050022), /* PORT34CR */
1403 PORTCR(35, 0xe6050023), /* PORT35CR */
1404 PORTCR(36, 0xe6050024), /* PORT36CR */
1405 PORTCR(37, 0xe6050025), /* PORT37CR */
1406 PORTCR(38, 0xe6050026), /* PORT38CR */
1407 PORTCR(39, 0xe6050027), /* PORT39CR */
1408
1409 PORTCR(40, 0xe6050028), /* PORT40CR */
1410 PORTCR(41, 0xe6050029), /* PORT41CR */
1411 PORTCR(42, 0xe605002a), /* PORT42CR */
1412 PORTCR(43, 0xe605002b), /* PORT43CR */
1413 PORTCR(44, 0xe605002c), /* PORT44CR */
1414 PORTCR(45, 0xe605002d), /* PORT45CR */
1415 PORTCR(46, 0xe605002e), /* PORT46CR */
1416 PORTCR(47, 0xe605002f), /* PORT47CR */
1417 PORTCR(48, 0xe6050030), /* PORT48CR */
1418 PORTCR(49, 0xe6050031), /* PORT49CR */
1419
1420 PORTCR(50, 0xe6050032), /* PORT50CR */
1421 PORTCR(51, 0xe6050033), /* PORT51CR */
1422 PORTCR(52, 0xe6050034), /* PORT52CR */
1423 PORTCR(53, 0xe6050035), /* PORT53CR */
1424 PORTCR(54, 0xe6050036), /* PORT54CR */
1425 PORTCR(55, 0xe6050037), /* PORT55CR */
1426 PORTCR(56, 0xe6050038), /* PORT56CR */
1427 PORTCR(57, 0xe6050039), /* PORT57CR */
1428 PORTCR(58, 0xe605003a), /* PORT58CR */
1429 PORTCR(59, 0xe605003b), /* PORT59CR */
1430
1431 PORTCR(60, 0xe605003c), /* PORT60CR */
1432 PORTCR(61, 0xe605003d), /* PORT61CR */
1433 PORTCR(62, 0xe605003e), /* PORT62CR */
1434 PORTCR(63, 0xe605003f), /* PORT63CR */
1435 PORTCR(64, 0xe6050040), /* PORT64CR */
1436 PORTCR(65, 0xe6050041), /* PORT65CR */
1437 PORTCR(66, 0xe6050042), /* PORT66CR */
1438 PORTCR(67, 0xe6050043), /* PORT67CR */
1439 PORTCR(68, 0xe6050044), /* PORT68CR */
1440 PORTCR(69, 0xe6050045), /* PORT69CR */
1441
1442 PORTCR(70, 0xe6050046), /* PORT70CR */
1443 PORTCR(71, 0xe6050047), /* PORT71CR */
1444 PORTCR(72, 0xe6050048), /* PORT72CR */
1445 PORTCR(73, 0xe6050049), /* PORT73CR */
1446 PORTCR(74, 0xe605004a), /* PORT74CR */
1447 PORTCR(75, 0xe605004b), /* PORT75CR */
1448 PORTCR(76, 0xe605004c), /* PORT76CR */
1449 PORTCR(77, 0xe605004d), /* PORT77CR */
1450 PORTCR(78, 0xe605004e), /* PORT78CR */
1451 PORTCR(79, 0xe605004f), /* PORT79CR */
1452
1453 PORTCR(80, 0xe6050050), /* PORT80CR */
1454 PORTCR(81, 0xe6050051), /* PORT81CR */
1455 PORTCR(82, 0xe6050052), /* PORT82CR */
1456 PORTCR(83, 0xe6050053), /* PORT83CR */
1457 PORTCR(84, 0xe6050054), /* PORT84CR */
1458 PORTCR(85, 0xe6050055), /* PORT85CR */
1459 PORTCR(86, 0xe6050056), /* PORT86CR */
1460 PORTCR(87, 0xe6050057), /* PORT87CR */
1461 PORTCR(88, 0xe6051058), /* PORT88CR */
1462 PORTCR(89, 0xe6051059), /* PORT89CR */
1463
1464 PORTCR(90, 0xe605105a), /* PORT90CR */
1465 PORTCR(91, 0xe605105b), /* PORT91CR */
1466 PORTCR(92, 0xe605105c), /* PORT92CR */
1467 PORTCR(93, 0xe605105d), /* PORT93CR */
1468 PORTCR(94, 0xe605105e), /* PORT94CR */
1469 PORTCR(95, 0xe605105f), /* PORT95CR */
1470 PORTCR(96, 0xe6051060), /* PORT96CR */
1471 PORTCR(97, 0xe6051061), /* PORT97CR */
1472 PORTCR(98, 0xe6051062), /* PORT98CR */
1473 PORTCR(99, 0xe6051063), /* PORT99CR */
1474
1475 PORTCR(100, 0xe6051064), /* PORT100CR */
1476 PORTCR(101, 0xe6051065), /* PORT101CR */
1477 PORTCR(102, 0xe6051066), /* PORT102CR */
1478 PORTCR(103, 0xe6051067), /* PORT103CR */
1479 PORTCR(104, 0xe6051068), /* PORT104CR */
1480 PORTCR(105, 0xe6051069), /* PORT105CR */
1481 PORTCR(106, 0xe605106a), /* PORT106CR */
1482 PORTCR(107, 0xe605106b), /* PORT107CR */
1483 PORTCR(108, 0xe605106c), /* PORT108CR */
1484 PORTCR(109, 0xe605106d), /* PORT109CR */
1485
1486 PORTCR(110, 0xe605106e), /* PORT110CR */
1487 PORTCR(111, 0xe605106f), /* PORT111CR */
1488 PORTCR(112, 0xe6051070), /* PORT112CR */
1489 PORTCR(113, 0xe6051071), /* PORT113CR */
1490 PORTCR(114, 0xe6051072), /* PORT114CR */
1491 PORTCR(115, 0xe6051073), /* PORT115CR */
1492 PORTCR(116, 0xe6051074), /* PORT116CR */
1493 PORTCR(117, 0xe6051075), /* PORT117CR */
1494 PORTCR(118, 0xe6051076), /* PORT118CR */
1495 PORTCR(119, 0xe6051077), /* PORT119CR */
1496
1497 PORTCR(120, 0xe6051078), /* PORT120CR */
1498 PORTCR(121, 0xe6051079), /* PORT121CR */
1499 PORTCR(122, 0xe605107a), /* PORT122CR */
1500 PORTCR(123, 0xe605107b), /* PORT123CR */
1501 PORTCR(124, 0xe605107c), /* PORT124CR */
1502 PORTCR(125, 0xe605107d), /* PORT125CR */
1503 PORTCR(126, 0xe605107e), /* PORT126CR */
1504 PORTCR(127, 0xe605107f), /* PORT127CR */
1505 PORTCR(128, 0xe6051080), /* PORT128CR */
1506 PORTCR(129, 0xe6051081), /* PORT129CR */
1507
1508 PORTCR(130, 0xe6051082), /* PORT130CR */
1509 PORTCR(131, 0xe6051083), /* PORT131CR */
1510 PORTCR(132, 0xe6051084), /* PORT132CR */
1511 PORTCR(133, 0xe6051085), /* PORT133CR */
1512 PORTCR(134, 0xe6051086), /* PORT134CR */
1513 PORTCR(135, 0xe6051087), /* PORT135CR */
1514 PORTCR(136, 0xe6051088), /* PORT136CR */
1515 PORTCR(137, 0xe6051089), /* PORT137CR */
1516 PORTCR(138, 0xe605108a), /* PORT138CR */
1517 PORTCR(139, 0xe605108b), /* PORT139CR */
1518
1519 PORTCR(140, 0xe605108c), /* PORT140CR */
1520 PORTCR(141, 0xe605108d), /* PORT141CR */
1521 PORTCR(142, 0xe605108e), /* PORT142CR */
1522 PORTCR(143, 0xe605108f), /* PORT143CR */
1523 PORTCR(144, 0xe6051090), /* PORT144CR */
1524 PORTCR(145, 0xe6051091), /* PORT145CR */
1525 PORTCR(146, 0xe6051092), /* PORT146CR */
1526 PORTCR(147, 0xe6051093), /* PORT147CR */
1527 PORTCR(148, 0xe6051094), /* PORT148CR */
1528 PORTCR(149, 0xe6051095), /* PORT149CR */
1529
1530 PORTCR(150, 0xe6051096), /* PORT150CR */
1531 PORTCR(151, 0xe6051097), /* PORT151CR */
1532 PORTCR(152, 0xe6051098), /* PORT152CR */
1533 PORTCR(153, 0xe6051099), /* PORT153CR */
1534 PORTCR(154, 0xe605109a), /* PORT154CR */
1535 PORTCR(155, 0xe605109b), /* PORT155CR */
1536 PORTCR(156, 0xe605109c), /* PORT156CR */
1537 PORTCR(157, 0xe605109d), /* PORT157CR */
1538 PORTCR(158, 0xe605109e), /* PORT158CR */
1539 PORTCR(159, 0xe605109f), /* PORT159CR */
1540
1541 PORTCR(160, 0xe60510a0), /* PORT160CR */
1542 PORTCR(161, 0xe60510a1), /* PORT161CR */
1543 PORTCR(162, 0xe60510a2), /* PORT162CR */
1544 PORTCR(163, 0xe60510a3), /* PORT163CR */
1545 PORTCR(164, 0xe60510a4), /* PORT164CR */
1546 PORTCR(165, 0xe60510a5), /* PORT165CR */
1547 PORTCR(166, 0xe60510a6), /* PORT166CR */
1548 PORTCR(167, 0xe60510a7), /* PORT167CR */
1549 PORTCR(168, 0xe60510a8), /* PORT168CR */
1550 PORTCR(169, 0xe60510a9), /* PORT169CR */
1551
1552 PORTCR(170, 0xe60510aa), /* PORT170CR */
1553 PORTCR(171, 0xe60510ab), /* PORT171CR */
1554 PORTCR(172, 0xe60510ac), /* PORT172CR */
1555 PORTCR(173, 0xe60510ad), /* PORT173CR */
1556 PORTCR(174, 0xe60510ae), /* PORT174CR */
1557 PORTCR(175, 0xe60520af), /* PORT175CR */
1558 PORTCR(176, 0xe60520b0), /* PORT176CR */
1559 PORTCR(177, 0xe60520b1), /* PORT177CR */
1560 PORTCR(178, 0xe60520b2), /* PORT178CR */
1561 PORTCR(179, 0xe60520b3), /* PORT179CR */
1562
1563 PORTCR(180, 0xe60520b4), /* PORT180CR */
1564 PORTCR(181, 0xe60520b5), /* PORT181CR */
1565 PORTCR(182, 0xe60520b6), /* PORT182CR */
1566 PORTCR(183, 0xe60520b7), /* PORT183CR */
1567 PORTCR(184, 0xe60520b8), /* PORT184CR */
1568 PORTCR(185, 0xe60520b9), /* PORT185CR */
1569 PORTCR(186, 0xe60520ba), /* PORT186CR */
1570 PORTCR(187, 0xe60520bb), /* PORT187CR */
1571 PORTCR(188, 0xe60520bc), /* PORT188CR */
1572 PORTCR(189, 0xe60520bd), /* PORT189CR */
1573
1574 PORTCR(190, 0xe60520be), /* PORT190CR */
1575 PORTCR(191, 0xe60520bf), /* PORT191CR */
1576 PORTCR(192, 0xe60520c0), /* PORT192CR */
1577 PORTCR(193, 0xe60520c1), /* PORT193CR */
1578 PORTCR(194, 0xe60520c2), /* PORT194CR */
1579 PORTCR(195, 0xe60520c3), /* PORT195CR */
1580 PORTCR(196, 0xe60520c4), /* PORT196CR */
1581 PORTCR(197, 0xe60520c5), /* PORT197CR */
1582 PORTCR(198, 0xe60520c6), /* PORT198CR */
1583 PORTCR(199, 0xe60520c7), /* PORT199CR */
1584
1585 PORTCR(200, 0xe60520c8), /* PORT200CR */
1586 PORTCR(201, 0xe60520c9), /* PORT201CR */
1587 PORTCR(202, 0xe60520ca), /* PORT202CR */
1588 PORTCR(203, 0xe60520cb), /* PORT203CR */
1589 PORTCR(204, 0xe60520cc), /* PORT204CR */
1590 PORTCR(205, 0xe60520cd), /* PORT205CR */
1591 PORTCR(206, 0xe60520ce), /* PORT206CR */
1592 PORTCR(207, 0xe60520cf), /* PORT207CR */
1593 PORTCR(208, 0xe60520d0), /* PORT208CR */
1594 PORTCR(209, 0xe60520d1), /* PORT209CR */
1595
1596 PORTCR(210, 0xe60520d2), /* PORT210CR */
1597 PORTCR(211, 0xe60520d3), /* PORT211CR */
1598 PORTCR(212, 0xe60520d4), /* PORT212CR */
1599 PORTCR(213, 0xe60520d5), /* PORT213CR */
1600 PORTCR(214, 0xe60520d6), /* PORT214CR */
1601 PORTCR(215, 0xe60520d7), /* PORT215CR */
1602 PORTCR(216, 0xe60520d8), /* PORT216CR */
1603 PORTCR(217, 0xe60520d9), /* PORT217CR */
1604 PORTCR(218, 0xe60520da), /* PORT218CR */
1605 PORTCR(219, 0xe60520db), /* PORT219CR */
1606
1607 PORTCR(220, 0xe60520dc), /* PORT220CR */
1608 PORTCR(221, 0xe60520dd), /* PORT221CR */
1609 PORTCR(222, 0xe60520de), /* PORT222CR */
1610 PORTCR(223, 0xe60520df), /* PORT223CR */
1611 PORTCR(224, 0xe60520e0), /* PORT224CR */
1612 PORTCR(225, 0xe60520e1), /* PORT225CR */
1613 PORTCR(226, 0xe60520e2), /* PORT226CR */
1614 PORTCR(227, 0xe60520e3), /* PORT227CR */
1615 PORTCR(228, 0xe60520e4), /* PORT228CR */
1616 PORTCR(229, 0xe60520e5), /* PORT229CR */
1617
1618 PORTCR(230, 0xe60520e6), /* PORT230CR */
1619 PORTCR(231, 0xe60520e7), /* PORT231CR */
1620 PORTCR(232, 0xe60520e8), /* PORT232CR */
1621 PORTCR(233, 0xe60520e9), /* PORT233CR */
1622 PORTCR(234, 0xe60520ea), /* PORT234CR */
1623 PORTCR(235, 0xe60520eb), /* PORT235CR */
1624 PORTCR(236, 0xe60530ec), /* PORT236CR */
1625 PORTCR(237, 0xe60530ed), /* PORT237CR */
1626 PORTCR(238, 0xe60530ee), /* PORT238CR */
1627 PORTCR(239, 0xe60530ef), /* PORT239CR */
1628
1629 PORTCR(240, 0xe60530f0), /* PORT240CR */
1630 PORTCR(241, 0xe60530f1), /* PORT241CR */
1631 PORTCR(242, 0xe60530f2), /* PORT242CR */
1632 PORTCR(243, 0xe60530f3), /* PORT243CR */
1633 PORTCR(244, 0xe60530f4), /* PORT244CR */
1634 PORTCR(245, 0xe60530f5), /* PORT245CR */
1635 PORTCR(246, 0xe60530f6), /* PORT246CR */
1636 PORTCR(247, 0xe60530f7), /* PORT247CR */
1637 PORTCR(248, 0xe60530f8), /* PORT248CR */
1638 PORTCR(249, 0xe60530f9), /* PORT249CR */
1639
1640 PORTCR(250, 0xe60530fa), /* PORT250CR */
1641 PORTCR(251, 0xe60530fb), /* PORT251CR */
1642 PORTCR(252, 0xe60530fc), /* PORT252CR */
1643 PORTCR(253, 0xe60530fd), /* PORT253CR */
1644 PORTCR(254, 0xe60530fe), /* PORT254CR */
1645 PORTCR(255, 0xe60530ff), /* PORT255CR */
1646 PORTCR(256, 0xe6053100), /* PORT256CR */
1647 PORTCR(257, 0xe6053101), /* PORT257CR */
1648 PORTCR(258, 0xe6053102), /* PORT258CR */
1649 PORTCR(259, 0xe6053103), /* PORT259CR */
1650
1651 PORTCR(260, 0xe6053104), /* PORT260CR */
1652 PORTCR(261, 0xe6053105), /* PORT261CR */
1653 PORTCR(262, 0xe6053106), /* PORT262CR */
1654 PORTCR(263, 0xe6053107), /* PORT263CR */
1655 PORTCR(264, 0xe6053108), /* PORT264CR */
1656 PORTCR(265, 0xe6053109), /* PORT265CR */
1657 PORTCR(266, 0xe605310a), /* PORT266CR */
1658 PORTCR(267, 0xe605310b), /* PORT267CR */
1659 PORTCR(268, 0xe605310c), /* PORT268CR */
1660 PORTCR(269, 0xe605310d), /* PORT269CR */
1661
1662 PORTCR(270, 0xe605310e), /* PORT270CR */
1663 PORTCR(271, 0xe605310f), /* PORT271CR */
1664 PORTCR(272, 0xe6053110), /* PORT272CR */
1665
1666 { PINMUX_CFG_REG("MSELBCR", 0xe6058024, 32, 1) {
1667 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1668 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1669 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1670 0, 0,
1671 0, 0,
1672 0, 0,
1673 0, 0,
1674 0, 0,
1675 MSELBCR_MSEL2_0, MSELBCR_MSEL2_1,
1676 0, 0,
1677 0, 0 }
1678 },
1679 { },
1680};
1681
1682static struct pinmux_data_reg pinmux_data_regs[] = {
1683 { PINMUX_DATA_REG("PORTL031_000DR", 0xe6054000, 32) {
1684 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
1685 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
1686 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
1687 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
1688 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
1689 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
1690 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
1691 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA }
1692 },
1693 { PINMUX_DATA_REG("PORTL063_032DR", 0xe6054004, 32) {
1694 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
1695 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
1696 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
1697 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
1698 PORT47_DATA, PORT46_DATA, PORT45_DATA, PORT44_DATA,
1699 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
1700 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
1701 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA }
1702 },
1703 { PINMUX_DATA_REG("PORTL095_064DR", 0xe6054008, 32) {
1704 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
1705 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
1706 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
1707 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
1708 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
1709 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
1710 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
1711 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA }
1712 },
1713 { PINMUX_DATA_REG("PORTD127_096DR", 0xe6055004, 32) {
1714 PORT127_DATA, PORT126_DATA, PORT125_DATA, PORT124_DATA,
1715 PORT123_DATA, PORT122_DATA, PORT121_DATA, PORT120_DATA,
1716 PORT119_DATA, PORT118_DATA, PORT117_DATA, PORT116_DATA,
1717 PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
1718 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
1719 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
1720 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
1721 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA }
1722 },
1723 { PINMUX_DATA_REG("PORTD159_128DR", 0xe6055008, 32) {
1724 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
1725 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
1726 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
1727 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
1728 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
1729 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
1730 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
1731 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA }
1732 },
1733 { PINMUX_DATA_REG("PORTR191_160DR", 0xe6056000, 32) {
1734 PORT191_DATA, PORT190_DATA, PORT189_DATA, PORT188_DATA,
1735 PORT187_DATA, PORT186_DATA, PORT185_DATA, PORT184_DATA,
1736 PORT183_DATA, PORT182_DATA, PORT181_DATA, PORT180_DATA,
1737 PORT179_DATA, PORT178_DATA, PORT177_DATA, PORT176_DATA,
1738 PORT175_DATA, PORT174_DATA, PORT173_DATA, PORT172_DATA,
1739 PORT171_DATA, PORT170_DATA, PORT169_DATA, PORT168_DATA,
1740 PORT167_DATA, PORT166_DATA, PORT165_DATA, PORT164_DATA,
1741 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA }
1742 },
1743 { PINMUX_DATA_REG("PORTR223_192DR", 0xe6056004, 32) {
1744 PORT223_DATA, PORT222_DATA, PORT221_DATA, PORT220_DATA,
1745 PORT219_DATA, PORT218_DATA, PORT217_DATA, PORT216_DATA,
1746 PORT215_DATA, PORT214_DATA, PORT213_DATA, PORT212_DATA,
1747 PORT211_DATA, PORT210_DATA, PORT209_DATA, PORT208_DATA,
1748 PORT207_DATA, PORT206_DATA, PORT205_DATA, PORT204_DATA,
1749 PORT203_DATA, PORT202_DATA, PORT201_DATA, PORT200_DATA,
1750 PORT199_DATA, PORT198_DATA, PORT197_DATA, PORT196_DATA,
1751 PORT195_DATA, PORT194_DATA, PORT193_DATA, PORT192_DATA }
1752 },
1753 { PINMUX_DATA_REG("PORTU255_224DR", 0xe6057000, 32) {
1754 PORT255_DATA, PORT254_DATA, PORT253_DATA, PORT252_DATA,
1755 PORT251_DATA, PORT250_DATA, PORT249_DATA, PORT248_DATA,
1756 PORT247_DATA, PORT246_DATA, PORT245_DATA, PORT244_DATA,
1757 PORT243_DATA, PORT242_DATA, PORT241_DATA, PORT240_DATA,
1758 PORT239_DATA, PORT238_DATA, PORT237_DATA, PORT236_DATA,
1759 PORT235_DATA, PORT234_DATA, PORT233_DATA, PORT232_DATA,
1760 PORT231_DATA, PORT230_DATA, PORT229_DATA, PORT228_DATA,
1761 PORT227_DATA, PORT226_DATA, PORT225_DATA, PORT224_DATA }
1762 },
1763 { PINMUX_DATA_REG("PORTU287_256DR", 0xe6057004, 32) {
1764 0, 0, 0, 0,
1765 0, 0, 0, 0,
1766 0, 0, 0, 0,
1767 0, 0, 0, PORT272_DATA,
1768 PORT271_DATA, PORT270_DATA, PORT269_DATA, PORT268_DATA,
1769 PORT267_DATA, PORT266_DATA, PORT265_DATA, PORT264_DATA,
1770 PORT263_DATA, PORT262_DATA, PORT261_DATA, PORT260_DATA,
1771 PORT259_DATA, PORT258_DATA, PORT257_DATA, PORT256_DATA }
1772 },
1773 { },
1774};
1775
1776static struct pinmux_info sh7367_pinmux_info = {
1777 .name = "sh7367_pfc",
1778 .reserved_id = PINMUX_RESERVED,
1779 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1780 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1781 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1782 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
1783 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1784 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1785 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1786
1787 .first_gpio = GPIO_PORT0,
1788 .last_gpio = GPIO_FN_DIVLOCK,
1789
1790 .gpios = pinmux_gpios,
1791 .cfg_regs = pinmux_config_regs,
1792 .data_regs = pinmux_data_regs,
1793
1794 .gpio_data = pinmux_data,
1795 .gpio_data_size = ARRAY_SIZE(pinmux_data),
1796};
1797
1798void sh7367_pinmux_init(void)
1799{
1800 register_pinmux(&sh7367_pinmux_info);
1801}
diff --git a/arch/arm/mach-shmobile/pfc-sh7372.c b/arch/arm/mach-shmobile/pfc-sh7372.c
new file mode 100644
index 000000000000..9c265dae138a
--- /dev/null
+++ b/arch/arm/mach-shmobile/pfc-sh7372.c
@@ -0,0 +1,1640 @@
1/*
2 * sh7372 processor support - PFC hardware block
3 *
4 * Copyright (C) 2010 Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 *
6 * Based on
7 * sh7367 processor support - PFC hardware block
8 * Copyright (C) 2010 Magnus Damm
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23#include <linux/init.h>
24#include <linux/kernel.h>
25#include <linux/gpio.h>
26#include <mach/sh7372.h>
27
28#define _1(fn, pfx, sfx) fn(pfx, sfx)
29
30#define _10(fn, pfx, sfx) \
31 _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
32 _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
33 _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
34 _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
35 _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
36
37#define _80(fn, pfx, sfx) \
38 _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \
39 _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \
40 _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \
41 _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx)
42
43#define _190(fn, pfx, sfx) \
44 _10(fn, pfx, sfx), _80(fn, pfx, sfx), _10(fn, pfx##9, sfx), \
45 _10(fn, pfx##10, sfx), _80(fn, pfx##1, sfx), _1(fn, pfx##190, sfx)
46
47#define _PORT(pfx, sfx) pfx##_##sfx
48#define PORT_ALL(str) _190(_PORT, PORT, str)
49
50enum {
51 PINMUX_RESERVED = 0,
52
53 /* PORT0_DATA -> PORT190_DATA */
54 PINMUX_DATA_BEGIN,
55 PORT_ALL(DATA),
56 PINMUX_DATA_END,
57
58 /* PORT0_IN -> PORT190_IN */
59 PINMUX_INPUT_BEGIN,
60 PORT_ALL(IN),
61 PINMUX_INPUT_END,
62
63 /* PORT0_IN_PU -> PORT190_IN_PU */
64 PINMUX_INPUT_PULLUP_BEGIN,
65 PORT_ALL(IN_PU),
66 PINMUX_INPUT_PULLUP_END,
67
68 /* PORT0_IN_PD -> PORT190_IN_PD */
69 PINMUX_INPUT_PULLDOWN_BEGIN,
70 PORT_ALL(IN_PD),
71 PINMUX_INPUT_PULLDOWN_END,
72
73 /* PORT0_OUT -> PORT190_OUT */
74 PINMUX_OUTPUT_BEGIN,
75 PORT_ALL(OUT),
76 PINMUX_OUTPUT_END,
77
78 PINMUX_FUNCTION_BEGIN,
79 PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT190_FN_IN */
80 PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT190_FN_OUT */
81 PORT_ALL(FN0), /* PORT0_FN0 -> PORT190_FN0 */
82 PORT_ALL(FN1), /* PORT0_FN1 -> PORT190_FN1 */
83 PORT_ALL(FN2), /* PORT0_FN2 -> PORT190_FN2 */
84 PORT_ALL(FN3), /* PORT0_FN3 -> PORT190_FN3 */
85 PORT_ALL(FN4), /* PORT0_FN4 -> PORT190_FN4 */
86 PORT_ALL(FN5), /* PORT0_FN5 -> PORT190_FN5 */
87 PORT_ALL(FN6), /* PORT0_FN6 -> PORT190_FN6 */
88 PORT_ALL(FN7), /* PORT0_FN7 -> PORT190_FN7 */
89
90 MSEL1CR_31_0, MSEL1CR_31_1,
91 MSEL1CR_30_0, MSEL1CR_30_1,
92 MSEL1CR_29_0, MSEL1CR_29_1,
93 MSEL1CR_28_0, MSEL1CR_28_1,
94 MSEL1CR_27_0, MSEL1CR_27_1,
95 MSEL1CR_26_0, MSEL1CR_26_1,
96 MSEL1CR_16_0, MSEL1CR_16_1,
97 MSEL1CR_15_0, MSEL1CR_15_1,
98 MSEL1CR_14_0, MSEL1CR_14_1,
99 MSEL1CR_13_0, MSEL1CR_13_1,
100 MSEL1CR_12_0, MSEL1CR_12_1,
101 MSEL1CR_9_0, MSEL1CR_9_1,
102 MSEL1CR_8_0, MSEL1CR_8_1,
103 MSEL1CR_7_0, MSEL1CR_7_1,
104 MSEL1CR_6_0, MSEL1CR_6_1,
105 MSEL1CR_4_0, MSEL1CR_4_1,
106 MSEL1CR_3_0, MSEL1CR_3_1,
107 MSEL1CR_2_0, MSEL1CR_2_1,
108 MSEL1CR_0_0, MSEL1CR_0_1,
109
110 MSEL3CR_27_0, MSEL3CR_27_1,
111 MSEL3CR_26_0, MSEL3CR_26_1,
112 MSEL3CR_21_0, MSEL3CR_21_1,
113 MSEL3CR_20_0, MSEL3CR_20_1,
114 MSEL3CR_15_0, MSEL3CR_15_1,
115 MSEL3CR_9_0, MSEL3CR_9_1,
116 MSEL3CR_6_0, MSEL3CR_6_1,
117
118 MSEL4CR_19_0, MSEL4CR_19_1,
119 MSEL4CR_18_0, MSEL4CR_18_1,
120 MSEL4CR_17_0, MSEL4CR_17_1,
121 MSEL4CR_16_0, MSEL4CR_16_1,
122 MSEL4CR_15_0, MSEL4CR_15_1,
123 MSEL4CR_14_0, MSEL4CR_14_1,
124 MSEL4CR_10_0, MSEL4CR_10_1,
125 MSEL4CR_6_0, MSEL4CR_6_1,
126 MSEL4CR_4_0, MSEL4CR_4_1,
127 MSEL4CR_1_0, MSEL4CR_1_1,
128 PINMUX_FUNCTION_END,
129
130 PINMUX_MARK_BEGIN,
131
132 /* IRQ */
133 IRQ0_6_MARK, IRQ0_162_MARK, IRQ1_MARK, IRQ2_4_MARK,
134 IRQ2_5_MARK, IRQ3_8_MARK, IRQ3_16_MARK, IRQ4_17_MARK,
135 IRQ4_163_MARK, IRQ5_MARK, IRQ6_39_MARK, IRQ6_164_MARK,
136 IRQ7_40_MARK, IRQ7_167_MARK, IRQ8_41_MARK, IRQ8_168_MARK,
137 IRQ9_42_MARK, IRQ9_169_MARK, IRQ10_MARK, IRQ11_MARK,
138 IRQ12_80_MARK, IRQ12_137_MARK, IRQ13_81_MARK, IRQ13_145_MARK,
139 IRQ14_82_MARK, IRQ14_146_MARK, IRQ15_83_MARK, IRQ15_147_MARK,
140 IRQ16_84_MARK, IRQ16_170_MARK, IRQ17_MARK, IRQ18_MARK,
141 IRQ19_MARK, IRQ20_MARK, IRQ21_MARK, IRQ22_MARK,
142 IRQ23_MARK, IRQ24_MARK, IRQ25_MARK, IRQ26_121_MARK,
143 IRQ26_172_MARK, IRQ27_122_MARK, IRQ27_180_MARK, IRQ28_123_MARK,
144 IRQ28_181_MARK, IRQ29_129_MARK, IRQ29_182_MARK, IRQ30_130_MARK,
145 IRQ30_183_MARK, IRQ31_138_MARK, IRQ31_184_MARK,
146
147 /* MSIOF0 */
148 MSIOF0_TSYNC_MARK, MSIOF0_TSCK_MARK, MSIOF0_RXD_MARK,
149 MSIOF0_RSCK_MARK, MSIOF0_RSYNC_MARK, MSIOF0_MCK0_MARK,
150 MSIOF0_MCK1_MARK, MSIOF0_SS1_MARK, MSIOF0_SS2_MARK,
151 MSIOF0_TXD_MARK,
152
153 /* MSIOF1 */
154 MSIOF1_TSCK_39_MARK, MSIOF1_TSYNC_40_MARK,
155 MSIOF1_TSCK_88_MARK, MSIOF1_TSYNC_89_MARK,
156 MSIOF1_TXD_41_MARK, MSIOF1_RXD_42_MARK,
157 MSIOF1_TXD_90_MARK, MSIOF1_RXD_91_MARK,
158 MSIOF1_SS1_43_MARK, MSIOF1_SS2_44_MARK,
159 MSIOF1_SS1_92_MARK, MSIOF1_SS2_93_MARK,
160 MSIOF1_RSCK_MARK, MSIOF1_RSYNC_MARK,
161 MSIOF1_MCK0_MARK, MSIOF1_MCK1_MARK,
162
163 /* MSIOF2 */
164 MSIOF2_RSCK_MARK, MSIOF2_RSYNC_MARK, MSIOF2_MCK0_MARK,
165 MSIOF2_MCK1_MARK, MSIOF2_SS1_MARK, MSIOF2_SS2_MARK,
166 MSIOF2_TSYNC_MARK, MSIOF2_TSCK_MARK, MSIOF2_RXD_MARK,
167 MSIOF2_TXD_MARK,
168
169 /* BBIF1 */
170 BBIF1_RXD_MARK, BBIF1_TSYNC_MARK, BBIF1_TSCK_MARK,
171 BBIF1_TXD_MARK, BBIF1_RSCK_MARK, BBIF1_RSYNC_MARK,
172 BBIF1_FLOW_MARK, BB_RX_FLOW_N_MARK,
173
174 /* BBIF2 */
175 BBIF2_TSCK1_MARK, BBIF2_TSYNC1_MARK,
176 BBIF2_TXD1_MARK, BBIF2_RXD_MARK,
177
178 /* FSI */
179 FSIACK_MARK, FSIBCK_MARK, FSIAILR_MARK, FSIAIBT_MARK,
180 FSIAISLD_MARK, FSIAOMC_MARK, FSIAOLR_MARK, FSIAOBT_MARK,
181 FSIAOSLD_MARK, FSIASPDIF_11_MARK, FSIASPDIF_15_MARK,
182
183 /* FMSI */
184 FMSOCK_MARK, FMSOOLR_MARK, FMSIOLR_MARK, FMSOOBT_MARK,
185 FMSIOBT_MARK, FMSOSLD_MARK, FMSOILR_MARK, FMSIILR_MARK,
186 FMSOIBT_MARK, FMSIIBT_MARK, FMSISLD_MARK, FMSICK_MARK,
187
188 /* SCIFA0 */
189 SCIFA0_TXD_MARK, SCIFA0_RXD_MARK, SCIFA0_SCK_MARK,
190 SCIFA0_RTS_MARK, SCIFA0_CTS_MARK,
191
192 /* SCIFA1 */
193 SCIFA1_TXD_MARK, SCIFA1_RXD_MARK, SCIFA1_SCK_MARK,
194 SCIFA1_RTS_MARK, SCIFA1_CTS_MARK,
195
196 /* SCIFA2 */
197 SCIFA2_CTS1_MARK, SCIFA2_RTS1_MARK, SCIFA2_TXD1_MARK,
198 SCIFA2_RXD1_MARK, SCIFA2_SCK1_MARK,
199
200 /* SCIFA3 */
201 SCIFA3_CTS_43_MARK, SCIFA3_CTS_140_MARK, SCIFA3_RTS_44_MARK,
202 SCIFA3_RTS_141_MARK, SCIFA3_SCK_MARK, SCIFA3_TXD_MARK,
203 SCIFA3_RXD_MARK,
204
205 /* SCIFA4 */
206 SCIFA4_RXD_MARK, SCIFA4_TXD_MARK,
207
208 /* SCIFA5 */
209 SCIFA5_RXD_MARK, SCIFA5_TXD_MARK,
210
211 /* SCIFB */
212 SCIFB_SCK_MARK, SCIFB_RTS_MARK, SCIFB_CTS_MARK,
213 SCIFB_TXD_MARK, SCIFB_RXD_MARK,
214
215 /* CEU */
216 VIO_HD_MARK, VIO_CKO1_MARK, VIO_CKO2_MARK, VIO_VD_MARK,
217 VIO_CLK_MARK, VIO_FIELD_MARK, VIO_CKO_MARK,
218 VIO_D0_MARK, VIO_D1_MARK, VIO_D2_MARK, VIO_D3_MARK,
219 VIO_D4_MARK, VIO_D5_MARK, VIO_D6_MARK, VIO_D7_MARK,
220 VIO_D8_MARK, VIO_D9_MARK, VIO_D10_MARK, VIO_D11_MARK,
221 VIO_D12_MARK, VIO_D13_MARK, VIO_D14_MARK, VIO_D15_MARK,
222
223 /* USB0 */
224 IDIN_0_MARK, EXTLP_0_MARK, OVCN2_0_MARK, PWEN_0_MARK,
225 OVCN_0_MARK, VBUS0_0_MARK,
226
227 /* USB1 */
228 IDIN_1_18_MARK, IDIN_1_113_MARK,
229 PWEN_1_115_MARK, PWEN_1_138_MARK,
230 OVCN_1_114_MARK, OVCN_1_162_MARK,
231 EXTLP_1_MARK, OVCN2_1_MARK,
232 VBUS0_1_MARK,
233
234 /* GPIO */
235 GPI0_MARK, GPI1_MARK, GPO0_MARK, GPO1_MARK,
236
237 /* BSC */
238 BS_MARK, WE1_MARK,
239 CKO_MARK, WAIT_MARK, RDWR_MARK,
240
241 A0_MARK, A1_MARK, A2_MARK, A3_MARK,
242 A6_MARK, A7_MARK, A8_MARK, A9_MARK,
243 A10_MARK, A11_MARK, A12_MARK, A13_MARK,
244 A14_MARK, A15_MARK, A16_MARK, A17_MARK,
245 A18_MARK, A19_MARK, A20_MARK, A21_MARK,
246 A22_MARK, A23_MARK, A24_MARK, A25_MARK,
247 A26_MARK,
248
249 CS0_MARK, CS2_MARK, CS4_MARK,
250 CS5A_MARK, CS5B_MARK, CS6A_MARK,
251
252 /* BSC/FLCTL */
253 RD_FSC_MARK, WE0_FWE_MARK, A4_FOE_MARK, A5_FCDE_MARK,
254 D0_NAF0_MARK, D1_NAF1_MARK, D2_NAF2_MARK, D3_NAF3_MARK,
255 D4_NAF4_MARK, D5_NAF5_MARK, D6_NAF6_MARK, D7_NAF7_MARK,
256 D8_NAF8_MARK, D9_NAF9_MARK, D10_NAF10_MARK, D11_NAF11_MARK,
257 D12_NAF12_MARK, D13_NAF13_MARK, D14_NAF14_MARK, D15_NAF15_MARK,
258
259 /* MMCIF(1) */
260 MMCD0_0_MARK, MMCD0_1_MARK, MMCD0_2_MARK, MMCD0_3_MARK,
261 MMCD0_4_MARK, MMCD0_5_MARK, MMCD0_6_MARK, MMCD0_7_MARK,
262 MMCCMD0_MARK, MMCCLK0_MARK,
263
264 /* MMCIF(2) */
265 MMCD1_0_MARK, MMCD1_1_MARK, MMCD1_2_MARK, MMCD1_3_MARK,
266 MMCD1_4_MARK, MMCD1_5_MARK, MMCD1_6_MARK, MMCD1_7_MARK,
267 MMCCLK1_MARK, MMCCMD1_MARK,
268
269 /* SPU2 */
270 VINT_I_MARK,
271
272 /* FLCTL */
273 FCE1_MARK, FCE0_MARK, FRB_MARK,
274
275 /* HSI */
276 GP_RX_FLAG_MARK, GP_RX_DATA_MARK, GP_TX_READY_MARK,
277 GP_RX_WAKE_MARK, MP_TX_FLAG_MARK, MP_TX_DATA_MARK,
278 MP_RX_READY_MARK, MP_TX_WAKE_MARK,
279
280 /* MFI */
281 MFIv6_MARK,
282 MFIv4_MARK,
283
284 MEMC_CS0_MARK, MEMC_BUSCLK_MEMC_A0_MARK,
285 MEMC_CS1_MEMC_A1_MARK, MEMC_ADV_MEMC_DREQ0_MARK,
286 MEMC_WAIT_MEMC_DREQ1_MARK, MEMC_NOE_MARK,
287 MEMC_NWE_MARK, MEMC_INT_MARK,
288
289 MEMC_AD0_MARK, MEMC_AD1_MARK, MEMC_AD2_MARK,
290 MEMC_AD3_MARK, MEMC_AD4_MARK, MEMC_AD5_MARK,
291 MEMC_AD6_MARK, MEMC_AD7_MARK, MEMC_AD8_MARK,
292 MEMC_AD9_MARK, MEMC_AD10_MARK, MEMC_AD11_MARK,
293 MEMC_AD12_MARK, MEMC_AD13_MARK, MEMC_AD14_MARK,
294 MEMC_AD15_MARK,
295
296 /* SIM */
297 SIM_RST_MARK, SIM_CLK_MARK, SIM_D_MARK,
298
299 /* TPU */
300 TPU0TO0_MARK, TPU0TO1_MARK,
301 TPU0TO2_93_MARK, TPU0TO2_99_MARK,
302 TPU0TO3_MARK,
303
304 /* I2C2 */
305 I2C_SCL2_MARK, I2C_SDA2_MARK,
306
307 /* I2C3(1) */
308 I2C_SCL3_MARK, I2C_SDA3_MARK,
309
310 /* I2C3(2) */
311 I2C_SCL3S_MARK, I2C_SDA3S_MARK,
312
313 /* I2C4(2) */
314 I2C_SCL4_MARK, I2C_SDA4_MARK,
315
316 /* I2C4(2) */
317 I2C_SCL4S_MARK, I2C_SDA4S_MARK,
318
319 /* KEYSC */
320 KEYOUT0_MARK, KEYIN0_121_MARK, KEYIN0_136_MARK,
321 KEYOUT1_MARK, KEYIN1_122_MARK, KEYIN1_135_MARK,
322 KEYOUT2_MARK, KEYIN2_123_MARK, KEYIN2_134_MARK,
323 KEYOUT3_MARK, KEYIN3_124_MARK, KEYIN3_133_MARK,
324 KEYOUT4_MARK, KEYIN4_MARK,
325 KEYOUT5_MARK, KEYIN5_MARK,
326 KEYOUT6_MARK, KEYIN6_MARK,
327 KEYOUT7_MARK, KEYIN7_MARK,
328
329 /* LCDC */
330 LCDC0_SELECT_MARK,
331 LCDC1_SELECT_MARK,
332 LCDHSYN_MARK, LCDCS_MARK, LCDVSYN_MARK, LCDDCK_MARK,
333 LCDWR_MARK, LCDRD_MARK, LCDDISP_MARK, LCDRS_MARK,
334 LCDLCLK_MARK, LCDDON_MARK,
335
336 LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
337 LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
338 LCDD8_MARK, LCDD9_MARK, LCDD10_MARK, LCDD11_MARK,
339 LCDD12_MARK, LCDD13_MARK, LCDD14_MARK, LCDD15_MARK,
340 LCDD16_MARK, LCDD17_MARK, LCDD18_MARK, LCDD19_MARK,
341 LCDD20_MARK, LCDD21_MARK, LCDD22_MARK, LCDD23_MARK,
342
343 /* IRDA */
344 IRDA_OUT_MARK, IRDA_IN_MARK, IRDA_FIRSEL_MARK,
345 IROUT_139_MARK, IROUT_140_MARK,
346
347 /* TSIF1 */
348 TS0_1SELECT_MARK,
349 TS0_2SELECT_MARK,
350 TS1_1SELECT_MARK,
351 TS1_2SELECT_MARK,
352
353 TS_SPSYNC1_MARK, TS_SDAT1_MARK,
354 TS_SDEN1_MARK, TS_SCK1_MARK,
355
356 /* TSIF2 */
357 TS_SPSYNC2_MARK, TS_SDAT2_MARK,
358 TS_SDEN2_MARK, TS_SCK2_MARK,
359
360 /* HDMI */
361 HDMI_HPD_MARK, HDMI_CEC_MARK,
362
363 /* SDHI0 */
364 SDHICLK0_MARK, SDHICD0_MARK,
365 SDHICMD0_MARK, SDHIWP0_MARK,
366 SDHID0_0_MARK, SDHID0_1_MARK,
367 SDHID0_2_MARK, SDHID0_3_MARK,
368
369 /* SDHI1 */
370 SDHICLK1_MARK, SDHICMD1_MARK, SDHID1_0_MARK,
371 SDHID1_1_MARK, SDHID1_2_MARK, SDHID1_3_MARK,
372
373 /* SDHI2 */
374 SDHICLK2_MARK, SDHICMD2_MARK, SDHID2_0_MARK,
375 SDHID2_1_MARK, SDHID2_2_MARK, SDHID2_3_MARK,
376
377 /* SDENC */
378 SDENC_CPG_MARK,
379 SDENC_DV_CLKI_MARK,
380
381 PINMUX_MARK_END,
382};
383
384/* PORT_DATA_I_PD(nr) */
385#define _I___D(nr) \
386 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
387 PORT##nr##_IN, PORT##nr##_IN_PD)
388
389/* PORT_DATA_I_PU(nr) */
390#define _I__U_(nr) \
391 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
392 PORT##nr##_IN, PORT##nr##_IN_PU)
393
394/* PORT_DATA_I_PU_PD(nr) */
395#define _I__UD(nr) \
396 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
397 PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
398
399/* PORT_DATA_O(nr) */
400#define __O___(nr) \
401 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT)
402
403/* PORT_DATA_IO(nr) */
404#define _IO___(nr) \
405 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
406 PORT##nr##_IN)
407
408/* PORT_DATA_IO_PD(nr) */
409#define _IO__D(nr) \
410 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
411 PORT##nr##_IN, PORT##nr##_IN_PD)
412
413/* PORT_DATA_IO_PU(nr) */
414#define _IO_U_(nr) \
415 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
416 PORT##nr##_IN, PORT##nr##_IN_PU)
417
418/* PORT_DATA_IO_PU_PD(nr) */
419#define _IO_UD(nr) \
420 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
421 PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
422
423
424static pinmux_enum_t pinmux_data[] = {
425
426 /* specify valid pin states for each pin in GPIO mode */
427
428 _IO__D(0), _IO__D(1), __O___(2), _I___D(3), _I___D(4),
429 _I___D(5), _IO_UD(6), _I___D(7), _IO__D(8), __O___(9),
430
431 __O___(10), __O___(11), _IO_UD(12), _IO__D(13), _IO__D(14),
432 __O___(15), _IO__D(16), _IO__D(17), _I___D(18), _IO___(19),
433
434 _IO___(20), _IO___(21), _IO___(22), _IO___(23), _IO___(24),
435 _IO___(25), _IO___(26), _IO___(27), _IO___(28), _IO___(29),
436
437 _IO___(30), _IO___(31), _IO___(32), _IO___(33), _IO___(34),
438 _IO___(35), _IO___(36), _IO___(37), _IO___(38), _IO___(39),
439
440 _IO___(40), _IO___(41), _IO___(42), _IO___(43), _IO___(44),
441 _IO___(45), _IO_U_(46), _IO_U_(47), _IO_U_(48), _IO_U_(49),
442
443 _IO_U_(50), _IO_U_(51), _IO_U_(52), _IO_U_(53), _IO_U_(54),
444 _IO_U_(55), _IO_U_(56), _IO_U_(57), _IO_U_(58), _IO_U_(59),
445
446 _IO_U_(60), _IO_U_(61), _IO___(62), __O___(63), __O___(64),
447 _IO_U_(65), __O___(66), _IO_U_(67), __O___(68), _IO___(69), /*66?*/
448
449 _IO___(70), _IO___(71), __O___(72), _I__U_(73), _I__UD(74),
450 _IO_UD(75), _IO_UD(76), _IO_UD(77), _IO_UD(78), _IO_UD(79),
451
452 _IO_UD(80), _IO_UD(81), _IO_UD(82), _IO_UD(83), _IO_UD(84),
453 _IO_UD(85), _IO_UD(86), _IO_UD(87), _IO_UD(88), _IO_UD(89),
454
455 _IO_UD(90), _IO_UD(91), _IO_UD(92), _IO_UD(93), _IO_UD(94),
456 _IO_UD(95), _IO_U_(96), _IO_UD(97), _IO_UD(98), __O___(99), /*99?*/
457
458 _IO__D(100), _IO__D(101), _IO__D(102), _IO__D(103), _IO__D(104),
459 _IO__D(105), _IO_U_(106), _IO_U_(107), _IO_U_(108), _IO_U_(109),
460
461 _IO_U_(110), _IO_U_(111), _IO__D(112), _IO__D(113), _IO_U_(114),
462 _IO_U_(115), _IO_U_(116), _IO_U_(117), _IO_U_(118), _IO_U_(119),
463
464 _IO_U_(120), _IO__D(121), _IO__D(122), _IO__D(123), _IO__D(124),
465 _IO__D(125), _IO__D(126), _IO__D(127), _IO__D(128), _IO_UD(129),
466
467 _IO_UD(130), _IO_UD(131), _IO_UD(132), _IO_UD(133), _IO_UD(134),
468 _IO_UD(135), _IO__D(136), _IO__D(137), _IO__D(138), _IO__D(139),
469
470 _IO__D(140), _IO__D(141), _IO__D(142), _IO_UD(143), _IO__D(144),
471 _IO__D(145), _IO__D(146), _IO__D(147), _IO__D(148), _IO__D(149),
472
473 _IO__D(150), _IO__D(151), _IO_UD(152), _I___D(153), _IO_UD(154),
474 _I___D(155), _IO__D(156), _IO__D(157), _I___D(158), _IO__D(159),
475
476 __O___(160), _IO__D(161), _IO__D(162), _IO__D(163), _I___D(164),
477 _IO__D(165), _I___D(166), _I___D(167), _I___D(168), _I___D(169),
478
479 _I___D(170), __O___(171), _IO_UD(172), _IO_UD(173), _IO_UD(174),
480 _IO_UD(175), _IO_UD(176), _IO_UD(177), _IO_UD(178), __O___(179),
481
482 _IO_UD(180), _IO_UD(181), _IO_UD(182), _IO_UD(183), _IO_UD(184),
483 __O___(185), _IO_UD(186), _IO_UD(187), _IO_UD(188), _IO_UD(189),
484
485 _IO_UD(190),
486
487 /* IRQ */
488 PINMUX_DATA(IRQ0_6_MARK, PORT6_FN0, MSEL1CR_0_0),
489 PINMUX_DATA(IRQ0_162_MARK, PORT162_FN0, MSEL1CR_0_1),
490 PINMUX_DATA(IRQ1_MARK, PORT12_FN0),
491 PINMUX_DATA(IRQ2_4_MARK, PORT4_FN0, MSEL1CR_2_0),
492 PINMUX_DATA(IRQ2_5_MARK, PORT5_FN0, MSEL1CR_2_1),
493 PINMUX_DATA(IRQ3_8_MARK, PORT8_FN0, MSEL1CR_3_0),
494 PINMUX_DATA(IRQ3_16_MARK, PORT16_FN0, MSEL1CR_3_1),
495 PINMUX_DATA(IRQ4_17_MARK, PORT17_FN0, MSEL1CR_4_0),
496 PINMUX_DATA(IRQ4_163_MARK, PORT163_FN0, MSEL1CR_4_1),
497 PINMUX_DATA(IRQ5_MARK, PORT18_FN0),
498 PINMUX_DATA(IRQ6_39_MARK, PORT39_FN0, MSEL1CR_6_0),
499 PINMUX_DATA(IRQ6_164_MARK, PORT164_FN0, MSEL1CR_6_1),
500 PINMUX_DATA(IRQ7_40_MARK, PORT40_FN0, MSEL1CR_7_1),
501 PINMUX_DATA(IRQ7_167_MARK, PORT167_FN0, MSEL1CR_7_0),
502 PINMUX_DATA(IRQ8_41_MARK, PORT41_FN0, MSEL1CR_8_1),
503 PINMUX_DATA(IRQ8_168_MARK, PORT168_FN0, MSEL1CR_8_0),
504 PINMUX_DATA(IRQ9_42_MARK, PORT42_FN0, MSEL1CR_9_0),
505 PINMUX_DATA(IRQ9_169_MARK, PORT169_FN0, MSEL1CR_9_1),
506 PINMUX_DATA(IRQ10_MARK, PORT65_FN0, MSEL1CR_9_1),
507 PINMUX_DATA(IRQ11_MARK, PORT67_FN0),
508 PINMUX_DATA(IRQ12_80_MARK, PORT80_FN0, MSEL1CR_12_0),
509 PINMUX_DATA(IRQ12_137_MARK, PORT137_FN0, MSEL1CR_12_1),
510 PINMUX_DATA(IRQ13_81_MARK, PORT81_FN0, MSEL1CR_13_0),
511 PINMUX_DATA(IRQ13_145_MARK, PORT145_FN0, MSEL1CR_13_1),
512 PINMUX_DATA(IRQ14_82_MARK, PORT82_FN0, MSEL1CR_14_0),
513 PINMUX_DATA(IRQ14_146_MARK, PORT146_FN0, MSEL1CR_14_1),
514 PINMUX_DATA(IRQ15_83_MARK, PORT83_FN0, MSEL1CR_15_0),
515 PINMUX_DATA(IRQ15_147_MARK, PORT147_FN0, MSEL1CR_15_1),
516 PINMUX_DATA(IRQ16_84_MARK, PORT84_FN0, MSEL1CR_16_0),
517 PINMUX_DATA(IRQ16_170_MARK, PORT170_FN0, MSEL1CR_16_1),
518 PINMUX_DATA(IRQ17_MARK, PORT85_FN0),
519 PINMUX_DATA(IRQ18_MARK, PORT86_FN0),
520 PINMUX_DATA(IRQ19_MARK, PORT87_FN0),
521 PINMUX_DATA(IRQ20_MARK, PORT92_FN0),
522 PINMUX_DATA(IRQ21_MARK, PORT93_FN0),
523 PINMUX_DATA(IRQ22_MARK, PORT94_FN0),
524 PINMUX_DATA(IRQ23_MARK, PORT95_FN0),
525 PINMUX_DATA(IRQ24_MARK, PORT112_FN0),
526 PINMUX_DATA(IRQ25_MARK, PORT119_FN0),
527 PINMUX_DATA(IRQ26_121_MARK, PORT121_FN0, MSEL1CR_26_1),
528 PINMUX_DATA(IRQ26_172_MARK, PORT172_FN0, MSEL1CR_26_0),
529 PINMUX_DATA(IRQ27_122_MARK, PORT122_FN0, MSEL1CR_27_1),
530 PINMUX_DATA(IRQ27_180_MARK, PORT180_FN0, MSEL1CR_27_0),
531 PINMUX_DATA(IRQ28_123_MARK, PORT123_FN0, MSEL1CR_28_1),
532 PINMUX_DATA(IRQ28_181_MARK, PORT181_FN0, MSEL1CR_28_0),
533 PINMUX_DATA(IRQ29_129_MARK, PORT129_FN0, MSEL1CR_29_1),
534 PINMUX_DATA(IRQ29_182_MARK, PORT182_FN0, MSEL1CR_29_0),
535 PINMUX_DATA(IRQ30_130_MARK, PORT130_FN0, MSEL1CR_30_1),
536 PINMUX_DATA(IRQ30_183_MARK, PORT183_FN0, MSEL1CR_30_0),
537 PINMUX_DATA(IRQ31_138_MARK, PORT138_FN0, MSEL1CR_31_1),
538 PINMUX_DATA(IRQ31_184_MARK, PORT184_FN0, MSEL1CR_31_0),
539
540 /* Function 1 */
541 PINMUX_DATA(BBIF2_TSCK1_MARK, PORT0_FN1),
542 PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT1_FN1),
543 PINMUX_DATA(BBIF2_TXD1_MARK, PORT2_FN1),
544 PINMUX_DATA(BBIF2_RXD_MARK, PORT3_FN1),
545 PINMUX_DATA(FSIACK_MARK, PORT4_FN1),
546 PINMUX_DATA(FSIAILR_MARK, PORT5_FN1),
547 PINMUX_DATA(FSIAIBT_MARK, PORT6_FN1),
548 PINMUX_DATA(FSIAISLD_MARK, PORT7_FN1),
549 PINMUX_DATA(FSIAOMC_MARK, PORT8_FN1),
550 PINMUX_DATA(FSIAOLR_MARK, PORT9_FN1),
551 PINMUX_DATA(FSIAOBT_MARK, PORT10_FN1),
552 PINMUX_DATA(FSIAOSLD_MARK, PORT11_FN1),
553 PINMUX_DATA(FMSOCK_MARK, PORT12_FN1),
554 PINMUX_DATA(FMSOOLR_MARK, PORT13_FN1),
555 PINMUX_DATA(FMSOOBT_MARK, PORT14_FN1),
556 PINMUX_DATA(FMSOSLD_MARK, PORT15_FN1),
557 PINMUX_DATA(FMSOILR_MARK, PORT16_FN1),
558 PINMUX_DATA(FMSOIBT_MARK, PORT17_FN1),
559 PINMUX_DATA(FMSISLD_MARK, PORT18_FN1),
560 PINMUX_DATA(A0_MARK, PORT19_FN1),
561 PINMUX_DATA(A1_MARK, PORT20_FN1),
562 PINMUX_DATA(A2_MARK, PORT21_FN1),
563 PINMUX_DATA(A3_MARK, PORT22_FN1),
564 PINMUX_DATA(A4_FOE_MARK, PORT23_FN1),
565 PINMUX_DATA(A5_FCDE_MARK, PORT24_FN1),
566 PINMUX_DATA(A6_MARK, PORT25_FN1),
567 PINMUX_DATA(A7_MARK, PORT26_FN1),
568 PINMUX_DATA(A8_MARK, PORT27_FN1),
569 PINMUX_DATA(A9_MARK, PORT28_FN1),
570 PINMUX_DATA(A10_MARK, PORT29_FN1),
571 PINMUX_DATA(A11_MARK, PORT30_FN1),
572 PINMUX_DATA(A12_MARK, PORT31_FN1),
573 PINMUX_DATA(A13_MARK, PORT32_FN1),
574 PINMUX_DATA(A14_MARK, PORT33_FN1),
575 PINMUX_DATA(A15_MARK, PORT34_FN1),
576 PINMUX_DATA(A16_MARK, PORT35_FN1),
577 PINMUX_DATA(A17_MARK, PORT36_FN1),
578 PINMUX_DATA(A18_MARK, PORT37_FN1),
579 PINMUX_DATA(A19_MARK, PORT38_FN1),
580 PINMUX_DATA(A20_MARK, PORT39_FN1),
581 PINMUX_DATA(A21_MARK, PORT40_FN1),
582 PINMUX_DATA(A22_MARK, PORT41_FN1),
583 PINMUX_DATA(A23_MARK, PORT42_FN1),
584 PINMUX_DATA(A24_MARK, PORT43_FN1),
585 PINMUX_DATA(A25_MARK, PORT44_FN1),
586 PINMUX_DATA(A26_MARK, PORT45_FN1),
587 PINMUX_DATA(D0_NAF0_MARK, PORT46_FN1),
588 PINMUX_DATA(D1_NAF1_MARK, PORT47_FN1),
589 PINMUX_DATA(D2_NAF2_MARK, PORT48_FN1),
590 PINMUX_DATA(D3_NAF3_MARK, PORT49_FN1),
591 PINMUX_DATA(D4_NAF4_MARK, PORT50_FN1),
592 PINMUX_DATA(D5_NAF5_MARK, PORT51_FN1),
593 PINMUX_DATA(D6_NAF6_MARK, PORT52_FN1),
594 PINMUX_DATA(D7_NAF7_MARK, PORT53_FN1),
595 PINMUX_DATA(D8_NAF8_MARK, PORT54_FN1),
596 PINMUX_DATA(D9_NAF9_MARK, PORT55_FN1),
597 PINMUX_DATA(D10_NAF10_MARK, PORT56_FN1),
598 PINMUX_DATA(D11_NAF11_MARK, PORT57_FN1),
599 PINMUX_DATA(D12_NAF12_MARK, PORT58_FN1),
600 PINMUX_DATA(D13_NAF13_MARK, PORT59_FN1),
601 PINMUX_DATA(D14_NAF14_MARK, PORT60_FN1),
602 PINMUX_DATA(D15_NAF15_MARK, PORT61_FN1),
603 PINMUX_DATA(CS0_MARK, PORT62_FN1),
604 PINMUX_DATA(CS2_MARK, PORT63_FN1),
605 PINMUX_DATA(CS4_MARK, PORT64_FN1),
606 PINMUX_DATA(CS5A_MARK, PORT65_FN1),
607 PINMUX_DATA(CS5B_MARK, PORT66_FN1),
608 PINMUX_DATA(CS6A_MARK, PORT67_FN1),
609 PINMUX_DATA(FCE0_MARK, PORT68_FN1),
610 PINMUX_DATA(RD_FSC_MARK, PORT69_FN1),
611 PINMUX_DATA(WE0_FWE_MARK, PORT70_FN1),
612 PINMUX_DATA(WE1_MARK, PORT71_FN1),
613 PINMUX_DATA(CKO_MARK, PORT72_FN1),
614 PINMUX_DATA(FRB_MARK, PORT73_FN1),
615 PINMUX_DATA(WAIT_MARK, PORT74_FN1),
616 PINMUX_DATA(RDWR_MARK, PORT75_FN1),
617 PINMUX_DATA(MEMC_AD0_MARK, PORT76_FN1),
618 PINMUX_DATA(MEMC_AD1_MARK, PORT77_FN1),
619 PINMUX_DATA(MEMC_AD2_MARK, PORT78_FN1),
620 PINMUX_DATA(MEMC_AD3_MARK, PORT79_FN1),
621 PINMUX_DATA(MEMC_AD4_MARK, PORT80_FN1),
622 PINMUX_DATA(MEMC_AD5_MARK, PORT81_FN1),
623 PINMUX_DATA(MEMC_AD6_MARK, PORT82_FN1),
624 PINMUX_DATA(MEMC_AD7_MARK, PORT83_FN1),
625 PINMUX_DATA(MEMC_AD8_MARK, PORT84_FN1),
626 PINMUX_DATA(MEMC_AD9_MARK, PORT85_FN1),
627 PINMUX_DATA(MEMC_AD10_MARK, PORT86_FN1),
628 PINMUX_DATA(MEMC_AD11_MARK, PORT87_FN1),
629 PINMUX_DATA(MEMC_AD12_MARK, PORT88_FN1),
630 PINMUX_DATA(MEMC_AD13_MARK, PORT89_FN1),
631 PINMUX_DATA(MEMC_AD14_MARK, PORT90_FN1),
632 PINMUX_DATA(MEMC_AD15_MARK, PORT91_FN1),
633 PINMUX_DATA(MEMC_CS0_MARK, PORT92_FN1),
634 PINMUX_DATA(MEMC_BUSCLK_MEMC_A0_MARK, PORT93_FN1),
635 PINMUX_DATA(MEMC_CS1_MEMC_A1_MARK, PORT94_FN1),
636 PINMUX_DATA(MEMC_ADV_MEMC_DREQ0_MARK, PORT95_FN1),
637 PINMUX_DATA(MEMC_WAIT_MEMC_DREQ1_MARK, PORT96_FN1),
638 PINMUX_DATA(MEMC_NOE_MARK, PORT97_FN1),
639 PINMUX_DATA(MEMC_NWE_MARK, PORT98_FN1),
640 PINMUX_DATA(MEMC_INT_MARK, PORT99_FN1),
641 PINMUX_DATA(VIO_VD_MARK, PORT100_FN1),
642 PINMUX_DATA(VIO_HD_MARK, PORT101_FN1),
643 PINMUX_DATA(VIO_D0_MARK, PORT102_FN1),
644 PINMUX_DATA(VIO_D1_MARK, PORT103_FN1),
645 PINMUX_DATA(VIO_D2_MARK, PORT104_FN1),
646 PINMUX_DATA(VIO_D3_MARK, PORT105_FN1),
647 PINMUX_DATA(VIO_D4_MARK, PORT106_FN1),
648 PINMUX_DATA(VIO_D5_MARK, PORT107_FN1),
649 PINMUX_DATA(VIO_D6_MARK, PORT108_FN1),
650 PINMUX_DATA(VIO_D7_MARK, PORT109_FN1),
651 PINMUX_DATA(VIO_D8_MARK, PORT110_FN1),
652 PINMUX_DATA(VIO_D9_MARK, PORT111_FN1),
653 PINMUX_DATA(VIO_D10_MARK, PORT112_FN1),
654 PINMUX_DATA(VIO_D11_MARK, PORT113_FN1),
655 PINMUX_DATA(VIO_D12_MARK, PORT114_FN1),
656 PINMUX_DATA(VIO_D13_MARK, PORT115_FN1),
657 PINMUX_DATA(VIO_D14_MARK, PORT116_FN1),
658 PINMUX_DATA(VIO_D15_MARK, PORT117_FN1),
659 PINMUX_DATA(VIO_CLK_MARK, PORT118_FN1),
660 PINMUX_DATA(VIO_FIELD_MARK, PORT119_FN1),
661 PINMUX_DATA(VIO_CKO_MARK, PORT120_FN1),
662 PINMUX_DATA(LCDD0_MARK, PORT121_FN1),
663 PINMUX_DATA(LCDD1_MARK, PORT122_FN1),
664 PINMUX_DATA(LCDD2_MARK, PORT123_FN1),
665 PINMUX_DATA(LCDD3_MARK, PORT124_FN1),
666 PINMUX_DATA(LCDD4_MARK, PORT125_FN1),
667 PINMUX_DATA(LCDD5_MARK, PORT126_FN1),
668 PINMUX_DATA(LCDD6_MARK, PORT127_FN1),
669 PINMUX_DATA(LCDD7_MARK, PORT128_FN1),
670 PINMUX_DATA(LCDD8_MARK, PORT129_FN1),
671 PINMUX_DATA(LCDD9_MARK, PORT130_FN1),
672 PINMUX_DATA(LCDD10_MARK, PORT131_FN1),
673 PINMUX_DATA(LCDD11_MARK, PORT132_FN1),
674 PINMUX_DATA(LCDD12_MARK, PORT133_FN1),
675 PINMUX_DATA(LCDD13_MARK, PORT134_FN1),
676 PINMUX_DATA(LCDD14_MARK, PORT135_FN1),
677 PINMUX_DATA(LCDD15_MARK, PORT136_FN1),
678 PINMUX_DATA(LCDD16_MARK, PORT137_FN1),
679 PINMUX_DATA(LCDD17_MARK, PORT138_FN1),
680 PINMUX_DATA(LCDD18_MARK, PORT139_FN1),
681 PINMUX_DATA(LCDD19_MARK, PORT140_FN1),
682 PINMUX_DATA(LCDD20_MARK, PORT141_FN1),
683 PINMUX_DATA(LCDD21_MARK, PORT142_FN1),
684 PINMUX_DATA(LCDD22_MARK, PORT143_FN1),
685 PINMUX_DATA(LCDD23_MARK, PORT144_FN1),
686 PINMUX_DATA(LCDHSYN_MARK, PORT145_FN1),
687 PINMUX_DATA(LCDVSYN_MARK, PORT146_FN1),
688 PINMUX_DATA(LCDDCK_MARK, PORT147_FN1),
689 PINMUX_DATA(LCDRD_MARK, PORT148_FN1),
690 PINMUX_DATA(LCDDISP_MARK, PORT149_FN1),
691 PINMUX_DATA(LCDLCLK_MARK, PORT150_FN1),
692 PINMUX_DATA(LCDDON_MARK, PORT151_FN1),
693 PINMUX_DATA(SCIFA0_TXD_MARK, PORT152_FN1),
694 PINMUX_DATA(SCIFA0_RXD_MARK, PORT153_FN1),
695 PINMUX_DATA(SCIFA1_TXD_MARK, PORT154_FN1),
696 PINMUX_DATA(SCIFA1_RXD_MARK, PORT155_FN1),
697 PINMUX_DATA(TS_SPSYNC1_MARK, PORT156_FN1),
698 PINMUX_DATA(TS_SDAT1_MARK, PORT157_FN1),
699 PINMUX_DATA(TS_SDEN1_MARK, PORT158_FN1),
700 PINMUX_DATA(TS_SCK1_MARK, PORT159_FN1),
701 PINMUX_DATA(TPU0TO0_MARK, PORT160_FN1),
702 PINMUX_DATA(TPU0TO1_MARK, PORT161_FN1),
703 PINMUX_DATA(SCIFB_SCK_MARK, PORT162_FN1),
704 PINMUX_DATA(SCIFB_RTS_MARK, PORT163_FN1),
705 PINMUX_DATA(SCIFB_CTS_MARK, PORT164_FN1),
706 PINMUX_DATA(SCIFB_TXD_MARK, PORT165_FN1),
707 PINMUX_DATA(SCIFB_RXD_MARK, PORT166_FN1),
708 PINMUX_DATA(VBUS0_0_MARK, PORT167_FN1),
709 PINMUX_DATA(VBUS0_1_MARK, PORT168_FN1),
710 PINMUX_DATA(HDMI_HPD_MARK, PORT169_FN1),
711 PINMUX_DATA(HDMI_CEC_MARK, PORT170_FN1),
712 PINMUX_DATA(SDHICLK0_MARK, PORT171_FN1),
713 PINMUX_DATA(SDHICD0_MARK, PORT172_FN1),
714 PINMUX_DATA(SDHID0_0_MARK, PORT173_FN1),
715 PINMUX_DATA(SDHID0_1_MARK, PORT174_FN1),
716 PINMUX_DATA(SDHID0_2_MARK, PORT175_FN1),
717 PINMUX_DATA(SDHID0_3_MARK, PORT176_FN1),
718 PINMUX_DATA(SDHICMD0_MARK, PORT177_FN1),
719 PINMUX_DATA(SDHIWP0_MARK, PORT178_FN1),
720 PINMUX_DATA(SDHICLK1_MARK, PORT179_FN1),
721 PINMUX_DATA(SDHID1_0_MARK, PORT180_FN1),
722 PINMUX_DATA(SDHID1_1_MARK, PORT181_FN1),
723 PINMUX_DATA(SDHID1_2_MARK, PORT182_FN1),
724 PINMUX_DATA(SDHID1_3_MARK, PORT183_FN1),
725 PINMUX_DATA(SDHICMD1_MARK, PORT184_FN1),
726 PINMUX_DATA(SDHICLK2_MARK, PORT185_FN1),
727 PINMUX_DATA(SDHID2_0_MARK, PORT186_FN1),
728 PINMUX_DATA(SDHID2_1_MARK, PORT187_FN1),
729 PINMUX_DATA(SDHID2_2_MARK, PORT188_FN1),
730 PINMUX_DATA(SDHID2_3_MARK, PORT189_FN1),
731 PINMUX_DATA(SDHICMD2_MARK, PORT190_FN1),
732
733 /* Function 2 */
734 PINMUX_DATA(FSIBCK_MARK, PORT4_FN2),
735 PINMUX_DATA(SCIFA4_RXD_MARK, PORT5_FN2),
736 PINMUX_DATA(SCIFA4_TXD_MARK, PORT6_FN2),
737 PINMUX_DATA(SCIFA5_RXD_MARK, PORT8_FN2),
738 PINMUX_DATA(FSIASPDIF_11_MARK, PORT11_FN2),
739 PINMUX_DATA(SCIFA5_TXD_MARK, PORT12_FN2),
740 PINMUX_DATA(FMSIOLR_MARK, PORT13_FN2),
741 PINMUX_DATA(FMSIOBT_MARK, PORT14_FN2),
742 PINMUX_DATA(FSIASPDIF_15_MARK, PORT15_FN2),
743 PINMUX_DATA(FMSIILR_MARK, PORT16_FN2),
744 PINMUX_DATA(FMSIIBT_MARK, PORT17_FN2),
745 PINMUX_DATA(BS_MARK, PORT19_FN2),
746 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT36_FN2),
747 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT37_FN2),
748 PINMUX_DATA(MSIOF0_RXD_MARK, PORT38_FN2),
749 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT39_FN2),
750 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT40_FN2),
751 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT41_FN2),
752 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT42_FN2),
753 PINMUX_DATA(MSIOF0_SS1_MARK, PORT43_FN2),
754 PINMUX_DATA(MSIOF0_SS2_MARK, PORT44_FN2),
755 PINMUX_DATA(MSIOF0_TXD_MARK, PORT45_FN2),
756 PINMUX_DATA(FMSICK_MARK, PORT65_FN2),
757 PINMUX_DATA(FCE1_MARK, PORT66_FN2),
758 PINMUX_DATA(BBIF1_RXD_MARK, PORT76_FN2),
759 PINMUX_DATA(BBIF1_TSYNC_MARK, PORT77_FN2),
760 PINMUX_DATA(BBIF1_TSCK_MARK, PORT78_FN2),
761 PINMUX_DATA(BBIF1_TXD_MARK, PORT79_FN2),
762 PINMUX_DATA(BBIF1_RSCK_MARK, PORT80_FN2),
763 PINMUX_DATA(BBIF1_RSYNC_MARK, PORT81_FN2),
764 PINMUX_DATA(BBIF1_FLOW_MARK, PORT82_FN2),
765 PINMUX_DATA(BB_RX_FLOW_N_MARK, PORT83_FN2),
766 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT84_FN2),
767 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT85_FN2),
768 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT86_FN2),
769 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT87_FN2),
770 PINMUX_DATA(MSIOF1_TSCK_88_MARK, PORT88_FN2, MSEL4CR_10_1),
771 PINMUX_DATA(MSIOF1_TSYNC_89_MARK, PORT89_FN2, MSEL4CR_10_1),
772 PINMUX_DATA(MSIOF1_TXD_90_MARK, PORT90_FN2, MSEL4CR_10_1),
773 PINMUX_DATA(MSIOF1_RXD_91_MARK, PORT91_FN2, MSEL4CR_10_1),
774 PINMUX_DATA(MSIOF1_SS1_92_MARK, PORT92_FN2, MSEL4CR_10_1),
775 PINMUX_DATA(MSIOF1_SS2_93_MARK, PORT93_FN2, MSEL4CR_10_1),
776 PINMUX_DATA(SCIFA2_CTS1_MARK, PORT94_FN2),
777 PINMUX_DATA(SCIFA2_RTS1_MARK, PORT95_FN2),
778 PINMUX_DATA(SCIFA2_TXD1_MARK, PORT96_FN2),
779 PINMUX_DATA(SCIFA2_RXD1_MARK, PORT97_FN2),
780 PINMUX_DATA(SCIFA2_SCK1_MARK, PORT98_FN2),
781 PINMUX_DATA(I2C_SCL2_MARK, PORT110_FN2),
782 PINMUX_DATA(I2C_SDA2_MARK, PORT111_FN2),
783 PINMUX_DATA(I2C_SCL3_MARK, PORT114_FN2, MSEL4CR_16_1),
784 PINMUX_DATA(I2C_SDA3_MARK, PORT115_FN2, MSEL4CR_16_1),
785 PINMUX_DATA(I2C_SCL4_MARK, PORT116_FN2, MSEL4CR_17_1),
786 PINMUX_DATA(I2C_SDA4_MARK, PORT117_FN2, MSEL4CR_17_1),
787 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT134_FN2),
788 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT135_FN2),
789 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT136_FN2),
790 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT137_FN2),
791 PINMUX_DATA(MSIOF2_SS1_MARK, PORT138_FN2),
792 PINMUX_DATA(MSIOF2_SS2_MARK, PORT139_FN2),
793 PINMUX_DATA(SCIFA3_CTS_140_MARK, PORT140_FN2, MSEL3CR_9_1),
794 PINMUX_DATA(SCIFA3_RTS_141_MARK, PORT141_FN2),
795 PINMUX_DATA(SCIFA3_SCK_MARK, PORT142_FN2),
796 PINMUX_DATA(SCIFA3_TXD_MARK, PORT143_FN2),
797 PINMUX_DATA(SCIFA3_RXD_MARK, PORT144_FN2),
798 PINMUX_DATA(MSIOF2_TSYNC_MARK, PORT148_FN2),
799 PINMUX_DATA(MSIOF2_TSCK_MARK, PORT149_FN2),
800 PINMUX_DATA(MSIOF2_RXD_MARK, PORT150_FN2),
801 PINMUX_DATA(MSIOF2_TXD_MARK, PORT151_FN2),
802 PINMUX_DATA(SCIFA0_SCK_MARK, PORT156_FN2),
803 PINMUX_DATA(SCIFA0_RTS_MARK, PORT157_FN2),
804 PINMUX_DATA(SCIFA0_CTS_MARK, PORT158_FN2),
805 PINMUX_DATA(SCIFA1_SCK_MARK, PORT159_FN2),
806 PINMUX_DATA(SCIFA1_RTS_MARK, PORT160_FN2),
807 PINMUX_DATA(SCIFA1_CTS_MARK, PORT161_FN2),
808
809 /* Function 3 */
810 PINMUX_DATA(VIO_CKO1_MARK, PORT16_FN3),
811 PINMUX_DATA(VIO_CKO2_MARK, PORT17_FN3),
812 PINMUX_DATA(IDIN_1_18_MARK, PORT18_FN3, MSEL4CR_14_1),
813 PINMUX_DATA(MSIOF1_TSCK_39_MARK, PORT39_FN3, MSEL4CR_10_0),
814 PINMUX_DATA(MSIOF1_TSYNC_40_MARK, PORT40_FN3, MSEL4CR_10_0),
815 PINMUX_DATA(MSIOF1_TXD_41_MARK, PORT41_FN3, MSEL4CR_10_0),
816 PINMUX_DATA(MSIOF1_RXD_42_MARK, PORT42_FN3, MSEL4CR_10_0),
817 PINMUX_DATA(MSIOF1_SS1_43_MARK, PORT43_FN3, MSEL4CR_10_0),
818 PINMUX_DATA(MSIOF1_SS2_44_MARK, PORT44_FN3, MSEL4CR_10_0),
819 PINMUX_DATA(MMCD1_0_MARK, PORT54_FN3, MSEL4CR_15_1),
820 PINMUX_DATA(MMCD1_1_MARK, PORT55_FN3, MSEL4CR_15_1),
821 PINMUX_DATA(MMCD1_2_MARK, PORT56_FN3, MSEL4CR_15_1),
822 PINMUX_DATA(MMCD1_3_MARK, PORT57_FN3, MSEL4CR_15_1),
823 PINMUX_DATA(MMCD1_4_MARK, PORT58_FN3, MSEL4CR_15_1),
824 PINMUX_DATA(MMCD1_5_MARK, PORT59_FN3, MSEL4CR_15_1),
825 PINMUX_DATA(MMCD1_6_MARK, PORT60_FN3, MSEL4CR_15_1),
826 PINMUX_DATA(MMCD1_7_MARK, PORT61_FN3, MSEL4CR_15_1),
827 PINMUX_DATA(VINT_I_MARK, PORT65_FN3),
828 PINMUX_DATA(MMCCLK1_MARK, PORT66_FN3, MSEL4CR_15_1),
829 PINMUX_DATA(MMCCMD1_MARK, PORT67_FN3, MSEL4CR_15_1),
830 PINMUX_DATA(TPU0TO2_93_MARK, PORT93_FN3),
831 PINMUX_DATA(TPU0TO2_99_MARK, PORT99_FN3),
832 PINMUX_DATA(TPU0TO3_MARK, PORT112_FN3),
833 PINMUX_DATA(IDIN_0_MARK, PORT113_FN3),
834 PINMUX_DATA(EXTLP_0_MARK, PORT114_FN3),
835 PINMUX_DATA(OVCN2_0_MARK, PORT115_FN3),
836 PINMUX_DATA(PWEN_0_MARK, PORT116_FN3),
837 PINMUX_DATA(OVCN_0_MARK, PORT117_FN3),
838 PINMUX_DATA(KEYOUT7_MARK, PORT121_FN3),
839 PINMUX_DATA(KEYOUT6_MARK, PORT122_FN3),
840 PINMUX_DATA(KEYOUT5_MARK, PORT123_FN3),
841 PINMUX_DATA(KEYOUT4_MARK, PORT124_FN3),
842 PINMUX_DATA(KEYOUT3_MARK, PORT125_FN3),
843 PINMUX_DATA(KEYOUT2_MARK, PORT126_FN3),
844 PINMUX_DATA(KEYOUT1_MARK, PORT127_FN3),
845 PINMUX_DATA(KEYOUT0_MARK, PORT128_FN3),
846 PINMUX_DATA(KEYIN7_MARK, PORT129_FN3),
847 PINMUX_DATA(KEYIN6_MARK, PORT130_FN3),
848 PINMUX_DATA(KEYIN5_MARK, PORT131_FN3),
849 PINMUX_DATA(KEYIN4_MARK, PORT132_FN3),
850 PINMUX_DATA(KEYIN3_133_MARK, PORT133_FN3, MSEL4CR_18_0),
851 PINMUX_DATA(KEYIN2_134_MARK, PORT134_FN3, MSEL4CR_18_0),
852 PINMUX_DATA(KEYIN1_135_MARK, PORT135_FN3, MSEL4CR_18_0),
853 PINMUX_DATA(KEYIN0_136_MARK, PORT136_FN3, MSEL4CR_18_0),
854 PINMUX_DATA(TS_SPSYNC2_MARK, PORT137_FN3),
855 PINMUX_DATA(IROUT_139_MARK, PORT139_FN3),
856 PINMUX_DATA(IRDA_OUT_MARK, PORT140_FN3),
857 PINMUX_DATA(IRDA_IN_MARK, PORT141_FN3),
858 PINMUX_DATA(IRDA_FIRSEL_MARK, PORT142_FN3),
859 PINMUX_DATA(TS_SDAT2_MARK, PORT145_FN3),
860 PINMUX_DATA(TS_SDEN2_MARK, PORT146_FN3),
861 PINMUX_DATA(TS_SCK2_MARK, PORT147_FN3),
862
863 /* Function 4 */
864 PINMUX_DATA(SCIFA3_CTS_43_MARK, PORT43_FN4, MSEL3CR_9_0),
865 PINMUX_DATA(SCIFA3_RTS_44_MARK, PORT44_FN4),
866 PINMUX_DATA(GP_RX_FLAG_MARK, PORT76_FN4),
867 PINMUX_DATA(GP_RX_DATA_MARK, PORT77_FN4),
868 PINMUX_DATA(GP_TX_READY_MARK, PORT78_FN4),
869 PINMUX_DATA(GP_RX_WAKE_MARK, PORT79_FN4),
870 PINMUX_DATA(MP_TX_FLAG_MARK, PORT80_FN4),
871 PINMUX_DATA(MP_TX_DATA_MARK, PORT81_FN4),
872 PINMUX_DATA(MP_RX_READY_MARK, PORT82_FN4),
873 PINMUX_DATA(MP_TX_WAKE_MARK, PORT83_FN4),
874 PINMUX_DATA(MMCD0_0_MARK, PORT84_FN4, MSEL4CR_15_0),
875 PINMUX_DATA(MMCD0_1_MARK, PORT85_FN4, MSEL4CR_15_0),
876 PINMUX_DATA(MMCD0_2_MARK, PORT86_FN4, MSEL4CR_15_0),
877 PINMUX_DATA(MMCD0_3_MARK, PORT87_FN4, MSEL4CR_15_0),
878 PINMUX_DATA(MMCD0_4_MARK, PORT88_FN4, MSEL4CR_15_0),
879 PINMUX_DATA(MMCD0_5_MARK, PORT89_FN4, MSEL4CR_15_0),
880 PINMUX_DATA(MMCD0_6_MARK, PORT90_FN4, MSEL4CR_15_0),
881 PINMUX_DATA(MMCD0_7_MARK, PORT91_FN4, MSEL4CR_15_0),
882 PINMUX_DATA(MMCCMD0_MARK, PORT92_FN4, MSEL4CR_15_0),
883 PINMUX_DATA(SIM_RST_MARK, PORT94_FN4),
884 PINMUX_DATA(SIM_CLK_MARK, PORT95_FN4),
885 PINMUX_DATA(SIM_D_MARK, PORT98_FN4),
886 PINMUX_DATA(MMCCLK0_MARK, PORT99_FN4, MSEL4CR_15_0),
887 PINMUX_DATA(IDIN_1_113_MARK, PORT113_FN4, MSEL4CR_14_0),
888 PINMUX_DATA(OVCN_1_114_MARK, PORT114_FN4, MSEL4CR_14_0),
889 PINMUX_DATA(PWEN_1_115_MARK, PORT115_FN4),
890 PINMUX_DATA(EXTLP_1_MARK, PORT116_FN4),
891 PINMUX_DATA(OVCN2_1_MARK, PORT117_FN4),
892 PINMUX_DATA(KEYIN0_121_MARK, PORT121_FN4, MSEL4CR_18_1),
893 PINMUX_DATA(KEYIN1_122_MARK, PORT122_FN4, MSEL4CR_18_1),
894 PINMUX_DATA(KEYIN2_123_MARK, PORT123_FN4, MSEL4CR_18_1),
895 PINMUX_DATA(KEYIN3_124_MARK, PORT124_FN4, MSEL4CR_18_1),
896 PINMUX_DATA(PWEN_1_138_MARK, PORT138_FN4),
897 PINMUX_DATA(IROUT_140_MARK, PORT140_FN4),
898 PINMUX_DATA(LCDCS_MARK, PORT145_FN4),
899 PINMUX_DATA(LCDWR_MARK, PORT147_FN4),
900 PINMUX_DATA(LCDRS_MARK, PORT149_FN4),
901 PINMUX_DATA(OVCN_1_162_MARK, PORT162_FN4, MSEL4CR_14_1),
902
903 /* Function 5 */
904 PINMUX_DATA(GPI0_MARK, PORT41_FN5),
905 PINMUX_DATA(GPI1_MARK, PORT42_FN5),
906 PINMUX_DATA(GPO0_MARK, PORT43_FN5),
907 PINMUX_DATA(GPO1_MARK, PORT44_FN5),
908 PINMUX_DATA(I2C_SCL3S_MARK, PORT137_FN5, MSEL4CR_16_0),
909 PINMUX_DATA(I2C_SDA3S_MARK, PORT145_FN5, MSEL4CR_16_0),
910 PINMUX_DATA(I2C_SCL4S_MARK, PORT146_FN5, MSEL4CR_17_0),
911 PINMUX_DATA(I2C_SDA4S_MARK, PORT147_FN5, MSEL4CR_17_0),
912
913 /* Function select */
914 PINMUX_DATA(LCDC0_SELECT_MARK, MSEL3CR_6_0),
915 PINMUX_DATA(LCDC1_SELECT_MARK, MSEL3CR_6_1),
916
917 PINMUX_DATA(TS0_1SELECT_MARK, MSEL3CR_21_0, MSEL3CR_20_0),
918 PINMUX_DATA(TS0_2SELECT_MARK, MSEL3CR_21_0, MSEL3CR_20_1),
919 PINMUX_DATA(TS1_1SELECT_MARK, MSEL3CR_27_0, MSEL3CR_26_0),
920 PINMUX_DATA(TS1_2SELECT_MARK, MSEL3CR_27_0, MSEL3CR_26_1),
921
922 PINMUX_DATA(SDENC_CPG_MARK, MSEL4CR_19_0),
923 PINMUX_DATA(SDENC_DV_CLKI_MARK, MSEL4CR_19_1),
924
925 PINMUX_DATA(MFIv6_MARK, MSEL4CR_6_0),
926 PINMUX_DATA(MFIv4_MARK, MSEL4CR_6_1),
927};
928
929#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
930#define GPIO_PORT_ALL() _190(_GPIO_PORT, , unused)
931#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
932
933static struct pinmux_gpio pinmux_gpios[] = {
934
935 /* PORT */
936 GPIO_PORT_ALL(),
937
938 /* IRQ */
939 GPIO_FN(IRQ0_6), GPIO_FN(IRQ0_162), GPIO_FN(IRQ1),
940 GPIO_FN(IRQ2_4), GPIO_FN(IRQ2_5), GPIO_FN(IRQ3_8),
941 GPIO_FN(IRQ3_16), GPIO_FN(IRQ4_17), GPIO_FN(IRQ4_163),
942 GPIO_FN(IRQ5), GPIO_FN(IRQ6_39), GPIO_FN(IRQ6_164),
943 GPIO_FN(IRQ7_40), GPIO_FN(IRQ7_167), GPIO_FN(IRQ8_41),
944 GPIO_FN(IRQ8_168), GPIO_FN(IRQ9_42), GPIO_FN(IRQ9_169),
945 GPIO_FN(IRQ10), GPIO_FN(IRQ11), GPIO_FN(IRQ12_80),
946 GPIO_FN(IRQ12_137), GPIO_FN(IRQ13_81), GPIO_FN(IRQ13_145),
947 GPIO_FN(IRQ14_82), GPIO_FN(IRQ14_146), GPIO_FN(IRQ15_83),
948 GPIO_FN(IRQ15_147), GPIO_FN(IRQ16_84), GPIO_FN(IRQ16_170),
949 GPIO_FN(IRQ17), GPIO_FN(IRQ18), GPIO_FN(IRQ19),
950 GPIO_FN(IRQ20), GPIO_FN(IRQ21), GPIO_FN(IRQ22),
951 GPIO_FN(IRQ23), GPIO_FN(IRQ24), GPIO_FN(IRQ25),
952 GPIO_FN(IRQ26_121), GPIO_FN(IRQ26_172), GPIO_FN(IRQ27_122),
953 GPIO_FN(IRQ27_180), GPIO_FN(IRQ28_123), GPIO_FN(IRQ28_181),
954 GPIO_FN(IRQ29_129), GPIO_FN(IRQ29_182), GPIO_FN(IRQ30_130),
955 GPIO_FN(IRQ30_183), GPIO_FN(IRQ31_138), GPIO_FN(IRQ31_184),
956
957 /* MSIOF0 */
958 GPIO_FN(MSIOF0_TSYNC), GPIO_FN(MSIOF0_TSCK), GPIO_FN(MSIOF0_RXD),
959 GPIO_FN(MSIOF0_RSCK), GPIO_FN(MSIOF0_RSYNC), GPIO_FN(MSIOF0_MCK0),
960 GPIO_FN(MSIOF0_MCK1), GPIO_FN(MSIOF0_SS1), GPIO_FN(MSIOF0_SS2),
961 GPIO_FN(MSIOF0_TXD),
962
963 /* MSIOF1 */
964 GPIO_FN(MSIOF1_TSCK_39), GPIO_FN(MSIOF1_TSCK_88),
965 GPIO_FN(MSIOF1_TSYNC_40), GPIO_FN(MSIOF1_TSYNC_89),
966 GPIO_FN(MSIOF1_TXD_41), GPIO_FN(MSIOF1_TXD_90),
967 GPIO_FN(MSIOF1_RXD_42), GPIO_FN(MSIOF1_RXD_91),
968 GPIO_FN(MSIOF1_SS1_43), GPIO_FN(MSIOF1_SS1_92),
969 GPIO_FN(MSIOF1_SS2_44), GPIO_FN(MSIOF1_SS2_93),
970 GPIO_FN(MSIOF1_RSCK), GPIO_FN(MSIOF1_RSYNC),
971 GPIO_FN(MSIOF1_MCK0), GPIO_FN(MSIOF1_MCK1),
972
973 /* MSIOF2 */
974 GPIO_FN(MSIOF2_RSCK), GPIO_FN(MSIOF2_RSYNC), GPIO_FN(MSIOF2_MCK0),
975 GPIO_FN(MSIOF2_MCK1), GPIO_FN(MSIOF2_SS1), GPIO_FN(MSIOF2_SS2),
976 GPIO_FN(MSIOF2_TSYNC), GPIO_FN(MSIOF2_TSCK), GPIO_FN(MSIOF2_RXD),
977 GPIO_FN(MSIOF2_TXD),
978
979 /* BBIF1 */
980 GPIO_FN(BBIF1_RXD), GPIO_FN(BBIF1_TSYNC), GPIO_FN(BBIF1_TSCK),
981 GPIO_FN(BBIF1_TXD), GPIO_FN(BBIF1_RSCK), GPIO_FN(BBIF1_RSYNC),
982 GPIO_FN(BBIF1_FLOW), GPIO_FN(BB_RX_FLOW_N),
983
984 /* BBIF2 */
985 GPIO_FN(BBIF2_TSCK1), GPIO_FN(BBIF2_TSYNC1),
986 GPIO_FN(BBIF2_TXD1), GPIO_FN(BBIF2_RXD),
987
988 /* FSI */
989 GPIO_FN(FSIACK), GPIO_FN(FSIBCK), GPIO_FN(FSIAILR),
990 GPIO_FN(FSIAIBT), GPIO_FN(FSIAISLD), GPIO_FN(FSIAOMC),
991 GPIO_FN(FSIAOLR), GPIO_FN(FSIAOBT), GPIO_FN(FSIAOSLD),
992 GPIO_FN(FSIASPDIF_11), GPIO_FN(FSIASPDIF_15),
993
994 /* FMSI */
995 GPIO_FN(FMSOCK), GPIO_FN(FMSOOLR), GPIO_FN(FMSIOLR),
996 GPIO_FN(FMSOOBT), GPIO_FN(FMSIOBT), GPIO_FN(FMSOSLD),
997 GPIO_FN(FMSOILR), GPIO_FN(FMSIILR), GPIO_FN(FMSOIBT),
998 GPIO_FN(FMSIIBT), GPIO_FN(FMSISLD), GPIO_FN(FMSICK),
999
1000 /* SCIFA0 */
1001 GPIO_FN(SCIFA0_TXD), GPIO_FN(SCIFA0_RXD), GPIO_FN(SCIFA0_SCK),
1002 GPIO_FN(SCIFA0_RTS), GPIO_FN(SCIFA0_CTS),
1003
1004 /* SCIFA1 */
1005 GPIO_FN(SCIFA1_TXD), GPIO_FN(SCIFA1_RXD), GPIO_FN(SCIFA1_SCK),
1006 GPIO_FN(SCIFA1_RTS), GPIO_FN(SCIFA1_CTS),
1007
1008 /* SCIFA2 */
1009 GPIO_FN(SCIFA2_CTS1), GPIO_FN(SCIFA2_RTS1), GPIO_FN(SCIFA2_TXD1),
1010 GPIO_FN(SCIFA2_RXD1), GPIO_FN(SCIFA2_SCK1),
1011
1012 /* SCIFA3 */
1013 GPIO_FN(SCIFA3_CTS_43), GPIO_FN(SCIFA3_CTS_140),
1014 GPIO_FN(SCIFA3_RTS_44), GPIO_FN(SCIFA3_RTS_141),
1015 GPIO_FN(SCIFA3_SCK), GPIO_FN(SCIFA3_TXD),
1016 GPIO_FN(SCIFA3_RXD),
1017
1018 /* SCIFA4 */
1019 GPIO_FN(SCIFA4_RXD), GPIO_FN(SCIFA4_TXD),
1020
1021 /* SCIFA5 */
1022 GPIO_FN(SCIFA5_RXD), GPIO_FN(SCIFA5_TXD),
1023
1024 /* SCIFB */
1025 GPIO_FN(SCIFB_SCK), GPIO_FN(SCIFB_RTS), GPIO_FN(SCIFB_CTS),
1026 GPIO_FN(SCIFB_TXD), GPIO_FN(SCIFB_RXD),
1027
1028 /* CEU */
1029 GPIO_FN(VIO_HD), GPIO_FN(VIO_CKO1), GPIO_FN(VIO_CKO2),
1030 GPIO_FN(VIO_VD), GPIO_FN(VIO_CLK), GPIO_FN(VIO_FIELD),
1031 GPIO_FN(VIO_CKO), GPIO_FN(VIO_D0), GPIO_FN(VIO_D1),
1032 GPIO_FN(VIO_D2), GPIO_FN(VIO_D3), GPIO_FN(VIO_D4),
1033 GPIO_FN(VIO_D5), GPIO_FN(VIO_D6), GPIO_FN(VIO_D7),
1034 GPIO_FN(VIO_D8), GPIO_FN(VIO_D9), GPIO_FN(VIO_D10),
1035 GPIO_FN(VIO_D11), GPIO_FN(VIO_D12), GPIO_FN(VIO_D13),
1036 GPIO_FN(VIO_D14), GPIO_FN(VIO_D15),
1037
1038 /* USB0 */
1039 GPIO_FN(IDIN_0), GPIO_FN(EXTLP_0), GPIO_FN(OVCN2_0),
1040 GPIO_FN(PWEN_0), GPIO_FN(OVCN_0), GPIO_FN(VBUS0_0),
1041
1042 /* USB1 */
1043 GPIO_FN(IDIN_1_18), GPIO_FN(IDIN_1_113),
1044 GPIO_FN(OVCN_1_114), GPIO_FN(OVCN_1_162),
1045 GPIO_FN(PWEN_1_115), GPIO_FN(PWEN_1_138),
1046 GPIO_FN(EXTLP_1), GPIO_FN(OVCN2_1),
1047 GPIO_FN(VBUS0_1),
1048
1049 /* GPIO */
1050 GPIO_FN(GPI0), GPIO_FN(GPI1), GPIO_FN(GPO0), GPIO_FN(GPO1),
1051
1052 /* BSC */
1053 GPIO_FN(BS), GPIO_FN(WE1), GPIO_FN(CKO),
1054 GPIO_FN(WAIT), GPIO_FN(RDWR),
1055
1056 GPIO_FN(A0), GPIO_FN(A1), GPIO_FN(A2),
1057 GPIO_FN(A3), GPIO_FN(A6), GPIO_FN(A7),
1058 GPIO_FN(A8), GPIO_FN(A9), GPIO_FN(A10),
1059 GPIO_FN(A11), GPIO_FN(A12), GPIO_FN(A13),
1060 GPIO_FN(A14), GPIO_FN(A15), GPIO_FN(A16),
1061 GPIO_FN(A17), GPIO_FN(A18), GPIO_FN(A19),
1062 GPIO_FN(A20), GPIO_FN(A21), GPIO_FN(A22),
1063 GPIO_FN(A23), GPIO_FN(A24), GPIO_FN(A25),
1064 GPIO_FN(A26),
1065
1066 GPIO_FN(CS0), GPIO_FN(CS2), GPIO_FN(CS4),
1067 GPIO_FN(CS5A), GPIO_FN(CS5B), GPIO_FN(CS6A),
1068
1069 /* BSC/FLCTL */
1070 GPIO_FN(RD_FSC), GPIO_FN(WE0_FWE), GPIO_FN(A4_FOE),
1071 GPIO_FN(A5_FCDE), GPIO_FN(D0_NAF0), GPIO_FN(D1_NAF1),
1072 GPIO_FN(D2_NAF2), GPIO_FN(D3_NAF3), GPIO_FN(D4_NAF4),
1073 GPIO_FN(D5_NAF5), GPIO_FN(D6_NAF6), GPIO_FN(D7_NAF7),
1074 GPIO_FN(D8_NAF8), GPIO_FN(D9_NAF9), GPIO_FN(D10_NAF10),
1075 GPIO_FN(D11_NAF11), GPIO_FN(D12_NAF12), GPIO_FN(D13_NAF13),
1076 GPIO_FN(D14_NAF14), GPIO_FN(D15_NAF15),
1077
1078 /* MMCIF(1) */
1079 GPIO_FN(MMCD0_0), GPIO_FN(MMCD0_1), GPIO_FN(MMCD0_2),
1080 GPIO_FN(MMCD0_3), GPIO_FN(MMCD0_4), GPIO_FN(MMCD0_5),
1081 GPIO_FN(MMCD0_6), GPIO_FN(MMCD0_7), GPIO_FN(MMCCMD0),
1082 GPIO_FN(MMCCLK0),
1083
1084 /* MMCIF(2) */
1085 GPIO_FN(MMCD1_0), GPIO_FN(MMCD1_1), GPIO_FN(MMCD1_2),
1086 GPIO_FN(MMCD1_3), GPIO_FN(MMCD1_4), GPIO_FN(MMCD1_5),
1087 GPIO_FN(MMCD1_6), GPIO_FN(MMCD1_7), GPIO_FN(MMCCLK1),
1088 GPIO_FN(MMCCMD1),
1089
1090 /* SPU2 */
1091 GPIO_FN(VINT_I),
1092
1093 /* FLCTL */
1094 GPIO_FN(FCE1), GPIO_FN(FCE0), GPIO_FN(FRB),
1095
1096 /* HSI */
1097 GPIO_FN(GP_RX_FLAG), GPIO_FN(GP_RX_DATA), GPIO_FN(GP_TX_READY),
1098 GPIO_FN(GP_RX_WAKE), GPIO_FN(MP_TX_FLAG), GPIO_FN(MP_TX_DATA),
1099 GPIO_FN(MP_RX_READY), GPIO_FN(MP_TX_WAKE),
1100
1101 /* MFI */
1102 GPIO_FN(MFIv6),
1103 GPIO_FN(MFIv4),
1104
1105 GPIO_FN(MEMC_BUSCLK_MEMC_A0), GPIO_FN(MEMC_ADV_MEMC_DREQ0),
1106 GPIO_FN(MEMC_WAIT_MEMC_DREQ1), GPIO_FN(MEMC_CS1_MEMC_A1),
1107 GPIO_FN(MEMC_CS0), GPIO_FN(MEMC_NOE),
1108 GPIO_FN(MEMC_NWE), GPIO_FN(MEMC_INT),
1109
1110 GPIO_FN(MEMC_AD0), GPIO_FN(MEMC_AD1), GPIO_FN(MEMC_AD2),
1111 GPIO_FN(MEMC_AD3), GPIO_FN(MEMC_AD4), GPIO_FN(MEMC_AD5),
1112 GPIO_FN(MEMC_AD6), GPIO_FN(MEMC_AD7), GPIO_FN(MEMC_AD8),
1113 GPIO_FN(MEMC_AD9), GPIO_FN(MEMC_AD10), GPIO_FN(MEMC_AD11),
1114 GPIO_FN(MEMC_AD12), GPIO_FN(MEMC_AD13), GPIO_FN(MEMC_AD14),
1115 GPIO_FN(MEMC_AD15),
1116
1117 /* SIM */
1118 GPIO_FN(SIM_RST), GPIO_FN(SIM_CLK), GPIO_FN(SIM_D),
1119
1120 /* TPU */
1121 GPIO_FN(TPU0TO0), GPIO_FN(TPU0TO1), GPIO_FN(TPU0TO2_93),
1122 GPIO_FN(TPU0TO2_99), GPIO_FN(TPU0TO3),
1123
1124 /* I2C2 */
1125 GPIO_FN(I2C_SCL2), GPIO_FN(I2C_SDA2),
1126
1127 /* I2C3(1) */
1128 GPIO_FN(I2C_SCL3), GPIO_FN(I2C_SDA3),
1129
1130 /* I2C3(2) */
1131 GPIO_FN(I2C_SCL3S), GPIO_FN(I2C_SDA3S),
1132
1133 /* I2C4(2) */
1134 GPIO_FN(I2C_SCL4), GPIO_FN(I2C_SDA4),
1135
1136 /* I2C4(2) */
1137 GPIO_FN(I2C_SCL4S), GPIO_FN(I2C_SDA4S),
1138
1139 /* KEYSC */
1140 GPIO_FN(KEYOUT0), GPIO_FN(KEYIN0_121), GPIO_FN(KEYIN0_136),
1141 GPIO_FN(KEYOUT1), GPIO_FN(KEYIN1_122), GPIO_FN(KEYIN1_135),
1142 GPIO_FN(KEYOUT2), GPIO_FN(KEYIN2_123), GPIO_FN(KEYIN2_134),
1143 GPIO_FN(KEYOUT3), GPIO_FN(KEYIN3_124), GPIO_FN(KEYIN3_133),
1144 GPIO_FN(KEYOUT4), GPIO_FN(KEYIN4), GPIO_FN(KEYOUT5),
1145 GPIO_FN(KEYIN5), GPIO_FN(KEYOUT6), GPIO_FN(KEYIN6),
1146 GPIO_FN(KEYOUT7), GPIO_FN(KEYIN7),
1147
1148 /* LCDC */
1149 GPIO_FN(LCDHSYN), GPIO_FN(LCDCS), GPIO_FN(LCDVSYN),
1150 GPIO_FN(LCDDCK), GPIO_FN(LCDWR), GPIO_FN(LCDRD),
1151 GPIO_FN(LCDDISP), GPIO_FN(LCDRS), GPIO_FN(LCDLCLK),
1152 GPIO_FN(LCDDON),
1153
1154 GPIO_FN(LCDD0), GPIO_FN(LCDD1), GPIO_FN(LCDD2),
1155 GPIO_FN(LCDD3), GPIO_FN(LCDD4), GPIO_FN(LCDD5),
1156 GPIO_FN(LCDD6), GPIO_FN(LCDD7), GPIO_FN(LCDD8),
1157 GPIO_FN(LCDD9), GPIO_FN(LCDD10), GPIO_FN(LCDD11),
1158 GPIO_FN(LCDD12), GPIO_FN(LCDD13), GPIO_FN(LCDD14),
1159 GPIO_FN(LCDD15), GPIO_FN(LCDD16), GPIO_FN(LCDD17),
1160 GPIO_FN(LCDD18), GPIO_FN(LCDD19), GPIO_FN(LCDD20),
1161 GPIO_FN(LCDD21), GPIO_FN(LCDD22), GPIO_FN(LCDD23),
1162
1163 GPIO_FN(LCDC0_SELECT),
1164 GPIO_FN(LCDC1_SELECT),
1165
1166 /* IRDA */
1167 GPIO_FN(IRDA_OUT), GPIO_FN(IRDA_IN), GPIO_FN(IRDA_FIRSEL),
1168 GPIO_FN(IROUT_139), GPIO_FN(IROUT_140),
1169
1170 /* TSIF1 */
1171 GPIO_FN(TS0_1SELECT),
1172 GPIO_FN(TS0_2SELECT),
1173 GPIO_FN(TS1_1SELECT),
1174 GPIO_FN(TS1_2SELECT),
1175
1176 GPIO_FN(TS_SPSYNC1), GPIO_FN(TS_SDAT1),
1177 GPIO_FN(TS_SDEN1), GPIO_FN(TS_SCK1),
1178
1179 /* TSIF2 */
1180 GPIO_FN(TS_SPSYNC2), GPIO_FN(TS_SDAT2),
1181 GPIO_FN(TS_SDEN2), GPIO_FN(TS_SCK2),
1182
1183 /* HDMI */
1184 GPIO_FN(HDMI_HPD), GPIO_FN(HDMI_CEC),
1185
1186 /* SDHI0 */
1187 GPIO_FN(SDHICLK0), GPIO_FN(SDHICD0), GPIO_FN(SDHICMD0),
1188 GPIO_FN(SDHIWP0), GPIO_FN(SDHID0_0), GPIO_FN(SDHID0_1),
1189 GPIO_FN(SDHID0_2), GPIO_FN(SDHID0_3),
1190
1191 /* SDHI1 */
1192 GPIO_FN(SDHICLK1), GPIO_FN(SDHICMD1), GPIO_FN(SDHID1_0),
1193 GPIO_FN(SDHID1_1), GPIO_FN(SDHID1_2), GPIO_FN(SDHID1_3),
1194
1195 /* SDHI2 */
1196 GPIO_FN(SDHICLK2), GPIO_FN(SDHICMD2), GPIO_FN(SDHID2_0),
1197 GPIO_FN(SDHID2_1), GPIO_FN(SDHID2_2), GPIO_FN(SDHID2_3),
1198
1199 /* SDENC */
1200 GPIO_FN(SDENC_CPG),
1201 GPIO_FN(SDENC_DV_CLKI),
1202};
1203
1204/* helper for top 4 bits in PORTnCR */
1205#define PCRH(in, in_pd, in_pu, out) \
1206 0, (out), (in), 0, \
1207 0, 0, 0, 0, \
1208 0, 0, (in_pd), 0, \
1209 0, 0, (in_pu), 0
1210
1211#define PORTCR(nr, reg) \
1212 { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
1213 PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
1214 PORT##nr##_IN_PU, PORT##nr##_OUT), \
1215 PORT##nr##_FN0, PORT##nr##_FN1, PORT##nr##_FN2, \
1216 PORT##nr##_FN3, PORT##nr##_FN4, PORT##nr##_FN5, \
1217 PORT##nr##_FN6, PORT##nr##_FN7 } \
1218 }
1219
1220static struct pinmux_cfg_reg pinmux_config_regs[] = {
1221 PORTCR(0, 0xE6051000), /* PORT0CR */
1222 PORTCR(1, 0xE6051001), /* PORT1CR */
1223 PORTCR(2, 0xE6051002), /* PORT2CR */
1224 PORTCR(3, 0xE6051003), /* PORT3CR */
1225 PORTCR(4, 0xE6051004), /* PORT4CR */
1226 PORTCR(5, 0xE6051005), /* PORT5CR */
1227 PORTCR(6, 0xE6051006), /* PORT6CR */
1228 PORTCR(7, 0xE6051007), /* PORT7CR */
1229 PORTCR(8, 0xE6051008), /* PORT8CR */
1230 PORTCR(9, 0xE6051009), /* PORT9CR */
1231 PORTCR(10, 0xE605100A), /* PORT10CR */
1232 PORTCR(11, 0xE605100B), /* PORT11CR */
1233 PORTCR(12, 0xE605100C), /* PORT12CR */
1234 PORTCR(13, 0xE605100D), /* PORT13CR */
1235 PORTCR(14, 0xE605100E), /* PORT14CR */
1236 PORTCR(15, 0xE605100F), /* PORT15CR */
1237 PORTCR(16, 0xE6051010), /* PORT16CR */
1238 PORTCR(17, 0xE6051011), /* PORT17CR */
1239 PORTCR(18, 0xE6051012), /* PORT18CR */
1240 PORTCR(19, 0xE6051013), /* PORT19CR */
1241 PORTCR(20, 0xE6051014), /* PORT20CR */
1242 PORTCR(21, 0xE6051015), /* PORT21CR */
1243 PORTCR(22, 0xE6051016), /* PORT22CR */
1244 PORTCR(23, 0xE6051017), /* PORT23CR */
1245 PORTCR(24, 0xE6051018), /* PORT24CR */
1246 PORTCR(25, 0xE6051019), /* PORT25CR */
1247 PORTCR(26, 0xE605101A), /* PORT26CR */
1248 PORTCR(27, 0xE605101B), /* PORT27CR */
1249 PORTCR(28, 0xE605101C), /* PORT28CR */
1250 PORTCR(29, 0xE605101D), /* PORT29CR */
1251 PORTCR(30, 0xE605101E), /* PORT30CR */
1252 PORTCR(31, 0xE605101F), /* PORT31CR */
1253 PORTCR(32, 0xE6051020), /* PORT32CR */
1254 PORTCR(33, 0xE6051021), /* PORT33CR */
1255 PORTCR(34, 0xE6051022), /* PORT34CR */
1256 PORTCR(35, 0xE6051023), /* PORT35CR */
1257 PORTCR(36, 0xE6051024), /* PORT36CR */
1258 PORTCR(37, 0xE6051025), /* PORT37CR */
1259 PORTCR(38, 0xE6051026), /* PORT38CR */
1260 PORTCR(39, 0xE6051027), /* PORT39CR */
1261 PORTCR(40, 0xE6051028), /* PORT40CR */
1262 PORTCR(41, 0xE6051029), /* PORT41CR */
1263 PORTCR(42, 0xE605102A), /* PORT42CR */
1264 PORTCR(43, 0xE605102B), /* PORT43CR */
1265 PORTCR(44, 0xE605102C), /* PORT44CR */
1266 PORTCR(45, 0xE605102D), /* PORT45CR */
1267 PORTCR(46, 0xE605202E), /* PORT46CR */
1268 PORTCR(47, 0xE605202F), /* PORT47CR */
1269 PORTCR(48, 0xE6052030), /* PORT48CR */
1270 PORTCR(49, 0xE6052031), /* PORT49CR */
1271 PORTCR(50, 0xE6052032), /* PORT50CR */
1272 PORTCR(51, 0xE6052033), /* PORT51CR */
1273 PORTCR(52, 0xE6052034), /* PORT52CR */
1274 PORTCR(53, 0xE6052035), /* PORT53CR */
1275 PORTCR(54, 0xE6052036), /* PORT54CR */
1276 PORTCR(55, 0xE6052037), /* PORT55CR */
1277 PORTCR(56, 0xE6052038), /* PORT56CR */
1278 PORTCR(57, 0xE6052039), /* PORT57CR */
1279 PORTCR(58, 0xE605203A), /* PORT58CR */
1280 PORTCR(59, 0xE605203B), /* PORT59CR */
1281 PORTCR(60, 0xE605203C), /* PORT60CR */
1282 PORTCR(61, 0xE605203D), /* PORT61CR */
1283 PORTCR(62, 0xE605203E), /* PORT62CR */
1284 PORTCR(63, 0xE605203F), /* PORT63CR */
1285 PORTCR(64, 0xE6052040), /* PORT64CR */
1286 PORTCR(65, 0xE6052041), /* PORT65CR */
1287 PORTCR(66, 0xE6052042), /* PORT66CR */
1288 PORTCR(67, 0xE6052043), /* PORT67CR */
1289 PORTCR(68, 0xE6052044), /* PORT68CR */
1290 PORTCR(69, 0xE6052045), /* PORT69CR */
1291 PORTCR(70, 0xE6052046), /* PORT70CR */
1292 PORTCR(71, 0xE6052047), /* PORT71CR */
1293 PORTCR(72, 0xE6052048), /* PORT72CR */
1294 PORTCR(73, 0xE6052049), /* PORT73CR */
1295 PORTCR(74, 0xE605204A), /* PORT74CR */
1296 PORTCR(75, 0xE605204B), /* PORT75CR */
1297 PORTCR(76, 0xE605004C), /* PORT76CR */
1298 PORTCR(77, 0xE605004D), /* PORT77CR */
1299 PORTCR(78, 0xE605004E), /* PORT78CR */
1300 PORTCR(79, 0xE605004F), /* PORT79CR */
1301 PORTCR(80, 0xE6050050), /* PORT80CR */
1302 PORTCR(81, 0xE6050051), /* PORT81CR */
1303 PORTCR(82, 0xE6050052), /* PORT82CR */
1304 PORTCR(83, 0xE6050053), /* PORT83CR */
1305 PORTCR(84, 0xE6050054), /* PORT84CR */
1306 PORTCR(85, 0xE6050055), /* PORT85CR */
1307 PORTCR(86, 0xE6050056), /* PORT86CR */
1308 PORTCR(87, 0xE6050057), /* PORT87CR */
1309 PORTCR(88, 0xE6050058), /* PORT88CR */
1310 PORTCR(89, 0xE6050059), /* PORT89CR */
1311 PORTCR(90, 0xE605005A), /* PORT90CR */
1312 PORTCR(91, 0xE605005B), /* PORT91CR */
1313 PORTCR(92, 0xE605005C), /* PORT92CR */
1314 PORTCR(93, 0xE605005D), /* PORT93CR */
1315 PORTCR(94, 0xE605005E), /* PORT94CR */
1316 PORTCR(95, 0xE605005F), /* PORT95CR */
1317 PORTCR(96, 0xE6050060), /* PORT96CR */
1318 PORTCR(97, 0xE6050061), /* PORT97CR */
1319 PORTCR(98, 0xE6050062), /* PORT98CR */
1320 PORTCR(99, 0xE6050063), /* PORT99CR */
1321 PORTCR(100, 0xE6053064), /* PORT100CR */
1322 PORTCR(101, 0xE6053065), /* PORT101CR */
1323 PORTCR(102, 0xE6053066), /* PORT102CR */
1324 PORTCR(103, 0xE6053067), /* PORT103CR */
1325 PORTCR(104, 0xE6053068), /* PORT104CR */
1326 PORTCR(105, 0xE6053069), /* PORT105CR */
1327 PORTCR(106, 0xE605306A), /* PORT106CR */
1328 PORTCR(107, 0xE605306B), /* PORT107CR */
1329 PORTCR(108, 0xE605306C), /* PORT108CR */
1330 PORTCR(109, 0xE605306D), /* PORT109CR */
1331 PORTCR(110, 0xE605306E), /* PORT110CR */
1332 PORTCR(111, 0xE605306F), /* PORT111CR */
1333 PORTCR(112, 0xE6053070), /* PORT112CR */
1334 PORTCR(113, 0xE6053071), /* PORT113CR */
1335 PORTCR(114, 0xE6053072), /* PORT114CR */
1336 PORTCR(115, 0xE6053073), /* PORT115CR */
1337 PORTCR(116, 0xE6053074), /* PORT116CR */
1338 PORTCR(117, 0xE6053075), /* PORT117CR */
1339 PORTCR(118, 0xE6053076), /* PORT118CR */
1340 PORTCR(119, 0xE6053077), /* PORT119CR */
1341 PORTCR(120, 0xE6053078), /* PORT120CR */
1342 PORTCR(121, 0xE6050079), /* PORT121CR */
1343 PORTCR(122, 0xE605007A), /* PORT122CR */
1344 PORTCR(123, 0xE605007B), /* PORT123CR */
1345 PORTCR(124, 0xE605007C), /* PORT124CR */
1346 PORTCR(125, 0xE605007D), /* PORT125CR */
1347 PORTCR(126, 0xE605007E), /* PORT126CR */
1348 PORTCR(127, 0xE605007F), /* PORT127CR */
1349 PORTCR(128, 0xE6050080), /* PORT128CR */
1350 PORTCR(129, 0xE6050081), /* PORT129CR */
1351 PORTCR(130, 0xE6050082), /* PORT130CR */
1352 PORTCR(131, 0xE6050083), /* PORT131CR */
1353 PORTCR(132, 0xE6050084), /* PORT132CR */
1354 PORTCR(133, 0xE6050085), /* PORT133CR */
1355 PORTCR(134, 0xE6050086), /* PORT134CR */
1356 PORTCR(135, 0xE6050087), /* PORT135CR */
1357 PORTCR(136, 0xE6050088), /* PORT136CR */
1358 PORTCR(137, 0xE6050089), /* PORT137CR */
1359 PORTCR(138, 0xE605008A), /* PORT138CR */
1360 PORTCR(139, 0xE605008B), /* PORT139CR */
1361 PORTCR(140, 0xE605008C), /* PORT140CR */
1362 PORTCR(141, 0xE605008D), /* PORT141CR */
1363 PORTCR(142, 0xE605008E), /* PORT142CR */
1364 PORTCR(143, 0xE605008F), /* PORT143CR */
1365 PORTCR(144, 0xE6050090), /* PORT144CR */
1366 PORTCR(145, 0xE6050091), /* PORT145CR */
1367 PORTCR(146, 0xE6050092), /* PORT146CR */
1368 PORTCR(147, 0xE6050093), /* PORT147CR */
1369 PORTCR(148, 0xE6050094), /* PORT148CR */
1370 PORTCR(149, 0xE6050095), /* PORT149CR */
1371 PORTCR(150, 0xE6050096), /* PORT150CR */
1372 PORTCR(151, 0xE6050097), /* PORT151CR */
1373 PORTCR(152, 0xE6053098), /* PORT152CR */
1374 PORTCR(153, 0xE6053099), /* PORT153CR */
1375 PORTCR(154, 0xE605309A), /* PORT154CR */
1376 PORTCR(155, 0xE605309B), /* PORT155CR */
1377 PORTCR(156, 0xE605009C), /* PORT156CR */
1378 PORTCR(157, 0xE605009D), /* PORT157CR */
1379 PORTCR(158, 0xE605009E), /* PORT158CR */
1380 PORTCR(159, 0xE605009F), /* PORT159CR */
1381 PORTCR(160, 0xE60500A0), /* PORT160CR */
1382 PORTCR(161, 0xE60500A1), /* PORT161CR */
1383 PORTCR(162, 0xE60500A2), /* PORT162CR */
1384 PORTCR(163, 0xE60500A3), /* PORT163CR */
1385 PORTCR(164, 0xE60500A4), /* PORT164CR */
1386 PORTCR(165, 0xE60500A5), /* PORT165CR */
1387 PORTCR(166, 0xE60500A6), /* PORT166CR */
1388 PORTCR(167, 0xE60520A7), /* PORT167CR */
1389 PORTCR(168, 0xE60520A8), /* PORT168CR */
1390 PORTCR(169, 0xE60520A9), /* PORT169CR */
1391 PORTCR(170, 0xE60520AA), /* PORT170CR */
1392 PORTCR(171, 0xE60520AB), /* PORT171CR */
1393 PORTCR(172, 0xE60520AC), /* PORT172CR */
1394 PORTCR(173, 0xE60520AD), /* PORT173CR */
1395 PORTCR(174, 0xE60520AE), /* PORT174CR */
1396 PORTCR(175, 0xE60520AF), /* PORT175CR */
1397 PORTCR(176, 0xE60520B0), /* PORT176CR */
1398 PORTCR(177, 0xE60520B1), /* PORT177CR */
1399 PORTCR(178, 0xE60520B2), /* PORT178CR */
1400 PORTCR(179, 0xE60520B3), /* PORT179CR */
1401 PORTCR(180, 0xE60520B4), /* PORT180CR */
1402 PORTCR(181, 0xE60520B5), /* PORT181CR */
1403 PORTCR(182, 0xE60520B6), /* PORT182CR */
1404 PORTCR(183, 0xE60520B7), /* PORT183CR */
1405 PORTCR(184, 0xE60520B8), /* PORT184CR */
1406 PORTCR(185, 0xE60520B9), /* PORT185CR */
1407 PORTCR(186, 0xE60520BA), /* PORT186CR */
1408 PORTCR(187, 0xE60520BB), /* PORT187CR */
1409 PORTCR(188, 0xE60520BC), /* PORT188CR */
1410 PORTCR(189, 0xE60520BD), /* PORT189CR */
1411 PORTCR(190, 0xE60520BE), /* PORT190CR */
1412
1413 { PINMUX_CFG_REG("MSEL1CR", 0xE605800C, 32, 1) {
1414 MSEL1CR_31_0, MSEL1CR_31_1,
1415 MSEL1CR_30_0, MSEL1CR_30_1,
1416 MSEL1CR_29_0, MSEL1CR_29_1,
1417 MSEL1CR_28_0, MSEL1CR_28_1,
1418 MSEL1CR_27_0, MSEL1CR_27_1,
1419 MSEL1CR_26_0, MSEL1CR_26_1,
1420 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1421 0, 0, 0, 0, 0, 0, 0, 0,
1422 MSEL1CR_16_0, MSEL1CR_16_1,
1423 MSEL1CR_15_0, MSEL1CR_15_1,
1424 MSEL1CR_14_0, MSEL1CR_14_1,
1425 MSEL1CR_13_0, MSEL1CR_13_1,
1426 MSEL1CR_12_0, MSEL1CR_12_1,
1427 0, 0, 0, 0,
1428 MSEL1CR_9_0, MSEL1CR_9_1,
1429 MSEL1CR_8_0, MSEL1CR_8_1,
1430 MSEL1CR_7_0, MSEL1CR_7_1,
1431 MSEL1CR_6_0, MSEL1CR_6_1,
1432 0, 0,
1433 MSEL1CR_4_0, MSEL1CR_4_1,
1434 MSEL1CR_3_0, MSEL1CR_3_1,
1435 MSEL1CR_2_0, MSEL1CR_2_1,
1436 0, 0,
1437 MSEL1CR_0_0, MSEL1CR_0_1,
1438 }
1439 },
1440 { PINMUX_CFG_REG("MSEL3CR", 0xE6058020, 32, 1) {
1441 0, 0, 0, 0,
1442 0, 0, 0, 0,
1443 MSEL3CR_27_0, MSEL3CR_27_1,
1444 MSEL3CR_26_0, MSEL3CR_26_1,
1445 0, 0, 0, 0,
1446 0, 0, 0, 0,
1447 MSEL3CR_21_0, MSEL3CR_21_1,
1448 MSEL3CR_20_0, MSEL3CR_20_1,
1449 0, 0, 0, 0,
1450 0, 0, 0, 0,
1451 MSEL3CR_15_0, MSEL3CR_15_1,
1452 0, 0, 0, 0,
1453 0, 0, 0, 0,
1454 0, 0,
1455 MSEL3CR_9_0, MSEL3CR_9_1,
1456 0, 0, 0, 0,
1457 MSEL3CR_6_0, MSEL3CR_6_1,
1458 0, 0, 0, 0,
1459 0, 0, 0, 0,
1460 0, 0, 0, 0,
1461 }
1462 },
1463 { PINMUX_CFG_REG("MSEL4CR", 0xE6058024, 32, 1) {
1464 0, 0, 0, 0,
1465 0, 0, 0, 0,
1466 0, 0, 0, 0,
1467 0, 0, 0, 0,
1468 0, 0, 0, 0,
1469 0, 0, 0, 0,
1470 MSEL4CR_19_0, MSEL4CR_19_1,
1471 MSEL4CR_18_0, MSEL4CR_18_1,
1472 MSEL4CR_17_0, MSEL4CR_17_1,
1473 MSEL4CR_16_0, MSEL4CR_16_1,
1474 MSEL4CR_15_0, MSEL4CR_15_1,
1475 MSEL4CR_14_0, MSEL4CR_14_1,
1476 0, 0, 0, 0,
1477 0, 0,
1478 MSEL4CR_10_0, MSEL4CR_10_1,
1479 0, 0, 0, 0,
1480 0, 0,
1481 MSEL4CR_6_0, MSEL4CR_6_1,
1482 0, 0,
1483 MSEL4CR_4_0, MSEL4CR_4_1,
1484 0, 0, 0, 0,
1485 MSEL4CR_1_0, MSEL4CR_1_1,
1486 0, 0,
1487 }
1488 },
1489 { },
1490};
1491
1492static struct pinmux_data_reg pinmux_data_regs[] = {
1493 { PINMUX_DATA_REG("PORTL095_064DR", 0xE6054008, 32) {
1494 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
1495 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
1496 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
1497 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
1498 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
1499 0, 0, 0, 0,
1500 0, 0, 0, 0,
1501 0, 0, 0, 0,
1502 }
1503 },
1504 { PINMUX_DATA_REG("PORTL127_096DR", 0xE605400C, 32) {
1505 PORT127_DATA, PORT126_DATA, PORT125_DATA, PORT124_DATA,
1506 PORT123_DATA, PORT122_DATA, PORT121_DATA, 0,
1507 0, 0, 0, 0,
1508 0, 0, 0, 0,
1509 0, 0, 0, 0,
1510 0, 0, 0, 0,
1511 0, 0, 0, 0,
1512 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA,
1513 }
1514 },
1515 { PINMUX_DATA_REG("PORTL159_128DR", 0xE6054010, 32) {
1516 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
1517 0, 0, 0, 0,
1518 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
1519 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
1520 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
1521 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
1522 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
1523 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA,
1524 }
1525 },
1526 { PINMUX_DATA_REG("PORTL191_160DR", 0xE6054014, 32) {
1527 0, 0, 0, 0,
1528 0, 0, 0, 0,
1529 0, 0, 0, 0,
1530 0, 0, 0, 0,
1531 0, 0, 0, 0,
1532 0, 0, 0, 0,
1533 0, PORT166_DATA, PORT165_DATA, PORT164_DATA,
1534 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA,
1535 }
1536 },
1537 { PINMUX_DATA_REG("PORTD031_000DR", 0xE6055000, 32) {
1538 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
1539 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
1540 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
1541 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
1542 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
1543 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
1544 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
1545 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA,
1546 }
1547 },
1548 { PINMUX_DATA_REG("PORTD063_032DR", 0xE6055004, 32) {
1549 0, 0, 0, 0, 0, 0, 0, 0,
1550 0, 0, 0, 0, 0, 0, 0, 0,
1551 0, 0, PORT45_DATA, PORT44_DATA,
1552 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
1553 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
1554 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA,
1555 }
1556 },
1557 { PINMUX_DATA_REG("PORTR063_032DR", 0xE6056004, 32) {
1558 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
1559 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
1560 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
1561 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
1562 PORT47_DATA, PORT46_DATA, 0, 0,
1563 0, 0, 0, 0,
1564 0, 0, 0, 0,
1565 0, 0, 0, 0,
1566 }
1567 },
1568 { PINMUX_DATA_REG("PORTR095_064DR", 0xE6056008, 32) {
1569 0, 0, 0, 0,
1570 0, 0, 0, 0,
1571 0, 0, 0, 0,
1572 0, 0, 0, 0,
1573 0, 0, 0, 0,
1574 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
1575 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
1576 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA,
1577 }
1578 },
1579 { PINMUX_DATA_REG("PORTR191_160DR", 0xE6056014, 32) {
1580 0, PORT190_DATA, PORT189_DATA, PORT188_DATA,
1581 PORT187_DATA, PORT186_DATA, PORT185_DATA, PORT184_DATA,
1582 PORT183_DATA, PORT182_DATA, PORT181_DATA, PORT180_DATA,
1583 PORT179_DATA, PORT178_DATA, PORT177_DATA, PORT176_DATA,
1584 PORT175_DATA, PORT174_DATA, PORT173_DATA, PORT172_DATA,
1585 PORT171_DATA, PORT170_DATA, PORT169_DATA, PORT168_DATA,
1586 PORT167_DATA, 0, 0, 0,
1587 0, 0, 0, 0,
1588 }
1589 },
1590 { PINMUX_DATA_REG("PORTU127_096DR", 0xE605700C, 32) {
1591 0, 0, 0, 0,
1592 0, 0, 0, PORT120_DATA,
1593 PORT119_DATA, PORT118_DATA, PORT117_DATA, PORT116_DATA,
1594 PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
1595 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
1596 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
1597 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
1598 0, 0, 0, 0,
1599 }
1600 },
1601 { PINMUX_DATA_REG("PORTU159_128DR", 0xE6057010, 32) {
1602 0, 0, 0, 0,
1603 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
1604 0, 0, 0, 0,
1605 0, 0, 0, 0,
1606 0, 0, 0, 0,
1607 0, 0, 0, 0,
1608 0, 0, 0, 0,
1609 0, 0, 0, 0,
1610 }
1611 },
1612 { },
1613};
1614
1615static struct pinmux_info sh7372_pinmux_info = {
1616 .name = "sh7372_pfc",
1617 .reserved_id = PINMUX_RESERVED,
1618 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1619 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1620 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1621 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
1622 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1623 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1624 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1625
1626 .first_gpio = GPIO_PORT0,
1627 .last_gpio = GPIO_FN_SDENC_DV_CLKI,
1628
1629 .gpios = pinmux_gpios,
1630 .cfg_regs = pinmux_config_regs,
1631 .data_regs = pinmux_data_regs,
1632
1633 .gpio_data = pinmux_data,
1634 .gpio_data_size = ARRAY_SIZE(pinmux_data),
1635};
1636
1637void sh7372_pinmux_init(void)
1638{
1639 register_pinmux(&sh7372_pinmux_info);
1640}
diff --git a/arch/arm/mach-shmobile/pfc-sh7377.c b/arch/arm/mach-shmobile/pfc-sh7377.c
new file mode 100644
index 000000000000..613e6842ad05
--- /dev/null
+++ b/arch/arm/mach-shmobile/pfc-sh7377.c
@@ -0,0 +1,1767 @@
1/*
2 * sh7377 processor support - PFC hardware block
3 *
4 * Copyright (C) 2010 NISHIMOTO Hiroki
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of the
9 * 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#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/gpio.h>
23#include <mach/sh7377.h>
24
25#define _1(fn, pfx, sfx) fn(pfx, sfx)
26
27#define _10(fn, pfx, sfx) \
28 _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
29 _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
30 _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
31 _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
32 _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
33
34#define _90(fn, pfx, sfx) \
35 _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \
36 _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \
37 _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \
38 _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx), \
39 _10(fn, pfx##9, sfx)
40
41#define _265(fn, pfx, sfx) \
42 _10(fn, pfx, sfx), _90(fn, pfx, sfx), \
43 _10(fn, pfx##10, sfx), \
44 _1(fn, pfx##110, sfx), _1(fn, pfx##111, sfx), \
45 _1(fn, pfx##112, sfx), _1(fn, pfx##113, sfx), \
46 _1(fn, pfx##114, sfx), _1(fn, pfx##115, sfx), \
47 _1(fn, pfx##116, sfx), _1(fn, pfx##117, sfx), \
48 _1(fn, pfx##118, sfx), \
49 _1(fn, pfx##128, sfx), _1(fn, pfx##129, sfx), \
50 _10(fn, pfx##13, sfx), _10(fn, pfx##14, sfx), \
51 _10(fn, pfx##15, sfx), \
52 _1(fn, pfx##160, sfx), _1(fn, pfx##161, sfx), \
53 _1(fn, pfx##162, sfx), _1(fn, pfx##163, sfx), \
54 _1(fn, pfx##164, sfx), \
55 _1(fn, pfx##192, sfx), _1(fn, pfx##193, sfx), \
56 _1(fn, pfx##194, sfx), _1(fn, pfx##195, sfx), \
57 _1(fn, pfx##196, sfx), _1(fn, pfx##197, sfx), \
58 _1(fn, pfx##198, sfx), _1(fn, pfx##199, sfx), \
59 _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \
60 _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \
61 _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \
62 _1(fn, pfx##260, sfx), _1(fn, pfx##261, sfx), \
63 _1(fn, pfx##262, sfx), _1(fn, pfx##263, sfx), \
64 _1(fn, pfx##264, sfx)
65
66#define _PORT(pfx, sfx) pfx##_##sfx
67#define PORT_265(str) _265(_PORT, PORT, str)
68
69enum {
70 PINMUX_RESERVED = 0,
71
72 PINMUX_DATA_BEGIN,
73 PORT_265(DATA), /* PORT0_DATA -> PORT264_DATA */
74 PINMUX_DATA_END,
75
76 PINMUX_INPUT_BEGIN,
77 PORT_265(IN), /* PORT0_IN -> PORT264_IN */
78 PINMUX_INPUT_END,
79
80 PINMUX_INPUT_PULLUP_BEGIN,
81 PORT_265(IN_PU), /* PORT0_IN_PU -> PORT264_IN_PU */
82 PINMUX_INPUT_PULLUP_END,
83
84 PINMUX_INPUT_PULLDOWN_BEGIN,
85 PORT_265(IN_PD), /* PORT0_IN_PD -> PORT264_IN_PD */
86 PINMUX_INPUT_PULLDOWN_END,
87
88 PINMUX_OUTPUT_BEGIN,
89 PORT_265(OUT), /* PORT0_OUT -> PORT264_OUT */
90 PINMUX_OUTPUT_END,
91
92 PINMUX_FUNCTION_BEGIN,
93 PORT_265(FN_IN), /* PORT0_FN_IN -> PORT264_FN_IN */
94 PORT_265(FN_OUT), /* PORT0_FN_OUT -> PORT264_FN_OUT */
95 PORT_265(FN0), /* PORT0_FN0 -> PORT264_FN0 */
96 PORT_265(FN1), /* PORT0_FN1 -> PORT264_FN1 */
97 PORT_265(FN2), /* PORT0_FN2 -> PORT264_FN2 */
98 PORT_265(FN3), /* PORT0_FN3 -> PORT264_FN3 */
99 PORT_265(FN4), /* PORT0_FN4 -> PORT264_FN4 */
100 PORT_265(FN5), /* PORT0_FN5 -> PORT264_FN5 */
101 PORT_265(FN6), /* PORT0_FN6 -> PORT264_FN6 */
102 PORT_265(FN7), /* PORT0_FN7 -> PORT264_FN7 */
103
104 MSELBCR_MSEL17_1, MSELBCR_MSEL17_0,
105 MSELBCR_MSEL16_1, MSELBCR_MSEL16_0,
106 PINMUX_FUNCTION_END,
107
108 PINMUX_MARK_BEGIN,
109 /* Special Pull-up / Pull-down Functions */
110 PORT66_KEYIN0_PU_MARK, PORT67_KEYIN1_PU_MARK,
111 PORT68_KEYIN2_PU_MARK, PORT69_KEYIN3_PU_MARK,
112 PORT70_KEYIN4_PU_MARK, PORT71_KEYIN5_PU_MARK,
113 PORT72_KEYIN6_PU_MARK,
114
115 /* 55-1 */
116 VBUS_0_MARK,
117 CPORT0_MARK,
118 CPORT1_MARK,
119 CPORT2_MARK,
120 CPORT3_MARK,
121 CPORT4_MARK,
122 CPORT5_MARK,
123 CPORT6_MARK,
124 CPORT7_MARK,
125 CPORT8_MARK,
126 CPORT9_MARK,
127 CPORT10_MARK,
128 CPORT11_MARK, SIN2_MARK,
129 CPORT12_MARK, XCTS2_MARK,
130 CPORT13_MARK, RFSPO4_MARK,
131 CPORT14_MARK, RFSPO5_MARK,
132 CPORT15_MARK, SCIFA0_SCK_MARK, GPS_AGC2_MARK,
133 CPORT16_MARK, SCIFA0_TXD_MARK, GPS_AGC3_MARK,
134 CPORT17_IC_OE_MARK, SOUT2_MARK,
135 CPORT18_MARK, XRTS2_MARK, PORT19_VIO_CKO2_MARK,
136 CPORT19_MPORT1_MARK,
137 CPORT20_MARK, RFSPO6_MARK,
138 CPORT21_MARK, STATUS0_MARK,
139 CPORT22_MARK, STATUS1_MARK,
140 CPORT23_MARK, STATUS2_MARK, RFSPO7_MARK,
141 B_SYNLD1_MARK,
142 B_SYNLD2_MARK, SYSENMSK_MARK,
143 XMAINPS_MARK,
144 XDIVPS_MARK,
145 XIDRST_MARK,
146 IDCLK_MARK, IC_DP_MARK,
147 IDIO_MARK, IC_DM_MARK,
148 SOUT1_MARK, SCIFA4_TXD_MARK, M02_BERDAT_MARK,
149 SIN1_MARK, SCIFA4_RXD_MARK, XWUP_MARK,
150 XRTS1_MARK, SCIFA4_RTS_MARK, M03_BERCLK_MARK,
151 XCTS1_MARK, SCIFA4_CTS_MARK,
152 PCMCLKO_MARK,
153 SYNC8KO_MARK,
154
155 /* 55-2 */
156 DNPCM_A_MARK,
157 UPPCM_A_MARK,
158 VACK_MARK,
159 XTALB1L_MARK,
160 GPS_AGC1_MARK, SCIFA0_RTS_MARK,
161 GPS_AGC4_MARK, SCIFA0_RXD_MARK,
162 GPS_PWRDOWN_MARK, SCIFA0_CTS_MARK,
163 GPS_IM_MARK,
164 GPS_IS_MARK,
165 GPS_QM_MARK,
166 GPS_QS_MARK,
167 FMSOCK_MARK, PORT49_IRDA_OUT_MARK, PORT49_IROUT_MARK,
168 FMSOOLR_MARK, BBIF2_TSYNC2_MARK, TPU2TO2_MARK, IPORT3_MARK,
169 FMSIOLR_MARK,
170 FMSOOBT_MARK, BBIF2_TSCK2_MARK, TPU2TO3_MARK, OPORT1_MARK,
171 FMSIOBT_MARK,
172 FMSOSLD_MARK, BBIF2_TXD2_MARK, OPORT2_MARK,
173 FMSOILR_MARK, PORT53_IRDA_IN_MARK, TPU3TO3_MARK, OPORT3_MARK,
174 FMSIILR_MARK,
175 FMSOIBT_MARK, PORT54_IRDA_FIRSEL_MARK, TPU3TO2_MARK, FMSIIBT_MARK,
176 FMSISLD_MARK, MFG0_OUT1_MARK, TPU0TO0_MARK,
177 A0_EA0_MARK, BS_MARK,
178 A12_EA12_MARK, PORT58_VIO_CKOR_MARK, TPU4TO2_MARK,
179 A13_EA13_MARK, PORT59_IROUT_MARK, MFG0_OUT2_MARK, TPU0TO1_MARK,
180 A14_EA14_MARK, PORT60_KEYOUT5_MARK,
181 A15_EA15_MARK, PORT61_KEYOUT4_MARK,
182 A16_EA16_MARK, PORT62_KEYOUT3_MARK, MSIOF0_SS1_MARK,
183 A17_EA17_MARK, PORT63_KEYOUT2_MARK, MSIOF0_TSYNC_MARK,
184 A18_EA18_MARK, PORT64_KEYOUT1_MARK, MSIOF0_TSCK_MARK,
185 A19_EA19_MARK, PORT65_KEYOUT0_MARK, MSIOF0_TXD_MARK,
186 A20_EA20_MARK, PORT66_KEYIN0_MARK, MSIOF0_RSCK_MARK,
187 A21_EA21_MARK, PORT67_KEYIN1_MARK, MSIOF0_RSYNC_MARK,
188 A22_EA22_MARK, PORT68_KEYIN2_MARK, MSIOF0_MCK0_MARK,
189 A23_EA23_MARK, PORT69_KEYIN3_MARK, MSIOF0_MCK1_MARK,
190 A24_EA24_MARK, PORT70_KEYIN4_MARK, MSIOF0_RXD_MARK,
191 A25_EA25_MARK, PORT71_KEYIN5_MARK, MSIOF0_SS2_MARK,
192 A26_MARK, PORT72_KEYIN6_MARK,
193 D0_ED0_NAF0_MARK,
194 D1_ED1_NAF1_MARK,
195 D2_ED2_NAF2_MARK,
196 D3_ED3_NAF3_MARK,
197 D4_ED4_NAF4_MARK,
198 D5_ED5_NAF5_MARK,
199 D6_ED6_NAF6_MARK,
200 D7_ED7_NAF7_MARK,
201 D8_ED8_NAF8_MARK,
202 D9_ED9_NAF9_MARK,
203 D10_ED10_NAF10_MARK,
204 D11_ED11_NAF11_MARK,
205 D12_ED12_NAF12_MARK,
206 D13_ED13_NAF13_MARK,
207 D14_ED14_NAF14_MARK,
208 D15_ED15_NAF15_MARK,
209 CS4_MARK,
210 CS5A_MARK, FMSICK_MARK,
211 CS5B_MARK, FCE1_MARK,
212
213 /* 55-3 */
214 CS6B_MARK, XCS2_MARK, CS6A_MARK, DACK0_MARK,
215 FCE0_MARK,
216 WAIT_MARK, DREQ0_MARK,
217 RD_XRD_MARK,
218 WE0_XWR0_FWE_MARK,
219 WE1_XWR1_MARK,
220 FRB_MARK,
221 CKO_MARK,
222 NBRSTOUT_MARK,
223 NBRST_MARK,
224 GPS_EPPSIN_MARK,
225 LATCHPULSE_MARK,
226 LTESIGNAL_MARK,
227 LEGACYSTATE_MARK,
228 TCKON_MARK,
229 VIO_VD_MARK, PORT128_KEYOUT0_MARK, IPORT0_MARK,
230 VIO_HD_MARK, PORT129_KEYOUT1_MARK, IPORT1_MARK,
231 VIO_D0_MARK, PORT130_KEYOUT2_MARK, PORT130_MSIOF2_RXD_MARK,
232 VIO_D1_MARK, PORT131_KEYOUT3_MARK, PORT131_MSIOF2_SS1_MARK,
233 VIO_D2_MARK, PORT132_KEYOUT4_MARK, PORT132_MSIOF2_SS2_MARK,
234 VIO_D3_MARK, PORT133_KEYOUT5_MARK, PORT133_MSIOF2_TSYNC_MARK,
235 VIO_D4_MARK, PORT134_KEYIN0_MARK, PORT134_MSIOF2_TXD_MARK,
236 VIO_D5_MARK, PORT135_KEYIN1_MARK, PORT135_MSIOF2_TSCK_MARK,
237 VIO_D6_MARK, PORT136_KEYIN2_MARK,
238 VIO_D7_MARK, PORT137_KEYIN3_MARK,
239 VIO_D8_MARK, M9_SLCD_A01_MARK, PORT138_FSIAOMC_MARK,
240 VIO_D9_MARK, M10_SLCD_CK1_MARK, PORT139_FSIAOLR_MARK,
241 VIO_D10_MARK, M11_SLCD_SO1_MARK, TPU0TO2_MARK, PORT140_FSIAOBT_MARK,
242 VIO_D11_MARK, M12_SLCD_CE1_MARK, TPU0TO3_MARK, PORT141_FSIAOSLD_MARK,
243 VIO_D12_MARK, M13_BSW_MARK, PORT142_FSIACK_MARK,
244 VIO_D13_MARK, M14_GSW_MARK, PORT143_FSIAILR_MARK,
245 VIO_D14_MARK, M15_RSW_MARK, PORT144_FSIAIBT_MARK,
246 VIO_D15_MARK, TPU1TO3_MARK, PORT145_FSIAISLD_MARK,
247 VIO_CLK_MARK, PORT146_KEYIN4_MARK, IPORT2_MARK,
248 VIO_FIELD_MARK, PORT147_KEYIN5_MARK,
249 VIO_CKO_MARK, PORT148_KEYIN6_MARK,
250 A27_MARK, RDWR_XWE_MARK, MFG0_IN1_MARK,
251 MFG0_IN2_MARK,
252 TS_SPSYNC3_MARK, MSIOF2_RSCK_MARK,
253 TS_SDAT3_MARK, MSIOF2_RSYNC_MARK,
254 TPU1TO2_MARK, TS_SDEN3_MARK, PORT153_MSIOF2_SS1_MARK,
255 SOUT3_MARK, SCIFA2_TXD1_MARK, MSIOF2_MCK0_MARK,
256 SIN3_MARK, SCIFA2_RXD1_MARK, MSIOF2_MCK1_MARK,
257 XRTS3_MARK, SCIFA2_RTS1_MARK, PORT156_MSIOF2_SS2_MARK,
258 XCTS3_MARK, SCIFA2_CTS1_MARK, PORT157_MSIOF2_RXD_MARK,
259
260 /* 55-4 */
261 DINT_MARK, SCIFA2_SCK1_MARK, TS_SCK3_MARK,
262 PORT159_SCIFB_SCK_MARK, PORT159_SCIFA5_SCK_MARK, NMI_MARK,
263 PORT160_SCIFB_TXD_MARK, PORT160_SCIFA5_TXD_MARK, SOUT0_MARK,
264 PORT161_SCIFB_CTS_MARK, PORT161_SCIFA5_CTS_MARK, XCTS0_MARK,
265 MFG3_IN2_MARK,
266 PORT162_SCIFB_RXD_MARK, PORT162_SCIFA5_RXD_MARK, SIN0_MARK,
267 MFG3_IN1_MARK,
268 PORT163_SCIFB_RTS_MARK, PORT163_SCIFA5_RTS_MARK, XRTS0_MARK,
269 MFG3_OUT1_MARK, TPU3TO0_MARK,
270 LCDD0_MARK, PORT192_KEYOUT0_MARK, EXT_CKI_MARK,
271 LCDD1_MARK, PORT193_KEYOUT1_MARK, PORT193_SCIFA5_CTS_MARK,
272 BBIF2_TSYNC1_MARK,
273 LCDD2_MARK, PORT194_KEYOUT2_MARK, PORT194_SCIFA5_RTS_MARK,
274 BBIF2_TSCK1_MARK,
275 LCDD3_MARK, PORT195_KEYOUT3_MARK, PORT195_SCIFA5_RXD_MARK,
276 BBIF2_TXD1_MARK,
277 LCDD4_MARK, PORT196_KEYOUT4_MARK, PORT196_SCIFA5_TXD_MARK,
278 LCDD5_MARK, PORT197_KEYOUT5_MARK, PORT197_SCIFA5_SCK_MARK,
279 MFG2_OUT2_MARK,
280 TPU2TO1_MARK,
281 LCDD6_MARK, XWR2_MARK,
282 LCDD7_MARK, TPU4TO1_MARK, MFG4_OUT2_MARK, XWR3_MARK,
283 LCDD8_MARK, PORT200_KEYIN0_MARK, VIO_DR0_MARK, D16_MARK, ED16_MARK,
284 LCDD9_MARK, PORT201_KEYIN1_MARK, VIO_DR1_MARK, D17_MARK, ED17_MARK,
285 LCDD10_MARK, PORT202_KEYIN2_MARK, VIO_DR2_MARK, D18_MARK, ED18_MARK,
286 LCDD11_MARK, PORT203_KEYIN3_MARK, VIO_DR3_MARK, D19_MARK, ED19_MARK,
287 LCDD12_MARK, PORT204_KEYIN4_MARK, VIO_DR4_MARK, D20_MARK, ED20_MARK,
288 LCDD13_MARK, PORT205_KEYIN5_MARK, VIO_DR5_MARK, D21_MARK, ED21_MARK,
289 LCDD14_MARK, PORT206_KEYIN6_MARK, VIO_DR6_MARK, D22_MARK, ED22_MARK,
290 LCDD15_MARK, PORT207_MSIOF0L_SS1_MARK, PORT207_KEYOUT0_MARK,
291 VIO_DR7_MARK, D23_MARK, ED23_MARK,
292 LCDD16_MARK, PORT208_MSIOF0L_SS2_MARK, PORT208_KEYOUT1_MARK,
293 VIO_VDR_MARK, D24_MARK, ED24_MARK,
294 LCDD17_MARK, PORT209_KEYOUT2_MARK, VIO_HDR_MARK, D25_MARK, ED25_MARK,
295 LCDD18_MARK, DREQ2_MARK, PORT210_MSIOF0L_SS1_MARK, D26_MARK, ED26_MARK,
296 LCDD19_MARK, PORT211_MSIOF0L_SS2_MARK, D27_MARK, ED27_MARK,
297 LCDD20_MARK, TS_SPSYNC1_MARK, MSIOF0L_MCK0_MARK, D28_MARK, ED28_MARK,
298 LCDD21_MARK, TS_SDAT1_MARK, MSIOF0L_MCK1_MARK, D29_MARK, ED29_MARK,
299 LCDD22_MARK, TS_SDEN1_MARK, MSIOF0L_RSCK_MARK, D30_MARK, ED30_MARK,
300 LCDD23_MARK, TS_SCK1_MARK, MSIOF0L_RSYNC_MARK, D31_MARK, ED31_MARK,
301 LCDDCK_MARK, LCDWR_MARK, PORT216_KEYOUT3_MARK, VIO_CLKR_MARK,
302 LCDRD_MARK, DACK2_MARK, MSIOF0L_TSYNC_MARK,
303 LCDHSYN_MARK, LCDCS_MARK, LCDCS2_MARK, DACK3_MARK,
304 PORT218_VIO_CKOR_MARK, PORT218_KEYOUT4_MARK,
305 LCDDISP_MARK, LCDRS_MARK, DREQ3_MARK, MSIOF0L_TSCK_MARK,
306 LCDVSYN_MARK, LCDVSYN2_MARK, PORT220_KEYOUT5_MARK,
307 LCDLCLK_MARK, DREQ1_MARK, PWEN_MARK, MSIOF0L_RXD_MARK,
308 LCDDON_MARK, LCDDON2_MARK, DACK1_MARK, OVCN_MARK, MSIOF0L_TXD_MARK,
309 SCIFA1_TXD_MARK, OVCN2_MARK,
310 EXTLP_MARK, SCIFA1_SCK_MARK, USBTERM_MARK, PORT226_VIO_CKO2_MARK,
311 SCIFA1_RTS_MARK, IDIN_MARK,
312 SCIFA1_RXD_MARK,
313 SCIFA1_CTS_MARK, MFG1_IN1_MARK,
314 MSIOF1_TXD_MARK, SCIFA2_TXD2_MARK, PORT230_FSIAOMC_MARK,
315 MSIOF1_TSYNC_MARK, SCIFA2_CTS2_MARK, PORT231_FSIAOLR_MARK,
316 MSIOF1_TSCK_MARK, SCIFA2_SCK2_MARK, PORT232_FSIAOBT_MARK,
317 MSIOF1_RXD_MARK, SCIFA2_RXD2_MARK, GPS_VCOTRIG_MARK,
318 PORT233_FSIACK_MARK,
319 MSIOF1_RSCK_MARK, SCIFA2_RTS2_MARK, PORT234_FSIAOSLD_MARK,
320 MSIOF1_RSYNC_MARK, OPORT0_MARK, MFG1_IN2_MARK, PORT235_FSIAILR_MARK,
321 MSIOF1_MCK0_MARK, I2C_SDA2_MARK, PORT236_FSIAIBT_MARK,
322 MSIOF1_MCK1_MARK, I2C_SCL2_MARK, PORT237_FSIAISLD_MARK,
323 MSIOF1_SS1_MARK, EDBGREQ3_MARK,
324
325 /* 55-5 */
326 MSIOF1_SS2_MARK,
327 SCIFA6_TXD_MARK,
328 PORT241_IRDA_OUT_MARK, PORT241_IROUT_MARK, MFG4_OUT1_MARK,
329 TPU4TO0_MARK,
330 PORT242_IRDA_IN_MARK, MFG4_IN2_MARK,
331 PORT243_IRDA_FIRSEL_MARK, PORT243_VIO_CKO2_MARK,
332 PORT244_SCIFA5_CTS_MARK, MFG2_IN1_MARK, PORT244_SCIFB_CTS_MARK,
333 PORT244_MSIOF2_RXD_MARK,
334 PORT245_SCIFA5_RTS_MARK, MFG2_IN2_MARK, PORT245_SCIFB_RTS_MARK,
335 PORT245_MSIOF2_TXD_MARK,
336 PORT246_SCIFA5_RXD_MARK, MFG1_OUT1_MARK, PORT246_SCIFB_RXD_MARK,
337 TPU1TO0_MARK,
338 PORT247_SCIFA5_TXD_MARK, MFG3_OUT2_MARK, PORT247_SCIFB_TXD_MARK,
339 TPU3TO1_MARK,
340 PORT248_SCIFA5_SCK_MARK, MFG2_OUT1_MARK, PORT248_SCIFB_SCK_MARK,
341 TPU2TO0_MARK,
342 PORT248_MSIOF2_TSCK_MARK,
343 PORT249_IROUT_MARK, MFG4_IN1_MARK, PORT249_MSIOF2_TSYNC_MARK,
344 SDHICLK0_MARK, TCK2_SWCLK_MC0_MARK,
345 SDHICD0_MARK,
346 SDHID0_0_MARK, TMS2_SWDIO_MC0_MARK,
347 SDHID0_1_MARK, TDO2_SWO0_MC0_MARK,
348 SDHID0_2_MARK, TDI2_MARK,
349 SDHID0_3_MARK, RTCK2_SWO1_MC0_MARK,
350 SDHICMD0_MARK, TRST2_MARK,
351 SDHIWP0_MARK, EDBGREQ2_MARK,
352 SDHICLK1_MARK, TCK3_SWCLK_MC1_MARK,
353 SDHID1_0_MARK, M11_SLCD_SO2_MARK, TS_SPSYNC2_MARK,
354 TMS3_SWDIO_MC1_MARK,
355 SDHID1_1_MARK, M9_SLCD_A02_MARK, TS_SDAT2_MARK, TDO3_SWO0_MC1_MARK,
356 SDHID1_2_MARK, M10_SLCD_CK2_MARK, TS_SDEN2_MARK, TDI3_MARK,
357 SDHID1_3_MARK, M12_SLCD_CE2_MARK, TS_SCK2_MARK, RTCK3_SWO1_MC1_MARK,
358 SDHICMD1_MARK, TRST3_MARK,
359 RESETOUTS_MARK,
360 PINMUX_MARK_END,
361};
362
363#define PORT_DATA_I(nr) \
364 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
365
366#define PORT_DATA_I_PD(nr) \
367 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
368 PORT##nr##_IN, PORT##nr##_IN_PD)
369
370#define PORT_DATA_I_PU(nr) \
371 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
372 PORT##nr##_IN, PORT##nr##_IN_PU)
373
374#define PORT_DATA_I_PU_PD(nr) \
375 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
376 PORT##nr##_IN, PORT##nr##_IN_PD, \
377 PORT##nr##_IN_PU)
378
379#define PORT_DATA_O(nr) \
380 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
381 PORT##nr##_OUT)
382
383#define PORT_DATA_IO(nr) \
384 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
385 PORT##nr##_OUT, PORT##nr##_IN)
386
387#define PORT_DATA_IO_PD(nr) \
388 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
389 PORT##nr##_OUT, PORT##nr##_IN, \
390 PORT##nr##_IN_PD)
391
392#define PORT_DATA_IO_PU(nr) \
393 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
394 PORT##nr##_OUT, PORT##nr##_IN, \
395 PORT##nr##_IN_PU)
396
397#define PORT_DATA_IO_PU_PD(nr) \
398 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
399 PORT##nr##_OUT, PORT##nr##_IN, \
400 PORT##nr##_IN_PD, PORT##nr##_IN_PU)
401
402static pinmux_enum_t pinmux_data[] = {
403 /* specify valid pin states for each pin in GPIO mode */
404 /* 55-1 (GPIO) */
405 PORT_DATA_I_PD(0), PORT_DATA_I_PU(1),
406 PORT_DATA_I_PU(2), PORT_DATA_I_PU(3),
407 PORT_DATA_I_PU(4), PORT_DATA_I_PU(5),
408 PORT_DATA_I_PU(6), PORT_DATA_I_PU(7),
409 PORT_DATA_I_PU(8), PORT_DATA_I_PU(9),
410 PORT_DATA_I_PU(10), PORT_DATA_I_PU(11),
411 PORT_DATA_IO_PU(12), PORT_DATA_IO_PU(13),
412 PORT_DATA_IO_PU_PD(14), PORT_DATA_IO_PU_PD(15),
413 PORT_DATA_O(16), PORT_DATA_IO(17),
414 PORT_DATA_O(18), PORT_DATA_O(19),
415 PORT_DATA_O(20), PORT_DATA_O(21),
416 PORT_DATA_O(22), PORT_DATA_O(23),
417 PORT_DATA_O(24), PORT_DATA_I_PD(25),
418 PORT_DATA_I_PD(26), PORT_DATA_O(27),
419 PORT_DATA_O(28), PORT_DATA_O(29),
420 PORT_DATA_IO(30), PORT_DATA_IO_PU(31),
421 PORT_DATA_IO_PD(32), PORT_DATA_I_PU(33),
422 PORT_DATA_IO_PD(34), PORT_DATA_I_PU_PD(35),
423 PORT_DATA_O(36), PORT_DATA_IO(37),
424
425 /* 55-2 (GPIO) */
426 PORT_DATA_O(38), PORT_DATA_I_PU(39),
427 PORT_DATA_I_PU_PD(40), PORT_DATA_O(41),
428 PORT_DATA_IO_PD(42), PORT_DATA_IO_PD(43),
429 PORT_DATA_IO_PD(44), PORT_DATA_I_PD(45),
430 PORT_DATA_I_PD(46), PORT_DATA_I_PD(47),
431 PORT_DATA_I_PD(48), PORT_DATA_IO_PU_PD(49),
432 PORT_DATA_IO_PD(50), PORT_DATA_IO_PD(51),
433 PORT_DATA_O(52), PORT_DATA_IO_PU_PD(53),
434 PORT_DATA_IO_PU_PD(54), PORT_DATA_IO_PD(55),
435 PORT_DATA_I_PU_PD(56), PORT_DATA_IO(57),
436 PORT_DATA_IO(58), PORT_DATA_IO(59),
437 PORT_DATA_IO(60), PORT_DATA_IO(61),
438 PORT_DATA_IO_PD(62), PORT_DATA_IO_PD(63),
439 PORT_DATA_IO_PD(64), PORT_DATA_IO_PD(65),
440 PORT_DATA_IO_PU_PD(66), PORT_DATA_IO_PU_PD(67),
441 PORT_DATA_IO_PU_PD(68), PORT_DATA_IO_PU_PD(69),
442 PORT_DATA_IO_PU_PD(70), PORT_DATA_IO_PU_PD(71),
443 PORT_DATA_IO_PU_PD(72), PORT_DATA_I_PU_PD(73),
444 PORT_DATA_IO_PU(74), PORT_DATA_IO_PU(75),
445 PORT_DATA_IO_PU(76), PORT_DATA_IO_PU(77),
446 PORT_DATA_IO_PU(78), PORT_DATA_IO_PU(79),
447 PORT_DATA_IO_PU(80), PORT_DATA_IO_PU(81),
448 PORT_DATA_IO_PU(82), PORT_DATA_IO_PU(83),
449 PORT_DATA_IO_PU(84), PORT_DATA_IO_PU(85),
450 PORT_DATA_IO_PU(86), PORT_DATA_IO_PU(87),
451 PORT_DATA_IO_PU(88), PORT_DATA_IO_PU(89),
452 PORT_DATA_O(90), PORT_DATA_IO_PU(91),
453 PORT_DATA_O(92),
454
455 /* 55-3 (GPIO) */
456 PORT_DATA_IO_PU(93),
457 PORT_DATA_O(94),
458 PORT_DATA_I_PU_PD(95),
459 PORT_DATA_IO(96), PORT_DATA_IO(97),
460 PORT_DATA_IO(98), PORT_DATA_I_PU(99),
461 PORT_DATA_O(100), PORT_DATA_O(101),
462 PORT_DATA_I_PU(102), PORT_DATA_IO_PD(103),
463 PORT_DATA_I_PD(104), PORT_DATA_I_PD(105),
464 PORT_DATA_I_PD(106), PORT_DATA_I_PD(107),
465 PORT_DATA_I_PD(108), PORT_DATA_IO_PD(109),
466 PORT_DATA_IO_PD(110), PORT_DATA_I_PD(111),
467 PORT_DATA_IO_PD(112), PORT_DATA_IO_PD(113),
468 PORT_DATA_IO_PD(114), PORT_DATA_I_PD(115),
469 PORT_DATA_I_PD(116), PORT_DATA_IO_PD(117),
470 PORT_DATA_I_PD(118), PORT_DATA_IO_PD(128),
471 PORT_DATA_IO_PD(129), PORT_DATA_IO_PD(130),
472 PORT_DATA_IO_PD(131), PORT_DATA_IO_PD(132),
473 PORT_DATA_IO_PD(133), PORT_DATA_IO_PU_PD(134),
474 PORT_DATA_IO_PU_PD(135), PORT_DATA_IO_PU_PD(136),
475 PORT_DATA_IO_PU_PD(137), PORT_DATA_IO_PD(138),
476 PORT_DATA_IO_PD(139), PORT_DATA_IO_PD(140),
477 PORT_DATA_IO_PD(141), PORT_DATA_IO_PD(142),
478 PORT_DATA_IO_PD(143), PORT_DATA_IO_PU_PD(144),
479 PORT_DATA_IO_PD(145), PORT_DATA_IO_PU_PD(146),
480 PORT_DATA_IO_PU_PD(147), PORT_DATA_IO_PU_PD(148),
481 PORT_DATA_IO_PU_PD(149), PORT_DATA_I_PD(150),
482 PORT_DATA_IO_PU_PD(151), PORT_DATA_IO_PD(152),
483 PORT_DATA_IO_PD(153), PORT_DATA_IO_PD(154),
484 PORT_DATA_I_PD(155), PORT_DATA_IO_PU_PD(156),
485 PORT_DATA_I_PD(157), PORT_DATA_IO_PD(158),
486
487 /* 55-4 (GPIO) */
488 PORT_DATA_IO_PU_PD(159), PORT_DATA_IO_PU_PD(160),
489 PORT_DATA_I_PU_PD(161), PORT_DATA_I_PU_PD(162),
490 PORT_DATA_IO_PU_PD(163), PORT_DATA_I_PU_PD(164),
491 PORT_DATA_IO_PD(192), PORT_DATA_IO_PD(193),
492 PORT_DATA_IO_PD(194), PORT_DATA_IO_PD(195),
493 PORT_DATA_IO_PD(196), PORT_DATA_IO_PD(197),
494 PORT_DATA_IO_PD(198), PORT_DATA_IO_PD(199),
495 PORT_DATA_IO_PU_PD(200), PORT_DATA_IO_PU_PD(201),
496 PORT_DATA_IO_PU_PD(202), PORT_DATA_IO_PU_PD(203),
497 PORT_DATA_IO_PU_PD(204), PORT_DATA_IO_PU_PD(205),
498 PORT_DATA_IO_PU_PD(206), PORT_DATA_IO_PD(207),
499 PORT_DATA_IO_PD(208), PORT_DATA_IO_PD(209),
500 PORT_DATA_IO_PD(210), PORT_DATA_IO_PD(211),
501 PORT_DATA_IO_PD(212), PORT_DATA_IO_PD(213),
502 PORT_DATA_IO_PD(214), PORT_DATA_IO_PD(215),
503 PORT_DATA_IO_PD(216), PORT_DATA_IO_PD(217),
504 PORT_DATA_O(218), PORT_DATA_IO_PD(219),
505 PORT_DATA_IO_PD(220), PORT_DATA_IO_PD(221),
506 PORT_DATA_IO_PU_PD(222),
507 PORT_DATA_I_PU_PD(223), PORT_DATA_I_PU_PD(224),
508 PORT_DATA_IO_PU_PD(225), PORT_DATA_O(226),
509 PORT_DATA_IO_PU_PD(227), PORT_DATA_I_PD(228),
510 PORT_DATA_I_PD(229), PORT_DATA_IO(230),
511 PORT_DATA_IO_PD(231), PORT_DATA_IO_PU_PD(232),
512 PORT_DATA_I_PD(233), PORT_DATA_IO_PU_PD(234),
513 PORT_DATA_IO_PU_PD(235), PORT_DATA_IO_PU_PD(236),
514 PORT_DATA_IO_PD(237), PORT_DATA_IO_PU_PD(238),
515
516 /* 55-5 (GPIO) */
517 PORT_DATA_IO_PU_PD(239), PORT_DATA_IO_PU_PD(240),
518 PORT_DATA_O(241), PORT_DATA_I_PD(242),
519 PORT_DATA_IO_PU_PD(243), PORT_DATA_IO_PU_PD(244),
520 PORT_DATA_IO_PU_PD(245), PORT_DATA_IO_PU_PD(246),
521 PORT_DATA_IO_PU_PD(247), PORT_DATA_IO_PU_PD(248),
522 PORT_DATA_IO_PU_PD(249), PORT_DATA_IO_PD(250),
523 PORT_DATA_IO_PU_PD(251), PORT_DATA_IO_PU_PD(252),
524 PORT_DATA_IO_PU_PD(253), PORT_DATA_IO_PU_PD(254),
525 PORT_DATA_IO_PU_PD(255), PORT_DATA_IO_PU_PD(256),
526 PORT_DATA_IO_PU_PD(257), PORT_DATA_IO_PD(258),
527 PORT_DATA_IO_PU_PD(259), PORT_DATA_IO_PU_PD(260),
528 PORT_DATA_IO_PU_PD(261), PORT_DATA_IO_PU_PD(262),
529 PORT_DATA_IO_PU_PD(263),
530
531 /* Special Pull-up / Pull-down Functions */
532 PINMUX_DATA(PORT66_KEYIN0_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
533 PORT66_FN2, PORT66_IN_PU),
534 PINMUX_DATA(PORT67_KEYIN1_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
535 PORT67_FN2, PORT67_IN_PU),
536 PINMUX_DATA(PORT68_KEYIN2_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
537 PORT68_FN2, PORT68_IN_PU),
538 PINMUX_DATA(PORT69_KEYIN3_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
539 PORT69_FN2, PORT69_IN_PU),
540 PINMUX_DATA(PORT70_KEYIN4_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
541 PORT70_FN2, PORT70_IN_PU),
542 PINMUX_DATA(PORT71_KEYIN5_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
543 PORT71_FN2, PORT71_IN_PU),
544 PINMUX_DATA(PORT72_KEYIN6_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
545 PORT72_FN2, PORT72_IN_PU),
546
547
548 /* 55-1 (FN) */
549 PINMUX_DATA(VBUS_0_MARK, PORT0_FN1),
550 PINMUX_DATA(CPORT0_MARK, PORT1_FN1),
551 PINMUX_DATA(CPORT1_MARK, PORT2_FN1),
552 PINMUX_DATA(CPORT2_MARK, PORT3_FN1),
553 PINMUX_DATA(CPORT3_MARK, PORT4_FN1),
554 PINMUX_DATA(CPORT4_MARK, PORT5_FN1),
555 PINMUX_DATA(CPORT5_MARK, PORT6_FN1),
556 PINMUX_DATA(CPORT6_MARK, PORT7_FN1),
557 PINMUX_DATA(CPORT7_MARK, PORT8_FN1),
558 PINMUX_DATA(CPORT8_MARK, PORT9_FN1),
559 PINMUX_DATA(CPORT9_MARK, PORT10_FN1),
560 PINMUX_DATA(CPORT10_MARK, PORT11_FN1),
561 PINMUX_DATA(CPORT11_MARK, PORT12_FN1),
562 PINMUX_DATA(SIN2_MARK, PORT12_FN2),
563 PINMUX_DATA(CPORT12_MARK, PORT13_FN1),
564 PINMUX_DATA(XCTS2_MARK, PORT13_FN2),
565 PINMUX_DATA(CPORT13_MARK, PORT14_FN1),
566 PINMUX_DATA(RFSPO4_MARK, PORT14_FN2),
567 PINMUX_DATA(CPORT14_MARK, PORT15_FN1),
568 PINMUX_DATA(RFSPO5_MARK, PORT15_FN2),
569 PINMUX_DATA(CPORT15_MARK, PORT16_FN1),
570 PINMUX_DATA(SCIFA0_SCK_MARK, PORT16_FN2),
571 PINMUX_DATA(GPS_AGC2_MARK, PORT16_FN3),
572 PINMUX_DATA(CPORT16_MARK, PORT17_FN1),
573 PINMUX_DATA(SCIFA0_TXD_MARK, PORT17_FN2),
574 PINMUX_DATA(GPS_AGC3_MARK, PORT17_FN3),
575 PINMUX_DATA(CPORT17_IC_OE_MARK, PORT18_FN1),
576 PINMUX_DATA(SOUT2_MARK, PORT18_FN2),
577 PINMUX_DATA(CPORT18_MARK, PORT19_FN1),
578 PINMUX_DATA(XRTS2_MARK, PORT19_FN2),
579 PINMUX_DATA(PORT19_VIO_CKO2_MARK, PORT19_FN3),
580 PINMUX_DATA(CPORT19_MPORT1_MARK, PORT20_FN1),
581 PINMUX_DATA(CPORT20_MARK, PORT21_FN1),
582 PINMUX_DATA(RFSPO6_MARK, PORT21_FN2),
583 PINMUX_DATA(CPORT21_MARK, PORT22_FN1),
584 PINMUX_DATA(STATUS0_MARK, PORT22_FN2),
585 PINMUX_DATA(CPORT22_MARK, PORT23_FN1),
586 PINMUX_DATA(STATUS1_MARK, PORT23_FN2),
587 PINMUX_DATA(CPORT23_MARK, PORT24_FN1),
588 PINMUX_DATA(STATUS2_MARK, PORT24_FN2),
589 PINMUX_DATA(RFSPO7_MARK, PORT24_FN3),
590 PINMUX_DATA(B_SYNLD1_MARK, PORT25_FN1),
591 PINMUX_DATA(B_SYNLD2_MARK, PORT26_FN1),
592 PINMUX_DATA(SYSENMSK_MARK, PORT26_FN2),
593 PINMUX_DATA(XMAINPS_MARK, PORT27_FN1),
594 PINMUX_DATA(XDIVPS_MARK, PORT28_FN1),
595 PINMUX_DATA(XIDRST_MARK, PORT29_FN1),
596 PINMUX_DATA(IDCLK_MARK, PORT30_FN1),
597 PINMUX_DATA(IC_DP_MARK, PORT30_FN2),
598 PINMUX_DATA(IDIO_MARK, PORT31_FN1),
599 PINMUX_DATA(IC_DM_MARK, PORT31_FN2),
600 PINMUX_DATA(SOUT1_MARK, PORT32_FN1),
601 PINMUX_DATA(SCIFA4_TXD_MARK, PORT32_FN2),
602 PINMUX_DATA(M02_BERDAT_MARK, PORT32_FN3),
603 PINMUX_DATA(SIN1_MARK, PORT33_FN1),
604 PINMUX_DATA(SCIFA4_RXD_MARK, PORT33_FN2),
605 PINMUX_DATA(XWUP_MARK, PORT33_FN3),
606 PINMUX_DATA(XRTS1_MARK, PORT34_FN1),
607 PINMUX_DATA(SCIFA4_RTS_MARK, PORT34_FN2),
608 PINMUX_DATA(M03_BERCLK_MARK, PORT34_FN3),
609 PINMUX_DATA(XCTS1_MARK, PORT35_FN1),
610 PINMUX_DATA(SCIFA4_CTS_MARK, PORT35_FN2),
611 PINMUX_DATA(PCMCLKO_MARK, PORT36_FN1),
612 PINMUX_DATA(SYNC8KO_MARK, PORT37_FN1),
613
614 /* 55-2 (FN) */
615 PINMUX_DATA(DNPCM_A_MARK, PORT38_FN1),
616 PINMUX_DATA(UPPCM_A_MARK, PORT39_FN1),
617 PINMUX_DATA(VACK_MARK, PORT40_FN1),
618 PINMUX_DATA(XTALB1L_MARK, PORT41_FN1),
619 PINMUX_DATA(GPS_AGC1_MARK, PORT42_FN1),
620 PINMUX_DATA(SCIFA0_RTS_MARK, PORT42_FN2),
621 PINMUX_DATA(GPS_AGC4_MARK, PORT43_FN1),
622 PINMUX_DATA(SCIFA0_RXD_MARK, PORT43_FN2),
623 PINMUX_DATA(GPS_PWRDOWN_MARK, PORT44_FN1),
624 PINMUX_DATA(SCIFA0_CTS_MARK, PORT44_FN2),
625 PINMUX_DATA(GPS_IM_MARK, PORT45_FN1),
626 PINMUX_DATA(GPS_IS_MARK, PORT46_FN1),
627 PINMUX_DATA(GPS_QM_MARK, PORT47_FN1),
628 PINMUX_DATA(GPS_QS_MARK, PORT48_FN1),
629 PINMUX_DATA(FMSOCK_MARK, PORT49_FN1),
630 PINMUX_DATA(PORT49_IRDA_OUT_MARK, PORT49_FN2),
631 PINMUX_DATA(PORT49_IROUT_MARK, PORT49_FN3),
632 PINMUX_DATA(FMSOOLR_MARK, PORT50_FN1),
633 PINMUX_DATA(BBIF2_TSYNC2_MARK, PORT50_FN2),
634 PINMUX_DATA(TPU2TO2_MARK, PORT50_FN3),
635 PINMUX_DATA(IPORT3_MARK, PORT50_FN4),
636 PINMUX_DATA(FMSIOLR_MARK, PORT50_FN5),
637 PINMUX_DATA(FMSOOBT_MARK, PORT51_FN1),
638 PINMUX_DATA(BBIF2_TSCK2_MARK, PORT51_FN2),
639 PINMUX_DATA(TPU2TO3_MARK, PORT51_FN3),
640 PINMUX_DATA(OPORT1_MARK, PORT51_FN4),
641 PINMUX_DATA(FMSIOBT_MARK, PORT51_FN5),
642 PINMUX_DATA(FMSOSLD_MARK, PORT52_FN1),
643 PINMUX_DATA(BBIF2_TXD2_MARK, PORT52_FN2),
644 PINMUX_DATA(OPORT2_MARK, PORT52_FN3),
645 PINMUX_DATA(FMSOILR_MARK, PORT53_FN1),
646 PINMUX_DATA(PORT53_IRDA_IN_MARK, PORT53_FN2),
647 PINMUX_DATA(TPU3TO3_MARK, PORT53_FN3),
648 PINMUX_DATA(OPORT3_MARK, PORT53_FN4),
649 PINMUX_DATA(FMSIILR_MARK, PORT53_FN5),
650 PINMUX_DATA(FMSOIBT_MARK, PORT54_FN1),
651 PINMUX_DATA(PORT54_IRDA_FIRSEL_MARK, PORT54_FN2),
652 PINMUX_DATA(TPU3TO2_MARK, PORT54_FN3),
653 PINMUX_DATA(FMSIIBT_MARK, PORT54_FN4),
654 PINMUX_DATA(FMSISLD_MARK, PORT55_FN1),
655 PINMUX_DATA(MFG0_OUT1_MARK, PORT55_FN2),
656 PINMUX_DATA(TPU0TO0_MARK, PORT55_FN3),
657 PINMUX_DATA(A0_EA0_MARK, PORT57_FN1),
658 PINMUX_DATA(BS_MARK, PORT57_FN2),
659 PINMUX_DATA(A12_EA12_MARK, PORT58_FN1),
660 PINMUX_DATA(PORT58_VIO_CKOR_MARK, PORT58_FN2),
661 PINMUX_DATA(TPU4TO2_MARK, PORT58_FN3),
662 PINMUX_DATA(A13_EA13_MARK, PORT59_FN1),
663 PINMUX_DATA(PORT59_IROUT_MARK, PORT59_FN2),
664 PINMUX_DATA(MFG0_OUT2_MARK, PORT59_FN3),
665 PINMUX_DATA(TPU0TO1_MARK, PORT59_FN4),
666 PINMUX_DATA(A14_EA14_MARK, PORT60_FN1),
667 PINMUX_DATA(PORT60_KEYOUT5_MARK, PORT60_FN2),
668 PINMUX_DATA(A15_EA15_MARK, PORT61_FN1),
669 PINMUX_DATA(PORT61_KEYOUT4_MARK, PORT61_FN2),
670 PINMUX_DATA(A16_EA16_MARK, PORT62_FN1),
671 PINMUX_DATA(PORT62_KEYOUT3_MARK, PORT62_FN2),
672 PINMUX_DATA(MSIOF0_SS1_MARK, PORT62_FN3),
673 PINMUX_DATA(A17_EA17_MARK, PORT63_FN1),
674 PINMUX_DATA(PORT63_KEYOUT2_MARK, PORT63_FN2),
675 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT63_FN3),
676 PINMUX_DATA(A18_EA18_MARK, PORT64_FN1),
677 PINMUX_DATA(PORT64_KEYOUT1_MARK, PORT64_FN2),
678 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT64_FN3),
679 PINMUX_DATA(A19_EA19_MARK, PORT65_FN1),
680 PINMUX_DATA(PORT65_KEYOUT0_MARK, PORT65_FN2),
681 PINMUX_DATA(MSIOF0_TXD_MARK, PORT65_FN3),
682 PINMUX_DATA(A20_EA20_MARK, PORT66_FN1),
683 PINMUX_DATA(PORT66_KEYIN0_MARK, PORT66_FN2),
684 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT66_FN3),
685 PINMUX_DATA(A21_EA21_MARK, PORT67_FN1),
686 PINMUX_DATA(PORT67_KEYIN1_MARK, PORT67_FN2),
687 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT67_FN3),
688 PINMUX_DATA(A22_EA22_MARK, PORT68_FN1),
689 PINMUX_DATA(PORT68_KEYIN2_MARK, PORT68_FN2),
690 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT68_FN3),
691 PINMUX_DATA(A23_EA23_MARK, PORT69_FN1),
692 PINMUX_DATA(PORT69_KEYIN3_MARK, PORT69_FN2),
693 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT69_FN3),
694 PINMUX_DATA(A24_EA24_MARK, PORT70_FN1),
695 PINMUX_DATA(PORT70_KEYIN4_MARK, PORT70_FN2),
696 PINMUX_DATA(MSIOF0_RXD_MARK, PORT70_FN3),
697 PINMUX_DATA(A25_EA25_MARK, PORT71_FN1),
698 PINMUX_DATA(PORT71_KEYIN5_MARK, PORT71_FN2),
699 PINMUX_DATA(MSIOF0_SS2_MARK, PORT71_FN3),
700 PINMUX_DATA(A26_MARK, PORT72_FN1),
701 PINMUX_DATA(PORT72_KEYIN6_MARK, PORT72_FN2),
702 PINMUX_DATA(D0_ED0_NAF0_MARK, PORT74_FN1),
703 PINMUX_DATA(D1_ED1_NAF1_MARK, PORT75_FN1),
704 PINMUX_DATA(D2_ED2_NAF2_MARK, PORT76_FN1),
705 PINMUX_DATA(D3_ED3_NAF3_MARK, PORT77_FN1),
706 PINMUX_DATA(D4_ED4_NAF4_MARK, PORT78_FN1),
707 PINMUX_DATA(D5_ED5_NAF5_MARK, PORT79_FN1),
708 PINMUX_DATA(D6_ED6_NAF6_MARK, PORT80_FN1),
709 PINMUX_DATA(D7_ED7_NAF7_MARK, PORT81_FN1),
710 PINMUX_DATA(D8_ED8_NAF8_MARK, PORT82_FN1),
711 PINMUX_DATA(D9_ED9_NAF9_MARK, PORT83_FN1),
712 PINMUX_DATA(D10_ED10_NAF10_MARK, PORT84_FN1),
713 PINMUX_DATA(D11_ED11_NAF11_MARK, PORT85_FN1),
714 PINMUX_DATA(D12_ED12_NAF12_MARK, PORT86_FN1),
715 PINMUX_DATA(D13_ED13_NAF13_MARK, PORT87_FN1),
716 PINMUX_DATA(D14_ED14_NAF14_MARK, PORT88_FN1),
717 PINMUX_DATA(D15_ED15_NAF15_MARK, PORT89_FN1),
718 PINMUX_DATA(CS4_MARK, PORT90_FN1),
719 PINMUX_DATA(CS5A_MARK, PORT91_FN1),
720 PINMUX_DATA(FMSICK_MARK, PORT91_FN2),
721 PINMUX_DATA(CS5B_MARK, PORT92_FN1),
722 PINMUX_DATA(FCE1_MARK, PORT92_FN2),
723
724 /* 55-3 (FN) */
725 PINMUX_DATA(CS6B_MARK, PORT93_FN1),
726 PINMUX_DATA(XCS2_MARK, PORT93_FN2),
727 PINMUX_DATA(CS6A_MARK, PORT93_FN3),
728 PINMUX_DATA(DACK0_MARK, PORT93_FN4),
729 PINMUX_DATA(FCE0_MARK, PORT94_FN1),
730 PINMUX_DATA(WAIT_MARK, PORT95_FN1),
731 PINMUX_DATA(DREQ0_MARK, PORT95_FN2),
732 PINMUX_DATA(RD_XRD_MARK, PORT96_FN1),
733 PINMUX_DATA(WE0_XWR0_FWE_MARK, PORT97_FN1),
734 PINMUX_DATA(WE1_XWR1_MARK, PORT98_FN1),
735 PINMUX_DATA(FRB_MARK, PORT99_FN1),
736 PINMUX_DATA(CKO_MARK, PORT100_FN1),
737 PINMUX_DATA(NBRSTOUT_MARK, PORT101_FN1),
738 PINMUX_DATA(NBRST_MARK, PORT102_FN1),
739 PINMUX_DATA(GPS_EPPSIN_MARK, PORT106_FN1),
740 PINMUX_DATA(LATCHPULSE_MARK, PORT110_FN1),
741 PINMUX_DATA(LTESIGNAL_MARK, PORT111_FN1),
742 PINMUX_DATA(LEGACYSTATE_MARK, PORT112_FN1),
743 PINMUX_DATA(TCKON_MARK, PORT118_FN1),
744 PINMUX_DATA(VIO_VD_MARK, PORT128_FN1),
745 PINMUX_DATA(PORT128_KEYOUT0_MARK, PORT128_FN2),
746 PINMUX_DATA(IPORT0_MARK, PORT128_FN3),
747 PINMUX_DATA(VIO_HD_MARK, PORT129_FN1),
748 PINMUX_DATA(PORT129_KEYOUT1_MARK, PORT129_FN2),
749 PINMUX_DATA(IPORT1_MARK, PORT129_FN3),
750 PINMUX_DATA(VIO_D0_MARK, PORT130_FN1),
751 PINMUX_DATA(PORT130_KEYOUT2_MARK, PORT130_FN2),
752 PINMUX_DATA(PORT130_MSIOF2_RXD_MARK, PORT130_FN3),
753 PINMUX_DATA(VIO_D1_MARK, PORT131_FN1),
754 PINMUX_DATA(PORT131_KEYOUT3_MARK, PORT131_FN2),
755 PINMUX_DATA(PORT131_MSIOF2_SS1_MARK, PORT131_FN3),
756 PINMUX_DATA(VIO_D2_MARK, PORT132_FN1),
757 PINMUX_DATA(PORT132_KEYOUT4_MARK, PORT132_FN2),
758 PINMUX_DATA(PORT132_MSIOF2_SS2_MARK, PORT132_FN3),
759 PINMUX_DATA(VIO_D3_MARK, PORT133_FN1),
760 PINMUX_DATA(PORT133_KEYOUT5_MARK, PORT133_FN2),
761 PINMUX_DATA(PORT133_MSIOF2_TSYNC_MARK, PORT133_FN3),
762 PINMUX_DATA(VIO_D4_MARK, PORT134_FN1),
763 PINMUX_DATA(PORT134_KEYIN0_MARK, PORT134_FN2),
764 PINMUX_DATA(PORT134_MSIOF2_TXD_MARK, PORT134_FN3),
765 PINMUX_DATA(VIO_D5_MARK, PORT135_FN1),
766 PINMUX_DATA(PORT135_KEYIN1_MARK, PORT135_FN2),
767 PINMUX_DATA(PORT135_MSIOF2_TSCK_MARK, PORT135_FN3),
768 PINMUX_DATA(VIO_D6_MARK, PORT136_FN1),
769 PINMUX_DATA(PORT136_KEYIN2_MARK, PORT136_FN2),
770 PINMUX_DATA(VIO_D7_MARK, PORT137_FN1),
771 PINMUX_DATA(PORT137_KEYIN3_MARK, PORT137_FN2),
772 PINMUX_DATA(VIO_D8_MARK, PORT138_FN1),
773 PINMUX_DATA(M9_SLCD_A01_MARK, PORT138_FN2),
774 PINMUX_DATA(PORT138_FSIAOMC_MARK, PORT138_FN3),
775 PINMUX_DATA(VIO_D9_MARK, PORT139_FN1),
776 PINMUX_DATA(M10_SLCD_CK1_MARK, PORT139_FN2),
777 PINMUX_DATA(PORT139_FSIAOLR_MARK, PORT139_FN3),
778 PINMUX_DATA(VIO_D10_MARK, PORT140_FN1),
779 PINMUX_DATA(M11_SLCD_SO1_MARK, PORT140_FN2),
780 PINMUX_DATA(TPU0TO2_MARK, PORT140_FN3),
781 PINMUX_DATA(PORT140_FSIAOBT_MARK, PORT140_FN4),
782 PINMUX_DATA(VIO_D11_MARK, PORT141_FN1),
783 PINMUX_DATA(M12_SLCD_CE1_MARK, PORT141_FN2),
784 PINMUX_DATA(TPU0TO3_MARK, PORT141_FN3),
785 PINMUX_DATA(PORT141_FSIAOSLD_MARK, PORT141_FN4),
786 PINMUX_DATA(VIO_D12_MARK, PORT142_FN1),
787 PINMUX_DATA(M13_BSW_MARK, PORT142_FN2),
788 PINMUX_DATA(PORT142_FSIACK_MARK, PORT142_FN3),
789 PINMUX_DATA(VIO_D13_MARK, PORT143_FN1),
790 PINMUX_DATA(M14_GSW_MARK, PORT143_FN2),
791 PINMUX_DATA(PORT143_FSIAILR_MARK, PORT143_FN3),
792 PINMUX_DATA(VIO_D14_MARK, PORT144_FN1),
793 PINMUX_DATA(M15_RSW_MARK, PORT144_FN2),
794 PINMUX_DATA(PORT144_FSIAIBT_MARK, PORT144_FN3),
795 PINMUX_DATA(VIO_D15_MARK, PORT145_FN1),
796 PINMUX_DATA(TPU1TO3_MARK, PORT145_FN2),
797 PINMUX_DATA(PORT145_FSIAISLD_MARK, PORT145_FN3),
798 PINMUX_DATA(VIO_CLK_MARK, PORT146_FN1),
799 PINMUX_DATA(PORT146_KEYIN4_MARK, PORT146_FN2),
800 PINMUX_DATA(IPORT2_MARK, PORT146_FN3),
801 PINMUX_DATA(VIO_FIELD_MARK, PORT147_FN1),
802 PINMUX_DATA(PORT147_KEYIN5_MARK, PORT147_FN2),
803 PINMUX_DATA(VIO_CKO_MARK, PORT148_FN1),
804 PINMUX_DATA(PORT148_KEYIN6_MARK, PORT148_FN2),
805 PINMUX_DATA(A27_MARK, PORT149_FN1),
806 PINMUX_DATA(RDWR_XWE_MARK, PORT149_FN2),
807 PINMUX_DATA(MFG0_IN1_MARK, PORT149_FN3),
808 PINMUX_DATA(MFG0_IN2_MARK, PORT150_FN1),
809 PINMUX_DATA(TS_SPSYNC3_MARK, PORT151_FN1),
810 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT151_FN2),
811 PINMUX_DATA(TS_SDAT3_MARK, PORT152_FN1),
812 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT152_FN2),
813 PINMUX_DATA(TPU1TO2_MARK, PORT153_FN1),
814 PINMUX_DATA(TS_SDEN3_MARK, PORT153_FN2),
815 PINMUX_DATA(PORT153_MSIOF2_SS1_MARK, PORT153_FN3),
816 PINMUX_DATA(SOUT3_MARK, PORT154_FN1),
817 PINMUX_DATA(SCIFA2_TXD1_MARK, PORT154_FN2),
818 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT154_FN3),
819 PINMUX_DATA(SIN3_MARK, PORT155_FN1),
820 PINMUX_DATA(SCIFA2_RXD1_MARK, PORT155_FN2),
821 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT155_FN3),
822 PINMUX_DATA(XRTS3_MARK, PORT156_FN1),
823 PINMUX_DATA(SCIFA2_RTS1_MARK, PORT156_FN2),
824 PINMUX_DATA(PORT156_MSIOF2_SS2_MARK, PORT156_FN3),
825 PINMUX_DATA(XCTS3_MARK, PORT157_FN1),
826 PINMUX_DATA(SCIFA2_CTS1_MARK, PORT157_FN2),
827 PINMUX_DATA(PORT157_MSIOF2_RXD_MARK, PORT157_FN3),
828
829 /* 55-4 (FN) */
830 PINMUX_DATA(DINT_MARK, PORT158_FN1),
831 PINMUX_DATA(SCIFA2_SCK1_MARK, PORT158_FN2),
832 PINMUX_DATA(TS_SCK3_MARK, PORT158_FN3),
833 PINMUX_DATA(PORT159_SCIFB_SCK_MARK, PORT159_FN1),
834 PINMUX_DATA(PORT159_SCIFA5_SCK_MARK, PORT159_FN2),
835 PINMUX_DATA(NMI_MARK, PORT159_FN3),
836 PINMUX_DATA(PORT160_SCIFB_TXD_MARK, PORT160_FN1),
837 PINMUX_DATA(PORT160_SCIFA5_TXD_MARK, PORT160_FN2),
838 PINMUX_DATA(SOUT0_MARK, PORT160_FN3),
839 PINMUX_DATA(PORT161_SCIFB_CTS_MARK, PORT161_FN1),
840 PINMUX_DATA(PORT161_SCIFA5_CTS_MARK, PORT161_FN2),
841 PINMUX_DATA(XCTS0_MARK, PORT161_FN3),
842 PINMUX_DATA(MFG3_IN2_MARK, PORT161_FN4),
843 PINMUX_DATA(PORT162_SCIFB_RXD_MARK, PORT162_FN1),
844 PINMUX_DATA(PORT162_SCIFA5_RXD_MARK, PORT162_FN2),
845 PINMUX_DATA(SIN0_MARK, PORT162_FN3),
846 PINMUX_DATA(MFG3_IN1_MARK, PORT162_FN4),
847 PINMUX_DATA(PORT163_SCIFB_RTS_MARK, PORT163_FN1),
848 PINMUX_DATA(PORT163_SCIFA5_RTS_MARK, PORT163_FN2),
849 PINMUX_DATA(XRTS0_MARK, PORT163_FN3),
850 PINMUX_DATA(MFG3_OUT1_MARK, PORT163_FN4),
851 PINMUX_DATA(TPU3TO0_MARK, PORT163_FN5),
852 PINMUX_DATA(LCDD0_MARK, PORT192_FN1),
853 PINMUX_DATA(PORT192_KEYOUT0_MARK, PORT192_FN2),
854 PINMUX_DATA(EXT_CKI_MARK, PORT192_FN3),
855 PINMUX_DATA(LCDD1_MARK, PORT193_FN1),
856 PINMUX_DATA(PORT193_KEYOUT1_MARK, PORT193_FN2),
857 PINMUX_DATA(PORT193_SCIFA5_CTS_MARK, PORT193_FN3),
858 PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT193_FN4),
859 PINMUX_DATA(LCDD2_MARK, PORT194_FN1),
860 PINMUX_DATA(PORT194_KEYOUT2_MARK, PORT194_FN2),
861 PINMUX_DATA(PORT194_SCIFA5_RTS_MARK, PORT194_FN3),
862 PINMUX_DATA(BBIF2_TSCK1_MARK, PORT194_FN4),
863 PINMUX_DATA(LCDD3_MARK, PORT195_FN1),
864 PINMUX_DATA(PORT195_KEYOUT3_MARK, PORT195_FN2),
865 PINMUX_DATA(PORT195_SCIFA5_RXD_MARK, PORT195_FN3),
866 PINMUX_DATA(BBIF2_TXD1_MARK, PORT195_FN4),
867 PINMUX_DATA(LCDD4_MARK, PORT196_FN1),
868 PINMUX_DATA(PORT196_KEYOUT4_MARK, PORT196_FN2),
869 PINMUX_DATA(PORT196_SCIFA5_TXD_MARK, PORT196_FN3),
870 PINMUX_DATA(LCDD5_MARK, PORT197_FN1),
871 PINMUX_DATA(PORT197_KEYOUT5_MARK, PORT197_FN2),
872 PINMUX_DATA(PORT197_SCIFA5_SCK_MARK, PORT197_FN3),
873 PINMUX_DATA(MFG2_OUT2_MARK, PORT197_FN4),
874 PINMUX_DATA(LCDD6_MARK, PORT198_FN1),
875 PINMUX_DATA(LCDD7_MARK, PORT199_FN1),
876 PINMUX_DATA(TPU4TO1_MARK, PORT199_FN2),
877 PINMUX_DATA(MFG4_OUT2_MARK, PORT199_FN3),
878 PINMUX_DATA(LCDD8_MARK, PORT200_FN1),
879 PINMUX_DATA(PORT200_KEYIN0_MARK, PORT200_FN2),
880 PINMUX_DATA(VIO_DR0_MARK, PORT200_FN3),
881 PINMUX_DATA(D16_MARK, PORT200_FN4),
882 PINMUX_DATA(LCDD9_MARK, PORT201_FN1),
883 PINMUX_DATA(PORT201_KEYIN1_MARK, PORT201_FN2),
884 PINMUX_DATA(VIO_DR1_MARK, PORT201_FN3),
885 PINMUX_DATA(D17_MARK, PORT201_FN4),
886 PINMUX_DATA(LCDD10_MARK, PORT202_FN1),
887 PINMUX_DATA(PORT202_KEYIN2_MARK, PORT202_FN2),
888 PINMUX_DATA(VIO_DR2_MARK, PORT202_FN3),
889 PINMUX_DATA(D18_MARK, PORT202_FN4),
890 PINMUX_DATA(LCDD11_MARK, PORT203_FN1),
891 PINMUX_DATA(PORT203_KEYIN3_MARK, PORT203_FN2),
892 PINMUX_DATA(VIO_DR3_MARK, PORT203_FN3),
893 PINMUX_DATA(D19_MARK, PORT203_FN4),
894 PINMUX_DATA(LCDD12_MARK, PORT204_FN1),
895 PINMUX_DATA(PORT204_KEYIN4_MARK, PORT204_FN2),
896 PINMUX_DATA(VIO_DR4_MARK, PORT204_FN3),
897 PINMUX_DATA(D20_MARK, PORT204_FN4),
898 PINMUX_DATA(LCDD13_MARK, PORT205_FN1),
899 PINMUX_DATA(PORT205_KEYIN5_MARK, PORT205_FN2),
900 PINMUX_DATA(VIO_DR5_MARK, PORT205_FN3),
901 PINMUX_DATA(D21_MARK, PORT205_FN4),
902 PINMUX_DATA(LCDD14_MARK, PORT206_FN1),
903 PINMUX_DATA(PORT206_KEYIN6_MARK, PORT206_FN2),
904 PINMUX_DATA(VIO_DR6_MARK, PORT206_FN3),
905 PINMUX_DATA(D22_MARK, PORT206_FN4),
906 PINMUX_DATA(LCDD15_MARK, PORT207_FN1),
907 PINMUX_DATA(PORT207_MSIOF0L_SS1_MARK, PORT207_FN2),
908 PINMUX_DATA(PORT207_KEYOUT0_MARK, PORT207_FN3),
909 PINMUX_DATA(VIO_DR7_MARK, PORT207_FN4),
910 PINMUX_DATA(D23_MARK, PORT207_FN5),
911 PINMUX_DATA(LCDD16_MARK, PORT208_FN1),
912 PINMUX_DATA(PORT208_MSIOF0L_SS2_MARK, PORT208_FN2),
913 PINMUX_DATA(PORT208_KEYOUT1_MARK, PORT208_FN3),
914 PINMUX_DATA(VIO_VDR_MARK, PORT208_FN4),
915 PINMUX_DATA(D24_MARK, PORT208_FN5),
916 PINMUX_DATA(LCDD17_MARK, PORT209_FN1),
917 PINMUX_DATA(PORT209_KEYOUT2_MARK, PORT209_FN2),
918 PINMUX_DATA(VIO_HDR_MARK, PORT209_FN3),
919 PINMUX_DATA(D25_MARK, PORT209_FN4),
920 PINMUX_DATA(LCDD18_MARK, PORT210_FN1),
921 PINMUX_DATA(DREQ2_MARK, PORT210_FN2),
922 PINMUX_DATA(PORT210_MSIOF0L_SS1_MARK, PORT210_FN3),
923 PINMUX_DATA(D26_MARK, PORT210_FN4),
924 PINMUX_DATA(LCDD19_MARK, PORT211_FN1),
925 PINMUX_DATA(PORT211_MSIOF0L_SS2_MARK, PORT211_FN2),
926 PINMUX_DATA(D27_MARK, PORT211_FN3),
927 PINMUX_DATA(LCDD20_MARK, PORT212_FN1),
928 PINMUX_DATA(TS_SPSYNC1_MARK, PORT212_FN2),
929 PINMUX_DATA(MSIOF0L_MCK0_MARK, PORT212_FN3),
930 PINMUX_DATA(D28_MARK, PORT212_FN4),
931 PINMUX_DATA(LCDD21_MARK, PORT213_FN1),
932 PINMUX_DATA(TS_SDAT1_MARK, PORT213_FN2),
933 PINMUX_DATA(MSIOF0L_MCK1_MARK, PORT213_FN3),
934 PINMUX_DATA(D29_MARK, PORT213_FN4),
935 PINMUX_DATA(LCDD22_MARK, PORT214_FN1),
936 PINMUX_DATA(TS_SDEN1_MARK, PORT214_FN2),
937 PINMUX_DATA(MSIOF0L_RSCK_MARK, PORT214_FN3),
938 PINMUX_DATA(D30_MARK, PORT214_FN4),
939 PINMUX_DATA(LCDD23_MARK, PORT215_FN1),
940 PINMUX_DATA(TS_SCK1_MARK, PORT215_FN2),
941 PINMUX_DATA(MSIOF0L_RSYNC_MARK, PORT215_FN3),
942 PINMUX_DATA(D31_MARK, PORT215_FN4),
943 PINMUX_DATA(LCDDCK_MARK, PORT216_FN1),
944 PINMUX_DATA(LCDWR_MARK, PORT216_FN2),
945 PINMUX_DATA(PORT216_KEYOUT3_MARK, PORT216_FN3),
946 PINMUX_DATA(VIO_CLKR_MARK, PORT216_FN4),
947 PINMUX_DATA(LCDRD_MARK, PORT217_FN1),
948 PINMUX_DATA(DACK2_MARK, PORT217_FN2),
949 PINMUX_DATA(MSIOF0L_TSYNC_MARK, PORT217_FN3),
950 PINMUX_DATA(LCDHSYN_MARK, PORT218_FN1),
951 PINMUX_DATA(LCDCS_MARK, PORT218_FN2),
952 PINMUX_DATA(LCDCS2_MARK, PORT218_FN3),
953 PINMUX_DATA(DACK3_MARK, PORT218_FN4),
954 PINMUX_DATA(PORT218_VIO_CKOR_MARK, PORT218_FN5),
955 PINMUX_DATA(PORT218_KEYOUT4_MARK, PORT218_FN6),
956 PINMUX_DATA(LCDDISP_MARK, PORT219_FN1),
957 PINMUX_DATA(LCDRS_MARK, PORT219_FN2),
958 PINMUX_DATA(DREQ3_MARK, PORT219_FN3),
959 PINMUX_DATA(MSIOF0L_TSCK_MARK, PORT219_FN4),
960 PINMUX_DATA(LCDVSYN_MARK, PORT220_FN1),
961 PINMUX_DATA(LCDVSYN2_MARK, PORT220_FN2),
962 PINMUX_DATA(PORT220_KEYOUT5_MARK, PORT220_FN3),
963 PINMUX_DATA(LCDLCLK_MARK, PORT221_FN1),
964 PINMUX_DATA(DREQ1_MARK, PORT221_FN2),
965 PINMUX_DATA(PWEN_MARK, PORT221_FN3),
966 PINMUX_DATA(MSIOF0L_RXD_MARK, PORT221_FN4),
967 PINMUX_DATA(LCDDON_MARK, PORT222_FN1),
968 PINMUX_DATA(LCDDON2_MARK, PORT222_FN2),
969 PINMUX_DATA(DACK1_MARK, PORT222_FN3),
970 PINMUX_DATA(OVCN_MARK, PORT222_FN4),
971 PINMUX_DATA(MSIOF0L_TXD_MARK, PORT222_FN5),
972 PINMUX_DATA(SCIFA1_TXD_MARK, PORT225_FN1),
973 PINMUX_DATA(OVCN2_MARK, PORT225_FN2),
974 PINMUX_DATA(EXTLP_MARK, PORT226_FN1),
975 PINMUX_DATA(SCIFA1_SCK_MARK, PORT226_FN2),
976 PINMUX_DATA(USBTERM_MARK, PORT226_FN3),
977 PINMUX_DATA(PORT226_VIO_CKO2_MARK, PORT226_FN4),
978 PINMUX_DATA(SCIFA1_RTS_MARK, PORT227_FN1),
979 PINMUX_DATA(IDIN_MARK, PORT227_FN2),
980 PINMUX_DATA(SCIFA1_RXD_MARK, PORT228_FN1),
981 PINMUX_DATA(SCIFA1_CTS_MARK, PORT229_FN1),
982 PINMUX_DATA(MFG1_IN1_MARK, PORT229_FN2),
983 PINMUX_DATA(MSIOF1_TXD_MARK, PORT230_FN1),
984 PINMUX_DATA(SCIFA2_TXD2_MARK, PORT230_FN2),
985 PINMUX_DATA(PORT230_FSIAOMC_MARK, PORT230_FN3),
986 PINMUX_DATA(MSIOF1_TSYNC_MARK, PORT231_FN1),
987 PINMUX_DATA(SCIFA2_CTS2_MARK, PORT231_FN2),
988 PINMUX_DATA(PORT231_FSIAOLR_MARK, PORT231_FN3),
989 PINMUX_DATA(MSIOF1_TSCK_MARK, PORT232_FN1),
990 PINMUX_DATA(SCIFA2_SCK2_MARK, PORT232_FN2),
991 PINMUX_DATA(PORT232_FSIAOBT_MARK, PORT232_FN3),
992 PINMUX_DATA(MSIOF1_RXD_MARK, PORT233_FN1),
993 PINMUX_DATA(SCIFA2_RXD2_MARK, PORT233_FN2),
994 PINMUX_DATA(GPS_VCOTRIG_MARK, PORT233_FN3),
995 PINMUX_DATA(PORT233_FSIACK_MARK, PORT233_FN4),
996 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT234_FN1),
997 PINMUX_DATA(SCIFA2_RTS2_MARK, PORT234_FN2),
998 PINMUX_DATA(PORT234_FSIAOSLD_MARK, PORT234_FN3),
999 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT235_FN1),
1000 PINMUX_DATA(OPORT0_MARK, PORT235_FN2),
1001 PINMUX_DATA(MFG1_IN2_MARK, PORT235_FN3),
1002 PINMUX_DATA(PORT235_FSIAILR_MARK, PORT235_FN4),
1003 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT236_FN1),
1004 PINMUX_DATA(I2C_SDA2_MARK, PORT236_FN2),
1005 PINMUX_DATA(PORT236_FSIAIBT_MARK, PORT236_FN3),
1006 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT237_FN1),
1007 PINMUX_DATA(I2C_SCL2_MARK, PORT237_FN2),
1008 PINMUX_DATA(PORT237_FSIAISLD_MARK, PORT237_FN3),
1009 PINMUX_DATA(MSIOF1_SS1_MARK, PORT238_FN1),
1010 PINMUX_DATA(EDBGREQ3_MARK, PORT238_FN2),
1011
1012 /* 55-5 (FN) */
1013 PINMUX_DATA(MSIOF1_SS2_MARK, PORT239_FN1),
1014 PINMUX_DATA(SCIFA6_TXD_MARK, PORT240_FN1),
1015 PINMUX_DATA(PORT241_IRDA_OUT_MARK, PORT241_FN1),
1016 PINMUX_DATA(PORT241_IROUT_MARK, PORT241_FN2),
1017 PINMUX_DATA(MFG4_OUT1_MARK, PORT241_FN3),
1018 PINMUX_DATA(TPU4TO0_MARK, PORT241_FN4),
1019 PINMUX_DATA(PORT242_IRDA_IN_MARK, PORT242_FN1),
1020 PINMUX_DATA(MFG4_IN2_MARK, PORT242_FN2),
1021 PINMUX_DATA(PORT243_IRDA_FIRSEL_MARK, PORT243_FN1),
1022 PINMUX_DATA(PORT243_VIO_CKO2_MARK, PORT243_FN2),
1023 PINMUX_DATA(PORT244_SCIFA5_CTS_MARK, PORT244_FN1),
1024 PINMUX_DATA(MFG2_IN1_MARK, PORT244_FN2),
1025 PINMUX_DATA(PORT244_SCIFB_CTS_MARK, PORT244_FN3),
1026 PINMUX_DATA(PORT245_SCIFA5_RTS_MARK, PORT245_FN1),
1027 PINMUX_DATA(MFG2_IN2_MARK, PORT245_FN2),
1028 PINMUX_DATA(PORT245_SCIFB_RTS_MARK, PORT245_FN3),
1029 PINMUX_DATA(PORT246_SCIFA5_RXD_MARK, PORT246_FN1),
1030 PINMUX_DATA(MFG1_OUT1_MARK, PORT246_FN2),
1031 PINMUX_DATA(PORT246_SCIFB_RXD_MARK, PORT246_FN3),
1032 PINMUX_DATA(TPU1TO0_MARK, PORT246_FN4),
1033 PINMUX_DATA(PORT247_SCIFA5_TXD_MARK, PORT247_FN1),
1034 PINMUX_DATA(MFG3_OUT2_MARK, PORT247_FN2),
1035 PINMUX_DATA(PORT247_SCIFB_TXD_MARK, PORT247_FN3),
1036 PINMUX_DATA(TPU3TO1_MARK, PORT247_FN4),
1037 PINMUX_DATA(PORT248_SCIFA5_SCK_MARK, PORT248_FN1),
1038 PINMUX_DATA(MFG2_OUT1_MARK, PORT248_FN2),
1039 PINMUX_DATA(PORT248_SCIFB_SCK_MARK, PORT248_FN3),
1040 PINMUX_DATA(TPU2TO0_MARK, PORT248_FN4),
1041 PINMUX_DATA(PORT249_IROUT_MARK, PORT249_FN1),
1042 PINMUX_DATA(MFG4_IN1_MARK, PORT249_FN2),
1043 PINMUX_DATA(SDHICLK0_MARK, PORT250_FN1),
1044 PINMUX_DATA(TCK2_SWCLK_MC0_MARK, PORT250_FN2),
1045 PINMUX_DATA(SDHICD0_MARK, PORT251_FN1),
1046 PINMUX_DATA(SDHID0_0_MARK, PORT252_FN1),
1047 PINMUX_DATA(TMS2_SWDIO_MC0_MARK, PORT252_FN2),
1048 PINMUX_DATA(SDHID0_1_MARK, PORT253_FN1),
1049 PINMUX_DATA(TDO2_SWO0_MC0_MARK, PORT253_FN2),
1050 PINMUX_DATA(SDHID0_2_MARK, PORT254_FN1),
1051 PINMUX_DATA(TDI2_MARK, PORT254_FN2),
1052 PINMUX_DATA(SDHID0_3_MARK, PORT255_FN1),
1053 PINMUX_DATA(RTCK2_SWO1_MC0_MARK, PORT255_FN2),
1054 PINMUX_DATA(SDHICMD0_MARK, PORT256_FN1),
1055 PINMUX_DATA(TRST2_MARK, PORT256_FN2),
1056 PINMUX_DATA(SDHIWP0_MARK, PORT257_FN1),
1057 PINMUX_DATA(EDBGREQ2_MARK, PORT257_FN2),
1058 PINMUX_DATA(SDHICLK1_MARK, PORT258_FN1),
1059 PINMUX_DATA(TCK3_SWCLK_MC1_MARK, PORT258_FN2),
1060 PINMUX_DATA(SDHID1_0_MARK, PORT259_FN1),
1061 PINMUX_DATA(M11_SLCD_SO2_MARK, PORT259_FN2),
1062 PINMUX_DATA(TS_SPSYNC2_MARK, PORT259_FN3),
1063 PINMUX_DATA(TMS3_SWDIO_MC1_MARK, PORT259_FN4),
1064 PINMUX_DATA(SDHID1_1_MARK, PORT260_FN1),
1065 PINMUX_DATA(M9_SLCD_A02_MARK, PORT260_FN2),
1066 PINMUX_DATA(TS_SDAT2_MARK, PORT260_FN3),
1067 PINMUX_DATA(TDO3_SWO0_MC1_MARK, PORT260_FN4),
1068 PINMUX_DATA(SDHID1_2_MARK, PORT261_FN1),
1069 PINMUX_DATA(M10_SLCD_CK2_MARK, PORT261_FN2),
1070 PINMUX_DATA(TS_SDEN2_MARK, PORT261_FN3),
1071 PINMUX_DATA(TDI3_MARK, PORT261_FN4),
1072 PINMUX_DATA(SDHID1_3_MARK, PORT262_FN1),
1073 PINMUX_DATA(M12_SLCD_CE2_MARK, PORT262_FN2),
1074 PINMUX_DATA(TS_SCK2_MARK, PORT262_FN3),
1075 PINMUX_DATA(RTCK3_SWO1_MC1_MARK, PORT262_FN4),
1076 PINMUX_DATA(SDHICMD1_MARK, PORT263_FN1),
1077 PINMUX_DATA(TRST3_MARK, PORT263_FN2),
1078 PINMUX_DATA(RESETOUTS_MARK, PORT264_FN1),
1079};
1080
1081#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
1082#define GPIO_PORT_265() _265(_GPIO_PORT, , unused)
1083#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
1084
1085static struct pinmux_gpio pinmux_gpios[] = {
1086 /* 55-1 -> 55-5 (GPIO) */
1087 GPIO_PORT_265(),
1088
1089 /* Special Pull-up / Pull-down Functions */
1090 GPIO_FN(PORT66_KEYIN0_PU), GPIO_FN(PORT67_KEYIN1_PU),
1091 GPIO_FN(PORT68_KEYIN2_PU), GPIO_FN(PORT69_KEYIN3_PU),
1092 GPIO_FN(PORT70_KEYIN4_PU), GPIO_FN(PORT71_KEYIN5_PU),
1093 GPIO_FN(PORT72_KEYIN6_PU),
1094
1095 /* 55-1 (FN) */
1096 GPIO_FN(VBUS_0),
1097 GPIO_FN(CPORT0),
1098 GPIO_FN(CPORT1),
1099 GPIO_FN(CPORT2),
1100 GPIO_FN(CPORT3),
1101 GPIO_FN(CPORT4),
1102 GPIO_FN(CPORT5),
1103 GPIO_FN(CPORT6),
1104 GPIO_FN(CPORT7),
1105 GPIO_FN(CPORT8),
1106 GPIO_FN(CPORT9),
1107 GPIO_FN(CPORT10),
1108 GPIO_FN(CPORT11), GPIO_FN(SIN2),
1109 GPIO_FN(CPORT12), GPIO_FN(XCTS2),
1110 GPIO_FN(CPORT13), GPIO_FN(RFSPO4),
1111 GPIO_FN(CPORT14), GPIO_FN(RFSPO5),
1112 GPIO_FN(CPORT15), GPIO_FN(SCIFA0_SCK), GPIO_FN(GPS_AGC2),
1113 GPIO_FN(CPORT16), GPIO_FN(SCIFA0_TXD), GPIO_FN(GPS_AGC3),
1114 GPIO_FN(CPORT17_IC_OE), GPIO_FN(SOUT2),
1115 GPIO_FN(CPORT18), GPIO_FN(XRTS2), GPIO_FN(PORT19_VIO_CKO2),
1116 GPIO_FN(CPORT19_MPORT1),
1117 GPIO_FN(CPORT20), GPIO_FN(RFSPO6),
1118 GPIO_FN(CPORT21), GPIO_FN(STATUS0),
1119 GPIO_FN(CPORT22), GPIO_FN(STATUS1),
1120 GPIO_FN(CPORT23), GPIO_FN(STATUS2), GPIO_FN(RFSPO7),
1121 GPIO_FN(B_SYNLD1),
1122 GPIO_FN(B_SYNLD2), GPIO_FN(SYSENMSK),
1123 GPIO_FN(XMAINPS),
1124 GPIO_FN(XDIVPS),
1125 GPIO_FN(XIDRST),
1126 GPIO_FN(IDCLK), GPIO_FN(IC_DP),
1127 GPIO_FN(IDIO), GPIO_FN(IC_DM),
1128 GPIO_FN(SOUT1), GPIO_FN(SCIFA4_TXD), GPIO_FN(M02_BERDAT),
1129 GPIO_FN(SIN1), GPIO_FN(SCIFA4_RXD), GPIO_FN(XWUP),
1130 GPIO_FN(XRTS1), GPIO_FN(SCIFA4_RTS), GPIO_FN(M03_BERCLK),
1131 GPIO_FN(XCTS1), GPIO_FN(SCIFA4_CTS),
1132 GPIO_FN(PCMCLKO),
1133 GPIO_FN(SYNC8KO),
1134
1135 /* 55-2 (FN) */
1136 GPIO_FN(DNPCM_A),
1137 GPIO_FN(UPPCM_A),
1138 GPIO_FN(VACK),
1139 GPIO_FN(XTALB1L),
1140 GPIO_FN(GPS_AGC1), GPIO_FN(SCIFA0_RTS),
1141 GPIO_FN(GPS_AGC4), GPIO_FN(SCIFA0_RXD),
1142 GPIO_FN(GPS_PWRDOWN), GPIO_FN(SCIFA0_CTS),
1143 GPIO_FN(GPS_IM),
1144 GPIO_FN(GPS_IS),
1145 GPIO_FN(GPS_QM),
1146 GPIO_FN(GPS_QS),
1147 GPIO_FN(FMSOCK), GPIO_FN(PORT49_IRDA_OUT), GPIO_FN(PORT49_IROUT),
1148 GPIO_FN(FMSOOLR), GPIO_FN(BBIF2_TSYNC2), GPIO_FN(TPU2TO2),
1149 GPIO_FN(IPORT3), GPIO_FN(FMSIOLR),
1150 GPIO_FN(FMSOOBT), GPIO_FN(BBIF2_TSCK2), GPIO_FN(TPU2TO3),
1151 GPIO_FN(OPORT1), GPIO_FN(FMSIOBT),
1152 GPIO_FN(FMSOSLD), GPIO_FN(BBIF2_TXD2), GPIO_FN(OPORT2),
1153 GPIO_FN(FMSOILR), GPIO_FN(PORT53_IRDA_IN), GPIO_FN(TPU3TO3),
1154 GPIO_FN(OPORT3), GPIO_FN(FMSIILR),
1155 GPIO_FN(FMSOIBT), GPIO_FN(PORT54_IRDA_FIRSEL), GPIO_FN(TPU3TO2),
1156 GPIO_FN(FMSIIBT),
1157 GPIO_FN(FMSISLD), GPIO_FN(MFG0_OUT1), GPIO_FN(TPU0TO0),
1158 GPIO_FN(A0_EA0), GPIO_FN(BS),
1159 GPIO_FN(A12_EA12), GPIO_FN(PORT58_VIO_CKOR), GPIO_FN(TPU4TO2),
1160 GPIO_FN(A13_EA13), GPIO_FN(PORT59_IROUT), GPIO_FN(MFG0_OUT2),
1161 GPIO_FN(TPU0TO1),
1162 GPIO_FN(A14_EA14), GPIO_FN(PORT60_KEYOUT5),
1163 GPIO_FN(A15_EA15), GPIO_FN(PORT61_KEYOUT4),
1164 GPIO_FN(A16_EA16), GPIO_FN(PORT62_KEYOUT3), GPIO_FN(MSIOF0_SS1),
1165 GPIO_FN(A17_EA17), GPIO_FN(PORT63_KEYOUT2), GPIO_FN(MSIOF0_TSYNC),
1166 GPIO_FN(A18_EA18), GPIO_FN(PORT64_KEYOUT1), GPIO_FN(MSIOF0_TSCK),
1167 GPIO_FN(A19_EA19), GPIO_FN(PORT65_KEYOUT0), GPIO_FN(MSIOF0_TXD),
1168 GPIO_FN(A20_EA20), GPIO_FN(PORT66_KEYIN0), GPIO_FN(MSIOF0_RSCK),
1169 GPIO_FN(A21_EA21), GPIO_FN(PORT67_KEYIN1), GPIO_FN(MSIOF0_RSYNC),
1170 GPIO_FN(A22_EA22), GPIO_FN(PORT68_KEYIN2), GPIO_FN(MSIOF0_MCK0),
1171 GPIO_FN(A23_EA23), GPIO_FN(PORT69_KEYIN3), GPIO_FN(MSIOF0_MCK1),
1172 GPIO_FN(A24_EA24), GPIO_FN(PORT70_KEYIN4), GPIO_FN(MSIOF0_RXD),
1173 GPIO_FN(A25_EA25), GPIO_FN(PORT71_KEYIN5), GPIO_FN(MSIOF0_SS2),
1174 GPIO_FN(A26), GPIO_FN(PORT72_KEYIN6),
1175 GPIO_FN(D0_ED0_NAF0),
1176 GPIO_FN(D1_ED1_NAF1),
1177 GPIO_FN(D2_ED2_NAF2),
1178 GPIO_FN(D3_ED3_NAF3),
1179 GPIO_FN(D4_ED4_NAF4),
1180 GPIO_FN(D5_ED5_NAF5),
1181 GPIO_FN(D6_ED6_NAF6),
1182 GPIO_FN(D7_ED7_NAF7),
1183 GPIO_FN(D8_ED8_NAF8),
1184 GPIO_FN(D9_ED9_NAF9),
1185 GPIO_FN(D10_ED10_NAF10),
1186 GPIO_FN(D11_ED11_NAF11),
1187 GPIO_FN(D12_ED12_NAF12),
1188 GPIO_FN(D13_ED13_NAF13),
1189 GPIO_FN(D14_ED14_NAF14),
1190 GPIO_FN(D15_ED15_NAF15),
1191 GPIO_FN(CS4),
1192 GPIO_FN(CS5A), GPIO_FN(FMSICK),
1193
1194 /* 55-3 (FN) */
1195 GPIO_FN(CS5B), GPIO_FN(FCE1),
1196 GPIO_FN(CS6B), GPIO_FN(XCS2), GPIO_FN(CS6A), GPIO_FN(DACK0),
1197 GPIO_FN(FCE0),
1198 GPIO_FN(WAIT), GPIO_FN(DREQ0),
1199 GPIO_FN(RD_XRD),
1200 GPIO_FN(WE0_XWR0_FWE),
1201 GPIO_FN(WE1_XWR1),
1202 GPIO_FN(FRB),
1203 GPIO_FN(CKO),
1204 GPIO_FN(NBRSTOUT),
1205 GPIO_FN(NBRST),
1206 GPIO_FN(GPS_EPPSIN),
1207 GPIO_FN(LATCHPULSE),
1208 GPIO_FN(LTESIGNAL),
1209 GPIO_FN(LEGACYSTATE),
1210 GPIO_FN(TCKON),
1211 GPIO_FN(VIO_VD), GPIO_FN(PORT128_KEYOUT0), GPIO_FN(IPORT0),
1212 GPIO_FN(VIO_HD), GPIO_FN(PORT129_KEYOUT1), GPIO_FN(IPORT1),
1213 GPIO_FN(VIO_D0), GPIO_FN(PORT130_KEYOUT2), GPIO_FN(PORT130_MSIOF2_RXD),
1214 GPIO_FN(VIO_D1), GPIO_FN(PORT131_KEYOUT3), GPIO_FN(PORT131_MSIOF2_SS1),
1215 GPIO_FN(VIO_D2), GPIO_FN(PORT132_KEYOUT4), GPIO_FN(PORT132_MSIOF2_SS2),
1216 GPIO_FN(VIO_D3), GPIO_FN(PORT133_KEYOUT5),
1217 GPIO_FN(PORT133_MSIOF2_TSYNC),
1218 GPIO_FN(VIO_D4), GPIO_FN(PORT134_KEYIN0), GPIO_FN(PORT134_MSIOF2_TXD),
1219 GPIO_FN(VIO_D5), GPIO_FN(PORT135_KEYIN1), GPIO_FN(PORT135_MSIOF2_TSCK),
1220 GPIO_FN(VIO_D6), GPIO_FN(PORT136_KEYIN2),
1221 GPIO_FN(VIO_D7), GPIO_FN(PORT137_KEYIN3),
1222 GPIO_FN(VIO_D8), GPIO_FN(M9_SLCD_A01), GPIO_FN(PORT138_FSIAOMC),
1223 GPIO_FN(VIO_D9), GPIO_FN(M10_SLCD_CK1), GPIO_FN(PORT139_FSIAOLR),
1224 GPIO_FN(VIO_D10), GPIO_FN(M11_SLCD_SO1), GPIO_FN(TPU0TO2),
1225 GPIO_FN(PORT140_FSIAOBT),
1226 GPIO_FN(VIO_D11), GPIO_FN(M12_SLCD_CE1), GPIO_FN(TPU0TO3),
1227 GPIO_FN(PORT141_FSIAOSLD),
1228 GPIO_FN(VIO_D12), GPIO_FN(M13_BSW), GPIO_FN(PORT142_FSIACK),
1229 GPIO_FN(VIO_D13), GPIO_FN(M14_GSW), GPIO_FN(PORT143_FSIAILR),
1230 GPIO_FN(VIO_D14), GPIO_FN(M15_RSW), GPIO_FN(PORT144_FSIAIBT),
1231 GPIO_FN(VIO_D15), GPIO_FN(TPU1TO3), GPIO_FN(PORT145_FSIAISLD),
1232 GPIO_FN(VIO_CLK), GPIO_FN(PORT146_KEYIN4), GPIO_FN(IPORT2),
1233 GPIO_FN(VIO_FIELD), GPIO_FN(PORT147_KEYIN5),
1234 GPIO_FN(VIO_CKO), GPIO_FN(PORT148_KEYIN6),
1235 GPIO_FN(A27), GPIO_FN(RDWR_XWE), GPIO_FN(MFG0_IN1),
1236 GPIO_FN(MFG0_IN2),
1237 GPIO_FN(TS_SPSYNC3), GPIO_FN(MSIOF2_RSCK),
1238 GPIO_FN(TS_SDAT3), GPIO_FN(MSIOF2_RSYNC),
1239 GPIO_FN(TPU1TO2), GPIO_FN(TS_SDEN3), GPIO_FN(PORT153_MSIOF2_SS1),
1240 GPIO_FN(SOUT3), GPIO_FN(SCIFA2_TXD1), GPIO_FN(MSIOF2_MCK0),
1241 GPIO_FN(SIN3), GPIO_FN(SCIFA2_RXD1), GPIO_FN(MSIOF2_MCK1),
1242 GPIO_FN(XRTS3), GPIO_FN(SCIFA2_RTS1), GPIO_FN(PORT156_MSIOF2_SS2),
1243 GPIO_FN(XCTS3), GPIO_FN(SCIFA2_CTS1), GPIO_FN(PORT157_MSIOF2_RXD),
1244
1245 /* 55-4 (FN) */
1246 GPIO_FN(DINT), GPIO_FN(SCIFA2_SCK1), GPIO_FN(TS_SCK3),
1247 GPIO_FN(PORT159_SCIFB_SCK), GPIO_FN(PORT159_SCIFA5_SCK), GPIO_FN(NMI),
1248 GPIO_FN(PORT160_SCIFB_TXD), GPIO_FN(PORT160_SCIFA5_TXD), GPIO_FN(SOUT0),
1249 GPIO_FN(PORT161_SCIFB_CTS), GPIO_FN(PORT161_SCIFA5_CTS), GPIO_FN(XCTS0),
1250 GPIO_FN(MFG3_IN2),
1251 GPIO_FN(PORT162_SCIFB_RXD), GPIO_FN(PORT162_SCIFA5_RXD), GPIO_FN(SIN0),
1252 GPIO_FN(MFG3_IN1),
1253 GPIO_FN(PORT163_SCIFB_RTS), GPIO_FN(PORT163_SCIFA5_RTS), GPIO_FN(XRTS0),
1254 GPIO_FN(MFG3_OUT1), GPIO_FN(TPU3TO0),
1255 GPIO_FN(LCDD0), GPIO_FN(PORT192_KEYOUT0), GPIO_FN(EXT_CKI),
1256 GPIO_FN(LCDD1), GPIO_FN(PORT193_KEYOUT1), GPIO_FN(PORT193_SCIFA5_CTS),
1257 GPIO_FN(BBIF2_TSYNC1),
1258 GPIO_FN(LCDD2), GPIO_FN(PORT194_KEYOUT2), GPIO_FN(PORT194_SCIFA5_RTS),
1259 GPIO_FN(BBIF2_TSCK1),
1260 GPIO_FN(LCDD3), GPIO_FN(PORT195_KEYOUT3), GPIO_FN(PORT195_SCIFA5_RXD),
1261 GPIO_FN(BBIF2_TXD1),
1262 GPIO_FN(LCDD4), GPIO_FN(PORT196_KEYOUT4), GPIO_FN(PORT196_SCIFA5_TXD),
1263 GPIO_FN(LCDD5), GPIO_FN(PORT197_KEYOUT5), GPIO_FN(PORT197_SCIFA5_SCK),
1264 GPIO_FN(MFG2_OUT2),
1265 GPIO_FN(LCDD6),
1266 GPIO_FN(LCDD7), GPIO_FN(TPU4TO1), GPIO_FN(MFG4_OUT2),
1267 GPIO_FN(LCDD8), GPIO_FN(PORT200_KEYIN0), GPIO_FN(VIO_DR0),
1268 GPIO_FN(D16),
1269 GPIO_FN(LCDD9), GPIO_FN(PORT201_KEYIN1), GPIO_FN(VIO_DR1),
1270 GPIO_FN(D17),
1271 GPIO_FN(LCDD10), GPIO_FN(PORT202_KEYIN2), GPIO_FN(VIO_DR2),
1272 GPIO_FN(D18),
1273 GPIO_FN(LCDD11), GPIO_FN(PORT203_KEYIN3), GPIO_FN(VIO_DR3),
1274 GPIO_FN(D19),
1275 GPIO_FN(LCDD12), GPIO_FN(PORT204_KEYIN4), GPIO_FN(VIO_DR4),
1276 GPIO_FN(D20),
1277 GPIO_FN(LCDD13), GPIO_FN(PORT205_KEYIN5), GPIO_FN(VIO_DR5),
1278 GPIO_FN(D21),
1279 GPIO_FN(LCDD14), GPIO_FN(PORT206_KEYIN6), GPIO_FN(VIO_DR6),
1280 GPIO_FN(D22),
1281 GPIO_FN(LCDD15), GPIO_FN(PORT207_MSIOF0L_SS1), GPIO_FN(PORT207_KEYOUT0),
1282 GPIO_FN(VIO_DR7), GPIO_FN(D23),
1283 GPIO_FN(LCDD16), GPIO_FN(PORT208_MSIOF0L_SS2), GPIO_FN(PORT208_KEYOUT1),
1284 GPIO_FN(VIO_VDR), GPIO_FN(D24),
1285 GPIO_FN(LCDD17), GPIO_FN(PORT209_KEYOUT2), GPIO_FN(VIO_HDR),
1286 GPIO_FN(D25),
1287 GPIO_FN(LCDD18), GPIO_FN(DREQ2), GPIO_FN(PORT210_MSIOF0L_SS1),
1288 GPIO_FN(D26),
1289 GPIO_FN(LCDD19), GPIO_FN(PORT211_MSIOF0L_SS2), GPIO_FN(D27),
1290 GPIO_FN(LCDD20), GPIO_FN(TS_SPSYNC1), GPIO_FN(MSIOF0L_MCK0),
1291 GPIO_FN(D28),
1292 GPIO_FN(LCDD21), GPIO_FN(TS_SDAT1), GPIO_FN(MSIOF0L_MCK1),
1293 GPIO_FN(D29),
1294 GPIO_FN(LCDD22), GPIO_FN(TS_SDEN1), GPIO_FN(MSIOF0L_RSCK),
1295 GPIO_FN(D30),
1296 GPIO_FN(LCDD23), GPIO_FN(TS_SCK1), GPIO_FN(MSIOF0L_RSYNC),
1297 GPIO_FN(D31),
1298 GPIO_FN(LCDDCK), GPIO_FN(LCDWR), GPIO_FN(PORT216_KEYOUT3),
1299 GPIO_FN(VIO_CLKR),
1300 GPIO_FN(LCDRD), GPIO_FN(DACK2), GPIO_FN(MSIOF0L_TSYNC),
1301 GPIO_FN(LCDHSYN), GPIO_FN(LCDCS), GPIO_FN(LCDCS2), GPIO_FN(DACK3),
1302 GPIO_FN(PORT218_VIO_CKOR), GPIO_FN(PORT218_KEYOUT4),
1303 GPIO_FN(LCDDISP), GPIO_FN(LCDRS), GPIO_FN(DREQ3), GPIO_FN(MSIOF0L_TSCK),
1304 GPIO_FN(LCDVSYN), GPIO_FN(LCDVSYN2), GPIO_FN(PORT220_KEYOUT5),
1305 GPIO_FN(LCDLCLK), GPIO_FN(DREQ1), GPIO_FN(PWEN), GPIO_FN(MSIOF0L_RXD),
1306 GPIO_FN(LCDDON), GPIO_FN(LCDDON2), GPIO_FN(DACK1), GPIO_FN(OVCN),
1307 GPIO_FN(MSIOF0L_TXD),
1308 GPIO_FN(SCIFA1_TXD), GPIO_FN(OVCN2),
1309 GPIO_FN(EXTLP), GPIO_FN(SCIFA1_SCK), GPIO_FN(USBTERM),
1310 GPIO_FN(PORT226_VIO_CKO2),
1311 GPIO_FN(SCIFA1_RTS), GPIO_FN(IDIN),
1312 GPIO_FN(SCIFA1_RXD),
1313 GPIO_FN(SCIFA1_CTS), GPIO_FN(MFG1_IN1),
1314 GPIO_FN(MSIOF1_TXD), GPIO_FN(SCIFA2_TXD2), GPIO_FN(PORT230_FSIAOMC),
1315 GPIO_FN(MSIOF1_TSYNC), GPIO_FN(SCIFA2_CTS2), GPIO_FN(PORT231_FSIAOLR),
1316 GPIO_FN(MSIOF1_TSCK), GPIO_FN(SCIFA2_SCK2), GPIO_FN(PORT232_FSIAOBT),
1317 GPIO_FN(MSIOF1_RXD), GPIO_FN(SCIFA2_RXD2), GPIO_FN(GPS_VCOTRIG),
1318 GPIO_FN(PORT233_FSIACK),
1319 GPIO_FN(MSIOF1_RSCK), GPIO_FN(SCIFA2_RTS2), GPIO_FN(PORT234_FSIAOSLD),
1320 GPIO_FN(MSIOF1_RSYNC), GPIO_FN(OPORT0), GPIO_FN(MFG1_IN2),
1321 GPIO_FN(PORT235_FSIAILR),
1322 GPIO_FN(MSIOF1_MCK0), GPIO_FN(I2C_SDA2), GPIO_FN(PORT236_FSIAIBT),
1323 GPIO_FN(MSIOF1_MCK1), GPIO_FN(I2C_SCL2), GPIO_FN(PORT237_FSIAISLD),
1324 GPIO_FN(MSIOF1_SS1), GPIO_FN(EDBGREQ3),
1325
1326 /* 55-5 (FN) */
1327 GPIO_FN(MSIOF1_SS2),
1328 GPIO_FN(SCIFA6_TXD),
1329 GPIO_FN(PORT241_IRDA_OUT), GPIO_FN(PORT241_IROUT), GPIO_FN(MFG4_OUT1),
1330 GPIO_FN(TPU4TO0),
1331 GPIO_FN(PORT242_IRDA_IN), GPIO_FN(MFG4_IN2),
1332 GPIO_FN(PORT243_IRDA_FIRSEL), GPIO_FN(PORT243_VIO_CKO2),
1333 GPIO_FN(PORT244_SCIFA5_CTS), GPIO_FN(MFG2_IN1),
1334 GPIO_FN(PORT244_SCIFB_CTS),
1335 GPIO_FN(PORT245_SCIFA5_RTS), GPIO_FN(MFG2_IN2),
1336 GPIO_FN(PORT245_SCIFB_RTS),
1337 GPIO_FN(PORT246_SCIFA5_RXD), GPIO_FN(MFG1_OUT1),
1338 GPIO_FN(PORT246_SCIFB_RXD), GPIO_FN(TPU1TO0),
1339 GPIO_FN(PORT247_SCIFA5_TXD), GPIO_FN(MFG3_OUT2),
1340 GPIO_FN(PORT247_SCIFB_TXD), GPIO_FN(TPU3TO1),
1341 GPIO_FN(PORT248_SCIFA5_SCK), GPIO_FN(MFG2_OUT1),
1342 GPIO_FN(PORT248_SCIFB_SCK), GPIO_FN(TPU2TO0),
1343 GPIO_FN(PORT249_IROUT), GPIO_FN(MFG4_IN1),
1344 GPIO_FN(SDHICLK0), GPIO_FN(TCK2_SWCLK_MC0),
1345 GPIO_FN(SDHICD0),
1346 GPIO_FN(SDHID0_0), GPIO_FN(TMS2_SWDIO_MC0),
1347 GPIO_FN(SDHID0_1), GPIO_FN(TDO2_SWO0_MC0),
1348 GPIO_FN(SDHID0_2), GPIO_FN(TDI2),
1349 GPIO_FN(SDHID0_3), GPIO_FN(RTCK2_SWO1_MC0),
1350 GPIO_FN(SDHICMD0), GPIO_FN(TRST2),
1351 GPIO_FN(SDHIWP0), GPIO_FN(EDBGREQ2),
1352 GPIO_FN(SDHICLK1), GPIO_FN(TCK3_SWCLK_MC1),
1353 GPIO_FN(SDHID1_0), GPIO_FN(M11_SLCD_SO2), GPIO_FN(TS_SPSYNC2),
1354 GPIO_FN(TMS3_SWDIO_MC1),
1355 GPIO_FN(SDHID1_1), GPIO_FN(M9_SLCD_A02), GPIO_FN(TS_SDAT2),
1356 GPIO_FN(TDO3_SWO0_MC1),
1357 GPIO_FN(SDHID1_2), GPIO_FN(M10_SLCD_CK2), GPIO_FN(TS_SDEN2),
1358 GPIO_FN(TDI3),
1359 GPIO_FN(SDHID1_3), GPIO_FN(M12_SLCD_CE2), GPIO_FN(TS_SCK2),
1360 GPIO_FN(RTCK3_SWO1_MC1),
1361 GPIO_FN(SDHICMD1), GPIO_FN(TRST3),
1362 GPIO_FN(RESETOUTS),
1363};
1364
1365/* helper for top 4 bits in PORTnCR */
1366#define PCRH(in, in_pd, in_pu, out) \
1367 0, (out), (in), 0, \
1368 0, 0, 0, 0, \
1369 0, 0, (in_pd), 0, \
1370 0, 0, (in_pu), 0
1371
1372#define PORTCR(nr, reg) \
1373 { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
1374 PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
1375 PORT##nr##_IN_PU, PORT##nr##_OUT), \
1376 PORT##nr##_FN0, PORT##nr##_FN1, \
1377 PORT##nr##_FN2, PORT##nr##_FN3, \
1378 PORT##nr##_FN4, PORT##nr##_FN5, \
1379 PORT##nr##_FN6, PORT##nr##_FN7 } \
1380 }
1381
1382static struct pinmux_cfg_reg pinmux_config_regs[] = {
1383 PORTCR(0, 0xe6050000), /* PORT0CR */
1384 PORTCR(1, 0xe6050001), /* PORT1CR */
1385 PORTCR(2, 0xe6050002), /* PORT2CR */
1386 PORTCR(3, 0xe6050003), /* PORT3CR */
1387 PORTCR(4, 0xe6050004), /* PORT4CR */
1388 PORTCR(5, 0xe6050005), /* PORT5CR */
1389 PORTCR(6, 0xe6050006), /* PORT6CR */
1390 PORTCR(7, 0xe6050007), /* PORT7CR */
1391 PORTCR(8, 0xe6050008), /* PORT8CR */
1392 PORTCR(9, 0xe6050009), /* PORT9CR */
1393
1394 PORTCR(10, 0xe605000a), /* PORT10CR */
1395 PORTCR(11, 0xe605000b), /* PORT11CR */
1396 PORTCR(12, 0xe605000c), /* PORT12CR */
1397 PORTCR(13, 0xe605000d), /* PORT13CR */
1398 PORTCR(14, 0xe605000e), /* PORT14CR */
1399 PORTCR(15, 0xe605000f), /* PORT15CR */
1400 PORTCR(16, 0xe6050010), /* PORT16CR */
1401 PORTCR(17, 0xe6050011), /* PORT17CR */
1402 PORTCR(18, 0xe6050012), /* PORT18CR */
1403 PORTCR(19, 0xe6050013), /* PORT19CR */
1404
1405 PORTCR(20, 0xe6050014), /* PORT20CR */
1406 PORTCR(21, 0xe6050015), /* PORT21CR */
1407 PORTCR(22, 0xe6050016), /* PORT22CR */
1408 PORTCR(23, 0xe6050017), /* PORT23CR */
1409 PORTCR(24, 0xe6050018), /* PORT24CR */
1410 PORTCR(25, 0xe6050019), /* PORT25CR */
1411 PORTCR(26, 0xe605001a), /* PORT26CR */
1412 PORTCR(27, 0xe605001b), /* PORT27CR */
1413 PORTCR(28, 0xe605001c), /* PORT28CR */
1414 PORTCR(29, 0xe605001d), /* PORT29CR */
1415
1416 PORTCR(30, 0xe605001e), /* PORT30CR */
1417 PORTCR(31, 0xe605001f), /* PORT31CR */
1418 PORTCR(32, 0xe6050020), /* PORT32CR */
1419 PORTCR(33, 0xe6050021), /* PORT33CR */
1420 PORTCR(34, 0xe6050022), /* PORT34CR */
1421 PORTCR(35, 0xe6050023), /* PORT35CR */
1422 PORTCR(36, 0xe6050024), /* PORT36CR */
1423 PORTCR(37, 0xe6050025), /* PORT37CR */
1424 PORTCR(38, 0xe6050026), /* PORT38CR */
1425 PORTCR(39, 0xe6050027), /* PORT39CR */
1426
1427 PORTCR(40, 0xe6050028), /* PORT40CR */
1428 PORTCR(41, 0xe6050029), /* PORT41CR */
1429 PORTCR(42, 0xe605002a), /* PORT42CR */
1430 PORTCR(43, 0xe605002b), /* PORT43CR */
1431 PORTCR(44, 0xe605002c), /* PORT44CR */
1432 PORTCR(45, 0xe605002d), /* PORT45CR */
1433 PORTCR(46, 0xe605002e), /* PORT46CR */
1434 PORTCR(47, 0xe605002f), /* PORT47CR */
1435 PORTCR(48, 0xe6050030), /* PORT48CR */
1436 PORTCR(49, 0xe6050031), /* PORT49CR */
1437
1438 PORTCR(50, 0xe6050032), /* PORT50CR */
1439 PORTCR(51, 0xe6050033), /* PORT51CR */
1440 PORTCR(52, 0xe6050034), /* PORT52CR */
1441 PORTCR(53, 0xe6050035), /* PORT53CR */
1442 PORTCR(54, 0xe6050036), /* PORT54CR */
1443 PORTCR(55, 0xe6050037), /* PORT55CR */
1444 PORTCR(56, 0xe6050038), /* PORT56CR */
1445 PORTCR(57, 0xe6050039), /* PORT57CR */
1446 PORTCR(58, 0xe605003a), /* PORT58CR */
1447 PORTCR(59, 0xe605003b), /* PORT59CR */
1448
1449 PORTCR(60, 0xe605003c), /* PORT60CR */
1450 PORTCR(61, 0xe605003d), /* PORT61CR */
1451 PORTCR(62, 0xe605003e), /* PORT62CR */
1452 PORTCR(63, 0xe605003f), /* PORT63CR */
1453 PORTCR(64, 0xe6050040), /* PORT64CR */
1454 PORTCR(65, 0xe6050041), /* PORT65CR */
1455 PORTCR(66, 0xe6050042), /* PORT66CR */
1456 PORTCR(67, 0xe6050043), /* PORT67CR */
1457 PORTCR(68, 0xe6050044), /* PORT68CR */
1458 PORTCR(69, 0xe6050045), /* PORT69CR */
1459
1460 PORTCR(70, 0xe6050046), /* PORT70CR */
1461 PORTCR(71, 0xe6050047), /* PORT71CR */
1462 PORTCR(72, 0xe6050048), /* PORT72CR */
1463 PORTCR(73, 0xe6050049), /* PORT73CR */
1464 PORTCR(74, 0xe605004a), /* PORT74CR */
1465 PORTCR(75, 0xe605004b), /* PORT75CR */
1466 PORTCR(76, 0xe605004c), /* PORT76CR */
1467 PORTCR(77, 0xe605004d), /* PORT77CR */
1468 PORTCR(78, 0xe605004e), /* PORT78CR */
1469 PORTCR(79, 0xe605004f), /* PORT79CR */
1470
1471 PORTCR(80, 0xe6050050), /* PORT80CR */
1472 PORTCR(81, 0xe6050051), /* PORT81CR */
1473 PORTCR(82, 0xe6050052), /* PORT82CR */
1474 PORTCR(83, 0xe6050053), /* PORT83CR */
1475 PORTCR(84, 0xe6050054), /* PORT84CR */
1476 PORTCR(85, 0xe6050055), /* PORT85CR */
1477 PORTCR(86, 0xe6050056), /* PORT86CR */
1478 PORTCR(87, 0xe6050057), /* PORT87CR */
1479 PORTCR(88, 0xe6050058), /* PORT88CR */
1480 PORTCR(89, 0xe6050059), /* PORT89CR */
1481
1482 PORTCR(90, 0xe605005a), /* PORT90CR */
1483 PORTCR(91, 0xe605005b), /* PORT91CR */
1484 PORTCR(92, 0xe605005c), /* PORT92CR */
1485 PORTCR(93, 0xe605005d), /* PORT93CR */
1486 PORTCR(94, 0xe605005e), /* PORT94CR */
1487 PORTCR(95, 0xe605005f), /* PORT95CR */
1488 PORTCR(96, 0xe6050060), /* PORT96CR */
1489 PORTCR(97, 0xe6050061), /* PORT97CR */
1490 PORTCR(98, 0xe6050062), /* PORT98CR */
1491 PORTCR(99, 0xe6050063), /* PORT99CR */
1492
1493 PORTCR(100, 0xe6050064), /* PORT100CR */
1494 PORTCR(101, 0xe6050065), /* PORT101CR */
1495 PORTCR(102, 0xe6050066), /* PORT102CR */
1496 PORTCR(103, 0xe6050067), /* PORT103CR */
1497 PORTCR(104, 0xe6050068), /* PORT104CR */
1498 PORTCR(105, 0xe6050069), /* PORT105CR */
1499 PORTCR(106, 0xe605006a), /* PORT106CR */
1500 PORTCR(107, 0xe605006b), /* PORT107CR */
1501 PORTCR(108, 0xe605006c), /* PORT108CR */
1502 PORTCR(109, 0xe605006d), /* PORT109CR */
1503
1504 PORTCR(110, 0xe605006e), /* PORT110CR */
1505 PORTCR(111, 0xe605006f), /* PORT111CR */
1506 PORTCR(112, 0xe6050070), /* PORT112CR */
1507 PORTCR(113, 0xe6050071), /* PORT113CR */
1508 PORTCR(114, 0xe6050072), /* PORT114CR */
1509 PORTCR(115, 0xe6050073), /* PORT115CR */
1510 PORTCR(116, 0xe6050074), /* PORT116CR */
1511 PORTCR(117, 0xe6050075), /* PORT117CR */
1512 PORTCR(118, 0xe6050076), /* PORT118CR */
1513
1514 PORTCR(128, 0xe6051080), /* PORT128CR */
1515 PORTCR(129, 0xe6051081), /* PORT129CR */
1516
1517 PORTCR(130, 0xe6051082), /* PORT130CR */
1518 PORTCR(131, 0xe6051083), /* PORT131CR */
1519 PORTCR(132, 0xe6051084), /* PORT132CR */
1520 PORTCR(133, 0xe6051085), /* PORT133CR */
1521 PORTCR(134, 0xe6051086), /* PORT134CR */
1522 PORTCR(135, 0xe6051087), /* PORT135CR */
1523 PORTCR(136, 0xe6051088), /* PORT136CR */
1524 PORTCR(137, 0xe6051089), /* PORT137CR */
1525 PORTCR(138, 0xe605108a), /* PORT138CR */
1526 PORTCR(139, 0xe605108b), /* PORT139CR */
1527
1528 PORTCR(140, 0xe605108c), /* PORT140CR */
1529 PORTCR(141, 0xe605108d), /* PORT141CR */
1530 PORTCR(142, 0xe605108e), /* PORT142CR */
1531 PORTCR(143, 0xe605108f), /* PORT143CR */
1532 PORTCR(144, 0xe6051090), /* PORT144CR */
1533 PORTCR(145, 0xe6051091), /* PORT145CR */
1534 PORTCR(146, 0xe6051092), /* PORT146CR */
1535 PORTCR(147, 0xe6051093), /* PORT147CR */
1536 PORTCR(148, 0xe6051094), /* PORT148CR */
1537 PORTCR(149, 0xe6051095), /* PORT149CR */
1538
1539 PORTCR(150, 0xe6051096), /* PORT150CR */
1540 PORTCR(151, 0xe6051097), /* PORT151CR */
1541 PORTCR(152, 0xe6051098), /* PORT152CR */
1542 PORTCR(153, 0xe6051099), /* PORT153CR */
1543 PORTCR(154, 0xe605109a), /* PORT154CR */
1544 PORTCR(155, 0xe605109b), /* PORT155CR */
1545 PORTCR(156, 0xe605109c), /* PORT156CR */
1546 PORTCR(157, 0xe605109d), /* PORT157CR */
1547 PORTCR(158, 0xe605109e), /* PORT158CR */
1548 PORTCR(159, 0xe605109f), /* PORT159CR */
1549
1550 PORTCR(160, 0xe60510a0), /* PORT160CR */
1551 PORTCR(161, 0xe60510a1), /* PORT161CR */
1552 PORTCR(162, 0xe60510a2), /* PORT162CR */
1553 PORTCR(163, 0xe60510a3), /* PORT163CR */
1554 PORTCR(164, 0xe60510a4), /* PORT164CR */
1555
1556 PORTCR(192, 0xe60520c0), /* PORT192CR */
1557 PORTCR(193, 0xe60520c1), /* PORT193CR */
1558 PORTCR(194, 0xe60520c2), /* PORT194CR */
1559 PORTCR(195, 0xe60520c3), /* PORT195CR */
1560 PORTCR(196, 0xe60520c4), /* PORT196CR */
1561 PORTCR(197, 0xe60520c5), /* PORT197CR */
1562 PORTCR(198, 0xe60520c6), /* PORT198CR */
1563 PORTCR(199, 0xe60520c7), /* PORT199CR */
1564
1565 PORTCR(200, 0xe60520c8), /* PORT200CR */
1566 PORTCR(201, 0xe60520c9), /* PORT201CR */
1567 PORTCR(202, 0xe60520ca), /* PORT202CR */
1568 PORTCR(203, 0xe60520cb), /* PORT203CR */
1569 PORTCR(204, 0xe60520cc), /* PORT204CR */
1570 PORTCR(205, 0xe60520cd), /* PORT205CR */
1571 PORTCR(206, 0xe60520ce), /* PORT206CR */
1572 PORTCR(207, 0xe60520cf), /* PORT207CR */
1573 PORTCR(208, 0xe60520d0), /* PORT208CR */
1574 PORTCR(209, 0xe60520d1), /* PORT209CR */
1575
1576 PORTCR(210, 0xe60520d2), /* PORT210CR */
1577 PORTCR(211, 0xe60520d3), /* PORT211CR */
1578 PORTCR(212, 0xe60520d4), /* PORT212CR */
1579 PORTCR(213, 0xe60520d5), /* PORT213CR */
1580 PORTCR(214, 0xe60520d6), /* PORT214CR */
1581 PORTCR(215, 0xe60520d7), /* PORT215CR */
1582 PORTCR(216, 0xe60520d8), /* PORT216CR */
1583 PORTCR(217, 0xe60520d9), /* PORT217CR */
1584 PORTCR(218, 0xe60520da), /* PORT218CR */
1585 PORTCR(219, 0xe60520db), /* PORT219CR */
1586
1587 PORTCR(220, 0xe60520dc), /* PORT220CR */
1588 PORTCR(221, 0xe60520dd), /* PORT221CR */
1589 PORTCR(222, 0xe60520de), /* PORT222CR */
1590 PORTCR(223, 0xe60520df), /* PORT223CR */
1591 PORTCR(224, 0xe60520e0), /* PORT224CR */
1592 PORTCR(225, 0xe60520e1), /* PORT225CR */
1593 PORTCR(226, 0xe60520e2), /* PORT226CR */
1594 PORTCR(227, 0xe60520e3), /* PORT227CR */
1595 PORTCR(228, 0xe60520e4), /* PORT228CR */
1596 PORTCR(229, 0xe60520e5), /* PORT229CR */
1597
1598 PORTCR(230, 0xe60520e6), /* PORT230CR */
1599 PORTCR(231, 0xe60520e7), /* PORT231CR */
1600 PORTCR(232, 0xe60520e8), /* PORT232CR */
1601 PORTCR(233, 0xe60520e9), /* PORT233CR */
1602 PORTCR(234, 0xe60520ea), /* PORT234CR */
1603 PORTCR(235, 0xe60520eb), /* PORT235CR */
1604 PORTCR(236, 0xe60520ec), /* PORT236CR */
1605 PORTCR(237, 0xe60520ed), /* PORT237CR */
1606 PORTCR(238, 0xe60520ee), /* PORT238CR */
1607 PORTCR(239, 0xe60520ef), /* PORT239CR */
1608
1609 PORTCR(240, 0xe60520f0), /* PORT240CR */
1610 PORTCR(241, 0xe60520f1), /* PORT241CR */
1611 PORTCR(242, 0xe60520f2), /* PORT242CR */
1612 PORTCR(243, 0xe60520f3), /* PORT243CR */
1613 PORTCR(244, 0xe60520f4), /* PORT244CR */
1614 PORTCR(245, 0xe60520f5), /* PORT245CR */
1615 PORTCR(246, 0xe60520f6), /* PORT246CR */
1616 PORTCR(247, 0xe60520f7), /* PORT247CR */
1617 PORTCR(248, 0xe60520f8), /* PORT248CR */
1618 PORTCR(249, 0xe60520f9), /* PORT249CR */
1619
1620 PORTCR(250, 0xe60520fa), /* PORT250CR */
1621 PORTCR(251, 0xe60520fb), /* PORT251CR */
1622 PORTCR(252, 0xe60520fc), /* PORT252CR */
1623 PORTCR(253, 0xe60520fd), /* PORT253CR */
1624 PORTCR(254, 0xe60520fe), /* PORT254CR */
1625 PORTCR(255, 0xe60520ff), /* PORT255CR */
1626 PORTCR(256, 0xe6052100), /* PORT256CR */
1627 PORTCR(257, 0xe6052101), /* PORT257CR */
1628 PORTCR(258, 0xe6052102), /* PORT258CR */
1629 PORTCR(259, 0xe6052103), /* PORT259CR */
1630
1631 PORTCR(260, 0xe6052104), /* PORT260CR */
1632 PORTCR(261, 0xe6052105), /* PORT261CR */
1633 PORTCR(262, 0xe6052106), /* PORT262CR */
1634 PORTCR(263, 0xe6052107), /* PORT263CR */
1635 PORTCR(264, 0xe6052108), /* PORT264CR */
1636
1637 { PINMUX_CFG_REG("MSELBCR", 0xe6058024, 32, 1) {
1638 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1639 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1640 MSELBCR_MSEL17_0, MSELBCR_MSEL17_1,
1641 MSELBCR_MSEL16_0, MSELBCR_MSEL16_1,
1642 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1643 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
1644 },
1645 { },
1646};
1647
1648static struct pinmux_data_reg pinmux_data_regs[] = {
1649 { PINMUX_DATA_REG("PORTL031_000DR", 0xe6054000, 32) {
1650 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
1651 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
1652 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
1653 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
1654 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
1655 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
1656 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
1657 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA }
1658 },
1659 { PINMUX_DATA_REG("PORTL063_032DR", 0xe6054004, 32) {
1660 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
1661 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
1662 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
1663 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
1664 PORT47_DATA, PORT46_DATA, PORT45_DATA, PORT44_DATA,
1665 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
1666 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
1667 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA }
1668 },
1669 { PINMUX_DATA_REG("PORTL095_064DR", 0xe6054008, 32) {
1670 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
1671 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
1672 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
1673 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
1674 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
1675 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
1676 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
1677 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA }
1678 },
1679 { PINMUX_DATA_REG("PORTD127_096DR", 0xe605400C, 32) {
1680 0, 0, 0, 0,
1681 0, 0, 0, 0,
1682 0, PORT118_DATA, PORT117_DATA, PORT116_DATA,
1683 PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
1684 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
1685 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
1686 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
1687 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA }
1688 },
1689 { PINMUX_DATA_REG("PORTD159_128DR", 0xe6055000, 32) {
1690 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
1691 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
1692 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
1693 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
1694 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
1695 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
1696 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
1697 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA }
1698 },
1699 { PINMUX_DATA_REG("PORTR191_160DR", 0xe6055004, 32) {
1700 0, 0, 0, 0,
1701 0, 0, 0, 0,
1702 0, 0, 0, 0,
1703 0, 0, 0, 0,
1704 0, 0, 0, 0,
1705 0, 0, 0, 0,
1706 0, 0, 0, PORT164_DATA,
1707 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA }
1708 },
1709 { PINMUX_DATA_REG("PORTR223_192DR", 0xe6056000, 32) {
1710 PORT223_DATA, PORT222_DATA, PORT221_DATA, PORT220_DATA,
1711 PORT219_DATA, PORT218_DATA, PORT217_DATA, PORT216_DATA,
1712 PORT215_DATA, PORT214_DATA, PORT213_DATA, PORT212_DATA,
1713 PORT211_DATA, PORT210_DATA, PORT209_DATA, PORT208_DATA,
1714 PORT207_DATA, PORT206_DATA, PORT205_DATA, PORT204_DATA,
1715 PORT203_DATA, PORT202_DATA, PORT201_DATA, PORT200_DATA,
1716 PORT199_DATA, PORT198_DATA, PORT197_DATA, PORT196_DATA,
1717 PORT195_DATA, PORT194_DATA, PORT193_DATA, PORT192_DATA }
1718 },
1719 { PINMUX_DATA_REG("PORTU255_224DR", 0xe6056004, 32) {
1720 PORT255_DATA, PORT254_DATA, PORT253_DATA, PORT252_DATA,
1721 PORT251_DATA, PORT250_DATA, PORT249_DATA, PORT248_DATA,
1722 PORT247_DATA, PORT246_DATA, PORT245_DATA, PORT244_DATA,
1723 PORT243_DATA, PORT242_DATA, PORT241_DATA, PORT240_DATA,
1724 PORT239_DATA, PORT238_DATA, PORT237_DATA, PORT236_DATA,
1725 PORT235_DATA, PORT234_DATA, PORT233_DATA, PORT232_DATA,
1726 PORT231_DATA, PORT230_DATA, PORT229_DATA, PORT228_DATA,
1727 PORT227_DATA, PORT226_DATA, PORT225_DATA, PORT224_DATA }
1728 },
1729 { PINMUX_DATA_REG("PORTU287_256DR", 0xe6056008, 32) {
1730 0, 0, 0, 0,
1731 0, 0, 0, 0,
1732 0, 0, 0, 0,
1733 0, 0, 0, 0,
1734 0, 0, 0, 0,
1735 0, 0, 0, PORT264_DATA,
1736 PORT263_DATA, PORT262_DATA, PORT261_DATA, PORT260_DATA,
1737 PORT259_DATA, PORT258_DATA, PORT257_DATA, PORT256_DATA }
1738 },
1739 { },
1740};
1741
1742static struct pinmux_info sh7377_pinmux_info = {
1743 .name = "sh7377_pfc",
1744 .reserved_id = PINMUX_RESERVED,
1745 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1746 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1747 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1748 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
1749 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1750 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1751 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1752
1753 .first_gpio = GPIO_PORT0,
1754 .last_gpio = GPIO_FN_RESETOUTS,
1755
1756 .gpios = pinmux_gpios,
1757 .cfg_regs = pinmux_config_regs,
1758 .data_regs = pinmux_data_regs,
1759
1760 .gpio_data = pinmux_data,
1761 .gpio_data_size = ARRAY_SIZE(pinmux_data),
1762};
1763
1764void sh7377_pinmux_init(void)
1765{
1766 register_pinmux(&sh7377_pinmux_info);
1767}
diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
new file mode 100644
index 000000000000..3eed44eb98b4
--- /dev/null
+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
@@ -0,0 +1,2746 @@
1/*
2 * sh73a0 processor support - PFC hardware block
3 *
4 * Copyright (C) 2010 Renesas Solutions Corp.
5 * Copyright (C) 2010 NISHIMOTO Hiroki
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; version 2 of the
10 * License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#include <linux/init.h>
22#include <linux/kernel.h>
23#include <linux/gpio.h>
24#include <mach/sh73a0.h>
25
26#define _1(fn, pfx, sfx) fn(pfx, sfx)
27
28#define _10(fn, pfx, sfx) \
29 _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
30 _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
31 _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
32 _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
33 _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
34
35#define _310(fn, pfx, sfx) \
36 _10(fn, pfx, sfx), _10(fn, pfx##1, sfx), \
37 _10(fn, pfx##2, sfx), _10(fn, pfx##3, sfx), \
38 _10(fn, pfx##4, sfx), _10(fn, pfx##5, sfx), \
39 _10(fn, pfx##6, sfx), _10(fn, pfx##7, sfx), \
40 _10(fn, pfx##8, sfx), _10(fn, pfx##9, sfx), \
41 _10(fn, pfx##10, sfx), \
42 _1(fn, pfx##110, sfx), _1(fn, pfx##111, sfx), \
43 _1(fn, pfx##112, sfx), _1(fn, pfx##113, sfx), \
44 _1(fn, pfx##114, sfx), _1(fn, pfx##115, sfx), \
45 _1(fn, pfx##116, sfx), _1(fn, pfx##117, sfx), \
46 _1(fn, pfx##118, sfx), \
47 _1(fn, pfx##128, sfx), _1(fn, pfx##129, sfx), \
48 _10(fn, pfx##13, sfx), _10(fn, pfx##14, sfx), \
49 _10(fn, pfx##15, sfx), \
50 _1(fn, pfx##160, sfx), _1(fn, pfx##161, sfx), \
51 _1(fn, pfx##162, sfx), _1(fn, pfx##163, sfx), \
52 _1(fn, pfx##164, sfx), \
53 _1(fn, pfx##192, sfx), _1(fn, pfx##193, sfx), \
54 _1(fn, pfx##194, sfx), _1(fn, pfx##195, sfx), \
55 _1(fn, pfx##196, sfx), _1(fn, pfx##197, sfx), \
56 _1(fn, pfx##198, sfx), _1(fn, pfx##199, sfx), \
57 _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \
58 _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \
59 _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \
60 _10(fn, pfx##26, sfx), _10(fn, pfx##27, sfx), \
61 _1(fn, pfx##280, sfx), _1(fn, pfx##281, sfx), \
62 _1(fn, pfx##282, sfx), \
63 _1(fn, pfx##288, sfx), _1(fn, pfx##289, sfx), \
64 _10(fn, pfx##29, sfx), _10(fn, pfx##30, sfx)
65
66#define _PORT(pfx, sfx) pfx##_##sfx
67#define PORT_310(str) _310(_PORT, PORT, str)
68
69enum {
70 PINMUX_RESERVED = 0,
71
72 PINMUX_DATA_BEGIN,
73 PORT_310(DATA), /* PORT0_DATA -> PORT309_DATA */
74 PINMUX_DATA_END,
75
76 PINMUX_INPUT_BEGIN,
77 PORT_310(IN), /* PORT0_IN -> PORT309_IN */
78 PINMUX_INPUT_END,
79
80 PINMUX_INPUT_PULLUP_BEGIN,
81 PORT_310(IN_PU), /* PORT0_IN_PU -> PORT309_IN_PU */
82 PINMUX_INPUT_PULLUP_END,
83
84 PINMUX_INPUT_PULLDOWN_BEGIN,
85 PORT_310(IN_PD), /* PORT0_IN_PD -> PORT309_IN_PD */
86 PINMUX_INPUT_PULLDOWN_END,
87
88 PINMUX_OUTPUT_BEGIN,
89 PORT_310(OUT), /* PORT0_OUT -> PORT309_OUT */
90 PINMUX_OUTPUT_END,
91
92 PINMUX_FUNCTION_BEGIN,
93 PORT_310(FN_IN), /* PORT0_FN_IN -> PORT309_FN_IN */
94 PORT_310(FN_OUT), /* PORT0_FN_OUT -> PORT309_FN_OUT */
95 PORT_310(FN0), /* PORT0_FN0 -> PORT309_FN0 */
96 PORT_310(FN1), /* PORT0_FN1 -> PORT309_FN1 */
97 PORT_310(FN2), /* PORT0_FN2 -> PORT309_FN2 */
98 PORT_310(FN3), /* PORT0_FN3 -> PORT309_FN3 */
99 PORT_310(FN4), /* PORT0_FN4 -> PORT309_FN4 */
100 PORT_310(FN5), /* PORT0_FN5 -> PORT309_FN5 */
101 PORT_310(FN6), /* PORT0_FN6 -> PORT309_FN6 */
102 PORT_310(FN7), /* PORT0_FN7 -> PORT309_FN7 */
103
104 MSEL2CR_MSEL19_0, MSEL2CR_MSEL19_1,
105 MSEL2CR_MSEL18_0, MSEL2CR_MSEL18_1,
106 MSEL2CR_MSEL17_0, MSEL2CR_MSEL17_1,
107 MSEL2CR_MSEL16_0, MSEL2CR_MSEL16_1,
108 MSEL2CR_MSEL14_0, MSEL2CR_MSEL14_1,
109 MSEL2CR_MSEL13_0, MSEL2CR_MSEL13_1,
110 MSEL2CR_MSEL12_0, MSEL2CR_MSEL12_1,
111 MSEL2CR_MSEL11_0, MSEL2CR_MSEL11_1,
112 MSEL2CR_MSEL10_0, MSEL2CR_MSEL10_1,
113 MSEL2CR_MSEL9_0, MSEL2CR_MSEL9_1,
114 MSEL2CR_MSEL8_0, MSEL2CR_MSEL8_1,
115 MSEL2CR_MSEL7_0, MSEL2CR_MSEL7_1,
116 MSEL2CR_MSEL6_0, MSEL2CR_MSEL6_1,
117 MSEL2CR_MSEL4_0, MSEL2CR_MSEL4_1,
118 MSEL2CR_MSEL5_0, MSEL2CR_MSEL5_1,
119 MSEL2CR_MSEL3_0, MSEL2CR_MSEL3_1,
120 MSEL2CR_MSEL2_0, MSEL2CR_MSEL2_1,
121 MSEL2CR_MSEL1_0, MSEL2CR_MSEL1_1,
122 MSEL2CR_MSEL0_0, MSEL2CR_MSEL0_1,
123 MSEL3CR_MSEL28_0, MSEL3CR_MSEL28_1,
124 MSEL3CR_MSEL15_0, MSEL3CR_MSEL15_1,
125 MSEL3CR_MSEL11_0, MSEL3CR_MSEL11_1,
126 MSEL3CR_MSEL9_0, MSEL3CR_MSEL9_1,
127 MSEL3CR_MSEL6_0, MSEL3CR_MSEL6_1,
128 MSEL3CR_MSEL2_0, MSEL3CR_MSEL2_1,
129 MSEL4CR_MSEL29_0, MSEL4CR_MSEL29_1,
130 MSEL4CR_MSEL27_0, MSEL4CR_MSEL27_1,
131 MSEL4CR_MSEL26_0, MSEL4CR_MSEL26_1,
132 MSEL4CR_MSEL22_0, MSEL4CR_MSEL22_1,
133 MSEL4CR_MSEL21_0, MSEL4CR_MSEL21_1,
134 MSEL4CR_MSEL20_0, MSEL4CR_MSEL20_1,
135 MSEL4CR_MSEL19_0, MSEL4CR_MSEL19_1,
136 MSEL4CR_MSEL15_0, MSEL4CR_MSEL15_1,
137 MSEL4CR_MSEL13_0, MSEL4CR_MSEL13_1,
138 MSEL4CR_MSEL12_0, MSEL4CR_MSEL12_1,
139 MSEL4CR_MSEL11_0, MSEL4CR_MSEL11_1,
140 MSEL4CR_MSEL10_0, MSEL4CR_MSEL10_1,
141 MSEL4CR_MSEL9_0, MSEL4CR_MSEL9_1,
142 MSEL4CR_MSEL8_0, MSEL4CR_MSEL8_1,
143 MSEL4CR_MSEL7_0, MSEL4CR_MSEL7_1,
144 MSEL4CR_MSEL4_0, MSEL4CR_MSEL4_1,
145 MSEL4CR_MSEL1_0, MSEL4CR_MSEL1_1,
146 PINMUX_FUNCTION_END,
147
148 PINMUX_MARK_BEGIN,
149 /* Hardware manual Table 25-1 (Function 0-7) */
150 VBUS_0_MARK,
151 GPI0_MARK,
152 GPI1_MARK,
153 GPI2_MARK,
154 GPI3_MARK,
155 GPI4_MARK,
156 GPI5_MARK,
157 GPI6_MARK,
158 GPI7_MARK,
159 SCIFA7_RXD_MARK,
160 SCIFA7_CTS__MARK,
161 GPO7_MARK, MFG0_OUT2_MARK,
162 GPO6_MARK, MFG1_OUT2_MARK,
163 GPO5_MARK, SCIFA0_SCK_MARK, FSICOSLDT3_MARK, PORT16_VIO_CKOR_MARK,
164 SCIFA0_TXD_MARK,
165 SCIFA7_TXD_MARK,
166 SCIFA7_RTS__MARK, PORT19_VIO_CKO2_MARK,
167 GPO0_MARK,
168 GPO1_MARK,
169 GPO2_MARK, STATUS0_MARK,
170 GPO3_MARK, STATUS1_MARK,
171 GPO4_MARK, STATUS2_MARK,
172 VINT_MARK,
173 TCKON_MARK,
174 XDVFS1_MARK, PORT27_I2C_SCL2_MARK, PORT27_I2C_SCL3_MARK, \
175 MFG0_OUT1_MARK, PORT27_IROUT_MARK,
176 XDVFS2_MARK, PORT28_I2C_SDA2_MARK, PORT28_I2C_SDA3_MARK, \
177 PORT28_TPU1TO1_MARK,
178 SIM_RST_MARK, PORT29_TPU1TO1_MARK,
179 SIM_CLK_MARK, PORT30_VIO_CKOR_MARK,
180 SIM_D_MARK, PORT31_IROUT_MARK,
181 SCIFA4_TXD_MARK,
182 SCIFA4_RXD_MARK, XWUP_MARK,
183 SCIFA4_RTS__MARK,
184 SCIFA4_CTS__MARK,
185 FSIBOBT_MARK, FSIBIBT_MARK,
186 FSIBOLR_MARK, FSIBILR_MARK,
187 FSIBOSLD_MARK,
188 FSIBISLD_MARK,
189 VACK_MARK,
190 XTAL1L_MARK,
191 SCIFA0_RTS__MARK, FSICOSLDT2_MARK,
192 SCIFA0_RXD_MARK,
193 SCIFA0_CTS__MARK, FSICOSLDT1_MARK,
194 FSICOBT_MARK, FSICIBT_MARK, FSIDOBT_MARK, FSIDIBT_MARK,
195 FSICOLR_MARK, FSICILR_MARK, FSIDOLR_MARK, FSIDILR_MARK,
196 FSICOSLD_MARK, PORT47_FSICSPDIF_MARK,
197 FSICISLD_MARK, FSIDISLD_MARK,
198 FSIACK_MARK, PORT49_IRDA_OUT_MARK, PORT49_IROUT_MARK, FSIAOMC_MARK,
199 FSIAOLR_MARK, BBIF2_TSYNC2_MARK, TPU2TO2_MARK, FSIAILR_MARK,
200
201 FSIAOBT_MARK, BBIF2_TSCK2_MARK, TPU2TO3_MARK, FSIAIBT_MARK,
202 FSIAOSLD_MARK, BBIF2_TXD2_MARK,
203 FSIASPDIF_MARK, PORT53_IRDA_IN_MARK, TPU3TO3_MARK, FSIBSPDIF_MARK, \
204 PORT53_FSICSPDIF_MARK,
205 FSIBCK_MARK, PORT54_IRDA_FIRSEL_MARK, TPU3TO2_MARK, FSIBOMC_MARK, \
206 FSICCK_MARK, FSICOMC_MARK,
207 FSIAISLD_MARK, TPU0TO0_MARK,
208 A0_MARK, BS__MARK,
209 A12_MARK, PORT58_KEYOUT7_MARK, TPU4TO2_MARK,
210 A13_MARK, PORT59_KEYOUT6_MARK, TPU0TO1_MARK,
211 A14_MARK, KEYOUT5_MARK,
212 A15_MARK, KEYOUT4_MARK,
213 A16_MARK, KEYOUT3_MARK, MSIOF0_SS1_MARK,
214 A17_MARK, KEYOUT2_MARK, MSIOF0_TSYNC_MARK,
215 A18_MARK, KEYOUT1_MARK, MSIOF0_TSCK_MARK,
216 A19_MARK, KEYOUT0_MARK, MSIOF0_TXD_MARK,
217 A20_MARK, KEYIN0_MARK, MSIOF0_RSCK_MARK,
218 A21_MARK, KEYIN1_MARK, MSIOF0_RSYNC_MARK,
219 A22_MARK, KEYIN2_MARK, MSIOF0_MCK0_MARK,
220 A23_MARK, KEYIN3_MARK, MSIOF0_MCK1_MARK,
221 A24_MARK, KEYIN4_MARK, MSIOF0_RXD_MARK,
222 A25_MARK, KEYIN5_MARK, MSIOF0_SS2_MARK,
223 A26_MARK, KEYIN6_MARK,
224 KEYIN7_MARK,
225 D0_NAF0_MARK,
226 D1_NAF1_MARK,
227 D2_NAF2_MARK,
228 D3_NAF3_MARK,
229 D4_NAF4_MARK,
230 D5_NAF5_MARK,
231 D6_NAF6_MARK,
232 D7_NAF7_MARK,
233 D8_NAF8_MARK,
234 D9_NAF9_MARK,
235 D10_NAF10_MARK,
236 D11_NAF11_MARK,
237 D12_NAF12_MARK,
238 D13_NAF13_MARK,
239 D14_NAF14_MARK,
240 D15_NAF15_MARK,
241 CS4__MARK,
242 CS5A__MARK, PORT91_RDWR_MARK,
243 CS5B__MARK, FCE1__MARK,
244 CS6B__MARK, DACK0_MARK,
245 FCE0__MARK, CS6A__MARK,
246 WAIT__MARK, DREQ0_MARK,
247 RD__FSC_MARK,
248 WE0__FWE_MARK, RDWR_FWE_MARK,
249 WE1__MARK,
250 FRB_MARK,
251 CKO_MARK,
252 NBRSTOUT__MARK,
253 NBRST__MARK,
254 BBIF2_TXD_MARK,
255 BBIF2_RXD_MARK,
256 BBIF2_SYNC_MARK,
257 BBIF2_SCK_MARK,
258 SCIFA3_CTS__MARK, MFG3_IN2_MARK,
259 SCIFA3_RXD_MARK, MFG3_IN1_MARK,
260 BBIF1_SS2_MARK, SCIFA3_RTS__MARK, MFG3_OUT1_MARK,
261 SCIFA3_TXD_MARK,
262 HSI_RX_DATA_MARK, BBIF1_RXD_MARK,
263 HSI_TX_WAKE_MARK, BBIF1_TSCK_MARK,
264 HSI_TX_DATA_MARK, BBIF1_TSYNC_MARK,
265 HSI_TX_READY_MARK, BBIF1_TXD_MARK,
266 HSI_RX_READY_MARK, BBIF1_RSCK_MARK, PORT115_I2C_SCL2_MARK, \
267 PORT115_I2C_SCL3_MARK,
268 HSI_RX_WAKE_MARK, BBIF1_RSYNC_MARK, PORT116_I2C_SDA2_MARK, \
269 PORT116_I2C_SDA3_MARK,
270 HSI_RX_FLAG_MARK, BBIF1_SS1_MARK, BBIF1_FLOW_MARK,
271 HSI_TX_FLAG_MARK,
272 VIO_VD_MARK, PORT128_LCD2VSYN_MARK, VIO2_VD_MARK, LCD2D0_MARK,
273
274 VIO_HD_MARK, PORT129_LCD2HSYN_MARK, PORT129_LCD2CS__MARK, \
275 VIO2_HD_MARK, LCD2D1_MARK,
276 VIO_D0_MARK, PORT130_MSIOF2_RXD_MARK, LCD2D10_MARK,
277 VIO_D1_MARK, PORT131_KEYOUT6_MARK, PORT131_MSIOF2_SS1_MARK, \
278 PORT131_KEYOUT11_MARK, LCD2D11_MARK,
279 VIO_D2_MARK, PORT132_KEYOUT7_MARK, PORT132_MSIOF2_SS2_MARK, \
280 PORT132_KEYOUT10_MARK, LCD2D12_MARK,
281 VIO_D3_MARK, MSIOF2_TSYNC_MARK, LCD2D13_MARK,
282 VIO_D4_MARK, MSIOF2_TXD_MARK, LCD2D14_MARK,
283 VIO_D5_MARK, MSIOF2_TSCK_MARK, LCD2D15_MARK,
284 VIO_D6_MARK, PORT136_KEYOUT8_MARK, LCD2D16_MARK,
285 VIO_D7_MARK, PORT137_KEYOUT9_MARK, LCD2D17_MARK,
286 VIO_D8_MARK, PORT138_KEYOUT8_MARK, VIO2_D0_MARK, LCD2D6_MARK,
287 VIO_D9_MARK, PORT139_KEYOUT9_MARK, VIO2_D1_MARK, LCD2D7_MARK,
288 VIO_D10_MARK, TPU0TO2_MARK, VIO2_D2_MARK, LCD2D8_MARK,
289 VIO_D11_MARK, TPU0TO3_MARK, VIO2_D3_MARK, LCD2D9_MARK,
290 VIO_D12_MARK, PORT142_KEYOUT10_MARK, VIO2_D4_MARK, LCD2D2_MARK,
291 VIO_D13_MARK, PORT143_KEYOUT11_MARK, PORT143_KEYOUT6_MARK, \
292 VIO2_D5_MARK, LCD2D3_MARK,
293 VIO_D14_MARK, PORT144_KEYOUT7_MARK, VIO2_D6_MARK, LCD2D4_MARK,
294 VIO_D15_MARK, TPU1TO3_MARK, PORT145_LCD2DISP_MARK, \
295 PORT145_LCD2RS_MARK, VIO2_D7_MARK, LCD2D5_MARK,
296 VIO_CLK_MARK, LCD2DCK_MARK, PORT146_LCD2WR__MARK, VIO2_CLK_MARK, \
297 LCD2D18_MARK,
298 VIO_FIELD_MARK, LCD2RD__MARK, VIO2_FIELD_MARK, LCD2D19_MARK,
299 VIO_CKO_MARK,
300 A27_MARK, PORT149_RDWR_MARK, MFG0_IN1_MARK, PORT149_KEYOUT9_MARK,
301 MFG0_IN2_MARK,
302 TS_SPSYNC3_MARK, MSIOF2_RSCK_MARK,
303 TS_SDAT3_MARK, MSIOF2_RSYNC_MARK,
304 TPU1TO2_MARK, TS_SDEN3_MARK, PORT153_MSIOF2_SS1_MARK,
305 SCIFA2_TXD1_MARK, MSIOF2_MCK0_MARK,
306 SCIFA2_RXD1_MARK, MSIOF2_MCK1_MARK,
307 SCIFA2_RTS1__MARK, PORT156_MSIOF2_SS2_MARK,
308 SCIFA2_CTS1__MARK, PORT157_MSIOF2_RXD_MARK,
309 DINT__MARK, SCIFA2_SCK1_MARK, TS_SCK3_MARK,
310 PORT159_SCIFB_SCK_MARK, PORT159_SCIFA5_SCK_MARK, NMI_MARK,
311 PORT160_SCIFB_TXD_MARK, PORT160_SCIFA5_TXD_MARK,
312 PORT161_SCIFB_CTS__MARK, PORT161_SCIFA5_CTS__MARK,
313 PORT162_SCIFB_RXD_MARK, PORT162_SCIFA5_RXD_MARK,
314 PORT163_SCIFB_RTS__MARK, PORT163_SCIFA5_RTS__MARK, TPU3TO0_MARK,
315 LCDD0_MARK,
316 LCDD1_MARK, PORT193_SCIFA5_CTS__MARK, BBIF2_TSYNC1_MARK,
317 LCDD2_MARK, PORT194_SCIFA5_RTS__MARK, BBIF2_TSCK1_MARK,
318 LCDD3_MARK, PORT195_SCIFA5_RXD_MARK, BBIF2_TXD1_MARK,
319 LCDD4_MARK, PORT196_SCIFA5_TXD_MARK,
320 LCDD5_MARK, PORT197_SCIFA5_SCK_MARK, MFG2_OUT2_MARK, TPU2TO1_MARK,
321 LCDD6_MARK,
322 LCDD7_MARK, TPU4TO1_MARK, MFG4_OUT2_MARK,
323 LCDD8_MARK, D16_MARK,
324 LCDD9_MARK, D17_MARK,
325 LCDD10_MARK, D18_MARK,
326 LCDD11_MARK, D19_MARK,
327 LCDD12_MARK, D20_MARK,
328 LCDD13_MARK, D21_MARK,
329 LCDD14_MARK, D22_MARK,
330 LCDD15_MARK, PORT207_MSIOF0L_SS1_MARK, D23_MARK,
331 LCDD16_MARK, PORT208_MSIOF0L_SS2_MARK, D24_MARK,
332 LCDD17_MARK, D25_MARK,
333 LCDD18_MARK, DREQ2_MARK, PORT210_MSIOF0L_SS1_MARK, D26_MARK,
334 LCDD19_MARK, PORT211_MSIOF0L_SS2_MARK, D27_MARK,
335 LCDD20_MARK, TS_SPSYNC1_MARK, MSIOF0L_MCK0_MARK, D28_MARK,
336 LCDD21_MARK, TS_SDAT1_MARK, MSIOF0L_MCK1_MARK, D29_MARK,
337 LCDD22_MARK, TS_SDEN1_MARK, MSIOF0L_RSCK_MARK, D30_MARK,
338 LCDD23_MARK, TS_SCK1_MARK, MSIOF0L_RSYNC_MARK, D31_MARK,
339 LCDDCK_MARK, LCDWR__MARK,
340 LCDRD__MARK, DACK2_MARK, PORT217_LCD2RS_MARK, MSIOF0L_TSYNC_MARK, \
341 VIO2_FIELD3_MARK, PORT217_LCD2DISP_MARK,
342 LCDHSYN_MARK, LCDCS__MARK, LCDCS2__MARK, DACK3_MARK, \
343 PORT218_VIO_CKOR_MARK,
344 LCDDISP_MARK, LCDRS_MARK, PORT219_LCD2WR__MARK, DREQ3_MARK, \
345 MSIOF0L_TSCK_MARK, VIO2_CLK3_MARK, LCD2DCK_2_MARK,
346 LCDVSYN_MARK, LCDVSYN2_MARK,
347 LCDLCLK_MARK, DREQ1_MARK, PORT221_LCD2CS__MARK, PWEN_MARK, \
348 MSIOF0L_RXD_MARK, VIO2_HD3_MARK, PORT221_LCD2HSYN_MARK,
349 LCDDON_MARK, LCDDON2_MARK, DACK1_MARK, OVCN_MARK, MSIOF0L_TXD_MARK, \
350 VIO2_VD3_MARK, PORT222_LCD2VSYN_MARK,
351
352 SCIFA1_TXD_MARK, OVCN2_MARK,
353 EXTLP_MARK, SCIFA1_SCK_MARK, PORT226_VIO_CKO2_MARK,
354 SCIFA1_RTS__MARK, IDIN_MARK,
355 SCIFA1_RXD_MARK,
356 SCIFA1_CTS__MARK, MFG1_IN1_MARK,
357 MSIOF1_TXD_MARK, SCIFA2_TXD2_MARK,
358 MSIOF1_TSYNC_MARK, SCIFA2_CTS2__MARK,
359 MSIOF1_TSCK_MARK, SCIFA2_SCK2_MARK,
360 MSIOF1_RXD_MARK, SCIFA2_RXD2_MARK,
361 MSIOF1_RSCK_MARK, SCIFA2_RTS2__MARK, VIO2_CLK2_MARK, LCD2D20_MARK,
362 MSIOF1_RSYNC_MARK, MFG1_IN2_MARK, VIO2_VD2_MARK, LCD2D21_MARK,
363 MSIOF1_MCK0_MARK, PORT236_I2C_SDA2_MARK,
364 MSIOF1_MCK1_MARK, PORT237_I2C_SCL2_MARK,
365 MSIOF1_SS1_MARK, VIO2_FIELD2_MARK, LCD2D22_MARK,
366 MSIOF1_SS2_MARK, VIO2_HD2_MARK, LCD2D23_MARK,
367 SCIFA6_TXD_MARK,
368 PORT241_IRDA_OUT_MARK, PORT241_IROUT_MARK, MFG4_OUT1_MARK, TPU4TO0_MARK,
369 PORT242_IRDA_IN_MARK, MFG4_IN2_MARK,
370 PORT243_IRDA_FIRSEL_MARK, PORT243_VIO_CKO2_MARK,
371 PORT244_SCIFA5_CTS__MARK, MFG2_IN1_MARK, PORT244_SCIFB_CTS__MARK, \
372 MSIOF2R_RXD_MARK,
373 PORT245_SCIFA5_RTS__MARK, MFG2_IN2_MARK, PORT245_SCIFB_RTS__MARK, \
374 MSIOF2R_TXD_MARK,
375 PORT246_SCIFA5_RXD_MARK, MFG1_OUT1_MARK, PORT246_SCIFB_RXD_MARK, \
376 TPU1TO0_MARK,
377 PORT247_SCIFA5_TXD_MARK, MFG3_OUT2_MARK, PORT247_SCIFB_TXD_MARK, \
378 TPU3TO1_MARK,
379 PORT248_SCIFA5_SCK_MARK, MFG2_OUT1_MARK, PORT248_SCIFB_SCK_MARK, \
380 TPU2TO0_MARK, PORT248_I2C_SCL3_MARK, MSIOF2R_TSCK_MARK,
381 PORT249_IROUT_MARK, MFG4_IN1_MARK, PORT249_I2C_SDA3_MARK, \
382 MSIOF2R_TSYNC_MARK,
383 SDHICLK0_MARK,
384 SDHICD0_MARK,
385 SDHID0_0_MARK,
386 SDHID0_1_MARK,
387 SDHID0_2_MARK,
388 SDHID0_3_MARK,
389 SDHICMD0_MARK,
390 SDHIWP0_MARK,
391 SDHICLK1_MARK,
392 SDHID1_0_MARK, TS_SPSYNC2_MARK,
393 SDHID1_1_MARK, TS_SDAT2_MARK,
394 SDHID1_2_MARK, TS_SDEN2_MARK,
395 SDHID1_3_MARK, TS_SCK2_MARK,
396 SDHICMD1_MARK,
397 SDHICLK2_MARK,
398 SDHID2_0_MARK, TS_SPSYNC4_MARK,
399 SDHID2_1_MARK, TS_SDAT4_MARK,
400 SDHID2_2_MARK, TS_SDEN4_MARK,
401 SDHID2_3_MARK, TS_SCK4_MARK,
402 SDHICMD2_MARK,
403 MMCCLK0_MARK,
404 MMCD0_0_MARK,
405 MMCD0_1_MARK,
406 MMCD0_2_MARK,
407 MMCD0_3_MARK,
408 MMCD0_4_MARK, TS_SPSYNC5_MARK,
409 MMCD0_5_MARK, TS_SDAT5_MARK,
410 MMCD0_6_MARK, TS_SDEN5_MARK,
411 MMCD0_7_MARK, TS_SCK5_MARK,
412 MMCCMD0_MARK,
413 RESETOUTS__MARK, EXTAL2OUT_MARK,
414 MCP_WAIT__MCP_FRB_MARK,
415 MCP_CKO_MARK, MMCCLK1_MARK,
416 MCP_D15_MCP_NAF15_MARK,
417 MCP_D14_MCP_NAF14_MARK,
418 MCP_D13_MCP_NAF13_MARK,
419 MCP_D12_MCP_NAF12_MARK,
420 MCP_D11_MCP_NAF11_MARK,
421 MCP_D10_MCP_NAF10_MARK,
422 MCP_D9_MCP_NAF9_MARK,
423 MCP_D8_MCP_NAF8_MARK, MMCCMD1_MARK,
424 MCP_D7_MCP_NAF7_MARK, MMCD1_7_MARK,
425
426 MCP_D6_MCP_NAF6_MARK, MMCD1_6_MARK,
427 MCP_D5_MCP_NAF5_MARK, MMCD1_5_MARK,
428 MCP_D4_MCP_NAF4_MARK, MMCD1_4_MARK,
429 MCP_D3_MCP_NAF3_MARK, MMCD1_3_MARK,
430 MCP_D2_MCP_NAF2_MARK, MMCD1_2_MARK,
431 MCP_D1_MCP_NAF1_MARK, MMCD1_1_MARK,
432 MCP_D0_MCP_NAF0_MARK, MMCD1_0_MARK,
433 MCP_NBRSTOUT__MARK,
434 MCP_WE0__MCP_FWE_MARK, MCP_RDWR_MCP_FWE_MARK,
435
436 /* MSEL2 special cases */
437 TSIF2_TS_XX1_MARK,
438 TSIF2_TS_XX2_MARK,
439 TSIF2_TS_XX3_MARK,
440 TSIF2_TS_XX4_MARK,
441 TSIF2_TS_XX5_MARK,
442 TSIF1_TS_XX1_MARK,
443 TSIF1_TS_XX2_MARK,
444 TSIF1_TS_XX3_MARK,
445 TSIF1_TS_XX4_MARK,
446 TSIF1_TS_XX5_MARK,
447 TSIF0_TS_XX1_MARK,
448 TSIF0_TS_XX2_MARK,
449 TSIF0_TS_XX3_MARK,
450 TSIF0_TS_XX4_MARK,
451 TSIF0_TS_XX5_MARK,
452 MST1_TS_XX1_MARK,
453 MST1_TS_XX2_MARK,
454 MST1_TS_XX3_MARK,
455 MST1_TS_XX4_MARK,
456 MST1_TS_XX5_MARK,
457 MST0_TS_XX1_MARK,
458 MST0_TS_XX2_MARK,
459 MST0_TS_XX3_MARK,
460 MST0_TS_XX4_MARK,
461 MST0_TS_XX5_MARK,
462
463 /* MSEL3 special cases */
464 SDHI0_VCCQ_MC0_ON_MARK,
465 SDHI0_VCCQ_MC0_OFF_MARK,
466 DEBUG_MON_VIO_MARK,
467 DEBUG_MON_LCDD_MARK,
468 LCDC_LCDC0_MARK,
469 LCDC_LCDC1_MARK,
470
471 /* MSEL4 special cases */
472 IRQ9_MEM_INT_MARK,
473 IRQ9_MCP_INT_MARK,
474 A11_MARK,
475 KEYOUT8_MARK,
476 TPU4TO3_MARK,
477 RESETA_N_PU_ON_MARK,
478 RESETA_N_PU_OFF_MARK,
479 EDBGREQ_PD_MARK,
480 EDBGREQ_PU_MARK,
481
482 /* Functions with pull-ups */
483 KEYIN0_PU_MARK,
484 KEYIN1_PU_MARK,
485 KEYIN2_PU_MARK,
486 KEYIN3_PU_MARK,
487 KEYIN4_PU_MARK,
488 KEYIN5_PU_MARK,
489 KEYIN6_PU_MARK,
490 KEYIN7_PU_MARK,
491 SDHID1_0_PU_MARK,
492 SDHID1_1_PU_MARK,
493 SDHID1_2_PU_MARK,
494 SDHID1_3_PU_MARK,
495 SDHICMD1_PU_MARK,
496 MMCCMD0_PU_MARK,
497 MMCCMD1_PU_MARK,
498 FSIACK_PU_MARK,
499 FSIAILR_PU_MARK,
500 FSIAIBT_PU_MARK,
501 FSIAISLD_PU_MARK,
502
503 PINMUX_MARK_END,
504};
505
506#define PORT_DATA_I(nr) \
507 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
508
509#define PORT_DATA_I_PD(nr) \
510 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
511 PORT##nr##_IN, PORT##nr##_IN_PD)
512
513#define PORT_DATA_I_PU(nr) \
514 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
515 PORT##nr##_IN, PORT##nr##_IN_PU)
516
517#define PORT_DATA_I_PU_PD(nr) \
518 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
519 PORT##nr##_IN, PORT##nr##_IN_PD, \
520 PORT##nr##_IN_PU)
521
522#define PORT_DATA_O(nr) \
523 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
524 PORT##nr##_OUT)
525
526#define PORT_DATA_IO(nr) \
527 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
528 PORT##nr##_OUT, PORT##nr##_IN)
529
530#define PORT_DATA_IO_PD(nr) \
531 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
532 PORT##nr##_OUT, PORT##nr##_IN, \
533 PORT##nr##_IN_PD)
534
535#define PORT_DATA_IO_PU(nr) \
536 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
537 PORT##nr##_OUT, PORT##nr##_IN, \
538 PORT##nr##_IN_PU)
539
540#define PORT_DATA_IO_PU_PD(nr) \
541 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
542 PORT##nr##_OUT, PORT##nr##_IN, \
543 PORT##nr##_IN_PD, PORT##nr##_IN_PU)
544
545static pinmux_enum_t pinmux_data[] = {
546 /* specify valid pin states for each pin in GPIO mode */
547
548 /* Table 25-1 (I/O and Pull U/D) */
549 PORT_DATA_I_PD(0),
550 PORT_DATA_I_PU(1),
551 PORT_DATA_I_PU(2),
552 PORT_DATA_I_PU(3),
553 PORT_DATA_I_PU(4),
554 PORT_DATA_I_PU(5),
555 PORT_DATA_I_PU(6),
556 PORT_DATA_I_PU(7),
557 PORT_DATA_I_PU(8),
558 PORT_DATA_I_PD(9),
559 PORT_DATA_I_PD(10),
560 PORT_DATA_I_PU_PD(11),
561 PORT_DATA_IO_PU_PD(12),
562 PORT_DATA_IO_PU_PD(13),
563 PORT_DATA_IO_PU_PD(14),
564 PORT_DATA_IO_PU_PD(15),
565 PORT_DATA_IO_PD(16),
566 PORT_DATA_IO_PD(17),
567 PORT_DATA_IO_PU(18),
568 PORT_DATA_IO_PU(19),
569 PORT_DATA_O(20),
570 PORT_DATA_O(21),
571 PORT_DATA_O(22),
572 PORT_DATA_O(23),
573 PORT_DATA_O(24),
574 PORT_DATA_I_PD(25),
575 PORT_DATA_I_PD(26),
576 PORT_DATA_IO_PU(27),
577 PORT_DATA_IO_PU(28),
578 PORT_DATA_IO_PD(29),
579 PORT_DATA_IO_PD(30),
580 PORT_DATA_IO_PU(31),
581 PORT_DATA_IO_PD(32),
582 PORT_DATA_I_PU_PD(33),
583 PORT_DATA_IO_PD(34),
584 PORT_DATA_I_PU_PD(35),
585 PORT_DATA_IO_PD(36),
586 PORT_DATA_IO(37),
587 PORT_DATA_O(38),
588 PORT_DATA_I_PU(39),
589 PORT_DATA_I_PU_PD(40),
590 PORT_DATA_O(41),
591 PORT_DATA_IO_PD(42),
592 PORT_DATA_IO_PU_PD(43),
593 PORT_DATA_IO_PU_PD(44),
594 PORT_DATA_IO_PD(45),
595 PORT_DATA_IO_PD(46),
596 PORT_DATA_IO_PD(47),
597 PORT_DATA_I_PD(48),
598 PORT_DATA_IO_PU_PD(49),
599 PORT_DATA_IO_PD(50),
600
601 PORT_DATA_IO_PD(51),
602 PORT_DATA_O(52),
603 PORT_DATA_IO_PU_PD(53),
604 PORT_DATA_IO_PU_PD(54),
605 PORT_DATA_IO_PD(55),
606 PORT_DATA_I_PU_PD(56),
607 PORT_DATA_IO(57),
608 PORT_DATA_IO(58),
609 PORT_DATA_IO(59),
610 PORT_DATA_IO(60),
611 PORT_DATA_IO(61),
612 PORT_DATA_IO_PD(62),
613 PORT_DATA_IO_PD(63),
614 PORT_DATA_IO_PU_PD(64),
615 PORT_DATA_IO_PD(65),
616 PORT_DATA_IO_PU_PD(66),
617 PORT_DATA_IO_PU_PD(67),
618 PORT_DATA_IO_PU_PD(68),
619 PORT_DATA_IO_PU_PD(69),
620 PORT_DATA_IO_PU_PD(70),
621 PORT_DATA_IO_PU_PD(71),
622 PORT_DATA_IO_PU_PD(72),
623 PORT_DATA_I_PU_PD(73),
624 PORT_DATA_IO_PU(74),
625 PORT_DATA_IO_PU(75),
626 PORT_DATA_IO_PU(76),
627 PORT_DATA_IO_PU(77),
628 PORT_DATA_IO_PU(78),
629 PORT_DATA_IO_PU(79),
630 PORT_DATA_IO_PU(80),
631 PORT_DATA_IO_PU(81),
632 PORT_DATA_IO_PU(82),
633 PORT_DATA_IO_PU(83),
634 PORT_DATA_IO_PU(84),
635 PORT_DATA_IO_PU(85),
636 PORT_DATA_IO_PU(86),
637 PORT_DATA_IO_PU(87),
638 PORT_DATA_IO_PU(88),
639 PORT_DATA_IO_PU(89),
640 PORT_DATA_O(90),
641 PORT_DATA_IO_PU(91),
642 PORT_DATA_O(92),
643 PORT_DATA_IO_PU(93),
644 PORT_DATA_O(94),
645 PORT_DATA_I_PU_PD(95),
646 PORT_DATA_IO(96),
647 PORT_DATA_IO(97),
648 PORT_DATA_IO(98),
649 PORT_DATA_I_PU(99),
650 PORT_DATA_O(100),
651 PORT_DATA_O(101),
652 PORT_DATA_I_PU(102),
653 PORT_DATA_IO_PD(103),
654 PORT_DATA_I_PU_PD(104),
655 PORT_DATA_I_PD(105),
656 PORT_DATA_I_PD(106),
657 PORT_DATA_I_PU_PD(107),
658 PORT_DATA_I_PU_PD(108),
659 PORT_DATA_IO_PD(109),
660 PORT_DATA_IO_PD(110),
661 PORT_DATA_IO_PU_PD(111),
662 PORT_DATA_IO_PU_PD(112),
663 PORT_DATA_IO_PU_PD(113),
664 PORT_DATA_IO_PD(114),
665 PORT_DATA_IO_PU(115),
666 PORT_DATA_IO_PU(116),
667 PORT_DATA_IO_PU_PD(117),
668 PORT_DATA_IO_PU_PD(118),
669 PORT_DATA_IO_PD(128),
670
671 PORT_DATA_IO_PD(129),
672 PORT_DATA_IO_PU_PD(130),
673 PORT_DATA_IO_PD(131),
674 PORT_DATA_IO_PD(132),
675 PORT_DATA_IO_PD(133),
676 PORT_DATA_IO_PU_PD(134),
677 PORT_DATA_IO_PU_PD(135),
678 PORT_DATA_IO_PU_PD(136),
679 PORT_DATA_IO_PU_PD(137),
680 PORT_DATA_IO_PD(138),
681 PORT_DATA_IO_PD(139),
682 PORT_DATA_IO_PD(140),
683 PORT_DATA_IO_PD(141),
684 PORT_DATA_IO_PD(142),
685 PORT_DATA_IO_PD(143),
686 PORT_DATA_IO_PU_PD(144),
687 PORT_DATA_IO_PD(145),
688 PORT_DATA_IO_PU_PD(146),
689 PORT_DATA_IO_PU_PD(147),
690 PORT_DATA_IO_PU_PD(148),
691 PORT_DATA_IO_PU_PD(149),
692 PORT_DATA_I_PU_PD(150),
693 PORT_DATA_IO_PU_PD(151),
694 PORT_DATA_IO_PU_PD(152),
695 PORT_DATA_IO_PD(153),
696 PORT_DATA_IO_PD(154),
697 PORT_DATA_I_PU_PD(155),
698 PORT_DATA_IO_PU_PD(156),
699 PORT_DATA_I_PD(157),
700 PORT_DATA_IO_PD(158),
701 PORT_DATA_IO_PU_PD(159),
702 PORT_DATA_IO_PU_PD(160),
703 PORT_DATA_I_PU_PD(161),
704 PORT_DATA_I_PU_PD(162),
705 PORT_DATA_IO_PU_PD(163),
706 PORT_DATA_I_PU_PD(164),
707 PORT_DATA_IO_PD(192),
708 PORT_DATA_IO_PU_PD(193),
709 PORT_DATA_IO_PD(194),
710 PORT_DATA_IO_PU_PD(195),
711 PORT_DATA_IO_PD(196),
712 PORT_DATA_IO_PD(197),
713 PORT_DATA_IO_PD(198),
714 PORT_DATA_IO_PD(199),
715 PORT_DATA_IO_PU_PD(200),
716 PORT_DATA_IO_PU_PD(201),
717 PORT_DATA_IO_PU_PD(202),
718 PORT_DATA_IO_PU_PD(203),
719 PORT_DATA_IO_PU_PD(204),
720 PORT_DATA_IO_PU_PD(205),
721 PORT_DATA_IO_PU_PD(206),
722 PORT_DATA_IO_PD(207),
723 PORT_DATA_IO_PD(208),
724 PORT_DATA_IO_PD(209),
725 PORT_DATA_IO_PD(210),
726 PORT_DATA_IO_PD(211),
727 PORT_DATA_IO_PD(212),
728 PORT_DATA_IO_PD(213),
729 PORT_DATA_IO_PU_PD(214),
730 PORT_DATA_IO_PU_PD(215),
731 PORT_DATA_IO_PD(216),
732 PORT_DATA_IO_PD(217),
733 PORT_DATA_O(218),
734 PORT_DATA_IO_PD(219),
735 PORT_DATA_IO_PD(220),
736 PORT_DATA_IO_PU_PD(221),
737 PORT_DATA_IO_PU_PD(222),
738 PORT_DATA_I_PU_PD(223),
739 PORT_DATA_I_PU_PD(224),
740
741 PORT_DATA_IO_PU_PD(225),
742 PORT_DATA_O(226),
743 PORT_DATA_IO_PU_PD(227),
744 PORT_DATA_I_PU_PD(228),
745 PORT_DATA_I_PD(229),
746 PORT_DATA_IO(230),
747 PORT_DATA_IO_PU_PD(231),
748 PORT_DATA_IO_PU_PD(232),
749 PORT_DATA_I_PU_PD(233),
750 PORT_DATA_IO_PU_PD(234),
751 PORT_DATA_IO_PU_PD(235),
752 PORT_DATA_IO_PU_PD(236),
753 PORT_DATA_IO_PD(237),
754 PORT_DATA_IO_PU_PD(238),
755 PORT_DATA_IO_PU_PD(239),
756 PORT_DATA_IO_PU_PD(240),
757 PORT_DATA_O(241),
758 PORT_DATA_I_PD(242),
759 PORT_DATA_IO_PU_PD(243),
760 PORT_DATA_IO_PU_PD(244),
761 PORT_DATA_IO_PU_PD(245),
762 PORT_DATA_IO_PU_PD(246),
763 PORT_DATA_IO_PU_PD(247),
764 PORT_DATA_IO_PU_PD(248),
765 PORT_DATA_IO_PU_PD(249),
766 PORT_DATA_IO_PU_PD(250),
767 PORT_DATA_IO_PU_PD(251),
768 PORT_DATA_IO_PU_PD(252),
769 PORT_DATA_IO_PU_PD(253),
770 PORT_DATA_IO_PU_PD(254),
771 PORT_DATA_IO_PU_PD(255),
772 PORT_DATA_IO_PU_PD(256),
773 PORT_DATA_IO_PU_PD(257),
774 PORT_DATA_IO_PU_PD(258),
775 PORT_DATA_IO_PU_PD(259),
776 PORT_DATA_IO_PU_PD(260),
777 PORT_DATA_IO_PU_PD(261),
778 PORT_DATA_IO_PU_PD(262),
779 PORT_DATA_IO_PU_PD(263),
780 PORT_DATA_IO_PU_PD(264),
781 PORT_DATA_IO_PU_PD(265),
782 PORT_DATA_IO_PU_PD(266),
783 PORT_DATA_IO_PU_PD(267),
784 PORT_DATA_IO_PU_PD(268),
785 PORT_DATA_IO_PU_PD(269),
786 PORT_DATA_IO_PU_PD(270),
787 PORT_DATA_IO_PU_PD(271),
788 PORT_DATA_IO_PU_PD(272),
789 PORT_DATA_IO_PU_PD(273),
790 PORT_DATA_IO_PU_PD(274),
791 PORT_DATA_IO_PU_PD(275),
792 PORT_DATA_IO_PU_PD(276),
793 PORT_DATA_IO_PU_PD(277),
794 PORT_DATA_IO_PU_PD(278),
795 PORT_DATA_IO_PU_PD(279),
796 PORT_DATA_IO_PU_PD(280),
797 PORT_DATA_O(281),
798 PORT_DATA_O(282),
799 PORT_DATA_I_PU(288),
800 PORT_DATA_IO_PU_PD(289),
801 PORT_DATA_IO_PU_PD(290),
802 PORT_DATA_IO_PU_PD(291),
803 PORT_DATA_IO_PU_PD(292),
804 PORT_DATA_IO_PU_PD(293),
805 PORT_DATA_IO_PU_PD(294),
806 PORT_DATA_IO_PU_PD(295),
807 PORT_DATA_IO_PU_PD(296),
808 PORT_DATA_IO_PU_PD(297),
809 PORT_DATA_IO_PU_PD(298),
810
811 PORT_DATA_IO_PU_PD(299),
812 PORT_DATA_IO_PU_PD(300),
813 PORT_DATA_IO_PU_PD(301),
814 PORT_DATA_IO_PU_PD(302),
815 PORT_DATA_IO_PU_PD(303),
816 PORT_DATA_IO_PU_PD(304),
817 PORT_DATA_IO_PU_PD(305),
818 PORT_DATA_O(306),
819 PORT_DATA_O(307),
820 PORT_DATA_I_PU(308),
821 PORT_DATA_O(309),
822
823 /* Table 25-1 (Function 0-7) */
824 PINMUX_DATA(VBUS_0_MARK, PORT0_FN1),
825 PINMUX_DATA(GPI0_MARK, PORT1_FN1),
826 PINMUX_DATA(GPI1_MARK, PORT2_FN1),
827 PINMUX_DATA(GPI2_MARK, PORT3_FN1),
828 PINMUX_DATA(GPI3_MARK, PORT4_FN1),
829 PINMUX_DATA(GPI4_MARK, PORT5_FN1),
830 PINMUX_DATA(GPI5_MARK, PORT6_FN1),
831 PINMUX_DATA(GPI6_MARK, PORT7_FN1),
832 PINMUX_DATA(GPI7_MARK, PORT8_FN1),
833 PINMUX_DATA(SCIFA7_RXD_MARK, PORT12_FN2),
834 PINMUX_DATA(SCIFA7_CTS__MARK, PORT13_FN2),
835 PINMUX_DATA(GPO7_MARK, PORT14_FN1), \
836 PINMUX_DATA(MFG0_OUT2_MARK, PORT14_FN4),
837 PINMUX_DATA(GPO6_MARK, PORT15_FN1), \
838 PINMUX_DATA(MFG1_OUT2_MARK, PORT15_FN4),
839 PINMUX_DATA(GPO5_MARK, PORT16_FN1), \
840 PINMUX_DATA(SCIFA0_SCK_MARK, PORT16_FN2), \
841 PINMUX_DATA(FSICOSLDT3_MARK, PORT16_FN3), \
842 PINMUX_DATA(PORT16_VIO_CKOR_MARK, PORT16_FN4),
843 PINMUX_DATA(SCIFA0_TXD_MARK, PORT17_FN2),
844 PINMUX_DATA(SCIFA7_TXD_MARK, PORT18_FN2),
845 PINMUX_DATA(SCIFA7_RTS__MARK, PORT19_FN2), \
846 PINMUX_DATA(PORT19_VIO_CKO2_MARK, PORT19_FN3),
847 PINMUX_DATA(GPO0_MARK, PORT20_FN1),
848 PINMUX_DATA(GPO1_MARK, PORT21_FN1),
849 PINMUX_DATA(GPO2_MARK, PORT22_FN1), \
850 PINMUX_DATA(STATUS0_MARK, PORT22_FN2),
851 PINMUX_DATA(GPO3_MARK, PORT23_FN1), \
852 PINMUX_DATA(STATUS1_MARK, PORT23_FN2),
853 PINMUX_DATA(GPO4_MARK, PORT24_FN1), \
854 PINMUX_DATA(STATUS2_MARK, PORT24_FN2),
855 PINMUX_DATA(VINT_MARK, PORT25_FN1),
856 PINMUX_DATA(TCKON_MARK, PORT26_FN1),
857 PINMUX_DATA(XDVFS1_MARK, PORT27_FN1), \
858 PINMUX_DATA(PORT27_I2C_SCL2_MARK, PORT27_FN2, MSEL2CR_MSEL17_0,
859 MSEL2CR_MSEL16_1), \
860 PINMUX_DATA(PORT27_I2C_SCL3_MARK, PORT27_FN3, MSEL2CR_MSEL19_0,
861 MSEL2CR_MSEL18_0), \
862 PINMUX_DATA(MFG0_OUT1_MARK, PORT27_FN4), \
863 PINMUX_DATA(PORT27_IROUT_MARK, PORT27_FN7),
864 PINMUX_DATA(XDVFS2_MARK, PORT28_FN1), \
865 PINMUX_DATA(PORT28_I2C_SDA2_MARK, PORT28_FN2, MSEL2CR_MSEL17_0,
866 MSEL2CR_MSEL16_1), \
867 PINMUX_DATA(PORT28_I2C_SDA3_MARK, PORT28_FN3, MSEL2CR_MSEL19_0,
868 MSEL2CR_MSEL18_0), \
869 PINMUX_DATA(PORT28_TPU1TO1_MARK, PORT28_FN7),
870 PINMUX_DATA(SIM_RST_MARK, PORT29_FN1), \
871 PINMUX_DATA(PORT29_TPU1TO1_MARK, PORT29_FN4),
872 PINMUX_DATA(SIM_CLK_MARK, PORT30_FN1), \
873 PINMUX_DATA(PORT30_VIO_CKOR_MARK, PORT30_FN4),
874 PINMUX_DATA(SIM_D_MARK, PORT31_FN1), \
875 PINMUX_DATA(PORT31_IROUT_MARK, PORT31_FN4),
876 PINMUX_DATA(SCIFA4_TXD_MARK, PORT32_FN2),
877 PINMUX_DATA(SCIFA4_RXD_MARK, PORT33_FN2), \
878 PINMUX_DATA(XWUP_MARK, PORT33_FN3),
879 PINMUX_DATA(SCIFA4_RTS__MARK, PORT34_FN2),
880 PINMUX_DATA(SCIFA4_CTS__MARK, PORT35_FN2),
881 PINMUX_DATA(FSIBOBT_MARK, PORT36_FN1), \
882 PINMUX_DATA(FSIBIBT_MARK, PORT36_FN2),
883 PINMUX_DATA(FSIBOLR_MARK, PORT37_FN1), \
884 PINMUX_DATA(FSIBILR_MARK, PORT37_FN2),
885 PINMUX_DATA(FSIBOSLD_MARK, PORT38_FN1),
886 PINMUX_DATA(FSIBISLD_MARK, PORT39_FN1),
887 PINMUX_DATA(VACK_MARK, PORT40_FN1),
888 PINMUX_DATA(XTAL1L_MARK, PORT41_FN1),
889 PINMUX_DATA(SCIFA0_RTS__MARK, PORT42_FN2), \
890 PINMUX_DATA(FSICOSLDT2_MARK, PORT42_FN3),
891 PINMUX_DATA(SCIFA0_RXD_MARK, PORT43_FN2),
892 PINMUX_DATA(SCIFA0_CTS__MARK, PORT44_FN2), \
893 PINMUX_DATA(FSICOSLDT1_MARK, PORT44_FN3),
894 PINMUX_DATA(FSICOBT_MARK, PORT45_FN1), \
895 PINMUX_DATA(FSICIBT_MARK, PORT45_FN2), \
896 PINMUX_DATA(FSIDOBT_MARK, PORT45_FN3), \
897 PINMUX_DATA(FSIDIBT_MARK, PORT45_FN4),
898 PINMUX_DATA(FSICOLR_MARK, PORT46_FN1), \
899 PINMUX_DATA(FSICILR_MARK, PORT46_FN2), \
900 PINMUX_DATA(FSIDOLR_MARK, PORT46_FN3), \
901 PINMUX_DATA(FSIDILR_MARK, PORT46_FN4),
902 PINMUX_DATA(FSICOSLD_MARK, PORT47_FN1), \
903 PINMUX_DATA(PORT47_FSICSPDIF_MARK, PORT47_FN2),
904 PINMUX_DATA(FSICISLD_MARK, PORT48_FN1), \
905 PINMUX_DATA(FSIDISLD_MARK, PORT48_FN3),
906 PINMUX_DATA(FSIACK_MARK, PORT49_FN1), \
907 PINMUX_DATA(PORT49_IRDA_OUT_MARK, PORT49_FN2, MSEL4CR_MSEL19_1), \
908 PINMUX_DATA(PORT49_IROUT_MARK, PORT49_FN4), \
909 PINMUX_DATA(FSIAOMC_MARK, PORT49_FN5),
910 PINMUX_DATA(FSIAOLR_MARK, PORT50_FN1), \
911 PINMUX_DATA(BBIF2_TSYNC2_MARK, PORT50_FN2), \
912 PINMUX_DATA(TPU2TO2_MARK, PORT50_FN3), \
913 PINMUX_DATA(FSIAILR_MARK, PORT50_FN5),
914
915 PINMUX_DATA(FSIAOBT_MARK, PORT51_FN1), \
916 PINMUX_DATA(BBIF2_TSCK2_MARK, PORT51_FN2), \
917 PINMUX_DATA(TPU2TO3_MARK, PORT51_FN3), \
918 PINMUX_DATA(FSIAIBT_MARK, PORT51_FN5),
919 PINMUX_DATA(FSIAOSLD_MARK, PORT52_FN1), \
920 PINMUX_DATA(BBIF2_TXD2_MARK, PORT52_FN2),
921 PINMUX_DATA(FSIASPDIF_MARK, PORT53_FN1), \
922 PINMUX_DATA(PORT53_IRDA_IN_MARK, PORT53_FN2, MSEL4CR_MSEL19_1), \
923 PINMUX_DATA(TPU3TO3_MARK, PORT53_FN3), \
924 PINMUX_DATA(FSIBSPDIF_MARK, PORT53_FN5), \
925 PINMUX_DATA(PORT53_FSICSPDIF_MARK, PORT53_FN6),
926 PINMUX_DATA(FSIBCK_MARK, PORT54_FN1), \
927 PINMUX_DATA(PORT54_IRDA_FIRSEL_MARK, PORT54_FN2, MSEL4CR_MSEL19_1), \
928 PINMUX_DATA(TPU3TO2_MARK, PORT54_FN3), \
929 PINMUX_DATA(FSIBOMC_MARK, PORT54_FN5), \
930 PINMUX_DATA(FSICCK_MARK, PORT54_FN6), \
931 PINMUX_DATA(FSICOMC_MARK, PORT54_FN7),
932 PINMUX_DATA(FSIAISLD_MARK, PORT55_FN1), \
933 PINMUX_DATA(TPU0TO0_MARK, PORT55_FN3),
934 PINMUX_DATA(A0_MARK, PORT57_FN1), \
935 PINMUX_DATA(BS__MARK, PORT57_FN2),
936 PINMUX_DATA(A12_MARK, PORT58_FN1), \
937 PINMUX_DATA(PORT58_KEYOUT7_MARK, PORT58_FN2), \
938 PINMUX_DATA(TPU4TO2_MARK, PORT58_FN4),
939 PINMUX_DATA(A13_MARK, PORT59_FN1), \
940 PINMUX_DATA(PORT59_KEYOUT6_MARK, PORT59_FN2), \
941 PINMUX_DATA(TPU0TO1_MARK, PORT59_FN4),
942 PINMUX_DATA(A14_MARK, PORT60_FN1), \
943 PINMUX_DATA(KEYOUT5_MARK, PORT60_FN2),
944 PINMUX_DATA(A15_MARK, PORT61_FN1), \
945 PINMUX_DATA(KEYOUT4_MARK, PORT61_FN2),
946 PINMUX_DATA(A16_MARK, PORT62_FN1), \
947 PINMUX_DATA(KEYOUT3_MARK, PORT62_FN2), \
948 PINMUX_DATA(MSIOF0_SS1_MARK, PORT62_FN4, MSEL3CR_MSEL11_0),
949 PINMUX_DATA(A17_MARK, PORT63_FN1), \
950 PINMUX_DATA(KEYOUT2_MARK, PORT63_FN2), \
951 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT63_FN4, MSEL3CR_MSEL11_0),
952 PINMUX_DATA(A18_MARK, PORT64_FN1), \
953 PINMUX_DATA(KEYOUT1_MARK, PORT64_FN2), \
954 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT64_FN4, MSEL3CR_MSEL11_0),
955 PINMUX_DATA(A19_MARK, PORT65_FN1), \
956 PINMUX_DATA(KEYOUT0_MARK, PORT65_FN2), \
957 PINMUX_DATA(MSIOF0_TXD_MARK, PORT65_FN4, MSEL3CR_MSEL11_0),
958 PINMUX_DATA(A20_MARK, PORT66_FN1), \
959 PINMUX_DATA(KEYIN0_MARK, PORT66_FN2), \
960 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT66_FN4, MSEL3CR_MSEL11_0),
961 PINMUX_DATA(A21_MARK, PORT67_FN1), \
962 PINMUX_DATA(KEYIN1_MARK, PORT67_FN2), \
963 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT67_FN4, MSEL3CR_MSEL11_0),
964 PINMUX_DATA(A22_MARK, PORT68_FN1), \
965 PINMUX_DATA(KEYIN2_MARK, PORT68_FN2), \
966 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT68_FN4, MSEL3CR_MSEL11_0),
967 PINMUX_DATA(A23_MARK, PORT69_FN1), \
968 PINMUX_DATA(KEYIN3_MARK, PORT69_FN2), \
969 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT69_FN4, MSEL3CR_MSEL11_0),
970 PINMUX_DATA(A24_MARK, PORT70_FN1), \
971 PINMUX_DATA(KEYIN4_MARK, PORT70_FN2), \
972 PINMUX_DATA(MSIOF0_RXD_MARK, PORT70_FN4, MSEL3CR_MSEL11_0),
973 PINMUX_DATA(A25_MARK, PORT71_FN1), \
974 PINMUX_DATA(KEYIN5_MARK, PORT71_FN2), \
975 PINMUX_DATA(MSIOF0_SS2_MARK, PORT71_FN4, MSEL3CR_MSEL11_0),
976 PINMUX_DATA(A26_MARK, PORT72_FN1), \
977 PINMUX_DATA(KEYIN6_MARK, PORT72_FN2),
978 PINMUX_DATA(KEYIN7_MARK, PORT73_FN2),
979 PINMUX_DATA(D0_NAF0_MARK, PORT74_FN1),
980 PINMUX_DATA(D1_NAF1_MARK, PORT75_FN1),
981 PINMUX_DATA(D2_NAF2_MARK, PORT76_FN1),
982 PINMUX_DATA(D3_NAF3_MARK, PORT77_FN1),
983 PINMUX_DATA(D4_NAF4_MARK, PORT78_FN1),
984 PINMUX_DATA(D5_NAF5_MARK, PORT79_FN1),
985 PINMUX_DATA(D6_NAF6_MARK, PORT80_FN1),
986 PINMUX_DATA(D7_NAF7_MARK, PORT81_FN1),
987 PINMUX_DATA(D8_NAF8_MARK, PORT82_FN1),
988 PINMUX_DATA(D9_NAF9_MARK, PORT83_FN1),
989 PINMUX_DATA(D10_NAF10_MARK, PORT84_FN1),
990 PINMUX_DATA(D11_NAF11_MARK, PORT85_FN1),
991 PINMUX_DATA(D12_NAF12_MARK, PORT86_FN1),
992 PINMUX_DATA(D13_NAF13_MARK, PORT87_FN1),
993 PINMUX_DATA(D14_NAF14_MARK, PORT88_FN1),
994 PINMUX_DATA(D15_NAF15_MARK, PORT89_FN1),
995 PINMUX_DATA(CS4__MARK, PORT90_FN1),
996 PINMUX_DATA(CS5A__MARK, PORT91_FN1), \
997 PINMUX_DATA(PORT91_RDWR_MARK, PORT91_FN2),
998 PINMUX_DATA(CS5B__MARK, PORT92_FN1), \
999 PINMUX_DATA(FCE1__MARK, PORT92_FN2),
1000 PINMUX_DATA(CS6B__MARK, PORT93_FN1), \
1001 PINMUX_DATA(DACK0_MARK, PORT93_FN4),
1002 PINMUX_DATA(FCE0__MARK, PORT94_FN1), \
1003 PINMUX_DATA(CS6A__MARK, PORT94_FN2),
1004 PINMUX_DATA(WAIT__MARK, PORT95_FN1), \
1005 PINMUX_DATA(DREQ0_MARK, PORT95_FN2),
1006 PINMUX_DATA(RD__FSC_MARK, PORT96_FN1),
1007 PINMUX_DATA(WE0__FWE_MARK, PORT97_FN1), \
1008 PINMUX_DATA(RDWR_FWE_MARK, PORT97_FN2),
1009 PINMUX_DATA(WE1__MARK, PORT98_FN1),
1010 PINMUX_DATA(FRB_MARK, PORT99_FN1),
1011 PINMUX_DATA(CKO_MARK, PORT100_FN1),
1012 PINMUX_DATA(NBRSTOUT__MARK, PORT101_FN1),
1013 PINMUX_DATA(NBRST__MARK, PORT102_FN1),
1014 PINMUX_DATA(BBIF2_TXD_MARK, PORT103_FN3),
1015 PINMUX_DATA(BBIF2_RXD_MARK, PORT104_FN3),
1016 PINMUX_DATA(BBIF2_SYNC_MARK, PORT105_FN3),
1017 PINMUX_DATA(BBIF2_SCK_MARK, PORT106_FN3),
1018 PINMUX_DATA(SCIFA3_CTS__MARK, PORT107_FN3), \
1019 PINMUX_DATA(MFG3_IN2_MARK, PORT107_FN4),
1020 PINMUX_DATA(SCIFA3_RXD_MARK, PORT108_FN3), \
1021 PINMUX_DATA(MFG3_IN1_MARK, PORT108_FN4),
1022 PINMUX_DATA(BBIF1_SS2_MARK, PORT109_FN2), \
1023 PINMUX_DATA(SCIFA3_RTS__MARK, PORT109_FN3), \
1024 PINMUX_DATA(MFG3_OUT1_MARK, PORT109_FN4),
1025 PINMUX_DATA(SCIFA3_TXD_MARK, PORT110_FN3),
1026 PINMUX_DATA(HSI_RX_DATA_MARK, PORT111_FN1), \
1027 PINMUX_DATA(BBIF1_RXD_MARK, PORT111_FN3),
1028 PINMUX_DATA(HSI_TX_WAKE_MARK, PORT112_FN1), \
1029 PINMUX_DATA(BBIF1_TSCK_MARK, PORT112_FN3),
1030 PINMUX_DATA(HSI_TX_DATA_MARK, PORT113_FN1), \
1031 PINMUX_DATA(BBIF1_TSYNC_MARK, PORT113_FN3),
1032 PINMUX_DATA(HSI_TX_READY_MARK, PORT114_FN1), \
1033 PINMUX_DATA(BBIF1_TXD_MARK, PORT114_FN3),
1034 PINMUX_DATA(HSI_RX_READY_MARK, PORT115_FN1), \
1035 PINMUX_DATA(BBIF1_RSCK_MARK, PORT115_FN3), \
1036 PINMUX_DATA(PORT115_I2C_SCL2_MARK, PORT115_FN5, MSEL2CR_MSEL17_1), \
1037 PINMUX_DATA(PORT115_I2C_SCL3_MARK, PORT115_FN6, MSEL2CR_MSEL19_1),
1038 PINMUX_DATA(HSI_RX_WAKE_MARK, PORT116_FN1), \
1039 PINMUX_DATA(BBIF1_RSYNC_MARK, PORT116_FN3), \
1040 PINMUX_DATA(PORT116_I2C_SDA2_MARK, PORT116_FN5, MSEL2CR_MSEL17_1), \
1041 PINMUX_DATA(PORT116_I2C_SDA3_MARK, PORT116_FN6, MSEL2CR_MSEL19_1),
1042 PINMUX_DATA(HSI_RX_FLAG_MARK, PORT117_FN1), \
1043 PINMUX_DATA(BBIF1_SS1_MARK, PORT117_FN2), \
1044 PINMUX_DATA(BBIF1_FLOW_MARK, PORT117_FN3),
1045 PINMUX_DATA(HSI_TX_FLAG_MARK, PORT118_FN1),
1046 PINMUX_DATA(VIO_VD_MARK, PORT128_FN1), \
1047 PINMUX_DATA(PORT128_LCD2VSYN_MARK, PORT128_FN4, MSEL3CR_MSEL2_0), \
1048 PINMUX_DATA(VIO2_VD_MARK, PORT128_FN6, MSEL4CR_MSEL27_0), \
1049 PINMUX_DATA(LCD2D0_MARK, PORT128_FN7),
1050
1051 PINMUX_DATA(VIO_HD_MARK, PORT129_FN1), \
1052 PINMUX_DATA(PORT129_LCD2HSYN_MARK, PORT129_FN4), \
1053 PINMUX_DATA(PORT129_LCD2CS__MARK, PORT129_FN5), \
1054 PINMUX_DATA(VIO2_HD_MARK, PORT129_FN6, MSEL4CR_MSEL27_0), \
1055 PINMUX_DATA(LCD2D1_MARK, PORT129_FN7),
1056 PINMUX_DATA(VIO_D0_MARK, PORT130_FN1), \
1057 PINMUX_DATA(PORT130_MSIOF2_RXD_MARK, PORT130_FN3, MSEL4CR_MSEL11_0,
1058 MSEL4CR_MSEL10_1), \
1059 PINMUX_DATA(LCD2D10_MARK, PORT130_FN7),
1060 PINMUX_DATA(VIO_D1_MARK, PORT131_FN1), \
1061 PINMUX_DATA(PORT131_KEYOUT6_MARK, PORT131_FN2), \
1062 PINMUX_DATA(PORT131_MSIOF2_SS1_MARK, PORT131_FN3), \
1063 PINMUX_DATA(PORT131_KEYOUT11_MARK, PORT131_FN4), \
1064 PINMUX_DATA(LCD2D11_MARK, PORT131_FN7),
1065 PINMUX_DATA(VIO_D2_MARK, PORT132_FN1), \
1066 PINMUX_DATA(PORT132_KEYOUT7_MARK, PORT132_FN2), \
1067 PINMUX_DATA(PORT132_MSIOF2_SS2_MARK, PORT132_FN3), \
1068 PINMUX_DATA(PORT132_KEYOUT10_MARK, PORT132_FN4), \
1069 PINMUX_DATA(LCD2D12_MARK, PORT132_FN7),
1070 PINMUX_DATA(VIO_D3_MARK, PORT133_FN1), \
1071 PINMUX_DATA(MSIOF2_TSYNC_MARK, PORT133_FN3, MSEL4CR_MSEL11_0), \
1072 PINMUX_DATA(LCD2D13_MARK, PORT133_FN7),
1073 PINMUX_DATA(VIO_D4_MARK, PORT134_FN1), \
1074 PINMUX_DATA(MSIOF2_TXD_MARK, PORT134_FN3, MSEL4CR_MSEL11_0), \
1075 PINMUX_DATA(LCD2D14_MARK, PORT134_FN7),
1076 PINMUX_DATA(VIO_D5_MARK, PORT135_FN1), \
1077 PINMUX_DATA(MSIOF2_TSCK_MARK, PORT135_FN3, MSEL4CR_MSEL11_0), \
1078 PINMUX_DATA(LCD2D15_MARK, PORT135_FN7),
1079 PINMUX_DATA(VIO_D6_MARK, PORT136_FN1), \
1080 PINMUX_DATA(PORT136_KEYOUT8_MARK, PORT136_FN2), \
1081 PINMUX_DATA(LCD2D16_MARK, PORT136_FN7),
1082 PINMUX_DATA(VIO_D7_MARK, PORT137_FN1), \
1083 PINMUX_DATA(PORT137_KEYOUT9_MARK, PORT137_FN2), \
1084 PINMUX_DATA(LCD2D17_MARK, PORT137_FN7),
1085 PINMUX_DATA(VIO_D8_MARK, PORT138_FN1), \
1086 PINMUX_DATA(PORT138_KEYOUT8_MARK, PORT138_FN2), \
1087 PINMUX_DATA(VIO2_D0_MARK, PORT138_FN6), \
1088 PINMUX_DATA(LCD2D6_MARK, PORT138_FN7),
1089 PINMUX_DATA(VIO_D9_MARK, PORT139_FN1), \
1090 PINMUX_DATA(PORT139_KEYOUT9_MARK, PORT139_FN2), \
1091 PINMUX_DATA(VIO2_D1_MARK, PORT139_FN6), \
1092 PINMUX_DATA(LCD2D7_MARK, PORT139_FN7),
1093 PINMUX_DATA(VIO_D10_MARK, PORT140_FN1), \
1094 PINMUX_DATA(TPU0TO2_MARK, PORT140_FN4), \
1095 PINMUX_DATA(VIO2_D2_MARK, PORT140_FN6), \
1096 PINMUX_DATA(LCD2D8_MARK, PORT140_FN7),
1097 PINMUX_DATA(VIO_D11_MARK, PORT141_FN1), \
1098 PINMUX_DATA(TPU0TO3_MARK, PORT141_FN4), \
1099 PINMUX_DATA(VIO2_D3_MARK, PORT141_FN6), \
1100 PINMUX_DATA(LCD2D9_MARK, PORT141_FN7),
1101 PINMUX_DATA(VIO_D12_MARK, PORT142_FN1), \
1102 PINMUX_DATA(PORT142_KEYOUT10_MARK, PORT142_FN2), \
1103 PINMUX_DATA(VIO2_D4_MARK, PORT142_FN6), \
1104 PINMUX_DATA(LCD2D2_MARK, PORT142_FN7),
1105 PINMUX_DATA(VIO_D13_MARK, PORT143_FN1), \
1106 PINMUX_DATA(PORT143_KEYOUT11_MARK, PORT143_FN2), \
1107 PINMUX_DATA(PORT143_KEYOUT6_MARK, PORT143_FN3), \
1108 PINMUX_DATA(VIO2_D5_MARK, PORT143_FN6), \
1109 PINMUX_DATA(LCD2D3_MARK, PORT143_FN7),
1110 PINMUX_DATA(VIO_D14_MARK, PORT144_FN1), \
1111 PINMUX_DATA(PORT144_KEYOUT7_MARK, PORT144_FN2), \
1112 PINMUX_DATA(VIO2_D6_MARK, PORT144_FN6), \
1113 PINMUX_DATA(LCD2D4_MARK, PORT144_FN7),
1114 PINMUX_DATA(VIO_D15_MARK, PORT145_FN1), \
1115 PINMUX_DATA(TPU1TO3_MARK, PORT145_FN3), \
1116 PINMUX_DATA(PORT145_LCD2DISP_MARK, PORT145_FN4), \
1117 PINMUX_DATA(PORT145_LCD2RS_MARK, PORT145_FN5), \
1118 PINMUX_DATA(VIO2_D7_MARK, PORT145_FN6), \
1119 PINMUX_DATA(LCD2D5_MARK, PORT145_FN7),
1120 PINMUX_DATA(VIO_CLK_MARK, PORT146_FN1), \
1121 PINMUX_DATA(LCD2DCK_MARK, PORT146_FN4), \
1122 PINMUX_DATA(PORT146_LCD2WR__MARK, PORT146_FN5), \
1123 PINMUX_DATA(VIO2_CLK_MARK, PORT146_FN6, MSEL4CR_MSEL27_0), \
1124 PINMUX_DATA(LCD2D18_MARK, PORT146_FN7),
1125 PINMUX_DATA(VIO_FIELD_MARK, PORT147_FN1), \
1126 PINMUX_DATA(LCD2RD__MARK, PORT147_FN4), \
1127 PINMUX_DATA(VIO2_FIELD_MARK, PORT147_FN6, MSEL4CR_MSEL27_0), \
1128 PINMUX_DATA(LCD2D19_MARK, PORT147_FN7),
1129 PINMUX_DATA(VIO_CKO_MARK, PORT148_FN1),
1130 PINMUX_DATA(A27_MARK, PORT149_FN1), \
1131 PINMUX_DATA(PORT149_RDWR_MARK, PORT149_FN2), \
1132 PINMUX_DATA(MFG0_IN1_MARK, PORT149_FN3), \
1133 PINMUX_DATA(PORT149_KEYOUT9_MARK, PORT149_FN4),
1134 PINMUX_DATA(MFG0_IN2_MARK, PORT150_FN3),
1135 PINMUX_DATA(TS_SPSYNC3_MARK, PORT151_FN4), \
1136 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT151_FN5),
1137 PINMUX_DATA(TS_SDAT3_MARK, PORT152_FN4), \
1138 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT152_FN5),
1139 PINMUX_DATA(TPU1TO2_MARK, PORT153_FN3), \
1140 PINMUX_DATA(TS_SDEN3_MARK, PORT153_FN4), \
1141 PINMUX_DATA(PORT153_MSIOF2_SS1_MARK, PORT153_FN5),
1142 PINMUX_DATA(SCIFA2_TXD1_MARK, PORT154_FN2, MSEL3CR_MSEL9_0), \
1143 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT154_FN5),
1144 PINMUX_DATA(SCIFA2_RXD1_MARK, PORT155_FN2, MSEL3CR_MSEL9_0), \
1145 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT155_FN5),
1146 PINMUX_DATA(SCIFA2_RTS1__MARK, PORT156_FN2, MSEL3CR_MSEL9_0), \
1147 PINMUX_DATA(PORT156_MSIOF2_SS2_MARK, PORT156_FN5),
1148 PINMUX_DATA(SCIFA2_CTS1__MARK, PORT157_FN2, MSEL3CR_MSEL9_0), \
1149 PINMUX_DATA(PORT157_MSIOF2_RXD_MARK, PORT157_FN5, MSEL4CR_MSEL11_0,
1150 MSEL4CR_MSEL10_0),
1151 PINMUX_DATA(DINT__MARK, PORT158_FN1), \
1152 PINMUX_DATA(SCIFA2_SCK1_MARK, PORT158_FN2, MSEL3CR_MSEL9_0), \
1153 PINMUX_DATA(TS_SCK3_MARK, PORT158_FN4),
1154 PINMUX_DATA(PORT159_SCIFB_SCK_MARK, PORT159_FN1, MSEL4CR_MSEL22_0), \
1155 PINMUX_DATA(PORT159_SCIFA5_SCK_MARK, PORT159_FN2, MSEL4CR_MSEL21_1), \
1156 PINMUX_DATA(NMI_MARK, PORT159_FN3),
1157 PINMUX_DATA(PORT160_SCIFB_TXD_MARK, PORT160_FN1, MSEL4CR_MSEL22_0), \
1158 PINMUX_DATA(PORT160_SCIFA5_TXD_MARK, PORT160_FN2, MSEL4CR_MSEL21_1),
1159 PINMUX_DATA(PORT161_SCIFB_CTS__MARK, PORT161_FN1, MSEL4CR_MSEL22_0), \
1160 PINMUX_DATA(PORT161_SCIFA5_CTS__MARK, PORT161_FN2, MSEL4CR_MSEL21_1),
1161 PINMUX_DATA(PORT162_SCIFB_RXD_MARK, PORT162_FN1, MSEL4CR_MSEL22_0), \
1162 PINMUX_DATA(PORT162_SCIFA5_RXD_MARK, PORT162_FN2, MSEL4CR_MSEL21_1),
1163 PINMUX_DATA(PORT163_SCIFB_RTS__MARK, PORT163_FN1, MSEL4CR_MSEL22_0), \
1164 PINMUX_DATA(PORT163_SCIFA5_RTS__MARK, PORT163_FN2, MSEL4CR_MSEL21_1), \
1165 PINMUX_DATA(TPU3TO0_MARK, PORT163_FN5),
1166 PINMUX_DATA(LCDD0_MARK, PORT192_FN1),
1167 PINMUX_DATA(LCDD1_MARK, PORT193_FN1), \
1168 PINMUX_DATA(PORT193_SCIFA5_CTS__MARK, PORT193_FN3, MSEL4CR_MSEL21_0,
1169 MSEL4CR_MSEL20_1), \
1170 PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT193_FN5),
1171 PINMUX_DATA(LCDD2_MARK, PORT194_FN1), \
1172 PINMUX_DATA(PORT194_SCIFA5_RTS__MARK, PORT194_FN3, MSEL4CR_MSEL21_0,
1173 MSEL4CR_MSEL20_1), \
1174 PINMUX_DATA(BBIF2_TSCK1_MARK, PORT194_FN5),
1175 PINMUX_DATA(LCDD3_MARK, PORT195_FN1), \
1176 PINMUX_DATA(PORT195_SCIFA5_RXD_MARK, PORT195_FN3, MSEL4CR_MSEL21_0,
1177 MSEL4CR_MSEL20_1), \
1178 PINMUX_DATA(BBIF2_TXD1_MARK, PORT195_FN5),
1179 PINMUX_DATA(LCDD4_MARK, PORT196_FN1), \
1180 PINMUX_DATA(PORT196_SCIFA5_TXD_MARK, PORT196_FN3, MSEL4CR_MSEL21_0,
1181 MSEL4CR_MSEL20_1),
1182 PINMUX_DATA(LCDD5_MARK, PORT197_FN1), \
1183 PINMUX_DATA(PORT197_SCIFA5_SCK_MARK, PORT197_FN3, MSEL4CR_MSEL21_0,
1184 MSEL4CR_MSEL20_1), \
1185 PINMUX_DATA(MFG2_OUT2_MARK, PORT197_FN5), \
1186 PINMUX_DATA(TPU2TO1_MARK, PORT197_FN7),
1187 PINMUX_DATA(LCDD6_MARK, PORT198_FN1),
1188 PINMUX_DATA(LCDD7_MARK, PORT199_FN1), \
1189 PINMUX_DATA(TPU4TO1_MARK, PORT199_FN2), \
1190 PINMUX_DATA(MFG4_OUT2_MARK, PORT199_FN5),
1191 PINMUX_DATA(LCDD8_MARK, PORT200_FN1), \
1192 PINMUX_DATA(D16_MARK, PORT200_FN6),
1193 PINMUX_DATA(LCDD9_MARK, PORT201_FN1), \
1194 PINMUX_DATA(D17_MARK, PORT201_FN6),
1195 PINMUX_DATA(LCDD10_MARK, PORT202_FN1), \
1196 PINMUX_DATA(D18_MARK, PORT202_FN6),
1197 PINMUX_DATA(LCDD11_MARK, PORT203_FN1), \
1198 PINMUX_DATA(D19_MARK, PORT203_FN6),
1199 PINMUX_DATA(LCDD12_MARK, PORT204_FN1), \
1200 PINMUX_DATA(D20_MARK, PORT204_FN6),
1201 PINMUX_DATA(LCDD13_MARK, PORT205_FN1), \
1202 PINMUX_DATA(D21_MARK, PORT205_FN6),
1203 PINMUX_DATA(LCDD14_MARK, PORT206_FN1), \
1204 PINMUX_DATA(D22_MARK, PORT206_FN6),
1205 PINMUX_DATA(LCDD15_MARK, PORT207_FN1), \
1206 PINMUX_DATA(PORT207_MSIOF0L_SS1_MARK, PORT207_FN2, MSEL3CR_MSEL11_1), \
1207 PINMUX_DATA(D23_MARK, PORT207_FN6),
1208 PINMUX_DATA(LCDD16_MARK, PORT208_FN1), \
1209 PINMUX_DATA(PORT208_MSIOF0L_SS2_MARK, PORT208_FN2, MSEL3CR_MSEL11_1), \
1210 PINMUX_DATA(D24_MARK, PORT208_FN6),
1211 PINMUX_DATA(LCDD17_MARK, PORT209_FN1), \
1212 PINMUX_DATA(D25_MARK, PORT209_FN6),
1213 PINMUX_DATA(LCDD18_MARK, PORT210_FN1), \
1214 PINMUX_DATA(DREQ2_MARK, PORT210_FN2), \
1215 PINMUX_DATA(PORT210_MSIOF0L_SS1_MARK, PORT210_FN5, MSEL3CR_MSEL11_1), \
1216 PINMUX_DATA(D26_MARK, PORT210_FN6),
1217 PINMUX_DATA(LCDD19_MARK, PORT211_FN1), \
1218 PINMUX_DATA(PORT211_MSIOF0L_SS2_MARK, PORT211_FN5, MSEL3CR_MSEL11_1), \
1219 PINMUX_DATA(D27_MARK, PORT211_FN6),
1220 PINMUX_DATA(LCDD20_MARK, PORT212_FN1), \
1221 PINMUX_DATA(TS_SPSYNC1_MARK, PORT212_FN2), \
1222 PINMUX_DATA(MSIOF0L_MCK0_MARK, PORT212_FN5, MSEL3CR_MSEL11_1), \
1223 PINMUX_DATA(D28_MARK, PORT212_FN6),
1224 PINMUX_DATA(LCDD21_MARK, PORT213_FN1), \
1225 PINMUX_DATA(TS_SDAT1_MARK, PORT213_FN2), \
1226 PINMUX_DATA(MSIOF0L_MCK1_MARK, PORT213_FN5, MSEL3CR_MSEL11_1), \
1227 PINMUX_DATA(D29_MARK, PORT213_FN6),
1228 PINMUX_DATA(LCDD22_MARK, PORT214_FN1), \
1229 PINMUX_DATA(TS_SDEN1_MARK, PORT214_FN2), \
1230 PINMUX_DATA(MSIOF0L_RSCK_MARK, PORT214_FN5, MSEL3CR_MSEL11_1), \
1231 PINMUX_DATA(D30_MARK, PORT214_FN6),
1232 PINMUX_DATA(LCDD23_MARK, PORT215_FN1), \
1233 PINMUX_DATA(TS_SCK1_MARK, PORT215_FN2), \
1234 PINMUX_DATA(MSIOF0L_RSYNC_MARK, PORT215_FN5, MSEL3CR_MSEL11_1), \
1235 PINMUX_DATA(D31_MARK, PORT215_FN6),
1236 PINMUX_DATA(LCDDCK_MARK, PORT216_FN1), \
1237 PINMUX_DATA(LCDWR__MARK, PORT216_FN2),
1238 PINMUX_DATA(LCDRD__MARK, PORT217_FN1), \
1239 PINMUX_DATA(DACK2_MARK, PORT217_FN2), \
1240 PINMUX_DATA(PORT217_LCD2RS_MARK, PORT217_FN3), \
1241 PINMUX_DATA(MSIOF0L_TSYNC_MARK, PORT217_FN5, MSEL3CR_MSEL11_1), \
1242 PINMUX_DATA(VIO2_FIELD3_MARK, PORT217_FN6, MSEL4CR_MSEL27_1,
1243 MSEL4CR_MSEL26_1), \
1244 PINMUX_DATA(PORT217_LCD2DISP_MARK, PORT217_FN7),
1245 PINMUX_DATA(LCDHSYN_MARK, PORT218_FN1), \
1246 PINMUX_DATA(LCDCS__MARK, PORT218_FN2), \
1247 PINMUX_DATA(LCDCS2__MARK, PORT218_FN3), \
1248 PINMUX_DATA(DACK3_MARK, PORT218_FN4), \
1249 PINMUX_DATA(PORT218_VIO_CKOR_MARK, PORT218_FN5),
1250 PINMUX_DATA(LCDDISP_MARK, PORT219_FN1), \
1251 PINMUX_DATA(LCDRS_MARK, PORT219_FN2), \
1252 PINMUX_DATA(PORT219_LCD2WR__MARK, PORT219_FN3), \
1253 PINMUX_DATA(DREQ3_MARK, PORT219_FN4), \
1254 PINMUX_DATA(MSIOF0L_TSCK_MARK, PORT219_FN5, MSEL3CR_MSEL11_1), \
1255 PINMUX_DATA(VIO2_CLK3_MARK, PORT219_FN6, MSEL4CR_MSEL27_1,
1256 MSEL4CR_MSEL26_1), \
1257 PINMUX_DATA(LCD2DCK_2_MARK, PORT219_FN7),
1258 PINMUX_DATA(LCDVSYN_MARK, PORT220_FN1), \
1259 PINMUX_DATA(LCDVSYN2_MARK, PORT220_FN2),
1260 PINMUX_DATA(LCDLCLK_MARK, PORT221_FN1), \
1261 PINMUX_DATA(DREQ1_MARK, PORT221_FN2), \
1262 PINMUX_DATA(PORT221_LCD2CS__MARK, PORT221_FN3), \
1263 PINMUX_DATA(PWEN_MARK, PORT221_FN4), \
1264 PINMUX_DATA(MSIOF0L_RXD_MARK, PORT221_FN5, MSEL3CR_MSEL11_1), \
1265 PINMUX_DATA(VIO2_HD3_MARK, PORT221_FN6, MSEL4CR_MSEL27_1,
1266 MSEL4CR_MSEL26_1), \
1267 PINMUX_DATA(PORT221_LCD2HSYN_MARK, PORT221_FN7),
1268 PINMUX_DATA(LCDDON_MARK, PORT222_FN1), \
1269 PINMUX_DATA(LCDDON2_MARK, PORT222_FN2), \
1270 PINMUX_DATA(DACK1_MARK, PORT222_FN3), \
1271 PINMUX_DATA(OVCN_MARK, PORT222_FN4), \
1272 PINMUX_DATA(MSIOF0L_TXD_MARK, PORT222_FN5, MSEL3CR_MSEL11_1), \
1273 PINMUX_DATA(VIO2_VD3_MARK, PORT222_FN6, MSEL4CR_MSEL27_1,
1274 MSEL4CR_MSEL26_1), \
1275 PINMUX_DATA(PORT222_LCD2VSYN_MARK, PORT222_FN7, MSEL3CR_MSEL2_1),
1276
1277 PINMUX_DATA(SCIFA1_TXD_MARK, PORT225_FN2), \
1278 PINMUX_DATA(OVCN2_MARK, PORT225_FN4),
1279 PINMUX_DATA(EXTLP_MARK, PORT226_FN1), \
1280 PINMUX_DATA(SCIFA1_SCK_MARK, PORT226_FN2), \
1281 PINMUX_DATA(PORT226_VIO_CKO2_MARK, PORT226_FN5),
1282 PINMUX_DATA(SCIFA1_RTS__MARK, PORT227_FN2), \
1283 PINMUX_DATA(IDIN_MARK, PORT227_FN4),
1284 PINMUX_DATA(SCIFA1_RXD_MARK, PORT228_FN2),
1285 PINMUX_DATA(SCIFA1_CTS__MARK, PORT229_FN2), \
1286 PINMUX_DATA(MFG1_IN1_MARK, PORT229_FN3),
1287 PINMUX_DATA(MSIOF1_TXD_MARK, PORT230_FN1), \
1288 PINMUX_DATA(SCIFA2_TXD2_MARK, PORT230_FN2, MSEL3CR_MSEL9_1),
1289 PINMUX_DATA(MSIOF1_TSYNC_MARK, PORT231_FN1), \
1290 PINMUX_DATA(SCIFA2_CTS2__MARK, PORT231_FN2, MSEL3CR_MSEL9_1),
1291 PINMUX_DATA(MSIOF1_TSCK_MARK, PORT232_FN1), \
1292 PINMUX_DATA(SCIFA2_SCK2_MARK, PORT232_FN2, MSEL3CR_MSEL9_1),
1293 PINMUX_DATA(MSIOF1_RXD_MARK, PORT233_FN1), \
1294 PINMUX_DATA(SCIFA2_RXD2_MARK, PORT233_FN2, MSEL3CR_MSEL9_1),
1295 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT234_FN1), \
1296 PINMUX_DATA(SCIFA2_RTS2__MARK, PORT234_FN2, MSEL3CR_MSEL9_1), \
1297 PINMUX_DATA(VIO2_CLK2_MARK, PORT234_FN6, MSEL4CR_MSEL27_1,
1298 MSEL4CR_MSEL26_0), \
1299 PINMUX_DATA(LCD2D20_MARK, PORT234_FN7),
1300 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT235_FN1), \
1301 PINMUX_DATA(MFG1_IN2_MARK, PORT235_FN3), \
1302 PINMUX_DATA(VIO2_VD2_MARK, PORT235_FN6, MSEL4CR_MSEL27_1,
1303 MSEL4CR_MSEL26_0), \
1304 PINMUX_DATA(LCD2D21_MARK, PORT235_FN7),
1305 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT236_FN1), \
1306 PINMUX_DATA(PORT236_I2C_SDA2_MARK, PORT236_FN2, MSEL2CR_MSEL17_0,
1307 MSEL2CR_MSEL16_0),
1308 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT237_FN1), \
1309 PINMUX_DATA(PORT237_I2C_SCL2_MARK, PORT237_FN2, MSEL2CR_MSEL17_0,
1310 MSEL2CR_MSEL16_0),
1311 PINMUX_DATA(MSIOF1_SS1_MARK, PORT238_FN1), \
1312 PINMUX_DATA(VIO2_FIELD2_MARK, PORT238_FN6, MSEL4CR_MSEL27_1,
1313 MSEL4CR_MSEL26_0), \
1314 PINMUX_DATA(LCD2D22_MARK, PORT238_FN7),
1315 PINMUX_DATA(MSIOF1_SS2_MARK, PORT239_FN1), \
1316 PINMUX_DATA(VIO2_HD2_MARK, PORT239_FN6, MSEL4CR_MSEL27_1,
1317 MSEL4CR_MSEL26_0), \
1318 PINMUX_DATA(LCD2D23_MARK, PORT239_FN7),
1319 PINMUX_DATA(SCIFA6_TXD_MARK, PORT240_FN1),
1320 PINMUX_DATA(PORT241_IRDA_OUT_MARK, PORT241_FN1, MSEL4CR_MSEL19_0), \
1321 PINMUX_DATA(PORT241_IROUT_MARK, PORT241_FN2), \
1322 PINMUX_DATA(MFG4_OUT1_MARK, PORT241_FN3), \
1323 PINMUX_DATA(TPU4TO0_MARK, PORT241_FN4),
1324 PINMUX_DATA(PORT242_IRDA_IN_MARK, PORT242_FN1, MSEL4CR_MSEL19_0), \
1325 PINMUX_DATA(MFG4_IN2_MARK, PORT242_FN3),
1326 PINMUX_DATA(PORT243_IRDA_FIRSEL_MARK, PORT243_FN1, MSEL4CR_MSEL19_0), \
1327 PINMUX_DATA(PORT243_VIO_CKO2_MARK, PORT243_FN2),
1328 PINMUX_DATA(PORT244_SCIFA5_CTS__MARK, PORT244_FN1, MSEL4CR_MSEL21_0,
1329 MSEL4CR_MSEL20_0), \
1330 PINMUX_DATA(MFG2_IN1_MARK, PORT244_FN2), \
1331 PINMUX_DATA(PORT244_SCIFB_CTS__MARK, PORT244_FN3, MSEL4CR_MSEL22_1), \
1332 PINMUX_DATA(MSIOF2R_RXD_MARK, PORT244_FN7, MSEL4CR_MSEL11_1),
1333 PINMUX_DATA(PORT245_SCIFA5_RTS__MARK, PORT245_FN1, MSEL4CR_MSEL21_0,
1334 MSEL4CR_MSEL20_0), \
1335 PINMUX_DATA(MFG2_IN2_MARK, PORT245_FN2), \
1336 PINMUX_DATA(PORT245_SCIFB_RTS__MARK, PORT245_FN3, MSEL4CR_MSEL22_1), \
1337 PINMUX_DATA(MSIOF2R_TXD_MARK, PORT245_FN7, MSEL4CR_MSEL11_1),
1338 PINMUX_DATA(PORT246_SCIFA5_RXD_MARK, PORT246_FN1, MSEL4CR_MSEL21_0,
1339 MSEL4CR_MSEL20_0), \
1340 PINMUX_DATA(MFG1_OUT1_MARK, PORT246_FN2), \
1341 PINMUX_DATA(PORT246_SCIFB_RXD_MARK, PORT246_FN3, MSEL4CR_MSEL22_1), \
1342 PINMUX_DATA(TPU1TO0_MARK, PORT246_FN4),
1343 PINMUX_DATA(PORT247_SCIFA5_TXD_MARK, PORT247_FN1, MSEL4CR_MSEL21_0,
1344 MSEL4CR_MSEL20_0), \
1345 PINMUX_DATA(MFG3_OUT2_MARK, PORT247_FN2), \
1346 PINMUX_DATA(PORT247_SCIFB_TXD_MARK, PORT247_FN3, MSEL4CR_MSEL22_1), \
1347 PINMUX_DATA(TPU3TO1_MARK, PORT247_FN4),
1348 PINMUX_DATA(PORT248_SCIFA5_SCK_MARK, PORT248_FN1, MSEL4CR_MSEL21_0,
1349 MSEL4CR_MSEL20_0), \
1350 PINMUX_DATA(MFG2_OUT1_MARK, PORT248_FN2), \
1351 PINMUX_DATA(PORT248_SCIFB_SCK_MARK, PORT248_FN3, MSEL4CR_MSEL22_1), \
1352 PINMUX_DATA(TPU2TO0_MARK, PORT248_FN4), \
1353 PINMUX_DATA(PORT248_I2C_SCL3_MARK, PORT248_FN5, MSEL2CR_MSEL19_0,
1354 MSEL2CR_MSEL18_0), \
1355 PINMUX_DATA(MSIOF2R_TSCK_MARK, PORT248_FN7, MSEL4CR_MSEL11_1),
1356 PINMUX_DATA(PORT249_IROUT_MARK, PORT249_FN1), \
1357 PINMUX_DATA(MFG4_IN1_MARK, PORT249_FN2), \
1358 PINMUX_DATA(PORT249_I2C_SDA3_MARK, PORT249_FN5, MSEL2CR_MSEL19_0,
1359 MSEL2CR_MSEL18_0), \
1360 PINMUX_DATA(MSIOF2R_TSYNC_MARK, PORT249_FN7, MSEL4CR_MSEL11_1),
1361 PINMUX_DATA(SDHICLK0_MARK, PORT250_FN1),
1362 PINMUX_DATA(SDHICD0_MARK, PORT251_FN1),
1363 PINMUX_DATA(SDHID0_0_MARK, PORT252_FN1),
1364 PINMUX_DATA(SDHID0_1_MARK, PORT253_FN1),
1365 PINMUX_DATA(SDHID0_2_MARK, PORT254_FN1),
1366 PINMUX_DATA(SDHID0_3_MARK, PORT255_FN1),
1367 PINMUX_DATA(SDHICMD0_MARK, PORT256_FN1),
1368 PINMUX_DATA(SDHIWP0_MARK, PORT257_FN1),
1369 PINMUX_DATA(SDHICLK1_MARK, PORT258_FN1),
1370 PINMUX_DATA(SDHID1_0_MARK, PORT259_FN1), \
1371 PINMUX_DATA(TS_SPSYNC2_MARK, PORT259_FN3),
1372 PINMUX_DATA(SDHID1_1_MARK, PORT260_FN1), \
1373 PINMUX_DATA(TS_SDAT2_MARK, PORT260_FN3),
1374 PINMUX_DATA(SDHID1_2_MARK, PORT261_FN1), \
1375 PINMUX_DATA(TS_SDEN2_MARK, PORT261_FN3),
1376 PINMUX_DATA(SDHID1_3_MARK, PORT262_FN1), \
1377 PINMUX_DATA(TS_SCK2_MARK, PORT262_FN3),
1378 PINMUX_DATA(SDHICMD1_MARK, PORT263_FN1),
1379 PINMUX_DATA(SDHICLK2_MARK, PORT264_FN1),
1380 PINMUX_DATA(SDHID2_0_MARK, PORT265_FN1), \
1381 PINMUX_DATA(TS_SPSYNC4_MARK, PORT265_FN3),
1382 PINMUX_DATA(SDHID2_1_MARK, PORT266_FN1), \
1383 PINMUX_DATA(TS_SDAT4_MARK, PORT266_FN3),
1384 PINMUX_DATA(SDHID2_2_MARK, PORT267_FN1), \
1385 PINMUX_DATA(TS_SDEN4_MARK, PORT267_FN3),
1386 PINMUX_DATA(SDHID2_3_MARK, PORT268_FN1), \
1387 PINMUX_DATA(TS_SCK4_MARK, PORT268_FN3),
1388 PINMUX_DATA(SDHICMD2_MARK, PORT269_FN1),
1389 PINMUX_DATA(MMCCLK0_MARK, PORT270_FN1, MSEL4CR_MSEL15_0),
1390 PINMUX_DATA(MMCD0_0_MARK, PORT271_FN1, MSEL4CR_MSEL15_0),
1391 PINMUX_DATA(MMCD0_1_MARK, PORT272_FN1, MSEL4CR_MSEL15_0),
1392 PINMUX_DATA(MMCD0_2_MARK, PORT273_FN1, MSEL4CR_MSEL15_0),
1393 PINMUX_DATA(MMCD0_3_MARK, PORT274_FN1, MSEL4CR_MSEL15_0),
1394 PINMUX_DATA(MMCD0_4_MARK, PORT275_FN1, MSEL4CR_MSEL15_0), \
1395 PINMUX_DATA(TS_SPSYNC5_MARK, PORT275_FN3),
1396 PINMUX_DATA(MMCD0_5_MARK, PORT276_FN1, MSEL4CR_MSEL15_0), \
1397 PINMUX_DATA(TS_SDAT5_MARK, PORT276_FN3),
1398 PINMUX_DATA(MMCD0_6_MARK, PORT277_FN1, MSEL4CR_MSEL15_0), \
1399 PINMUX_DATA(TS_SDEN5_MARK, PORT277_FN3),
1400 PINMUX_DATA(MMCD0_7_MARK, PORT278_FN1, MSEL4CR_MSEL15_0), \
1401 PINMUX_DATA(TS_SCK5_MARK, PORT278_FN3),
1402 PINMUX_DATA(MMCCMD0_MARK, PORT279_FN1, MSEL4CR_MSEL15_0),
1403 PINMUX_DATA(RESETOUTS__MARK, PORT281_FN1), \
1404 PINMUX_DATA(EXTAL2OUT_MARK, PORT281_FN2),
1405 PINMUX_DATA(MCP_WAIT__MCP_FRB_MARK, PORT288_FN1),
1406 PINMUX_DATA(MCP_CKO_MARK, PORT289_FN1), \
1407 PINMUX_DATA(MMCCLK1_MARK, PORT289_FN2, MSEL4CR_MSEL15_1),
1408 PINMUX_DATA(MCP_D15_MCP_NAF15_MARK, PORT290_FN1),
1409 PINMUX_DATA(MCP_D14_MCP_NAF14_MARK, PORT291_FN1),
1410 PINMUX_DATA(MCP_D13_MCP_NAF13_MARK, PORT292_FN1),
1411 PINMUX_DATA(MCP_D12_MCP_NAF12_MARK, PORT293_FN1),
1412 PINMUX_DATA(MCP_D11_MCP_NAF11_MARK, PORT294_FN1),
1413 PINMUX_DATA(MCP_D10_MCP_NAF10_MARK, PORT295_FN1),
1414 PINMUX_DATA(MCP_D9_MCP_NAF9_MARK, PORT296_FN1),
1415 PINMUX_DATA(MCP_D8_MCP_NAF8_MARK, PORT297_FN1), \
1416 PINMUX_DATA(MMCCMD1_MARK, PORT297_FN2, MSEL4CR_MSEL15_1),
1417 PINMUX_DATA(MCP_D7_MCP_NAF7_MARK, PORT298_FN1), \
1418 PINMUX_DATA(MMCD1_7_MARK, PORT298_FN2, MSEL4CR_MSEL15_1),
1419
1420 PINMUX_DATA(MCP_D6_MCP_NAF6_MARK, PORT299_FN1), \
1421 PINMUX_DATA(MMCD1_6_MARK, PORT299_FN2, MSEL4CR_MSEL15_1),
1422 PINMUX_DATA(MCP_D5_MCP_NAF5_MARK, PORT300_FN1), \
1423 PINMUX_DATA(MMCD1_5_MARK, PORT300_FN2, MSEL4CR_MSEL15_1),
1424 PINMUX_DATA(MCP_D4_MCP_NAF4_MARK, PORT301_FN1), \
1425 PINMUX_DATA(MMCD1_4_MARK, PORT301_FN2, MSEL4CR_MSEL15_1),
1426 PINMUX_DATA(MCP_D3_MCP_NAF3_MARK, PORT302_FN1), \
1427 PINMUX_DATA(MMCD1_3_MARK, PORT302_FN2, MSEL4CR_MSEL15_1),
1428 PINMUX_DATA(MCP_D2_MCP_NAF2_MARK, PORT303_FN1), \
1429 PINMUX_DATA(MMCD1_2_MARK, PORT303_FN2, MSEL4CR_MSEL15_1),
1430 PINMUX_DATA(MCP_D1_MCP_NAF1_MARK, PORT304_FN1), \
1431 PINMUX_DATA(MMCD1_1_MARK, PORT304_FN2, MSEL4CR_MSEL15_1),
1432 PINMUX_DATA(MCP_D0_MCP_NAF0_MARK, PORT305_FN1), \
1433 PINMUX_DATA(MMCD1_0_MARK, PORT305_FN2, MSEL4CR_MSEL15_1),
1434 PINMUX_DATA(MCP_NBRSTOUT__MARK, PORT306_FN1),
1435 PINMUX_DATA(MCP_WE0__MCP_FWE_MARK, PORT309_FN1), \
1436 PINMUX_DATA(MCP_RDWR_MCP_FWE_MARK, PORT309_FN2),
1437
1438 /* MSEL2 special cases */
1439 PINMUX_DATA(TSIF2_TS_XX1_MARK, MSEL2CR_MSEL14_0, MSEL2CR_MSEL13_0,
1440 MSEL2CR_MSEL12_0),
1441 PINMUX_DATA(TSIF2_TS_XX2_MARK, MSEL2CR_MSEL14_0, MSEL2CR_MSEL13_0,
1442 MSEL2CR_MSEL12_1),
1443 PINMUX_DATA(TSIF2_TS_XX3_MARK, MSEL2CR_MSEL14_0, MSEL2CR_MSEL13_1,
1444 MSEL2CR_MSEL12_0),
1445 PINMUX_DATA(TSIF2_TS_XX4_MARK, MSEL2CR_MSEL14_0, MSEL2CR_MSEL13_1,
1446 MSEL2CR_MSEL12_1),
1447 PINMUX_DATA(TSIF2_TS_XX5_MARK, MSEL2CR_MSEL14_1, MSEL2CR_MSEL13_0,
1448 MSEL2CR_MSEL12_0),
1449 PINMUX_DATA(TSIF1_TS_XX1_MARK, MSEL2CR_MSEL11_0, MSEL2CR_MSEL10_0,
1450 MSEL2CR_MSEL9_0),
1451 PINMUX_DATA(TSIF1_TS_XX2_MARK, MSEL2CR_MSEL11_0, MSEL2CR_MSEL10_0,
1452 MSEL2CR_MSEL9_1),
1453 PINMUX_DATA(TSIF1_TS_XX3_MARK, MSEL2CR_MSEL11_0, MSEL2CR_MSEL10_1,
1454 MSEL2CR_MSEL9_0),
1455 PINMUX_DATA(TSIF1_TS_XX4_MARK, MSEL2CR_MSEL11_0, MSEL2CR_MSEL10_1,
1456 MSEL2CR_MSEL9_1),
1457 PINMUX_DATA(TSIF1_TS_XX5_MARK, MSEL2CR_MSEL11_1, MSEL2CR_MSEL10_0,
1458 MSEL2CR_MSEL9_0),
1459 PINMUX_DATA(TSIF0_TS_XX1_MARK, MSEL2CR_MSEL8_0, MSEL2CR_MSEL7_0,
1460 MSEL2CR_MSEL6_0),
1461 PINMUX_DATA(TSIF0_TS_XX2_MARK, MSEL2CR_MSEL8_0, MSEL2CR_MSEL7_0,
1462 MSEL2CR_MSEL6_1),
1463 PINMUX_DATA(TSIF0_TS_XX3_MARK, MSEL2CR_MSEL8_0, MSEL2CR_MSEL7_1,
1464 MSEL2CR_MSEL6_0),
1465 PINMUX_DATA(TSIF0_TS_XX4_MARK, MSEL2CR_MSEL8_0, MSEL2CR_MSEL7_1,
1466 MSEL2CR_MSEL6_1),
1467 PINMUX_DATA(TSIF0_TS_XX5_MARK, MSEL2CR_MSEL8_1, MSEL2CR_MSEL7_0,
1468 MSEL2CR_MSEL6_0),
1469 PINMUX_DATA(MST1_TS_XX1_MARK, MSEL2CR_MSEL5_0, MSEL2CR_MSEL4_0,
1470 MSEL2CR_MSEL3_0),
1471 PINMUX_DATA(MST1_TS_XX2_MARK, MSEL2CR_MSEL5_0, MSEL2CR_MSEL4_0,
1472 MSEL2CR_MSEL3_1),
1473 PINMUX_DATA(MST1_TS_XX3_MARK, MSEL2CR_MSEL5_0, MSEL2CR_MSEL4_1,
1474 MSEL2CR_MSEL3_0),
1475 PINMUX_DATA(MST1_TS_XX4_MARK, MSEL2CR_MSEL5_0, MSEL2CR_MSEL4_1,
1476 MSEL2CR_MSEL3_1),
1477 PINMUX_DATA(MST1_TS_XX5_MARK, MSEL2CR_MSEL5_1, MSEL2CR_MSEL4_0,
1478 MSEL2CR_MSEL3_0),
1479 PINMUX_DATA(MST0_TS_XX1_MARK, MSEL2CR_MSEL2_0, MSEL2CR_MSEL1_0,
1480 MSEL2CR_MSEL0_0),
1481 PINMUX_DATA(MST0_TS_XX2_MARK, MSEL2CR_MSEL2_0, MSEL2CR_MSEL1_0,
1482 MSEL2CR_MSEL0_1),
1483 PINMUX_DATA(MST0_TS_XX3_MARK, MSEL2CR_MSEL2_0, MSEL2CR_MSEL1_1,
1484 MSEL2CR_MSEL0_0),
1485 PINMUX_DATA(MST0_TS_XX4_MARK, MSEL2CR_MSEL2_0, MSEL2CR_MSEL1_1,
1486 MSEL2CR_MSEL0_1),
1487 PINMUX_DATA(MST0_TS_XX5_MARK, MSEL2CR_MSEL2_1, MSEL2CR_MSEL1_0,
1488 MSEL2CR_MSEL0_0),
1489
1490 /* MSEL3 special cases */
1491 PINMUX_DATA(SDHI0_VCCQ_MC0_ON_MARK, MSEL3CR_MSEL28_1),
1492 PINMUX_DATA(SDHI0_VCCQ_MC0_OFF_MARK, MSEL3CR_MSEL28_0),
1493 PINMUX_DATA(DEBUG_MON_VIO_MARK, MSEL3CR_MSEL15_0),
1494 PINMUX_DATA(DEBUG_MON_LCDD_MARK, MSEL3CR_MSEL15_1),
1495 PINMUX_DATA(LCDC_LCDC0_MARK, MSEL3CR_MSEL6_0),
1496 PINMUX_DATA(LCDC_LCDC1_MARK, MSEL3CR_MSEL6_1),
1497
1498 /* MSEL4 special cases */
1499 PINMUX_DATA(IRQ9_MEM_INT_MARK, MSEL4CR_MSEL29_0),
1500 PINMUX_DATA(IRQ9_MCP_INT_MARK, MSEL4CR_MSEL29_1),
1501 PINMUX_DATA(A11_MARK, MSEL4CR_MSEL13_0, MSEL4CR_MSEL12_0),
1502 PINMUX_DATA(KEYOUT8_MARK, MSEL4CR_MSEL13_0, MSEL4CR_MSEL12_1),
1503 PINMUX_DATA(TPU4TO3_MARK, MSEL4CR_MSEL13_1, MSEL4CR_MSEL12_0),
1504 PINMUX_DATA(RESETA_N_PU_ON_MARK, MSEL4CR_MSEL4_0),
1505 PINMUX_DATA(RESETA_N_PU_OFF_MARK, MSEL4CR_MSEL4_1),
1506 PINMUX_DATA(EDBGREQ_PD_MARK, MSEL4CR_MSEL1_0),
1507 PINMUX_DATA(EDBGREQ_PU_MARK, MSEL4CR_MSEL1_1),
1508
1509 /* Functions with pull-ups */
1510 PINMUX_DATA(KEYIN0_PU_MARK, PORT66_FN2, PORT66_IN_PU),
1511 PINMUX_DATA(KEYIN1_PU_MARK, PORT67_FN2, PORT67_IN_PU),
1512 PINMUX_DATA(KEYIN2_PU_MARK, PORT68_FN2, PORT68_IN_PU),
1513 PINMUX_DATA(KEYIN3_PU_MARK, PORT69_FN2, PORT69_IN_PU),
1514 PINMUX_DATA(KEYIN4_PU_MARK, PORT70_FN2, PORT70_IN_PU),
1515 PINMUX_DATA(KEYIN5_PU_MARK, PORT71_FN2, PORT71_IN_PU),
1516 PINMUX_DATA(KEYIN6_PU_MARK, PORT72_FN2, PORT72_IN_PU),
1517 PINMUX_DATA(KEYIN7_PU_MARK, PORT73_FN2, PORT73_IN_PU),
1518
1519 PINMUX_DATA(SDHID1_0_PU_MARK, PORT259_IN_PU, PORT259_FN1),
1520 PINMUX_DATA(SDHID1_1_PU_MARK, PORT260_IN_PU, PORT260_FN1),
1521 PINMUX_DATA(SDHID1_2_PU_MARK, PORT261_IN_PU, PORT261_FN1),
1522 PINMUX_DATA(SDHID1_3_PU_MARK, PORT262_IN_PU, PORT262_FN1),
1523 PINMUX_DATA(SDHICMD1_PU_MARK, PORT263_IN_PU, PORT263_FN1),
1524
1525 PINMUX_DATA(MMCCMD0_PU_MARK, PORT279_FN1, PORT279_IN_PU,
1526 MSEL4CR_MSEL15_0),
1527 PINMUX_DATA(MMCCMD1_PU_MARK, PORT297_FN2, PORT279_IN_PU,
1528 MSEL4CR_MSEL15_1),
1529 PINMUX_DATA(FSIACK_PU_MARK, PORT49_FN1, PORT49_IN_PU),
1530 PINMUX_DATA(FSIAILR_PU_MARK, PORT50_FN5, PORT50_IN_PU),
1531 PINMUX_DATA(FSIAIBT_PU_MARK, PORT51_FN5, PORT51_IN_PU),
1532 PINMUX_DATA(FSIAISLD_PU_MARK, PORT55_FN1, PORT55_IN_PU),
1533};
1534
1535#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
1536#define GPIO_PORT_310() _310(_GPIO_PORT, , unused)
1537#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
1538
1539static struct pinmux_gpio pinmux_gpios[] = {
1540 GPIO_PORT_310(),
1541
1542 /* Table 25-1 (Functions 0-7) */
1543 GPIO_FN(VBUS_0),
1544 GPIO_FN(GPI0),
1545 GPIO_FN(GPI1),
1546 GPIO_FN(GPI2),
1547 GPIO_FN(GPI3),
1548 GPIO_FN(GPI4),
1549 GPIO_FN(GPI5),
1550 GPIO_FN(GPI6),
1551 GPIO_FN(GPI7),
1552 GPIO_FN(SCIFA7_RXD),
1553 GPIO_FN(SCIFA7_CTS_),
1554 GPIO_FN(GPO7), \
1555 GPIO_FN(MFG0_OUT2),
1556 GPIO_FN(GPO6), \
1557 GPIO_FN(MFG1_OUT2),
1558 GPIO_FN(GPO5), \
1559 GPIO_FN(SCIFA0_SCK), \
1560 GPIO_FN(FSICOSLDT3), \
1561 GPIO_FN(PORT16_VIO_CKOR),
1562 GPIO_FN(SCIFA0_TXD),
1563 GPIO_FN(SCIFA7_TXD),
1564 GPIO_FN(SCIFA7_RTS_), \
1565 GPIO_FN(PORT19_VIO_CKO2),
1566 GPIO_FN(GPO0),
1567 GPIO_FN(GPO1),
1568 GPIO_FN(GPO2), \
1569 GPIO_FN(STATUS0),
1570 GPIO_FN(GPO3), \
1571 GPIO_FN(STATUS1),
1572 GPIO_FN(GPO4), \
1573 GPIO_FN(STATUS2),
1574 GPIO_FN(VINT),
1575 GPIO_FN(TCKON),
1576 GPIO_FN(XDVFS1), \
1577 GPIO_FN(PORT27_I2C_SCL2), \
1578 GPIO_FN(PORT27_I2C_SCL3), \
1579 GPIO_FN(MFG0_OUT1), \
1580 GPIO_FN(PORT27_IROUT),
1581 GPIO_FN(XDVFS2), \
1582 GPIO_FN(PORT28_I2C_SDA2), \
1583 GPIO_FN(PORT28_I2C_SDA3), \
1584 GPIO_FN(PORT28_TPU1TO1),
1585 GPIO_FN(SIM_RST), \
1586 GPIO_FN(PORT29_TPU1TO1),
1587 GPIO_FN(SIM_CLK), \
1588 GPIO_FN(PORT30_VIO_CKOR),
1589 GPIO_FN(SIM_D), \
1590 GPIO_FN(PORT31_IROUT),
1591 GPIO_FN(SCIFA4_TXD),
1592 GPIO_FN(SCIFA4_RXD), \
1593 GPIO_FN(XWUP),
1594 GPIO_FN(SCIFA4_RTS_),
1595 GPIO_FN(SCIFA4_CTS_),
1596 GPIO_FN(FSIBOBT), \
1597 GPIO_FN(FSIBIBT),
1598 GPIO_FN(FSIBOLR), \
1599 GPIO_FN(FSIBILR),
1600 GPIO_FN(FSIBOSLD),
1601 GPIO_FN(FSIBISLD),
1602 GPIO_FN(VACK),
1603 GPIO_FN(XTAL1L),
1604 GPIO_FN(SCIFA0_RTS_), \
1605 GPIO_FN(FSICOSLDT2),
1606 GPIO_FN(SCIFA0_RXD),
1607 GPIO_FN(SCIFA0_CTS_), \
1608 GPIO_FN(FSICOSLDT1),
1609 GPIO_FN(FSICOBT), \
1610 GPIO_FN(FSICIBT), \
1611 GPIO_FN(FSIDOBT), \
1612 GPIO_FN(FSIDIBT),
1613 GPIO_FN(FSICOLR), \
1614 GPIO_FN(FSICILR), \
1615 GPIO_FN(FSIDOLR), \
1616 GPIO_FN(FSIDILR),
1617 GPIO_FN(FSICOSLD), \
1618 GPIO_FN(PORT47_FSICSPDIF),
1619 GPIO_FN(FSICISLD), \
1620 GPIO_FN(FSIDISLD),
1621 GPIO_FN(FSIACK), \
1622 GPIO_FN(PORT49_IRDA_OUT), \
1623 GPIO_FN(PORT49_IROUT), \
1624 GPIO_FN(FSIAOMC),
1625 GPIO_FN(FSIAOLR), \
1626 GPIO_FN(BBIF2_TSYNC2), \
1627 GPIO_FN(TPU2TO2), \
1628 GPIO_FN(FSIAILR),
1629
1630 GPIO_FN(FSIAOBT), \
1631 GPIO_FN(BBIF2_TSCK2), \
1632 GPIO_FN(TPU2TO3), \
1633 GPIO_FN(FSIAIBT),
1634 GPIO_FN(FSIAOSLD), \
1635 GPIO_FN(BBIF2_TXD2),
1636 GPIO_FN(FSIASPDIF), \
1637 GPIO_FN(PORT53_IRDA_IN), \
1638 GPIO_FN(TPU3TO3), \
1639 GPIO_FN(FSIBSPDIF), \
1640 GPIO_FN(PORT53_FSICSPDIF),
1641 GPIO_FN(FSIBCK), \
1642 GPIO_FN(PORT54_IRDA_FIRSEL), \
1643 GPIO_FN(TPU3TO2), \
1644 GPIO_FN(FSIBOMC), \
1645 GPIO_FN(FSICCK), \
1646 GPIO_FN(FSICOMC),
1647 GPIO_FN(FSIAISLD), \
1648 GPIO_FN(TPU0TO0),
1649 GPIO_FN(A0), \
1650 GPIO_FN(BS_),
1651 GPIO_FN(A12), \
1652 GPIO_FN(PORT58_KEYOUT7), \
1653 GPIO_FN(TPU4TO2),
1654 GPIO_FN(A13), \
1655 GPIO_FN(PORT59_KEYOUT6), \
1656 GPIO_FN(TPU0TO1),
1657 GPIO_FN(A14), \
1658 GPIO_FN(KEYOUT5),
1659 GPIO_FN(A15), \
1660 GPIO_FN(KEYOUT4),
1661 GPIO_FN(A16), \
1662 GPIO_FN(KEYOUT3), \
1663 GPIO_FN(MSIOF0_SS1),
1664 GPIO_FN(A17), \
1665 GPIO_FN(KEYOUT2), \
1666 GPIO_FN(MSIOF0_TSYNC),
1667 GPIO_FN(A18), \
1668 GPIO_FN(KEYOUT1), \
1669 GPIO_FN(MSIOF0_TSCK),
1670 GPIO_FN(A19), \
1671 GPIO_FN(KEYOUT0), \
1672 GPIO_FN(MSIOF0_TXD),
1673 GPIO_FN(A20), \
1674 GPIO_FN(KEYIN0), \
1675 GPIO_FN(MSIOF0_RSCK),
1676 GPIO_FN(A21), \
1677 GPIO_FN(KEYIN1), \
1678 GPIO_FN(MSIOF0_RSYNC),
1679 GPIO_FN(A22), \
1680 GPIO_FN(KEYIN2), \
1681 GPIO_FN(MSIOF0_MCK0),
1682 GPIO_FN(A23), \
1683 GPIO_FN(KEYIN3), \
1684 GPIO_FN(MSIOF0_MCK1),
1685 GPIO_FN(A24), \
1686 GPIO_FN(KEYIN4), \
1687 GPIO_FN(MSIOF0_RXD),
1688 GPIO_FN(A25), \
1689 GPIO_FN(KEYIN5), \
1690 GPIO_FN(MSIOF0_SS2),
1691 GPIO_FN(A26), \
1692 GPIO_FN(KEYIN6),
1693 GPIO_FN(KEYIN7),
1694 GPIO_FN(D0_NAF0),
1695 GPIO_FN(D1_NAF1),
1696 GPIO_FN(D2_NAF2),
1697 GPIO_FN(D3_NAF3),
1698 GPIO_FN(D4_NAF4),
1699 GPIO_FN(D5_NAF5),
1700 GPIO_FN(D6_NAF6),
1701 GPIO_FN(D7_NAF7),
1702 GPIO_FN(D8_NAF8),
1703 GPIO_FN(D9_NAF9),
1704 GPIO_FN(D10_NAF10),
1705 GPIO_FN(D11_NAF11),
1706 GPIO_FN(D12_NAF12),
1707 GPIO_FN(D13_NAF13),
1708 GPIO_FN(D14_NAF14),
1709 GPIO_FN(D15_NAF15),
1710 GPIO_FN(CS4_),
1711 GPIO_FN(CS5A_), \
1712 GPIO_FN(PORT91_RDWR),
1713 GPIO_FN(CS5B_), \
1714 GPIO_FN(FCE1_),
1715 GPIO_FN(CS6B_), \
1716 GPIO_FN(DACK0),
1717 GPIO_FN(FCE0_), \
1718 GPIO_FN(CS6A_),
1719 GPIO_FN(WAIT_), \
1720 GPIO_FN(DREQ0),
1721 GPIO_FN(RD__FSC),
1722 GPIO_FN(WE0__FWE), \
1723 GPIO_FN(RDWR_FWE),
1724 GPIO_FN(WE1_),
1725 GPIO_FN(FRB),
1726 GPIO_FN(CKO),
1727 GPIO_FN(NBRSTOUT_),
1728 GPIO_FN(NBRST_),
1729 GPIO_FN(BBIF2_TXD),
1730 GPIO_FN(BBIF2_RXD),
1731 GPIO_FN(BBIF2_SYNC),
1732 GPIO_FN(BBIF2_SCK),
1733 GPIO_FN(SCIFA3_CTS_), \
1734 GPIO_FN(MFG3_IN2),
1735 GPIO_FN(SCIFA3_RXD), \
1736 GPIO_FN(MFG3_IN1),
1737 GPIO_FN(BBIF1_SS2), \
1738 GPIO_FN(SCIFA3_RTS_), \
1739 GPIO_FN(MFG3_OUT1),
1740 GPIO_FN(SCIFA3_TXD),
1741 GPIO_FN(HSI_RX_DATA), \
1742 GPIO_FN(BBIF1_RXD),
1743 GPIO_FN(HSI_TX_WAKE), \
1744 GPIO_FN(BBIF1_TSCK),
1745 GPIO_FN(HSI_TX_DATA), \
1746 GPIO_FN(BBIF1_TSYNC),
1747 GPIO_FN(HSI_TX_READY), \
1748 GPIO_FN(BBIF1_TXD),
1749 GPIO_FN(HSI_RX_READY), \
1750 GPIO_FN(BBIF1_RSCK), \
1751 GPIO_FN(PORT115_I2C_SCL2), \
1752 GPIO_FN(PORT115_I2C_SCL3),
1753 GPIO_FN(HSI_RX_WAKE), \
1754 GPIO_FN(BBIF1_RSYNC), \
1755 GPIO_FN(PORT116_I2C_SDA2), \
1756 GPIO_FN(PORT116_I2C_SDA3),
1757 GPIO_FN(HSI_RX_FLAG), \
1758 GPIO_FN(BBIF1_SS1), \
1759 GPIO_FN(BBIF1_FLOW),
1760 GPIO_FN(HSI_TX_FLAG),
1761 GPIO_FN(VIO_VD), \
1762 GPIO_FN(PORT128_LCD2VSYN), \
1763 GPIO_FN(VIO2_VD), \
1764 GPIO_FN(LCD2D0),
1765
1766 GPIO_FN(VIO_HD), \
1767 GPIO_FN(PORT129_LCD2HSYN), \
1768 GPIO_FN(PORT129_LCD2CS_), \
1769 GPIO_FN(VIO2_HD), \
1770 GPIO_FN(LCD2D1),
1771 GPIO_FN(VIO_D0), \
1772 GPIO_FN(PORT130_MSIOF2_RXD), \
1773 GPIO_FN(LCD2D10),
1774 GPIO_FN(VIO_D1), \
1775 GPIO_FN(PORT131_KEYOUT6), \
1776 GPIO_FN(PORT131_MSIOF2_SS1), \
1777 GPIO_FN(PORT131_KEYOUT11), \
1778 GPIO_FN(LCD2D11),
1779 GPIO_FN(VIO_D2), \
1780 GPIO_FN(PORT132_KEYOUT7), \
1781 GPIO_FN(PORT132_MSIOF2_SS2), \
1782 GPIO_FN(PORT132_KEYOUT10), \
1783 GPIO_FN(LCD2D12),
1784 GPIO_FN(VIO_D3), \
1785 GPIO_FN(MSIOF2_TSYNC), \
1786 GPIO_FN(LCD2D13),
1787 GPIO_FN(VIO_D4), \
1788 GPIO_FN(MSIOF2_TXD), \
1789 GPIO_FN(LCD2D14),
1790 GPIO_FN(VIO_D5), \
1791 GPIO_FN(MSIOF2_TSCK), \
1792 GPIO_FN(LCD2D15),
1793 GPIO_FN(VIO_D6), \
1794 GPIO_FN(PORT136_KEYOUT8), \
1795 GPIO_FN(LCD2D16),
1796 GPIO_FN(VIO_D7), \
1797 GPIO_FN(PORT137_KEYOUT9), \
1798 GPIO_FN(LCD2D17),
1799 GPIO_FN(VIO_D8), \
1800 GPIO_FN(PORT138_KEYOUT8), \
1801 GPIO_FN(VIO2_D0), \
1802 GPIO_FN(LCD2D6),
1803 GPIO_FN(VIO_D9), \
1804 GPIO_FN(PORT139_KEYOUT9), \
1805 GPIO_FN(VIO2_D1), \
1806 GPIO_FN(LCD2D7),
1807 GPIO_FN(VIO_D10), \
1808 GPIO_FN(TPU0TO2), \
1809 GPIO_FN(VIO2_D2), \
1810 GPIO_FN(LCD2D8),
1811 GPIO_FN(VIO_D11), \
1812 GPIO_FN(TPU0TO3), \
1813 GPIO_FN(VIO2_D3), \
1814 GPIO_FN(LCD2D9),
1815 GPIO_FN(VIO_D12), \
1816 GPIO_FN(PORT142_KEYOUT10), \
1817 GPIO_FN(VIO2_D4), \
1818 GPIO_FN(LCD2D2),
1819 GPIO_FN(VIO_D13), \
1820 GPIO_FN(PORT143_KEYOUT11), \
1821 GPIO_FN(PORT143_KEYOUT6), \
1822 GPIO_FN(VIO2_D5), \
1823 GPIO_FN(LCD2D3),
1824 GPIO_FN(VIO_D14), \
1825 GPIO_FN(PORT144_KEYOUT7), \
1826 GPIO_FN(VIO2_D6), \
1827 GPIO_FN(LCD2D4),
1828 GPIO_FN(VIO_D15), \
1829 GPIO_FN(TPU1TO3), \
1830 GPIO_FN(PORT145_LCD2DISP), \
1831 GPIO_FN(PORT145_LCD2RS), \
1832 GPIO_FN(VIO2_D7), \
1833 GPIO_FN(LCD2D5),
1834 GPIO_FN(VIO_CLK), \
1835 GPIO_FN(LCD2DCK), \
1836 GPIO_FN(PORT146_LCD2WR_), \
1837 GPIO_FN(VIO2_CLK), \
1838 GPIO_FN(LCD2D18),
1839 GPIO_FN(VIO_FIELD), \
1840 GPIO_FN(LCD2RD_), \
1841 GPIO_FN(VIO2_FIELD), \
1842 GPIO_FN(LCD2D19),
1843 GPIO_FN(VIO_CKO),
1844 GPIO_FN(A27), \
1845 GPIO_FN(PORT149_RDWR), \
1846 GPIO_FN(MFG0_IN1), \
1847 GPIO_FN(PORT149_KEYOUT9),
1848 GPIO_FN(MFG0_IN2),
1849 GPIO_FN(TS_SPSYNC3), \
1850 GPIO_FN(MSIOF2_RSCK),
1851 GPIO_FN(TS_SDAT3), \
1852 GPIO_FN(MSIOF2_RSYNC),
1853 GPIO_FN(TPU1TO2), \
1854 GPIO_FN(TS_SDEN3), \
1855 GPIO_FN(PORT153_MSIOF2_SS1),
1856 GPIO_FN(SCIFA2_TXD1), \
1857 GPIO_FN(MSIOF2_MCK0),
1858 GPIO_FN(SCIFA2_RXD1), \
1859 GPIO_FN(MSIOF2_MCK1),
1860 GPIO_FN(SCIFA2_RTS1_), \
1861 GPIO_FN(PORT156_MSIOF2_SS2),
1862 GPIO_FN(SCIFA2_CTS1_), \
1863 GPIO_FN(PORT157_MSIOF2_RXD),
1864 GPIO_FN(DINT_), \
1865 GPIO_FN(SCIFA2_SCK1), \
1866 GPIO_FN(TS_SCK3),
1867 GPIO_FN(PORT159_SCIFB_SCK), \
1868 GPIO_FN(PORT159_SCIFA5_SCK), \
1869 GPIO_FN(NMI),
1870 GPIO_FN(PORT160_SCIFB_TXD), \
1871 GPIO_FN(PORT160_SCIFA5_TXD),
1872 GPIO_FN(PORT161_SCIFB_CTS_), \
1873 GPIO_FN(PORT161_SCIFA5_CTS_),
1874 GPIO_FN(PORT162_SCIFB_RXD), \
1875 GPIO_FN(PORT162_SCIFA5_RXD),
1876 GPIO_FN(PORT163_SCIFB_RTS_), \
1877 GPIO_FN(PORT163_SCIFA5_RTS_), \
1878 GPIO_FN(TPU3TO0),
1879 GPIO_FN(LCDD0),
1880 GPIO_FN(LCDD1), \
1881 GPIO_FN(PORT193_SCIFA5_CTS_), \
1882 GPIO_FN(BBIF2_TSYNC1),
1883 GPIO_FN(LCDD2), \
1884 GPIO_FN(PORT194_SCIFA5_RTS_), \
1885 GPIO_FN(BBIF2_TSCK1),
1886 GPIO_FN(LCDD3), \
1887 GPIO_FN(PORT195_SCIFA5_RXD), \
1888 GPIO_FN(BBIF2_TXD1),
1889 GPIO_FN(LCDD4), \
1890 GPIO_FN(PORT196_SCIFA5_TXD),
1891 GPIO_FN(LCDD5), \
1892 GPIO_FN(PORT197_SCIFA5_SCK), \
1893 GPIO_FN(MFG2_OUT2), \
1894 GPIO_FN(TPU2TO1),
1895 GPIO_FN(LCDD6),
1896 GPIO_FN(LCDD7), \
1897 GPIO_FN(TPU4TO1), \
1898 GPIO_FN(MFG4_OUT2),
1899 GPIO_FN(LCDD8), \
1900 GPIO_FN(D16),
1901 GPIO_FN(LCDD9), \
1902 GPIO_FN(D17),
1903 GPIO_FN(LCDD10), \
1904 GPIO_FN(D18),
1905 GPIO_FN(LCDD11), \
1906 GPIO_FN(D19),
1907 GPIO_FN(LCDD12), \
1908 GPIO_FN(D20),
1909 GPIO_FN(LCDD13), \
1910 GPIO_FN(D21),
1911 GPIO_FN(LCDD14), \
1912 GPIO_FN(D22),
1913 GPIO_FN(LCDD15), \
1914 GPIO_FN(PORT207_MSIOF0L_SS1), \
1915 GPIO_FN(D23),
1916 GPIO_FN(LCDD16), \
1917 GPIO_FN(PORT208_MSIOF0L_SS2), \
1918 GPIO_FN(D24),
1919 GPIO_FN(LCDD17), \
1920 GPIO_FN(D25),
1921 GPIO_FN(LCDD18), \
1922 GPIO_FN(DREQ2), \
1923 GPIO_FN(PORT210_MSIOF0L_SS1), \
1924 GPIO_FN(D26),
1925 GPIO_FN(LCDD19), \
1926 GPIO_FN(PORT211_MSIOF0L_SS2), \
1927 GPIO_FN(D27),
1928 GPIO_FN(LCDD20), \
1929 GPIO_FN(TS_SPSYNC1), \
1930 GPIO_FN(MSIOF0L_MCK0), \
1931 GPIO_FN(D28),
1932 GPIO_FN(LCDD21), \
1933 GPIO_FN(TS_SDAT1), \
1934 GPIO_FN(MSIOF0L_MCK1), \
1935 GPIO_FN(D29),
1936 GPIO_FN(LCDD22), \
1937 GPIO_FN(TS_SDEN1), \
1938 GPIO_FN(MSIOF0L_RSCK), \
1939 GPIO_FN(D30),
1940 GPIO_FN(LCDD23), \
1941 GPIO_FN(TS_SCK1), \
1942 GPIO_FN(MSIOF0L_RSYNC), \
1943 GPIO_FN(D31),
1944 GPIO_FN(LCDDCK), \
1945 GPIO_FN(LCDWR_),
1946 GPIO_FN(LCDRD_), \
1947 GPIO_FN(DACK2), \
1948 GPIO_FN(PORT217_LCD2RS), \
1949 GPIO_FN(MSIOF0L_TSYNC), \
1950 GPIO_FN(VIO2_FIELD3), \
1951 GPIO_FN(PORT217_LCD2DISP),
1952 GPIO_FN(LCDHSYN), \
1953 GPIO_FN(LCDCS_), \
1954 GPIO_FN(LCDCS2_), \
1955 GPIO_FN(DACK3), \
1956 GPIO_FN(PORT218_VIO_CKOR),
1957 GPIO_FN(LCDDISP), \
1958 GPIO_FN(LCDRS), \
1959 GPIO_FN(PORT219_LCD2WR_), \
1960 GPIO_FN(DREQ3), \
1961 GPIO_FN(MSIOF0L_TSCK), \
1962 GPIO_FN(VIO2_CLK3), \
1963 GPIO_FN(LCD2DCK_2),
1964 GPIO_FN(LCDVSYN), \
1965 GPIO_FN(LCDVSYN2),
1966 GPIO_FN(LCDLCLK), \
1967 GPIO_FN(DREQ1), \
1968 GPIO_FN(PORT221_LCD2CS_), \
1969 GPIO_FN(PWEN), \
1970 GPIO_FN(MSIOF0L_RXD), \
1971 GPIO_FN(VIO2_HD3), \
1972 GPIO_FN(PORT221_LCD2HSYN),
1973 GPIO_FN(LCDDON), \
1974 GPIO_FN(LCDDON2), \
1975 GPIO_FN(DACK1), \
1976 GPIO_FN(OVCN), \
1977 GPIO_FN(MSIOF0L_TXD), \
1978 GPIO_FN(VIO2_VD3), \
1979 GPIO_FN(PORT222_LCD2VSYN),
1980
1981 GPIO_FN(SCIFA1_TXD), \
1982 GPIO_FN(OVCN2),
1983 GPIO_FN(EXTLP), \
1984 GPIO_FN(SCIFA1_SCK), \
1985 GPIO_FN(PORT226_VIO_CKO2),
1986 GPIO_FN(SCIFA1_RTS_), \
1987 GPIO_FN(IDIN),
1988 GPIO_FN(SCIFA1_RXD),
1989 GPIO_FN(SCIFA1_CTS_), \
1990 GPIO_FN(MFG1_IN1),
1991 GPIO_FN(MSIOF1_TXD), \
1992 GPIO_FN(SCIFA2_TXD2),
1993 GPIO_FN(MSIOF1_TSYNC), \
1994 GPIO_FN(SCIFA2_CTS2_),
1995 GPIO_FN(MSIOF1_TSCK), \
1996 GPIO_FN(SCIFA2_SCK2),
1997 GPIO_FN(MSIOF1_RXD), \
1998 GPIO_FN(SCIFA2_RXD2),
1999 GPIO_FN(MSIOF1_RSCK), \
2000 GPIO_FN(SCIFA2_RTS2_), \
2001 GPIO_FN(VIO2_CLK2), \
2002 GPIO_FN(LCD2D20),
2003 GPIO_FN(MSIOF1_RSYNC), \
2004 GPIO_FN(MFG1_IN2), \
2005 GPIO_FN(VIO2_VD2), \
2006 GPIO_FN(LCD2D21),
2007 GPIO_FN(MSIOF1_MCK0), \
2008 GPIO_FN(PORT236_I2C_SDA2),
2009 GPIO_FN(MSIOF1_MCK1), \
2010 GPIO_FN(PORT237_I2C_SCL2),
2011 GPIO_FN(MSIOF1_SS1), \
2012 GPIO_FN(VIO2_FIELD2), \
2013 GPIO_FN(LCD2D22),
2014 GPIO_FN(MSIOF1_SS2), \
2015 GPIO_FN(VIO2_HD2), \
2016 GPIO_FN(LCD2D23),
2017 GPIO_FN(SCIFA6_TXD),
2018 GPIO_FN(PORT241_IRDA_OUT), \
2019 GPIO_FN(PORT241_IROUT), \
2020 GPIO_FN(MFG4_OUT1), \
2021 GPIO_FN(TPU4TO0),
2022 GPIO_FN(PORT242_IRDA_IN), \
2023 GPIO_FN(MFG4_IN2),
2024 GPIO_FN(PORT243_IRDA_FIRSEL), \
2025 GPIO_FN(PORT243_VIO_CKO2),
2026 GPIO_FN(PORT244_SCIFA5_CTS_), \
2027 GPIO_FN(MFG2_IN1), \
2028 GPIO_FN(PORT244_SCIFB_CTS_), \
2029 GPIO_FN(MSIOF2R_RXD),
2030 GPIO_FN(PORT245_SCIFA5_RTS_), \
2031 GPIO_FN(MFG2_IN2), \
2032 GPIO_FN(PORT245_SCIFB_RTS_), \
2033 GPIO_FN(MSIOF2R_TXD),
2034 GPIO_FN(PORT246_SCIFA5_RXD), \
2035 GPIO_FN(MFG1_OUT1), \
2036 GPIO_FN(PORT246_SCIFB_RXD), \
2037 GPIO_FN(TPU1TO0),
2038 GPIO_FN(PORT247_SCIFA5_TXD), \
2039 GPIO_FN(MFG3_OUT2), \
2040 GPIO_FN(PORT247_SCIFB_TXD), \
2041 GPIO_FN(TPU3TO1),
2042 GPIO_FN(PORT248_SCIFA5_SCK), \
2043 GPIO_FN(MFG2_OUT1), \
2044 GPIO_FN(PORT248_SCIFB_SCK), \
2045 GPIO_FN(TPU2TO0), \
2046 GPIO_FN(PORT248_I2C_SCL3), \
2047 GPIO_FN(MSIOF2R_TSCK),
2048 GPIO_FN(PORT249_IROUT), \
2049 GPIO_FN(MFG4_IN1), \
2050 GPIO_FN(PORT249_I2C_SDA3), \
2051 GPIO_FN(MSIOF2R_TSYNC),
2052 GPIO_FN(SDHICLK0),
2053 GPIO_FN(SDHICD0),
2054 GPIO_FN(SDHID0_0),
2055 GPIO_FN(SDHID0_1),
2056 GPIO_FN(SDHID0_2),
2057 GPIO_FN(SDHID0_3),
2058 GPIO_FN(SDHICMD0),
2059 GPIO_FN(SDHIWP0),
2060 GPIO_FN(SDHICLK1),
2061 GPIO_FN(SDHID1_0), \
2062 GPIO_FN(TS_SPSYNC2),
2063 GPIO_FN(SDHID1_1), \
2064 GPIO_FN(TS_SDAT2),
2065 GPIO_FN(SDHID1_2), \
2066 GPIO_FN(TS_SDEN2),
2067 GPIO_FN(SDHID1_3), \
2068 GPIO_FN(TS_SCK2),
2069 GPIO_FN(SDHICMD1),
2070 GPIO_FN(SDHICLK2),
2071 GPIO_FN(SDHID2_0), \
2072 GPIO_FN(TS_SPSYNC4),
2073 GPIO_FN(SDHID2_1), \
2074 GPIO_FN(TS_SDAT4),
2075 GPIO_FN(SDHID2_2), \
2076 GPIO_FN(TS_SDEN4),
2077 GPIO_FN(SDHID2_3), \
2078 GPIO_FN(TS_SCK4),
2079 GPIO_FN(SDHICMD2),
2080 GPIO_FN(MMCCLK0),
2081 GPIO_FN(MMCD0_0),
2082 GPIO_FN(MMCD0_1),
2083 GPIO_FN(MMCD0_2),
2084 GPIO_FN(MMCD0_3),
2085 GPIO_FN(MMCD0_4), \
2086 GPIO_FN(TS_SPSYNC5),
2087 GPIO_FN(MMCD0_5), \
2088 GPIO_FN(TS_SDAT5),
2089 GPIO_FN(MMCD0_6), \
2090 GPIO_FN(TS_SDEN5),
2091 GPIO_FN(MMCD0_7), \
2092 GPIO_FN(TS_SCK5),
2093 GPIO_FN(MMCCMD0),
2094 GPIO_FN(RESETOUTS_), \
2095 GPIO_FN(EXTAL2OUT),
2096 GPIO_FN(MCP_WAIT__MCP_FRB),
2097 GPIO_FN(MCP_CKO), \
2098 GPIO_FN(MMCCLK1),
2099 GPIO_FN(MCP_D15_MCP_NAF15),
2100 GPIO_FN(MCP_D14_MCP_NAF14),
2101 GPIO_FN(MCP_D13_MCP_NAF13),
2102 GPIO_FN(MCP_D12_MCP_NAF12),
2103 GPIO_FN(MCP_D11_MCP_NAF11),
2104 GPIO_FN(MCP_D10_MCP_NAF10),
2105 GPIO_FN(MCP_D9_MCP_NAF9),
2106 GPIO_FN(MCP_D8_MCP_NAF8), \
2107 GPIO_FN(MMCCMD1),
2108 GPIO_FN(MCP_D7_MCP_NAF7), \
2109 GPIO_FN(MMCD1_7),
2110
2111 GPIO_FN(MCP_D6_MCP_NAF6), \
2112 GPIO_FN(MMCD1_6),
2113 GPIO_FN(MCP_D5_MCP_NAF5), \
2114 GPIO_FN(MMCD1_5),
2115 GPIO_FN(MCP_D4_MCP_NAF4), \
2116 GPIO_FN(MMCD1_4),
2117 GPIO_FN(MCP_D3_MCP_NAF3), \
2118 GPIO_FN(MMCD1_3),
2119 GPIO_FN(MCP_D2_MCP_NAF2), \
2120 GPIO_FN(MMCD1_2),
2121 GPIO_FN(MCP_D1_MCP_NAF1), \
2122 GPIO_FN(MMCD1_1),
2123 GPIO_FN(MCP_D0_MCP_NAF0), \
2124 GPIO_FN(MMCD1_0),
2125 GPIO_FN(MCP_NBRSTOUT_),
2126 GPIO_FN(MCP_WE0__MCP_FWE), \
2127 GPIO_FN(MCP_RDWR_MCP_FWE),
2128
2129 /* MSEL2 special cases */
2130 GPIO_FN(TSIF2_TS_XX1),
2131 GPIO_FN(TSIF2_TS_XX2),
2132 GPIO_FN(TSIF2_TS_XX3),
2133 GPIO_FN(TSIF2_TS_XX4),
2134 GPIO_FN(TSIF2_TS_XX5),
2135 GPIO_FN(TSIF1_TS_XX1),
2136 GPIO_FN(TSIF1_TS_XX2),
2137 GPIO_FN(TSIF1_TS_XX3),
2138 GPIO_FN(TSIF1_TS_XX4),
2139 GPIO_FN(TSIF1_TS_XX5),
2140 GPIO_FN(TSIF0_TS_XX1),
2141 GPIO_FN(TSIF0_TS_XX2),
2142 GPIO_FN(TSIF0_TS_XX3),
2143 GPIO_FN(TSIF0_TS_XX4),
2144 GPIO_FN(TSIF0_TS_XX5),
2145 GPIO_FN(MST1_TS_XX1),
2146 GPIO_FN(MST1_TS_XX2),
2147 GPIO_FN(MST1_TS_XX3),
2148 GPIO_FN(MST1_TS_XX4),
2149 GPIO_FN(MST1_TS_XX5),
2150 GPIO_FN(MST0_TS_XX1),
2151 GPIO_FN(MST0_TS_XX2),
2152 GPIO_FN(MST0_TS_XX3),
2153 GPIO_FN(MST0_TS_XX4),
2154 GPIO_FN(MST0_TS_XX5),
2155
2156 /* MSEL3 special cases */
2157 GPIO_FN(SDHI0_VCCQ_MC0_ON),
2158 GPIO_FN(SDHI0_VCCQ_MC0_OFF),
2159 GPIO_FN(DEBUG_MON_VIO),
2160 GPIO_FN(DEBUG_MON_LCDD),
2161 GPIO_FN(LCDC_LCDC0),
2162 GPIO_FN(LCDC_LCDC1),
2163
2164 /* MSEL4 special cases */
2165 GPIO_FN(IRQ9_MEM_INT),
2166 GPIO_FN(IRQ9_MCP_INT),
2167 GPIO_FN(A11),
2168 GPIO_FN(KEYOUT8),
2169 GPIO_FN(TPU4TO3),
2170 GPIO_FN(RESETA_N_PU_ON),
2171 GPIO_FN(RESETA_N_PU_OFF),
2172 GPIO_FN(EDBGREQ_PD),
2173 GPIO_FN(EDBGREQ_PU),
2174
2175 /* Functions with pull-ups */
2176 GPIO_FN(KEYIN0_PU),
2177 GPIO_FN(KEYIN1_PU),
2178 GPIO_FN(KEYIN2_PU),
2179 GPIO_FN(KEYIN3_PU),
2180 GPIO_FN(KEYIN4_PU),
2181 GPIO_FN(KEYIN5_PU),
2182 GPIO_FN(KEYIN6_PU),
2183 GPIO_FN(KEYIN7_PU),
2184 GPIO_FN(SDHID1_0_PU),
2185 GPIO_FN(SDHID1_1_PU),
2186 GPIO_FN(SDHID1_2_PU),
2187 GPIO_FN(SDHID1_3_PU),
2188 GPIO_FN(SDHICMD1_PU),
2189 GPIO_FN(MMCCMD0_PU),
2190 GPIO_FN(MMCCMD1_PU),
2191 GPIO_FN(FSIACK_PU),
2192 GPIO_FN(FSIAILR_PU),
2193 GPIO_FN(FSIAIBT_PU),
2194 GPIO_FN(FSIAISLD_PU),
2195};
2196
2197#define PORTCR(nr, reg) \
2198 { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
2199 0, \
2200 /*0001*/ PORT##nr##_OUT , \
2201 /*0010*/ PORT##nr##_IN , 0, 0, 0, 0, 0, 0, 0, \
2202 /*1010*/ PORT##nr##_IN_PD, 0, 0, 0, \
2203 /*1110*/ PORT##nr##_IN_PU, 0, \
2204 PORT##nr##_FN0, PORT##nr##_FN1, PORT##nr##_FN2, \
2205 PORT##nr##_FN3, PORT##nr##_FN4, PORT##nr##_FN5, \
2206 PORT##nr##_FN6, PORT##nr##_FN7, 0, 0, 0, 0, 0, 0, 0, 0 } \
2207 }
2208
2209static struct pinmux_cfg_reg pinmux_config_regs[] = {
2210 PORTCR(0, 0xe6050000), /* PORT0CR */
2211 PORTCR(1, 0xe6050001), /* PORT1CR */
2212 PORTCR(2, 0xe6050002), /* PORT2CR */
2213 PORTCR(3, 0xe6050003), /* PORT3CR */
2214 PORTCR(4, 0xe6050004), /* PORT4CR */
2215 PORTCR(5, 0xe6050005), /* PORT5CR */
2216 PORTCR(6, 0xe6050006), /* PORT6CR */
2217 PORTCR(7, 0xe6050007), /* PORT7CR */
2218 PORTCR(8, 0xe6050008), /* PORT8CR */
2219 PORTCR(9, 0xe6050009), /* PORT9CR */
2220
2221 PORTCR(10, 0xe605000a), /* PORT10CR */
2222 PORTCR(11, 0xe605000b), /* PORT11CR */
2223 PORTCR(12, 0xe605000c), /* PORT12CR */
2224 PORTCR(13, 0xe605000d), /* PORT13CR */
2225 PORTCR(14, 0xe605000e), /* PORT14CR */
2226 PORTCR(15, 0xe605000f), /* PORT15CR */
2227 PORTCR(16, 0xe6050010), /* PORT16CR */
2228 PORTCR(17, 0xe6050011), /* PORT17CR */
2229 PORTCR(18, 0xe6050012), /* PORT18CR */
2230 PORTCR(19, 0xe6050013), /* PORT19CR */
2231
2232 PORTCR(20, 0xe6050014), /* PORT20CR */
2233 PORTCR(21, 0xe6050015), /* PORT21CR */
2234 PORTCR(22, 0xe6050016), /* PORT22CR */
2235 PORTCR(23, 0xe6050017), /* PORT23CR */
2236 PORTCR(24, 0xe6050018), /* PORT24CR */
2237 PORTCR(25, 0xe6050019), /* PORT25CR */
2238 PORTCR(26, 0xe605001a), /* PORT26CR */
2239 PORTCR(27, 0xe605001b), /* PORT27CR */
2240 PORTCR(28, 0xe605001c), /* PORT28CR */
2241 PORTCR(29, 0xe605001d), /* PORT29CR */
2242
2243 PORTCR(30, 0xe605001e), /* PORT30CR */
2244 PORTCR(31, 0xe605001f), /* PORT31CR */
2245 PORTCR(32, 0xe6051020), /* PORT32CR */
2246 PORTCR(33, 0xe6051021), /* PORT33CR */
2247 PORTCR(34, 0xe6051022), /* PORT34CR */
2248 PORTCR(35, 0xe6051023), /* PORT35CR */
2249 PORTCR(36, 0xe6051024), /* PORT36CR */
2250 PORTCR(37, 0xe6051025), /* PORT37CR */
2251 PORTCR(38, 0xe6051026), /* PORT38CR */
2252 PORTCR(39, 0xe6051027), /* PORT39CR */
2253
2254 PORTCR(40, 0xe6051028), /* PORT40CR */
2255 PORTCR(41, 0xe6051029), /* PORT41CR */
2256 PORTCR(42, 0xe605102a), /* PORT42CR */
2257 PORTCR(43, 0xe605102b), /* PORT43CR */
2258 PORTCR(44, 0xe605102c), /* PORT44CR */
2259 PORTCR(45, 0xe605102d), /* PORT45CR */
2260 PORTCR(46, 0xe605102e), /* PORT46CR */
2261 PORTCR(47, 0xe605102f), /* PORT47CR */
2262 PORTCR(48, 0xe6051030), /* PORT48CR */
2263 PORTCR(49, 0xe6051031), /* PORT49CR */
2264
2265 PORTCR(50, 0xe6051032), /* PORT50CR */
2266 PORTCR(51, 0xe6051033), /* PORT51CR */
2267 PORTCR(52, 0xe6051034), /* PORT52CR */
2268 PORTCR(53, 0xe6051035), /* PORT53CR */
2269 PORTCR(54, 0xe6051036), /* PORT54CR */
2270 PORTCR(55, 0xe6051037), /* PORT55CR */
2271 PORTCR(56, 0xe6051038), /* PORT56CR */
2272 PORTCR(57, 0xe6051039), /* PORT57CR */
2273 PORTCR(58, 0xe605103a), /* PORT58CR */
2274 PORTCR(59, 0xe605103b), /* PORT59CR */
2275
2276 PORTCR(60, 0xe605103c), /* PORT60CR */
2277 PORTCR(61, 0xe605103d), /* PORT61CR */
2278 PORTCR(62, 0xe605103e), /* PORT62CR */
2279 PORTCR(63, 0xe605103f), /* PORT63CR */
2280 PORTCR(64, 0xe6051040), /* PORT64CR */
2281 PORTCR(65, 0xe6051041), /* PORT65CR */
2282 PORTCR(66, 0xe6051042), /* PORT66CR */
2283 PORTCR(67, 0xe6051043), /* PORT67CR */
2284 PORTCR(68, 0xe6051044), /* PORT68CR */
2285 PORTCR(69, 0xe6051045), /* PORT69CR */
2286
2287 PORTCR(70, 0xe6051046), /* PORT70CR */
2288 PORTCR(71, 0xe6051047), /* PORT71CR */
2289 PORTCR(72, 0xe6051048), /* PORT72CR */
2290 PORTCR(73, 0xe6051049), /* PORT73CR */
2291 PORTCR(74, 0xe605104a), /* PORT74CR */
2292 PORTCR(75, 0xe605104b), /* PORT75CR */
2293 PORTCR(76, 0xe605104c), /* PORT76CR */
2294 PORTCR(77, 0xe605104d), /* PORT77CR */
2295 PORTCR(78, 0xe605104e), /* PORT78CR */
2296 PORTCR(79, 0xe605104f), /* PORT79CR */
2297
2298 PORTCR(80, 0xe6051050), /* PORT80CR */
2299 PORTCR(81, 0xe6051051), /* PORT81CR */
2300 PORTCR(82, 0xe6051052), /* PORT82CR */
2301 PORTCR(83, 0xe6051053), /* PORT83CR */
2302 PORTCR(84, 0xe6051054), /* PORT84CR */
2303 PORTCR(85, 0xe6051055), /* PORT85CR */
2304 PORTCR(86, 0xe6051056), /* PORT86CR */
2305 PORTCR(87, 0xe6051057), /* PORT87CR */
2306 PORTCR(88, 0xe6051058), /* PORT88CR */
2307 PORTCR(89, 0xe6051059), /* PORT89CR */
2308
2309 PORTCR(90, 0xe605105a), /* PORT90CR */
2310 PORTCR(91, 0xe605105b), /* PORT91CR */
2311 PORTCR(92, 0xe605105c), /* PORT92CR */
2312 PORTCR(93, 0xe605105d), /* PORT93CR */
2313 PORTCR(94, 0xe605105e), /* PORT94CR */
2314 PORTCR(95, 0xe605105f), /* PORT95CR */
2315 PORTCR(96, 0xe6052060), /* PORT96CR */
2316 PORTCR(97, 0xe6052061), /* PORT97CR */
2317 PORTCR(98, 0xe6052062), /* PORT98CR */
2318 PORTCR(99, 0xe6052063), /* PORT99CR */
2319
2320 PORTCR(100, 0xe6052064), /* PORT100CR */
2321 PORTCR(101, 0xe6052065), /* PORT101CR */
2322 PORTCR(102, 0xe6052066), /* PORT102CR */
2323 PORTCR(103, 0xe6052067), /* PORT103CR */
2324 PORTCR(104, 0xe6052068), /* PORT104CR */
2325 PORTCR(105, 0xe6052069), /* PORT105CR */
2326 PORTCR(106, 0xe605206a), /* PORT106CR */
2327 PORTCR(107, 0xe605206b), /* PORT107CR */
2328 PORTCR(108, 0xe605206c), /* PORT108CR */
2329 PORTCR(109, 0xe605206d), /* PORT109CR */
2330
2331 PORTCR(110, 0xe605206e), /* PORT110CR */
2332 PORTCR(111, 0xe605206f), /* PORT111CR */
2333 PORTCR(112, 0xe6052070), /* PORT112CR */
2334 PORTCR(113, 0xe6052071), /* PORT113CR */
2335 PORTCR(114, 0xe6052072), /* PORT114CR */
2336 PORTCR(115, 0xe6052073), /* PORT115CR */
2337 PORTCR(116, 0xe6052074), /* PORT116CR */
2338 PORTCR(117, 0xe6052075), /* PORT117CR */
2339 PORTCR(118, 0xe6052076), /* PORT118CR */
2340
2341 PORTCR(128, 0xe6052080), /* PORT128CR */
2342 PORTCR(129, 0xe6052081), /* PORT129CR */
2343
2344 PORTCR(130, 0xe6052082), /* PORT130CR */
2345 PORTCR(131, 0xe6052083), /* PORT131CR */
2346 PORTCR(132, 0xe6052084), /* PORT132CR */
2347 PORTCR(133, 0xe6052085), /* PORT133CR */
2348 PORTCR(134, 0xe6052086), /* PORT134CR */
2349 PORTCR(135, 0xe6052087), /* PORT135CR */
2350 PORTCR(136, 0xe6052088), /* PORT136CR */
2351 PORTCR(137, 0xe6052089), /* PORT137CR */
2352 PORTCR(138, 0xe605208a), /* PORT138CR */
2353 PORTCR(139, 0xe605208b), /* PORT139CR */
2354
2355 PORTCR(140, 0xe605208c), /* PORT140CR */
2356 PORTCR(141, 0xe605208d), /* PORT141CR */
2357 PORTCR(142, 0xe605208e), /* PORT142CR */
2358 PORTCR(143, 0xe605208f), /* PORT143CR */
2359 PORTCR(144, 0xe6052090), /* PORT144CR */
2360 PORTCR(145, 0xe6052091), /* PORT145CR */
2361 PORTCR(146, 0xe6052092), /* PORT146CR */
2362 PORTCR(147, 0xe6052093), /* PORT147CR */
2363 PORTCR(148, 0xe6052094), /* PORT148CR */
2364 PORTCR(149, 0xe6052095), /* PORT149CR */
2365
2366 PORTCR(150, 0xe6052096), /* PORT150CR */
2367 PORTCR(151, 0xe6052097), /* PORT151CR */
2368 PORTCR(152, 0xe6052098), /* PORT152CR */
2369 PORTCR(153, 0xe6052099), /* PORT153CR */
2370 PORTCR(154, 0xe605209a), /* PORT154CR */
2371 PORTCR(155, 0xe605209b), /* PORT155CR */
2372 PORTCR(156, 0xe605209c), /* PORT156CR */
2373 PORTCR(157, 0xe605209d), /* PORT157CR */
2374 PORTCR(158, 0xe605209e), /* PORT158CR */
2375 PORTCR(159, 0xe605209f), /* PORT159CR */
2376
2377 PORTCR(160, 0xe60520a0), /* PORT160CR */
2378 PORTCR(161, 0xe60520a1), /* PORT161CR */
2379 PORTCR(162, 0xe60520a2), /* PORT162CR */
2380 PORTCR(163, 0xe60520a3), /* PORT163CR */
2381 PORTCR(164, 0xe60520a4), /* PORT164CR */
2382
2383 PORTCR(192, 0xe60520c0), /* PORT192CR */
2384 PORTCR(193, 0xe60520c1), /* PORT193CR */
2385 PORTCR(194, 0xe60520c2), /* PORT194CR */
2386 PORTCR(195, 0xe60520c3), /* PORT195CR */
2387 PORTCR(196, 0xe60520c4), /* PORT196CR */
2388 PORTCR(197, 0xe60520c5), /* PORT197CR */
2389 PORTCR(198, 0xe60520c6), /* PORT198CR */
2390 PORTCR(199, 0xe60520c7), /* PORT199CR */
2391
2392 PORTCR(200, 0xe60520c8), /* PORT200CR */
2393 PORTCR(201, 0xe60520c9), /* PORT201CR */
2394 PORTCR(202, 0xe60520ca), /* PORT202CR */
2395 PORTCR(203, 0xe60520cb), /* PORT203CR */
2396 PORTCR(204, 0xe60520cc), /* PORT204CR */
2397 PORTCR(205, 0xe60520cd), /* PORT205CR */
2398 PORTCR(206, 0xe60520ce), /* PORT206CR */
2399 PORTCR(207, 0xe60520cf), /* PORT207CR */
2400 PORTCR(208, 0xe60520d0), /* PORT208CR */
2401 PORTCR(209, 0xe60520d1), /* PORT209CR */
2402
2403 PORTCR(210, 0xe60520d2), /* PORT210CR */
2404 PORTCR(211, 0xe60520d3), /* PORT211CR */
2405 PORTCR(212, 0xe60520d4), /* PORT212CR */
2406 PORTCR(213, 0xe60520d5), /* PORT213CR */
2407 PORTCR(214, 0xe60520d6), /* PORT214CR */
2408 PORTCR(215, 0xe60520d7), /* PORT215CR */
2409 PORTCR(216, 0xe60520d8), /* PORT216CR */
2410 PORTCR(217, 0xe60520d9), /* PORT217CR */
2411 PORTCR(218, 0xe60520da), /* PORT218CR */
2412 PORTCR(219, 0xe60520db), /* PORT219CR */
2413
2414 PORTCR(220, 0xe60520dc), /* PORT220CR */
2415 PORTCR(221, 0xe60520dd), /* PORT221CR */
2416 PORTCR(222, 0xe60520de), /* PORT222CR */
2417 PORTCR(223, 0xe60520df), /* PORT223CR */
2418 PORTCR(224, 0xe60530e0), /* PORT224CR */
2419 PORTCR(225, 0xe60530e1), /* PORT225CR */
2420 PORTCR(226, 0xe60530e2), /* PORT226CR */
2421 PORTCR(227, 0xe60530e3), /* PORT227CR */
2422 PORTCR(228, 0xe60530e4), /* PORT228CR */
2423 PORTCR(229, 0xe60530e5), /* PORT229CR */
2424
2425 PORTCR(230, 0xe60530e6), /* PORT230CR */
2426 PORTCR(231, 0xe60530e7), /* PORT231CR */
2427 PORTCR(232, 0xe60530e8), /* PORT232CR */
2428 PORTCR(233, 0xe60530e9), /* PORT233CR */
2429 PORTCR(234, 0xe60530ea), /* PORT234CR */
2430 PORTCR(235, 0xe60530eb), /* PORT235CR */
2431 PORTCR(236, 0xe60530ec), /* PORT236CR */
2432 PORTCR(237, 0xe60530ed), /* PORT237CR */
2433 PORTCR(238, 0xe60530ee), /* PORT238CR */
2434 PORTCR(239, 0xe60530ef), /* PORT239CR */
2435
2436 PORTCR(240, 0xe60530f0), /* PORT240CR */
2437 PORTCR(241, 0xe60530f1), /* PORT241CR */
2438 PORTCR(242, 0xe60530f2), /* PORT242CR */
2439 PORTCR(243, 0xe60530f3), /* PORT243CR */
2440 PORTCR(244, 0xe60530f4), /* PORT244CR */
2441 PORTCR(245, 0xe60530f5), /* PORT245CR */
2442 PORTCR(246, 0xe60530f6), /* PORT246CR */
2443 PORTCR(247, 0xe60530f7), /* PORT247CR */
2444 PORTCR(248, 0xe60530f8), /* PORT248CR */
2445 PORTCR(249, 0xe60530f9), /* PORT249CR */
2446
2447 PORTCR(250, 0xe60530fa), /* PORT250CR */
2448 PORTCR(251, 0xe60530fb), /* PORT251CR */
2449 PORTCR(252, 0xe60530fc), /* PORT252CR */
2450 PORTCR(253, 0xe60530fd), /* PORT253CR */
2451 PORTCR(254, 0xe60530fe), /* PORT254CR */
2452 PORTCR(255, 0xe60530ff), /* PORT255CR */
2453 PORTCR(256, 0xe6053100), /* PORT256CR */
2454 PORTCR(257, 0xe6053101), /* PORT257CR */
2455 PORTCR(258, 0xe6053102), /* PORT258CR */
2456 PORTCR(259, 0xe6053103), /* PORT259CR */
2457
2458 PORTCR(260, 0xe6053104), /* PORT260CR */
2459 PORTCR(261, 0xe6053105), /* PORT261CR */
2460 PORTCR(262, 0xe6053106), /* PORT262CR */
2461 PORTCR(263, 0xe6053107), /* PORT263CR */
2462 PORTCR(264, 0xe6053108), /* PORT264CR */
2463 PORTCR(265, 0xe6053109), /* PORT265CR */
2464 PORTCR(266, 0xe605310a), /* PORT266CR */
2465 PORTCR(267, 0xe605310b), /* PORT267CR */
2466 PORTCR(268, 0xe605310c), /* PORT268CR */
2467 PORTCR(269, 0xe605310d), /* PORT269CR */
2468
2469 PORTCR(270, 0xe605310e), /* PORT270CR */
2470 PORTCR(271, 0xe605310f), /* PORT271CR */
2471 PORTCR(272, 0xe6053110), /* PORT272CR */
2472 PORTCR(273, 0xe6053111), /* PORT273CR */
2473 PORTCR(274, 0xe6053112), /* PORT274CR */
2474 PORTCR(275, 0xe6053113), /* PORT275CR */
2475 PORTCR(276, 0xe6053114), /* PORT276CR */
2476 PORTCR(277, 0xe6053115), /* PORT277CR */
2477 PORTCR(278, 0xe6053116), /* PORT278CR */
2478 PORTCR(279, 0xe6053117), /* PORT279CR */
2479
2480 PORTCR(280, 0xe6053118), /* PORT280CR */
2481 PORTCR(281, 0xe6053119), /* PORT281CR */
2482 PORTCR(282, 0xe605311a), /* PORT282CR */
2483
2484 PORTCR(288, 0xe6052120), /* PORT288CR */
2485 PORTCR(289, 0xe6052121), /* PORT289CR */
2486
2487 PORTCR(290, 0xe6052122), /* PORT290CR */
2488 PORTCR(291, 0xe6052123), /* PORT291CR */
2489 PORTCR(292, 0xe6052124), /* PORT292CR */
2490 PORTCR(293, 0xe6052125), /* PORT293CR */
2491 PORTCR(294, 0xe6052126), /* PORT294CR */
2492 PORTCR(295, 0xe6052127), /* PORT295CR */
2493 PORTCR(296, 0xe6052128), /* PORT296CR */
2494 PORTCR(297, 0xe6052129), /* PORT297CR */
2495 PORTCR(298, 0xe605212a), /* PORT298CR */
2496 PORTCR(299, 0xe605212b), /* PORT299CR */
2497
2498 PORTCR(300, 0xe605212c), /* PORT300CR */
2499 PORTCR(301, 0xe605212d), /* PORT301CR */
2500 PORTCR(302, 0xe605212e), /* PORT302CR */
2501 PORTCR(303, 0xe605212f), /* PORT303CR */
2502 PORTCR(304, 0xe6052130), /* PORT304CR */
2503 PORTCR(305, 0xe6052131), /* PORT305CR */
2504 PORTCR(306, 0xe6052132), /* PORT306CR */
2505 PORTCR(307, 0xe6052133), /* PORT307CR */
2506 PORTCR(308, 0xe6052134), /* PORT308CR */
2507 PORTCR(309, 0xe6052135), /* PORT309CR */
2508
2509 { PINMUX_CFG_REG("MSEL2CR", 0xe605801c, 32, 1) {
2510 0, 0,
2511 0, 0,
2512 0, 0,
2513 0, 0,
2514 0, 0,
2515 0, 0,
2516 0, 0,
2517 0, 0,
2518 0, 0,
2519 0, 0,
2520 0, 0,
2521 0, 0,
2522 MSEL2CR_MSEL19_0, MSEL2CR_MSEL19_1,
2523 MSEL2CR_MSEL18_0, MSEL2CR_MSEL18_1,
2524 MSEL2CR_MSEL17_0, MSEL2CR_MSEL17_1,
2525 MSEL2CR_MSEL16_0, MSEL2CR_MSEL16_1,
2526 0, 0,
2527 MSEL2CR_MSEL14_0, MSEL2CR_MSEL14_1,
2528 MSEL2CR_MSEL13_0, MSEL2CR_MSEL13_1,
2529 MSEL2CR_MSEL12_0, MSEL2CR_MSEL12_1,
2530 MSEL2CR_MSEL11_0, MSEL2CR_MSEL11_1,
2531 MSEL2CR_MSEL10_0, MSEL2CR_MSEL10_1,
2532 MSEL2CR_MSEL9_0, MSEL2CR_MSEL9_1,
2533 MSEL2CR_MSEL8_0, MSEL2CR_MSEL8_1,
2534 MSEL2CR_MSEL7_0, MSEL2CR_MSEL7_1,
2535 MSEL2CR_MSEL6_0, MSEL2CR_MSEL6_1,
2536 MSEL2CR_MSEL5_0, MSEL2CR_MSEL5_1,
2537 MSEL2CR_MSEL4_0, MSEL2CR_MSEL4_1,
2538 MSEL2CR_MSEL3_0, MSEL2CR_MSEL3_1,
2539 MSEL2CR_MSEL2_0, MSEL2CR_MSEL2_1,
2540 MSEL2CR_MSEL1_0, MSEL2CR_MSEL1_1,
2541 MSEL2CR_MSEL0_0, MSEL2CR_MSEL0_1,
2542 }
2543 },
2544 { PINMUX_CFG_REG("MSEL3CR", 0xe6058020, 32, 1) {
2545 0, 0,
2546 0, 0,
2547 0, 0,
2548 MSEL3CR_MSEL28_0, MSEL3CR_MSEL28_1,
2549 0, 0,
2550 0, 0,
2551 0, 0,
2552 0, 0,
2553 0, 0,
2554 0, 0,
2555 0, 0,
2556 0, 0,
2557 0, 0,
2558 0, 0,
2559 0, 0,
2560 0, 0,
2561 MSEL3CR_MSEL15_0, MSEL3CR_MSEL15_1,
2562 0, 0,
2563 0, 0,
2564 0, 0,
2565 MSEL3CR_MSEL11_0, MSEL3CR_MSEL11_1,
2566 0, 0,
2567 MSEL3CR_MSEL9_0, MSEL3CR_MSEL9_1,
2568 0, 0,
2569 0, 0,
2570 MSEL3CR_MSEL6_0, MSEL3CR_MSEL6_1,
2571 0, 0,
2572 0, 0,
2573 0, 0,
2574 MSEL3CR_MSEL2_0, MSEL3CR_MSEL2_1,
2575 0, 0,
2576 0, 0,
2577 }
2578 },
2579 { PINMUX_CFG_REG("MSEL4CR", 0xe6058024, 32, 1) {
2580 0, 0,
2581 0, 0,
2582 MSEL4CR_MSEL29_0, MSEL4CR_MSEL29_1,
2583 0, 0,
2584 MSEL4CR_MSEL27_0, MSEL4CR_MSEL27_1,
2585 MSEL4CR_MSEL26_0, MSEL4CR_MSEL26_1,
2586 0, 0,
2587 0, 0,
2588 0, 0,
2589 MSEL4CR_MSEL22_0, MSEL4CR_MSEL22_1,
2590 MSEL4CR_MSEL21_0, MSEL4CR_MSEL21_1,
2591 MSEL4CR_MSEL20_0, MSEL4CR_MSEL20_1,
2592 MSEL4CR_MSEL19_0, MSEL4CR_MSEL19_1,
2593 0, 0,
2594 0, 0,
2595 0, 0,
2596 MSEL4CR_MSEL15_0, MSEL4CR_MSEL15_1,
2597 0, 0,
2598 MSEL4CR_MSEL13_0, MSEL4CR_MSEL13_1,
2599 MSEL4CR_MSEL12_0, MSEL4CR_MSEL12_1,
2600 MSEL4CR_MSEL11_0, MSEL4CR_MSEL11_1,
2601 MSEL4CR_MSEL10_0, MSEL4CR_MSEL10_1,
2602 MSEL4CR_MSEL9_0, MSEL4CR_MSEL9_1,
2603 MSEL4CR_MSEL8_0, MSEL4CR_MSEL8_1,
2604 MSEL4CR_MSEL7_0, MSEL4CR_MSEL7_1,
2605 0, 0,
2606 0, 0,
2607 MSEL4CR_MSEL4_0, MSEL4CR_MSEL4_1,
2608 0, 0,
2609 0, 0,
2610 MSEL4CR_MSEL1_0, MSEL4CR_MSEL1_1,
2611 0, 0,
2612 }
2613 },
2614 { },
2615};
2616
2617static struct pinmux_data_reg pinmux_data_regs[] = {
2618 { PINMUX_DATA_REG("PORTL031_000DR", 0xe6054000, 32) {
2619 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
2620 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
2621 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
2622 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
2623 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
2624 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
2625 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
2626 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA }
2627 },
2628 { PINMUX_DATA_REG("PORTD063_032DR", 0xe6055000, 32) {
2629 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
2630 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
2631 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
2632 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
2633 PORT47_DATA, PORT46_DATA, PORT45_DATA, PORT44_DATA,
2634 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
2635 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
2636 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA }
2637 },
2638 { PINMUX_DATA_REG("PORTD095_064DR", 0xe6055004, 32) {
2639 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
2640 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
2641 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
2642 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
2643 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
2644 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
2645 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
2646 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA }
2647 },
2648 { PINMUX_DATA_REG("PORTR127_096DR", 0xe6056000, 32) {
2649 0, 0, 0, 0,
2650 0, 0, 0, 0,
2651 0, PORT118_DATA, PORT117_DATA, PORT116_DATA,
2652 PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
2653 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
2654 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
2655 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
2656 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA }
2657 },
2658 { PINMUX_DATA_REG("PORTR159_128DR", 0xe6056004, 32) {
2659 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
2660 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
2661 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
2662 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
2663 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
2664 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
2665 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
2666 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA }
2667 },
2668 { PINMUX_DATA_REG("PORTR191_160DR", 0xe6056008, 32) {
2669 0, 0, 0, 0,
2670 0, 0, 0, 0,
2671 0, 0, 0, 0,
2672 0, 0, 0, 0,
2673 0, 0, 0, 0,
2674 0, 0, 0, 0,
2675 0, 0, 0, PORT164_DATA,
2676 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA }
2677 },
2678 { PINMUX_DATA_REG("PORTR223_192DR", 0xe605600C, 32) {
2679 PORT223_DATA, PORT222_DATA, PORT221_DATA, PORT220_DATA,
2680 PORT219_DATA, PORT218_DATA, PORT217_DATA, PORT216_DATA,
2681 PORT215_DATA, PORT214_DATA, PORT213_DATA, PORT212_DATA,
2682 PORT211_DATA, PORT210_DATA, PORT209_DATA, PORT208_DATA,
2683 PORT207_DATA, PORT206_DATA, PORT205_DATA, PORT204_DATA,
2684 PORT203_DATA, PORT202_DATA, PORT201_DATA, PORT200_DATA,
2685 PORT199_DATA, PORT198_DATA, PORT197_DATA, PORT196_DATA,
2686 PORT195_DATA, PORT194_DATA, PORT193_DATA, PORT192_DATA }
2687 },
2688 { PINMUX_DATA_REG("PORTU255_224DR", 0xe6057000, 32) {
2689 PORT255_DATA, PORT254_DATA, PORT253_DATA, PORT252_DATA,
2690 PORT251_DATA, PORT250_DATA, PORT249_DATA, PORT248_DATA,
2691 PORT247_DATA, PORT246_DATA, PORT245_DATA, PORT244_DATA,
2692 PORT243_DATA, PORT242_DATA, PORT241_DATA, PORT240_DATA,
2693 PORT239_DATA, PORT238_DATA, PORT237_DATA, PORT236_DATA,
2694 PORT235_DATA, PORT234_DATA, PORT233_DATA, PORT232_DATA,
2695 PORT231_DATA, PORT230_DATA, PORT229_DATA, PORT228_DATA,
2696 PORT227_DATA, PORT226_DATA, PORT225_DATA, PORT224_DATA }
2697 },
2698 { PINMUX_DATA_REG("PORTU287_256DR", 0xe6057004, 32) {
2699 0, 0, 0, 0,
2700 0, PORT282_DATA, PORT281_DATA, PORT280_DATA,
2701 PORT279_DATA, PORT278_DATA, PORT277_DATA, PORT276_DATA,
2702 PORT275_DATA, PORT274_DATA, PORT273_DATA, PORT272_DATA,
2703 PORT271_DATA, PORT270_DATA, PORT269_DATA, PORT268_DATA,
2704 PORT267_DATA, PORT266_DATA, PORT265_DATA, PORT264_DATA,
2705 PORT263_DATA, PORT262_DATA, PORT261_DATA, PORT260_DATA,
2706 PORT259_DATA, PORT258_DATA, PORT257_DATA, PORT256_DATA }
2707 },
2708 { PINMUX_DATA_REG("PORTR319_288DR", 0xe6056010, 32) {
2709 0, 0, 0, 0,
2710 0, 0, 0, 0,
2711 0, 0, PORT309_DATA, PORT308_DATA,
2712 PORT307_DATA, PORT306_DATA, PORT305_DATA, PORT304_DATA,
2713 PORT303_DATA, PORT302_DATA, PORT301_DATA, PORT300_DATA,
2714 PORT299_DATA, PORT298_DATA, PORT297_DATA, PORT296_DATA,
2715 PORT295_DATA, PORT294_DATA, PORT293_DATA, PORT292_DATA,
2716 PORT291_DATA, PORT290_DATA, PORT289_DATA, PORT288_DATA }
2717 },
2718 { },
2719};
2720
2721static struct pinmux_info sh73a0_pinmux_info = {
2722 .name = "sh73a0_pfc",
2723 .reserved_id = PINMUX_RESERVED,
2724 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2725 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
2726 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
2727 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
2728 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
2729 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2730 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2731
2732 .first_gpio = GPIO_PORT0,
2733 .last_gpio = GPIO_FN_FSIAISLD_PU,
2734
2735 .gpios = pinmux_gpios,
2736 .cfg_regs = pinmux_config_regs,
2737 .data_regs = pinmux_data_regs,
2738
2739 .gpio_data = pinmux_data,
2740 .gpio_data_size = ARRAY_SIZE(pinmux_data),
2741};
2742
2743void sh73a0_pinmux_init(void)
2744{
2745 register_pinmux(&sh73a0_pinmux_info);
2746}
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
new file mode 100644
index 000000000000..65e879bab4dc
--- /dev/null
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -0,0 +1,70 @@
1/*
2 * SMP support for R-Mobile / SH-Mobile
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2011 Paul Mundt
6 *
7 * Based on vexpress, Copyright (C) 2002 ARM Ltd, All Rights Reserved
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 version 2 as
11 * published by the Free Software Foundation.
12 */
13#include <linux/init.h>
14#include <linux/errno.h>
15#include <linux/delay.h>
16#include <linux/device.h>
17#include <linux/smp.h>
18#include <linux/io.h>
19#include <asm/localtimer.h>
20#include <asm/mach-types.h>
21#include <mach/common.h>
22
23static unsigned int __init shmobile_smp_get_core_count(void)
24{
25 if (machine_is_ag5evm())
26 return sh73a0_get_core_count();
27
28 return 1;
29}
30
31static void __init shmobile_smp_prepare_cpus(void)
32{
33 if (machine_is_ag5evm())
34 sh73a0_smp_prepare_cpus();
35}
36
37void __cpuinit platform_secondary_init(unsigned int cpu)
38{
39 trace_hardirqs_off();
40
41 if (machine_is_ag5evm())
42 sh73a0_secondary_init(cpu);
43}
44
45int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
46{
47 if (machine_is_ag5evm())
48 return sh73a0_boot_secondary(cpu);
49
50 return -ENOSYS;
51}
52
53void __init smp_init_cpus(void)
54{
55 unsigned int ncores = shmobile_smp_get_core_count();
56 unsigned int i;
57
58 for (i = 0; i < ncores; i++)
59 set_cpu_possible(i, true);
60}
61
62void __init platform_smp_prepare_cpus(unsigned int max_cpus)
63{
64 int i;
65
66 for (i = 0; i < max_cpus; i++)
67 set_cpu_present(i, true);
68
69 shmobile_smp_prepare_cpus();
70}
diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c
new file mode 100644
index 000000000000..94912d3944d3
--- /dev/null
+++ b/arch/arm/mach-shmobile/pm_runtime.c
@@ -0,0 +1,169 @@
1/*
2 * arch/arm/mach-shmobile/pm_runtime.c
3 *
4 * Runtime PM support code for SuperH Mobile ARM
5 *
6 * Copyright (C) 2009-2010 Magnus Damm
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/io.h>
16#include <linux/pm_runtime.h>
17#include <linux/platform_device.h>
18#include <linux/clk.h>
19#include <linux/sh_clk.h>
20#include <linux/bitmap.h>
21
22#ifdef CONFIG_PM_RUNTIME
23#define BIT_ONCE 0
24#define BIT_ACTIVE 1
25#define BIT_CLK_ENABLED 2
26
27struct pm_runtime_data {
28 unsigned long flags;
29 struct clk *clk;
30};
31
32static void __devres_release(struct device *dev, void *res)
33{
34 struct pm_runtime_data *prd = res;
35
36 dev_dbg(dev, "__devres_release()\n");
37
38 if (test_bit(BIT_CLK_ENABLED, &prd->flags))
39 clk_disable(prd->clk);
40
41 if (test_bit(BIT_ACTIVE, &prd->flags))
42 clk_put(prd->clk);
43}
44
45static struct pm_runtime_data *__to_prd(struct device *dev)
46{
47 return devres_find(dev, __devres_release, NULL, NULL);
48}
49
50static void platform_pm_runtime_init(struct device *dev,
51 struct pm_runtime_data *prd)
52{
53 if (prd && !test_and_set_bit(BIT_ONCE, &prd->flags)) {
54 prd->clk = clk_get(dev, NULL);
55 if (!IS_ERR(prd->clk)) {
56 set_bit(BIT_ACTIVE, &prd->flags);
57 dev_info(dev, "clocks managed by runtime pm\n");
58 }
59 }
60}
61
62static void platform_pm_runtime_bug(struct device *dev,
63 struct pm_runtime_data *prd)
64{
65 if (prd && !test_and_set_bit(BIT_ONCE, &prd->flags))
66 dev_err(dev, "runtime pm suspend before resume\n");
67}
68
69int platform_pm_runtime_suspend(struct device *dev)
70{
71 struct pm_runtime_data *prd = __to_prd(dev);
72
73 dev_dbg(dev, "platform_pm_runtime_suspend()\n");
74
75 platform_pm_runtime_bug(dev, prd);
76
77 if (prd && test_bit(BIT_ACTIVE, &prd->flags)) {
78 clk_disable(prd->clk);
79 clear_bit(BIT_CLK_ENABLED, &prd->flags);
80 }
81
82 return 0;
83}
84
85int platform_pm_runtime_resume(struct device *dev)
86{
87 struct pm_runtime_data *prd = __to_prd(dev);
88
89 dev_dbg(dev, "platform_pm_runtime_resume()\n");
90
91 platform_pm_runtime_init(dev, prd);
92
93 if (prd && test_bit(BIT_ACTIVE, &prd->flags)) {
94 clk_enable(prd->clk);
95 set_bit(BIT_CLK_ENABLED, &prd->flags);
96 }
97
98 return 0;
99}
100
101int platform_pm_runtime_idle(struct device *dev)
102{
103 /* suspend synchronously to disable clocks immediately */
104 return pm_runtime_suspend(dev);
105}
106
107static int platform_bus_notify(struct notifier_block *nb,
108 unsigned long action, void *data)
109{
110 struct device *dev = data;
111 struct pm_runtime_data *prd;
112
113 dev_dbg(dev, "platform_bus_notify() %ld !\n", action);
114
115 if (action == BUS_NOTIFY_BIND_DRIVER) {
116 prd = devres_alloc(__devres_release, sizeof(*prd), GFP_KERNEL);
117 if (prd)
118 devres_add(dev, prd);
119 else
120 dev_err(dev, "unable to alloc memory for runtime pm\n");
121 }
122
123 return 0;
124}
125
126#else /* CONFIG_PM_RUNTIME */
127
128static int platform_bus_notify(struct notifier_block *nb,
129 unsigned long action, void *data)
130{
131 struct device *dev = data;
132 struct clk *clk;
133
134 dev_dbg(dev, "platform_bus_notify() %ld !\n", action);
135
136 switch (action) {
137 case BUS_NOTIFY_BIND_DRIVER:
138 clk = clk_get(dev, NULL);
139 if (!IS_ERR(clk)) {
140 clk_enable(clk);
141 clk_put(clk);
142 dev_info(dev, "runtime pm disabled, clock forced on\n");
143 }
144 break;
145 case BUS_NOTIFY_UNBOUND_DRIVER:
146 clk = clk_get(dev, NULL);
147 if (!IS_ERR(clk)) {
148 clk_disable(clk);
149 clk_put(clk);
150 dev_info(dev, "runtime pm disabled, clock forced off\n");
151 }
152 break;
153 }
154
155 return 0;
156}
157
158#endif /* CONFIG_PM_RUNTIME */
159
160static struct notifier_block platform_bus_notifier = {
161 .notifier_call = platform_bus_notify
162};
163
164static int __init sh_pm_runtime_init(void)
165{
166 bus_register_notifier(&platform_bus_type, &platform_bus_notifier);
167 return 0;
168}
169core_initcall(sh_pm_runtime_init);
diff --git a/arch/arm/mach-shmobile/setup-sh7367.c b/arch/arm/mach-shmobile/setup-sh7367.c
new file mode 100644
index 000000000000..ce28141662da
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-sh7367.c
@@ -0,0 +1,225 @@
1/*
2 * sh7367 processor support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
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#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/input.h>
27#include <linux/io.h>
28#include <linux/serial_sci.h>
29#include <linux/sh_timer.h>
30#include <mach/hardware.h>
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33
34/* SCIFA0 */
35static struct plat_sci_port scif0_platform_data = {
36 .mapbase = 0xe6c40000,
37 .flags = UPF_BOOT_AUTOCONF,
38 .scscr = SCSCR_RE | SCSCR_TE,
39 .scbrr_algo_id = SCBRR_ALGO_4,
40 .type = PORT_SCIF,
41 .irqs = { evt2irq(0xc00), evt2irq(0xc00),
42 evt2irq(0xc00), evt2irq(0xc00) },
43};
44
45static struct platform_device scif0_device = {
46 .name = "sh-sci",
47 .id = 0,
48 .dev = {
49 .platform_data = &scif0_platform_data,
50 },
51};
52
53/* SCIFA1 */
54static struct plat_sci_port scif1_platform_data = {
55 .mapbase = 0xe6c50000,
56 .flags = UPF_BOOT_AUTOCONF,
57 .scscr = SCSCR_RE | SCSCR_TE,
58 .scbrr_algo_id = SCBRR_ALGO_4,
59 .type = PORT_SCIF,
60 .irqs = { evt2irq(0xc20), evt2irq(0xc20),
61 evt2irq(0xc20), evt2irq(0xc20) },
62};
63
64static struct platform_device scif1_device = {
65 .name = "sh-sci",
66 .id = 1,
67 .dev = {
68 .platform_data = &scif1_platform_data,
69 },
70};
71
72/* SCIFA2 */
73static struct plat_sci_port scif2_platform_data = {
74 .mapbase = 0xe6c60000,
75 .flags = UPF_BOOT_AUTOCONF,
76 .scscr = SCSCR_RE | SCSCR_TE,
77 .scbrr_algo_id = SCBRR_ALGO_4,
78 .type = PORT_SCIF,
79 .irqs = { evt2irq(0xc40), evt2irq(0xc40),
80 evt2irq(0xc40), evt2irq(0xc40) },
81};
82
83static struct platform_device scif2_device = {
84 .name = "sh-sci",
85 .id = 2,
86 .dev = {
87 .platform_data = &scif2_platform_data,
88 },
89};
90
91/* SCIFA3 */
92static struct plat_sci_port scif3_platform_data = {
93 .mapbase = 0xe6c70000,
94 .flags = UPF_BOOT_AUTOCONF,
95 .scscr = SCSCR_RE | SCSCR_TE,
96 .scbrr_algo_id = SCBRR_ALGO_4,
97 .type = PORT_SCIF,
98 .irqs = { evt2irq(0xc60), evt2irq(0xc60),
99 evt2irq(0xc60), evt2irq(0xc60) },
100};
101
102static struct platform_device scif3_device = {
103 .name = "sh-sci",
104 .id = 3,
105 .dev = {
106 .platform_data = &scif3_platform_data,
107 },
108};
109
110/* SCIFA4 */
111static struct plat_sci_port scif4_platform_data = {
112 .mapbase = 0xe6c80000,
113 .flags = UPF_BOOT_AUTOCONF,
114 .scscr = SCSCR_RE | SCSCR_TE,
115 .scbrr_algo_id = SCBRR_ALGO_4,
116 .type = PORT_SCIF,
117 .irqs = { evt2irq(0xd20), evt2irq(0xd20),
118 evt2irq(0xd20), evt2irq(0xd20) },
119};
120
121static struct platform_device scif4_device = {
122 .name = "sh-sci",
123 .id = 4,
124 .dev = {
125 .platform_data = &scif4_platform_data,
126 },
127};
128
129/* SCIFA5 */
130static struct plat_sci_port scif5_platform_data = {
131 .mapbase = 0xe6cb0000,
132 .flags = UPF_BOOT_AUTOCONF,
133 .scscr = SCSCR_RE | SCSCR_TE,
134 .scbrr_algo_id = SCBRR_ALGO_4,
135 .type = PORT_SCIF,
136 .irqs = { evt2irq(0xd40), evt2irq(0xd40),
137 evt2irq(0xd40), evt2irq(0xd40) },
138};
139
140static struct platform_device scif5_device = {
141 .name = "sh-sci",
142 .id = 5,
143 .dev = {
144 .platform_data = &scif5_platform_data,
145 },
146};
147
148/* SCIFB */
149static struct plat_sci_port scif6_platform_data = {
150 .mapbase = 0xe6c30000,
151 .flags = UPF_BOOT_AUTOCONF,
152 .scscr = SCSCR_RE | SCSCR_TE,
153 .scbrr_algo_id = SCBRR_ALGO_4,
154 .type = PORT_SCIF,
155 .irqs = { evt2irq(0xd60), evt2irq(0xd60),
156 evt2irq(0xd60), evt2irq(0xd60) },
157};
158
159static struct platform_device scif6_device = {
160 .name = "sh-sci",
161 .id = 6,
162 .dev = {
163 .platform_data = &scif6_platform_data,
164 },
165};
166
167static struct sh_timer_config cmt10_platform_data = {
168 .name = "CMT10",
169 .channel_offset = 0x10,
170 .timer_bit = 0,
171 .clockevent_rating = 125,
172 .clocksource_rating = 125,
173};
174
175static struct resource cmt10_resources[] = {
176 [0] = {
177 .name = "CMT10",
178 .start = 0xe6138010,
179 .end = 0xe613801b,
180 .flags = IORESOURCE_MEM,
181 },
182 [1] = {
183 .start = evt2irq(0xb00), /* CMT1_CMT10 */
184 .flags = IORESOURCE_IRQ,
185 },
186};
187
188static struct platform_device cmt10_device = {
189 .name = "sh_cmt",
190 .id = 10,
191 .dev = {
192 .platform_data = &cmt10_platform_data,
193 },
194 .resource = cmt10_resources,
195 .num_resources = ARRAY_SIZE(cmt10_resources),
196};
197
198static struct platform_device *sh7367_early_devices[] __initdata = {
199 &scif0_device,
200 &scif1_device,
201 &scif2_device,
202 &scif3_device,
203 &scif4_device,
204 &scif5_device,
205 &scif6_device,
206 &cmt10_device,
207};
208
209void __init sh7367_add_standard_devices(void)
210{
211 platform_add_devices(sh7367_early_devices,
212 ARRAY_SIZE(sh7367_early_devices));
213}
214
215#define SYMSTPCR2 0xe6158048
216#define SYMSTPCR2_CMT1 (1 << 29)
217
218void __init sh7367_add_early_devices(void)
219{
220 /* enable clock to CMT1 */
221 __raw_writel(__raw_readl(SYMSTPCR2) & ~SYMSTPCR2_CMT1, SYMSTPCR2);
222
223 early_platform_add_devices(sh7367_early_devices,
224 ARRAY_SIZE(sh7367_early_devices));
225}
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
new file mode 100644
index 000000000000..ff0494f3d00c
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -0,0 +1,638 @@
1/*
2 * sh7372 processor support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
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#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/input.h>
27#include <linux/io.h>
28#include <linux/serial_sci.h>
29#include <linux/sh_dma.h>
30#include <linux/sh_intc.h>
31#include <linux/sh_timer.h>
32#include <mach/hardware.h>
33#include <mach/sh7372.h>
34#include <asm/mach-types.h>
35#include <asm/mach/arch.h>
36
37/* SCIFA0 */
38static struct plat_sci_port scif0_platform_data = {
39 .mapbase = 0xe6c40000,
40 .flags = UPF_BOOT_AUTOCONF,
41 .scscr = SCSCR_RE | SCSCR_TE,
42 .scbrr_algo_id = SCBRR_ALGO_4,
43 .type = PORT_SCIFA,
44 .irqs = { evt2irq(0x0c00), evt2irq(0x0c00),
45 evt2irq(0x0c00), evt2irq(0x0c00) },
46};
47
48static struct platform_device scif0_device = {
49 .name = "sh-sci",
50 .id = 0,
51 .dev = {
52 .platform_data = &scif0_platform_data,
53 },
54};
55
56/* SCIFA1 */
57static struct plat_sci_port scif1_platform_data = {
58 .mapbase = 0xe6c50000,
59 .flags = UPF_BOOT_AUTOCONF,
60 .scscr = SCSCR_RE | SCSCR_TE,
61 .scbrr_algo_id = SCBRR_ALGO_4,
62 .type = PORT_SCIFA,
63 .irqs = { evt2irq(0x0c20), evt2irq(0x0c20),
64 evt2irq(0x0c20), evt2irq(0x0c20) },
65};
66
67static struct platform_device scif1_device = {
68 .name = "sh-sci",
69 .id = 1,
70 .dev = {
71 .platform_data = &scif1_platform_data,
72 },
73};
74
75/* SCIFA2 */
76static struct plat_sci_port scif2_platform_data = {
77 .mapbase = 0xe6c60000,
78 .flags = UPF_BOOT_AUTOCONF,
79 .scscr = SCSCR_RE | SCSCR_TE,
80 .scbrr_algo_id = SCBRR_ALGO_4,
81 .type = PORT_SCIFA,
82 .irqs = { evt2irq(0x0c40), evt2irq(0x0c40),
83 evt2irq(0x0c40), evt2irq(0x0c40) },
84};
85
86static struct platform_device scif2_device = {
87 .name = "sh-sci",
88 .id = 2,
89 .dev = {
90 .platform_data = &scif2_platform_data,
91 },
92};
93
94/* SCIFA3 */
95static struct plat_sci_port scif3_platform_data = {
96 .mapbase = 0xe6c70000,
97 .flags = UPF_BOOT_AUTOCONF,
98 .scscr = SCSCR_RE | SCSCR_TE,
99 .scbrr_algo_id = SCBRR_ALGO_4,
100 .type = PORT_SCIFA,
101 .irqs = { evt2irq(0x0c60), evt2irq(0x0c60),
102 evt2irq(0x0c60), evt2irq(0x0c60) },
103};
104
105static struct platform_device scif3_device = {
106 .name = "sh-sci",
107 .id = 3,
108 .dev = {
109 .platform_data = &scif3_platform_data,
110 },
111};
112
113/* SCIFA4 */
114static struct plat_sci_port scif4_platform_data = {
115 .mapbase = 0xe6c80000,
116 .flags = UPF_BOOT_AUTOCONF,
117 .scscr = SCSCR_RE | SCSCR_TE,
118 .scbrr_algo_id = SCBRR_ALGO_4,
119 .type = PORT_SCIFA,
120 .irqs = { evt2irq(0x0d20), evt2irq(0x0d20),
121 evt2irq(0x0d20), evt2irq(0x0d20) },
122};
123
124static struct platform_device scif4_device = {
125 .name = "sh-sci",
126 .id = 4,
127 .dev = {
128 .platform_data = &scif4_platform_data,
129 },
130};
131
132/* SCIFA5 */
133static struct plat_sci_port scif5_platform_data = {
134 .mapbase = 0xe6cb0000,
135 .flags = UPF_BOOT_AUTOCONF,
136 .scscr = SCSCR_RE | SCSCR_TE,
137 .scbrr_algo_id = SCBRR_ALGO_4,
138 .type = PORT_SCIFA,
139 .irqs = { evt2irq(0x0d40), evt2irq(0x0d40),
140 evt2irq(0x0d40), evt2irq(0x0d40) },
141};
142
143static struct platform_device scif5_device = {
144 .name = "sh-sci",
145 .id = 5,
146 .dev = {
147 .platform_data = &scif5_platform_data,
148 },
149};
150
151/* SCIFB */
152static struct plat_sci_port scif6_platform_data = {
153 .mapbase = 0xe6c30000,
154 .flags = UPF_BOOT_AUTOCONF,
155 .scscr = SCSCR_RE | SCSCR_TE,
156 .scbrr_algo_id = SCBRR_ALGO_4,
157 .type = PORT_SCIFB,
158 .irqs = { evt2irq(0x0d60), evt2irq(0x0d60),
159 evt2irq(0x0d60), evt2irq(0x0d60) },
160};
161
162static struct platform_device scif6_device = {
163 .name = "sh-sci",
164 .id = 6,
165 .dev = {
166 .platform_data = &scif6_platform_data,
167 },
168};
169
170/* CMT */
171static struct sh_timer_config cmt10_platform_data = {
172 .name = "CMT10",
173 .channel_offset = 0x10,
174 .timer_bit = 0,
175 .clockevent_rating = 125,
176 .clocksource_rating = 125,
177};
178
179static struct resource cmt10_resources[] = {
180 [0] = {
181 .name = "CMT10",
182 .start = 0xe6138010,
183 .end = 0xe613801b,
184 .flags = IORESOURCE_MEM,
185 },
186 [1] = {
187 .start = evt2irq(0x0b00), /* CMT1_CMT10 */
188 .flags = IORESOURCE_IRQ,
189 },
190};
191
192static struct platform_device cmt10_device = {
193 .name = "sh_cmt",
194 .id = 10,
195 .dev = {
196 .platform_data = &cmt10_platform_data,
197 },
198 .resource = cmt10_resources,
199 .num_resources = ARRAY_SIZE(cmt10_resources),
200};
201
202/* TMU */
203static struct sh_timer_config tmu00_platform_data = {
204 .name = "TMU00",
205 .channel_offset = 0x4,
206 .timer_bit = 0,
207 .clockevent_rating = 200,
208};
209
210static struct resource tmu00_resources[] = {
211 [0] = {
212 .name = "TMU00",
213 .start = 0xfff60008,
214 .end = 0xfff60013,
215 .flags = IORESOURCE_MEM,
216 },
217 [1] = {
218 .start = intcs_evt2irq(0xe80), /* TMU_TUNI0 */
219 .flags = IORESOURCE_IRQ,
220 },
221};
222
223static struct platform_device tmu00_device = {
224 .name = "sh_tmu",
225 .id = 0,
226 .dev = {
227 .platform_data = &tmu00_platform_data,
228 },
229 .resource = tmu00_resources,
230 .num_resources = ARRAY_SIZE(tmu00_resources),
231};
232
233static struct sh_timer_config tmu01_platform_data = {
234 .name = "TMU01",
235 .channel_offset = 0x10,
236 .timer_bit = 1,
237 .clocksource_rating = 200,
238};
239
240static struct resource tmu01_resources[] = {
241 [0] = {
242 .name = "TMU01",
243 .start = 0xfff60014,
244 .end = 0xfff6001f,
245 .flags = IORESOURCE_MEM,
246 },
247 [1] = {
248 .start = intcs_evt2irq(0xea0), /* TMU_TUNI1 */
249 .flags = IORESOURCE_IRQ,
250 },
251};
252
253static struct platform_device tmu01_device = {
254 .name = "sh_tmu",
255 .id = 1,
256 .dev = {
257 .platform_data = &tmu01_platform_data,
258 },
259 .resource = tmu01_resources,
260 .num_resources = ARRAY_SIZE(tmu01_resources),
261};
262
263/* I2C */
264static struct resource iic0_resources[] = {
265 [0] = {
266 .name = "IIC0",
267 .start = 0xFFF20000,
268 .end = 0xFFF20425 - 1,
269 .flags = IORESOURCE_MEM,
270 },
271 [1] = {
272 .start = intcs_evt2irq(0xe00), /* IIC0_ALI0 */
273 .end = intcs_evt2irq(0xe60), /* IIC0_DTEI0 */
274 .flags = IORESOURCE_IRQ,
275 },
276};
277
278static struct platform_device iic0_device = {
279 .name = "i2c-sh_mobile",
280 .id = 0, /* "i2c0" clock */
281 .num_resources = ARRAY_SIZE(iic0_resources),
282 .resource = iic0_resources,
283};
284
285static struct resource iic1_resources[] = {
286 [0] = {
287 .name = "IIC1",
288 .start = 0xE6C20000,
289 .end = 0xE6C20425 - 1,
290 .flags = IORESOURCE_MEM,
291 },
292 [1] = {
293 .start = evt2irq(0x780), /* IIC1_ALI1 */
294 .end = evt2irq(0x7e0), /* IIC1_DTEI1 */
295 .flags = IORESOURCE_IRQ,
296 },
297};
298
299static struct platform_device iic1_device = {
300 .name = "i2c-sh_mobile",
301 .id = 1, /* "i2c1" clock */
302 .num_resources = ARRAY_SIZE(iic1_resources),
303 .resource = iic1_resources,
304};
305
306/* DMA */
307/* Transmit sizes and respective CHCR register values */
308enum {
309 XMIT_SZ_8BIT = 0,
310 XMIT_SZ_16BIT = 1,
311 XMIT_SZ_32BIT = 2,
312 XMIT_SZ_64BIT = 7,
313 XMIT_SZ_128BIT = 3,
314 XMIT_SZ_256BIT = 4,
315 XMIT_SZ_512BIT = 5,
316};
317
318/* log2(size / 8) - used to calculate number of transfers */
319#define TS_SHIFT { \
320 [XMIT_SZ_8BIT] = 0, \
321 [XMIT_SZ_16BIT] = 1, \
322 [XMIT_SZ_32BIT] = 2, \
323 [XMIT_SZ_64BIT] = 3, \
324 [XMIT_SZ_128BIT] = 4, \
325 [XMIT_SZ_256BIT] = 5, \
326 [XMIT_SZ_512BIT] = 6, \
327}
328
329#define TS_INDEX2VAL(i) ((((i) & 3) << 3) | \
330 (((i) & 0xc) << (20 - 2)))
331
332static const struct sh_dmae_slave_config sh7372_dmae_slaves[] = {
333 {
334 .slave_id = SHDMA_SLAVE_SCIF0_TX,
335 .addr = 0xe6c40020,
336 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
337 .mid_rid = 0x21,
338 }, {
339 .slave_id = SHDMA_SLAVE_SCIF0_RX,
340 .addr = 0xe6c40024,
341 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
342 .mid_rid = 0x22,
343 }, {
344 .slave_id = SHDMA_SLAVE_SCIF1_TX,
345 .addr = 0xe6c50020,
346 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
347 .mid_rid = 0x25,
348 }, {
349 .slave_id = SHDMA_SLAVE_SCIF1_RX,
350 .addr = 0xe6c50024,
351 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
352 .mid_rid = 0x26,
353 }, {
354 .slave_id = SHDMA_SLAVE_SCIF2_TX,
355 .addr = 0xe6c60020,
356 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
357 .mid_rid = 0x29,
358 }, {
359 .slave_id = SHDMA_SLAVE_SCIF2_RX,
360 .addr = 0xe6c60024,
361 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
362 .mid_rid = 0x2a,
363 }, {
364 .slave_id = SHDMA_SLAVE_SCIF3_TX,
365 .addr = 0xe6c70020,
366 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
367 .mid_rid = 0x2d,
368 }, {
369 .slave_id = SHDMA_SLAVE_SCIF3_RX,
370 .addr = 0xe6c70024,
371 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
372 .mid_rid = 0x2e,
373 }, {
374 .slave_id = SHDMA_SLAVE_SCIF4_TX,
375 .addr = 0xe6c80020,
376 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
377 .mid_rid = 0x39,
378 }, {
379 .slave_id = SHDMA_SLAVE_SCIF4_RX,
380 .addr = 0xe6c80024,
381 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
382 .mid_rid = 0x3a,
383 }, {
384 .slave_id = SHDMA_SLAVE_SCIF5_TX,
385 .addr = 0xe6cb0020,
386 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
387 .mid_rid = 0x35,
388 }, {
389 .slave_id = SHDMA_SLAVE_SCIF5_RX,
390 .addr = 0xe6cb0024,
391 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
392 .mid_rid = 0x36,
393 }, {
394 .slave_id = SHDMA_SLAVE_SCIF6_TX,
395 .addr = 0xe6c30040,
396 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
397 .mid_rid = 0x3d,
398 }, {
399 .slave_id = SHDMA_SLAVE_SCIF6_RX,
400 .addr = 0xe6c30060,
401 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT),
402 .mid_rid = 0x3e,
403 }, {
404 .slave_id = SHDMA_SLAVE_SDHI0_TX,
405 .addr = 0xe6850030,
406 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
407 .mid_rid = 0xc1,
408 }, {
409 .slave_id = SHDMA_SLAVE_SDHI0_RX,
410 .addr = 0xe6850030,
411 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
412 .mid_rid = 0xc2,
413 }, {
414 .slave_id = SHDMA_SLAVE_SDHI1_TX,
415 .addr = 0xe6860030,
416 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
417 .mid_rid = 0xc9,
418 }, {
419 .slave_id = SHDMA_SLAVE_SDHI1_RX,
420 .addr = 0xe6860030,
421 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
422 .mid_rid = 0xca,
423 }, {
424 .slave_id = SHDMA_SLAVE_SDHI2_TX,
425 .addr = 0xe6870030,
426 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
427 .mid_rid = 0xcd,
428 }, {
429 .slave_id = SHDMA_SLAVE_SDHI2_RX,
430 .addr = 0xe6870030,
431 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT),
432 .mid_rid = 0xce,
433 }, {
434 .slave_id = SHDMA_SLAVE_MMCIF_TX,
435 .addr = 0xe6bd0034,
436 .chcr = DM_FIX | SM_INC | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
437 .mid_rid = 0xd1,
438 }, {
439 .slave_id = SHDMA_SLAVE_MMCIF_RX,
440 .addr = 0xe6bd0034,
441 .chcr = DM_INC | SM_FIX | 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT),
442 .mid_rid = 0xd2,
443 },
444};
445
446static const struct sh_dmae_channel sh7372_dmae_channels[] = {
447 {
448 .offset = 0,
449 .dmars = 0,
450 .dmars_bit = 0,
451 }, {
452 .offset = 0x10,
453 .dmars = 0,
454 .dmars_bit = 8,
455 }, {
456 .offset = 0x20,
457 .dmars = 4,
458 .dmars_bit = 0,
459 }, {
460 .offset = 0x30,
461 .dmars = 4,
462 .dmars_bit = 8,
463 }, {
464 .offset = 0x50,
465 .dmars = 8,
466 .dmars_bit = 0,
467 }, {
468 .offset = 0x60,
469 .dmars = 8,
470 .dmars_bit = 8,
471 }
472};
473
474static const unsigned int ts_shift[] = TS_SHIFT;
475
476static struct sh_dmae_pdata dma_platform_data = {
477 .slave = sh7372_dmae_slaves,
478 .slave_num = ARRAY_SIZE(sh7372_dmae_slaves),
479 .channel = sh7372_dmae_channels,
480 .channel_num = ARRAY_SIZE(sh7372_dmae_channels),
481 .ts_low_shift = 3,
482 .ts_low_mask = 0x18,
483 .ts_high_shift = (20 - 2), /* 2 bits for shifted low TS */
484 .ts_high_mask = 0x00300000,
485 .ts_shift = ts_shift,
486 .ts_shift_num = ARRAY_SIZE(ts_shift),
487 .dmaor_init = DMAOR_DME,
488};
489
490/* Resource order important! */
491static struct resource sh7372_dmae0_resources[] = {
492 {
493 /* Channel registers and DMAOR */
494 .start = 0xfe008020,
495 .end = 0xfe00808f,
496 .flags = IORESOURCE_MEM,
497 },
498 {
499 /* DMARSx */
500 .start = 0xfe009000,
501 .end = 0xfe00900b,
502 .flags = IORESOURCE_MEM,
503 },
504 {
505 /* DMA error IRQ */
506 .start = evt2irq(0x20c0),
507 .end = evt2irq(0x20c0),
508 .flags = IORESOURCE_IRQ,
509 },
510 {
511 /* IRQ for channels 0-5 */
512 .start = evt2irq(0x2000),
513 .end = evt2irq(0x20a0),
514 .flags = IORESOURCE_IRQ,
515 },
516};
517
518/* Resource order important! */
519static struct resource sh7372_dmae1_resources[] = {
520 {
521 /* Channel registers and DMAOR */
522 .start = 0xfe018020,
523 .end = 0xfe01808f,
524 .flags = IORESOURCE_MEM,
525 },
526 {
527 /* DMARSx */
528 .start = 0xfe019000,
529 .end = 0xfe01900b,
530 .flags = IORESOURCE_MEM,
531 },
532 {
533 /* DMA error IRQ */
534 .start = evt2irq(0x21c0),
535 .end = evt2irq(0x21c0),
536 .flags = IORESOURCE_IRQ,
537 },
538 {
539 /* IRQ for channels 0-5 */
540 .start = evt2irq(0x2100),
541 .end = evt2irq(0x21a0),
542 .flags = IORESOURCE_IRQ,
543 },
544};
545
546/* Resource order important! */
547static struct resource sh7372_dmae2_resources[] = {
548 {
549 /* Channel registers and DMAOR */
550 .start = 0xfe028020,
551 .end = 0xfe02808f,
552 .flags = IORESOURCE_MEM,
553 },
554 {
555 /* DMARSx */
556 .start = 0xfe029000,
557 .end = 0xfe02900b,
558 .flags = IORESOURCE_MEM,
559 },
560 {
561 /* DMA error IRQ */
562 .start = evt2irq(0x22c0),
563 .end = evt2irq(0x22c0),
564 .flags = IORESOURCE_IRQ,
565 },
566 {
567 /* IRQ for channels 0-5 */
568 .start = evt2irq(0x2200),
569 .end = evt2irq(0x22a0),
570 .flags = IORESOURCE_IRQ,
571 },
572};
573
574static struct platform_device dma0_device = {
575 .name = "sh-dma-engine",
576 .id = 0,
577 .resource = sh7372_dmae0_resources,
578 .num_resources = ARRAY_SIZE(sh7372_dmae0_resources),
579 .dev = {
580 .platform_data = &dma_platform_data,
581 },
582};
583
584static struct platform_device dma1_device = {
585 .name = "sh-dma-engine",
586 .id = 1,
587 .resource = sh7372_dmae1_resources,
588 .num_resources = ARRAY_SIZE(sh7372_dmae1_resources),
589 .dev = {
590 .platform_data = &dma_platform_data,
591 },
592};
593
594static struct platform_device dma2_device = {
595 .name = "sh-dma-engine",
596 .id = 2,
597 .resource = sh7372_dmae2_resources,
598 .num_resources = ARRAY_SIZE(sh7372_dmae2_resources),
599 .dev = {
600 .platform_data = &dma_platform_data,
601 },
602};
603
604static struct platform_device *sh7372_early_devices[] __initdata = {
605 &scif0_device,
606 &scif1_device,
607 &scif2_device,
608 &scif3_device,
609 &scif4_device,
610 &scif5_device,
611 &scif6_device,
612 &cmt10_device,
613 &tmu00_device,
614 &tmu01_device,
615};
616
617static struct platform_device *sh7372_late_devices[] __initdata = {
618 &iic0_device,
619 &iic1_device,
620 &dma0_device,
621 &dma1_device,
622 &dma2_device,
623};
624
625void __init sh7372_add_standard_devices(void)
626{
627 platform_add_devices(sh7372_early_devices,
628 ARRAY_SIZE(sh7372_early_devices));
629
630 platform_add_devices(sh7372_late_devices,
631 ARRAY_SIZE(sh7372_late_devices));
632}
633
634void __init sh7372_add_early_devices(void)
635{
636 early_platform_add_devices(sh7372_early_devices,
637 ARRAY_SIZE(sh7372_early_devices));
638}
diff --git a/arch/arm/mach-shmobile/setup-sh7377.c b/arch/arm/mach-shmobile/setup-sh7377.c
new file mode 100644
index 000000000000..8099b0b8a934
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-sh7377.c
@@ -0,0 +1,246 @@
1/*
2 * sh7377 processor support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
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#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/input.h>
27#include <linux/io.h>
28#include <linux/serial_sci.h>
29#include <linux/sh_intc.h>
30#include <linux/sh_timer.h>
31#include <mach/hardware.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34
35/* SCIFA0 */
36static struct plat_sci_port scif0_platform_data = {
37 .mapbase = 0xe6c40000,
38 .flags = UPF_BOOT_AUTOCONF,
39 .scscr = SCSCR_RE | SCSCR_TE,
40 .scbrr_algo_id = SCBRR_ALGO_4,
41 .type = PORT_SCIF,
42 .irqs = { evt2irq(0xc00), evt2irq(0xc00),
43 evt2irq(0xc00), evt2irq(0xc00) },
44};
45
46static struct platform_device scif0_device = {
47 .name = "sh-sci",
48 .id = 0,
49 .dev = {
50 .platform_data = &scif0_platform_data,
51 },
52};
53
54/* SCIFA1 */
55static struct plat_sci_port scif1_platform_data = {
56 .mapbase = 0xe6c50000,
57 .flags = UPF_BOOT_AUTOCONF,
58 .scscr = SCSCR_RE | SCSCR_TE,
59 .scbrr_algo_id = SCBRR_ALGO_4,
60 .type = PORT_SCIF,
61 .irqs = { evt2irq(0xc20), evt2irq(0xc20),
62 evt2irq(0xc20), evt2irq(0xc20) },
63};
64
65static struct platform_device scif1_device = {
66 .name = "sh-sci",
67 .id = 1,
68 .dev = {
69 .platform_data = &scif1_platform_data,
70 },
71};
72
73/* SCIFA2 */
74static struct plat_sci_port scif2_platform_data = {
75 .mapbase = 0xe6c60000,
76 .flags = UPF_BOOT_AUTOCONF,
77 .scscr = SCSCR_RE | SCSCR_TE,
78 .scbrr_algo_id = SCBRR_ALGO_4,
79 .type = PORT_SCIF,
80 .irqs = { evt2irq(0xc40), evt2irq(0xc40),
81 evt2irq(0xc40), evt2irq(0xc40) },
82};
83
84static struct platform_device scif2_device = {
85 .name = "sh-sci",
86 .id = 2,
87 .dev = {
88 .platform_data = &scif2_platform_data,
89 },
90};
91
92/* SCIFA3 */
93static struct plat_sci_port scif3_platform_data = {
94 .mapbase = 0xe6c70000,
95 .flags = UPF_BOOT_AUTOCONF,
96 .scscr = SCSCR_RE | SCSCR_TE,
97 .scbrr_algo_id = SCBRR_ALGO_4,
98 .type = PORT_SCIF,
99 .irqs = { evt2irq(0xc60), evt2irq(0xc60),
100 evt2irq(0xc60), evt2irq(0xc60) },
101};
102
103static struct platform_device scif3_device = {
104 .name = "sh-sci",
105 .id = 3,
106 .dev = {
107 .platform_data = &scif3_platform_data,
108 },
109};
110
111/* SCIFA4 */
112static struct plat_sci_port scif4_platform_data = {
113 .mapbase = 0xe6c80000,
114 .flags = UPF_BOOT_AUTOCONF,
115 .scscr = SCSCR_RE | SCSCR_TE,
116 .scbrr_algo_id = SCBRR_ALGO_4,
117 .type = PORT_SCIF,
118 .irqs = { evt2irq(0xd20), evt2irq(0xd20),
119 evt2irq(0xd20), evt2irq(0xd20) },
120};
121
122static struct platform_device scif4_device = {
123 .name = "sh-sci",
124 .id = 4,
125 .dev = {
126 .platform_data = &scif4_platform_data,
127 },
128};
129
130/* SCIFA5 */
131static struct plat_sci_port scif5_platform_data = {
132 .mapbase = 0xe6cb0000,
133 .flags = UPF_BOOT_AUTOCONF,
134 .scscr = SCSCR_RE | SCSCR_TE,
135 .scbrr_algo_id = SCBRR_ALGO_4,
136 .type = PORT_SCIF,
137 .irqs = { evt2irq(0xd40), evt2irq(0xd40),
138 evt2irq(0xd40), evt2irq(0xd40) },
139};
140
141static struct platform_device scif5_device = {
142 .name = "sh-sci",
143 .id = 5,
144 .dev = {
145 .platform_data = &scif5_platform_data,
146 },
147};
148
149/* SCIFA6 */
150static struct plat_sci_port scif6_platform_data = {
151 .mapbase = 0xe6cc0000,
152 .flags = UPF_BOOT_AUTOCONF,
153 .scscr = SCSCR_RE | SCSCR_TE,
154 .scbrr_algo_id = SCBRR_ALGO_4,
155 .type = PORT_SCIF,
156 .irqs = { intcs_evt2irq(0x1a80), intcs_evt2irq(0x1a80),
157 intcs_evt2irq(0x1a80), intcs_evt2irq(0x1a80) },
158};
159
160static struct platform_device scif6_device = {
161 .name = "sh-sci",
162 .id = 6,
163 .dev = {
164 .platform_data = &scif6_platform_data,
165 },
166};
167
168/* SCIFB */
169static struct plat_sci_port scif7_platform_data = {
170 .mapbase = 0xe6c30000,
171 .flags = UPF_BOOT_AUTOCONF,
172 .scscr = SCSCR_RE | SCSCR_TE,
173 .scbrr_algo_id = SCBRR_ALGO_4,
174 .type = PORT_SCIF,
175 .irqs = { evt2irq(0xd60), evt2irq(0xd60),
176 evt2irq(0xd60), evt2irq(0xd60) },
177};
178
179static struct platform_device scif7_device = {
180 .name = "sh-sci",
181 .id = 7,
182 .dev = {
183 .platform_data = &scif7_platform_data,
184 },
185};
186
187static struct sh_timer_config cmt10_platform_data = {
188 .name = "CMT10",
189 .channel_offset = 0x10,
190 .timer_bit = 0,
191 .clockevent_rating = 125,
192 .clocksource_rating = 125,
193};
194
195static struct resource cmt10_resources[] = {
196 [0] = {
197 .name = "CMT10",
198 .start = 0xe6138010,
199 .end = 0xe613801b,
200 .flags = IORESOURCE_MEM,
201 },
202 [1] = {
203 .start = evt2irq(0xb00), /* CMT1_CMT10 */
204 .flags = IORESOURCE_IRQ,
205 },
206};
207
208static struct platform_device cmt10_device = {
209 .name = "sh_cmt",
210 .id = 10,
211 .dev = {
212 .platform_data = &cmt10_platform_data,
213 },
214 .resource = cmt10_resources,
215 .num_resources = ARRAY_SIZE(cmt10_resources),
216};
217
218static struct platform_device *sh7377_early_devices[] __initdata = {
219 &scif0_device,
220 &scif1_device,
221 &scif2_device,
222 &scif3_device,
223 &scif4_device,
224 &scif5_device,
225 &scif6_device,
226 &scif7_device,
227 &cmt10_device,
228};
229
230void __init sh7377_add_standard_devices(void)
231{
232 platform_add_devices(sh7377_early_devices,
233 ARRAY_SIZE(sh7377_early_devices));
234}
235
236#define SMSTPCR3 0xe615013c
237#define SMSTPCR3_CMT1 (1 << 29)
238
239void __init sh7377_add_early_devices(void)
240{
241 /* enable clock to CMT1 */
242 __raw_writel(__raw_readl(SMSTPCR3) & ~SMSTPCR3_CMT1, SMSTPCR3);
243
244 early_platform_add_devices(sh7377_early_devices,
245 ARRAY_SIZE(sh7377_early_devices));
246}
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
new file mode 100644
index 000000000000..685c40a2f5e6
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -0,0 +1,430 @@
1/*
2 * sh73a0 processor support
3 *
4 * Copyright (C) 2010 Takashi Yoshii
5 * Copyright (C) 2010 Magnus Damm
6 * Copyright (C) 2008 Yoshihiro Shimoda
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#include <linux/kernel.h>
22#include <linux/init.h>
23#include <linux/interrupt.h>
24#include <linux/irq.h>
25#include <linux/platform_device.h>
26#include <linux/delay.h>
27#include <linux/input.h>
28#include <linux/io.h>
29#include <linux/serial_sci.h>
30#include <linux/sh_intc.h>
31#include <linux/sh_timer.h>
32#include <mach/hardware.h>
33#include <asm/mach-types.h>
34#include <asm/mach/arch.h>
35
36static struct plat_sci_port scif0_platform_data = {
37 .mapbase = 0xe6c40000,
38 .flags = UPF_BOOT_AUTOCONF,
39 .scscr = SCSCR_RE | SCSCR_TE,
40 .scbrr_algo_id = SCBRR_ALGO_4,
41 .type = PORT_SCIFA,
42 .irqs = { gic_spi(72), gic_spi(72),
43 gic_spi(72), gic_spi(72) },
44};
45
46static struct platform_device scif0_device = {
47 .name = "sh-sci",
48 .id = 0,
49 .dev = {
50 .platform_data = &scif0_platform_data,
51 },
52};
53
54static struct plat_sci_port scif1_platform_data = {
55 .mapbase = 0xe6c50000,
56 .flags = UPF_BOOT_AUTOCONF,
57 .scscr = SCSCR_RE | SCSCR_TE,
58 .scbrr_algo_id = SCBRR_ALGO_4,
59 .type = PORT_SCIFA,
60 .irqs = { gic_spi(73), gic_spi(73),
61 gic_spi(73), gic_spi(73) },
62};
63
64static struct platform_device scif1_device = {
65 .name = "sh-sci",
66 .id = 1,
67 .dev = {
68 .platform_data = &scif1_platform_data,
69 },
70};
71
72static struct plat_sci_port scif2_platform_data = {
73 .mapbase = 0xe6c60000,
74 .flags = UPF_BOOT_AUTOCONF,
75 .scscr = SCSCR_RE | SCSCR_TE,
76 .scbrr_algo_id = SCBRR_ALGO_4,
77 .type = PORT_SCIFA,
78 .irqs = { gic_spi(74), gic_spi(74),
79 gic_spi(74), gic_spi(74) },
80};
81
82static struct platform_device scif2_device = {
83 .name = "sh-sci",
84 .id = 2,
85 .dev = {
86 .platform_data = &scif2_platform_data,
87 },
88};
89
90static struct plat_sci_port scif3_platform_data = {
91 .mapbase = 0xe6c70000,
92 .flags = UPF_BOOT_AUTOCONF,
93 .scscr = SCSCR_RE | SCSCR_TE,
94 .scbrr_algo_id = SCBRR_ALGO_4,
95 .type = PORT_SCIFA,
96 .irqs = { gic_spi(75), gic_spi(75),
97 gic_spi(75), gic_spi(75) },
98};
99
100static struct platform_device scif3_device = {
101 .name = "sh-sci",
102 .id = 3,
103 .dev = {
104 .platform_data = &scif3_platform_data,
105 },
106};
107
108static struct plat_sci_port scif4_platform_data = {
109 .mapbase = 0xe6c80000,
110 .flags = UPF_BOOT_AUTOCONF,
111 .scscr = SCSCR_RE | SCSCR_TE,
112 .scbrr_algo_id = SCBRR_ALGO_4,
113 .type = PORT_SCIFA,
114 .irqs = { gic_spi(78), gic_spi(78),
115 gic_spi(78), gic_spi(78) },
116};
117
118static struct platform_device scif4_device = {
119 .name = "sh-sci",
120 .id = 4,
121 .dev = {
122 .platform_data = &scif4_platform_data,
123 },
124};
125
126static struct plat_sci_port scif5_platform_data = {
127 .mapbase = 0xe6cb0000,
128 .flags = UPF_BOOT_AUTOCONF,
129 .scscr = SCSCR_RE | SCSCR_TE,
130 .scbrr_algo_id = SCBRR_ALGO_4,
131 .type = PORT_SCIFA,
132 .irqs = { gic_spi(79), gic_spi(79),
133 gic_spi(79), gic_spi(79) },
134};
135
136static struct platform_device scif5_device = {
137 .name = "sh-sci",
138 .id = 5,
139 .dev = {
140 .platform_data = &scif5_platform_data,
141 },
142};
143
144static struct plat_sci_port scif6_platform_data = {
145 .mapbase = 0xe6cc0000,
146 .flags = UPF_BOOT_AUTOCONF,
147 .scscr = SCSCR_RE | SCSCR_TE,
148 .scbrr_algo_id = SCBRR_ALGO_4,
149 .type = PORT_SCIFA,
150 .irqs = { gic_spi(156), gic_spi(156),
151 gic_spi(156), gic_spi(156) },
152};
153
154static struct platform_device scif6_device = {
155 .name = "sh-sci",
156 .id = 6,
157 .dev = {
158 .platform_data = &scif6_platform_data,
159 },
160};
161
162static struct plat_sci_port scif7_platform_data = {
163 .mapbase = 0xe6cd0000,
164 .flags = UPF_BOOT_AUTOCONF,
165 .scscr = SCSCR_RE | SCSCR_TE,
166 .scbrr_algo_id = SCBRR_ALGO_4,
167 .type = PORT_SCIFA,
168 .irqs = { gic_spi(143), gic_spi(143),
169 gic_spi(143), gic_spi(143) },
170};
171
172static struct platform_device scif7_device = {
173 .name = "sh-sci",
174 .id = 7,
175 .dev = {
176 .platform_data = &scif7_platform_data,
177 },
178};
179
180static struct plat_sci_port scif8_platform_data = {
181 .mapbase = 0xe6c30000,
182 .flags = UPF_BOOT_AUTOCONF,
183 .scscr = SCSCR_RE | SCSCR_TE,
184 .scbrr_algo_id = SCBRR_ALGO_4,
185 .type = PORT_SCIFB,
186 .irqs = { gic_spi(80), gic_spi(80),
187 gic_spi(80), gic_spi(80) },
188};
189
190static struct platform_device scif8_device = {
191 .name = "sh-sci",
192 .id = 8,
193 .dev = {
194 .platform_data = &scif8_platform_data,
195 },
196};
197
198static struct sh_timer_config cmt10_platform_data = {
199 .name = "CMT10",
200 .channel_offset = 0x10,
201 .timer_bit = 0,
202 .clockevent_rating = 125,
203 .clocksource_rating = 125,
204};
205
206static struct resource cmt10_resources[] = {
207 [0] = {
208 .name = "CMT10",
209 .start = 0xe6138010,
210 .end = 0xe613801b,
211 .flags = IORESOURCE_MEM,
212 },
213 [1] = {
214 .start = gic_spi(65),
215 .flags = IORESOURCE_IRQ,
216 },
217};
218
219static struct platform_device cmt10_device = {
220 .name = "sh_cmt",
221 .id = 10,
222 .dev = {
223 .platform_data = &cmt10_platform_data,
224 },
225 .resource = cmt10_resources,
226 .num_resources = ARRAY_SIZE(cmt10_resources),
227};
228
229/* TMU */
230static struct sh_timer_config tmu00_platform_data = {
231 .name = "TMU00",
232 .channel_offset = 0x4,
233 .timer_bit = 0,
234 .clockevent_rating = 200,
235};
236
237static struct resource tmu00_resources[] = {
238 [0] = {
239 .name = "TMU00",
240 .start = 0xfff60008,
241 .end = 0xfff60013,
242 .flags = IORESOURCE_MEM,
243 },
244 [1] = {
245 .start = intcs_evt2irq(0x0e80), /* TMU0_TUNI00 */
246 .flags = IORESOURCE_IRQ,
247 },
248};
249
250static struct platform_device tmu00_device = {
251 .name = "sh_tmu",
252 .id = 0,
253 .dev = {
254 .platform_data = &tmu00_platform_data,
255 },
256 .resource = tmu00_resources,
257 .num_resources = ARRAY_SIZE(tmu00_resources),
258};
259
260static struct sh_timer_config tmu01_platform_data = {
261 .name = "TMU01",
262 .channel_offset = 0x10,
263 .timer_bit = 1,
264 .clocksource_rating = 200,
265};
266
267static struct resource tmu01_resources[] = {
268 [0] = {
269 .name = "TMU01",
270 .start = 0xfff60014,
271 .end = 0xfff6001f,
272 .flags = IORESOURCE_MEM,
273 },
274 [1] = {
275 .start = intcs_evt2irq(0x0ea0), /* TMU0_TUNI01 */
276 .flags = IORESOURCE_IRQ,
277 },
278};
279
280static struct platform_device tmu01_device = {
281 .name = "sh_tmu",
282 .id = 1,
283 .dev = {
284 .platform_data = &tmu01_platform_data,
285 },
286 .resource = tmu01_resources,
287 .num_resources = ARRAY_SIZE(tmu01_resources),
288};
289
290static struct resource i2c0_resources[] = {
291 [0] = {
292 .name = "IIC0",
293 .start = 0xe6820000,
294 .end = 0xe6820425 - 1,
295 .flags = IORESOURCE_MEM,
296 },
297 [1] = {
298 .start = gic_spi(167),
299 .end = gic_spi(170),
300 .flags = IORESOURCE_IRQ,
301 },
302};
303
304static struct resource i2c1_resources[] = {
305 [0] = {
306 .name = "IIC1",
307 .start = 0xe6822000,
308 .end = 0xe6822425 - 1,
309 .flags = IORESOURCE_MEM,
310 },
311 [1] = {
312 .start = gic_spi(51),
313 .end = gic_spi(54),
314 .flags = IORESOURCE_IRQ,
315 },
316};
317
318static struct resource i2c2_resources[] = {
319 [0] = {
320 .name = "IIC2",
321 .start = 0xe6824000,
322 .end = 0xe6824425 - 1,
323 .flags = IORESOURCE_MEM,
324 },
325 [1] = {
326 .start = gic_spi(171),
327 .end = gic_spi(174),
328 .flags = IORESOURCE_IRQ,
329 },
330};
331
332static struct resource i2c3_resources[] = {
333 [0] = {
334 .name = "IIC3",
335 .start = 0xe6826000,
336 .end = 0xe6826425 - 1,
337 .flags = IORESOURCE_MEM,
338 },
339 [1] = {
340 .start = gic_spi(183),
341 .end = gic_spi(186),
342 .flags = IORESOURCE_IRQ,
343 },
344};
345
346static struct resource i2c4_resources[] = {
347 [0] = {
348 .name = "IIC4",
349 .start = 0xe6828000,
350 .end = 0xe6828425 - 1,
351 .flags = IORESOURCE_MEM,
352 },
353 [1] = {
354 .start = gic_spi(187),
355 .end = gic_spi(190),
356 .flags = IORESOURCE_IRQ,
357 },
358};
359
360static struct platform_device i2c0_device = {
361 .name = "i2c-sh_mobile",
362 .id = 0,
363 .resource = i2c0_resources,
364 .num_resources = ARRAY_SIZE(i2c0_resources),
365};
366
367static struct platform_device i2c1_device = {
368 .name = "i2c-sh_mobile",
369 .id = 1,
370 .resource = i2c1_resources,
371 .num_resources = ARRAY_SIZE(i2c1_resources),
372};
373
374static struct platform_device i2c2_device = {
375 .name = "i2c-sh_mobile",
376 .id = 2,
377 .resource = i2c2_resources,
378 .num_resources = ARRAY_SIZE(i2c2_resources),
379};
380
381static struct platform_device i2c3_device = {
382 .name = "i2c-sh_mobile",
383 .id = 3,
384 .resource = i2c3_resources,
385 .num_resources = ARRAY_SIZE(i2c3_resources),
386};
387
388static struct platform_device i2c4_device = {
389 .name = "i2c-sh_mobile",
390 .id = 4,
391 .resource = i2c4_resources,
392 .num_resources = ARRAY_SIZE(i2c4_resources),
393};
394
395static struct platform_device *sh73a0_early_devices[] __initdata = {
396 &scif0_device,
397 &scif1_device,
398 &scif2_device,
399 &scif3_device,
400 &scif4_device,
401 &scif5_device,
402 &scif6_device,
403 &scif7_device,
404 &scif8_device,
405 &cmt10_device,
406 &tmu00_device,
407 &tmu01_device,
408};
409
410static struct platform_device *sh73a0_late_devices[] __initdata = {
411 &i2c0_device,
412 &i2c1_device,
413 &i2c2_device,
414 &i2c3_device,
415 &i2c4_device,
416};
417
418void __init sh73a0_add_standard_devices(void)
419{
420 platform_add_devices(sh73a0_early_devices,
421 ARRAY_SIZE(sh73a0_early_devices));
422 platform_add_devices(sh73a0_late_devices,
423 ARRAY_SIZE(sh73a0_late_devices));
424}
425
426void __init sh73a0_add_early_devices(void)
427{
428 early_platform_add_devices(sh73a0_early_devices,
429 ARRAY_SIZE(sh73a0_early_devices));
430}
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
new file mode 100644
index 000000000000..a156d2108df1
--- /dev/null
+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
@@ -0,0 +1,97 @@
1/*
2 * SMP support for R-Mobile / SH-Mobile - sh73a0 portion
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2010 Takashi Yoshii
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#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/smp.h>
23#include <linux/spinlock.h>
24#include <linux/io.h>
25#include <mach/common.h>
26#include <asm/smp_scu.h>
27#include <asm/smp_twd.h>
28#include <asm/hardware/gic.h>
29
30#define WUPCR 0xe6151010
31#define SRESCR 0xe6151018
32#define PSTR 0xe6151040
33#define SBAR 0xe6180020
34#define APARMBAREA 0xe6f10020
35
36static void __iomem *scu_base_addr(void)
37{
38 return (void __iomem *)0xf0000000;
39}
40
41static DEFINE_SPINLOCK(scu_lock);
42static unsigned long tmp;
43
44static void modify_scu_cpu_psr(unsigned long set, unsigned long clr)
45{
46 void __iomem *scu_base = scu_base_addr();
47
48 spin_lock(&scu_lock);
49 tmp = __raw_readl(scu_base + 8);
50 tmp &= ~clr;
51 tmp |= set;
52 spin_unlock(&scu_lock);
53
54 /* disable cache coherency after releasing the lock */
55 __raw_writel(tmp, scu_base + 8);
56}
57
58unsigned int __init sh73a0_get_core_count(void)
59{
60 void __iomem *scu_base = scu_base_addr();
61
62 return scu_get_core_count(scu_base);
63}
64
65void __cpuinit sh73a0_secondary_init(unsigned int cpu)
66{
67 gic_secondary_init(0);
68}
69
70int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
71{
72 /* enable cache coherency */
73 modify_scu_cpu_psr(0, 3 << (cpu * 8));
74
75 if (((__raw_readw(__io(PSTR)) >> (4 * cpu)) & 3) == 3)
76 __raw_writel(1 << cpu, __io(WUPCR)); /* wake up */
77 else
78 __raw_writel(1 << cpu, __io(SRESCR)); /* reset */
79
80 return 0;
81}
82
83void __init sh73a0_smp_prepare_cpus(void)
84{
85#ifdef CONFIG_HAVE_ARM_TWD
86 twd_base = (void __iomem *)0xf0000600;
87#endif
88
89 scu_enable(scu_base_addr());
90
91 /* Map the reset vector (in headsmp.S) */
92 __raw_writel(0, __io(APARMBAREA)); /* 4k */
93 __raw_writel(__pa(shmobile_secondary_vector), __io(SBAR));
94
95 /* enable cache coherency on CPU0 */
96 modify_scu_cpu_psr(0, 3 << (0 * 8));
97}
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
new file mode 100644
index 000000000000..895794b543cd
--- /dev/null
+++ b/arch/arm/mach-shmobile/timer.c
@@ -0,0 +1,46 @@
1/*
2 * SH-Mobile Timer
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2002 - 2009 Paul Mundt
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#include <linux/platform_device.h>
22#include <asm/mach/time.h>
23
24static void __init shmobile_late_time_init(void)
25{
26 /*
27 * Make sure all compiled-in early timers register themselves.
28 *
29 * Run probe() for two "earlytimer" devices, these will be the
30 * clockevents and clocksource devices respectively. In the event
31 * that only a clockevents device is available, we -ENODEV on the
32 * clocksource and the jiffies clocksource is used transparently
33 * instead. No error handling is necessary here.
34 */
35 early_platform_driver_register_all("earlytimer");
36 early_platform_driver_probe("earlytimer", 2, 0);
37}
38
39static void __init shmobile_timer_init(void)
40{
41 late_time_init = shmobile_late_time_init;
42}
43
44struct sys_timer shmobile_timer = {
45 .init = shmobile_timer_init,
46};