162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef __ASM_SH_RENESAS_R7780RP_H
362306a36Sopenharmony_ci#define __ASM_SH_RENESAS_R7780RP_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci/* Box specific addresses.  */
662306a36Sopenharmony_ci#define PA_NORFLASH_ADDR	0x00000000
762306a36Sopenharmony_ci#define PA_NORFLASH_SIZE	0x04000000
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#if defined(CONFIG_SH_R7780MP)
1062306a36Sopenharmony_ci#define PA_BCR          0xa4000000      /* FPGA */
1162306a36Sopenharmony_ci#define PA_SDPOW	(-1)
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#define PA_IRLMSK       (PA_BCR+0x0000) /* Interrupt Mask control */
1462306a36Sopenharmony_ci#define PA_IRLMON       (PA_BCR+0x0002) /* Interrupt Status control */
1562306a36Sopenharmony_ci#define PA_IRLPRI1      (PA_BCR+0x0004) /* Interrupt Priorty 1 */
1662306a36Sopenharmony_ci#define PA_IRLPRI2      (PA_BCR+0x0006) /* Interrupt Priorty 2 */
1762306a36Sopenharmony_ci#define PA_IRLPRI3      (PA_BCR+0x0008) /* Interrupt Priorty 3 */
1862306a36Sopenharmony_ci#define PA_IRLPRI4      (PA_BCR+0x000a) /* Interrupt Priorty 4 */
1962306a36Sopenharmony_ci#define PA_RSTCTL       (PA_BCR+0x000c) /* Reset Control */
2062306a36Sopenharmony_ci#define PA_PCIBD        (PA_BCR+0x000e) /* PCI Board detect control */
2162306a36Sopenharmony_ci#define PA_PCICD        (PA_BCR+0x0010) /* PCI Connector detect control */
2262306a36Sopenharmony_ci#define PA_EXTGIO       (PA_BCR+0x0016) /* Extension GPIO Control */
2362306a36Sopenharmony_ci#define PA_IVDRMON      (PA_BCR+0x0018) /* iVDR Moniter control */
2462306a36Sopenharmony_ci#define PA_IVDRCTL      (PA_BCR+0x001a) /* iVDR control */
2562306a36Sopenharmony_ci#define PA_OBLED        (PA_BCR+0x001c) /* On Board LED control */
2662306a36Sopenharmony_ci#define PA_OBSW         (PA_BCR+0x001e) /* On Board Switch control */
2762306a36Sopenharmony_ci#define PA_AUDIOSEL     (PA_BCR+0x0020) /* Sound Interface Select control */
2862306a36Sopenharmony_ci#define PA_EXTPLR       (PA_BCR+0x001e) /* Extension Pin Polarity control */
2962306a36Sopenharmony_ci#define PA_TPCTL        (PA_BCR+0x0100) /* Touch Panel Access control */
3062306a36Sopenharmony_ci#define PA_TPDCKCTL     (PA_BCR+0x0102) /* Touch Panel Access data control */
3162306a36Sopenharmony_ci#define PA_TPCTLCLR     (PA_BCR+0x0104) /* Touch Panel Access control */
3262306a36Sopenharmony_ci#define PA_TPXPOS       (PA_BCR+0x0106) /* Touch Panel X position control */
3362306a36Sopenharmony_ci#define PA_TPYPOS       (PA_BCR+0x0108) /* Touch Panel Y position control */
3462306a36Sopenharmony_ci#define PA_DBSW         (PA_BCR+0x0200) /* Debug Board Switch control */
3562306a36Sopenharmony_ci#define PA_CFCTL        (PA_BCR+0x0300) /* CF Timing control */
3662306a36Sopenharmony_ci#define PA_CFPOW        (PA_BCR+0x0302) /* CF Power control */
3762306a36Sopenharmony_ci#define PA_CFCDINTCLR   (PA_BCR+0x0304) /* CF Insert Interrupt clear */
3862306a36Sopenharmony_ci#define PA_SCSMR0       (PA_BCR+0x0400) /* SCIF0 Serial mode control */
3962306a36Sopenharmony_ci#define PA_SCBRR0       (PA_BCR+0x0404) /* SCIF0 Bit rate control */
4062306a36Sopenharmony_ci#define PA_SCSCR0       (PA_BCR+0x0408) /* SCIF0 Serial control */
4162306a36Sopenharmony_ci#define PA_SCFTDR0      (PA_BCR+0x040c) /* SCIF0 Send FIFO control */
4262306a36Sopenharmony_ci#define PA_SCFSR0       (PA_BCR+0x0410) /* SCIF0 Serial status control */
4362306a36Sopenharmony_ci#define PA_SCFRDR0      (PA_BCR+0x0414) /* SCIF0 Receive FIFO control */
4462306a36Sopenharmony_ci#define PA_SCFCR0       (PA_BCR+0x0418) /* SCIF0 FIFO control */
4562306a36Sopenharmony_ci#define PA_SCTFDR0      (PA_BCR+0x041c) /* SCIF0 Send FIFO data control */
4662306a36Sopenharmony_ci#define PA_SCRFDR0      (PA_BCR+0x0420) /* SCIF0 Receive FIFO data control */
4762306a36Sopenharmony_ci#define PA_SCSPTR0      (PA_BCR+0x0424) /* SCIF0 Serial Port control */
4862306a36Sopenharmony_ci#define PA_SCLSR0       (PA_BCR+0x0428) /* SCIF0 Line Status control */
4962306a36Sopenharmony_ci#define PA_SCRER0       (PA_BCR+0x042c) /* SCIF0 Serial Error control */
5062306a36Sopenharmony_ci#define PA_SCSMR1       (PA_BCR+0x0500) /* SCIF1 Serial mode control */
5162306a36Sopenharmony_ci#define PA_SCBRR1       (PA_BCR+0x0504) /* SCIF1 Bit rate control */
5262306a36Sopenharmony_ci#define PA_SCSCR1       (PA_BCR+0x0508) /* SCIF1 Serial control */
5362306a36Sopenharmony_ci#define PA_SCFTDR1      (PA_BCR+0x050c) /* SCIF1 Send FIFO control */
5462306a36Sopenharmony_ci#define PA_SCFSR1       (PA_BCR+0x0510) /* SCIF1 Serial status control */
5562306a36Sopenharmony_ci#define PA_SCFRDR1      (PA_BCR+0x0514) /* SCIF1 Receive FIFO control */
5662306a36Sopenharmony_ci#define PA_SCFCR1       (PA_BCR+0x0518) /* SCIF1 FIFO control */
5762306a36Sopenharmony_ci#define PA_SCTFDR1      (PA_BCR+0x051c) /* SCIF1 Send FIFO data control */
5862306a36Sopenharmony_ci#define PA_SCRFDR1      (PA_BCR+0x0520) /* SCIF1 Receive FIFO data control */
5962306a36Sopenharmony_ci#define PA_SCSPTR1      (PA_BCR+0x0524) /* SCIF1 Serial Port control */
6062306a36Sopenharmony_ci#define PA_SCLSR1       (PA_BCR+0x0528) /* SCIF1 Line Status control */
6162306a36Sopenharmony_ci#define PA_SCRER1       (PA_BCR+0x052c) /* SCIF1 Serial Error control */
6262306a36Sopenharmony_ci#define PA_SMCR         (PA_BCR+0x0600) /* 2-wire Serial control */
6362306a36Sopenharmony_ci#define PA_SMSMADR      (PA_BCR+0x0602) /* 2-wire Serial Slave control */
6462306a36Sopenharmony_ci#define PA_SMMR         (PA_BCR+0x0604) /* 2-wire Serial Mode control */
6562306a36Sopenharmony_ci#define PA_SMSADR1      (PA_BCR+0x0606) /* 2-wire Serial Address1 control */
6662306a36Sopenharmony_ci#define PA_SMTRDR1      (PA_BCR+0x0646) /* 2-wire Serial Data1 control */
6762306a36Sopenharmony_ci#define PA_VERREG       (PA_BCR+0x0700) /* FPGA Version Register */
6862306a36Sopenharmony_ci#define PA_POFF         (PA_BCR+0x0800) /* System Power Off control */
6962306a36Sopenharmony_ci#define PA_PMR          (PA_BCR+0x0900) /*  */
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci#define IRLCNTR1        (PA_BCR + 0)    /* Interrupt Control Register1 */
7262306a36Sopenharmony_ci#define IVDR_CK_ON	8		/* iVDR Clock ON */
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#elif defined(CONFIG_SH_R7780RP)
7562306a36Sopenharmony_ci#define PA_POFF		(-1)
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#define PA_BCR		0xa5000000	/* FPGA */
7862306a36Sopenharmony_ci#define	PA_IRLMSK	(PA_BCR+0x0000)	/* Interrupt Mask control */
7962306a36Sopenharmony_ci#define PA_IRLMON	(PA_BCR+0x0002)	/* Interrupt Status control */
8062306a36Sopenharmony_ci#define	PA_SDPOW	(PA_BCR+0x0004)	/* SD Power control */
8162306a36Sopenharmony_ci#define	PA_RSTCTL	(PA_BCR+0x0006)	/* Device Reset control */
8262306a36Sopenharmony_ci#define	PA_PCIBD	(PA_BCR+0x0008)	/* PCI Board detect control */
8362306a36Sopenharmony_ci#define	PA_PCICD	(PA_BCR+0x000a)	/* PCI Connector detect control */
8462306a36Sopenharmony_ci#define	PA_ZIGIO1	(PA_BCR+0x000c)	/* Zigbee IO control 1 */
8562306a36Sopenharmony_ci#define	PA_ZIGIO2	(PA_BCR+0x000e)	/* Zigbee IO control 2 */
8662306a36Sopenharmony_ci#define	PA_ZIGIO3	(PA_BCR+0x0010)	/* Zigbee IO control 3 */
8762306a36Sopenharmony_ci#define	PA_ZIGIO4	(PA_BCR+0x0012)	/* Zigbee IO control 4 */
8862306a36Sopenharmony_ci#define	PA_IVDRMON	(PA_BCR+0x0014)	/* iVDR Moniter control */
8962306a36Sopenharmony_ci#define	PA_IVDRCTL	(PA_BCR+0x0016)	/* iVDR control */
9062306a36Sopenharmony_ci#define PA_OBLED	(PA_BCR+0x0018)	/* On Board LED control */
9162306a36Sopenharmony_ci#define PA_OBSW		(PA_BCR+0x001a)	/* On Board Switch control */
9262306a36Sopenharmony_ci#define PA_AUDIOSEL	(PA_BCR+0x001c)	/* Sound Interface Select control */
9362306a36Sopenharmony_ci#define PA_EXTPLR	(PA_BCR+0x001e)	/* Extension Pin Polarity control */
9462306a36Sopenharmony_ci#define PA_TPCTL	(PA_BCR+0x0100)	/* Touch Panel Access control */
9562306a36Sopenharmony_ci#define PA_TPDCKCTL	(PA_BCR+0x0102)	/* Touch Panel Access data control */
9662306a36Sopenharmony_ci#define PA_TPCTLCLR	(PA_BCR+0x0104)	/* Touch Panel Access control */
9762306a36Sopenharmony_ci#define PA_TPXPOS	(PA_BCR+0x0106)	/* Touch Panel X position control */
9862306a36Sopenharmony_ci#define PA_TPYPOS	(PA_BCR+0x0108)	/* Touch Panel Y position control */
9962306a36Sopenharmony_ci#define PA_DBDET	(PA_BCR+0x0200)	/* Debug Board detect control */
10062306a36Sopenharmony_ci#define PA_DBDISPCTL	(PA_BCR+0x0202)	/* Debug Board Dot timing control */
10162306a36Sopenharmony_ci#define PA_DBSW		(PA_BCR+0x0204)	/* Debug Board Switch control */
10262306a36Sopenharmony_ci#define PA_CFCTL	(PA_BCR+0x0300)	/* CF Timing control */
10362306a36Sopenharmony_ci#define PA_CFPOW	(PA_BCR+0x0302)	/* CF Power control */
10462306a36Sopenharmony_ci#define PA_CFCDINTCLR	(PA_BCR+0x0304)	/* CF Insert Interrupt clear */
10562306a36Sopenharmony_ci#define PA_SCSMR	(PA_BCR+0x0400)	/* SCIF Serial mode control */
10662306a36Sopenharmony_ci#define PA_SCBRR	(PA_BCR+0x0402)	/* SCIF Bit rate control */
10762306a36Sopenharmony_ci#define PA_SCSCR	(PA_BCR+0x0404)	/* SCIF Serial control */
10862306a36Sopenharmony_ci#define PA_SCFDTR	(PA_BCR+0x0406)	/* SCIF Send FIFO control */
10962306a36Sopenharmony_ci#define PA_SCFSR	(PA_BCR+0x0408)	/* SCIF Serial status control */
11062306a36Sopenharmony_ci#define PA_SCFRDR	(PA_BCR+0x040a)	/* SCIF Receive FIFO control */
11162306a36Sopenharmony_ci#define PA_SCFCR	(PA_BCR+0x040c)	/* SCIF FIFO control */
11262306a36Sopenharmony_ci#define PA_SCFDR	(PA_BCR+0x040e)	/* SCIF FIFO data control */
11362306a36Sopenharmony_ci#define PA_SCLSR	(PA_BCR+0x0412)	/* SCIF Line Status control */
11462306a36Sopenharmony_ci#define PA_SMCR		(PA_BCR+0x0500)	/* 2-wire Serial control */
11562306a36Sopenharmony_ci#define PA_SMSMADR	(PA_BCR+0x0502)	/* 2-wire Serial Slave control */
11662306a36Sopenharmony_ci#define PA_SMMR		(PA_BCR+0x0504)	/* 2-wire Serial Mode control */
11762306a36Sopenharmony_ci#define PA_SMSADR1	(PA_BCR+0x0506)	/* 2-wire Serial Address1 control */
11862306a36Sopenharmony_ci#define PA_SMTRDR1	(PA_BCR+0x0546)	/* 2-wire Serial Data1 control */
11962306a36Sopenharmony_ci#define PA_VERREG	(PA_BCR+0x0600)	/* FPGA Version Register */
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci#define PA_AX88796L	0xa5800400	/* AX88796L Area */
12262306a36Sopenharmony_ci#define PA_SC1602BSLB	0xa6000000	/* SC1602BSLB Area */
12362306a36Sopenharmony_ci#define PA_IDE_OFFSET	0x1f0		/* CF IDE Offset */
12462306a36Sopenharmony_ci#define AX88796L_IO_BASE	0x1000	/* AX88796L IO Base Address */
12562306a36Sopenharmony_ci
12662306a36Sopenharmony_ci#define IRLCNTR1	(PA_BCR + 0)	/* Interrupt Control Register1 */
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci#define IVDR_CK_ON	8		/* iVDR Clock ON */
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci#elif defined(CONFIG_SH_R7785RP)
13162306a36Sopenharmony_ci#define PA_BCR		0xa4000000	/* FPGA */
13262306a36Sopenharmony_ci#define PA_SDPOW	(-1)
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci#define	PA_PCISCR	(PA_BCR+0x0000)
13562306a36Sopenharmony_ci#define PA_IRLPRA	(PA_BCR+0x0002)
13662306a36Sopenharmony_ci#define	PA_IRLPRB	(PA_BCR+0x0004)
13762306a36Sopenharmony_ci#define	PA_IRLPRC	(PA_BCR+0x0006)
13862306a36Sopenharmony_ci#define	PA_IRLPRD	(PA_BCR+0x0008)
13962306a36Sopenharmony_ci#define IRLCNTR1	(PA_BCR+0x0010)
14062306a36Sopenharmony_ci#define	PA_IRLPRE	(PA_BCR+0x000a)
14162306a36Sopenharmony_ci#define	PA_IRLPRF	(PA_BCR+0x000c)
14262306a36Sopenharmony_ci#define	PA_EXIRLCR	(PA_BCR+0x000e)
14362306a36Sopenharmony_ci#define	PA_IRLMCR1	(PA_BCR+0x0010)
14462306a36Sopenharmony_ci#define	PA_IRLMCR2	(PA_BCR+0x0012)
14562306a36Sopenharmony_ci#define	PA_IRLSSR1	(PA_BCR+0x0014)
14662306a36Sopenharmony_ci#define	PA_IRLSSR2	(PA_BCR+0x0016)
14762306a36Sopenharmony_ci#define PA_CFTCR	(PA_BCR+0x0100)
14862306a36Sopenharmony_ci#define PA_CFPCR	(PA_BCR+0x0102)
14962306a36Sopenharmony_ci#define PA_PCICR	(PA_BCR+0x0110)
15062306a36Sopenharmony_ci#define PA_IVDRCTL	(PA_BCR+0x0112)
15162306a36Sopenharmony_ci#define PA_IVDRSR	(PA_BCR+0x0114)
15262306a36Sopenharmony_ci#define PA_PDRSTCR	(PA_BCR+0x0116)
15362306a36Sopenharmony_ci#define PA_POFF		(PA_BCR+0x0120)
15462306a36Sopenharmony_ci#define PA_LCDCR	(PA_BCR+0x0130)
15562306a36Sopenharmony_ci#define PA_TPCR		(PA_BCR+0x0140)
15662306a36Sopenharmony_ci#define PA_TPCKCR	(PA_BCR+0x0142)
15762306a36Sopenharmony_ci#define PA_TPRSTR	(PA_BCR+0x0144)
15862306a36Sopenharmony_ci#define PA_TPXPDR	(PA_BCR+0x0146)
15962306a36Sopenharmony_ci#define PA_TPYPDR	(PA_BCR+0x0148)
16062306a36Sopenharmony_ci#define PA_GPIOPFR	(PA_BCR+0x0150)
16162306a36Sopenharmony_ci#define PA_GPIODR	(PA_BCR+0x0152)
16262306a36Sopenharmony_ci#define PA_OBLED	(PA_BCR+0x0154)
16362306a36Sopenharmony_ci#define PA_SWSR		(PA_BCR+0x0156)
16462306a36Sopenharmony_ci#define PA_VERREG	(PA_BCR+0x0158)
16562306a36Sopenharmony_ci#define PA_SMCR		(PA_BCR+0x0200)
16662306a36Sopenharmony_ci#define PA_SMSMADR	(PA_BCR+0x0202)
16762306a36Sopenharmony_ci#define PA_SMMR		(PA_BCR+0x0204)
16862306a36Sopenharmony_ci#define PA_SMSADR1	(PA_BCR+0x0206)
16962306a36Sopenharmony_ci#define PA_SMSADR32	(PA_BCR+0x0244)
17062306a36Sopenharmony_ci#define PA_SMTRDR1	(PA_BCR+0x0246)
17162306a36Sopenharmony_ci#define PA_SMTRDR16	(PA_BCR+0x0264)
17262306a36Sopenharmony_ci#define PA_CU3MDR	(PA_BCR+0x0300)
17362306a36Sopenharmony_ci#define PA_CU5MDR	(PA_BCR+0x0302)
17462306a36Sopenharmony_ci#define PA_MMSR		(PA_BCR+0x0400)
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ci#define IVDR_CK_ON	4		/* iVDR Clock ON */
17762306a36Sopenharmony_ci#endif
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci#define HL_FPGA_IRQ_BASE	(200 + 16)
18062306a36Sopenharmony_ci#define HL_NR_IRL		15
18162306a36Sopenharmony_ci
18262306a36Sopenharmony_ci#define IRQ_AX88796		(HL_FPGA_IRQ_BASE + 0)
18362306a36Sopenharmony_ci#define IRQ_CF			(HL_FPGA_IRQ_BASE + 1)
18462306a36Sopenharmony_ci#define IRQ_PSW			(HL_FPGA_IRQ_BASE + 2)
18562306a36Sopenharmony_ci#define IRQ_EXT0		(HL_FPGA_IRQ_BASE + 3)
18662306a36Sopenharmony_ci#define IRQ_EXT1		(HL_FPGA_IRQ_BASE + 4)
18762306a36Sopenharmony_ci#define IRQ_EXT2		(HL_FPGA_IRQ_BASE + 5)
18862306a36Sopenharmony_ci#define IRQ_EXT3		(HL_FPGA_IRQ_BASE + 6)
18962306a36Sopenharmony_ci#define IRQ_EXT4		(HL_FPGA_IRQ_BASE + 7)
19062306a36Sopenharmony_ci#define IRQ_EXT5		(HL_FPGA_IRQ_BASE + 8)
19162306a36Sopenharmony_ci#define IRQ_EXT6		(HL_FPGA_IRQ_BASE + 9)
19262306a36Sopenharmony_ci#define IRQ_EXT7		(HL_FPGA_IRQ_BASE + 10)
19362306a36Sopenharmony_ci#define IRQ_SMBUS		(HL_FPGA_IRQ_BASE + 11)
19462306a36Sopenharmony_ci#define IRQ_TP			(HL_FPGA_IRQ_BASE + 12)
19562306a36Sopenharmony_ci#define IRQ_RTC			(HL_FPGA_IRQ_BASE + 13)
19662306a36Sopenharmony_ci#define IRQ_TH_ALERT		(HL_FPGA_IRQ_BASE + 14)
19762306a36Sopenharmony_ci#define IRQ_SCIF0		(HL_FPGA_IRQ_BASE + 15)
19862306a36Sopenharmony_ci#define IRQ_SCIF1		(HL_FPGA_IRQ_BASE + 16)
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ciunsigned char *highlander_plat_irq_setup(void);
20162306a36Sopenharmony_ci
20262306a36Sopenharmony_ci#ifdef CONFIG_SH_R7785RP
20362306a36Sopenharmony_civoid highlander_plat_pinmux_setup(void);
20462306a36Sopenharmony_ci#else
20562306a36Sopenharmony_ci#define highlander_plat_pinmux_setup()	do { } while (0)
20662306a36Sopenharmony_ci#endif
20762306a36Sopenharmony_ci
20862306a36Sopenharmony_ci#endif  /* __ASM_SH_RENESAS_R7780RP */
209