aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorSimon Horman <horms+renesas@verge.net.au>2013-12-19 05:08:11 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-12-19 05:08:11 -0500
commit70d4f2e5576a16120e6bc85b10011032306c1179 (patch)
tree8fe170b96167ab3aeb82980d58828942fe11668a /arch/arm/mach-shmobile
parentbe0647d556985ae58a42e7fc3751a293c418c41e (diff)
parent250d829f68ecb5e775a99deb03c56832acec28f4 (diff)
Merge branch 'heads/soc2' into boards2-base
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/Kconfig5
-rw-r--r--arch/arm/mach-shmobile/board-bockw.c1
-rw-r--r--arch/arm/mach-shmobile/clock-r7s72100.c1
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7790.c4
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7791.c3
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7778.h21
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c69
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c25
-rw-r--r--arch/arm/mach-shmobile/setup-rcar-gen2.c29
10 files changed, 151 insertions, 8 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 3e57d457308a..cd89d6348e0e 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -12,6 +12,7 @@ config ARCH_SHMOBILE_MULTI
12 select HAVE_SMP 12 select HAVE_SMP
13 select ARM_GIC 13 select ARM_GIC
14 select MIGHT_HAVE_CACHE_L2X0 14 select MIGHT_HAVE_CACHE_L2X0
15 select MIGHT_HAVE_PCI
15 select NO_IOPORT 16 select NO_IOPORT
16 select PINCTRL 17 select PINCTRL
17 select ARCH_REQUIRE_GPIOLIB 18 select ARCH_REQUIRE_GPIOLIB
@@ -111,6 +112,7 @@ config ARCH_R8A7790
111 select ARCH_WANT_OPTIONAL_GPIOLIB 112 select ARCH_WANT_OPTIONAL_GPIOLIB
112 select ARM_GIC 113 select ARM_GIC
113 select CPU_V7 114 select CPU_V7
115 select MIGHT_HAVE_PCI
114 select SH_CLK_CPG 116 select SH_CLK_CPG
115 select RENESAS_IRQC 117 select RENESAS_IRQC
116 118
@@ -119,6 +121,7 @@ config ARCH_R8A7791
119 select ARCH_WANT_OPTIONAL_GPIOLIB 121 select ARCH_WANT_OPTIONAL_GPIOLIB
120 select ARM_GIC 122 select ARM_GIC
121 select CPU_V7 123 select CPU_V7
124 select MIGHT_HAVE_PCI
122 select SH_CLK_CPG 125 select SH_CLK_CPG
123 select RENESAS_IRQC 126 select RENESAS_IRQC
124 127
@@ -127,6 +130,7 @@ config ARCH_EMEV2
127 select ARCH_WANT_OPTIONAL_GPIOLIB 130 select ARCH_WANT_OPTIONAL_GPIOLIB
128 select ARM_GIC 131 select ARM_GIC
129 select CPU_V7 132 select CPU_V7
133 select MIGHT_HAVE_PCI
130 select USE_OF 134 select USE_OF
131 select AUTO_ZRELADDR 135 select AUTO_ZRELADDR
132 136
@@ -265,6 +269,7 @@ config MACH_KOELSCH
265 bool "Koelsch board" 269 bool "Koelsch board"
266 depends on ARCH_R8A7791 270 depends on ARCH_R8A7791
267 select USE_OF 271 select USE_OF
272 select MICREL_PHY if SH_ETH
268 273
269config MACH_KOELSCH_REFERENCE 274config MACH_KOELSCH_REFERENCE
270 bool "Koelsch board - Reference Device Tree Implementation" 275 bool "Koelsch board - Reference Device Tree Implementation"
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index eb5b54fc5cc9..afb3f6869017 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -25,6 +25,7 @@
25#include <linux/mmc/sh_mmcif.h> 25#include <linux/mmc/sh_mmcif.h>
26#include <linux/mtd/partitions.h> 26#include <linux/mtd/partitions.h>
27#include <linux/pinctrl/machine.h> 27#include <linux/pinctrl/machine.h>
28#include <linux/platform_data/camera-rcar.h>
28#include <linux/platform_data/usb-rcar-phy.h> 29#include <linux/platform_data/usb-rcar-phy.h>
29#include <linux/platform_device.h> 30#include <linux/platform_device.h>
30#include <linux/regulator/fixed.h> 31#include <linux/regulator/fixed.h>
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
index 7b457aed8253..0814a508fd61 100644
--- a/arch/arm/mach-shmobile/clock-r7s72100.c
+++ b/arch/arm/mach-shmobile/clock-r7s72100.c
@@ -181,7 +181,6 @@ static struct clk_lookup lookups[] = {
181 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), 181 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]),
182 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), 182 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]),
183 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), 183 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]),
184 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]),
185}; 184};
186 185
187void __init r7s72100_clock_init(void) 186void __init r7s72100_clock_init(void)
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index 80cd8f31fa3c..09c5c7d66431 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -292,9 +292,13 @@ static struct clk_lookup lookups[] = {
292 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]), 292 CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]),
293 CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]), 293 CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]),
294 CLKDEV_DEV_ID("e6508000.i2c", &mstp_clks[MSTP931]), 294 CLKDEV_DEV_ID("e6508000.i2c", &mstp_clks[MSTP931]),
295 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP931]),
295 CLKDEV_DEV_ID("e6518000.i2c", &mstp_clks[MSTP930]), 296 CLKDEV_DEV_ID("e6518000.i2c", &mstp_clks[MSTP930]),
297 CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP930]),
296 CLKDEV_DEV_ID("e6530000.i2c", &mstp_clks[MSTP929]), 298 CLKDEV_DEV_ID("e6530000.i2c", &mstp_clks[MSTP929]),
299 CLKDEV_DEV_ID("i2c-rcar.2", &mstp_clks[MSTP929]),
297 CLKDEV_DEV_ID("e6540000.i2c", &mstp_clks[MSTP928]), 300 CLKDEV_DEV_ID("e6540000.i2c", &mstp_clks[MSTP928]),
301 CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP928]),
298 CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]), 302 CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]),
299 CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]), 303 CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
300 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), 304 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
index ff2d60d55bd5..f5461262ee25 100644
--- a/arch/arm/mach-shmobile/clock-r8a7791.c
+++ b/arch/arm/mach-shmobile/clock-r8a7791.c
@@ -122,6 +122,7 @@ static struct clk *main_clks[] = {
122 122
123/* MSTP */ 123/* MSTP */
124enum { 124enum {
125 MSTP813,
125 MSTP726, MSTP724, MSTP723, MSTP721, MSTP720, 126 MSTP726, MSTP724, MSTP723, MSTP721, MSTP720,
126 MSTP719, MSTP718, MSTP715, MSTP714, 127 MSTP719, MSTP718, MSTP715, MSTP714,
127 MSTP522, 128 MSTP522,
@@ -132,6 +133,7 @@ enum {
132}; 133};
133 134
134static struct clk mstp_clks[MSTP_NR] = { 135static struct clk mstp_clks[MSTP_NR] = {
136 [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
135 [MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */ 137 [MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */
136 [MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */ 138 [MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */
137 [MSTP723] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 23, 0), /* DU1 */ 139 [MSTP723] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 23, 0), /* DU1 */
@@ -192,6 +194,7 @@ static struct clk_lookup lookups[] = {
192 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), 194 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
193 CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]), 195 CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
194 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), 196 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
197 CLKDEV_DEV_ID("r8a7791-ether", &mstp_clks[MSTP813]), /* Ether */
195}; 198};
196 199
197#define R8A7791_CLOCK_ROOT(e, m, p0, p1, p30, p31) \ 200#define R8A7791_CLOCK_ROOT(e, m, p0, p1, p30, p31) \
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 2aeec468cf7c..87e349ddba7c 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -652,6 +652,7 @@ static struct clk_lookup lookups[] = {
652 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ 652 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
653 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ 653 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
654 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */ 654 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */
655 CLKDEV_DEV_ID("ec230000.sound", &mstp_clks[MSTP328]), /* FSI */
655 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ 656 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
656 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */ 657 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* I2C1 */
657 CLKDEV_DEV_ID("e6822000.i2c", &mstp_clks[MSTP323]), /* I2C1 */ 658 CLKDEV_DEV_ID("e6822000.i2c", &mstp_clks[MSTP323]), /* I2C1 */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
index b497f932d04f..f4076a50e970 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7778.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h
@@ -20,13 +20,30 @@
20#define __ASM_R8A7778_H__ 20#define __ASM_R8A7778_H__
21 21
22#include <linux/sh_eth.h> 22#include <linux/sh_eth.h>
23#include <linux/platform_data/camera-rcar.h>
24 23
25/* HPB-DMA slave IDs */ 24/* HPB-DMA slave IDs */
26enum { 25enum {
27 HPBDMA_SLAVE_DUMMY, 26 HPBDMA_SLAVE_DUMMY,
28 HPBDMA_SLAVE_SDHI0_TX, 27 HPBDMA_SLAVE_SDHI0_TX,
29 HPBDMA_SLAVE_SDHI0_RX, 28 HPBDMA_SLAVE_SDHI0_RX,
29 HPBDMA_SLAVE_SSI0_TX,
30 HPBDMA_SLAVE_SSI0_RX,
31 HPBDMA_SLAVE_SSI1_TX,
32 HPBDMA_SLAVE_SSI1_RX,
33 HPBDMA_SLAVE_SSI2_TX,
34 HPBDMA_SLAVE_SSI2_RX,
35 HPBDMA_SLAVE_SSI3_TX,
36 HPBDMA_SLAVE_SSI3_RX,
37 HPBDMA_SLAVE_SSI4_TX,
38 HPBDMA_SLAVE_SSI4_RX,
39 HPBDMA_SLAVE_SSI5_TX,
40 HPBDMA_SLAVE_SSI5_RX,
41 HPBDMA_SLAVE_SSI6_TX,
42 HPBDMA_SLAVE_SSI6_RX,
43 HPBDMA_SLAVE_SSI7_TX,
44 HPBDMA_SLAVE_SSI7_RX,
45 HPBDMA_SLAVE_SSI8_TX,
46 HPBDMA_SLAVE_SSI8_RX,
30 HPBDMA_SLAVE_HPBIF0_TX, 47 HPBDMA_SLAVE_HPBIF0_TX,
31 HPBDMA_SLAVE_HPBIF0_RX, 48 HPBDMA_SLAVE_HPBIF0_RX,
32 HPBDMA_SLAVE_HPBIF1_TX, 49 HPBDMA_SLAVE_HPBIF1_TX,
@@ -45,6 +62,8 @@ enum {
45 HPBDMA_SLAVE_HPBIF7_RX, 62 HPBDMA_SLAVE_HPBIF7_RX,
46 HPBDMA_SLAVE_HPBIF8_TX, 63 HPBDMA_SLAVE_HPBIF8_TX,
47 HPBDMA_SLAVE_HPBIF8_RX, 64 HPBDMA_SLAVE_HPBIF8_RX,
65 HPBDMA_SLAVE_USBFUNC_TX,
66 HPBDMA_SLAVE_USBFUNC_RX,
48}; 67};
49 68
50extern void r8a7778_add_standard_devices(void); 69extern void r8a7778_add_standard_devices(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 81701cfb6cc6..7ea6308e5da8 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -319,6 +319,29 @@ void __init r8a7778_add_dt_devices(void)
319#define HPB_DMAE_ASYNCMDR_ASMD21_SINGLE BIT(1) /* SDHI0 */ 319#define HPB_DMAE_ASYNCMDR_ASMD21_SINGLE BIT(1) /* SDHI0 */
320#define HPB_DMAE_ASYNCMDR_ASMD21_MULTI 0 /* SDHI0 */ 320#define HPB_DMAE_ASYNCMDR_ASMD21_MULTI 0 /* SDHI0 */
321 321
322#define HPBDMA_SSI(_id) \
323{ \
324 .id = HPBDMA_SLAVE_SSI## _id ##_TX, \
325 .addr = 0xffd91008 + (_id * 0x40), \
326 .dcr = HPB_DMAE_DCR_CT | \
327 HPB_DMAE_DCR_DIP | \
328 HPB_DMAE_DCR_SPDS_32BIT | \
329 HPB_DMAE_DCR_DMDL | \
330 HPB_DMAE_DCR_DPDS_32BIT, \
331 .port = _id + (_id << 8), \
332 .dma_ch = (28 + _id), \
333}, { \
334 .id = HPBDMA_SLAVE_SSI## _id ##_RX, \
335 .addr = 0xffd9100c + (_id * 0x40), \
336 .dcr = HPB_DMAE_DCR_CT | \
337 HPB_DMAE_DCR_DIP | \
338 HPB_DMAE_DCR_SMDL | \
339 HPB_DMAE_DCR_SPDS_32BIT | \
340 HPB_DMAE_DCR_DPDS_32BIT, \
341 .port = _id + (_id << 8), \
342 .dma_ch = (28 + _id), \
343}
344
322#define HPBDMA_HPBIF(_id) \ 345#define HPBDMA_HPBIF(_id) \
323{ \ 346{ \
324 .id = HPBDMA_SLAVE_HPBIF## _id ##_TX, \ 347 .id = HPBDMA_SLAVE_HPBIF## _id ##_TX, \
@@ -371,8 +394,34 @@ static const struct hpb_dmae_slave_config hpb_dmae_slaves[] = {
371 .port = 0x0D0C, 394 .port = 0x0D0C,
372 .flags = HPB_DMAE_SET_ASYNC_RESET | HPB_DMAE_SET_ASYNC_MODE, 395 .flags = HPB_DMAE_SET_ASYNC_RESET | HPB_DMAE_SET_ASYNC_MODE,
373 .dma_ch = 22, 396 .dma_ch = 22,
397 }, {
398 .id = HPBDMA_SLAVE_USBFUNC_TX, /* for D0 */
399 .addr = 0xffe60018,
400 .dcr = HPB_DMAE_DCR_SPDS_32BIT |
401 HPB_DMAE_DCR_DMDL |
402 HPB_DMAE_DCR_DPDS_32BIT,
403 .port = 0x0000,
404 .dma_ch = 14,
405 }, {
406 .id = HPBDMA_SLAVE_USBFUNC_RX, /* for D1 */
407 .addr = 0xffe6001c,
408 .dcr = HPB_DMAE_DCR_SMDL |
409 HPB_DMAE_DCR_SPDS_32BIT |
410 HPB_DMAE_DCR_DPDS_32BIT,
411 .port = 0x0101,
412 .dma_ch = 15,
374 }, 413 },
375 414
415 HPBDMA_SSI(0),
416 HPBDMA_SSI(1),
417 HPBDMA_SSI(2),
418 HPBDMA_SSI(3),
419 HPBDMA_SSI(4),
420 HPBDMA_SSI(5),
421 HPBDMA_SSI(6),
422 HPBDMA_SSI(7),
423 HPBDMA_SSI(8),
424
376 HPBDMA_HPBIF(0), 425 HPBDMA_HPBIF(0),
377 HPBDMA_HPBIF(1), 426 HPBDMA_HPBIF(1),
378 HPBDMA_HPBIF(2), 427 HPBDMA_HPBIF(2),
@@ -385,24 +434,44 @@ static const struct hpb_dmae_slave_config hpb_dmae_slaves[] = {
385}; 434};
386 435
387static const struct hpb_dmae_channel hpb_dmae_channels[] = { 436static const struct hpb_dmae_channel hpb_dmae_channels[] = {
437 HPB_DMAE_CHANNEL(0x7c, HPBDMA_SLAVE_USBFUNC_TX), /* ch. 14 */
438 HPB_DMAE_CHANNEL(0x7c, HPBDMA_SLAVE_USBFUNC_RX), /* ch. 15 */
388 HPB_DMAE_CHANNEL(0x7e, HPBDMA_SLAVE_SDHI0_TX), /* ch. 21 */ 439 HPB_DMAE_CHANNEL(0x7e, HPBDMA_SLAVE_SDHI0_TX), /* ch. 21 */
389 HPB_DMAE_CHANNEL(0x7e, HPBDMA_SLAVE_SDHI0_RX), /* ch. 22 */ 440 HPB_DMAE_CHANNEL(0x7e, HPBDMA_SLAVE_SDHI0_RX), /* ch. 22 */
441 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI0_TX), /* ch. 28 */
442 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI0_RX), /* ch. 28 */
390 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF0_TX), /* ch. 28 */ 443 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF0_TX), /* ch. 28 */
391 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF0_RX), /* ch. 28 */ 444 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF0_RX), /* ch. 28 */
445 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI1_TX), /* ch. 29 */
446 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI1_RX), /* ch. 29 */
392 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF1_TX), /* ch. 29 */ 447 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF1_TX), /* ch. 29 */
393 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF1_RX), /* ch. 29 */ 448 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF1_RX), /* ch. 29 */
449 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI2_TX), /* ch. 30 */
450 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI2_RX), /* ch. 30 */
394 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF2_TX), /* ch. 30 */ 451 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF2_TX), /* ch. 30 */
395 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF2_RX), /* ch. 30 */ 452 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF2_RX), /* ch. 30 */
453 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI3_TX), /* ch. 31 */
454 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI3_RX), /* ch. 31 */
396 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF3_TX), /* ch. 31 */ 455 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF3_TX), /* ch. 31 */
397 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF3_RX), /* ch. 31 */ 456 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF3_RX), /* ch. 31 */
457 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI4_TX), /* ch. 32 */
458 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI4_RX), /* ch. 32 */
398 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF4_TX), /* ch. 32 */ 459 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF4_TX), /* ch. 32 */
399 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF4_RX), /* ch. 32 */ 460 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF4_RX), /* ch. 32 */
461 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI5_TX), /* ch. 33 */
462 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI5_RX), /* ch. 33 */
400 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF5_TX), /* ch. 33 */ 463 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF5_TX), /* ch. 33 */
401 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF5_RX), /* ch. 33 */ 464 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF5_RX), /* ch. 33 */
465 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI6_TX), /* ch. 34 */
466 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI6_RX), /* ch. 34 */
402 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF6_TX), /* ch. 34 */ 467 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF6_TX), /* ch. 34 */
403 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF6_RX), /* ch. 34 */ 468 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF6_RX), /* ch. 34 */
469 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI7_TX), /* ch. 35 */
470 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI7_RX), /* ch. 35 */
404 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF7_TX), /* ch. 35 */ 471 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF7_TX), /* ch. 35 */
405 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF7_RX), /* ch. 35 */ 472 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF7_RX), /* ch. 35 */
473 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI8_TX), /* ch. 36 */
474 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_SSI8_RX), /* ch. 36 */
406 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF8_TX), /* ch. 36 */ 475 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF8_TX), /* ch. 36 */
407 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF8_RX), /* ch. 36 */ 476 HPB_DMAE_CHANNEL(0x7f, HPBDMA_SLAVE_HPBIF8_RX), /* ch. 36 */
408}; 477};
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 3543c3bacb75..8474818a7ae0 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -67,6 +67,27 @@ R8A7790_GPIO(5);
67 &r8a7790_gpio##idx##_platform_data, \ 67 &r8a7790_gpio##idx##_platform_data, \
68 sizeof(r8a7790_gpio##idx##_platform_data)) 68 sizeof(r8a7790_gpio##idx##_platform_data))
69 69
70static struct resource i2c_resources[] __initdata = {
71 /* I2C0 */
72 DEFINE_RES_MEM(0xE6508000, 0x40),
73 DEFINE_RES_IRQ(gic_spi(287)),
74 /* I2C1 */
75 DEFINE_RES_MEM(0xE6518000, 0x40),
76 DEFINE_RES_IRQ(gic_spi(288)),
77 /* I2C2 */
78 DEFINE_RES_MEM(0xE6530000, 0x40),
79 DEFINE_RES_IRQ(gic_spi(286)),
80 /* I2C3 */
81 DEFINE_RES_MEM(0xE6540000, 0x40),
82 DEFINE_RES_IRQ(gic_spi(290)),
83
84};
85
86#define r8a7790_register_i2c(idx) \
87 platform_device_register_simple( \
88 "i2c-rcar", idx, \
89 i2c_resources + (2 * idx), 2); \
90
70void __init r8a7790_pinmux_init(void) 91void __init r8a7790_pinmux_init(void)
71{ 92{
72 r8a7790_register_pfc(); 93 r8a7790_register_pfc();
@@ -76,6 +97,10 @@ void __init r8a7790_pinmux_init(void)
76 r8a7790_register_gpio(3); 97 r8a7790_register_gpio(3);
77 r8a7790_register_gpio(4); 98 r8a7790_register_gpio(4);
78 r8a7790_register_gpio(5); 99 r8a7790_register_gpio(5);
100 r8a7790_register_i2c(0);
101 r8a7790_register_i2c(1);
102 r8a7790_register_i2c(2);
103 r8a7790_register_i2c(3);
79} 104}
80 105
81#define SCIF_COMMON(scif_type, baseaddr, irq) \ 106#define SCIF_COMMON(scif_type, baseaddr, irq) \
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 5734c24bf6c7..69ccc6c6fd33 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -18,6 +18,7 @@
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 20
21#include <linux/clk/shmobile.h>
21#include <linux/clocksource.h> 22#include <linux/clocksource.h>
22#include <linux/io.h> 23#include <linux/io.h>
23#include <linux/kernel.h> 24#include <linux/kernel.h>
@@ -44,8 +45,10 @@ u32 __init rcar_gen2_read_mode_pins(void)
44 45
45void __init rcar_gen2_timer_init(void) 46void __init rcar_gen2_timer_init(void)
46{ 47{
47#ifdef CONFIG_ARM_ARCH_TIMER 48#if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK)
48 u32 mode = rcar_gen2_read_mode_pins(); 49 u32 mode = rcar_gen2_read_mode_pins();
50#endif
51#ifdef CONFIG_ARM_ARCH_TIMER
49 void __iomem *base; 52 void __iomem *base;
50 int extal_mhz = 0; 53 int extal_mhz = 0;
51 u32 freq; 54 u32 freq;
@@ -78,14 +81,28 @@ void __init rcar_gen2_timer_init(void)
78 /* Remap "armgcnt address map" space */ 81 /* Remap "armgcnt address map" space */
79 base = ioremap(0xe6080000, PAGE_SIZE); 82 base = ioremap(0xe6080000, PAGE_SIZE);
80 83
81 /* Update registers with correct frequency */ 84 /*
82 iowrite32(freq, base + CNTFID0); 85 * Update the timer if it is either not running, or is not at the
83 asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq)); 86 * right frequency. The timer is only configurable in secure mode
87 * so this avoids an abort if the loader started the timer and
88 * entered the kernel in non-secure mode.
89 */
90
91 if ((ioread32(base + CNTCR) & 1) == 0 ||
92 ioread32(base + CNTFID0) != freq) {
93 /* Update registers with correct frequency */
94 iowrite32(freq, base + CNTFID0);
95 asm volatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
96
97 /* make sure arch timer is started by setting bit 0 of CNTCR */
98 iowrite32(1, base + CNTCR);
99 }
84 100
85 /* make sure arch timer is started by setting bit 0 of CNTCR */
86 iowrite32(1, base + CNTCR);
87 iounmap(base); 101 iounmap(base);
88#endif /* CONFIG_ARM_ARCH_TIMER */ 102#endif /* CONFIG_ARM_ARCH_TIMER */
89 103
104#ifdef CONFIG_COMMON_CLK
105 rcar_gen2_clocks_init(mode);
106#endif
90 clocksource_of_init(); 107 clocksource_of_init();
91} 108}