Skip to content

Commit

Permalink
ARM: pxa: encode IRQ number into .nr_irqs
Browse files Browse the repository at this point in the history
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
  • Loading branch information
Haojian Zhuang authored and Eric Miao committed Oct 8, 2010
1 parent 1b43d8e commit 6ac6b81
Show file tree
Hide file tree
Showing 32 changed files with 62 additions and 61 deletions.
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ config ARCH_PXA
select GENERIC_CLOCKEVENTS
select TICK_ONESHOT
select PLAT_PXA
select SPARSE_IRQ
help
Support for Intel/Marvell's PXA2xx/PXA3xx processor line.

Expand Down
21 changes: 0 additions & 21 deletions arch/arm/mach-pxa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ config ARCH_LUBBOCK
bool "Intel DBPXA250 Development Platform (aka Lubbock)"
select PXA25x
select SA1111
select PXA_HAVE_BOARD_IRQS

config MACH_MAINSTONE
bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)"
select PXA27x
select HAVE_PWM
select PXA_HAVE_BOARD_IRQS

config MACH_ZYLONITE
bool
select PXA3xx
select HAVE_PWM
select PXA_HAVE_BOARD_IRQS

config MACH_ZYLONITE300
bool "PXA3xx Development Platform (aka Zylonite) PXA300/310"
Expand Down Expand Up @@ -61,23 +58,20 @@ config ARCH_VIPER
select ISA
select I2C_GPIO
select HAVE_PWM
select PXA_HAVE_BOARD_IRQS
select PXA_HAVE_ISA_IRQS
select ARCOM_PCMCIA

config MACH_ARCOM_ZEUS
bool "Arcom/Eurotech ZEUS SBC"
select PXA27x
select ISA
select PXA_HAVE_BOARD_IRQS
select PXA_HAVE_ISA_IRQS
select ARCOM_PCMCIA

config MACH_BALLOON3
bool "Balloon 3 board"
select PXA27x
select IWMMXT
select PXA_HAVE_BOARD_IRQS

config MACH_CSB726
bool "Enable Cogent CSB726 System On a Module"
Expand Down Expand Up @@ -140,13 +134,11 @@ config MACH_INTELMOTE2
bool "Intel Mote 2 Platform"
select PXA27x
select IWMMXT
select PXA_HAVE_BOARD_IRQS

config MACH_STARGATE2
bool "Intel Stargate 2 Platform"
select PXA27x
select IWMMXT
select PXA_HAVE_BOARD_IRQS

config MACH_XCEP
bool "Iskratel Electronics XCEP"
Expand Down Expand Up @@ -206,13 +198,11 @@ config MACH_LOGICPD_PXA270
bool "LogicPD PXA270 Card Engine Development Platform"
select PXA27x
select HAVE_PWM
select PXA_HAVE_BOARD_IRQS

config MACH_PCM027
bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
select PXA27x
select IWMMXT
select PXA_HAVE_BOARD_IRQS

config MACH_PCM990_BASEBOARD
bool "PHYTEC PCM-990 development board"
Expand Down Expand Up @@ -247,7 +237,6 @@ config MACH_COLIBRI_PXA270_INCOME
depends on MACH_COLIBRI
select PXA27x
select HAVE_PWM
select PXA_HAVE_BOARD_IRQS

config MACH_COLIBRI300
bool "Toradex Colibri PXA300/310"
Expand All @@ -274,7 +263,6 @@ config MACH_H4700
select PXA27x
select IWMMXT
select HAVE_PWM
select PXA_HAVE_BOARD_IRQS

config MACH_H5000
bool "HP iPAQ h5000"
Expand All @@ -289,7 +277,6 @@ config MACH_MAGICIAN
select PXA27x
select IWMMXT
select HAVE_PWM
select PXA_HAVE_BOARD_IRQS

config MACH_MIOA701
bool "Mitac Mio A701 Support"
Expand All @@ -307,7 +294,6 @@ config PXA_EZX
select PXA27x
select IWMMXT
select HAVE_PWM
select PXA_HAVE_BOARD_IRQS

config MACH_EZX_A780
bool "Motorola EZX A780"
Expand Down Expand Up @@ -478,7 +464,6 @@ config MACH_POODLE
depends on PXA_SHARPSL
select PXA25x
select SHARP_LOCOMO
select PXA_HAVE_BOARD_IRQS

config MACH_CORGI
bool "Enable Sharp SL-C700 (Corgi) Support"
Expand Down Expand Up @@ -523,7 +508,6 @@ config MACH_TOSA
bool "Enable Sharp SL-6000x (Tosa) Support"
depends on PXA_SHARPSL
select PXA25x
select PXA_HAVE_BOARD_IRQS

