162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef __ASM_SH_SE7780_H
362306a36Sopenharmony_ci#define __ASM_SH_SE7780_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci/*
662306a36Sopenharmony_ci * linux/include/asm-sh/se7780.h
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Copyright (C) 2006,2007  Nobuhiro Iwamatsu
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci * Hitachi UL SolutionEngine 7780 Support.
1162306a36Sopenharmony_ci */
1262306a36Sopenharmony_ci#include <linux/sh_intc.h>
1362306a36Sopenharmony_ci#include <asm/addrspace.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/* Box specific addresses.  */
1662306a36Sopenharmony_ci#define SE_AREA0_WIDTH	4		/* Area0: 32bit */
1762306a36Sopenharmony_ci#define PA_ROM		0xa0000000	/* EPROM */
1862306a36Sopenharmony_ci#define PA_ROM_SIZE	0x00400000	/* EPROM size 4M byte */
1962306a36Sopenharmony_ci#define PA_FROM		0xa1000000	/* Flash-ROM */
2062306a36Sopenharmony_ci#define PA_FROM_SIZE	0x01000000	/* Flash-ROM size 16M byte */
2162306a36Sopenharmony_ci#define PA_EXT1		0xa4000000
2262306a36Sopenharmony_ci#define PA_EXT1_SIZE	0x04000000
2362306a36Sopenharmony_ci#define PA_SM501	PA_EXT1		/* Graphic IC (SM501) */
2462306a36Sopenharmony_ci#define PA_SM501_SIZE	PA_EXT1_SIZE	/* Graphic IC (SM501) */
2562306a36Sopenharmony_ci#define PA_SDRAM	0xa8000000	/* DDR-SDRAM(Area2/3) 128MB */
2662306a36Sopenharmony_ci#define PA_SDRAM_SIZE	0x08000000
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define PA_EXT4		0xb0000000
2962306a36Sopenharmony_ci#define PA_EXT4_SIZE	0x04000000
3062306a36Sopenharmony_ci#define PA_EXT_FLASH	PA_EXT4		/* Expansion Flash-ROM */
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci#define PA_PERIPHERAL	PA_AREA6_IO	/* SW6-6=ON */
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#define PA_LAN		(PA_PERIPHERAL + 0)		/* SMC LAN91C111 */
3562306a36Sopenharmony_ci#define PA_LED_DISP	(PA_PERIPHERAL + 0x02000000)	/* 8words LED Display */
3662306a36Sopenharmony_ci#define DISP_CHAR_RAM	(7 << 3)
3762306a36Sopenharmony_ci#define DISP_SEL0_ADDR	(DISP_CHAR_RAM + 0)
3862306a36Sopenharmony_ci#define DISP_SEL1_ADDR	(DISP_CHAR_RAM + 1)
3962306a36Sopenharmony_ci#define DISP_SEL2_ADDR	(DISP_CHAR_RAM + 2)
4062306a36Sopenharmony_ci#define DISP_SEL3_ADDR	(DISP_CHAR_RAM + 3)
4162306a36Sopenharmony_ci#define DISP_SEL4_ADDR	(DISP_CHAR_RAM + 4)
4262306a36Sopenharmony_ci#define DISP_SEL5_ADDR	(DISP_CHAR_RAM + 5)
4362306a36Sopenharmony_ci#define DISP_SEL6_ADDR	(DISP_CHAR_RAM + 6)
4462306a36Sopenharmony_ci#define DISP_SEL7_ADDR	(DISP_CHAR_RAM + 7)
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#define DISP_UDC_RAM	(5 << 3)
4762306a36Sopenharmony_ci#define PA_FPGA		(PA_PERIPHERAL + 0x03000000) /* FPGA base address */
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci/* FPGA register address and bit */
5062306a36Sopenharmony_ci#define FPGA_SFTRST		(PA_FPGA + 0)	/* Soft reset register */
5162306a36Sopenharmony_ci#define FPGA_INTMSK1		(PA_FPGA + 2)	/* Interrupt Mask register 1 */
5262306a36Sopenharmony_ci#define FPGA_INTMSK2		(PA_FPGA + 4)	/* Interrupt Mask register 2 */
5362306a36Sopenharmony_ci#define FPGA_INTSEL1		(PA_FPGA + 6)	/* Interrupt select register 1 */
5462306a36Sopenharmony_ci#define FPGA_INTSEL2		(PA_FPGA + 8)	/* Interrupt select register 2 */
5562306a36Sopenharmony_ci#define FPGA_INTSEL3		(PA_FPGA + 10)	/* Interrupt select register 3 */
5662306a36Sopenharmony_ci#define FPGA_PCI_INTSEL1	(PA_FPGA + 12)	/* PCI Interrupt select register 1 */
5762306a36Sopenharmony_ci#define FPGA_PCI_INTSEL2	(PA_FPGA + 14)	/* PCI Interrupt select register 2 */
5862306a36Sopenharmony_ci#define FPGA_INTSET		(PA_FPGA + 16)	/* IRQ/IRL select register */
5962306a36Sopenharmony_ci#define FPGA_INTSTS1		(PA_FPGA + 18)	/* Interrupt status register 1 */
6062306a36Sopenharmony_ci#define FPGA_INTSTS2		(PA_FPGA + 20)	/* Interrupt status register 2 */
6162306a36Sopenharmony_ci#define FPGA_REQSEL		(PA_FPGA + 22)	/* REQ/GNT select register */
6262306a36Sopenharmony_ci#define FPGA_DBG_LED		(PA_FPGA + 32)	/* Debug LED(D-LED[8:1] */
6362306a36Sopenharmony_ci#define PA_LED			FPGA_DBG_LED
6462306a36Sopenharmony_ci#define FPGA_IVDRID		(PA_FPGA + 36)	/* iVDR ID Register */
6562306a36Sopenharmony_ci#define FPGA_IVDRPW		(PA_FPGA + 38)	/* iVDR Power ON Register */
6662306a36Sopenharmony_ci#define FPGA_MMCID		(PA_FPGA + 40)	/* MMC ID Register */
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci/* FPGA INTSEL position */
6962306a36Sopenharmony_ci/* INTSEL1 */
7062306a36Sopenharmony_ci#define IRQPOS_SMC91CX          (0 * 4)
7162306a36Sopenharmony_ci#define IRQPOS_SM501            (1 * 4)
7262306a36Sopenharmony_ci/* INTSEL2 */
7362306a36Sopenharmony_ci#define IRQPOS_EXTINT1          (0 * 4)
7462306a36Sopenharmony_ci#define IRQPOS_EXTINT2          (1 * 4)
7562306a36Sopenharmony_ci#define IRQPOS_EXTINT3          (2 * 4)
7662306a36Sopenharmony_ci#define IRQPOS_EXTINT4          (3 * 4)
7762306a36Sopenharmony_ci/* INTSEL3 */
7862306a36Sopenharmony_ci#define IRQPOS_PCCPW            (0 * 4)
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci/* IDE interrupt */
8162306a36Sopenharmony_ci#define IRQ_IDE0                evt2irq(0xa60) /* iVDR */
8262306a36Sopenharmony_ci
8362306a36Sopenharmony_ci/* SMC interrupt */
8462306a36Sopenharmony_ci#define SMC_IRQ                 evt2irq(0x300)
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci/* SM501 interrupt */
8762306a36Sopenharmony_ci#define SM501_IRQ               evt2irq(0x200)
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci/* interrupt pin */
9062306a36Sopenharmony_ci#define IRQPIN_EXTINT1          0 /* IRQ0 pin */
9162306a36Sopenharmony_ci#define IRQPIN_EXTINT2          1 /* IRQ1 pin */
9262306a36Sopenharmony_ci#define IRQPIN_EXTINT3          2 /* IRQ2 pin */
9362306a36Sopenharmony_ci#define IRQPIN_SMC91CX          3 /* IRQ3 pin */
9462306a36Sopenharmony_ci#define IRQPIN_EXTINT4          4 /* IRQ4 pin */
9562306a36Sopenharmony_ci#define IRQPIN_PCC0             5 /* IRQ5 pin */
9662306a36Sopenharmony_ci#define IRQPIN_PCC2             6 /* IRQ6 pin */
9762306a36Sopenharmony_ci#define IRQPIN_SM501            7 /* IRQ7 pin */
9862306a36Sopenharmony_ci#define IRQPIN_PCCPW            7 /* IRQ7 pin */
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci/* arch/sh/boards/se/7780/irq.c */
10162306a36Sopenharmony_civoid init_se7780_IRQ(void);
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci#define __IO_PREFIX		se7780
10462306a36Sopenharmony_ci#include <asm/io_generic.h>
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci#endif  /* __ASM_SH_SE7780_H */
107