/*
 * include/asm-arm/arch-cxd4115/irqs.h
 *
 * IRQ definitions
 *
 * Copyright 2007,2008,2009 Sony Corporation
 *
 * This code is based on include/asm-arm/arch-realview/irqs.h.
 */
/*
 *  linux/include/asm-arm/arch-realview/irqs.h
 *
 *  Copyright (C) 2003 ARM Limited
 *  Copyright (C) 2000 Deep Blue Solutions Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __ARCH_CXD4115_IRQS_H
#define __ARCH_CXD4115_IRQS_H

#define IRQ_IPI				1
#define IRQ_LOCALTIMER			29
#define IRQ_LOCALWDOG			30
#define IRQ_GIC_START			32

#define IRQ_GPIO_RISE_BASE		32
#define IRQ_GPIO_RISE(x)		(IRQ_GPIO_RISE_BASE + (x))

#define IRQ_VIPCPY			74

#define IRQ_GPIO_FALL_BASE		112
#define IRQ_GPIO_FALL(x)		(IRQ_GPIO_FALL_BASE + (x))

#define IRQ_PMU_BASE			136
#define IRQ_PMU(x)			(IRQ_PMU_BASE + (x))
#define IRQ_PMU_CPU0			IRQ_PMU(0)
#define IRQ_PMU_CPU1			IRQ_PMU(1)
#define IRQ_PMU_CPU2			IRQ_PMU(2)
#define IRQ_PMU_CPU3			IRQ_PMU(3)
#define IRQ_PMU_SCU0			IRQ_PMU(4)
#define IRQ_PMU_SCU1			IRQ_PMU(5)
#define IRQ_PMU_SCU2			IRQ_PMU(6)
#define IRQ_PMU_SCU3			IRQ_PMU(7)
#define IRQ_PMU_SCU4			IRQ_PMU(8)
#define IRQ_PMU_SCU5			IRQ_PMU(9)
#define IRQ_PMU_SCU6			IRQ_PMU(10)
#define IRQ_PMU_SCU7			IRQ_PMU(11)

#define IRQ_UART_BASE			152

#define IRQ_TIMER_BASE			155
#define IRQ_TIMER(x)			(IRQ_TIMER_BASE + (x))

#define IRQ_MS0				166

#define IRQ_DMAC0_BASE			168
#define IRQ_DMAC0(x)			(IRQ_DMAC0_BASE + (x))

#define IRQ_I2C				187

#define IRQ_SIO_BASE			188
#define IRQ_SIO(x)			(IRQ_SIO_BASE + (x))
#define IRQ_SIO0			IRQ_SIO(0)

#define IRQ_ATA				193

#define IRQ_PCI_BASE			196
#define IRQ_PCI_BRIDGE			(IRQ_PCI_BASE + 0)
#define IRQ_PCI(x)			(IRQ_PCI_BASE + 1 + (x))

#define IRQ_MSX_INS_RISE		201
#define IRQ_MSX_INS_FALL		202

#define IRQ_TPU_BASE			206
#define IRQ_TPU3_OUT			(IRQ_TPU_BASE + 5)

#define IRQ_ADC_BASE			214
#define IRQ_ADC(x)			(IRQ_ADC_BASE + (x))
#define IRQ_ADC0			IRQ_ADC(0)

#define IRQ_MXX				217

#define IRQ_SDIF_BASE			218
#define IRQ_SDIF0_INT			(IRQ_SDIF_BASE + 0)
#define IRQ_SDIF0_WAKE			(IRQ_SDIF_BASE + 1)
#define IRQ_SDIF1_INT			(IRQ_SDIF_BASE + 2)
#define IRQ_SDIF1_WAKE			(IRQ_SDIF_BASE + 3)

#define IRQ_ONA				224
#define IRQ_LDEC			225
#define IRQ_CEC				229
#define IRQ_IPCM0			230

#define IRQ_USB_BASE			233
#define IRQ_USB0			(IRQ_USB_BASE + 0)
#define IRQ_USB1			(IRQ_USB_BASE + 1)
#define IRQ_VBUSVALID_RISE		(IRQ_USB_BASE + 2)
#define IRQ_VBUSVALID_FALL		(IRQ_USB_BASE + 3)
#define IRQ_AVALID_RISE			(IRQ_USB_BASE + 4)
#define IRQ_AVALID_FALL			(IRQ_USB_BASE + 5)
#define IRQ_SESSEND_RISE		(IRQ_USB_BASE + 6)
#define IRQ_SESSEND_FALL		(IRQ_USB_BASE + 7)

#define NR_IRQS				256

#ifdef CONFIG_ARCH_CXD4120
# define IRQ_GPE			98
# define IRQ_EMC_XINT			148
# define IRQ_UART(x)			((x) == 3 ? 150 : (IRQ_UART_BASE + (x)))
# define IRQ_MS1			167
# define IRQ_MS1_INS_RISE		203
# define IRQ_MS1_INS_FALL		204
# define IRQ_SDIF2_INT			(IRQ_SDIF_BASE + 4)
# define IRQ_SDIF2_WAKE			(IRQ_SDIF_BASE + 5)
# define IRQ_ADC1			IRQ_ADC(1)
# define IRQ_ADC2			IRQ_ADC(2)
#else
# define IRQ_EMC_XINT			IRQ_GPIO_RISE(22)
# define IRQ_UART(x)			(IRQ_UART_BASE + (x))
#endif /* CONFIG_ARCH_CXD4120 */

#ifndef __ASSEMBLY__
extern void raise_irq(unsigned int cpu, unsigned int irq);
#endif /* !__ASSEMBLY__ */
#endif /* __ARCH_CXD4115_IRQS_H */