config TOSA_BT
tristate "Control the state of built-in bluetooth chip on Sharp SL-6000"
Expand Down Expand Up @@ -552,7 +536,6 @@ config MACH_ICONTROL
config ARCH_PXA_ESERIES
bool "PXA based Toshiba e-series PDAs"
select PXA25x
select PXA_HAVE_BOARD_IRQS

config MACH_E330
bool "Toshiba e330"
Expand Down Expand Up @@ -606,7 +589,6 @@ config MACH_ZIPIT2
bool "Zipit Z2 Handheld"
select PXA27x
select HAVE_PWM
select PXA_HAVE_BOARD_IRQS

endmenu

Expand Down Expand Up @@ -693,9 +675,6 @@ config SHARPSL_PM_MAX1111
select HWMON
select SENSORS_MAX1111

config PXA_HAVE_BOARD_IRQS
bool

config PXA_HAVE_ISA_IRQS
bool

Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/balloon3.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ MACHINE_START(BALLOON3, "Balloon3")
.phys_io = 0x40000000,
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.map_io = balloon3_map_io,
.nr_irqs = BALLOON3_NR_IRQS,
.init_irq = balloon3_init_irq,
.timer = &pxa_timer,
.init_machine = balloon3_init,
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-pxa/cm-x2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
extern void cmx255_init(void);
extern void cmx270_init(void);

/* reserve IRQs for IT8152 */
#define CMX2XX_NR_IRQS (IRQ_BOARD_START + 40)

/* virtual addresses for statically mapped regions */
#define CMX2XX_VIRT_BASE (0xe8000000)
#define CMX2XX_IT8152_VIRT (CMX2XX_VIRT_BASE)
Expand Down Expand Up @@ -514,6 +517,7 @@ MACHINE_START(ARMCORE, "Compulab CM-X2XX")
.phys_io = 0x40000000,
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.map_io = cmx2xx_map_io,
.nr_irqs = CMX2XX_NR_IRQS,
.init_irq = cmx2xx_init_irq,
.timer = &pxa_timer,
.init_machine = cmx2xx_init,
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/mach-pxa/eseries.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <mach/pxa25x.h>
#include <mach/eseries-gpio.h>
#include <mach/eseries-irq.h>
#include <mach/audio.h>
#include <mach/pxafb.h>
#include <mach/udc.h>
Expand Down Expand Up @@ -183,6 +184,7 @@ MACHINE_START(E330, "Toshiba e330")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
.init_machine = e330_init,
Expand Down Expand Up @@ -233,6 +235,7 @@ MACHINE_START(E350, "Toshiba e350")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
.init_machine = e350_init,
Expand Down Expand Up @@ -356,6 +359,7 @@ MACHINE_START(E400, "Toshiba e400")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
.init_machine = e400_init,
Expand Down Expand Up @@ -545,6 +549,7 @@ MACHINE_START(E740, "Toshiba e740")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
.init_machine = e740_init,
Expand Down Expand Up @@ -737,6 +742,7 @@ MACHINE_START(E750, "Toshiba e750")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
.init_machine = e750_init,
Expand Down Expand Up @@ -933,6 +939,7 @@ MACHINE_START(E800, "Toshiba e800")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = ESERIES_NR_IRQS,
.init_irq = pxa25x_init_irq,
.fixup = eseries_fixup,
.init_machine = e800_init,
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/mach-pxa/ezx.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "devices.h"
#include "generic.h"

#define EZX_NR_IRQS (IRQ_BOARD_START + 24)

