18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __ASM_SH_SE7780_H
38c2ecf20Sopenharmony_ci#define __ASM_SH_SE7780_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci * linux/include/asm-sh/se7780.h
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * Hitachi UL SolutionEngine 7780 Support.
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci#include <linux/sh_intc.h>
138c2ecf20Sopenharmony_ci#include <asm/addrspace.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/* Box specific addresses.  */
168c2ecf20Sopenharmony_ci#define SE_AREA0_WIDTH	4		/* Area0: 32bit */
178c2ecf20Sopenharmony_ci#define PA_ROM		0xa0000000	/* EPROM */
188c2ecf20Sopenharmony_ci#define PA_ROM_SIZE	0x00400000	/* EPROM size 4M byte */
198c2ecf20Sopenharmony_ci#define PA_FROM		0xa1000000	/* Flash-ROM */
208c2ecf20Sopenharmony_ci#define PA_FROM_SIZE	0x01000000	/* Flash-ROM size 16M byte */
218c2ecf20Sopenharmony_ci#define PA_EXT1		0xa4000000
228c2ecf20Sopenharmony_ci#define PA_EXT1_SIZE	0x04000000
238c2ecf20Sopenharmony_ci#define PA_SM501	PA_EXT1		/* Graphic IC (SM501) */
248c2ecf20Sopenharmony_ci#define PA_SM501_SIZE	PA_EXT1_SIZE	/* Graphic IC (SM501) */
258c2ecf20Sopenharmony_ci#define PA_SDRAM	0xa8000000	/* DDR-SDRAM(Area2/3) 128MB */
268c2ecf20Sopenharmony_ci#define PA_SDRAM_SIZE	0x08000000
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define PA_EXT4		0xb0000000
298c2ecf20Sopenharmony_ci#define PA_EXT4_SIZE	0x04000000
308c2ecf20Sopenharmony_ci#define PA_EXT_FLASH	PA_EXT4		/* Expansion Flash-ROM */
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define PA_PERIPHERAL	PA_AREA6_IO	/* SW6-6=ON */
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define PA_LAN		(PA_PERIPHERAL + 0)		/* SMC LAN91C111 */
358c2ecf20Sopenharmony_ci#define PA_LED_DISP	(PA_PERIPHERAL + 0x02000000)	/* 8words LED Display */
368c2ecf20Sopenharmony_ci#define DISP_CHAR_RAM	(7 << 3)
378c2ecf20Sopenharmony_ci#define DISP_SEL0_ADDR	(DISP_CHAR_RAM + 0)
388c2ecf20Sopenharmony_ci#define DISP_SEL1_ADDR	(DISP_CHAR_RAM + 1)
398c2ecf20Sopenharmony_ci#define DISP_SEL2_ADDR	(DISP_CHAR_RAM + 2)
408c2ecf20Sopenharmony_ci#define DISP_SEL3_ADDR	(DISP_CHAR_RAM + 3)
418c2ecf20Sopenharmony_ci#define DISP_SEL4_ADDR	(DISP_CHAR_RAM + 4)
428c2ecf20Sopenharmony_ci#define DISP_SEL5_ADDR	(DISP_CHAR_RAM + 5)
438c2ecf20Sopenharmony_ci#define DISP_SEL6_ADDR	(DISP_CHAR_RAM + 6)
448c2ecf20Sopenharmony_ci#define DISP_SEL7_ADDR	(DISP_CHAR_RAM + 7)
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#define DISP_UDC_RAM	(5 << 3)
478c2ecf20Sopenharmony_ci#define PA_FPGA		(PA_PERIPHERAL + 0x03000000) /* FPGA base address */
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci/* FPGA register address and bit */
508c2ecf20Sopenharmony_ci#define FPGA_SFTRST		(PA_FPGA + 0)	/* Soft reset register */
518c2ecf20Sopenharmony_ci#define FPGA_INTMSK1		(PA_FPGA + 2)	/* Interrupt Mask register 1 */
528c2ecf20Sopenharmony_ci#define FPGA_INTMSK2		(PA_FPGA + 4)	/* Interrupt Mask register 2 */
538c2ecf20Sopenharmony_ci#define FPGA_INTSEL1		(PA_FPGA + 6)	/* Interrupt select register 1 */
548c2ecf20Sopenharmony_ci#define FPGA_INTSEL2		(PA_FPGA + 8)	/* Interrupt select register 2 */
558c2ecf20Sopenharmony_ci#define FPGA_INTSEL3		(PA_FPGA + 10)	/* Interrupt select register 3 */
568c2ecf20Sopenharmony_ci#define FPGA_PCI_INTSEL1	(PA_FPGA + 12)	/* PCI Interrupt select register 1 */
578c2ecf20Sopenharmony_ci#define FPGA_PCI_INTSEL2	(PA_FPGA + 14)	/* PCI Interrupt select register 2 */
588c2ecf20Sopenharmony_ci#define FPGA_INTSET		(PA_FPGA + 16)	/* IRQ/IRL select register */
598c2ecf20Sopenharmony_ci#define FPGA_INTSTS1		(PA_FPGA + 18)	/* Interrupt status register 1 */
608c2ecf20Sopenharmony_ci#define FPGA_INTSTS2		(PA_FPGA + 20)	/* Interrupt status register 2 */
618c2ecf20Sopenharmony_ci#define FPGA_REQSEL		(PA_FPGA + 22)	/* REQ/GNT select register */
628c2ecf20Sopenharmony_ci#define FPGA_DBG_LED		(PA_FPGA + 32)	/* Debug LED(D-LED[8:1] */
638c2ecf20Sopenharmony_ci#define PA_LED			FPGA_DBG_LED
648c2ecf20Sopenharmony_ci#define FPGA_IVDRID		(PA_FPGA + 36)	/* iVDR ID Register */
658c2ecf20Sopenharmony_ci#define FPGA_IVDRPW		(PA_FPGA + 38)	/* iVDR Power ON Register */
668c2ecf20Sopenharmony_ci#define FPGA_MMCID		(PA_FPGA + 40)	/* MMC ID Register */
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci/* FPGA INTSEL position */
698c2ecf20Sopenharmony_ci/* INTSEL1 */
708c2ecf20Sopenharmony_ci#define IRQPOS_SMC91CX          (0 * 4)
718c2ecf20Sopenharmony_ci#define IRQPOS_SM501            (1 * 4)
728c2ecf20Sopenharmony_ci/* INTSEL2 */
738c2ecf20Sopenharmony_ci#define IRQPOS_EXTINT1          (0 * 4)
748c2ecf20Sopenharmony_ci#define IRQPOS_EXTINT2          (1 * 4)
758c2ecf20Sopenharmony_ci#define IRQPOS_EXTINT3          (2 * 4)
768c2ecf20Sopenharmony_ci#define IRQPOS_EXTINT4          (3 * 4)
778c2ecf20Sopenharmony_ci/* INTSEL3 */
788c2ecf20Sopenharmony_ci#define IRQPOS_PCCPW            (0 * 4)
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci/* IDE interrupt */
818c2ecf20Sopenharmony_ci#define IRQ_IDE0                evt2irq(0xa60) /* iVDR */
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci/* SMC interrupt */
848c2ecf20Sopenharmony_ci#define SMC_IRQ                 evt2irq(0x300)
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci/* SM501 interrupt */
878c2ecf20Sopenharmony_ci#define SM501_IRQ               evt2irq(0x200)
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci/* interrupt pin */
908c2ecf20Sopenharmony_ci#define IRQPIN_EXTINT1          0 /* IRQ0 pin */
918c2ecf20Sopenharmony_ci#define IRQPIN_EXTINT2          1 /* IRQ1 pin */
928c2ecf20Sopenharmony_ci#define IRQPIN_EXTINT3          2 /* IRQ2 pin */
938c2ecf20Sopenharmony_ci#define IRQPIN_SMC91CX          3 /* IRQ3 pin */
948c2ecf20Sopenharmony_ci#define IRQPIN_EXTINT4          4 /* IRQ4 pin */
958c2ecf20Sopenharmony_ci#define IRQPIN_PCC0             5 /* IRQ5 pin */
968c2ecf20Sopenharmony_ci#define IRQPIN_PCC2             6 /* IRQ6 pin */
978c2ecf20Sopenharmony_ci#define IRQPIN_SM501            7 /* IRQ7 pin */
988c2ecf20Sopenharmony_ci#define IRQPIN_PCCPW            7 /* IRQ7 pin */
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci/* arch/sh/boards/se/7780/irq.c */
1018c2ecf20Sopenharmony_civoid init_se7780_IRQ(void);
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#define __IO_PREFIX		se7780
1048c2ecf20Sopenharmony_ci#include <asm/io_generic.h>
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci#endif  /* __ASM_SH_SE7780_H */
107