162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * SH7757 Setup
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (C) 2009, 2011  Renesas Solutions Corp.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci *  based on setup-sh7785.c : Copyright (C) 2007  Paul Mundt
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci#include <linux/platform_device.h>
1062306a36Sopenharmony_ci#include <linux/init.h>
1162306a36Sopenharmony_ci#include <linux/serial.h>
1262306a36Sopenharmony_ci#include <linux/serial_sci.h>
1362306a36Sopenharmony_ci#include <linux/io.h>
1462306a36Sopenharmony_ci#include <linux/mm.h>
1562306a36Sopenharmony_ci#include <linux/dma-mapping.h>
1662306a36Sopenharmony_ci#include <linux/sh_timer.h>
1762306a36Sopenharmony_ci#include <linux/sh_dma.h>
1862306a36Sopenharmony_ci#include <linux/sh_intc.h>
1962306a36Sopenharmony_ci#include <linux/usb/ohci_pdriver.h>
2062306a36Sopenharmony_ci#include <cpu/dma-register.h>
2162306a36Sopenharmony_ci#include <cpu/sh7757.h>
2262306a36Sopenharmony_ci#include <asm/platform_early.h>
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_cistatic struct plat_sci_port scif2_platform_data = {
2562306a36Sopenharmony_ci	.scscr		= SCSCR_REIE,
2662306a36Sopenharmony_ci	.type		= PORT_SCIF,
2762306a36Sopenharmony_ci};
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_cistatic struct resource scif2_resources[] = {
3062306a36Sopenharmony_ci	DEFINE_RES_MEM(0xfe4b0000, 0x100),		/* SCIF2 */
3162306a36Sopenharmony_ci	DEFINE_RES_IRQ(evt2irq(0x700)),
3262306a36Sopenharmony_ci};
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_cistatic struct platform_device scif2_device = {
3562306a36Sopenharmony_ci	.name		= "sh-sci",
3662306a36Sopenharmony_ci	.id		= 0,
3762306a36Sopenharmony_ci	.resource	= scif2_resources,
3862306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(scif2_resources),
3962306a36Sopenharmony_ci	.dev		= {
4062306a36Sopenharmony_ci		.platform_data	= &scif2_platform_data,
4162306a36Sopenharmony_ci	},
4262306a36Sopenharmony_ci};
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_cistatic struct plat_sci_port scif3_platform_data = {
4562306a36Sopenharmony_ci	.scscr		= SCSCR_REIE,
4662306a36Sopenharmony_ci	.type		= PORT_SCIF,
4762306a36Sopenharmony_ci};
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_cistatic struct resource scif3_resources[] = {
5062306a36Sopenharmony_ci	DEFINE_RES_MEM(0xfe4c0000, 0x100),		/* SCIF3 */
5162306a36Sopenharmony_ci	DEFINE_RES_IRQ(evt2irq(0xb80)),
5262306a36Sopenharmony_ci};
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_cistatic struct platform_device scif3_device = {
5562306a36Sopenharmony_ci	.name		= "sh-sci",
5662306a36Sopenharmony_ci	.id		= 1,
5762306a36Sopenharmony_ci	.resource	= scif3_resources,
5862306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(scif3_resources),
5962306a36Sopenharmony_ci	.dev		= {
6062306a36Sopenharmony_ci		.platform_data	= &scif3_platform_data,
6162306a36Sopenharmony_ci	},
6262306a36Sopenharmony_ci};
6362306a36Sopenharmony_ci
6462306a36Sopenharmony_cistatic struct plat_sci_port scif4_platform_data = {
6562306a36Sopenharmony_ci	.scscr		= SCSCR_REIE,
6662306a36Sopenharmony_ci	.type		= PORT_SCIF,
6762306a36Sopenharmony_ci};
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_cistatic struct resource scif4_resources[] = {
7062306a36Sopenharmony_ci	DEFINE_RES_MEM(0xfe4d0000, 0x100),		/* SCIF4 */
7162306a36Sopenharmony_ci	DEFINE_RES_IRQ(evt2irq(0xf00)),
7262306a36Sopenharmony_ci};
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_cistatic struct platform_device scif4_device = {
7562306a36Sopenharmony_ci	.name		= "sh-sci",
7662306a36Sopenharmony_ci	.id		= 2,
7762306a36Sopenharmony_ci	.resource	= scif4_resources,
7862306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(scif4_resources),
7962306a36Sopenharmony_ci	.dev		= {
8062306a36Sopenharmony_ci		.platform_data	= &scif4_platform_data,
8162306a36Sopenharmony_ci	},
8262306a36Sopenharmony_ci};
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_cistatic struct sh_timer_config tmu0_platform_data = {
8562306a36Sopenharmony_ci	.channels_mask = 3,
8662306a36Sopenharmony_ci};
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_cistatic struct resource tmu0_resources[] = {
8962306a36Sopenharmony_ci	DEFINE_RES_MEM(0xfe430000, 0x20),
9062306a36Sopenharmony_ci	DEFINE_RES_IRQ(evt2irq(0x580)),
9162306a36Sopenharmony_ci	DEFINE_RES_IRQ(evt2irq(0x5a0)),
9262306a36Sopenharmony_ci};
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_cistatic struct platform_device tmu0_device = {
9562306a36Sopenharmony_ci	.name		= "sh-tmu",
9662306a36Sopenharmony_ci	.id		= 0,
9762306a36Sopenharmony_ci	.dev = {
9862306a36Sopenharmony_ci		.platform_data	= &tmu0_platform_data,
9962306a36Sopenharmony_ci	},
10062306a36Sopenharmony_ci	.resource	= tmu0_resources,
10162306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(tmu0_resources),
10262306a36Sopenharmony_ci};
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_cistatic struct resource spi0_resources[] = {
10562306a36Sopenharmony_ci	[0] = {
10662306a36Sopenharmony_ci		.start	= 0xfe002000,
10762306a36Sopenharmony_ci		.end	= 0xfe0020ff,
10862306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
10962306a36Sopenharmony_ci	},
11062306a36Sopenharmony_ci	[1] = {
11162306a36Sopenharmony_ci		.start	= evt2irq(0xcc0),
11262306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
11362306a36Sopenharmony_ci	},
11462306a36Sopenharmony_ci};
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci/* DMA */
11762306a36Sopenharmony_cistatic const struct sh_dmae_slave_config sh7757_dmae0_slaves[] = {
11862306a36Sopenharmony_ci	{
11962306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_SDHI_TX,
12062306a36Sopenharmony_ci		.addr		= 0x1fe50030,
12162306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
12262306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_16BIT),
12362306a36Sopenharmony_ci		.mid_rid	= 0xc5,
12462306a36Sopenharmony_ci	},
12562306a36Sopenharmony_ci	{
12662306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_SDHI_RX,
12762306a36Sopenharmony_ci		.addr		= 0x1fe50030,
12862306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
12962306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_16BIT),
13062306a36Sopenharmony_ci		.mid_rid	= 0xc6,
13162306a36Sopenharmony_ci	},
13262306a36Sopenharmony_ci	{
13362306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_MMCIF_TX,
13462306a36Sopenharmony_ci		.addr		= 0x1fcb0034,
13562306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
13662306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_32BIT),
13762306a36Sopenharmony_ci		.mid_rid	= 0xd3,
13862306a36Sopenharmony_ci	},
13962306a36Sopenharmony_ci	{
14062306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_MMCIF_RX,
14162306a36Sopenharmony_ci		.addr		= 0x1fcb0034,
14262306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
14362306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_32BIT),
14462306a36Sopenharmony_ci		.mid_rid	= 0xd7,
14562306a36Sopenharmony_ci	},
14662306a36Sopenharmony_ci};
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_cistatic const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = {
14962306a36Sopenharmony_ci	{
15062306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_SCIF2_TX,
15162306a36Sopenharmony_ci		.addr		= 0x1f4b000c,
15262306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
15362306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
15462306a36Sopenharmony_ci		.mid_rid	= 0x21,
15562306a36Sopenharmony_ci	},
15662306a36Sopenharmony_ci	{
15762306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_SCIF2_RX,
15862306a36Sopenharmony_ci		.addr		= 0x1f4b0014,
15962306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
16062306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
16162306a36Sopenharmony_ci		.mid_rid	= 0x22,
16262306a36Sopenharmony_ci	},
16362306a36Sopenharmony_ci	{
16462306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_SCIF3_TX,
16562306a36Sopenharmony_ci		.addr		= 0x1f4c000c,
16662306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
16762306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
16862306a36Sopenharmony_ci		.mid_rid	= 0x29,
16962306a36Sopenharmony_ci	},
17062306a36Sopenharmony_ci	{
17162306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_SCIF3_RX,
17262306a36Sopenharmony_ci		.addr		= 0x1f4c0014,
17362306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
17462306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
17562306a36Sopenharmony_ci		.mid_rid	= 0x2a,
17662306a36Sopenharmony_ci	},
17762306a36Sopenharmony_ci	{
17862306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_SCIF4_TX,
17962306a36Sopenharmony_ci		.addr		= 0x1f4d000c,
18062306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
18162306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
18262306a36Sopenharmony_ci		.mid_rid	= 0x41,
18362306a36Sopenharmony_ci	},
18462306a36Sopenharmony_ci	{
18562306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_SCIF4_RX,
18662306a36Sopenharmony_ci		.addr		= 0x1f4d0014,
18762306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
18862306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
18962306a36Sopenharmony_ci		.mid_rid	= 0x42,
19062306a36Sopenharmony_ci	},
19162306a36Sopenharmony_ci	{
19262306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RSPI_TX,
19362306a36Sopenharmony_ci		.addr		= 0xfe480004,
19462306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
19562306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_16BIT),
19662306a36Sopenharmony_ci		.mid_rid	= 0xc1,
19762306a36Sopenharmony_ci	},
19862306a36Sopenharmony_ci	{
19962306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RSPI_RX,
20062306a36Sopenharmony_ci		.addr		= 0xfe480004,
20162306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
20262306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_16BIT),
20362306a36Sopenharmony_ci		.mid_rid	= 0xc2,
20462306a36Sopenharmony_ci	},
20562306a36Sopenharmony_ci};
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_cistatic const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = {
20862306a36Sopenharmony_ci	{
20962306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC0_TX,
21062306a36Sopenharmony_ci		.addr		= 0x1e500012,
21162306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
21262306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
21362306a36Sopenharmony_ci		.mid_rid	= 0x21,
21462306a36Sopenharmony_ci	},
21562306a36Sopenharmony_ci	{
21662306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC0_RX,
21762306a36Sopenharmony_ci		.addr		= 0x1e500013,
21862306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
21962306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
22062306a36Sopenharmony_ci		.mid_rid	= 0x22,
22162306a36Sopenharmony_ci	},
22262306a36Sopenharmony_ci	{
22362306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC1_TX,
22462306a36Sopenharmony_ci		.addr		= 0x1e510012,
22562306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
22662306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
22762306a36Sopenharmony_ci		.mid_rid	= 0x29,
22862306a36Sopenharmony_ci	},
22962306a36Sopenharmony_ci	{
23062306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC1_RX,
23162306a36Sopenharmony_ci		.addr		= 0x1e510013,
23262306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
23362306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
23462306a36Sopenharmony_ci		.mid_rid	= 0x2a,
23562306a36Sopenharmony_ci	},
23662306a36Sopenharmony_ci	{
23762306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC2_TX,
23862306a36Sopenharmony_ci		.addr		= 0x1e520012,
23962306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
24062306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
24162306a36Sopenharmony_ci		.mid_rid	= 0xa1,
24262306a36Sopenharmony_ci	},
24362306a36Sopenharmony_ci	{
24462306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC2_RX,
24562306a36Sopenharmony_ci		.addr		= 0x1e520013,
24662306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
24762306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
24862306a36Sopenharmony_ci		.mid_rid	= 0xa2,
24962306a36Sopenharmony_ci	},
25062306a36Sopenharmony_ci	{
25162306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC3_TX,
25262306a36Sopenharmony_ci		.addr		= 0x1e530012,
25362306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
25462306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
25562306a36Sopenharmony_ci		.mid_rid	= 0xa9,
25662306a36Sopenharmony_ci	},
25762306a36Sopenharmony_ci	{
25862306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC3_RX,
25962306a36Sopenharmony_ci		.addr		= 0x1e530013,
26062306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
26162306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
26262306a36Sopenharmony_ci		.mid_rid	= 0xaf,
26362306a36Sopenharmony_ci	},
26462306a36Sopenharmony_ci	{
26562306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC4_TX,
26662306a36Sopenharmony_ci		.addr		= 0x1e540012,
26762306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
26862306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
26962306a36Sopenharmony_ci		.mid_rid	= 0xc5,
27062306a36Sopenharmony_ci	},
27162306a36Sopenharmony_ci	{
27262306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC4_RX,
27362306a36Sopenharmony_ci		.addr		= 0x1e540013,
27462306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
27562306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
27662306a36Sopenharmony_ci		.mid_rid	= 0xc6,
27762306a36Sopenharmony_ci	},
27862306a36Sopenharmony_ci};
27962306a36Sopenharmony_ci
28062306a36Sopenharmony_cistatic const struct sh_dmae_slave_config sh7757_dmae3_slaves[] = {
28162306a36Sopenharmony_ci	{
28262306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC5_TX,
28362306a36Sopenharmony_ci		.addr		= 0x1e550012,
28462306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
28562306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
28662306a36Sopenharmony_ci		.mid_rid	= 0x21,
28762306a36Sopenharmony_ci	},
28862306a36Sopenharmony_ci	{
28962306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC5_RX,
29062306a36Sopenharmony_ci		.addr		= 0x1e550013,
29162306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
29262306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
29362306a36Sopenharmony_ci		.mid_rid	= 0x22,
29462306a36Sopenharmony_ci	},
29562306a36Sopenharmony_ci	{
29662306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC6_TX,
29762306a36Sopenharmony_ci		.addr		= 0x1e560012,
29862306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
29962306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
30062306a36Sopenharmony_ci		.mid_rid	= 0x29,
30162306a36Sopenharmony_ci	},
30262306a36Sopenharmony_ci	{
30362306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC6_RX,
30462306a36Sopenharmony_ci		.addr		= 0x1e560013,
30562306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
30662306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
30762306a36Sopenharmony_ci		.mid_rid	= 0x2a,
30862306a36Sopenharmony_ci	},
30962306a36Sopenharmony_ci	{
31062306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC7_TX,
31162306a36Sopenharmony_ci		.addr		= 0x1e570012,
31262306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
31362306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
31462306a36Sopenharmony_ci		.mid_rid	= 0x41,
31562306a36Sopenharmony_ci	},
31662306a36Sopenharmony_ci	{
31762306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC7_RX,
31862306a36Sopenharmony_ci		.addr		= 0x1e570013,
31962306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
32062306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
32162306a36Sopenharmony_ci		.mid_rid	= 0x42,
32262306a36Sopenharmony_ci	},
32362306a36Sopenharmony_ci	{
32462306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC8_TX,
32562306a36Sopenharmony_ci		.addr		= 0x1e580012,
32662306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
32762306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
32862306a36Sopenharmony_ci		.mid_rid	= 0x45,
32962306a36Sopenharmony_ci	},
33062306a36Sopenharmony_ci	{
33162306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC8_RX,
33262306a36Sopenharmony_ci		.addr		= 0x1e580013,
33362306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
33462306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
33562306a36Sopenharmony_ci		.mid_rid	= 0x46,
33662306a36Sopenharmony_ci	},
33762306a36Sopenharmony_ci	{
33862306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC9_TX,
33962306a36Sopenharmony_ci		.addr		= 0x1e590012,
34062306a36Sopenharmony_ci		.chcr		= SM_INC | RS_ERS | 0x40000000 |
34162306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
34262306a36Sopenharmony_ci		.mid_rid	= 0x51,
34362306a36Sopenharmony_ci	},
34462306a36Sopenharmony_ci	{
34562306a36Sopenharmony_ci		.slave_id	= SHDMA_SLAVE_RIIC9_RX,
34662306a36Sopenharmony_ci		.addr		= 0x1e590013,
34762306a36Sopenharmony_ci		.chcr		= DM_INC | RS_ERS | 0x40000000 |
34862306a36Sopenharmony_ci				  TS_INDEX2VAL(XMIT_SZ_8BIT),
34962306a36Sopenharmony_ci		.mid_rid	= 0x52,
35062306a36Sopenharmony_ci	},
35162306a36Sopenharmony_ci};
35262306a36Sopenharmony_ci
35362306a36Sopenharmony_cistatic const struct sh_dmae_channel sh7757_dmae_channels[] = {
35462306a36Sopenharmony_ci	{
35562306a36Sopenharmony_ci		.offset = 0,
35662306a36Sopenharmony_ci		.dmars = 0,
35762306a36Sopenharmony_ci		.dmars_bit = 0,
35862306a36Sopenharmony_ci	}, {
35962306a36Sopenharmony_ci		.offset = 0x10,
36062306a36Sopenharmony_ci		.dmars = 0,
36162306a36Sopenharmony_ci		.dmars_bit = 8,
36262306a36Sopenharmony_ci	}, {
36362306a36Sopenharmony_ci		.offset = 0x20,
36462306a36Sopenharmony_ci		.dmars = 4,
36562306a36Sopenharmony_ci		.dmars_bit = 0,
36662306a36Sopenharmony_ci	}, {
36762306a36Sopenharmony_ci		.offset = 0x30,
36862306a36Sopenharmony_ci		.dmars = 4,
36962306a36Sopenharmony_ci		.dmars_bit = 8,
37062306a36Sopenharmony_ci	}, {
37162306a36Sopenharmony_ci		.offset = 0x50,
37262306a36Sopenharmony_ci		.dmars = 8,
37362306a36Sopenharmony_ci		.dmars_bit = 0,
37462306a36Sopenharmony_ci	}, {
37562306a36Sopenharmony_ci		.offset = 0x60,
37662306a36Sopenharmony_ci		.dmars = 8,
37762306a36Sopenharmony_ci		.dmars_bit = 8,
37862306a36Sopenharmony_ci	}
37962306a36Sopenharmony_ci};
38062306a36Sopenharmony_ci
38162306a36Sopenharmony_cistatic const unsigned int ts_shift[] = TS_SHIFT;
38262306a36Sopenharmony_ci
38362306a36Sopenharmony_cistatic struct sh_dmae_pdata dma0_platform_data = {
38462306a36Sopenharmony_ci	.slave		= sh7757_dmae0_slaves,
38562306a36Sopenharmony_ci	.slave_num	= ARRAY_SIZE(sh7757_dmae0_slaves),
38662306a36Sopenharmony_ci	.channel	= sh7757_dmae_channels,
38762306a36Sopenharmony_ci	.channel_num	= ARRAY_SIZE(sh7757_dmae_channels),
38862306a36Sopenharmony_ci	.ts_low_shift	= CHCR_TS_LOW_SHIFT,
38962306a36Sopenharmony_ci	.ts_low_mask	= CHCR_TS_LOW_MASK,
39062306a36Sopenharmony_ci	.ts_high_shift	= CHCR_TS_HIGH_SHIFT,
39162306a36Sopenharmony_ci	.ts_high_mask	= CHCR_TS_HIGH_MASK,
39262306a36Sopenharmony_ci	.ts_shift	= ts_shift,
39362306a36Sopenharmony_ci	.ts_shift_num	= ARRAY_SIZE(ts_shift),
39462306a36Sopenharmony_ci	.dmaor_init	= DMAOR_INIT,
39562306a36Sopenharmony_ci};
39662306a36Sopenharmony_ci
39762306a36Sopenharmony_cistatic struct sh_dmae_pdata dma1_platform_data = {
39862306a36Sopenharmony_ci	.slave		= sh7757_dmae1_slaves,
39962306a36Sopenharmony_ci	.slave_num	= ARRAY_SIZE(sh7757_dmae1_slaves),
40062306a36Sopenharmony_ci	.channel	= sh7757_dmae_channels,
40162306a36Sopenharmony_ci	.channel_num	= ARRAY_SIZE(sh7757_dmae_channels),
40262306a36Sopenharmony_ci	.ts_low_shift	= CHCR_TS_LOW_SHIFT,
40362306a36Sopenharmony_ci	.ts_low_mask	= CHCR_TS_LOW_MASK,
40462306a36Sopenharmony_ci	.ts_high_shift	= CHCR_TS_HIGH_SHIFT,
40562306a36Sopenharmony_ci	.ts_high_mask	= CHCR_TS_HIGH_MASK,
40662306a36Sopenharmony_ci	.ts_shift	= ts_shift,
40762306a36Sopenharmony_ci	.ts_shift_num	= ARRAY_SIZE(ts_shift),
40862306a36Sopenharmony_ci	.dmaor_init	= DMAOR_INIT,
40962306a36Sopenharmony_ci};
41062306a36Sopenharmony_ci
41162306a36Sopenharmony_cistatic struct sh_dmae_pdata dma2_platform_data = {
41262306a36Sopenharmony_ci	.slave		= sh7757_dmae2_slaves,
41362306a36Sopenharmony_ci	.slave_num	= ARRAY_SIZE(sh7757_dmae2_slaves),
41462306a36Sopenharmony_ci	.channel	= sh7757_dmae_channels,
41562306a36Sopenharmony_ci	.channel_num	= ARRAY_SIZE(sh7757_dmae_channels),
41662306a36Sopenharmony_ci	.ts_low_shift	= CHCR_TS_LOW_SHIFT,
41762306a36Sopenharmony_ci	.ts_low_mask	= CHCR_TS_LOW_MASK,
41862306a36Sopenharmony_ci	.ts_high_shift	= CHCR_TS_HIGH_SHIFT,
41962306a36Sopenharmony_ci	.ts_high_mask	= CHCR_TS_HIGH_MASK,
42062306a36Sopenharmony_ci	.ts_shift	= ts_shift,
42162306a36Sopenharmony_ci	.ts_shift_num	= ARRAY_SIZE(ts_shift),
42262306a36Sopenharmony_ci	.dmaor_init	= DMAOR_INIT,
42362306a36Sopenharmony_ci};
42462306a36Sopenharmony_ci
42562306a36Sopenharmony_cistatic struct sh_dmae_pdata dma3_platform_data = {
42662306a36Sopenharmony_ci	.slave		= sh7757_dmae3_slaves,
42762306a36Sopenharmony_ci	.slave_num	= ARRAY_SIZE(sh7757_dmae3_slaves),
42862306a36Sopenharmony_ci	.channel	= sh7757_dmae_channels,
42962306a36Sopenharmony_ci	.channel_num	= ARRAY_SIZE(sh7757_dmae_channels),
43062306a36Sopenharmony_ci	.ts_low_shift	= CHCR_TS_LOW_SHIFT,
43162306a36Sopenharmony_ci	.ts_low_mask	= CHCR_TS_LOW_MASK,
43262306a36Sopenharmony_ci	.ts_high_shift	= CHCR_TS_HIGH_SHIFT,
43362306a36Sopenharmony_ci	.ts_high_mask	= CHCR_TS_HIGH_MASK,
43462306a36Sopenharmony_ci	.ts_shift	= ts_shift,
43562306a36Sopenharmony_ci	.ts_shift_num	= ARRAY_SIZE(ts_shift),
43662306a36Sopenharmony_ci	.dmaor_init	= DMAOR_INIT,
43762306a36Sopenharmony_ci};
43862306a36Sopenharmony_ci
43962306a36Sopenharmony_ci/* channel 0 to 5 */
44062306a36Sopenharmony_cistatic struct resource sh7757_dmae0_resources[] = {
44162306a36Sopenharmony_ci	[0] = {
44262306a36Sopenharmony_ci		/* Channel registers and DMAOR */
44362306a36Sopenharmony_ci		.start	= 0xff608020,
44462306a36Sopenharmony_ci		.end	= 0xff60808f,
44562306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
44662306a36Sopenharmony_ci	},
44762306a36Sopenharmony_ci	[1] = {
44862306a36Sopenharmony_ci		/* DMARSx */
44962306a36Sopenharmony_ci		.start	= 0xff609000,
45062306a36Sopenharmony_ci		.end	= 0xff60900b,
45162306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
45262306a36Sopenharmony_ci	},
45362306a36Sopenharmony_ci	{
45462306a36Sopenharmony_ci		.name	= "error_irq",
45562306a36Sopenharmony_ci		.start	= evt2irq(0x640),
45662306a36Sopenharmony_ci		.end	= evt2irq(0x640),
45762306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
45862306a36Sopenharmony_ci	},
45962306a36Sopenharmony_ci};
46062306a36Sopenharmony_ci
46162306a36Sopenharmony_ci/* channel 6 to 11 */
46262306a36Sopenharmony_cistatic struct resource sh7757_dmae1_resources[] = {
46362306a36Sopenharmony_ci	[0] = {
46462306a36Sopenharmony_ci		/* Channel registers and DMAOR */
46562306a36Sopenharmony_ci		.start	= 0xff618020,
46662306a36Sopenharmony_ci		.end	= 0xff61808f,
46762306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
46862306a36Sopenharmony_ci	},
46962306a36Sopenharmony_ci	[1] = {
47062306a36Sopenharmony_ci		/* DMARSx */
47162306a36Sopenharmony_ci		.start	= 0xff619000,
47262306a36Sopenharmony_ci		.end	= 0xff61900b,
47362306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
47462306a36Sopenharmony_ci	},
47562306a36Sopenharmony_ci	{
47662306a36Sopenharmony_ci		.name	= "error_irq",
47762306a36Sopenharmony_ci		.start	= evt2irq(0x640),
47862306a36Sopenharmony_ci		.end	= evt2irq(0x640),
47962306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
48062306a36Sopenharmony_ci	},
48162306a36Sopenharmony_ci	{
48262306a36Sopenharmony_ci		/* IRQ for channels 4 */
48362306a36Sopenharmony_ci		.start	= evt2irq(0x7c0),
48462306a36Sopenharmony_ci		.end	= evt2irq(0x7c0),
48562306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
48662306a36Sopenharmony_ci	},
48762306a36Sopenharmony_ci	{
48862306a36Sopenharmony_ci		/* IRQ for channels 5 */
48962306a36Sopenharmony_ci		.start	= evt2irq(0x7c0),
49062306a36Sopenharmony_ci		.end	= evt2irq(0x7c0),
49162306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
49262306a36Sopenharmony_ci	},
49362306a36Sopenharmony_ci	{
49462306a36Sopenharmony_ci		/* IRQ for channels 6 */
49562306a36Sopenharmony_ci		.start	= evt2irq(0xd00),
49662306a36Sopenharmony_ci		.end	= evt2irq(0xd00),
49762306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
49862306a36Sopenharmony_ci	},
49962306a36Sopenharmony_ci	{
50062306a36Sopenharmony_ci		/* IRQ for channels 7 */
50162306a36Sopenharmony_ci		.start	= evt2irq(0xd00),
50262306a36Sopenharmony_ci		.end	= evt2irq(0xd00),
50362306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
50462306a36Sopenharmony_ci	},
50562306a36Sopenharmony_ci	{
50662306a36Sopenharmony_ci		/* IRQ for channels 8 */
50762306a36Sopenharmony_ci		.start	= evt2irq(0xd00),
50862306a36Sopenharmony_ci		.end	= evt2irq(0xd00),
50962306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
51062306a36Sopenharmony_ci	},
51162306a36Sopenharmony_ci	{
51262306a36Sopenharmony_ci		/* IRQ for channels 9 */
51362306a36Sopenharmony_ci		.start	= evt2irq(0xd00),
51462306a36Sopenharmony_ci		.end	= evt2irq(0xd00),
51562306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
51662306a36Sopenharmony_ci	},
51762306a36Sopenharmony_ci	{
51862306a36Sopenharmony_ci		/* IRQ for channels 10 */
51962306a36Sopenharmony_ci		.start	= evt2irq(0xd00),
52062306a36Sopenharmony_ci		.end	= evt2irq(0xd00),
52162306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
52262306a36Sopenharmony_ci	},
52362306a36Sopenharmony_ci	{
52462306a36Sopenharmony_ci		/* IRQ for channels 11 */
52562306a36Sopenharmony_ci		.start	= evt2irq(0xd00),
52662306a36Sopenharmony_ci		.end	= evt2irq(0xd00),
52762306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
52862306a36Sopenharmony_ci	},
52962306a36Sopenharmony_ci};
53062306a36Sopenharmony_ci
53162306a36Sopenharmony_ci/* channel 12 to 17 */
53262306a36Sopenharmony_cistatic struct resource sh7757_dmae2_resources[] = {
53362306a36Sopenharmony_ci	[0] = {
53462306a36Sopenharmony_ci		/* Channel registers and DMAOR */
53562306a36Sopenharmony_ci		.start	= 0xff708020,
53662306a36Sopenharmony_ci		.end	= 0xff70808f,
53762306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
53862306a36Sopenharmony_ci	},
53962306a36Sopenharmony_ci	[1] = {
54062306a36Sopenharmony_ci		/* DMARSx */
54162306a36Sopenharmony_ci		.start	= 0xff709000,
54262306a36Sopenharmony_ci		.end	= 0xff70900b,
54362306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
54462306a36Sopenharmony_ci	},
54562306a36Sopenharmony_ci	{
54662306a36Sopenharmony_ci		.name	= "error_irq",
54762306a36Sopenharmony_ci		.start	= evt2irq(0x2a60),
54862306a36Sopenharmony_ci		.end	= evt2irq(0x2a60),
54962306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
55062306a36Sopenharmony_ci	},
55162306a36Sopenharmony_ci	{
55262306a36Sopenharmony_ci		/* IRQ for channels 12 to 16 */
55362306a36Sopenharmony_ci		.start	= evt2irq(0x2400),
55462306a36Sopenharmony_ci		.end	= evt2irq(0x2480),
55562306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
55662306a36Sopenharmony_ci	},
55762306a36Sopenharmony_ci	{
55862306a36Sopenharmony_ci		/* IRQ for channel 17 */
55962306a36Sopenharmony_ci		.start	= evt2irq(0x24e0),
56062306a36Sopenharmony_ci		.end	= evt2irq(0x24e0),
56162306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
56262306a36Sopenharmony_ci	},
56362306a36Sopenharmony_ci};
56462306a36Sopenharmony_ci
56562306a36Sopenharmony_ci/* channel 18 to 23 */
56662306a36Sopenharmony_cistatic struct resource sh7757_dmae3_resources[] = {
56762306a36Sopenharmony_ci	[0] = {
56862306a36Sopenharmony_ci		/* Channel registers and DMAOR */
56962306a36Sopenharmony_ci		.start	= 0xff718020,
57062306a36Sopenharmony_ci		.end	= 0xff71808f,
57162306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
57262306a36Sopenharmony_ci	},
57362306a36Sopenharmony_ci	[1] = {
57462306a36Sopenharmony_ci		/* DMARSx */
57562306a36Sopenharmony_ci		.start	= 0xff719000,
57662306a36Sopenharmony_ci		.end	= 0xff71900b,
57762306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
57862306a36Sopenharmony_ci	},
57962306a36Sopenharmony_ci	{
58062306a36Sopenharmony_ci		.name	= "error_irq",
58162306a36Sopenharmony_ci		.start	= evt2irq(0x2a80),
58262306a36Sopenharmony_ci		.end	= evt2irq(0x2a80),
58362306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
58462306a36Sopenharmony_ci	},
58562306a36Sopenharmony_ci	{
58662306a36Sopenharmony_ci		/* IRQ for channels 18 to 22 */
58762306a36Sopenharmony_ci		.start	= evt2irq(0x2500),
58862306a36Sopenharmony_ci		.end	= evt2irq(0x2580),
58962306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
59062306a36Sopenharmony_ci	},
59162306a36Sopenharmony_ci	{
59262306a36Sopenharmony_ci		/* IRQ for channel 23 */
59362306a36Sopenharmony_ci		.start	= evt2irq(0x2600),
59462306a36Sopenharmony_ci		.end	= evt2irq(0x2600),
59562306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
59662306a36Sopenharmony_ci	},
59762306a36Sopenharmony_ci};
59862306a36Sopenharmony_ci
59962306a36Sopenharmony_cistatic struct platform_device dma0_device = {
60062306a36Sopenharmony_ci	.name           = "sh-dma-engine",
60162306a36Sopenharmony_ci	.id             = 0,
60262306a36Sopenharmony_ci	.resource	= sh7757_dmae0_resources,
60362306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(sh7757_dmae0_resources),
60462306a36Sopenharmony_ci	.dev            = {
60562306a36Sopenharmony_ci		.platform_data	= &dma0_platform_data,
60662306a36Sopenharmony_ci	},
60762306a36Sopenharmony_ci};
60862306a36Sopenharmony_ci
60962306a36Sopenharmony_cistatic struct platform_device dma1_device = {
61062306a36Sopenharmony_ci	.name		= "sh-dma-engine",
61162306a36Sopenharmony_ci	.id		= 1,
61262306a36Sopenharmony_ci	.resource	= sh7757_dmae1_resources,
61362306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(sh7757_dmae1_resources),
61462306a36Sopenharmony_ci	.dev		= {
61562306a36Sopenharmony_ci		.platform_data	= &dma1_platform_data,
61662306a36Sopenharmony_ci	},
61762306a36Sopenharmony_ci};
61862306a36Sopenharmony_ci
61962306a36Sopenharmony_cistatic struct platform_device dma2_device = {
62062306a36Sopenharmony_ci	.name		= "sh-dma-engine",
62162306a36Sopenharmony_ci	.id		= 2,
62262306a36Sopenharmony_ci	.resource	= sh7757_dmae2_resources,
62362306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(sh7757_dmae2_resources),
62462306a36Sopenharmony_ci	.dev		= {
62562306a36Sopenharmony_ci		.platform_data	= &dma2_platform_data,
62662306a36Sopenharmony_ci	},
62762306a36Sopenharmony_ci};
62862306a36Sopenharmony_ci
62962306a36Sopenharmony_cistatic struct platform_device dma3_device = {
63062306a36Sopenharmony_ci	.name		= "sh-dma-engine",
63162306a36Sopenharmony_ci	.id		= 3,
63262306a36Sopenharmony_ci	.resource	= sh7757_dmae3_resources,
63362306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(sh7757_dmae3_resources),
63462306a36Sopenharmony_ci	.dev		= {
63562306a36Sopenharmony_ci		.platform_data	= &dma3_platform_data,
63662306a36Sopenharmony_ci	},
63762306a36Sopenharmony_ci};
63862306a36Sopenharmony_ci
63962306a36Sopenharmony_cistatic struct platform_device spi0_device = {
64062306a36Sopenharmony_ci	.name	= "sh_spi",
64162306a36Sopenharmony_ci	.id	= 0,
64262306a36Sopenharmony_ci	.dev	= {
64362306a36Sopenharmony_ci		.dma_mask		= NULL,
64462306a36Sopenharmony_ci		.coherent_dma_mask	= 0xffffffff,
64562306a36Sopenharmony_ci	},
64662306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(spi0_resources),
64762306a36Sopenharmony_ci	.resource	= spi0_resources,
64862306a36Sopenharmony_ci};
64962306a36Sopenharmony_ci
65062306a36Sopenharmony_cistatic struct resource spi1_resources[] = {
65162306a36Sopenharmony_ci	{
65262306a36Sopenharmony_ci		.start	= 0xffd8ee70,
65362306a36Sopenharmony_ci		.end	= 0xffd8eeff,
65462306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
65562306a36Sopenharmony_ci	},
65662306a36Sopenharmony_ci	{
65762306a36Sopenharmony_ci		.start	= evt2irq(0x8c0),
65862306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
65962306a36Sopenharmony_ci	},
66062306a36Sopenharmony_ci};
66162306a36Sopenharmony_ci
66262306a36Sopenharmony_cistatic struct platform_device spi1_device = {
66362306a36Sopenharmony_ci	.name	= "sh_spi",
66462306a36Sopenharmony_ci	.id	= 1,
66562306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(spi1_resources),
66662306a36Sopenharmony_ci	.resource	= spi1_resources,
66762306a36Sopenharmony_ci};
66862306a36Sopenharmony_ci
66962306a36Sopenharmony_cistatic struct resource rspi_resources[] = {
67062306a36Sopenharmony_ci	{
67162306a36Sopenharmony_ci		.start	= 0xfe480000,
67262306a36Sopenharmony_ci		.end	= 0xfe4800ff,
67362306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
67462306a36Sopenharmony_ci	},
67562306a36Sopenharmony_ci	{
67662306a36Sopenharmony_ci		.start	= evt2irq(0x1d80),
67762306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
67862306a36Sopenharmony_ci	},
67962306a36Sopenharmony_ci};
68062306a36Sopenharmony_ci
68162306a36Sopenharmony_cistatic struct platform_device rspi_device = {
68262306a36Sopenharmony_ci	.name	= "rspi",
68362306a36Sopenharmony_ci	.id	= 2,
68462306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(rspi_resources),
68562306a36Sopenharmony_ci	.resource	= rspi_resources,
68662306a36Sopenharmony_ci};
68762306a36Sopenharmony_ci
68862306a36Sopenharmony_cistatic struct resource usb_ehci_resources[] = {
68962306a36Sopenharmony_ci	[0] = {
69062306a36Sopenharmony_ci		.start	= 0xfe4f1000,
69162306a36Sopenharmony_ci		.end	= 0xfe4f10ff,
69262306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
69362306a36Sopenharmony_ci	},
69462306a36Sopenharmony_ci	[1] = {
69562306a36Sopenharmony_ci		.start	= evt2irq(0x920),
69662306a36Sopenharmony_ci		.end	= evt2irq(0x920),
69762306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
69862306a36Sopenharmony_ci	},
69962306a36Sopenharmony_ci};
70062306a36Sopenharmony_ci
70162306a36Sopenharmony_cistatic struct platform_device usb_ehci_device = {
70262306a36Sopenharmony_ci	.name		= "sh_ehci",
70362306a36Sopenharmony_ci	.id		= -1,
70462306a36Sopenharmony_ci	.dev = {
70562306a36Sopenharmony_ci		.dma_mask = &usb_ehci_device.dev.coherent_dma_mask,
70662306a36Sopenharmony_ci		.coherent_dma_mask = DMA_BIT_MASK(32),
70762306a36Sopenharmony_ci	},
70862306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(usb_ehci_resources),
70962306a36Sopenharmony_ci	.resource	= usb_ehci_resources,
71062306a36Sopenharmony_ci};
71162306a36Sopenharmony_ci
71262306a36Sopenharmony_cistatic struct resource usb_ohci_resources[] = {
71362306a36Sopenharmony_ci	[0] = {
71462306a36Sopenharmony_ci		.start	= 0xfe4f1800,
71562306a36Sopenharmony_ci		.end	= 0xfe4f18ff,
71662306a36Sopenharmony_ci		.flags	= IORESOURCE_MEM,
71762306a36Sopenharmony_ci	},
71862306a36Sopenharmony_ci	[1] = {
71962306a36Sopenharmony_ci		.start	= evt2irq(0x920),
72062306a36Sopenharmony_ci		.end	= evt2irq(0x920),
72162306a36Sopenharmony_ci		.flags	= IORESOURCE_IRQ,
72262306a36Sopenharmony_ci	},
72362306a36Sopenharmony_ci};
72462306a36Sopenharmony_ci
72562306a36Sopenharmony_cistatic struct usb_ohci_pdata usb_ohci_pdata;
72662306a36Sopenharmony_ci
72762306a36Sopenharmony_cistatic struct platform_device usb_ohci_device = {
72862306a36Sopenharmony_ci	.name		= "ohci-platform",
72962306a36Sopenharmony_ci	.id		= -1,
73062306a36Sopenharmony_ci	.dev = {
73162306a36Sopenharmony_ci		.dma_mask = &usb_ohci_device.dev.coherent_dma_mask,
73262306a36Sopenharmony_ci		.coherent_dma_mask = DMA_BIT_MASK(32),
73362306a36Sopenharmony_ci		.platform_data	= &usb_ohci_pdata,
73462306a36Sopenharmony_ci	},
73562306a36Sopenharmony_ci	.num_resources	= ARRAY_SIZE(usb_ohci_resources),
73662306a36Sopenharmony_ci	.resource	= usb_ohci_resources,
73762306a36Sopenharmony_ci};
73862306a36Sopenharmony_ci
73962306a36Sopenharmony_cistatic struct platform_device *sh7757_devices[] __initdata = {
74062306a36Sopenharmony_ci	&scif2_device,
74162306a36Sopenharmony_ci	&scif3_device,
74262306a36Sopenharmony_ci	&scif4_device,
74362306a36Sopenharmony_ci	&tmu0_device,
74462306a36Sopenharmony_ci	&dma0_device,
74562306a36Sopenharmony_ci	&dma1_device,
74662306a36Sopenharmony_ci	&dma2_device,
74762306a36Sopenharmony_ci	&dma3_device,
74862306a36Sopenharmony_ci	&spi0_device,
74962306a36Sopenharmony_ci	&spi1_device,
75062306a36Sopenharmony_ci	&rspi_device,
75162306a36Sopenharmony_ci	&usb_ehci_device,
75262306a36Sopenharmony_ci	&usb_ohci_device,
75362306a36Sopenharmony_ci};
75462306a36Sopenharmony_ci
75562306a36Sopenharmony_cistatic int __init sh7757_devices_setup(void)
75662306a36Sopenharmony_ci{
75762306a36Sopenharmony_ci	return platform_add_devices(sh7757_devices,
75862306a36Sopenharmony_ci				    ARRAY_SIZE(sh7757_devices));
75962306a36Sopenharmony_ci}
76062306a36Sopenharmony_ciarch_initcall(sh7757_devices_setup);
76162306a36Sopenharmony_ci
76262306a36Sopenharmony_cistatic struct platform_device *sh7757_early_devices[] __initdata = {
76362306a36Sopenharmony_ci	&scif2_device,
76462306a36Sopenharmony_ci	&scif3_device,
76562306a36Sopenharmony_ci	&scif4_device,
76662306a36Sopenharmony_ci	&tmu0_device,
76762306a36Sopenharmony_ci};
76862306a36Sopenharmony_ci
76962306a36Sopenharmony_civoid __init plat_early_device_setup(void)
77062306a36Sopenharmony_ci{
77162306a36Sopenharmony_ci	sh_early_platform_add_devices(sh7757_early_devices,
77262306a36Sopenharmony_ci				   ARRAY_SIZE(sh7757_early_devices));
77362306a36Sopenharmony_ci}
77462306a36Sopenharmony_ci
77562306a36Sopenharmony_cienum {
77662306a36Sopenharmony_ci	UNUSED = 0,
77762306a36Sopenharmony_ci
77862306a36Sopenharmony_ci	/* interrupt sources */
77962306a36Sopenharmony_ci
78062306a36Sopenharmony_ci	IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,
78162306a36Sopenharmony_ci	IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,
78262306a36Sopenharmony_ci	IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,
78362306a36Sopenharmony_ci	IRL0_HHLL, IRL0_HHLH, IRL0_HHHL,
78462306a36Sopenharmony_ci
78562306a36Sopenharmony_ci	IRL4_LLLL, IRL4_LLLH, IRL4_LLHL, IRL4_LLHH,
78662306a36Sopenharmony_ci	IRL4_LHLL, IRL4_LHLH, IRL4_LHHL, IRL4_LHHH,
78762306a36Sopenharmony_ci	IRL4_HLLL, IRL4_HLLH, IRL4_HLHL, IRL4_HLHH,
78862306a36Sopenharmony_ci	IRL4_HHLL, IRL4_HHLH, IRL4_HHHL,
78962306a36Sopenharmony_ci	IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
79062306a36Sopenharmony_ci
79162306a36Sopenharmony_ci	SDHI, DVC,
79262306a36Sopenharmony_ci	IRQ8, IRQ9, IRQ11, IRQ10, IRQ12, IRQ13, IRQ14, IRQ15,
79362306a36Sopenharmony_ci	TMU0, TMU1, TMU2, TMU2_TICPI, TMU3, TMU4, TMU5,
79462306a36Sopenharmony_ci	HUDI,
79562306a36Sopenharmony_ci	ARC4,
79662306a36Sopenharmony_ci	DMAC0_5, DMAC6_7, DMAC8_11,
79762306a36Sopenharmony_ci	SCIF0, SCIF1, SCIF2, SCIF3, SCIF4,
79862306a36Sopenharmony_ci	USB0, USB1,
79962306a36Sopenharmony_ci	JMC,
80062306a36Sopenharmony_ci	SPI0, SPI1,
80162306a36Sopenharmony_ci	TMR01, TMR23, TMR45,
80262306a36Sopenharmony_ci	FRT,
80362306a36Sopenharmony_ci	LPC, LPC5, LPC6, LPC7, LPC8,
80462306a36Sopenharmony_ci	PECI0, PECI1, PECI2, PECI3, PECI4, PECI5,
80562306a36Sopenharmony_ci	ETHERC,
80662306a36Sopenharmony_ci	ADC0, ADC1,
80762306a36Sopenharmony_ci	SIM,
80862306a36Sopenharmony_ci	IIC0_0, IIC0_1, IIC0_2, IIC0_3,
80962306a36Sopenharmony_ci	IIC1_0, IIC1_1, IIC1_2, IIC1_3,
81062306a36Sopenharmony_ci	IIC2_0, IIC2_1, IIC2_2, IIC2_3,
81162306a36Sopenharmony_ci	IIC3_0, IIC3_1, IIC3_2, IIC3_3,
81262306a36Sopenharmony_ci	IIC4_0, IIC4_1, IIC4_2, IIC4_3,
81362306a36Sopenharmony_ci	IIC5_0, IIC5_1, IIC5_2, IIC5_3,
81462306a36Sopenharmony_ci	IIC6_0, IIC6_1, IIC6_2, IIC6_3,
81562306a36Sopenharmony_ci	IIC7_0, IIC7_1, IIC7_2, IIC7_3,
81662306a36Sopenharmony_ci	IIC8_0, IIC8_1, IIC8_2, IIC8_3,
81762306a36Sopenharmony_ci	IIC9_0, IIC9_1, IIC9_2, IIC9_3,
81862306a36Sopenharmony_ci	ONFICTL,
81962306a36Sopenharmony_ci	MMC1, MMC2,
82062306a36Sopenharmony_ci	ECCU,
82162306a36Sopenharmony_ci	PCIC,
82262306a36Sopenharmony_ci	G200,
82362306a36Sopenharmony_ci	RSPI,
82462306a36Sopenharmony_ci	SGPIO,
82562306a36Sopenharmony_ci	DMINT12, DMINT13, DMINT14, DMINT15, DMINT16, DMINT17, DMINT18, DMINT19,
82662306a36Sopenharmony_ci	DMINT20, DMINT21, DMINT22, DMINT23,
82762306a36Sopenharmony_ci	DDRECC,
82862306a36Sopenharmony_ci	TSIP,
82962306a36Sopenharmony_ci	PCIE_BRIDGE,
83062306a36Sopenharmony_ci	WDT0B, WDT1B, WDT2B, WDT3B, WDT4B, WDT5B, WDT6B, WDT7B, WDT8B,
83162306a36Sopenharmony_ci	GETHER0, GETHER1, GETHER2,
83262306a36Sopenharmony_ci	PBIA, PBIB, PBIC,
83362306a36Sopenharmony_ci	DMAE2, DMAE3,
83462306a36Sopenharmony_ci	SERMUX2, SERMUX3,
83562306a36Sopenharmony_ci
83662306a36Sopenharmony_ci	/* interrupt groups */
83762306a36Sopenharmony_ci
83862306a36Sopenharmony_ci	TMU012, TMU345,
83962306a36Sopenharmony_ci};
84062306a36Sopenharmony_ci
84162306a36Sopenharmony_cistatic struct intc_vect vectors[] __initdata = {
84262306a36Sopenharmony_ci	INTC_VECT(SDHI, 0x480), INTC_VECT(SDHI, 0x04a0),
84362306a36Sopenharmony_ci	INTC_VECT(SDHI, 0x4c0),
84462306a36Sopenharmony_ci	INTC_VECT(DVC, 0x4e0),
84562306a36Sopenharmony_ci	INTC_VECT(IRQ8, 0x500), INTC_VECT(IRQ9, 0x520),
84662306a36Sopenharmony_ci	INTC_VECT(IRQ10, 0x540),
84762306a36Sopenharmony_ci	INTC_VECT(TMU0, 0x580), INTC_VECT(TMU1, 0x5a0),
84862306a36Sopenharmony_ci	INTC_VECT(TMU2, 0x5c0), INTC_VECT(TMU2_TICPI, 0x5e0),
84962306a36Sopenharmony_ci	INTC_VECT(HUDI, 0x600),
85062306a36Sopenharmony_ci	INTC_VECT(ARC4, 0x620),
85162306a36Sopenharmony_ci	INTC_VECT(DMAC0_5, 0x640), INTC_VECT(DMAC0_5, 0x660),
85262306a36Sopenharmony_ci	INTC_VECT(DMAC0_5, 0x680), INTC_VECT(DMAC0_5, 0x6a0),
85362306a36Sopenharmony_ci	INTC_VECT(DMAC0_5, 0x6c0),
85462306a36Sopenharmony_ci	INTC_VECT(IRQ11, 0x6e0),
85562306a36Sopenharmony_ci	INTC_VECT(SCIF2, 0x700), INTC_VECT(SCIF2, 0x720),
85662306a36Sopenharmony_ci	INTC_VECT(SCIF2, 0x740), INTC_VECT(SCIF2, 0x760),
85762306a36Sopenharmony_ci	INTC_VECT(DMAC0_5, 0x780), INTC_VECT(DMAC0_5, 0x7a0),
85862306a36Sopenharmony_ci	INTC_VECT(DMAC6_7, 0x7c0), INTC_VECT(DMAC6_7, 0x7e0),
85962306a36Sopenharmony_ci	INTC_VECT(USB0, 0x840),
86062306a36Sopenharmony_ci	INTC_VECT(IRQ12, 0x880),
86162306a36Sopenharmony_ci	INTC_VECT(JMC, 0x8a0),
86262306a36Sopenharmony_ci	INTC_VECT(SPI1, 0x8c0),
86362306a36Sopenharmony_ci	INTC_VECT(IRQ13, 0x8e0), INTC_VECT(IRQ14, 0x900),
86462306a36Sopenharmony_ci	INTC_VECT(USB1, 0x920),
86562306a36Sopenharmony_ci	INTC_VECT(TMR01, 0xa00), INTC_VECT(TMR23, 0xa20),
86662306a36Sopenharmony_ci	INTC_VECT(TMR45, 0xa40),
86762306a36Sopenharmony_ci	INTC_VECT(FRT, 0xa80),
86862306a36Sopenharmony_ci	INTC_VECT(LPC, 0xaa0), INTC_VECT(LPC, 0xac0),
86962306a36Sopenharmony_ci	INTC_VECT(LPC, 0xae0), INTC_VECT(LPC, 0xb00),
87062306a36Sopenharmony_ci	INTC_VECT(LPC, 0xb20),
87162306a36Sopenharmony_ci	INTC_VECT(SCIF0, 0xb40), INTC_VECT(SCIF1, 0xb60),
87262306a36Sopenharmony_ci	INTC_VECT(SCIF3, 0xb80), INTC_VECT(SCIF3, 0xba0),
87362306a36Sopenharmony_ci	INTC_VECT(SCIF3, 0xbc0), INTC_VECT(SCIF3, 0xbe0),
87462306a36Sopenharmony_ci	INTC_VECT(PECI0, 0xc00), INTC_VECT(PECI1, 0xc20),
87562306a36Sopenharmony_ci	INTC_VECT(PECI2, 0xc40),
87662306a36Sopenharmony_ci	INTC_VECT(IRQ15, 0xc60),
87762306a36Sopenharmony_ci	INTC_VECT(ETHERC, 0xc80), INTC_VECT(ETHERC, 0xca0),
87862306a36Sopenharmony_ci	INTC_VECT(SPI0, 0xcc0),
87962306a36Sopenharmony_ci	INTC_VECT(ADC1, 0xce0),
88062306a36Sopenharmony_ci	INTC_VECT(DMAC8_11, 0xd00), INTC_VECT(DMAC8_11, 0xd20),
88162306a36Sopenharmony_ci	INTC_VECT(DMAC8_11, 0xd40), INTC_VECT(DMAC8_11, 0xd60),
88262306a36Sopenharmony_ci	INTC_VECT(SIM, 0xd80), INTC_VECT(SIM, 0xda0),
88362306a36Sopenharmony_ci	INTC_VECT(SIM, 0xdc0), INTC_VECT(SIM, 0xde0),
88462306a36Sopenharmony_ci	INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20),
88562306a36Sopenharmony_ci	INTC_VECT(TMU5, 0xe40),
88662306a36Sopenharmony_ci	INTC_VECT(ADC0, 0xe60),
88762306a36Sopenharmony_ci	INTC_VECT(SCIF4, 0xf00), INTC_VECT(SCIF4, 0xf20),
88862306a36Sopenharmony_ci	INTC_VECT(SCIF4, 0xf40), INTC_VECT(SCIF4, 0xf60),
88962306a36Sopenharmony_ci	INTC_VECT(IIC0_0, 0x1400), INTC_VECT(IIC0_1, 0x1420),
89062306a36Sopenharmony_ci	INTC_VECT(IIC0_2, 0x1440), INTC_VECT(IIC0_3, 0x1460),
89162306a36Sopenharmony_ci	INTC_VECT(IIC1_0, 0x1480), INTC_VECT(IIC1_1, 0x14e0),
89262306a36Sopenharmony_ci	INTC_VECT(IIC1_2, 0x1500), INTC_VECT(IIC1_3, 0x1520),
89362306a36Sopenharmony_ci	INTC_VECT(IIC2_0, 0x1540), INTC_VECT(IIC2_1, 0x1560),
89462306a36Sopenharmony_ci	INTC_VECT(IIC2_2, 0x1580), INTC_VECT(IIC2_3, 0x1600),
89562306a36Sopenharmony_ci	INTC_VECT(IIC3_0, 0x1620), INTC_VECT(IIC3_1, 0x1640),
89662306a36Sopenharmony_ci	INTC_VECT(IIC3_2, 0x16e0), INTC_VECT(IIC3_3, 0x1700),
89762306a36Sopenharmony_ci	INTC_VECT(IIC4_0, 0x17c0), INTC_VECT(IIC4_1, 0x1800),
89862306a36Sopenharmony_ci	INTC_VECT(IIC4_2, 0x1820), INTC_VECT(IIC4_3, 0x1840),
89962306a36Sopenharmony_ci	INTC_VECT(IIC5_0, 0x1860), INTC_VECT(IIC5_1, 0x1880),
90062306a36Sopenharmony_ci	INTC_VECT(IIC5_2, 0x18a0), INTC_VECT(IIC5_3, 0x18c0),
90162306a36Sopenharmony_ci	INTC_VECT(IIC6_0, 0x18e0), INTC_VECT(IIC6_1, 0x1900),
90262306a36Sopenharmony_ci	INTC_VECT(IIC6_2, 0x1920),
90362306a36Sopenharmony_ci	INTC_VECT(ONFICTL, 0x1960),
90462306a36Sopenharmony_ci	INTC_VECT(IIC6_3, 0x1980),
90562306a36Sopenharmony_ci	INTC_VECT(IIC7_0, 0x19a0), INTC_VECT(IIC7_1, 0x1a00),
90662306a36Sopenharmony_ci	INTC_VECT(IIC7_2, 0x1a20), INTC_VECT(IIC7_3, 0x1a40),
90762306a36Sopenharmony_ci	INTC_VECT(IIC8_0, 0x1a60), INTC_VECT(IIC8_1, 0x1a80),
90862306a36Sopenharmony_ci	INTC_VECT(IIC8_2, 0x1aa0), INTC_VECT(IIC8_3, 0x1b40),
90962306a36Sopenharmony_ci	INTC_VECT(IIC9_0, 0x1b60), INTC_VECT(IIC9_1, 0x1b80),
91062306a36Sopenharmony_ci	INTC_VECT(IIC9_2, 0x1c00), INTC_VECT(IIC9_3, 0x1c20),
91162306a36Sopenharmony_ci	INTC_VECT(MMC1, 0x1c60), INTC_VECT(MMC2, 0x1c80),
91262306a36Sopenharmony_ci	INTC_VECT(ECCU, 0x1cc0),
91362306a36Sopenharmony_ci	INTC_VECT(PCIC, 0x1ce0),
91462306a36Sopenharmony_ci	INTC_VECT(G200, 0x1d00),
91562306a36Sopenharmony_ci	INTC_VECT(RSPI, 0x1d80), INTC_VECT(RSPI, 0x1da0),
91662306a36Sopenharmony_ci	INTC_VECT(RSPI, 0x1dc0), INTC_VECT(RSPI, 0x1de0),
91762306a36Sopenharmony_ci	INTC_VECT(PECI3, 0x1ec0), INTC_VECT(PECI4, 0x1ee0),
91862306a36Sopenharmony_ci	INTC_VECT(PECI5, 0x1f00),
91962306a36Sopenharmony_ci	INTC_VECT(SGPIO, 0x1f80), INTC_VECT(SGPIO, 0x1fa0),
92062306a36Sopenharmony_ci	INTC_VECT(SGPIO, 0x1fc0),
92162306a36Sopenharmony_ci	INTC_VECT(DMINT12, 0x2400), INTC_VECT(DMINT13, 0x2420),
92262306a36Sopenharmony_ci	INTC_VECT(DMINT14, 0x2440), INTC_VECT(DMINT15, 0x2460),
92362306a36Sopenharmony_ci	INTC_VECT(DMINT16, 0x2480), INTC_VECT(DMINT17, 0x24e0),
92462306a36Sopenharmony_ci	INTC_VECT(DMINT18, 0x2500), INTC_VECT(DMINT19, 0x2520),
92562306a36Sopenharmony_ci	INTC_VECT(DMINT20, 0x2540), INTC_VECT(DMINT21, 0x2560),
92662306a36Sopenharmony_ci	INTC_VECT(DMINT22, 0x2580), INTC_VECT(DMINT23, 0x2600),
92762306a36Sopenharmony_ci	INTC_VECT(DDRECC, 0x2620),
92862306a36Sopenharmony_ci	INTC_VECT(TSIP, 0x2640),
92962306a36Sopenharmony_ci	INTC_VECT(PCIE_BRIDGE, 0x27c0),
93062306a36Sopenharmony_ci	INTC_VECT(WDT0B, 0x2800), INTC_VECT(WDT1B, 0x2820),
93162306a36Sopenharmony_ci	INTC_VECT(WDT2B, 0x2840), INTC_VECT(WDT3B, 0x2860),
93262306a36Sopenharmony_ci	INTC_VECT(WDT4B, 0x2880), INTC_VECT(WDT5B, 0x28a0),
93362306a36Sopenharmony_ci	INTC_VECT(WDT6B, 0x28c0), INTC_VECT(WDT7B, 0x28e0),
93462306a36Sopenharmony_ci	INTC_VECT(WDT8B, 0x2900),
93562306a36Sopenharmony_ci	INTC_VECT(GETHER0, 0x2960), INTC_VECT(GETHER1, 0x2980),
93662306a36Sopenharmony_ci	INTC_VECT(GETHER2, 0x29a0),
93762306a36Sopenharmony_ci	INTC_VECT(PBIA, 0x2a00), INTC_VECT(PBIB, 0x2a20),
93862306a36Sopenharmony_ci	INTC_VECT(PBIC, 0x2a40),
93962306a36Sopenharmony_ci	INTC_VECT(DMAE2, 0x2a60), INTC_VECT(DMAE3, 0x2a80),
94062306a36Sopenharmony_ci	INTC_VECT(SERMUX2, 0x2aa0), INTC_VECT(SERMUX3, 0x2b40),
94162306a36Sopenharmony_ci	INTC_VECT(LPC5, 0x2b60), INTC_VECT(LPC6, 0x2b80),
94262306a36Sopenharmony_ci	INTC_VECT(LPC7, 0x2c00), INTC_VECT(LPC8, 0x2c20),
94362306a36Sopenharmony_ci};
94462306a36Sopenharmony_ci
94562306a36Sopenharmony_cistatic struct intc_group groups[] __initdata = {
94662306a36Sopenharmony_ci	INTC_GROUP(TMU012, TMU0, TMU1, TMU2, TMU2_TICPI),
94762306a36Sopenharmony_ci	INTC_GROUP(TMU345, TMU3, TMU4, TMU5),
94862306a36Sopenharmony_ci};
94962306a36Sopenharmony_ci
95062306a36Sopenharmony_cistatic struct intc_mask_reg mask_registers[] __initdata = {
95162306a36Sopenharmony_ci	{ 0xffd00044, 0xffd00064, 32, /* INTMSK0 / INTMSKCLR0 */
95262306a36Sopenharmony_ci	  { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
95362306a36Sopenharmony_ci
95462306a36Sopenharmony_ci	{ 0xffd40080, 0xffd40084, 32, /* INTMSK2 / INTMSKCLR2 */
95562306a36Sopenharmony_ci	  { IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH,
95662306a36Sopenharmony_ci	    IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH,
95762306a36Sopenharmony_ci	    IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH,
95862306a36Sopenharmony_ci	    IRL0_HHLL, IRL0_HHLH, IRL0_HHHL, 0,
95962306a36Sopenharmony_ci	    IRL4_LLLL, IRL4_LLLH, IRL4_LLHL, IRL4_LLHH,
96062306a36Sopenharmony_ci	    IRL4_LHLL, IRL4_LHLH, IRL4_LHHL, IRL4_LHHH,
96162306a36Sopenharmony_ci	    IRL4_HLLL, IRL4_HLLH, IRL4_HLHL, IRL4_HLHH,
96262306a36Sopenharmony_ci	    IRL4_HHLL, IRL4_HHLH, IRL4_HHHL, 0, } },
96362306a36Sopenharmony_ci
96462306a36Sopenharmony_ci	{ 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */
96562306a36Sopenharmony_ci	  { 0, 0, 0, 0, 0, 0, 0, 0,
96662306a36Sopenharmony_ci	    0, DMAC8_11, 0, PECI0, LPC, FRT, 0, TMR45,
96762306a36Sopenharmony_ci	    TMR23, TMR01, 0, 0, 0, 0, 0, DMAC0_5,
96862306a36Sopenharmony_ci	    HUDI, 0, 0, SCIF3, SCIF2, SDHI, TMU345, TMU012
96962306a36Sopenharmony_ci	     } },
97062306a36Sopenharmony_ci
97162306a36Sopenharmony_ci	{ 0xffd400d0, 0xffd400d4, 32, /* INT2MSKR1 / INT2MSKCR1 */
97262306a36Sopenharmony_ci	  { IRQ15, IRQ14, IRQ13, IRQ12, IRQ11, IRQ10, SCIF4, ETHERC,
97362306a36Sopenharmony_ci	    IRQ9, IRQ8, SCIF1, SCIF0, USB0, 0, 0, USB1,
97462306a36Sopenharmony_ci	    ADC1, 0, DMAC6_7, ADC0, SPI0, SIM, PECI2, PECI1,
97562306a36Sopenharmony_ci	    ARC4, 0, SPI1, JMC, 0, 0, 0, DVC
97662306a36Sopenharmony_ci	     } },
97762306a36Sopenharmony_ci
97862306a36Sopenharmony_ci	{ 0xffd10038, 0xffd1003c, 32, /* INT2MSKR2 / INT2MSKCR2 */
97962306a36Sopenharmony_ci	  { IIC4_1, IIC4_2, IIC5_0, ONFICTL, 0, 0, SGPIO, 0,
98062306a36Sopenharmony_ci	    0, G200, 0, IIC9_2, IIC8_2, IIC8_1, IIC8_0, IIC7_3,
98162306a36Sopenharmony_ci	    IIC7_2, IIC7_1, IIC6_3, IIC0_0, IIC0_1, IIC0_2, IIC0_3, IIC3_1,
98262306a36Sopenharmony_ci	    IIC2_3, 0, IIC2_1, IIC9_1, IIC3_3, IIC1_0, 0, IIC2_2
98362306a36Sopenharmony_ci	     } },
98462306a36Sopenharmony_ci
98562306a36Sopenharmony_ci	{ 0xffd100d0, 0xffd100d4, 32, /* INT2MSKR3 / INT2MSKCR3 */
98662306a36Sopenharmony_ci	  { MMC1, IIC6_1, IIC6_0, IIC5_1, IIC3_2, IIC2_0, PECI5, MMC2,
98762306a36Sopenharmony_ci	    IIC1_3, IIC1_2, IIC9_0, IIC8_3, IIC4_3, IIC7_0, 0, IIC6_2,
98862306a36Sopenharmony_ci	    PCIC, 0, IIC4_0, 0, ECCU, RSPI, 0, IIC9_3,
98962306a36Sopenharmony_ci	    IIC3_0, 0, IIC5_3, IIC5_2, 0, 0, 0, IIC1_1
99062306a36Sopenharmony_ci	     } },
99162306a36Sopenharmony_ci
99262306a36Sopenharmony_ci	{ 0xffd20038, 0xffd2003c, 32, /* INT2MSKR4 / INT2MSKCR4 */
99362306a36Sopenharmony_ci	  { WDT0B, WDT1B, WDT3B, GETHER0, 0, 0, 0, 0,
99462306a36Sopenharmony_ci	    0, 0, 0, LPC7, SERMUX2, DMAE3, DMAE2, PBIC,
99562306a36Sopenharmony_ci	    PBIB, PBIA, GETHER1, DMINT12, DMINT13, DMINT14, DMINT15, TSIP,
99662306a36Sopenharmony_ci	    DMINT23, 0, DMINT21, LPC6, 0, DMINT16, 0, DMINT22
99762306a36Sopenharmony_ci	     } },
99862306a36Sopenharmony_ci
99962306a36Sopenharmony_ci	{ 0xffd200d0, 0xffd200d4, 32, /* INT2MSKR5 / INT2MSKCR5 */
100062306a36Sopenharmony_ci	  { 0, WDT8B, WDT7B, WDT4B, 0, DMINT20, 0, 0,
100162306a36Sopenharmony_ci	    DMINT19, DMINT18, LPC5, SERMUX3, WDT2B, GETHER2, 0, 0,
100262306a36Sopenharmony_ci	    0, 0, PCIE_BRIDGE, 0, 0, 0, 0, LPC8,
100362306a36Sopenharmony_ci	    DDRECC, 0, WDT6B, WDT5B, 0, 0, 0, DMINT17
100462306a36Sopenharmony_ci	     } },
100562306a36Sopenharmony_ci};
100662306a36Sopenharmony_ci
100762306a36Sopenharmony_ci#define INTPRI		0xffd00010
100862306a36Sopenharmony_ci#define INT2PRI0	0xffd40000
100962306a36Sopenharmony_ci#define INT2PRI1	0xffd40004
101062306a36Sopenharmony_ci#define INT2PRI2	0xffd40008
101162306a36Sopenharmony_ci#define INT2PRI3	0xffd4000c
101262306a36Sopenharmony_ci#define INT2PRI4	0xffd40010
101362306a36Sopenharmony_ci#define INT2PRI5	0xffd40014
101462306a36Sopenharmony_ci#define INT2PRI6	0xffd40018
101562306a36Sopenharmony_ci#define INT2PRI7	0xffd4001c
101662306a36Sopenharmony_ci#define INT2PRI8	0xffd400a0
101762306a36Sopenharmony_ci#define INT2PRI9	0xffd400a4
101862306a36Sopenharmony_ci#define INT2PRI10	0xffd400a8
101962306a36Sopenharmony_ci#define INT2PRI11	0xffd400ac
102062306a36Sopenharmony_ci#define INT2PRI12	0xffd400b0
102162306a36Sopenharmony_ci#define INT2PRI13	0xffd400b4
102262306a36Sopenharmony_ci#define INT2PRI14	0xffd400b8
102362306a36Sopenharmony_ci#define INT2PRI15	0xffd400bc
102462306a36Sopenharmony_ci#define INT2PRI16	0xffd10000
102562306a36Sopenharmony_ci#define INT2PRI17	0xffd10004
102662306a36Sopenharmony_ci#define INT2PRI18	0xffd10008
102762306a36Sopenharmony_ci#define INT2PRI19	0xffd1000c
102862306a36Sopenharmony_ci#define INT2PRI20	0xffd10010
102962306a36Sopenharmony_ci#define INT2PRI21	0xffd10014
103062306a36Sopenharmony_ci#define INT2PRI22	0xffd10018
103162306a36Sopenharmony_ci#define INT2PRI23	0xffd1001c
103262306a36Sopenharmony_ci#define INT2PRI24	0xffd100a0
103362306a36Sopenharmony_ci#define INT2PRI25	0xffd100a4
103462306a36Sopenharmony_ci#define INT2PRI26	0xffd100a8
103562306a36Sopenharmony_ci#define INT2PRI27	0xffd100ac
103662306a36Sopenharmony_ci#define INT2PRI28	0xffd100b0
103762306a36Sopenharmony_ci#define INT2PRI29	0xffd100b4
103862306a36Sopenharmony_ci#define INT2PRI30	0xffd100b8
103962306a36Sopenharmony_ci#define INT2PRI31	0xffd100bc
104062306a36Sopenharmony_ci#define INT2PRI32	0xffd20000
104162306a36Sopenharmony_ci#define INT2PRI33	0xffd20004
104262306a36Sopenharmony_ci#define INT2PRI34	0xffd20008
104362306a36Sopenharmony_ci#define INT2PRI35	0xffd2000c
104462306a36Sopenharmony_ci#define INT2PRI36	0xffd20010
104562306a36Sopenharmony_ci#define INT2PRI37	0xffd20014
104662306a36Sopenharmony_ci#define INT2PRI38	0xffd20018
104762306a36Sopenharmony_ci#define INT2PRI39	0xffd2001c
104862306a36Sopenharmony_ci#define INT2PRI40	0xffd200a0
104962306a36Sopenharmony_ci#define INT2PRI41	0xffd200a4
105062306a36Sopenharmony_ci#define INT2PRI42	0xffd200a8
105162306a36Sopenharmony_ci#define INT2PRI43	0xffd200ac
105262306a36Sopenharmony_ci#define INT2PRI44	0xffd200b0
105362306a36Sopenharmony_ci#define INT2PRI45	0xffd200b4
105462306a36Sopenharmony_ci#define INT2PRI46	0xffd200b8
105562306a36Sopenharmony_ci#define INT2PRI47	0xffd200bc
105662306a36Sopenharmony_ci
105762306a36Sopenharmony_cistatic struct intc_prio_reg prio_registers[] __initdata = {
105862306a36Sopenharmony_ci	{ INTPRI, 0, 32, 4, { IRQ0, IRQ1, IRQ2, IRQ3,
105962306a36Sopenharmony_ci			      IRQ4, IRQ5, IRQ6, IRQ7 } },
106062306a36Sopenharmony_ci
106162306a36Sopenharmony_ci	{ INT2PRI0, 0, 32, 8, { TMU0, TMU1, TMU2, TMU2_TICPI } },
106262306a36Sopenharmony_ci	{ INT2PRI1, 0, 32, 8, { TMU3, TMU4, TMU5, SDHI } },
106362306a36Sopenharmony_ci	{ INT2PRI2, 0, 32, 8, { SCIF2, SCIF3, 0, IRQ8 } },
106462306a36Sopenharmony_ci	{ INT2PRI3, 0, 32, 8, { HUDI, DMAC0_5, ADC0, IRQ9 } },
106562306a36Sopenharmony_ci	{ INT2PRI4, 0, 32, 8, { IRQ10, 0, TMR01, TMR23 } },
106662306a36Sopenharmony_ci	{ INT2PRI5, 0, 32, 8, { TMR45, 0, FRT, LPC } },
106762306a36Sopenharmony_ci	{ INT2PRI6, 0, 32, 8, { PECI0, ETHERC, DMAC8_11, 0 } },
106862306a36Sopenharmony_ci	{ INT2PRI7, 0, 32, 8, { SCIF4, 0, IRQ11, IRQ12 } },
106962306a36Sopenharmony_ci	{ INT2PRI8, 0, 32, 8, { 0, 0, 0, DVC } },
107062306a36Sopenharmony_ci	{ INT2PRI9, 0, 32, 8, { ARC4, 0, SPI1, JMC } },
107162306a36Sopenharmony_ci	{ INT2PRI10, 0, 32, 8, { SPI0, SIM, PECI2, PECI1 } },
107262306a36Sopenharmony_ci	{ INT2PRI11, 0, 32, 8, { ADC1, IRQ13, DMAC6_7, IRQ14 } },
107362306a36Sopenharmony_ci	{ INT2PRI12, 0, 32, 8, { USB0, 0, IRQ15, USB1 } },
107462306a36Sopenharmony_ci	{ INT2PRI13, 0, 32, 8, { 0, 0, SCIF1, SCIF0 } },
107562306a36Sopenharmony_ci
107662306a36Sopenharmony_ci	{ INT2PRI16, 0, 32, 8, { IIC2_2, 0, 0, 0 } },
107762306a36Sopenharmony_ci	{ INT2PRI17, 0, 32, 8, { 0, 0, 0, IIC1_0 } },
107862306a36Sopenharmony_ci	{ INT2PRI18, 0, 32, 8, { IIC3_3, IIC9_1, IIC2_1, IIC1_2 } },
107962306a36Sopenharmony_ci	{ INT2PRI19, 0, 32, 8, { IIC2_3, IIC3_1, 0, IIC1_3 } },
108062306a36Sopenharmony_ci	{ INT2PRI20, 0, 32, 8, { IIC2_0, IIC6_3, IIC7_1, IIC7_2 } },
108162306a36Sopenharmony_ci	{ INT2PRI21, 0, 32, 8, { IIC7_3, IIC8_0, IIC8_1, IIC8_2 } },
108262306a36Sopenharmony_ci	{ INT2PRI22, 0, 32, 8, { IIC9_2, MMC2, G200, 0 } },
108362306a36Sopenharmony_ci	{ INT2PRI23, 0, 32, 8, { PECI5, SGPIO, IIC3_2, IIC5_1 } },
108462306a36Sopenharmony_ci	{ INT2PRI24, 0, 32, 8, { PECI4, PECI3, 0, IIC1_1 } },
108562306a36Sopenharmony_ci	{ INT2PRI25, 0, 32, 8, { IIC3_0, 0, IIC5_3, IIC5_2 } },
108662306a36Sopenharmony_ci	{ INT2PRI26, 0, 32, 8, { ECCU, RSPI, 0, IIC9_3 } },
108762306a36Sopenharmony_ci	{ INT2PRI27, 0, 32, 8, { PCIC, IIC6_0, IIC4_0, IIC6_1 } },
108862306a36Sopenharmony_ci	{ INT2PRI28, 0, 32, 8, { IIC4_3, IIC7_0, MMC1, IIC6_2 } },
108962306a36Sopenharmony_ci	{ INT2PRI29, 0, 32, 8, { 0, 0, IIC9_0, IIC8_3 } },
109062306a36Sopenharmony_ci	{ INT2PRI30, 0, 32, 8, { IIC4_1, IIC4_2, IIC5_0, ONFICTL } },
109162306a36Sopenharmony_ci	{ INT2PRI31, 0, 32, 8, { IIC0_0, IIC0_1, IIC0_2, IIC0_3 } },
109262306a36Sopenharmony_ci	{ INT2PRI32, 0, 32, 8, { DMINT22, 0, 0, 0 } },
109362306a36Sopenharmony_ci	{ INT2PRI33, 0, 32, 8, { 0, 0, 0, DMINT16 } },
109462306a36Sopenharmony_ci	{ INT2PRI34, 0, 32, 8, { 0, LPC6, DMINT21, DMINT18 } },
109562306a36Sopenharmony_ci	{ INT2PRI35, 0, 32, 8, { DMINT23, TSIP, 0, DMINT19 } },
109662306a36Sopenharmony_ci	{ INT2PRI36, 0, 32, 8, { DMINT20, GETHER1, PBIA, PBIB } },
109762306a36Sopenharmony_ci	{ INT2PRI37, 0, 32, 8, { PBIC, DMAE2, DMAE3, SERMUX2 } },
109862306a36Sopenharmony_ci	{ INT2PRI38, 0, 32, 8, { LPC7, 0, 0, 0 } },
109962306a36Sopenharmony_ci	{ INT2PRI39, 0, 32, 8, { 0, 0, 0, WDT4B } },
110062306a36Sopenharmony_ci	{ INT2PRI40, 0, 32, 8, { 0, 0, 0, DMINT17 } },
110162306a36Sopenharmony_ci	{ INT2PRI41, 0, 32, 8, { DDRECC, 0, WDT6B, WDT5B } },
110262306a36Sopenharmony_ci	{ INT2PRI42, 0, 32, 8, { 0, 0, 0, LPC8 } },
110362306a36Sopenharmony_ci	{ INT2PRI43, 0, 32, 8, { 0, WDT7B, PCIE_BRIDGE, WDT8B } },
110462306a36Sopenharmony_ci	{ INT2PRI44, 0, 32, 8, { WDT2B, GETHER2, 0, 0 } },
110562306a36Sopenharmony_ci	{ INT2PRI45, 0, 32, 8, { 0, 0, LPC5, SERMUX3 } },
110662306a36Sopenharmony_ci	{ INT2PRI46, 0, 32, 8, { WDT0B, WDT1B, WDT3B, GETHER0 } },
110762306a36Sopenharmony_ci	{ INT2PRI47, 0, 32, 8, { DMINT12, DMINT13, DMINT14, DMINT15 } },
110862306a36Sopenharmony_ci};
110962306a36Sopenharmony_ci
111062306a36Sopenharmony_cistatic struct intc_sense_reg sense_registers_irq8to15[] __initdata = {
111162306a36Sopenharmony_ci	{ 0xffd100f8, 32, 2, /* ICR2 */   { IRQ15, IRQ14, IRQ13, IRQ12,
111262306a36Sopenharmony_ci					    IRQ11, IRQ10, IRQ9, IRQ8 } },
111362306a36Sopenharmony_ci};
111462306a36Sopenharmony_ci
111562306a36Sopenharmony_cistatic DECLARE_INTC_DESC(intc_desc, "sh7757", vectors, groups,
111662306a36Sopenharmony_ci			 mask_registers, prio_registers,
111762306a36Sopenharmony_ci			 sense_registers_irq8to15);
111862306a36Sopenharmony_ci
111962306a36Sopenharmony_ci/* Support for external interrupt pins in IRQ mode */
112062306a36Sopenharmony_cistatic struct intc_vect vectors_irq0123[] __initdata = {
112162306a36Sopenharmony_ci	INTC_VECT(IRQ0, 0x200), INTC_VECT(IRQ1, 0x240),
112262306a36Sopenharmony_ci	INTC_VECT(IRQ2, 0x280), INTC_VECT(IRQ3, 0x2c0),
112362306a36Sopenharmony_ci};
112462306a36Sopenharmony_ci
112562306a36Sopenharmony_cistatic struct intc_vect vectors_irq4567[] __initdata = {
112662306a36Sopenharmony_ci	INTC_VECT(IRQ4, 0x300), INTC_VECT(IRQ5, 0x340),
112762306a36Sopenharmony_ci	INTC_VECT(IRQ6, 0x380), INTC_VECT(IRQ7, 0x3c0),
112862306a36Sopenharmony_ci};
112962306a36Sopenharmony_ci
113062306a36Sopenharmony_cistatic struct intc_sense_reg sense_registers[] __initdata = {
113162306a36Sopenharmony_ci	{ 0xffd0001c, 32, 2, /* ICR1 */   { IRQ0, IRQ1, IRQ2, IRQ3,
113262306a36Sopenharmony_ci					    IRQ4, IRQ5, IRQ6, IRQ7 } },
113362306a36Sopenharmony_ci};
113462306a36Sopenharmony_ci
113562306a36Sopenharmony_cistatic struct intc_mask_reg ack_registers[] __initdata = {
113662306a36Sopenharmony_ci	{ 0xffd00024, 0, 32, /* INTREQ */
113762306a36Sopenharmony_ci	  { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
113862306a36Sopenharmony_ci};
113962306a36Sopenharmony_ci
114062306a36Sopenharmony_cistatic DECLARE_INTC_DESC_ACK(intc_desc_irq0123, "sh7757-irq0123",
114162306a36Sopenharmony_ci			     vectors_irq0123, NULL, mask_registers,
114262306a36Sopenharmony_ci			     prio_registers, sense_registers, ack_registers);
114362306a36Sopenharmony_ci
114462306a36Sopenharmony_cistatic DECLARE_INTC_DESC_ACK(intc_desc_irq4567, "sh7757-irq4567",
114562306a36Sopenharmony_ci			     vectors_irq4567, NULL, mask_registers,
114662306a36Sopenharmony_ci			     prio_registers, sense_registers, ack_registers);
114762306a36Sopenharmony_ci
114862306a36Sopenharmony_ci/* External interrupt pins in IRL mode */
114962306a36Sopenharmony_cistatic struct intc_vect vectors_irl0123[] __initdata = {
115062306a36Sopenharmony_ci	INTC_VECT(IRL0_LLLL, 0x200), INTC_VECT(IRL0_LLLH, 0x220),
115162306a36Sopenharmony_ci	INTC_VECT(IRL0_LLHL, 0x240), INTC_VECT(IRL0_LLHH, 0x260),
115262306a36Sopenharmony_ci	INTC_VECT(IRL0_LHLL, 0x280), INTC_VECT(IRL0_LHLH, 0x2a0),
115362306a36Sopenharmony_ci	INTC_VECT(IRL0_LHHL, 0x2c0), INTC_VECT(IRL0_LHHH, 0x2e0),
115462306a36Sopenharmony_ci	INTC_VECT(IRL0_HLLL, 0x300), INTC_VECT(IRL0_HLLH, 0x320),
115562306a36Sopenharmony_ci	INTC_VECT(IRL0_HLHL, 0x340), INTC_VECT(IRL0_HLHH, 0x360),
115662306a36Sopenharmony_ci	INTC_VECT(IRL0_HHLL, 0x380), INTC_VECT(IRL0_HHLH, 0x3a0),
115762306a36Sopenharmony_ci	INTC_VECT(IRL0_HHHL, 0x3c0),
115862306a36Sopenharmony_ci};
115962306a36Sopenharmony_ci
116062306a36Sopenharmony_cistatic struct intc_vect vectors_irl4567[] __initdata = {
116162306a36Sopenharmony_ci	INTC_VECT(IRL4_LLLL, 0x200), INTC_VECT(IRL4_LLLH, 0x220),
116262306a36Sopenharmony_ci	INTC_VECT(IRL4_LLHL, 0x240), INTC_VECT(IRL4_LLHH, 0x260),
116362306a36Sopenharmony_ci	INTC_VECT(IRL4_LHLL, 0x280), INTC_VECT(IRL4_LHLH, 0x2a0),
116462306a36Sopenharmony_ci	INTC_VECT(IRL4_LHHL, 0x2c0), INTC_VECT(IRL4_LHHH, 0x2e0),
116562306a36Sopenharmony_ci	INTC_VECT(IRL4_HLLL, 0x300), INTC_VECT(IRL4_HLLH, 0x320),
116662306a36Sopenharmony_ci	INTC_VECT(IRL4_HLHL, 0x340), INTC_VECT(IRL4_HLHH, 0x360),
116762306a36Sopenharmony_ci	INTC_VECT(IRL4_HHLL, 0x380), INTC_VECT(IRL4_HHLH, 0x3a0),
116862306a36Sopenharmony_ci	INTC_VECT(IRL4_HHHL, 0x3c0),
116962306a36Sopenharmony_ci};
117062306a36Sopenharmony_ci
117162306a36Sopenharmony_cistatic DECLARE_INTC_DESC(intc_desc_irl0123, "sh7757-irl0123", vectors_irl0123,
117262306a36Sopenharmony_ci			 NULL, mask_registers, NULL, NULL);
117362306a36Sopenharmony_ci
117462306a36Sopenharmony_cistatic DECLARE_INTC_DESC(intc_desc_irl4567, "sh7757-irl4567", vectors_irl4567,
117562306a36Sopenharmony_ci			 NULL, mask_registers, NULL, NULL);
117662306a36Sopenharmony_ci
117762306a36Sopenharmony_ci#define INTC_ICR0	0xffd00000
117862306a36Sopenharmony_ci#define INTC_INTMSK0	0xffd00044
117962306a36Sopenharmony_ci#define INTC_INTMSK1	0xffd00048
118062306a36Sopenharmony_ci#define INTC_INTMSK2	0xffd40080
118162306a36Sopenharmony_ci#define INTC_INTMSKCLR1	0xffd00068
118262306a36Sopenharmony_ci#define INTC_INTMSKCLR2	0xffd40084
118362306a36Sopenharmony_ci
118462306a36Sopenharmony_civoid __init plat_irq_setup(void)
118562306a36Sopenharmony_ci{
118662306a36Sopenharmony_ci	/* disable IRQ3-0 + IRQ7-4 */
118762306a36Sopenharmony_ci	__raw_writel(0xff000000, INTC_INTMSK0);
118862306a36Sopenharmony_ci
118962306a36Sopenharmony_ci	/* disable IRL3-0 + IRL7-4 */
119062306a36Sopenharmony_ci	__raw_writel(0xc0000000, INTC_INTMSK1);
119162306a36Sopenharmony_ci	__raw_writel(0xfffefffe, INTC_INTMSK2);
119262306a36Sopenharmony_ci
119362306a36Sopenharmony_ci	/* select IRL mode for IRL3-0 + IRL7-4 */
119462306a36Sopenharmony_ci	__raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0);
119562306a36Sopenharmony_ci
119662306a36Sopenharmony_ci	/* disable holding function, ie enable "SH-4 Mode" */
119762306a36Sopenharmony_ci	__raw_writel(__raw_readl(INTC_ICR0) | 0x00200000, INTC_ICR0);
119862306a36Sopenharmony_ci
119962306a36Sopenharmony_ci	register_intc_controller(&intc_desc);
120062306a36Sopenharmony_ci}
120162306a36Sopenharmony_ci
120262306a36Sopenharmony_civoid __init plat_irq_setup_pins(int mode)
120362306a36Sopenharmony_ci{
120462306a36Sopenharmony_ci	switch (mode) {
120562306a36Sopenharmony_ci	case IRQ_MODE_IRQ7654:
120662306a36Sopenharmony_ci		/* select IRQ mode for IRL7-4 */
120762306a36Sopenharmony_ci		__raw_writel(__raw_readl(INTC_ICR0) | 0x00400000, INTC_ICR0);
120862306a36Sopenharmony_ci		register_intc_controller(&intc_desc_irq4567);
120962306a36Sopenharmony_ci		break;
121062306a36Sopenharmony_ci	case IRQ_MODE_IRQ3210:
121162306a36Sopenharmony_ci		/* select IRQ mode for IRL3-0 */
121262306a36Sopenharmony_ci		__raw_writel(__raw_readl(INTC_ICR0) | 0x00800000, INTC_ICR0);
121362306a36Sopenharmony_ci		register_intc_controller(&intc_desc_irq0123);
121462306a36Sopenharmony_ci		break;
121562306a36Sopenharmony_ci	case IRQ_MODE_IRL7654:
121662306a36Sopenharmony_ci		/* enable IRL7-4 but don't provide any masking */
121762306a36Sopenharmony_ci		__raw_writel(0x40000000, INTC_INTMSKCLR1);
121862306a36Sopenharmony_ci		__raw_writel(0x0000fffe, INTC_INTMSKCLR2);
121962306a36Sopenharmony_ci		break;
122062306a36Sopenharmony_ci	case IRQ_MODE_IRL3210:
122162306a36Sopenharmony_ci		/* enable IRL0-3 but don't provide any masking */
122262306a36Sopenharmony_ci		__raw_writel(0x80000000, INTC_INTMSKCLR1);
122362306a36Sopenharmony_ci		__raw_writel(0xfffe0000, INTC_INTMSKCLR2);
122462306a36Sopenharmony_ci		break;
122562306a36Sopenharmony_ci	case IRQ_MODE_IRL7654_MASK:
122662306a36Sopenharmony_ci		/* enable IRL7-4 and mask using cpu intc controller */
122762306a36Sopenharmony_ci		__raw_writel(0x40000000, INTC_INTMSKCLR1);
122862306a36Sopenharmony_ci		register_intc_controller(&intc_desc_irl4567);
122962306a36Sopenharmony_ci		break;
123062306a36Sopenharmony_ci	case IRQ_MODE_IRL3210_MASK:
123162306a36Sopenharmony_ci		/* enable IRL0-3 and mask using cpu intc controller */
123262306a36Sopenharmony_ci		__raw_writel(0x80000000, INTC_INTMSKCLR1);
123362306a36Sopenharmony_ci		register_intc_controller(&intc_desc_irl0123);
123462306a36Sopenharmony_ci		break;
123562306a36Sopenharmony_ci	default:
123662306a36Sopenharmony_ci		BUG();
123762306a36Sopenharmony_ci	}
123862306a36Sopenharmony_ci}
123962306a36Sopenharmony_ci
124062306a36Sopenharmony_civoid __init plat_mem_setup(void)
124162306a36Sopenharmony_ci{
124262306a36Sopenharmony_ci}
1243