#define GPIO12_A780_FLIP_LID 12
#define GPIO15_A1200_FLIP_LID 15
#define GPIO15_A910_FLIP_LID 15
Expand Down Expand Up @@ -800,6 +802,7 @@ MACHINE_START(EZX_A780, "Motorola EZX A780")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
.init_machine = a780_init,
Expand Down Expand Up @@ -866,6 +869,7 @@ MACHINE_START(EZX_E680, "Motorola EZX E680")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
.init_machine = e680_init,
Expand Down Expand Up @@ -932,6 +936,7 @@ MACHINE_START(EZX_A1200, "Motorola EZX A1200")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
.init_machine = a1200_init,
Expand Down Expand Up @@ -1124,6 +1129,7 @@ MACHINE_START(EZX_A910, "Motorola EZX A910")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
.init_machine = a910_init,
Expand Down Expand Up @@ -1190,6 +1196,7 @@ MACHINE_START(EZX_E6, "Motorola EZX E6")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
.init_machine = e6_init,
Expand Down Expand Up @@ -1230,6 +1237,7 @@ MACHINE_START(EZX_E2, "Motorola EZX E2")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = EZX_NR_IRQS,
.init_irq = pxa27x_init_irq,
.timer = &pxa_timer,
.init_machine = e2_init,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/hx4700.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ MACHINE_START(H4700, "HP iPAQ HX4700")
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
.boot_params = 0xa0000100,
.map_io = pxa_map_io,
.nr_irqs = HX4700_NR_IRQS,
.init_irq = pxa27x_init_irq,
.init_machine = hx4700_init,
.timer = &pxa_timer,
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-pxa/include/mach/balloon3.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ enum balloon3_features {
#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)

#define BALLOON3_NR_IRQS (IRQ_BOARD_START + 4)

extern int balloon3_has(enum balloon3_features feature);

#endif
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/include/mach/eseries-irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
#define TMIO_SD_IRQ IRQ_TMIO(1)
#define TMIO_USB_IRQ IRQ_TMIO(2)

#define ESERIES_NR_IRQS (IRQ_BOARD_START + 16)
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/include/mach/hx4700.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#define HX4700_ASIC3_GPIO_BASE NR_BUILTIN_GPIO
#define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
#define HX4700_NR_IRQS (IRQ_BOARD_START + 70)

/*
* PXA GPIOs
Expand Down
42 changes: 3 additions & 39 deletions arch/arm/mach-pxa/include/mach/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,48 +117,12 @@
/*
* The following interrupts are for board specific purposes. Since
* the kernel can only run on one machine at a time, we can re-use
* these. There will be 16 IRQs by default. If it is not enough,
* IRQ_BOARD_END is allowed be customized for each board, but keep
* the numbers within sensible limits and in descending order, so
* when multiple config options are selected, the maximum will be
* used.
* these.
* By default, no board IRQ is reserved. It should be finished in
* custom board since sparse IRQ is already enabled.
*/
#define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM)

#if defined(CONFIG_MACH_H4700)
#define IRQ_BOARD_END (IRQ_BOARD_START + 70)
#elif defined(CONFIG_MACH_ZYLONITE)
#define IRQ_BOARD_END (IRQ_BOARD_START + 32)
#elif defined(CONFIG_PXA_EZX)
#define IRQ_BOARD_END (IRQ_BOARD_START + 23)
#else
#define IRQ_BOARD_END (IRQ_BOARD_START + 16)
#endif

/*
* Figure out the MAX IRQ number.
*
* If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
* If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1
* Otherwise, we have the standard IRQs only.
*/
#ifdef CONFIG_SA1111
#define NR_IRQS (IRQ_BOARD_END + 55)
#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS)
#define NR_IRQS (IRQ_BOARD_END)
#else
#define NR_IRQS (IRQ_BOARD_START)
#endif

/* add IT8152 IRQs beyond BOARD_END */
#ifdef CONFIG_PCI_HOST_ITE8152
#define IT8152_LAST_IRQ (IRQ_BOARD_END + 40)

#if NR_IRQS < (IT8152_LAST_IRQ+1)
#undef NR_IRQS
#define NR_IRQS (IT8152_LAST_IRQ+1)
#endif

#endif /* CONFIG_PCI_HOST_ITE8152 */

#endif /* __ASM_MACH_IRQS_H */
2 changes: 2 additions & 0 deletions arch/arm/mach-pxa/include/mach/littleton.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
#define EXT0_GPIO_BASE (NR_BUILTIN_GPIO)
#define EXT0_GPIO(x) (EXT0_GPIO_BASE + (x))

#define LITTLETON_NR_IRQS (IRQ_BOARD_START + 8)

#endif /* __ASM_ARCH_LITTLETON_H */
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/include/mach/lpd270.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
#define LPD270_USBC_IRQ LPD270_IRQ(2)
#define LPD270_ETHERNET_IRQ LPD270_IRQ(3)
#define LPD270_AC97_IRQ LPD270_IRQ(4)
#define LPD270_NR_IRQS (IRQ_BOARD_START + 5)

#endif
3 changes: 3 additions & 0 deletions arch/arm/mach-pxa/include/mach/lubbock.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
#define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */
#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6)

#define LUBBOCK_SA1111_IRQ_BASE (IRQ_BOARD_START + 16)
#define LUBBOCK_NR_IRQS (IRQ_BOARD_START + 16 + 55)

#ifndef __ASSEMBLY__
extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set);
#endif
Loading

0 comments on commit 6ac6b81

Please sign in to comment.