All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] ARM: at91/dt: make use of periph id macros
@ 2013-08-01  6:48 ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:48 UTC (permalink / raw)
  To: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Mark Brown
  Cc: devicetree, linux-kernel, linux-arm-kernel, Boris BREZILLON

Hello,

This patch series move at91 SoCs peripheral id definitions from machine
specific include dir to dt-bindings include dir.
These macros are used to reference interrupts instead of peripheral numbers.

This makes dt definitions cleaner and easier to debug (one can easily tell if
the peripheral macro used to reference an interrupt line is not the good one).

These macros will be used for clk definitions and references too.

I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
definitions as there are no soc specific directories in dt-bindings include
dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
'include/dt-bindings/peripherals/at91/xxx' would be better.
What do you think ?

Best Regards,

Boris

Boris BREZILLON (8):
  ARM: at91: move peripheral id definitions to dt-bindings include dir
  ARM: at91/dt: use periph id macros for at91rm9200 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9260 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9263 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9g45 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9n12 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9x5 interrupt
    definitions
  ARM: at91/dt: use periph id macros for sama5d3 interrupt definitions

 arch/arm/boot/dts/at91rm9200.dtsi                  |   59 ++++++++------
 arch/arm/boot/dts/at91sam9260.dtsi                 |   57 +++++++-------
 arch/arm/boot/dts/at91sam9263.dtsi                 |   46 +++++------
 arch/arm/boot/dts/at91sam9g45.dtsi                 |   57 +++++++-------
 arch/arm/boot/dts/at91sam9n12.dtsi                 |   43 +++++-----
 arch/arm/boot/dts/at91sam9x5.dtsi                  |   63 +++++++--------
 arch/arm/boot/dts/sama5d3.dtsi                     |   83 ++++++++++----------
 arch/arm/mach-at91/include/mach/at91rm9200.h       |   31 +-------
 arch/arm/mach-at91/include/mach/at91sam9260.h      |   29 +------
 arch/arm/mach-at91/include/mach/at91sam9261.h      |   23 +-----
 arch/arm/mach-at91/include/mach/at91sam9263.h      |   27 +------
 arch/arm/mach-at91/include/mach/at91sam9g45.h      |   31 +-------
 arch/arm/mach-at91/include/mach/at91sam9n12.h      |   26 +-----
 arch/arm/mach-at91/include/mach/at91sam9rl.h       |   25 +-----
 arch/arm/mach-at91/include/mach/at91sam9x5.h       |   32 +-------
 arch/arm/mach-at91/include/mach/hardware.h         |    3 +-
 arch/arm/mach-at91/include/mach/sama5d3.h          |   48 +----------
 include/dt-bindings/at91/at91rm9200/peripherals.h  |   44 +++++++++++
 include/dt-bindings/at91/at91sam9260/peripherals.h |   42 ++++++++++
 include/dt-bindings/at91/at91sam9261/peripherals.h |   36 +++++++++
 include/dt-bindings/at91/at91sam9263/peripherals.h |   40 ++++++++++
 include/dt-bindings/at91/at91sam9g45/peripherals.h |   44 +++++++++++
 include/dt-bindings/at91/at91sam9n12/peripherals.h |   41 ++++++++++
 include/dt-bindings/at91/at91sam9rl/peripherals.h  |   38 +++++++++
 include/dt-bindings/at91/at91sam9x5/peripherals.h  |   45 +++++++++++
 include/dt-bindings/at91/common/peripherals.h      |   14 ++++
 include/dt-bindings/at91/sama5d3/peripherals.h     |   63 +++++++++++++++
 27 files changed, 629 insertions(+), 461 deletions(-)
 create mode 100644 include/dt-bindings/at91/at91rm9200/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9260/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9261/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9263/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9g45/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9n12/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9rl/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9x5/peripherals.h
 create mode 100644 include/dt-bindings/at91/common/peripherals.h
 create mode 100644 include/dt-bindings/at91/sama5d3/peripherals.h

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 0/8] ARM: at91/dt: make use of periph id macros
@ 2013-08-01  6:48 ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

This patch series move at91 SoCs peripheral id definitions from machine
specific include dir to dt-bindings include dir.
These macros are used to reference interrupts instead of peripheral numbers.

This makes dt definitions cleaner and easier to debug (one can easily tell if
the peripheral macro used to reference an interrupt line is not the good one).

These macros will be used for clk definitions and references too.

I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
definitions as there are no soc specific directories in dt-bindings include
dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
'include/dt-bindings/peripherals/at91/xxx' would be better.
What do you think ?

Best Regards,

Boris

Boris BREZILLON (8):
  ARM: at91: move peripheral id definitions to dt-bindings include dir
  ARM: at91/dt: use periph id macros for at91rm9200 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9260 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9263 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9g45 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9n12 interrupt
    definitions
  ARM: at91/dt: use periph id macros for at91sam9x5 interrupt
    definitions
  ARM: at91/dt: use periph id macros for sama5d3 interrupt definitions

 arch/arm/boot/dts/at91rm9200.dtsi                  |   59 ++++++++------
 arch/arm/boot/dts/at91sam9260.dtsi                 |   57 +++++++-------
 arch/arm/boot/dts/at91sam9263.dtsi                 |   46 +++++------
 arch/arm/boot/dts/at91sam9g45.dtsi                 |   57 +++++++-------
 arch/arm/boot/dts/at91sam9n12.dtsi                 |   43 +++++-----
 arch/arm/boot/dts/at91sam9x5.dtsi                  |   63 +++++++--------
 arch/arm/boot/dts/sama5d3.dtsi                     |   83 ++++++++++----------
 arch/arm/mach-at91/include/mach/at91rm9200.h       |   31 +-------
 arch/arm/mach-at91/include/mach/at91sam9260.h      |   29 +------
 arch/arm/mach-at91/include/mach/at91sam9261.h      |   23 +-----
 arch/arm/mach-at91/include/mach/at91sam9263.h      |   27 +------
 arch/arm/mach-at91/include/mach/at91sam9g45.h      |   31 +-------
 arch/arm/mach-at91/include/mach/at91sam9n12.h      |   26 +-----
 arch/arm/mach-at91/include/mach/at91sam9rl.h       |   25 +-----
 arch/arm/mach-at91/include/mach/at91sam9x5.h       |   32 +-------
 arch/arm/mach-at91/include/mach/hardware.h         |    3 +-
 arch/arm/mach-at91/include/mach/sama5d3.h          |   48 +----------
 include/dt-bindings/at91/at91rm9200/peripherals.h  |   44 +++++++++++
 include/dt-bindings/at91/at91sam9260/peripherals.h |   42 ++++++++++
 include/dt-bindings/at91/at91sam9261/peripherals.h |   36 +++++++++
 include/dt-bindings/at91/at91sam9263/peripherals.h |   40 ++++++++++
 include/dt-bindings/at91/at91sam9g45/peripherals.h |   44 +++++++++++
 include/dt-bindings/at91/at91sam9n12/peripherals.h |   41 ++++++++++
 include/dt-bindings/at91/at91sam9rl/peripherals.h  |   38 +++++++++
 include/dt-bindings/at91/at91sam9x5/peripherals.h  |   45 +++++++++++
 include/dt-bindings/at91/common/peripherals.h      |   14 ++++
 include/dt-bindings/at91/sama5d3/peripherals.h     |   63 +++++++++++++++
 27 files changed, 629 insertions(+), 461 deletions(-)
 create mode 100644 include/dt-bindings/at91/at91rm9200/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9260/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9261/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9263/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9g45/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9n12/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9rl/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9x5/peripherals.h
 create mode 100644 include/dt-bindings/at91/common/peripherals.h
 create mode 100644 include/dt-bindings/at91/sama5d3/peripherals.h

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
  2013-08-01  6:48 ` Boris BREZILLON
@ 2013-08-01  6:52   ` Boris BREZILLON
  -1 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:52 UTC (permalink / raw)
  To: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Arnd Bergmann
  Cc: devicetree, linux-kernel, linux-arm-kernel, Boris BREZILLON

This patch moves peripheral id definitions from machine specific include
dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
dir (include/dt-bindings/at91/'soc-name'/peripherals.h).

These definitions will be used inside dt to define interrupt ids and
peripheral clk ids.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/mach-at91/include/mach/at91rm9200.h       |   31 +---------
 arch/arm/mach-at91/include/mach/at91sam9260.h      |   29 +--------
 arch/arm/mach-at91/include/mach/at91sam9261.h      |   23 +------
 arch/arm/mach-at91/include/mach/at91sam9263.h      |   27 +--------
 arch/arm/mach-at91/include/mach/at91sam9g45.h      |   31 +---------
 arch/arm/mach-at91/include/mach/at91sam9n12.h      |   26 +-------
 arch/arm/mach-at91/include/mach/at91sam9rl.h       |   25 +-------
 arch/arm/mach-at91/include/mach/at91sam9x5.h       |   32 +---------
 arch/arm/mach-at91/include/mach/hardware.h         |    3 +-
 arch/arm/mach-at91/include/mach/sama5d3.h          |   48 +--------------
 include/dt-bindings/at91/at91rm9200/peripherals.h  |   44 ++++++++++++++
 include/dt-bindings/at91/at91sam9260/peripherals.h |   42 +++++++++++++
 include/dt-bindings/at91/at91sam9261/peripherals.h |   36 +++++++++++
 include/dt-bindings/at91/at91sam9263/peripherals.h |   40 +++++++++++++
 include/dt-bindings/at91/at91sam9g45/peripherals.h |   44 ++++++++++++++
 include/dt-bindings/at91/at91sam9n12/peripherals.h |   41 +++++++++++++
 include/dt-bindings/at91/at91sam9rl/peripherals.h  |   38 ++++++++++++
 include/dt-bindings/at91/at91sam9x5/peripherals.h  |   45 ++++++++++++++
 include/dt-bindings/at91/common/peripherals.h      |   14 +++++
 include/dt-bindings/at91/sama5d3/peripherals.h     |   63 ++++++++++++++++++++
 20 files changed, 417 insertions(+), 265 deletions(-)
 create mode 100644 include/dt-bindings/at91/at91rm9200/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9260/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9261/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9263/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9g45/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9n12/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9rl/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9x5/peripherals.h
 create mode 100644 include/dt-bindings/at91/common/peripherals.h
 create mode 100644 include/dt-bindings/at91/sama5d3/peripherals.h

diff --git a/arch/arm/mach-at91/include/mach/at91rm9200.h b/arch/arm/mach-at91/include/mach/at91rm9200.h
index e67317c..975b587 100644
--- a/arch/arm/mach-at91/include/mach/at91rm9200.h
+++ b/arch/arm/mach-at91/include/mach/at91rm9200.h
@@ -19,36 +19,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91RM9200_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91RM9200_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91RM9200_ID_PIOC	4	/* Parallel IO Controller C */
-#define AT91RM9200_ID_PIOD	5	/* Parallel IO Controller D */
-#define AT91RM9200_ID_US0	6	/* USART 0 */
-#define AT91RM9200_ID_US1	7	/* USART 1 */
-#define AT91RM9200_ID_US2	8	/* USART 2 */
-#define AT91RM9200_ID_US3	9	/* USART 3 */
-#define AT91RM9200_ID_MCI	10	/* Multimedia Card Interface */
-#define AT91RM9200_ID_UDP	11	/* USB Device Port */
-#define AT91RM9200_ID_TWI	12	/* Two-Wire Interface */
-#define AT91RM9200_ID_SPI	13	/* Serial Peripheral Interface */
-#define AT91RM9200_ID_SSC0	14	/* Serial Synchronous Controller 0 */
-#define AT91RM9200_ID_SSC1	15	/* Serial Synchronous Controller 1 */
-#define AT91RM9200_ID_SSC2	16	/* Serial Synchronous Controller 2 */
-#define AT91RM9200_ID_TC0	17	/* Timer Counter 0 */
-#define AT91RM9200_ID_TC1	18	/* Timer Counter 1 */
-#define AT91RM9200_ID_TC2	19	/* Timer Counter 2 */
-#define AT91RM9200_ID_TC3	20	/* Timer Counter 3 */
-#define AT91RM9200_ID_TC4	21	/* Timer Counter 4 */
-#define AT91RM9200_ID_TC5	22	/* Timer Counter 5 */
-#define AT91RM9200_ID_UHP	23	/* USB Host port */
-#define AT91RM9200_ID_EMAC	24	/* Ethernet MAC */
-#define AT91RM9200_ID_IRQ0	25	/* Advanced Interrupt Controller (IRQ0) */
-#define AT91RM9200_ID_IRQ1	26	/* Advanced Interrupt Controller (IRQ1) */
-#define AT91RM9200_ID_IRQ2	27	/* Advanced Interrupt Controller (IRQ2) */
-#define AT91RM9200_ID_IRQ3	28	/* Advanced Interrupt Controller (IRQ3) */
-#define AT91RM9200_ID_IRQ4	29	/* Advanced Interrupt Controller (IRQ4) */
-#define AT91RM9200_ID_IRQ5	30	/* Advanced Interrupt Controller (IRQ5) */
-#define AT91RM9200_ID_IRQ6	31	/* Advanced Interrupt Controller (IRQ6) */
+#include <dt-bindings/at91/at91rm9200/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9260.h b/arch/arm/mach-at91/include/mach/at91sam9260.h
index 416c7b6..7eb4ae0 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9260.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9260.h
@@ -20,34 +20,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9260_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91SAM9260_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91SAM9260_ID_PIOC	4	/* Parallel IO Controller C */
-#define AT91SAM9260_ID_ADC	5	/* Analog-to-Digital Converter */
-#define AT91SAM9260_ID_US0	6	/* USART 0 */
-#define AT91SAM9260_ID_US1	7	/* USART 1 */
-#define AT91SAM9260_ID_US2	8	/* USART 2 */
-#define AT91SAM9260_ID_MCI	9	/* Multimedia Card Interface */
-#define AT91SAM9260_ID_UDP	10	/* USB Device Port */
-#define AT91SAM9260_ID_TWI	11	/* Two-Wire Interface */
-#define AT91SAM9260_ID_SPI0	12	/* Serial Peripheral Interface 0 */
-#define AT91SAM9260_ID_SPI1	13	/* Serial Peripheral Interface 1 */
-#define AT91SAM9260_ID_SSC	14	/* Serial Synchronous Controller */
-#define AT91SAM9260_ID_TC0	17	/* Timer Counter 0 */
-#define AT91SAM9260_ID_TC1	18	/* Timer Counter 1 */
-#define AT91SAM9260_ID_TC2	19	/* Timer Counter 2 */
-#define AT91SAM9260_ID_UHP	20	/* USB Host port */
-#define AT91SAM9260_ID_EMAC	21	/* Ethernet */
-#define AT91SAM9260_ID_ISI	22	/* Image Sensor Interface */
-#define AT91SAM9260_ID_US3	23	/* USART 3 */
-#define AT91SAM9260_ID_US4	24	/* USART 4 */
-#define AT91SAM9260_ID_US5	25	/* USART 5 */
-#define AT91SAM9260_ID_TC3	26	/* Timer Counter 3 */
-#define AT91SAM9260_ID_TC4	27	/* Timer Counter 4 */
-#define AT91SAM9260_ID_TC5	28	/* Timer Counter 5 */
-#define AT91SAM9260_ID_IRQ0	29	/* Advanced Interrupt Controller (IRQ0) */
-#define AT91SAM9260_ID_IRQ1	30	/* Advanced Interrupt Controller (IRQ1) */
-#define AT91SAM9260_ID_IRQ2	31	/* Advanced Interrupt Controller (IRQ2) */
+#include <dt-bindings/at91/at91sam9260/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261.h b/arch/arm/mach-at91/include/mach/at91sam9261.h
index a041406..0cb62a3 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9261.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9261.h
@@ -18,28 +18,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9261_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91SAM9261_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91SAM9261_ID_PIOC	4	/* Parallel IO Controller C */
-#define AT91SAM9261_ID_US0	6	/* USART 0 */
-#define AT91SAM9261_ID_US1	7	/* USART 1 */
-#define AT91SAM9261_ID_US2	8	/* USART 2 */
-#define AT91SAM9261_ID_MCI	9	/* Multimedia Card Interface */
-#define AT91SAM9261_ID_UDP	10	/* USB Device Port */
-#define AT91SAM9261_ID_TWI	11	/* Two-Wire Interface */
-#define AT91SAM9261_ID_SPI0	12	/* Serial Peripheral Interface 0 */
-#define AT91SAM9261_ID_SPI1	13	/* Serial Peripheral Interface 1 */
-#define AT91SAM9261_ID_SSC0	14	/* Serial Synchronous Controller 0 */
-#define AT91SAM9261_ID_SSC1	15	/* Serial Synchronous Controller 1 */
-#define AT91SAM9261_ID_SSC2	16	/* Serial Synchronous Controller 2 */
-#define AT91SAM9261_ID_TC0	17	/* Timer Counter 0 */
-#define AT91SAM9261_ID_TC1	18	/* Timer Counter 1 */
-#define AT91SAM9261_ID_TC2	19	/* Timer Counter 2 */
-#define AT91SAM9261_ID_UHP	20	/* USB Host port */
-#define AT91SAM9261_ID_LCDC	21	/* LDC Controller */
-#define AT91SAM9261_ID_IRQ0	29	/* Advanced Interrupt Controller (IRQ0) */
-#define AT91SAM9261_ID_IRQ1	30	/* Advanced Interrupt Controller (IRQ1) */
-#define AT91SAM9261_ID_IRQ2	31	/* Advanced Interrupt Controller (IRQ2) */
+#include <dt-bindings/at91/at91sam9261/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9263.h b/arch/arm/mach-at91/include/mach/at91sam9263.h
index d201029..991ca66 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9263.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9263.h
@@ -18,32 +18,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9263_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91SAM9263_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91SAM9263_ID_PIOCDE	4	/* Parallel IO Controller C, D and E */
-#define AT91SAM9263_ID_US0	7	/* USART 0 */
-#define AT91SAM9263_ID_US1	8	/* USART 1 */
-#define AT91SAM9263_ID_US2	9	/* USART 2 */
-#define AT91SAM9263_ID_MCI0	10	/* Multimedia Card Interface 0 */
-#define AT91SAM9263_ID_MCI1	11	/* Multimedia Card Interface 1 */
-#define AT91SAM9263_ID_CAN	12	/* CAN */
-#define AT91SAM9263_ID_TWI	13	/* Two-Wire Interface */
-#define AT91SAM9263_ID_SPI0	14	/* Serial Peripheral Interface 0 */
-#define AT91SAM9263_ID_SPI1	15	/* Serial Peripheral Interface 1 */
-#define AT91SAM9263_ID_SSC0	16	/* Serial Synchronous Controller 0 */
-#define AT91SAM9263_ID_SSC1	17	/* Serial Synchronous Controller 1 */
-#define AT91SAM9263_ID_AC97C	18	/* AC97 Controller */
-#define AT91SAM9263_ID_TCB	19	/* Timer Counter 0, 1 and 2 */
-#define AT91SAM9263_ID_PWMC	20	/* Pulse Width Modulation Controller */
-#define AT91SAM9263_ID_EMAC	21	/* Ethernet */
-#define AT91SAM9263_ID_2DGE	23	/* 2D Graphic Engine */
-#define AT91SAM9263_ID_UDP	24	/* USB Device Port */
-#define AT91SAM9263_ID_ISI	25	/* Image Sensor Interface */
-#define AT91SAM9263_ID_LCDC	26	/* LCD Controller */
-#define AT91SAM9263_ID_DMA	27	/* DMA Controller */
-#define AT91SAM9263_ID_UHP	29	/* USB Host port */
-#define AT91SAM9263_ID_IRQ0	30	/* Advanced Interrupt Controller (IRQ0) */
-#define AT91SAM9263_ID_IRQ1	31	/* Advanced Interrupt Controller (IRQ1) */
+#include <dt-bindings/at91/at91sam9263/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45.h b/arch/arm/mach-at91/include/mach/at91sam9g45.h
index 8eba102..3f1a509 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9g45.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9g45.h
@@ -18,36 +18,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9G45_ID_PIOA	2	/* Parallel I/O Controller A */
-#define AT91SAM9G45_ID_PIOB	3	/* Parallel I/O Controller B */
-#define AT91SAM9G45_ID_PIOC	4	/* Parallel I/O Controller C */
-#define AT91SAM9G45_ID_PIODE	5	/* Parallel I/O Controller D and E */
-#define AT91SAM9G45_ID_TRNG	6	/* True Random Number Generator */
-#define AT91SAM9G45_ID_US0	7	/* USART 0 */
-#define AT91SAM9G45_ID_US1	8	/* USART 1 */
-#define AT91SAM9G45_ID_US2	9	/* USART 2 */
-#define AT91SAM9G45_ID_US3	10	/* USART 3 */
-#define AT91SAM9G45_ID_MCI0	11	/* High Speed Multimedia Card Interface 0 */
-#define AT91SAM9G45_ID_TWI0	12	/* Two-Wire Interface 0 */
-#define AT91SAM9G45_ID_TWI1	13	/* Two-Wire Interface 1 */
-#define AT91SAM9G45_ID_SPI0	14	/* Serial Peripheral Interface 0 */
-#define AT91SAM9G45_ID_SPI1	15	/* Serial Peripheral Interface 1 */
-#define AT91SAM9G45_ID_SSC0	16	/* Synchronous Serial Controller 0 */
-#define AT91SAM9G45_ID_SSC1	17	/* Synchronous Serial Controller 1 */
-#define AT91SAM9G45_ID_TCB	18	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
-#define AT91SAM9G45_ID_PWMC	19	/* Pulse Width Modulation Controller */
-#define AT91SAM9G45_ID_TSC	20	/* Touch Screen ADC Controller */
-#define AT91SAM9G45_ID_DMA	21	/* DMA Controller */
-#define AT91SAM9G45_ID_UHPHS	22	/* USB Host High Speed */
-#define AT91SAM9G45_ID_LCDC	23	/* LCD Controller */
-#define AT91SAM9G45_ID_AC97C	24	/* AC97 Controller */
-#define AT91SAM9G45_ID_EMAC	25	/* Ethernet MAC */
-#define AT91SAM9G45_ID_ISI	26	/* Image Sensor Interface */
-#define AT91SAM9G45_ID_UDPHS	27	/* USB Device High Speed */
-#define AT91SAM9G45_ID_AESTDESSHA 28	/* AES + T-DES + SHA */
-#define AT91SAM9G45_ID_MCI1	29	/* High Speed Multimedia Card Interface 1 */
-#define AT91SAM9G45_ID_VDEC	30	/* Video Decoder */
-#define AT91SAM9G45_ID_IRQ0	31	/* Advanced Interrupt Controller */
+#include <dt-bindings/at91/at91sam9263/peripherals.h>
 
 /*
  * User Peripheral physical base addresses.
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12.h b/arch/arm/mach-at91/include/mach/at91sam9n12.h
index d374b87..a78f203 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9n12.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9n12.h
@@ -14,31 +14,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9N12_ID_PIOAB	2	/* Parallel I/O Controller A and B */
-#define AT91SAM9N12_ID_PIOCD	3	/* Parallel I/O Controller C and D */
-#define AT91SAM9N12_ID_FUSE	4	/* FUSE Controller */
-#define AT91SAM9N12_ID_USART0	5	/* USART 0 */
-#define AT91SAM9N12_ID_USART1	6	/* USART 1 */
-#define AT91SAM9N12_ID_USART2	7	/* USART 2 */
-#define AT91SAM9N12_ID_USART3	8	/* USART 3 */
-#define AT91SAM9N12_ID_TWI0	9	/* Two-Wire Interface 0 */
-#define AT91SAM9N12_ID_TWI1	10	/* Two-Wire Interface 1 */
-#define AT91SAM9N12_ID_MCI	12	/* High Speed Multimedia Card Interface */
-#define AT91SAM9N12_ID_SPI0	13	/* Serial Peripheral Interface 0 */
-#define AT91SAM9N12_ID_SPI1	14	/* Serial Peripheral Interface 1 */
-#define AT91SAM9N12_ID_UART0	15	/* UART 0 */
-#define AT91SAM9N12_ID_UART1	16	/* UART 1 */
-#define AT91SAM9N12_ID_TCB	17	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
-#define AT91SAM9N12_ID_PWM	18	/* Pulse Width Modulation Controller */
-#define AT91SAM9N12_ID_ADC	19	/* ADC Controller */
-#define AT91SAM9N12_ID_DMA	20	/* DMA Controller */
-#define AT91SAM9N12_ID_UHP	22	/* USB Host High Speed */
-#define AT91SAM9N12_ID_UDP	23	/* USB Device High Speed */
-#define AT91SAM9N12_ID_LCDC	25	/* LCD Controller */
-#define AT91SAM9N12_ID_ISI	25	/* Image Sensor Interface */
-#define AT91SAM9N12_ID_SSC	28	/* Synchronous Serial Controller */
-#define AT91SAM9N12_ID_TRNG	30	/* TRNG */
-#define AT91SAM9N12_ID_IRQ0	31	/* Advanced Interrupt Controller */
+#include <dt-bindings/at91/at91sam9n12/peripherals.h>
 
 /*
  * User Peripheral physical base addresses.
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl.h b/arch/arm/mach-at91/include/mach/at91sam9rl.h
index a15db56..efe5d60 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9rl.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9rl.h
@@ -17,30 +17,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9RL_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91SAM9RL_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91SAM9RL_ID_PIOC	4	/* Parallel IO Controller C */
-#define AT91SAM9RL_ID_PIOD	5	/* Parallel IO Controller D */
-#define AT91SAM9RL_ID_US0	6	/* USART 0 */
-#define AT91SAM9RL_ID_US1	7	/* USART 1 */
-#define AT91SAM9RL_ID_US2	8	/* USART 2 */
-#define AT91SAM9RL_ID_US3	9	/* USART 3 */
-#define AT91SAM9RL_ID_MCI	10	/* Multimedia Card Interface */
-#define AT91SAM9RL_ID_TWI0	11	/* TWI 0 */
-#define AT91SAM9RL_ID_TWI1	12	/* TWI 1 */
-#define AT91SAM9RL_ID_SPI	13	/* Serial Peripheral Interface */
-#define AT91SAM9RL_ID_SSC0	14	/* Serial Synchronous Controller 0 */
-#define AT91SAM9RL_ID_SSC1	15	/* Serial Synchronous Controller 1 */
-#define AT91SAM9RL_ID_TC0	16	/* Timer Counter 0 */
-#define AT91SAM9RL_ID_TC1	17	/* Timer Counter 1 */
-#define AT91SAM9RL_ID_TC2	18	/* Timer Counter 2 */
-#define AT91SAM9RL_ID_PWMC	19	/* Pulse Width Modulation Controller */
-#define AT91SAM9RL_ID_TSC	20	/* Touch Screen Controller */
-#define AT91SAM9RL_ID_DMA	21	/* DMA Controller */
-#define AT91SAM9RL_ID_UDPHS	22	/* USB Device HS */
-#define AT91SAM9RL_ID_LCDC	23	/* LCD Controller */
-#define AT91SAM9RL_ID_AC97C	24	/* AC97 Controller */
-#define AT91SAM9RL_ID_IRQ0	31	/* Advanced Interrupt Controller (IRQ0) */
+#include <dt-bindings/at91/at91sam9rl/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9x5.h b/arch/arm/mach-at91/include/mach/at91sam9x5.h
index c75ee19..7e4b029 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9x5.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9x5.h
@@ -15,37 +15,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9X5_ID_PIOAB	2	/* Parallel I/O Controller A and B */
-#define AT91SAM9X5_ID_PIOCD	3	/* Parallel I/O Controller C and D */
-#define AT91SAM9X5_ID_SMD	4	/* SMD Soft Modem (SMD) */
-#define AT91SAM9X5_ID_USART0	5	/* USART 0 */
-#define AT91SAM9X5_ID_USART1	6	/* USART 1 */
-#define AT91SAM9X5_ID_USART2	7	/* USART 2 */
-#define AT91SAM9X5_ID_USART3	8	/* USART 3 */
-#define AT91SAM9X5_ID_TWI0	9	/* Two-Wire Interface 0 */
-#define AT91SAM9X5_ID_TWI1	10	/* Two-Wire Interface 1 */
-#define AT91SAM9X5_ID_TWI2	11	/* Two-Wire Interface 2 */
-#define AT91SAM9X5_ID_MCI0	12	/* High Speed Multimedia Card Interface 0 */
-#define AT91SAM9X5_ID_SPI0	13	/* Serial Peripheral Interface 0 */
-#define AT91SAM9X5_ID_SPI1	14	/* Serial Peripheral Interface 1 */
-#define AT91SAM9X5_ID_UART0	15	/* UART 0 */
-#define AT91SAM9X5_ID_UART1	16	/* UART 1 */
-#define AT91SAM9X5_ID_TCB	17	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
-#define AT91SAM9X5_ID_PWM	18	/* Pulse Width Modulation Controller */
-#define AT91SAM9X5_ID_ADC	19	/* ADC Controller */
-#define AT91SAM9X5_ID_DMA0	20	/* DMA Controller 0 */
-#define AT91SAM9X5_ID_DMA1	21	/* DMA Controller 1 */
-#define AT91SAM9X5_ID_UHPHS	22	/* USB Host High Speed */
-#define AT91SAM9X5_ID_UDPHS	23	/* USB Device High Speed */
-#define AT91SAM9X5_ID_EMAC0	24	/* Ethernet MAC0 */
-#define AT91SAM9X5_ID_LCDC	25	/* LCD Controller */
-#define AT91SAM9X5_ID_ISI	25	/* Image Sensor Interface */
-#define AT91SAM9X5_ID_MCI1	26	/* High Speed Multimedia Card Interface 1 */
-#define AT91SAM9X5_ID_EMAC1	27	/* Ethernet MAC1 */
-#define AT91SAM9X5_ID_SSC	28	/* Synchronous Serial Controller */
-#define AT91SAM9X5_ID_CAN0	29	/* CAN Controller 0 */
-#define AT91SAM9X5_ID_CAN1	30	/* CAN Controller 1 */
-#define AT91SAM9X5_ID_IRQ0	31	/* Advanced Interrupt Controller */
+#include <dt-bindings/at91/at91sam9x5/peripherals.h>
 
 /*
  * User Peripheral physical base addresses.
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
index a832e07..588135a 100644
--- a/arch/arm/mach-at91/include/mach/hardware.h
+++ b/arch/arm/mach-at91/include/mach/hardware.h
@@ -58,8 +58,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91_ID_FIQ		0	/* Advanced Interrupt Controller (FIQ) */
-#define AT91_ID_SYS		1	/* System Peripherals */
+#include <dt-bindings/at91/common/peripherals.h>
 
 #ifdef CONFIG_MMU
 /*
diff --git a/arch/arm/mach-at91/include/mach/sama5d3.h b/arch/arm/mach-at91/include/mach/sama5d3.h
index 6dc81ee..8155be4 100644
--- a/arch/arm/mach-at91/include/mach/sama5d3.h
+++ b/arch/arm/mach-at91/include/mach/sama5d3.h
@@ -16,53 +16,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91_ID_FIQ		 0	/* Advanced Interrupt Controller (FIQ) */
-#define AT91_ID_SYS		 1	/* System Peripherals */
-#define SAMA5D3_ID_DBGU		 2	/* debug Unit (usually no special interrupt line) */
-#define AT91_ID_PIT		 3	/* PIT */
-#define SAMA5D3_ID_WDT		 4	/* Watchdog Timer Interrupt */
-#define SAMA5D3_ID_HSMC		 5	/* Static Memory Controller */
-#define SAMA5D3_ID_PIOA		 6	/* PIOA */
-#define SAMA5D3_ID_PIOB		 7	/* PIOB */
-#define SAMA5D3_ID_PIOC		 8	/* PIOC */
-#define SAMA5D3_ID_PIOD		 9	/* PIOD */
-#define SAMA5D3_ID_PIOE		10	/* PIOE */
-#define SAMA5D3_ID_SMD		11	/* SMD Soft Modem */
-#define SAMA5D3_ID_USART0	12	/* USART0 */
-#define SAMA5D3_ID_USART1	13	/* USART1 */
-#define SAMA5D3_ID_USART2	14	/* USART2 */
-#define SAMA5D3_ID_USART3	15	/* USART3 */
-#define SAMA5D3_ID_UART0	16	/* UART 0 */
-#define SAMA5D3_ID_UART1	17	/* UART 1 */
-#define SAMA5D3_ID_TWI0		18	/* Two-Wire Interface 0 */
-#define SAMA5D3_ID_TWI1		19	/* Two-Wire Interface 1 */
-#define SAMA5D3_ID_TWI2		20	/* Two-Wire Interface 2 */
-#define SAMA5D3_ID_HSMCI0	21	/* MCI */
-#define SAMA5D3_ID_HSMCI1	22	/* MCI */
-#define SAMA5D3_ID_HSMCI2	23	/* MCI */
-#define SAMA5D3_ID_SPI0		24	/* Serial Peripheral Interface 0 */
-#define SAMA5D3_ID_SPI1		25	/* Serial Peripheral Interface 1 */
-#define SAMA5D3_ID_TC0		26	/* Timer Counter 0 */
-#define SAMA5D3_ID_TC1		27	/* Timer Counter 2 */
-#define SAMA5D3_ID_PWM		28	/* Pulse Width Modulation Controller */
-#define SAMA5D3_ID_ADC		29	/* Touch Screen ADC Controller */
-#define SAMA5D3_ID_DMA0		30	/* DMA Controller 0 */
-#define SAMA5D3_ID_DMA1		31	/* DMA Controller 1 */
-#define SAMA5D3_ID_UHPHS	32	/* USB Host High Speed */
-#define SAMA5D3_ID_UDPHS	33	/* USB Device High Speed */
-#define SAMA5D3_ID_GMAC		34	/* Gigabit Ethernet MAC */
-#define SAMA5D3_ID_EMAC		35	/* Ethernet MAC */
-#define SAMA5D3_ID_LCDC		36	/* LCD Controller */
-#define SAMA5D3_ID_ISI		37	/* Image Sensor Interface */
-#define SAMA5D3_ID_SSC0		38	/* Synchronous Serial Controller 0 */
-#define SAMA5D3_ID_SSC1		39	/* Synchronous Serial Controller 1 */
-#define SAMA5D3_ID_CAN0		40	/* CAN Controller 0 */
-#define SAMA5D3_ID_CAN1		41	/* CAN Controller 1 */
-#define SAMA5D3_ID_SHA		42	/* Secure Hash Algorithm */
-#define SAMA5D3_ID_AES		43	/* Advanced Encryption Standard */
-#define SAMA5D3_ID_TDES		44	/* Triple Data Encryption Standard */
-#define SAMA5D3_ID_TRNG		45	/* True Random Generator Number */
-#define SAMA5D3_ID_IRQ0		47	/* Advanced Interrupt Controller (IRQ0) */
+#include <dt-bindings/at91/sama5d3/peripherals.h>
 
 /*
  * Internal Memory
diff --git a/include/dt-bindings/at91/at91rm9200/peripherals.h b/include/dt-bindings/at91/at91rm9200/peripherals.h
new file mode 100644
index 0000000..769bd71
--- /dev/null
+++ b/include/dt-bindings/at91/at91rm9200/peripherals.h
@@ -0,0 +1,44 @@
+/*
+ * This header define at91rm9200 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91RM9200_PERIPH_H
+#define _DT_BINDINGS_AT91RM9200_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91RM9200_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91RM9200_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91RM9200_ID_PIOC	4	/* Parallel IO Controller C */
+#define AT91RM9200_ID_PIOD	5	/* Parallel IO Controller D */
+#define AT91RM9200_ID_US0	6	/* USART 0 */
+#define AT91RM9200_ID_US1	7	/* USART 1 */
+#define AT91RM9200_ID_US2	8	/* USART 2 */
+#define AT91RM9200_ID_US3	9	/* USART 3 */
+#define AT91RM9200_ID_MCI	10	/* Multimedia Card Interface */
+#define AT91RM9200_ID_UDP	11	/* USB Device Port */
+#define AT91RM9200_ID_TWI	12	/* Two-Wire Interface */
+#define AT91RM9200_ID_SPI	13	/* Serial Peripheral Interface */
+#define AT91RM9200_ID_SSC0	14	/* Serial Synchronous Controller 0 */
+#define AT91RM9200_ID_SSC1	15	/* Serial Synchronous Controller 1 */
+#define AT91RM9200_ID_SSC2	16	/* Serial Synchronous Controller 2 */
+#define AT91RM9200_ID_TC0	17	/* Timer Counter 0 */
+#define AT91RM9200_ID_TC1	18	/* Timer Counter 1 */
+#define AT91RM9200_ID_TC2	19	/* Timer Counter 2 */
+#define AT91RM9200_ID_TC3	20	/* Timer Counter 3 */
+#define AT91RM9200_ID_TC4	21	/* Timer Counter 4 */
+#define AT91RM9200_ID_TC5	22	/* Timer Counter 5 */
+#define AT91RM9200_ID_UHP	23	/* USB Host port */
+#define AT91RM9200_ID_EMAC	24	/* Ethernet MAC */
+#define AT91RM9200_ID_IRQ0	25	/* Advanced Interrupt Controller (IRQ0) */
+#define AT91RM9200_ID_IRQ1	26	/* Advanced Interrupt Controller (IRQ1) */
+#define AT91RM9200_ID_IRQ2	27	/* Advanced Interrupt Controller (IRQ2) */
+#define AT91RM9200_ID_IRQ3	28	/* Advanced Interrupt Controller (IRQ3) */
+#define AT91RM9200_ID_IRQ4	29	/* Advanced Interrupt Controller (IRQ4) */
+#define AT91RM9200_ID_IRQ5	30	/* Advanced Interrupt Controller (IRQ5) */
+#define AT91RM9200_ID_IRQ6	31	/* Advanced Interrupt Controller (IRQ6) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9260/peripherals.h b/include/dt-bindings/at91/at91sam9260/peripherals.h
new file mode 100644
index 0000000..d01db78
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9260/peripherals.h
@@ -0,0 +1,42 @@
+/*
+ * This header define at91sam9260 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9260_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9260_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9260_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91SAM9260_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91SAM9260_ID_PIOC	4	/* Parallel IO Controller C */
+#define AT91SAM9260_ID_ADC	5	/* Analog-to-Digital Converter */
+#define AT91SAM9260_ID_US0	6	/* USART 0 */
+#define AT91SAM9260_ID_US1	7	/* USART 1 */
+#define AT91SAM9260_ID_US2	8	/* USART 2 */
+#define AT91SAM9260_ID_MCI	9	/* Multimedia Card Interface */
+#define AT91SAM9260_ID_UDP	10	/* USB Device Port */
+#define AT91SAM9260_ID_TWI	11	/* Two-Wire Interface */
+#define AT91SAM9260_ID_SPI0	12	/* Serial Peripheral Interface 0 */
+#define AT91SAM9260_ID_SPI1	13	/* Serial Peripheral Interface 1 */
+#define AT91SAM9260_ID_SSC	14	/* Serial Synchronous Controller */
+#define AT91SAM9260_ID_TC0	17	/* Timer Counter 0 */
+#define AT91SAM9260_ID_TC1	18	/* Timer Counter 1 */
+#define AT91SAM9260_ID_TC2	19	/* Timer Counter 2 */
+#define AT91SAM9260_ID_UHP	20	/* USB Host port */
+#define AT91SAM9260_ID_EMAC	21	/* Ethernet */
+#define AT91SAM9260_ID_ISI	22	/* Image Sensor Interface */
+#define AT91SAM9260_ID_US3	23	/* USART 3 */
+#define AT91SAM9260_ID_US4	24	/* USART 4 */
+#define AT91SAM9260_ID_US5	25	/* USART 5 */
+#define AT91SAM9260_ID_TC3	26	/* Timer Counter 3 */
+#define AT91SAM9260_ID_TC4	27	/* Timer Counter 4 */
+#define AT91SAM9260_ID_TC5	28	/* Timer Counter 5 */
+#define AT91SAM9260_ID_IRQ0	29	/* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9260_ID_IRQ1	30	/* Advanced Interrupt Controller (IRQ1) */
+#define AT91SAM9260_ID_IRQ2	31	/* Advanced Interrupt Controller (IRQ2) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9261/peripherals.h b/include/dt-bindings/at91/at91sam9261/peripherals.h
new file mode 100644
index 0000000..1fa717c
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9261/peripherals.h
@@ -0,0 +1,36 @@
+/*
+ * This header define at91sam9261 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9261_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9261_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9261_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91SAM9261_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91SAM9261_ID_PIOC	4	/* Parallel IO Controller C */
+#define AT91SAM9261_ID_US0	6	/* USART 0 */
+#define AT91SAM9261_ID_US1	7	/* USART 1 */
+#define AT91SAM9261_ID_US2	8	/* USART 2 */
+#define AT91SAM9261_ID_MCI	9	/* Multimedia Card Interface */
+#define AT91SAM9261_ID_UDP	10	/* USB Device Port */
+#define AT91SAM9261_ID_TWI	11	/* Two-Wire Interface */
+#define AT91SAM9261_ID_SPI0	12	/* Serial Peripheral Interface 0 */
+#define AT91SAM9261_ID_SPI1	13	/* Serial Peripheral Interface 1 */
+#define AT91SAM9261_ID_SSC0	14	/* Serial Synchronous Controller 0 */
+#define AT91SAM9261_ID_SSC1	15	/* Serial Synchronous Controller 1 */
+#define AT91SAM9261_ID_SSC2	16	/* Serial Synchronous Controller 2 */
+#define AT91SAM9261_ID_TC0	17	/* Timer Counter 0 */
+#define AT91SAM9261_ID_TC1	18	/* Timer Counter 1 */
+#define AT91SAM9261_ID_TC2	19	/* Timer Counter 2 */
+#define AT91SAM9261_ID_UHP	20	/* USB Host port */
+#define AT91SAM9261_ID_LCDC	21	/* LDC Controller */
+#define AT91SAM9261_ID_IRQ0	29	/* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9261_ID_IRQ1	30	/* Advanced Interrupt Controller (IRQ1) */
+#define AT91SAM9261_ID_IRQ2	31	/* Advanced Interrupt Controller (IRQ2) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9263/peripherals.h b/include/dt-bindings/at91/at91sam9263/peripherals.h
new file mode 100644
index 0000000..7495e9c
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9263/peripherals.h
@@ -0,0 +1,40 @@
+/*
+ * This header define at91sam9263 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9263_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9263_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9263_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91SAM9263_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91SAM9263_ID_PIOCDE	4	/* Parallel IO Controller C, D and E */
+#define AT91SAM9263_ID_US0	7	/* USART 0 */
+#define AT91SAM9263_ID_US1	8	/* USART 1 */
+#define AT91SAM9263_ID_US2	9	/* USART 2 */
+#define AT91SAM9263_ID_MCI0	10	/* Multimedia Card Interface 0 */
+#define AT91SAM9263_ID_MCI1	11	/* Multimedia Card Interface 1 */
+#define AT91SAM9263_ID_CAN	12	/* CAN */
+#define AT91SAM9263_ID_TWI	13	/* Two-Wire Interface */
+#define AT91SAM9263_ID_SPI0	14	/* Serial Peripheral Interface 0 */
+#define AT91SAM9263_ID_SPI1	15	/* Serial Peripheral Interface 1 */
+#define AT91SAM9263_ID_SSC0	16	/* Serial Synchronous Controller 0 */
+#define AT91SAM9263_ID_SSC1	17	/* Serial Synchronous Controller 1 */
+#define AT91SAM9263_ID_AC97C	18	/* AC97 Controller */
+#define AT91SAM9263_ID_TCB	19	/* Timer Counter 0, 1 and 2 */
+#define AT91SAM9263_ID_PWMC	20	/* Pulse Width Modulation Controller */
+#define AT91SAM9263_ID_EMAC	21	/* Ethernet */
+#define AT91SAM9263_ID_2DGE	23	/* 2D Graphic Engine */
+#define AT91SAM9263_ID_UDP	24	/* USB Device Port */
+#define AT91SAM9263_ID_ISI	25	/* Image Sensor Interface */
+#define AT91SAM9263_ID_LCDC	26	/* LCD Controller */
+#define AT91SAM9263_ID_DMA	27	/* DMA Controller */
+#define AT91SAM9263_ID_UHP	29	/* USB Host port */
+#define AT91SAM9263_ID_IRQ0	30	/* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9263_ID_IRQ1	31	/* Advanced Interrupt Controller (IRQ1) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9g45/peripherals.h b/include/dt-bindings/at91/at91sam9g45/peripherals.h
new file mode 100644
index 0000000..9fc405d
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9g45/peripherals.h
@@ -0,0 +1,44 @@
+/*
+ * This header define at91sam9g45 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9G45_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9G45_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9G45_ID_PIOA	2	/* Parallel I/O Controller A */
+#define AT91SAM9G45_ID_PIOB	3	/* Parallel I/O Controller B */
+#define AT91SAM9G45_ID_PIOC	4	/* Parallel I/O Controller C */
+#define AT91SAM9G45_ID_PIODE	5	/* Parallel I/O Controller D and E */
+#define AT91SAM9G45_ID_TRNG	6	/* True Random Number Generator */
+#define AT91SAM9G45_ID_US0	7	/* USART 0 */
+#define AT91SAM9G45_ID_US1	8	/* USART 1 */
+#define AT91SAM9G45_ID_US2	9	/* USART 2 */
+#define AT91SAM9G45_ID_US3	10	/* USART 3 */
+#define AT91SAM9G45_ID_MCI0	11	/* High Speed Multimedia Card Interface 0 */
+#define AT91SAM9G45_ID_TWI0	12	/* Two-Wire Interface 0 */
+#define AT91SAM9G45_ID_TWI1	13	/* Two-Wire Interface 1 */
+#define AT91SAM9G45_ID_SPI0	14	/* Serial Peripheral Interface 0 */
+#define AT91SAM9G45_ID_SPI1	15	/* Serial Peripheral Interface 1 */
+#define AT91SAM9G45_ID_SSC0	16	/* Synchronous Serial Controller 0 */
+#define AT91SAM9G45_ID_SSC1	17	/* Synchronous Serial Controller 1 */
+#define AT91SAM9G45_ID_TCB	18	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
+#define AT91SAM9G45_ID_PWMC	19	/* Pulse Width Modulation Controller */
+#define AT91SAM9G45_ID_TSC	20	/* Touch Screen ADC Controller */
+#define AT91SAM9G45_ID_DMA	21	/* DMA Controller */
+#define AT91SAM9G45_ID_UHPHS	22	/* USB Host High Speed */
+#define AT91SAM9G45_ID_LCDC	23	/* LCD Controller */
+#define AT91SAM9G45_ID_AC97C	24	/* AC97 Controller */
+#define AT91SAM9G45_ID_EMAC	25	/* Ethernet MAC */
+#define AT91SAM9G45_ID_ISI	26	/* Image Sensor Interface */
+#define AT91SAM9G45_ID_UDPHS	27	/* USB Device High Speed */
+#define AT91SAM9G45_ID_AESTDESSHA 28	/* AES + T-DES + SHA */
+#define AT91SAM9G45_ID_MCI1	29	/* High Speed Multimedia Card Interface 1 */
+#define AT91SAM9G45_ID_VDEC	30	/* Video Decoder */
+#define AT91SAM9G45_ID_IRQ0	31	/* Advanced Interrupt Controller */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9n12/peripherals.h b/include/dt-bindings/at91/at91sam9n12/peripherals.h
new file mode 100644
index 0000000..be9e1f6
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9n12/peripherals.h
@@ -0,0 +1,41 @@
+/*
+ * This header define at91sam9n12 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9N12_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9N12_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9N12_ID_PIOAB	2	/* Parallel I/O Controller A and B */
+#define AT91SAM9N12_ID_PIOCD	3	/* Parallel I/O Controller C and D */
+#define AT91SAM9N12_ID_FUSE	4	/* FUSE Controller */
+#define AT91SAM9N12_ID_USART0	5	/* USART 0 */
+#define AT91SAM9N12_ID_USART1	6	/* USART 1 */
+#define AT91SAM9N12_ID_USART2	7	/* USART 2 */
+#define AT91SAM9N12_ID_USART3	8	/* USART 3 */
+#define AT91SAM9N12_ID_TWI0	9	/* Two-Wire Interface 0 */
+#define AT91SAM9N12_ID_TWI1	10	/* Two-Wire Interface 1 */
+#define AT91SAM9N12_ID_MCI	12	/* High Speed Multimedia Card Interface */
+#define AT91SAM9N12_ID_SPI0	13	/* Serial Peripheral Interface 0 */
+#define AT91SAM9N12_ID_SPI1	14	/* Serial Peripheral Interface 1 */
+#define AT91SAM9N12_ID_UART0	15	/* UART 0 */
+#define AT91SAM9N12_ID_UART1	16	/* UART 1 */
+#define AT91SAM9N12_ID_TCB	17	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
+#define AT91SAM9N12_ID_PWM	18	/* Pulse Width Modulation Controller */
+#define AT91SAM9N12_ID_ADC	19	/* ADC Controller */
+#define AT91SAM9N12_ID_DMA	20	/* DMA Controller */
+#define AT91SAM9N12_ID_UHP	22	/* USB Host High Speed */
+#define AT91SAM9N12_ID_UDP	23	/* USB Device High Speed */
+#define AT91SAM9N12_ID_LCDC	25	/* LCD Controller */
+#define AT91SAM9N12_ID_ISI	25	/* Image Sensor Interface */
+#define AT91SAM9N12_ID_SHA	27	/* Secure Hash Algorithm */
+#define AT91SAM9N12_ID_SSC	28	/* Synchronous Serial Controller */
+#define AT91SAM9N12_ID_AES	29	/* Advanced Encryption Standard */
+#define AT91SAM9N12_ID_TRNG	30	/* TRNG */
+#define AT91SAM9N12_ID_IRQ0	31	/* Advanced Interrupt Controller */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9rl/peripherals.h b/include/dt-bindings/at91/at91sam9rl/peripherals.h
new file mode 100644
index 0000000..6cc7279
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9rl/peripherals.h
@@ -0,0 +1,38 @@
+/*
+ * This header define at91sam9rl peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9RL_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9RL_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9RL_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91SAM9RL_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91SAM9RL_ID_PIOC	4	/* Parallel IO Controller C */
+#define AT91SAM9RL_ID_PIOD	5	/* Parallel IO Controller D */
+#define AT91SAM9RL_ID_US0	6	/* USART 0 */
+#define AT91SAM9RL_ID_US1	7	/* USART 1 */
+#define AT91SAM9RL_ID_US2	8	/* USART 2 */
+#define AT91SAM9RL_ID_US3	9	/* USART 3 */
+#define AT91SAM9RL_ID_MCI	10	/* Multimedia Card Interface */
+#define AT91SAM9RL_ID_TWI0	11	/* TWI 0 */
+#define AT91SAM9RL_ID_TWI1	12	/* TWI 1 */
+#define AT91SAM9RL_ID_SPI	13	/* Serial Peripheral Interface */
+#define AT91SAM9RL_ID_SSC0	14	/* Serial Synchronous Controller 0 */
+#define AT91SAM9RL_ID_SSC1	15	/* Serial Synchronous Controller 1 */
+#define AT91SAM9RL_ID_TC0	16	/* Timer Counter 0 */
+#define AT91SAM9RL_ID_TC1	17	/* Timer Counter 1 */
+#define AT91SAM9RL_ID_TC2	18	/* Timer Counter 2 */
+#define AT91SAM9RL_ID_PWMC	19	/* Pulse Width Modulation Controller */
+#define AT91SAM9RL_ID_TSC	20	/* Touch Screen Controller */
+#define AT91SAM9RL_ID_DMA	21	/* DMA Controller */
+#define AT91SAM9RL_ID_UDPHS	22	/* USB Device HS */
+#define AT91SAM9RL_ID_LCDC	23	/* LCD Controller */
+#define AT91SAM9RL_ID_AC97C	24	/* AC97 Controller */
+#define AT91SAM9RL_ID_IRQ0	31	/* Advanced Interrupt Controller (IRQ0) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9x5/peripherals.h b/include/dt-bindings/at91/at91sam9x5/peripherals.h
new file mode 100644
index 0000000..bf5b7b6
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9x5/peripherals.h
@@ -0,0 +1,45 @@
+/*
+ * This header define at91sam9x5 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9X5_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9X5_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9X5_ID_PIOAB	2	/* Parallel I/O Controller A and B */
+#define AT91SAM9X5_ID_PIOCD	3	/* Parallel I/O Controller C and D */
+#define AT91SAM9X5_ID_SMD	4	/* SMD Soft Modem (SMD) */
+#define AT91SAM9X5_ID_USART0	5	/* USART 0 */
+#define AT91SAM9X5_ID_USART1	6	/* USART 1 */
+#define AT91SAM9X5_ID_USART2	7	/* USART 2 */
+#define AT91SAM9X5_ID_USART3	8	/* USART 3 */
+#define AT91SAM9X5_ID_TWI0	9	/* Two-Wire Interface 0 */
+#define AT91SAM9X5_ID_TWI1	10	/* Two-Wire Interface 1 */
+#define AT91SAM9X5_ID_TWI2	11	/* Two-Wire Interface 2 */
+#define AT91SAM9X5_ID_MCI0	12	/* High Speed Multimedia Card Interface 0 */
+#define AT91SAM9X5_ID_SPI0	13	/* Serial Peripheral Interface 0 */
+#define AT91SAM9X5_ID_SPI1	14	/* Serial Peripheral Interface 1 */
+#define AT91SAM9X5_ID_UART0	15	/* UART 0 */
+#define AT91SAM9X5_ID_UART1	16	/* UART 1 */
+#define AT91SAM9X5_ID_TCB	17	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
+#define AT91SAM9X5_ID_PWM	18	/* Pulse Width Modulation Controller */
+#define AT91SAM9X5_ID_ADC	19	/* ADC Controller */
+#define AT91SAM9X5_ID_DMA0	20	/* DMA Controller 0 */
+#define AT91SAM9X5_ID_DMA1	21	/* DMA Controller 1 */
+#define AT91SAM9X5_ID_UHPHS	22	/* USB Host High Speed */
+#define AT91SAM9X5_ID_UDPHS	23	/* USB Device High Speed */
+#define AT91SAM9X5_ID_EMAC0	24	/* Ethernet MAC0 */
+#define AT91SAM9X5_ID_LCDC	25	/* LCD Controller */
+#define AT91SAM9X5_ID_ISI	25	/* Image Sensor Interface */
+#define AT91SAM9X5_ID_MCI1	26	/* High Speed Multimedia Card Interface 1 */
+#define AT91SAM9X5_ID_EMAC1	27	/* Ethernet MAC1 */
+#define AT91SAM9X5_ID_SSC	28	/* Synchronous Serial Controller */
+#define AT91SAM9X5_ID_CAN0	29	/* CAN Controller 0 */
+#define AT91SAM9X5_ID_CAN1	30	/* CAN Controller 1 */
+#define AT91SAM9X5_ID_IRQ0	31	/* Advanced Interrupt Controller */
+
+#endif
diff --git a/include/dt-bindings/at91/common/peripherals.h b/include/dt-bindings/at91/common/peripherals.h
new file mode 100644
index 0000000..ca8f1f4
--- /dev/null
+++ b/include/dt-bindings/at91/common/peripherals.h
@@ -0,0 +1,14 @@
+/*
+ * This header define at91 common peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91_PERIPH_H
+#define _DT_BINDINGS_AT91_PERIPH_H
+
+#define AT91_ID_FIQ	0	/* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS	1	/* System Peripherals */
+
+#endif
diff --git a/include/dt-bindings/at91/sama5d3/peripherals.h b/include/dt-bindings/at91/sama5d3/peripherals.h
new file mode 100644
index 0000000..9177c3f
--- /dev/null
+++ b/include/dt-bindings/at91/sama5d3/peripherals.h
@@ -0,0 +1,63 @@
+/*
+ * This header define sama5d3 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_SAMA5D3_PERIPH_H
+#define _DT_BINDINGS_SAMA5D3_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91_ID_FIQ		 0	/* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS		 1	/* System Peripherals */
+#define SAMA5D3_ID_DBGU		 2	/* debug Unit (usually no special interrupt line) */
+#define AT91_ID_PIT		 3	/* PIT */
+#define SAMA5D3_ID_WDT		 4	/* Watchdog Timer Interrupt */
+#define SAMA5D3_ID_HSMC		 5	/* Static Memory Controller */
+#define SAMA5D3_ID_PIOA		 6	/* PIOA */
+#define SAMA5D3_ID_PIOB		 7	/* PIOB */
+#define SAMA5D3_ID_PIOC		 8	/* PIOC */
+#define SAMA5D3_ID_PIOD		 9	/* PIOD */
+#define SAMA5D3_ID_PIOE		10	/* PIOE */
+#define SAMA5D3_ID_SMD		11	/* SMD Soft Modem */
+#define SAMA5D3_ID_USART0	12	/* USART0 */
+#define SAMA5D3_ID_USART1	13	/* USART1 */
+#define SAMA5D3_ID_USART2	14	/* USART2 */
+#define SAMA5D3_ID_USART3	15	/* USART3 */
+#define SAMA5D3_ID_UART0	16	/* UART 0 */
+#define SAMA5D3_ID_UART1	17	/* UART 1 */
+#define SAMA5D3_ID_TWI0		18	/* Two-Wire Interface 0 */
+#define SAMA5D3_ID_TWI1		19	/* Two-Wire Interface 1 */
+#define SAMA5D3_ID_TWI2		20	/* Two-Wire Interface 2 */
+#define SAMA5D3_ID_HSMCI0	21	/* MCI */
+#define SAMA5D3_ID_HSMCI1	22	/* MCI */
+#define SAMA5D3_ID_HSMCI2	23	/* MCI */
+#define SAMA5D3_ID_SPI0		24	/* Serial Peripheral Interface 0 */
+#define SAMA5D3_ID_SPI1		25	/* Serial Peripheral Interface 1 */
+#define SAMA5D3_ID_TC0		26	/* Timer Counter 0 */
+#define SAMA5D3_ID_TC1		27	/* Timer Counter 2 */
+#define SAMA5D3_ID_PWM		28	/* Pulse Width Modulation Controller */
+#define SAMA5D3_ID_ADC		29	/* Touch Screen ADC Controller */
+#define SAMA5D3_ID_DMA0		30	/* DMA Controller 0 */
+#define SAMA5D3_ID_DMA1		31	/* DMA Controller 1 */
+#define SAMA5D3_ID_UHPHS	32	/* USB Host High Speed */
+#define SAMA5D3_ID_UDPHS	33	/* USB Device High Speed */
+#define SAMA5D3_ID_GMAC		34	/* Gigabit Ethernet MAC */
+#define SAMA5D3_ID_EMAC		35	/* Ethernet MAC */
+#define SAMA5D3_ID_LCDC		36	/* LCD Controller */
+#define SAMA5D3_ID_ISI		37	/* Image Sensor Interface */
+#define SAMA5D3_ID_SSC0		38	/* Synchronous Serial Controller 0 */
+#define SAMA5D3_ID_SSC1		39	/* Synchronous Serial Controller 1 */
+#define SAMA5D3_ID_CAN0		40	/* CAN Controller 0 */
+#define SAMA5D3_ID_CAN1		41	/* CAN Controller 1 */
+#define SAMA5D3_ID_SHA		42	/* Secure Hash Algorithm */
+#define SAMA5D3_ID_AES		43	/* Advanced Encryption Standard */
+#define SAMA5D3_ID_TDES		44	/* Triple Data Encryption Standard */
+#define SAMA5D3_ID_TRNG		45	/* True Random Generator Number */
+#define SAMA5D3_ID_IRQ0		47	/* Advanced Interrupt Controller (IRQ0) */
+#define SAMA5D3_ID_FUSE		48	/* FUSE Controller */
+#define SAMA5D3_ID_MPDDRC	49	/* MPDDR Controller */
+
+#endif
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
@ 2013-08-01  6:52   ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:52 UTC (permalink / raw)
  To: linux-arm-kernel

This patch moves peripheral id definitions from machine specific include
dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
dir (include/dt-bindings/at91/'soc-name'/peripherals.h).

These definitions will be used inside dt to define interrupt ids and
peripheral clk ids.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/mach-at91/include/mach/at91rm9200.h       |   31 +---------
 arch/arm/mach-at91/include/mach/at91sam9260.h      |   29 +--------
 arch/arm/mach-at91/include/mach/at91sam9261.h      |   23 +------
 arch/arm/mach-at91/include/mach/at91sam9263.h      |   27 +--------
 arch/arm/mach-at91/include/mach/at91sam9g45.h      |   31 +---------
 arch/arm/mach-at91/include/mach/at91sam9n12.h      |   26 +-------
 arch/arm/mach-at91/include/mach/at91sam9rl.h       |   25 +-------
 arch/arm/mach-at91/include/mach/at91sam9x5.h       |   32 +---------
 arch/arm/mach-at91/include/mach/hardware.h         |    3 +-
 arch/arm/mach-at91/include/mach/sama5d3.h          |   48 +--------------
 include/dt-bindings/at91/at91rm9200/peripherals.h  |   44 ++++++++++++++
 include/dt-bindings/at91/at91sam9260/peripherals.h |   42 +++++++++++++
 include/dt-bindings/at91/at91sam9261/peripherals.h |   36 +++++++++++
 include/dt-bindings/at91/at91sam9263/peripherals.h |   40 +++++++++++++
 include/dt-bindings/at91/at91sam9g45/peripherals.h |   44 ++++++++++++++
 include/dt-bindings/at91/at91sam9n12/peripherals.h |   41 +++++++++++++
 include/dt-bindings/at91/at91sam9rl/peripherals.h  |   38 ++++++++++++
 include/dt-bindings/at91/at91sam9x5/peripherals.h  |   45 ++++++++++++++
 include/dt-bindings/at91/common/peripherals.h      |   14 +++++
 include/dt-bindings/at91/sama5d3/peripherals.h     |   63 ++++++++++++++++++++
 20 files changed, 417 insertions(+), 265 deletions(-)
 create mode 100644 include/dt-bindings/at91/at91rm9200/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9260/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9261/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9263/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9g45/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9n12/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9rl/peripherals.h
 create mode 100644 include/dt-bindings/at91/at91sam9x5/peripherals.h
 create mode 100644 include/dt-bindings/at91/common/peripherals.h
 create mode 100644 include/dt-bindings/at91/sama5d3/peripherals.h

diff --git a/arch/arm/mach-at91/include/mach/at91rm9200.h b/arch/arm/mach-at91/include/mach/at91rm9200.h
index e67317c..975b587 100644
--- a/arch/arm/mach-at91/include/mach/at91rm9200.h
+++ b/arch/arm/mach-at91/include/mach/at91rm9200.h
@@ -19,36 +19,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91RM9200_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91RM9200_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91RM9200_ID_PIOC	4	/* Parallel IO Controller C */
-#define AT91RM9200_ID_PIOD	5	/* Parallel IO Controller D */
-#define AT91RM9200_ID_US0	6	/* USART 0 */
-#define AT91RM9200_ID_US1	7	/* USART 1 */
-#define AT91RM9200_ID_US2	8	/* USART 2 */
-#define AT91RM9200_ID_US3	9	/* USART 3 */
-#define AT91RM9200_ID_MCI	10	/* Multimedia Card Interface */
-#define AT91RM9200_ID_UDP	11	/* USB Device Port */
-#define AT91RM9200_ID_TWI	12	/* Two-Wire Interface */
-#define AT91RM9200_ID_SPI	13	/* Serial Peripheral Interface */
-#define AT91RM9200_ID_SSC0	14	/* Serial Synchronous Controller 0 */
-#define AT91RM9200_ID_SSC1	15	/* Serial Synchronous Controller 1 */
-#define AT91RM9200_ID_SSC2	16	/* Serial Synchronous Controller 2 */
-#define AT91RM9200_ID_TC0	17	/* Timer Counter 0 */
-#define AT91RM9200_ID_TC1	18	/* Timer Counter 1 */
-#define AT91RM9200_ID_TC2	19	/* Timer Counter 2 */
-#define AT91RM9200_ID_TC3	20	/* Timer Counter 3 */
-#define AT91RM9200_ID_TC4	21	/* Timer Counter 4 */
-#define AT91RM9200_ID_TC5	22	/* Timer Counter 5 */
-#define AT91RM9200_ID_UHP	23	/* USB Host port */
-#define AT91RM9200_ID_EMAC	24	/* Ethernet MAC */
-#define AT91RM9200_ID_IRQ0	25	/* Advanced Interrupt Controller (IRQ0) */
-#define AT91RM9200_ID_IRQ1	26	/* Advanced Interrupt Controller (IRQ1) */
-#define AT91RM9200_ID_IRQ2	27	/* Advanced Interrupt Controller (IRQ2) */
-#define AT91RM9200_ID_IRQ3	28	/* Advanced Interrupt Controller (IRQ3) */
-#define AT91RM9200_ID_IRQ4	29	/* Advanced Interrupt Controller (IRQ4) */
-#define AT91RM9200_ID_IRQ5	30	/* Advanced Interrupt Controller (IRQ5) */
-#define AT91RM9200_ID_IRQ6	31	/* Advanced Interrupt Controller (IRQ6) */
+#include <dt-bindings/at91/at91rm9200/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9260.h b/arch/arm/mach-at91/include/mach/at91sam9260.h
index 416c7b6..7eb4ae0 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9260.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9260.h
@@ -20,34 +20,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9260_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91SAM9260_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91SAM9260_ID_PIOC	4	/* Parallel IO Controller C */
-#define AT91SAM9260_ID_ADC	5	/* Analog-to-Digital Converter */
-#define AT91SAM9260_ID_US0	6	/* USART 0 */
-#define AT91SAM9260_ID_US1	7	/* USART 1 */
-#define AT91SAM9260_ID_US2	8	/* USART 2 */
-#define AT91SAM9260_ID_MCI	9	/* Multimedia Card Interface */
-#define AT91SAM9260_ID_UDP	10	/* USB Device Port */
-#define AT91SAM9260_ID_TWI	11	/* Two-Wire Interface */
-#define AT91SAM9260_ID_SPI0	12	/* Serial Peripheral Interface 0 */
-#define AT91SAM9260_ID_SPI1	13	/* Serial Peripheral Interface 1 */
-#define AT91SAM9260_ID_SSC	14	/* Serial Synchronous Controller */
-#define AT91SAM9260_ID_TC0	17	/* Timer Counter 0 */
-#define AT91SAM9260_ID_TC1	18	/* Timer Counter 1 */
-#define AT91SAM9260_ID_TC2	19	/* Timer Counter 2 */
-#define AT91SAM9260_ID_UHP	20	/* USB Host port */
-#define AT91SAM9260_ID_EMAC	21	/* Ethernet */
-#define AT91SAM9260_ID_ISI	22	/* Image Sensor Interface */
-#define AT91SAM9260_ID_US3	23	/* USART 3 */
-#define AT91SAM9260_ID_US4	24	/* USART 4 */
-#define AT91SAM9260_ID_US5	25	/* USART 5 */
-#define AT91SAM9260_ID_TC3	26	/* Timer Counter 3 */
-#define AT91SAM9260_ID_TC4	27	/* Timer Counter 4 */
-#define AT91SAM9260_ID_TC5	28	/* Timer Counter 5 */
-#define AT91SAM9260_ID_IRQ0	29	/* Advanced Interrupt Controller (IRQ0) */
-#define AT91SAM9260_ID_IRQ1	30	/* Advanced Interrupt Controller (IRQ1) */
-#define AT91SAM9260_ID_IRQ2	31	/* Advanced Interrupt Controller (IRQ2) */
+#include <dt-bindings/at91/at91sam9260/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261.h b/arch/arm/mach-at91/include/mach/at91sam9261.h
index a041406..0cb62a3 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9261.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9261.h
@@ -18,28 +18,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9261_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91SAM9261_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91SAM9261_ID_PIOC	4	/* Parallel IO Controller C */
-#define AT91SAM9261_ID_US0	6	/* USART 0 */
-#define AT91SAM9261_ID_US1	7	/* USART 1 */
-#define AT91SAM9261_ID_US2	8	/* USART 2 */
-#define AT91SAM9261_ID_MCI	9	/* Multimedia Card Interface */
-#define AT91SAM9261_ID_UDP	10	/* USB Device Port */
-#define AT91SAM9261_ID_TWI	11	/* Two-Wire Interface */
-#define AT91SAM9261_ID_SPI0	12	/* Serial Peripheral Interface 0 */
-#define AT91SAM9261_ID_SPI1	13	/* Serial Peripheral Interface 1 */
-#define AT91SAM9261_ID_SSC0	14	/* Serial Synchronous Controller 0 */
-#define AT91SAM9261_ID_SSC1	15	/* Serial Synchronous Controller 1 */
-#define AT91SAM9261_ID_SSC2	16	/* Serial Synchronous Controller 2 */
-#define AT91SAM9261_ID_TC0	17	/* Timer Counter 0 */
-#define AT91SAM9261_ID_TC1	18	/* Timer Counter 1 */
-#define AT91SAM9261_ID_TC2	19	/* Timer Counter 2 */
-#define AT91SAM9261_ID_UHP	20	/* USB Host port */
-#define AT91SAM9261_ID_LCDC	21	/* LDC Controller */
-#define AT91SAM9261_ID_IRQ0	29	/* Advanced Interrupt Controller (IRQ0) */
-#define AT91SAM9261_ID_IRQ1	30	/* Advanced Interrupt Controller (IRQ1) */
-#define AT91SAM9261_ID_IRQ2	31	/* Advanced Interrupt Controller (IRQ2) */
+#include <dt-bindings/at91/at91sam9261/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9263.h b/arch/arm/mach-at91/include/mach/at91sam9263.h
index d201029..991ca66 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9263.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9263.h
@@ -18,32 +18,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9263_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91SAM9263_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91SAM9263_ID_PIOCDE	4	/* Parallel IO Controller C, D and E */
-#define AT91SAM9263_ID_US0	7	/* USART 0 */
-#define AT91SAM9263_ID_US1	8	/* USART 1 */
-#define AT91SAM9263_ID_US2	9	/* USART 2 */
-#define AT91SAM9263_ID_MCI0	10	/* Multimedia Card Interface 0 */
-#define AT91SAM9263_ID_MCI1	11	/* Multimedia Card Interface 1 */
-#define AT91SAM9263_ID_CAN	12	/* CAN */
-#define AT91SAM9263_ID_TWI	13	/* Two-Wire Interface */
-#define AT91SAM9263_ID_SPI0	14	/* Serial Peripheral Interface 0 */
-#define AT91SAM9263_ID_SPI1	15	/* Serial Peripheral Interface 1 */
-#define AT91SAM9263_ID_SSC0	16	/* Serial Synchronous Controller 0 */
-#define AT91SAM9263_ID_SSC1	17	/* Serial Synchronous Controller 1 */
-#define AT91SAM9263_ID_AC97C	18	/* AC97 Controller */
-#define AT91SAM9263_ID_TCB	19	/* Timer Counter 0, 1 and 2 */
-#define AT91SAM9263_ID_PWMC	20	/* Pulse Width Modulation Controller */
-#define AT91SAM9263_ID_EMAC	21	/* Ethernet */
-#define AT91SAM9263_ID_2DGE	23	/* 2D Graphic Engine */
-#define AT91SAM9263_ID_UDP	24	/* USB Device Port */
-#define AT91SAM9263_ID_ISI	25	/* Image Sensor Interface */
-#define AT91SAM9263_ID_LCDC	26	/* LCD Controller */
-#define AT91SAM9263_ID_DMA	27	/* DMA Controller */
-#define AT91SAM9263_ID_UHP	29	/* USB Host port */
-#define AT91SAM9263_ID_IRQ0	30	/* Advanced Interrupt Controller (IRQ0) */
-#define AT91SAM9263_ID_IRQ1	31	/* Advanced Interrupt Controller (IRQ1) */
+#include <dt-bindings/at91/at91sam9263/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45.h b/arch/arm/mach-at91/include/mach/at91sam9g45.h
index 8eba102..3f1a509 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9g45.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9g45.h
@@ -18,36 +18,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9G45_ID_PIOA	2	/* Parallel I/O Controller A */
-#define AT91SAM9G45_ID_PIOB	3	/* Parallel I/O Controller B */
-#define AT91SAM9G45_ID_PIOC	4	/* Parallel I/O Controller C */
-#define AT91SAM9G45_ID_PIODE	5	/* Parallel I/O Controller D and E */
-#define AT91SAM9G45_ID_TRNG	6	/* True Random Number Generator */
-#define AT91SAM9G45_ID_US0	7	/* USART 0 */
-#define AT91SAM9G45_ID_US1	8	/* USART 1 */
-#define AT91SAM9G45_ID_US2	9	/* USART 2 */
-#define AT91SAM9G45_ID_US3	10	/* USART 3 */
-#define AT91SAM9G45_ID_MCI0	11	/* High Speed Multimedia Card Interface 0 */
-#define AT91SAM9G45_ID_TWI0	12	/* Two-Wire Interface 0 */
-#define AT91SAM9G45_ID_TWI1	13	/* Two-Wire Interface 1 */
-#define AT91SAM9G45_ID_SPI0	14	/* Serial Peripheral Interface 0 */
-#define AT91SAM9G45_ID_SPI1	15	/* Serial Peripheral Interface 1 */
-#define AT91SAM9G45_ID_SSC0	16	/* Synchronous Serial Controller 0 */
-#define AT91SAM9G45_ID_SSC1	17	/* Synchronous Serial Controller 1 */
-#define AT91SAM9G45_ID_TCB	18	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
-#define AT91SAM9G45_ID_PWMC	19	/* Pulse Width Modulation Controller */
-#define AT91SAM9G45_ID_TSC	20	/* Touch Screen ADC Controller */
-#define AT91SAM9G45_ID_DMA	21	/* DMA Controller */
-#define AT91SAM9G45_ID_UHPHS	22	/* USB Host High Speed */
-#define AT91SAM9G45_ID_LCDC	23	/* LCD Controller */
-#define AT91SAM9G45_ID_AC97C	24	/* AC97 Controller */
-#define AT91SAM9G45_ID_EMAC	25	/* Ethernet MAC */
-#define AT91SAM9G45_ID_ISI	26	/* Image Sensor Interface */
-#define AT91SAM9G45_ID_UDPHS	27	/* USB Device High Speed */
-#define AT91SAM9G45_ID_AESTDESSHA 28	/* AES + T-DES + SHA */
-#define AT91SAM9G45_ID_MCI1	29	/* High Speed Multimedia Card Interface 1 */
-#define AT91SAM9G45_ID_VDEC	30	/* Video Decoder */
-#define AT91SAM9G45_ID_IRQ0	31	/* Advanced Interrupt Controller */
+#include <dt-bindings/at91/at91sam9263/peripherals.h>
 
 /*
  * User Peripheral physical base addresses.
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12.h b/arch/arm/mach-at91/include/mach/at91sam9n12.h
index d374b87..a78f203 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9n12.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9n12.h
@@ -14,31 +14,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9N12_ID_PIOAB	2	/* Parallel I/O Controller A and B */
-#define AT91SAM9N12_ID_PIOCD	3	/* Parallel I/O Controller C and D */
-#define AT91SAM9N12_ID_FUSE	4	/* FUSE Controller */
-#define AT91SAM9N12_ID_USART0	5	/* USART 0 */
-#define AT91SAM9N12_ID_USART1	6	/* USART 1 */
-#define AT91SAM9N12_ID_USART2	7	/* USART 2 */
-#define AT91SAM9N12_ID_USART3	8	/* USART 3 */
-#define AT91SAM9N12_ID_TWI0	9	/* Two-Wire Interface 0 */
-#define AT91SAM9N12_ID_TWI1	10	/* Two-Wire Interface 1 */
-#define AT91SAM9N12_ID_MCI	12	/* High Speed Multimedia Card Interface */
-#define AT91SAM9N12_ID_SPI0	13	/* Serial Peripheral Interface 0 */
-#define AT91SAM9N12_ID_SPI1	14	/* Serial Peripheral Interface 1 */
-#define AT91SAM9N12_ID_UART0	15	/* UART 0 */
-#define AT91SAM9N12_ID_UART1	16	/* UART 1 */
-#define AT91SAM9N12_ID_TCB	17	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
-#define AT91SAM9N12_ID_PWM	18	/* Pulse Width Modulation Controller */
-#define AT91SAM9N12_ID_ADC	19	/* ADC Controller */
-#define AT91SAM9N12_ID_DMA	20	/* DMA Controller */
-#define AT91SAM9N12_ID_UHP	22	/* USB Host High Speed */
-#define AT91SAM9N12_ID_UDP	23	/* USB Device High Speed */
-#define AT91SAM9N12_ID_LCDC	25	/* LCD Controller */
-#define AT91SAM9N12_ID_ISI	25	/* Image Sensor Interface */
-#define AT91SAM9N12_ID_SSC	28	/* Synchronous Serial Controller */
-#define AT91SAM9N12_ID_TRNG	30	/* TRNG */
-#define AT91SAM9N12_ID_IRQ0	31	/* Advanced Interrupt Controller */
+#include <dt-bindings/at91/at91sam9n12/peripherals.h>
 
 /*
  * User Peripheral physical base addresses.
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl.h b/arch/arm/mach-at91/include/mach/at91sam9rl.h
index a15db56..efe5d60 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9rl.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9rl.h
@@ -17,30 +17,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9RL_ID_PIOA	2	/* Parallel IO Controller A */
-#define AT91SAM9RL_ID_PIOB	3	/* Parallel IO Controller B */
-#define AT91SAM9RL_ID_PIOC	4	/* Parallel IO Controller C */
-#define AT91SAM9RL_ID_PIOD	5	/* Parallel IO Controller D */
-#define AT91SAM9RL_ID_US0	6	/* USART 0 */
-#define AT91SAM9RL_ID_US1	7	/* USART 1 */
-#define AT91SAM9RL_ID_US2	8	/* USART 2 */
-#define AT91SAM9RL_ID_US3	9	/* USART 3 */
-#define AT91SAM9RL_ID_MCI	10	/* Multimedia Card Interface */
-#define AT91SAM9RL_ID_TWI0	11	/* TWI 0 */
-#define AT91SAM9RL_ID_TWI1	12	/* TWI 1 */
-#define AT91SAM9RL_ID_SPI	13	/* Serial Peripheral Interface */
-#define AT91SAM9RL_ID_SSC0	14	/* Serial Synchronous Controller 0 */
-#define AT91SAM9RL_ID_SSC1	15	/* Serial Synchronous Controller 1 */
-#define AT91SAM9RL_ID_TC0	16	/* Timer Counter 0 */
-#define AT91SAM9RL_ID_TC1	17	/* Timer Counter 1 */
-#define AT91SAM9RL_ID_TC2	18	/* Timer Counter 2 */
-#define AT91SAM9RL_ID_PWMC	19	/* Pulse Width Modulation Controller */
-#define AT91SAM9RL_ID_TSC	20	/* Touch Screen Controller */
-#define AT91SAM9RL_ID_DMA	21	/* DMA Controller */
-#define AT91SAM9RL_ID_UDPHS	22	/* USB Device HS */
-#define AT91SAM9RL_ID_LCDC	23	/* LCD Controller */
-#define AT91SAM9RL_ID_AC97C	24	/* AC97 Controller */
-#define AT91SAM9RL_ID_IRQ0	31	/* Advanced Interrupt Controller (IRQ0) */
+#include <dt-bindings/at91/at91sam9rl/peripherals.h>
 
 
 /*
diff --git a/arch/arm/mach-at91/include/mach/at91sam9x5.h b/arch/arm/mach-at91/include/mach/at91sam9x5.h
index c75ee19..7e4b029 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9x5.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9x5.h
@@ -15,37 +15,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91SAM9X5_ID_PIOAB	2	/* Parallel I/O Controller A and B */
-#define AT91SAM9X5_ID_PIOCD	3	/* Parallel I/O Controller C and D */
-#define AT91SAM9X5_ID_SMD	4	/* SMD Soft Modem (SMD) */
-#define AT91SAM9X5_ID_USART0	5	/* USART 0 */
-#define AT91SAM9X5_ID_USART1	6	/* USART 1 */
-#define AT91SAM9X5_ID_USART2	7	/* USART 2 */
-#define AT91SAM9X5_ID_USART3	8	/* USART 3 */
-#define AT91SAM9X5_ID_TWI0	9	/* Two-Wire Interface 0 */
-#define AT91SAM9X5_ID_TWI1	10	/* Two-Wire Interface 1 */
-#define AT91SAM9X5_ID_TWI2	11	/* Two-Wire Interface 2 */
-#define AT91SAM9X5_ID_MCI0	12	/* High Speed Multimedia Card Interface 0 */
-#define AT91SAM9X5_ID_SPI0	13	/* Serial Peripheral Interface 0 */
-#define AT91SAM9X5_ID_SPI1	14	/* Serial Peripheral Interface 1 */
-#define AT91SAM9X5_ID_UART0	15	/* UART 0 */
-#define AT91SAM9X5_ID_UART1	16	/* UART 1 */
-#define AT91SAM9X5_ID_TCB	17	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
-#define AT91SAM9X5_ID_PWM	18	/* Pulse Width Modulation Controller */
-#define AT91SAM9X5_ID_ADC	19	/* ADC Controller */
-#define AT91SAM9X5_ID_DMA0	20	/* DMA Controller 0 */
-#define AT91SAM9X5_ID_DMA1	21	/* DMA Controller 1 */
-#define AT91SAM9X5_ID_UHPHS	22	/* USB Host High Speed */
-#define AT91SAM9X5_ID_UDPHS	23	/* USB Device High Speed */
-#define AT91SAM9X5_ID_EMAC0	24	/* Ethernet MAC0 */
-#define AT91SAM9X5_ID_LCDC	25	/* LCD Controller */
-#define AT91SAM9X5_ID_ISI	25	/* Image Sensor Interface */
-#define AT91SAM9X5_ID_MCI1	26	/* High Speed Multimedia Card Interface 1 */
-#define AT91SAM9X5_ID_EMAC1	27	/* Ethernet MAC1 */
-#define AT91SAM9X5_ID_SSC	28	/* Synchronous Serial Controller */
-#define AT91SAM9X5_ID_CAN0	29	/* CAN Controller 0 */
-#define AT91SAM9X5_ID_CAN1	30	/* CAN Controller 1 */
-#define AT91SAM9X5_ID_IRQ0	31	/* Advanced Interrupt Controller */
+#include <dt-bindings/at91/at91sam9x5/peripherals.h>
 
 /*
  * User Peripheral physical base addresses.
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
index a832e07..588135a 100644
--- a/arch/arm/mach-at91/include/mach/hardware.h
+++ b/arch/arm/mach-at91/include/mach/hardware.h
@@ -58,8 +58,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91_ID_FIQ		0	/* Advanced Interrupt Controller (FIQ) */
-#define AT91_ID_SYS		1	/* System Peripherals */
+#include <dt-bindings/at91/common/peripherals.h>
 
 #ifdef CONFIG_MMU
 /*
diff --git a/arch/arm/mach-at91/include/mach/sama5d3.h b/arch/arm/mach-at91/include/mach/sama5d3.h
index 6dc81ee..8155be4 100644
--- a/arch/arm/mach-at91/include/mach/sama5d3.h
+++ b/arch/arm/mach-at91/include/mach/sama5d3.h
@@ -16,53 +16,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#define AT91_ID_FIQ		 0	/* Advanced Interrupt Controller (FIQ) */
-#define AT91_ID_SYS		 1	/* System Peripherals */
-#define SAMA5D3_ID_DBGU		 2	/* debug Unit (usually no special interrupt line) */
-#define AT91_ID_PIT		 3	/* PIT */
-#define SAMA5D3_ID_WDT		 4	/* Watchdog Timer Interrupt */
-#define SAMA5D3_ID_HSMC		 5	/* Static Memory Controller */
-#define SAMA5D3_ID_PIOA		 6	/* PIOA */
-#define SAMA5D3_ID_PIOB		 7	/* PIOB */
-#define SAMA5D3_ID_PIOC		 8	/* PIOC */
-#define SAMA5D3_ID_PIOD		 9	/* PIOD */
-#define SAMA5D3_ID_PIOE		10	/* PIOE */
-#define SAMA5D3_ID_SMD		11	/* SMD Soft Modem */
-#define SAMA5D3_ID_USART0	12	/* USART0 */
-#define SAMA5D3_ID_USART1	13	/* USART1 */
-#define SAMA5D3_ID_USART2	14	/* USART2 */
-#define SAMA5D3_ID_USART3	15	/* USART3 */
-#define SAMA5D3_ID_UART0	16	/* UART 0 */
-#define SAMA5D3_ID_UART1	17	/* UART 1 */
-#define SAMA5D3_ID_TWI0		18	/* Two-Wire Interface 0 */
-#define SAMA5D3_ID_TWI1		19	/* Two-Wire Interface 1 */
-#define SAMA5D3_ID_TWI2		20	/* Two-Wire Interface 2 */
-#define SAMA5D3_ID_HSMCI0	21	/* MCI */
-#define SAMA5D3_ID_HSMCI1	22	/* MCI */
-#define SAMA5D3_ID_HSMCI2	23	/* MCI */
-#define SAMA5D3_ID_SPI0		24	/* Serial Peripheral Interface 0 */
-#define SAMA5D3_ID_SPI1		25	/* Serial Peripheral Interface 1 */
-#define SAMA5D3_ID_TC0		26	/* Timer Counter 0 */
-#define SAMA5D3_ID_TC1		27	/* Timer Counter 2 */
-#define SAMA5D3_ID_PWM		28	/* Pulse Width Modulation Controller */
-#define SAMA5D3_ID_ADC		29	/* Touch Screen ADC Controller */
-#define SAMA5D3_ID_DMA0		30	/* DMA Controller 0 */
-#define SAMA5D3_ID_DMA1		31	/* DMA Controller 1 */
-#define SAMA5D3_ID_UHPHS	32	/* USB Host High Speed */
-#define SAMA5D3_ID_UDPHS	33	/* USB Device High Speed */
-#define SAMA5D3_ID_GMAC		34	/* Gigabit Ethernet MAC */
-#define SAMA5D3_ID_EMAC		35	/* Ethernet MAC */
-#define SAMA5D3_ID_LCDC		36	/* LCD Controller */
-#define SAMA5D3_ID_ISI		37	/* Image Sensor Interface */
-#define SAMA5D3_ID_SSC0		38	/* Synchronous Serial Controller 0 */
-#define SAMA5D3_ID_SSC1		39	/* Synchronous Serial Controller 1 */
-#define SAMA5D3_ID_CAN0		40	/* CAN Controller 0 */
-#define SAMA5D3_ID_CAN1		41	/* CAN Controller 1 */
-#define SAMA5D3_ID_SHA		42	/* Secure Hash Algorithm */
-#define SAMA5D3_ID_AES		43	/* Advanced Encryption Standard */
-#define SAMA5D3_ID_TDES		44	/* Triple Data Encryption Standard */
-#define SAMA5D3_ID_TRNG		45	/* True Random Generator Number */
-#define SAMA5D3_ID_IRQ0		47	/* Advanced Interrupt Controller (IRQ0) */
+#include <dt-bindings/at91/sama5d3/peripherals.h>
 
 /*
  * Internal Memory
diff --git a/include/dt-bindings/at91/at91rm9200/peripherals.h b/include/dt-bindings/at91/at91rm9200/peripherals.h
new file mode 100644
index 0000000..769bd71
--- /dev/null
+++ b/include/dt-bindings/at91/at91rm9200/peripherals.h
@@ -0,0 +1,44 @@
+/*
+ * This header define at91rm9200 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91RM9200_PERIPH_H
+#define _DT_BINDINGS_AT91RM9200_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91RM9200_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91RM9200_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91RM9200_ID_PIOC	4	/* Parallel IO Controller C */
+#define AT91RM9200_ID_PIOD	5	/* Parallel IO Controller D */
+#define AT91RM9200_ID_US0	6	/* USART 0 */
+#define AT91RM9200_ID_US1	7	/* USART 1 */
+#define AT91RM9200_ID_US2	8	/* USART 2 */
+#define AT91RM9200_ID_US3	9	/* USART 3 */
+#define AT91RM9200_ID_MCI	10	/* Multimedia Card Interface */
+#define AT91RM9200_ID_UDP	11	/* USB Device Port */
+#define AT91RM9200_ID_TWI	12	/* Two-Wire Interface */
+#define AT91RM9200_ID_SPI	13	/* Serial Peripheral Interface */
+#define AT91RM9200_ID_SSC0	14	/* Serial Synchronous Controller 0 */
+#define AT91RM9200_ID_SSC1	15	/* Serial Synchronous Controller 1 */
+#define AT91RM9200_ID_SSC2	16	/* Serial Synchronous Controller 2 */
+#define AT91RM9200_ID_TC0	17	/* Timer Counter 0 */
+#define AT91RM9200_ID_TC1	18	/* Timer Counter 1 */
+#define AT91RM9200_ID_TC2	19	/* Timer Counter 2 */
+#define AT91RM9200_ID_TC3	20	/* Timer Counter 3 */
+#define AT91RM9200_ID_TC4	21	/* Timer Counter 4 */
+#define AT91RM9200_ID_TC5	22	/* Timer Counter 5 */
+#define AT91RM9200_ID_UHP	23	/* USB Host port */
+#define AT91RM9200_ID_EMAC	24	/* Ethernet MAC */
+#define AT91RM9200_ID_IRQ0	25	/* Advanced Interrupt Controller (IRQ0) */
+#define AT91RM9200_ID_IRQ1	26	/* Advanced Interrupt Controller (IRQ1) */
+#define AT91RM9200_ID_IRQ2	27	/* Advanced Interrupt Controller (IRQ2) */
+#define AT91RM9200_ID_IRQ3	28	/* Advanced Interrupt Controller (IRQ3) */
+#define AT91RM9200_ID_IRQ4	29	/* Advanced Interrupt Controller (IRQ4) */
+#define AT91RM9200_ID_IRQ5	30	/* Advanced Interrupt Controller (IRQ5) */
+#define AT91RM9200_ID_IRQ6	31	/* Advanced Interrupt Controller (IRQ6) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9260/peripherals.h b/include/dt-bindings/at91/at91sam9260/peripherals.h
new file mode 100644
index 0000000..d01db78
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9260/peripherals.h
@@ -0,0 +1,42 @@
+/*
+ * This header define at91sam9260 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9260_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9260_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9260_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91SAM9260_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91SAM9260_ID_PIOC	4	/* Parallel IO Controller C */
+#define AT91SAM9260_ID_ADC	5	/* Analog-to-Digital Converter */
+#define AT91SAM9260_ID_US0	6	/* USART 0 */
+#define AT91SAM9260_ID_US1	7	/* USART 1 */
+#define AT91SAM9260_ID_US2	8	/* USART 2 */
+#define AT91SAM9260_ID_MCI	9	/* Multimedia Card Interface */
+#define AT91SAM9260_ID_UDP	10	/* USB Device Port */
+#define AT91SAM9260_ID_TWI	11	/* Two-Wire Interface */
+#define AT91SAM9260_ID_SPI0	12	/* Serial Peripheral Interface 0 */
+#define AT91SAM9260_ID_SPI1	13	/* Serial Peripheral Interface 1 */
+#define AT91SAM9260_ID_SSC	14	/* Serial Synchronous Controller */
+#define AT91SAM9260_ID_TC0	17	/* Timer Counter 0 */
+#define AT91SAM9260_ID_TC1	18	/* Timer Counter 1 */
+#define AT91SAM9260_ID_TC2	19	/* Timer Counter 2 */
+#define AT91SAM9260_ID_UHP	20	/* USB Host port */
+#define AT91SAM9260_ID_EMAC	21	/* Ethernet */
+#define AT91SAM9260_ID_ISI	22	/* Image Sensor Interface */
+#define AT91SAM9260_ID_US3	23	/* USART 3 */
+#define AT91SAM9260_ID_US4	24	/* USART 4 */
+#define AT91SAM9260_ID_US5	25	/* USART 5 */
+#define AT91SAM9260_ID_TC3	26	/* Timer Counter 3 */
+#define AT91SAM9260_ID_TC4	27	/* Timer Counter 4 */
+#define AT91SAM9260_ID_TC5	28	/* Timer Counter 5 */
+#define AT91SAM9260_ID_IRQ0	29	/* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9260_ID_IRQ1	30	/* Advanced Interrupt Controller (IRQ1) */
+#define AT91SAM9260_ID_IRQ2	31	/* Advanced Interrupt Controller (IRQ2) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9261/peripherals.h b/include/dt-bindings/at91/at91sam9261/peripherals.h
new file mode 100644
index 0000000..1fa717c
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9261/peripherals.h
@@ -0,0 +1,36 @@
+/*
+ * This header define at91sam9261 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9261_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9261_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9261_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91SAM9261_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91SAM9261_ID_PIOC	4	/* Parallel IO Controller C */
+#define AT91SAM9261_ID_US0	6	/* USART 0 */
+#define AT91SAM9261_ID_US1	7	/* USART 1 */
+#define AT91SAM9261_ID_US2	8	/* USART 2 */
+#define AT91SAM9261_ID_MCI	9	/* Multimedia Card Interface */
+#define AT91SAM9261_ID_UDP	10	/* USB Device Port */
+#define AT91SAM9261_ID_TWI	11	/* Two-Wire Interface */
+#define AT91SAM9261_ID_SPI0	12	/* Serial Peripheral Interface 0 */
+#define AT91SAM9261_ID_SPI1	13	/* Serial Peripheral Interface 1 */
+#define AT91SAM9261_ID_SSC0	14	/* Serial Synchronous Controller 0 */
+#define AT91SAM9261_ID_SSC1	15	/* Serial Synchronous Controller 1 */
+#define AT91SAM9261_ID_SSC2	16	/* Serial Synchronous Controller 2 */
+#define AT91SAM9261_ID_TC0	17	/* Timer Counter 0 */
+#define AT91SAM9261_ID_TC1	18	/* Timer Counter 1 */
+#define AT91SAM9261_ID_TC2	19	/* Timer Counter 2 */
+#define AT91SAM9261_ID_UHP	20	/* USB Host port */
+#define AT91SAM9261_ID_LCDC	21	/* LDC Controller */
+#define AT91SAM9261_ID_IRQ0	29	/* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9261_ID_IRQ1	30	/* Advanced Interrupt Controller (IRQ1) */
+#define AT91SAM9261_ID_IRQ2	31	/* Advanced Interrupt Controller (IRQ2) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9263/peripherals.h b/include/dt-bindings/at91/at91sam9263/peripherals.h
new file mode 100644
index 0000000..7495e9c
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9263/peripherals.h
@@ -0,0 +1,40 @@
+/*
+ * This header define at91sam9263 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9263_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9263_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9263_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91SAM9263_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91SAM9263_ID_PIOCDE	4	/* Parallel IO Controller C, D and E */
+#define AT91SAM9263_ID_US0	7	/* USART 0 */
+#define AT91SAM9263_ID_US1	8	/* USART 1 */
+#define AT91SAM9263_ID_US2	9	/* USART 2 */
+#define AT91SAM9263_ID_MCI0	10	/* Multimedia Card Interface 0 */
+#define AT91SAM9263_ID_MCI1	11	/* Multimedia Card Interface 1 */
+#define AT91SAM9263_ID_CAN	12	/* CAN */
+#define AT91SAM9263_ID_TWI	13	/* Two-Wire Interface */
+#define AT91SAM9263_ID_SPI0	14	/* Serial Peripheral Interface 0 */
+#define AT91SAM9263_ID_SPI1	15	/* Serial Peripheral Interface 1 */
+#define AT91SAM9263_ID_SSC0	16	/* Serial Synchronous Controller 0 */
+#define AT91SAM9263_ID_SSC1	17	/* Serial Synchronous Controller 1 */
+#define AT91SAM9263_ID_AC97C	18	/* AC97 Controller */
+#define AT91SAM9263_ID_TCB	19	/* Timer Counter 0, 1 and 2 */
+#define AT91SAM9263_ID_PWMC	20	/* Pulse Width Modulation Controller */
+#define AT91SAM9263_ID_EMAC	21	/* Ethernet */
+#define AT91SAM9263_ID_2DGE	23	/* 2D Graphic Engine */
+#define AT91SAM9263_ID_UDP	24	/* USB Device Port */
+#define AT91SAM9263_ID_ISI	25	/* Image Sensor Interface */
+#define AT91SAM9263_ID_LCDC	26	/* LCD Controller */
+#define AT91SAM9263_ID_DMA	27	/* DMA Controller */
+#define AT91SAM9263_ID_UHP	29	/* USB Host port */
+#define AT91SAM9263_ID_IRQ0	30	/* Advanced Interrupt Controller (IRQ0) */
+#define AT91SAM9263_ID_IRQ1	31	/* Advanced Interrupt Controller (IRQ1) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9g45/peripherals.h b/include/dt-bindings/at91/at91sam9g45/peripherals.h
new file mode 100644
index 0000000..9fc405d
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9g45/peripherals.h
@@ -0,0 +1,44 @@
+/*
+ * This header define at91sam9g45 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9G45_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9G45_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9G45_ID_PIOA	2	/* Parallel I/O Controller A */
+#define AT91SAM9G45_ID_PIOB	3	/* Parallel I/O Controller B */
+#define AT91SAM9G45_ID_PIOC	4	/* Parallel I/O Controller C */
+#define AT91SAM9G45_ID_PIODE	5	/* Parallel I/O Controller D and E */
+#define AT91SAM9G45_ID_TRNG	6	/* True Random Number Generator */
+#define AT91SAM9G45_ID_US0	7	/* USART 0 */
+#define AT91SAM9G45_ID_US1	8	/* USART 1 */
+#define AT91SAM9G45_ID_US2	9	/* USART 2 */
+#define AT91SAM9G45_ID_US3	10	/* USART 3 */
+#define AT91SAM9G45_ID_MCI0	11	/* High Speed Multimedia Card Interface 0 */
+#define AT91SAM9G45_ID_TWI0	12	/* Two-Wire Interface 0 */
+#define AT91SAM9G45_ID_TWI1	13	/* Two-Wire Interface 1 */
+#define AT91SAM9G45_ID_SPI0	14	/* Serial Peripheral Interface 0 */
+#define AT91SAM9G45_ID_SPI1	15	/* Serial Peripheral Interface 1 */
+#define AT91SAM9G45_ID_SSC0	16	/* Synchronous Serial Controller 0 */
+#define AT91SAM9G45_ID_SSC1	17	/* Synchronous Serial Controller 1 */
+#define AT91SAM9G45_ID_TCB	18	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
+#define AT91SAM9G45_ID_PWMC	19	/* Pulse Width Modulation Controller */
+#define AT91SAM9G45_ID_TSC	20	/* Touch Screen ADC Controller */
+#define AT91SAM9G45_ID_DMA	21	/* DMA Controller */
+#define AT91SAM9G45_ID_UHPHS	22	/* USB Host High Speed */
+#define AT91SAM9G45_ID_LCDC	23	/* LCD Controller */
+#define AT91SAM9G45_ID_AC97C	24	/* AC97 Controller */
+#define AT91SAM9G45_ID_EMAC	25	/* Ethernet MAC */
+#define AT91SAM9G45_ID_ISI	26	/* Image Sensor Interface */
+#define AT91SAM9G45_ID_UDPHS	27	/* USB Device High Speed */
+#define AT91SAM9G45_ID_AESTDESSHA 28	/* AES + T-DES + SHA */
+#define AT91SAM9G45_ID_MCI1	29	/* High Speed Multimedia Card Interface 1 */
+#define AT91SAM9G45_ID_VDEC	30	/* Video Decoder */
+#define AT91SAM9G45_ID_IRQ0	31	/* Advanced Interrupt Controller */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9n12/peripherals.h b/include/dt-bindings/at91/at91sam9n12/peripherals.h
new file mode 100644
index 0000000..be9e1f6
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9n12/peripherals.h
@@ -0,0 +1,41 @@
+/*
+ * This header define at91sam9n12 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9N12_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9N12_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9N12_ID_PIOAB	2	/* Parallel I/O Controller A and B */
+#define AT91SAM9N12_ID_PIOCD	3	/* Parallel I/O Controller C and D */
+#define AT91SAM9N12_ID_FUSE	4	/* FUSE Controller */
+#define AT91SAM9N12_ID_USART0	5	/* USART 0 */
+#define AT91SAM9N12_ID_USART1	6	/* USART 1 */
+#define AT91SAM9N12_ID_USART2	7	/* USART 2 */
+#define AT91SAM9N12_ID_USART3	8	/* USART 3 */
+#define AT91SAM9N12_ID_TWI0	9	/* Two-Wire Interface 0 */
+#define AT91SAM9N12_ID_TWI1	10	/* Two-Wire Interface 1 */
+#define AT91SAM9N12_ID_MCI	12	/* High Speed Multimedia Card Interface */
+#define AT91SAM9N12_ID_SPI0	13	/* Serial Peripheral Interface 0 */
+#define AT91SAM9N12_ID_SPI1	14	/* Serial Peripheral Interface 1 */
+#define AT91SAM9N12_ID_UART0	15	/* UART 0 */
+#define AT91SAM9N12_ID_UART1	16	/* UART 1 */
+#define AT91SAM9N12_ID_TCB	17	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
+#define AT91SAM9N12_ID_PWM	18	/* Pulse Width Modulation Controller */
+#define AT91SAM9N12_ID_ADC	19	/* ADC Controller */
+#define AT91SAM9N12_ID_DMA	20	/* DMA Controller */
+#define AT91SAM9N12_ID_UHP	22	/* USB Host High Speed */
+#define AT91SAM9N12_ID_UDP	23	/* USB Device High Speed */
+#define AT91SAM9N12_ID_LCDC	25	/* LCD Controller */
+#define AT91SAM9N12_ID_ISI	25	/* Image Sensor Interface */
+#define AT91SAM9N12_ID_SHA	27	/* Secure Hash Algorithm */
+#define AT91SAM9N12_ID_SSC	28	/* Synchronous Serial Controller */
+#define AT91SAM9N12_ID_AES	29	/* Advanced Encryption Standard */
+#define AT91SAM9N12_ID_TRNG	30	/* TRNG */
+#define AT91SAM9N12_ID_IRQ0	31	/* Advanced Interrupt Controller */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9rl/peripherals.h b/include/dt-bindings/at91/at91sam9rl/peripherals.h
new file mode 100644
index 0000000..6cc7279
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9rl/peripherals.h
@@ -0,0 +1,38 @@
+/*
+ * This header define at91sam9rl peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9RL_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9RL_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9RL_ID_PIOA	2	/* Parallel IO Controller A */
+#define AT91SAM9RL_ID_PIOB	3	/* Parallel IO Controller B */
+#define AT91SAM9RL_ID_PIOC	4	/* Parallel IO Controller C */
+#define AT91SAM9RL_ID_PIOD	5	/* Parallel IO Controller D */
+#define AT91SAM9RL_ID_US0	6	/* USART 0 */
+#define AT91SAM9RL_ID_US1	7	/* USART 1 */
+#define AT91SAM9RL_ID_US2	8	/* USART 2 */
+#define AT91SAM9RL_ID_US3	9	/* USART 3 */
+#define AT91SAM9RL_ID_MCI	10	/* Multimedia Card Interface */
+#define AT91SAM9RL_ID_TWI0	11	/* TWI 0 */
+#define AT91SAM9RL_ID_TWI1	12	/* TWI 1 */
+#define AT91SAM9RL_ID_SPI	13	/* Serial Peripheral Interface */
+#define AT91SAM9RL_ID_SSC0	14	/* Serial Synchronous Controller 0 */
+#define AT91SAM9RL_ID_SSC1	15	/* Serial Synchronous Controller 1 */
+#define AT91SAM9RL_ID_TC0	16	/* Timer Counter 0 */
+#define AT91SAM9RL_ID_TC1	17	/* Timer Counter 1 */
+#define AT91SAM9RL_ID_TC2	18	/* Timer Counter 2 */
+#define AT91SAM9RL_ID_PWMC	19	/* Pulse Width Modulation Controller */
+#define AT91SAM9RL_ID_TSC	20	/* Touch Screen Controller */
+#define AT91SAM9RL_ID_DMA	21	/* DMA Controller */
+#define AT91SAM9RL_ID_UDPHS	22	/* USB Device HS */
+#define AT91SAM9RL_ID_LCDC	23	/* LCD Controller */
+#define AT91SAM9RL_ID_AC97C	24	/* AC97 Controller */
+#define AT91SAM9RL_ID_IRQ0	31	/* Advanced Interrupt Controller (IRQ0) */
+
+#endif
diff --git a/include/dt-bindings/at91/at91sam9x5/peripherals.h b/include/dt-bindings/at91/at91sam9x5/peripherals.h
new file mode 100644
index 0000000..bf5b7b6
--- /dev/null
+++ b/include/dt-bindings/at91/at91sam9x5/peripherals.h
@@ -0,0 +1,45 @@
+/*
+ * This header define at91sam9x5 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91SAM9X5_PERIPH_H
+#define _DT_BINDINGS_AT91SAM9X5_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91SAM9X5_ID_PIOAB	2	/* Parallel I/O Controller A and B */
+#define AT91SAM9X5_ID_PIOCD	3	/* Parallel I/O Controller C and D */
+#define AT91SAM9X5_ID_SMD	4	/* SMD Soft Modem (SMD) */
+#define AT91SAM9X5_ID_USART0	5	/* USART 0 */
+#define AT91SAM9X5_ID_USART1	6	/* USART 1 */
+#define AT91SAM9X5_ID_USART2	7	/* USART 2 */
+#define AT91SAM9X5_ID_USART3	8	/* USART 3 */
+#define AT91SAM9X5_ID_TWI0	9	/* Two-Wire Interface 0 */
+#define AT91SAM9X5_ID_TWI1	10	/* Two-Wire Interface 1 */
+#define AT91SAM9X5_ID_TWI2	11	/* Two-Wire Interface 2 */
+#define AT91SAM9X5_ID_MCI0	12	/* High Speed Multimedia Card Interface 0 */
+#define AT91SAM9X5_ID_SPI0	13	/* Serial Peripheral Interface 0 */
+#define AT91SAM9X5_ID_SPI1	14	/* Serial Peripheral Interface 1 */
+#define AT91SAM9X5_ID_UART0	15	/* UART 0 */
+#define AT91SAM9X5_ID_UART1	16	/* UART 1 */
+#define AT91SAM9X5_ID_TCB	17	/* Timer Counter 0, 1, 2, 3, 4 and 5 */
+#define AT91SAM9X5_ID_PWM	18	/* Pulse Width Modulation Controller */
+#define AT91SAM9X5_ID_ADC	19	/* ADC Controller */
+#define AT91SAM9X5_ID_DMA0	20	/* DMA Controller 0 */
+#define AT91SAM9X5_ID_DMA1	21	/* DMA Controller 1 */
+#define AT91SAM9X5_ID_UHPHS	22	/* USB Host High Speed */
+#define AT91SAM9X5_ID_UDPHS	23	/* USB Device High Speed */
+#define AT91SAM9X5_ID_EMAC0	24	/* Ethernet MAC0 */
+#define AT91SAM9X5_ID_LCDC	25	/* LCD Controller */
+#define AT91SAM9X5_ID_ISI	25	/* Image Sensor Interface */
+#define AT91SAM9X5_ID_MCI1	26	/* High Speed Multimedia Card Interface 1 */
+#define AT91SAM9X5_ID_EMAC1	27	/* Ethernet MAC1 */
+#define AT91SAM9X5_ID_SSC	28	/* Synchronous Serial Controller */
+#define AT91SAM9X5_ID_CAN0	29	/* CAN Controller 0 */
+#define AT91SAM9X5_ID_CAN1	30	/* CAN Controller 1 */
+#define AT91SAM9X5_ID_IRQ0	31	/* Advanced Interrupt Controller */
+
+#endif
diff --git a/include/dt-bindings/at91/common/peripherals.h b/include/dt-bindings/at91/common/peripherals.h
new file mode 100644
index 0000000..ca8f1f4
--- /dev/null
+++ b/include/dt-bindings/at91/common/peripherals.h
@@ -0,0 +1,14 @@
+/*
+ * This header define at91 common peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_AT91_PERIPH_H
+#define _DT_BINDINGS_AT91_PERIPH_H
+
+#define AT91_ID_FIQ	0	/* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS	1	/* System Peripherals */
+
+#endif
diff --git a/include/dt-bindings/at91/sama5d3/peripherals.h b/include/dt-bindings/at91/sama5d3/peripherals.h
new file mode 100644
index 0000000..9177c3f
--- /dev/null
+++ b/include/dt-bindings/at91/sama5d3/peripherals.h
@@ -0,0 +1,63 @@
+/*
+ * This header define sama5d3 peripheral ids.
+ *
+ * The constants defined in this header are being used in dts
+ * and at91 machine specific code.
+ */
+
+#ifndef _DT_BINDINGS_SAMA5D3_PERIPH_H
+#define _DT_BINDINGS_SAMA5D3_PERIPH_H
+
+#include <dt-bindings/at91/common/peripherals.h>
+
+#define AT91_ID_FIQ		 0	/* Advanced Interrupt Controller (FIQ) */
+#define AT91_ID_SYS		 1	/* System Peripherals */
+#define SAMA5D3_ID_DBGU		 2	/* debug Unit (usually no special interrupt line) */
+#define AT91_ID_PIT		 3	/* PIT */
+#define SAMA5D3_ID_WDT		 4	/* Watchdog Timer Interrupt */
+#define SAMA5D3_ID_HSMC		 5	/* Static Memory Controller */
+#define SAMA5D3_ID_PIOA		 6	/* PIOA */
+#define SAMA5D3_ID_PIOB		 7	/* PIOB */
+#define SAMA5D3_ID_PIOC		 8	/* PIOC */
+#define SAMA5D3_ID_PIOD		 9	/* PIOD */
+#define SAMA5D3_ID_PIOE		10	/* PIOE */
+#define SAMA5D3_ID_SMD		11	/* SMD Soft Modem */
+#define SAMA5D3_ID_USART0	12	/* USART0 */
+#define SAMA5D3_ID_USART1	13	/* USART1 */
+#define SAMA5D3_ID_USART2	14	/* USART2 */
+#define SAMA5D3_ID_USART3	15	/* USART3 */
+#define SAMA5D3_ID_UART0	16	/* UART 0 */
+#define SAMA5D3_ID_UART1	17	/* UART 1 */
+#define SAMA5D3_ID_TWI0		18	/* Two-Wire Interface 0 */
+#define SAMA5D3_ID_TWI1		19	/* Two-Wire Interface 1 */
+#define SAMA5D3_ID_TWI2		20	/* Two-Wire Interface 2 */
+#define SAMA5D3_ID_HSMCI0	21	/* MCI */
+#define SAMA5D3_ID_HSMCI1	22	/* MCI */
+#define SAMA5D3_ID_HSMCI2	23	/* MCI */
+#define SAMA5D3_ID_SPI0		24	/* Serial Peripheral Interface 0 */
+#define SAMA5D3_ID_SPI1		25	/* Serial Peripheral Interface 1 */
+#define SAMA5D3_ID_TC0		26	/* Timer Counter 0 */
+#define SAMA5D3_ID_TC1		27	/* Timer Counter 2 */
+#define SAMA5D3_ID_PWM		28	/* Pulse Width Modulation Controller */
+#define SAMA5D3_ID_ADC		29	/* Touch Screen ADC Controller */
+#define SAMA5D3_ID_DMA0		30	/* DMA Controller 0 */
+#define SAMA5D3_ID_DMA1		31	/* DMA Controller 1 */
+#define SAMA5D3_ID_UHPHS	32	/* USB Host High Speed */
+#define SAMA5D3_ID_UDPHS	33	/* USB Device High Speed */
+#define SAMA5D3_ID_GMAC		34	/* Gigabit Ethernet MAC */
+#define SAMA5D3_ID_EMAC		35	/* Ethernet MAC */
+#define SAMA5D3_ID_LCDC		36	/* LCD Controller */
+#define SAMA5D3_ID_ISI		37	/* Image Sensor Interface */
+#define SAMA5D3_ID_SSC0		38	/* Synchronous Serial Controller 0 */
+#define SAMA5D3_ID_SSC1		39	/* Synchronous Serial Controller 1 */
+#define SAMA5D3_ID_CAN0		40	/* CAN Controller 0 */
+#define SAMA5D3_ID_CAN1		41	/* CAN Controller 1 */
+#define SAMA5D3_ID_SHA		42	/* Secure Hash Algorithm */
+#define SAMA5D3_ID_AES		43	/* Advanced Encryption Standard */
+#define SAMA5D3_ID_TDES		44	/* Triple Data Encryption Standard */
+#define SAMA5D3_ID_TRNG		45	/* True Random Generator Number */
+#define SAMA5D3_ID_IRQ0		47	/* Advanced Interrupt Controller (IRQ0) */
+#define SAMA5D3_ID_FUSE		48	/* FUSE Controller */
+#define SAMA5D3_ID_MPDDRC	49	/* MPDDR Controller */
+
+#endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 2/8] ARM: at91/dt: use periph id macros for at91rm9200 interrupt definitions
  2013-08-01  6:48 ` Boris BREZILLON
@ 2013-08-01  6:53   ` Boris BREZILLON
  -1 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:53 UTC (permalink / raw)
  To: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Joachim Eastwood,
	Lorenzo Pieralisi
  Cc: devicetree, linux-kernel, linux-arm-kernel, Boris BREZILLON

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91rm9200/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91rm9200.dtsi |   59 +++++++++++++++++++++----------------
 1 file changed, 33 insertions(+), 26 deletions(-)

diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi
index 92b9e21..25c4ab2 100644
--- a/arch/arm/boot/dts/at91rm9200.dtsi
+++ b/arch/arm/boot/dts/at91rm9200.dtsi
@@ -14,6 +14,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91rm9200/peripherals.h>
 
 / {
 	model = "Atmel AT91RM9200 family SoC";
@@ -68,7 +69,13 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <25 26 27 28 29 30 31>;
+				atmel,external-irqs = <AT91RM9200_ID_IRQ0
+						       AT91RM9200_ID_IRQ1
+						       AT91RM9200_ID_IRQ2
+						       AT91RM9200_ID_IRQ3
+						       AT91RM9200_ID_IRQ4
+						       AT91RM9200_ID_IRQ5
+						       AT91RM9200_ID_IRQ6>;
 			};
 
 			ramc0: ramc@ffffff00 {
@@ -84,29 +91,29 @@
 			st: timer@fffffd00 {
 				compatible = "atmel,at91rm9200-st";
 				reg = <0xfffffd00 0x100>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			tcb0: timer@fffa0000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffa0000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0
-					      18 IRQ_TYPE_LEVEL_HIGH 0
-					      19 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91RM9200_ID_TC0 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91RM9200_ID_TC1 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91RM9200_ID_TC2 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer@fffa4000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffa4000 0x100>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0
-					      21 IRQ_TYPE_LEVEL_HIGH 0
-					      22 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91RM9200_ID_TC3 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91RM9200_ID_TC4 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91RM9200_ID_TC5 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			i2c0: i2c@fffb8000 {
 				compatible = "atmel,at91rm9200-i2c";
 				reg = <0xfffb8000 0x4000>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91RM9200_ID_TWI IRQ_TYPE_LEVEL_HIGH 6>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_twi>;
 				#address-cells = <1>;
@@ -117,7 +124,7 @@
 			mmc0: mmc@fffb4000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfffb4000 0x4000>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91RM9200_ID_MCI IRQ_TYPE_LEVEL_HIGH 0>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -126,7 +133,7 @@
 			ssc0: ssc@fffd0000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfffd0000 0x4000>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_SSC0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disable";
@@ -135,7 +142,7 @@
 			ssc1: ssc@fffd4000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfffd4000 0x4000>;
-				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_SSC1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
 				status = "disable";
@@ -144,7 +151,7 @@
 			ssc2: ssc@fffd8000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfffd8000 0x4000>;
-				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_SSC2 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc2_tx &pinctrl_ssc2_rx>;
 				status = "disable";
@@ -153,7 +160,7 @@
 			macb0: ethernet@fffbc000 {
 				compatible = "cdns,at91rm9200-emac", "cdns,emac";
 				reg = <0xfffbc000 0x4000>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91RM9200_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				phy-mode = "rmii";
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb_rmii>;
@@ -490,7 +497,7 @@
 				pioA: gpio@fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91RM9200_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -500,7 +507,7 @@
 				pioB: gpio@fffff600 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91RM9200_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -510,7 +517,7 @@
 				pioC: gpio@fffff800 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91RM9200_ID_PIOC IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -520,7 +527,7 @@
 				pioD: gpio@fffffa00 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91RM9200_ID_PIOD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -531,7 +538,7 @@
 			dbgu: serial@fffff200 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffff200 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -540,7 +547,7 @@
 			usart0: serial@fffc0000 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffc0000 0x200>;
-				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_US0 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -551,7 +558,7 @@
 			usart1: serial@fffc4000 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffc4000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_US1 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -562,7 +569,7 @@
 			usart2: serial@fffc8000 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffc8000 0x200>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_US2 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -573,7 +580,7 @@
 			usart3: serial@fffcc000 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffcc000 0x200>;
-				interrupts = <23 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_US3 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -584,7 +591,7 @@
 			usb1: gadget@fffb0000 {
 				compatible = "atmel,at91rm9200-udc";
 				reg = <0xfffb0000 0x4000>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 2>;
+				interrupts = <AT91RM9200_ID_UDP IRQ_TYPE_LEVEL_HIGH 2>;
 				status = "disabled";
 			};
 
@@ -593,7 +600,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffe0000 0x200>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91RM9200_ID_SPI IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi0>;
 				status = "disabled";
@@ -620,7 +627,7 @@
 		usb0: ohci@00300000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00300000 0x100000>;
-			interrupts = <23 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91RM9200_ID_UHP IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 2/8] ARM: at91/dt: use periph id macros for at91rm9200 interrupt definitions
@ 2013-08-01  6:53   ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:53 UTC (permalink / raw)
  To: linux-arm-kernel

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91rm9200/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91rm9200.dtsi |   59 +++++++++++++++++++++----------------
 1 file changed, 33 insertions(+), 26 deletions(-)

diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi
index 92b9e21..25c4ab2 100644
--- a/arch/arm/boot/dts/at91rm9200.dtsi
+++ b/arch/arm/boot/dts/at91rm9200.dtsi
@@ -14,6 +14,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91rm9200/peripherals.h>
 
 / {
 	model = "Atmel AT91RM9200 family SoC";
@@ -68,7 +69,13 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <25 26 27 28 29 30 31>;
+				atmel,external-irqs = <AT91RM9200_ID_IRQ0
+						       AT91RM9200_ID_IRQ1
+						       AT91RM9200_ID_IRQ2
+						       AT91RM9200_ID_IRQ3
+						       AT91RM9200_ID_IRQ4
+						       AT91RM9200_ID_IRQ5
+						       AT91RM9200_ID_IRQ6>;
 			};
 
 			ramc0: ramc at ffffff00 {
@@ -84,29 +91,29 @@
 			st: timer at fffffd00 {
 				compatible = "atmel,at91rm9200-st";
 				reg = <0xfffffd00 0x100>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			tcb0: timer at fffa0000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffa0000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0
-					      18 IRQ_TYPE_LEVEL_HIGH 0
-					      19 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91RM9200_ID_TC0 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91RM9200_ID_TC1 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91RM9200_ID_TC2 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer at fffa4000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffa4000 0x100>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0
-					      21 IRQ_TYPE_LEVEL_HIGH 0
-					      22 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91RM9200_ID_TC3 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91RM9200_ID_TC4 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91RM9200_ID_TC5 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			i2c0: i2c at fffb8000 {
 				compatible = "atmel,at91rm9200-i2c";
 				reg = <0xfffb8000 0x4000>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91RM9200_ID_TWI IRQ_TYPE_LEVEL_HIGH 6>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_twi>;
 				#address-cells = <1>;
@@ -117,7 +124,7 @@
 			mmc0: mmc at fffb4000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfffb4000 0x4000>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91RM9200_ID_MCI IRQ_TYPE_LEVEL_HIGH 0>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -126,7 +133,7 @@
 			ssc0: ssc at fffd0000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfffd0000 0x4000>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_SSC0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disable";
@@ -135,7 +142,7 @@
 			ssc1: ssc at fffd4000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfffd4000 0x4000>;
-				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_SSC1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
 				status = "disable";
@@ -144,7 +151,7 @@
 			ssc2: ssc at fffd8000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfffd8000 0x4000>;
-				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_SSC2 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc2_tx &pinctrl_ssc2_rx>;
 				status = "disable";
@@ -153,7 +160,7 @@
 			macb0: ethernet at fffbc000 {
 				compatible = "cdns,at91rm9200-emac", "cdns,emac";
 				reg = <0xfffbc000 0x4000>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91RM9200_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				phy-mode = "rmii";
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb_rmii>;
@@ -490,7 +497,7 @@
 				pioA: gpio at fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91RM9200_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -500,7 +507,7 @@
 				pioB: gpio at fffff600 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91RM9200_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -510,7 +517,7 @@
 				pioC: gpio at fffff800 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91RM9200_ID_PIOC IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -520,7 +527,7 @@
 				pioD: gpio at fffffa00 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91RM9200_ID_PIOD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -531,7 +538,7 @@
 			dbgu: serial at fffff200 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffff200 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -540,7 +547,7 @@
 			usart0: serial at fffc0000 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffc0000 0x200>;
-				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_US0 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -551,7 +558,7 @@
 			usart1: serial at fffc4000 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffc4000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_US1 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -562,7 +569,7 @@
 			usart2: serial at fffc8000 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffc8000 0x200>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_US2 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -573,7 +580,7 @@
 			usart3: serial at fffcc000 {
 				compatible = "atmel,at91rm9200-usart";
 				reg = <0xfffcc000 0x200>;
-				interrupts = <23 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91RM9200_ID_US3 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -584,7 +591,7 @@
 			usb1: gadget at fffb0000 {
 				compatible = "atmel,at91rm9200-udc";
 				reg = <0xfffb0000 0x4000>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 2>;
+				interrupts = <AT91RM9200_ID_UDP IRQ_TYPE_LEVEL_HIGH 2>;
 				status = "disabled";
 			};
 
@@ -593,7 +600,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffe0000 0x200>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91RM9200_ID_SPI IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi0>;
 				status = "disabled";
@@ -620,7 +627,7 @@
 		usb0: ohci at 00300000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00300000 0x100000>;
-			interrupts = <23 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91RM9200_ID_UHP IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 3/8] ARM: at91/dt: use periph id macros for at91sam9260 interrupt definitions
  2013-08-01  6:48 ` Boris BREZILLON
@ 2013-08-01  6:54   ` Boris BREZILLON
  -1 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:54 UTC (permalink / raw)
  To: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King
  Cc: devicetree, linux-kernel, linux-arm-kernel, Boris BREZILLON

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9260/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9260.dtsi |   57 +++++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index c7ccbcb..75fd07b 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -12,6 +12,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9260/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9260 family SoC";
@@ -65,7 +66,9 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <29 30 31>;
+				atmel,external-irqs = <AT91SAM9260_ID_IRQ0
+						       AT91SAM9260_ID_IRQ1
+						       AT91SAM9260_ID_IRQ2>;
 			};
 
 			ramc0: ramc@ffffea00 {
@@ -91,23 +94,23 @@
 			pit: timer@fffffd30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffd30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			tcb0: timer@fffa0000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffa0000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0
-					      18 IRQ_TYPE_LEVEL_HIGH 0
-					      19 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9260_ID_TC0 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91SAM9260_ID_TC1 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91SAM9260_ID_TC2 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer@fffdc000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffdc000 0x100>;
-				interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0
-					      27 IRQ_TYPE_LEVEL_HIGH 0
-					      28 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9260_ID_TC3 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91SAM9260_ID_TC4 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91SAM9260_ID_TC5 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			pinctrl@fffff400 {
@@ -438,7 +441,7 @@
 				pioA: gpio@fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9260_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -448,7 +451,7 @@
 				pioB: gpio@fffff600 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9260_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -458,7 +461,7 @@
 				pioC: gpio@fffff800 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9260_ID_PIOC IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -469,7 +472,7 @@
 			dbgu: serial@fffff200 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffff200 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -478,7 +481,7 @@
 			usart0: serial@fffb0000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffb0000 0x200>;
-				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US0 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -489,7 +492,7 @@
 			usart1: serial@fffb4000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffb4000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US1 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -500,7 +503,7 @@
 			usart2: serial@fffb8000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffb8000 0x200>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US2 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -511,7 +514,7 @@
 			usart3: serial@fffd0000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffd0000 0x200>;
-				interrupts = <23 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US3 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -522,7 +525,7 @@
 			uart0: serial@fffd4000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffd4000 0x200>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US4 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -533,7 +536,7 @@
 			uart1: serial@fffd8000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffd8000 0x200>;
-				interrupts = <25 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US5 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -544,7 +547,7 @@
 			macb0: ethernet@fffc4000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xfffc4000 0x100>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9260_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb_rmii>;
 				status = "disabled";
@@ -553,14 +556,14 @@
 			usb1: gadget@fffa4000 {
 				compatible = "atmel,at91rm9200-udc";
 				reg = <0xfffa4000 0x4000>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 2>;
+				interrupts = <AT91SAM9260_ID_UDP IRQ_TYPE_LEVEL_HIGH 2>;
 				status = "disabled";
 			};
 
 			i2c0: i2c@fffac000 {
 				compatible = "atmel,at91sam9260-i2c";
 				reg = <0xfffac000 0x100>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9260_ID_TWI IRQ_TYPE_LEVEL_HIGH 6>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -569,7 +572,7 @@
 			mmc0: mmc@fffa8000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfffa8000 0x600>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9260_ID_MCI IRQ_TYPE_LEVEL_HIGH 0>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -578,7 +581,7 @@
 			ssc0: ssc@fffbc000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfffbc000 0x4000>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_SSC IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -589,7 +592,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffc8000 0x200>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9260_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi0>;
 				status = "disabled";
@@ -600,7 +603,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffcc000 0x200>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9260_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi1>;
 				status = "disabled";
@@ -609,7 +612,7 @@
 			adc0: adc@fffe0000 {
 				compatible = "atmel,at91sam9260-adc";
 				reg = <0xfffe0000 0x100>;
-				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9260_ID_ADC IRQ_TYPE_LEVEL_HIGH 0>;
 				atmel,adc-use-external-triggers;
 				atmel,adc-channels-used = <0xf>;
 				atmel,adc-vref = <3300>;
@@ -672,7 +675,7 @@
 		usb0: ohci@00500000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00500000 0x100000>;
-			interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9260_ID_UHP IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 3/8] ARM: at91/dt: use periph id macros for at91sam9260 interrupt definitions
@ 2013-08-01  6:54   ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:54 UTC (permalink / raw)
  To: linux-arm-kernel

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9260/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9260.dtsi |   57 +++++++++++++++++++-----------------
 1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index c7ccbcb..75fd07b 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -12,6 +12,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9260/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9260 family SoC";
@@ -65,7 +66,9 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <29 30 31>;
+				atmel,external-irqs = <AT91SAM9260_ID_IRQ0
+						       AT91SAM9260_ID_IRQ1
+						       AT91SAM9260_ID_IRQ2>;
 			};
 
 			ramc0: ramc at ffffea00 {
@@ -91,23 +94,23 @@
 			pit: timer at fffffd30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffd30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			tcb0: timer at fffa0000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffa0000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0
-					      18 IRQ_TYPE_LEVEL_HIGH 0
-					      19 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9260_ID_TC0 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91SAM9260_ID_TC1 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91SAM9260_ID_TC2 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer at fffdc000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffdc000 0x100>;
-				interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0
-					      27 IRQ_TYPE_LEVEL_HIGH 0
-					      28 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9260_ID_TC3 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91SAM9260_ID_TC4 IRQ_TYPE_LEVEL_HIGH 0
+					      AT91SAM9260_ID_TC5 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			pinctrl at fffff400 {
@@ -438,7 +441,7 @@
 				pioA: gpio at fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9260_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -448,7 +451,7 @@
 				pioB: gpio at fffff600 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9260_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -458,7 +461,7 @@
 				pioC: gpio at fffff800 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9260_ID_PIOC IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -469,7 +472,7 @@
 			dbgu: serial at fffff200 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffff200 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -478,7 +481,7 @@
 			usart0: serial at fffb0000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffb0000 0x200>;
-				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US0 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -489,7 +492,7 @@
 			usart1: serial at fffb4000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffb4000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US1 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -500,7 +503,7 @@
 			usart2: serial at fffb8000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffb8000 0x200>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US2 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -511,7 +514,7 @@
 			usart3: serial at fffd0000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffd0000 0x200>;
-				interrupts = <23 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US3 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -522,7 +525,7 @@
 			uart0: serial at fffd4000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffd4000 0x200>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US4 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -533,7 +536,7 @@
 			uart1: serial at fffd8000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffd8000 0x200>;
-				interrupts = <25 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_US5 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -544,7 +547,7 @@
 			macb0: ethernet at fffc4000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xfffc4000 0x100>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9260_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb_rmii>;
 				status = "disabled";
@@ -553,14 +556,14 @@
 			usb1: gadget at fffa4000 {
 				compatible = "atmel,at91rm9200-udc";
 				reg = <0xfffa4000 0x4000>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 2>;
+				interrupts = <AT91SAM9260_ID_UDP IRQ_TYPE_LEVEL_HIGH 2>;
 				status = "disabled";
 			};
 
 			i2c0: i2c at fffac000 {
 				compatible = "atmel,at91sam9260-i2c";
 				reg = <0xfffac000 0x100>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9260_ID_TWI IRQ_TYPE_LEVEL_HIGH 6>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -569,7 +572,7 @@
 			mmc0: mmc at fffa8000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfffa8000 0x600>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9260_ID_MCI IRQ_TYPE_LEVEL_HIGH 0>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -578,7 +581,7 @@
 			ssc0: ssc at fffbc000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfffbc000 0x4000>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9260_ID_SSC IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -589,7 +592,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffc8000 0x200>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9260_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi0>;
 				status = "disabled";
@@ -600,7 +603,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffcc000 0x200>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9260_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi1>;
 				status = "disabled";
@@ -609,7 +612,7 @@
 			adc0: adc at fffe0000 {
 				compatible = "atmel,at91sam9260-adc";
 				reg = <0xfffe0000 0x100>;
-				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9260_ID_ADC IRQ_TYPE_LEVEL_HIGH 0>;
 				atmel,adc-use-external-triggers;
 				atmel,adc-channels-used = <0xf>;
 				atmel,adc-vref = <3300>;
@@ -672,7 +675,7 @@
 		usb0: ohci at 00500000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00500000 0x100000>;
-			interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9260_ID_UHP IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 4/8] ARM: at91/dt: use periph id macros for at91sam9263 interrupt definitions
  2013-08-01  6:48 ` Boris BREZILLON
@ 2013-08-01  6:55   ` Boris BREZILLON
  -1 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:55 UTC (permalink / raw)
  To: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Bo Shen
  Cc: devicetree, linux-kernel, linux-arm-kernel, Boris BREZILLON

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9263/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9263.dtsi |   46 +++++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index d5bd65f..590fd7b 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -10,6 +10,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9263/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9263 family SoC";
@@ -62,7 +63,8 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <30 31>;
+				atmel,external-irqs = <AT91SAM9263_ID_IRQ0
+						       AT91SAM9263_ID_IRQ1>;
 			};
 
 			pmc: pmc@fffffc00 {
@@ -79,13 +81,13 @@
 			pit: timer@fffffd30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffd30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			tcb0: timer@fff7c000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfff7c000 0x100>;
-				interrupts = <19 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9263_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			rstc@fffffd00 {
@@ -369,7 +371,7 @@
 				pioA: gpio@fffff200 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff200 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -379,7 +381,7 @@
 				pioB: gpio@fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -389,7 +391,7 @@
 				pioC: gpio@fffff600 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOCDE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -399,7 +401,7 @@
 				pioD: gpio@fffff800 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOCDE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -409,7 +411,7 @@
 				pioE: gpio@fffffa00 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOCDE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -420,7 +422,7 @@
 			dbgu: serial@ffffee00 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xffffee00 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -429,7 +431,7 @@
 			usart0: serial@fff8c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff8c000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_US0 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -440,7 +442,7 @@
 			usart1: serial@fff90000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff90000 0x200>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_US1 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -451,7 +453,7 @@
 			usart2: serial@fff94000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff94000 0x200>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_US2 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -462,7 +464,7 @@
 			ssc0: ssc@fff98000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfff98000 0x4000>;
-				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_SSC0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -471,7 +473,7 @@
 			ssc1: ssc@fff9c000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfff9c000 0x4000>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_SSC1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
 				status = "disabled";
@@ -480,7 +482,7 @@
 			macb0: ethernet@fffbc000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xfffbc000 0x100>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9263_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb_rmii>;
 				status = "disabled";
@@ -489,14 +491,14 @@
 			usb1: gadget@fff78000 {
 				compatible = "atmel,at91rm9200-udc";
 				reg = <0xfff78000 0x4000>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 2>;
+				interrupts = <AT91SAM9263_ID_UDP IRQ_TYPE_LEVEL_HIGH 2>;
 				status = "disabled";
 			};
 
 			i2c0: i2c@fff88000 {
 				compatible = "atmel,at91sam9263-i2c";
 				reg = <0xfff88000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9263_ID_TWI IRQ_TYPE_LEVEL_HIGH 6>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -505,7 +507,7 @@
 			mmc0: mmc@fff80000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfff80000 0x600>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9263_ID_MCI0 IRQ_TYPE_LEVEL_HIGH 0>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -514,7 +516,7 @@
 			mmc1: mmc@fff84000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfff84000 0x600>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9263_ID_MCI1 IRQ_TYPE_LEVEL_HIGH 0>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -531,7 +533,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffa4000 0x200>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9263_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi0>;
 				status = "disabled";
@@ -542,7 +544,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffa8000 0x200>;
-				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9263_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi1>;
 				status = "disabled";
@@ -570,7 +572,7 @@
 		usb0: ohci@00a00000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00a00000 0x100000>;
-			interrupts = <29 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9263_ID_UHP IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 4/8] ARM: at91/dt: use periph id macros for at91sam9263 interrupt definitions
@ 2013-08-01  6:55   ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:55 UTC (permalink / raw)
  To: linux-arm-kernel

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9263/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9263.dtsi |   46 +++++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index d5bd65f..590fd7b 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -10,6 +10,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9263/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9263 family SoC";
@@ -62,7 +63,8 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <30 31>;
+				atmel,external-irqs = <AT91SAM9263_ID_IRQ0
+						       AT91SAM9263_ID_IRQ1>;
 			};
 
 			pmc: pmc at fffffc00 {
@@ -79,13 +81,13 @@
 			pit: timer at fffffd30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffd30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			tcb0: timer at fff7c000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfff7c000 0x100>;
-				interrupts = <19 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9263_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			rstc at fffffd00 {
@@ -369,7 +371,7 @@
 				pioA: gpio at fffff200 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff200 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -379,7 +381,7 @@
 				pioB: gpio at fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -389,7 +391,7 @@
 				pioC: gpio at fffff600 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOCDE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -399,7 +401,7 @@
 				pioD: gpio at fffff800 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOCDE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -409,7 +411,7 @@
 				pioE: gpio at fffffa00 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9263_ID_PIOCDE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -420,7 +422,7 @@
 			dbgu: serial at ffffee00 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xffffee00 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -429,7 +431,7 @@
 			usart0: serial at fff8c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff8c000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_US0 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -440,7 +442,7 @@
 			usart1: serial at fff90000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff90000 0x200>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_US1 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -451,7 +453,7 @@
 			usart2: serial at fff94000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff94000 0x200>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_US2 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -462,7 +464,7 @@
 			ssc0: ssc at fff98000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfff98000 0x4000>;
-				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_SSC0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -471,7 +473,7 @@
 			ssc1: ssc at fff9c000 {
 				compatible = "atmel,at91rm9200-ssc";
 				reg = <0xfff9c000 0x4000>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9263_ID_SSC1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
 				status = "disabled";
@@ -480,7 +482,7 @@
 			macb0: ethernet at fffbc000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xfffbc000 0x100>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9263_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb_rmii>;
 				status = "disabled";
@@ -489,14 +491,14 @@
 			usb1: gadget at fff78000 {
 				compatible = "atmel,at91rm9200-udc";
 				reg = <0xfff78000 0x4000>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 2>;
+				interrupts = <AT91SAM9263_ID_UDP IRQ_TYPE_LEVEL_HIGH 2>;
 				status = "disabled";
 			};
 
 			i2c0: i2c at fff88000 {
 				compatible = "atmel,at91sam9263-i2c";
 				reg = <0xfff88000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9263_ID_TWI IRQ_TYPE_LEVEL_HIGH 6>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -505,7 +507,7 @@
 			mmc0: mmc at fff80000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfff80000 0x600>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9263_ID_MCI0 IRQ_TYPE_LEVEL_HIGH 0>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -514,7 +516,7 @@
 			mmc1: mmc at fff84000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfff84000 0x600>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9263_ID_MCI1 IRQ_TYPE_LEVEL_HIGH 0>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -531,7 +533,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffa4000 0x200>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9263_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi0>;
 				status = "disabled";
@@ -542,7 +544,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffa8000 0x200>;
-				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9263_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi1>;
 				status = "disabled";
@@ -570,7 +572,7 @@
 		usb0: ohci at 00a00000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00a00000 0x100000>;
-			interrupts = <29 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9263_ID_UHP IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 5/8] ARM: at91/dt: use periph id macros for at91sam9g45 interrupt definitions
  2013-08-01  6:48 ` Boris BREZILLON
@ 2013-08-01  6:57   ` Boris BREZILLON
  -1 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:57 UTC (permalink / raw)
  To: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Andrew Victor, Bo Shen
  Cc: devicetree, linux-kernel, linux-arm-kernel, Boris BREZILLON

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9g45/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9g45.dtsi            |   57 +++++++++++++------------
 arch/arm/mach-at91/include/mach/at91sam9g45.h |    2 +-
 2 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index c3e5148..c709780 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -14,6 +14,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9g45/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9G45 family SoC";
@@ -69,7 +70,7 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <31>;
+				atmel,external-irqs = <AT91SAM9G45_ID_IRQ0>;
 			};
 
 			ramc0: ramc@ffffe400 {
@@ -91,7 +92,7 @@
 			pit: timer@fffffd30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffd30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 
@@ -103,19 +104,19 @@
 			tcb0: timer@fff7c000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfff7c000 0x100>;
-				interrupts = <18 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer@fffd4000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffd4000 0x100>;
-				interrupts = <18 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			dma: dma-controller@ffffec00 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffec00 0x200>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_DMA IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
@@ -428,7 +429,7 @@
 				pioA: gpio@fffff200 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff200 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -438,7 +439,7 @@
 				pioB: gpio@fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -448,7 +449,7 @@
 				pioC: gpio@fffff600 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIOC IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -458,7 +459,7 @@
 				pioD: gpio@fffff800 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIODE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -468,7 +469,7 @@
 				pioE: gpio@fffffa00 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIODE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -479,7 +480,7 @@
 			dbgu: serial@ffffee00 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xffffee00 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -488,7 +489,7 @@
 			usart0: serial@fff8c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff8c000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_US0 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -499,7 +500,7 @@
 			usart1: serial@fff90000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff90000 0x200>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_US1 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -510,7 +511,7 @@
 			usart2: serial@fff94000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff94000 0x200>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_US2 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -521,7 +522,7 @@
 			usart3: serial@fff98000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff98000 0x200>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_US3 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -532,7 +533,7 @@
 			macb0: ethernet@fffbc000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xfffbc000 0x100>;
-				interrupts = <25 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9G45_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb_rmii>;
 				status = "disabled";
@@ -541,7 +542,7 @@
 			i2c0: i2c@fff84000 {
 				compatible = "atmel,at91sam9g10-i2c";
 				reg = <0xfff84000 0x100>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9G45_ID_TWI0 IRQ_TYPE_LEVEL_HIGH 6>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -550,7 +551,7 @@
 			i2c1: i2c@fff88000 {
 				compatible = "atmel,at91sam9g10-i2c";
 				reg = <0xfff88000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9G45_ID_TWI1 IRQ_TYPE_LEVEL_HIGH 6>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -559,7 +560,7 @@
 			ssc0: ssc@fff9c000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xfff9c000 0x4000>;
-				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_SSC0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -568,7 +569,7 @@
 			ssc1: ssc@fffa0000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xfffa0000 0x4000>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_SSC1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
 				status = "disabled";
@@ -577,7 +578,7 @@
 			adc0: adc@fffb0000 {
 				compatible = "atmel,at91sam9260-adc";
 				reg = <0xfffb0000 0x100>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_TSC IRQ_TYPE_LEVEL_HIGH 0>;
 				atmel,adc-use-external-triggers;
 				atmel,adc-channels-used = <0xff>;
 				atmel,adc-vref = <3300>;
@@ -617,7 +618,7 @@
 			mmc0: mmc@fff80000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfff80000 0x600>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_MCI0 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -628,7 +629,7 @@
 			mmc1: mmc@fffd0000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfffd0000 0x600>;
-				interrupts = <29 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_MCI1 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(13)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -647,7 +648,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffa4000 0x200>;
-				interrupts = <14 4 3>;
+				interrupts = <AT91SAM9G45_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi0>;
 				status = "disabled";
@@ -658,7 +659,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffa8000 0x200>;
-				interrupts = <15 4 3>;
+				interrupts = <AT91SAM9G45_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi1>;
 				status = "disabled";
@@ -670,7 +671,7 @@
 				compatible = "atmel,at91sam9rl-udc";
 				reg = <0x00600000 0x80000
 				       0xfff78000 0x400>;
-				interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_UDPHS IRQ_TYPE_LEVEL_HIGH 0>;
 				status = "disabled";
 
 				ep0 {
@@ -748,14 +749,14 @@
 		usb0: ohci@00700000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00700000 0x100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9G45_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 
 		usb1: ehci@00800000 {
 			compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 			reg = <0x00800000 0x100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9G45_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45.h b/arch/arm/mach-at91/include/mach/at91sam9g45.h
index 3f1a509..361fbc3 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9g45.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9g45.h
@@ -18,7 +18,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#include <dt-bindings/at91/at91sam9263/peripherals.h>
+#include <dt-bindings/at91/at91sam9g45/peripherals.h>
 
 /*
  * User Peripheral physical base addresses.
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 5/8] ARM: at91/dt: use periph id macros for at91sam9g45 interrupt definitions
@ 2013-08-01  6:57   ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:57 UTC (permalink / raw)
  To: linux-arm-kernel

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9g45/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9g45.dtsi            |   57 +++++++++++++------------
 arch/arm/mach-at91/include/mach/at91sam9g45.h |    2 +-
 2 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index c3e5148..c709780 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -14,6 +14,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9g45/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9G45 family SoC";
@@ -69,7 +70,7 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <31>;
+				atmel,external-irqs = <AT91SAM9G45_ID_IRQ0>;
 			};
 
 			ramc0: ramc at ffffe400 {
@@ -91,7 +92,7 @@
 			pit: timer at fffffd30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffd30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 
@@ -103,19 +104,19 @@
 			tcb0: timer at fff7c000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfff7c000 0x100>;
-				interrupts = <18 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer at fffd4000 {
 				compatible = "atmel,at91rm9200-tcb";
 				reg = <0xfffd4000 0x100>;
-				interrupts = <18 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			dma: dma-controller at ffffec00 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffec00 0x200>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_DMA IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
@@ -428,7 +429,7 @@
 				pioA: gpio at fffff200 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff200 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -438,7 +439,7 @@
 				pioB: gpio at fffff400 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -448,7 +449,7 @@
 				pioC: gpio at fffff600 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIOC IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -458,7 +459,7 @@
 				pioD: gpio at fffff800 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIODE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -468,7 +469,7 @@
 				pioE: gpio at fffffa00 {
 					compatible = "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9G45_ID_PIODE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -479,7 +480,7 @@
 			dbgu: serial at ffffee00 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xffffee00 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -488,7 +489,7 @@
 			usart0: serial at fff8c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff8c000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_US0 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -499,7 +500,7 @@
 			usart1: serial at fff90000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff90000 0x200>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_US1 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -510,7 +511,7 @@
 			usart2: serial at fff94000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff94000 0x200>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_US2 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -521,7 +522,7 @@
 			usart3: serial at fff98000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfff98000 0x200>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_US3 IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,use-dma-rx;
 				atmel,use-dma-tx;
 				pinctrl-names = "default";
@@ -532,7 +533,7 @@
 			macb0: ethernet at fffbc000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xfffbc000 0x100>;
-				interrupts = <25 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9G45_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb_rmii>;
 				status = "disabled";
@@ -541,7 +542,7 @@
 			i2c0: i2c at fff84000 {
 				compatible = "atmel,at91sam9g10-i2c";
 				reg = <0xfff84000 0x100>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9G45_ID_TWI0 IRQ_TYPE_LEVEL_HIGH 6>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -550,7 +551,7 @@
 			i2c1: i2c at fff88000 {
 				compatible = "atmel,at91sam9g10-i2c";
 				reg = <0xfff88000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9G45_ID_TWI1 IRQ_TYPE_LEVEL_HIGH 6>;
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -559,7 +560,7 @@
 			ssc0: ssc at fff9c000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xfff9c000 0x4000>;
-				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_SSC0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -568,7 +569,7 @@
 			ssc1: ssc at fffa0000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xfffa0000 0x4000>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9G45_ID_SSC1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
 				status = "disabled";
@@ -577,7 +578,7 @@
 			adc0: adc at fffb0000 {
 				compatible = "atmel,at91sam9260-adc";
 				reg = <0xfffb0000 0x100>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_TSC IRQ_TYPE_LEVEL_HIGH 0>;
 				atmel,adc-use-external-triggers;
 				atmel,adc-channels-used = <0xff>;
 				atmel,adc-vref = <3300>;
@@ -617,7 +618,7 @@
 			mmc0: mmc at fff80000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfff80000 0x600>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_MCI0 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -628,7 +629,7 @@
 			mmc1: mmc at fffd0000 {
 				compatible = "atmel,hsmci";
 				reg = <0xfffd0000 0x600>;
-				interrupts = <29 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_MCI1 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(13)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -647,7 +648,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffa4000 0x200>;
-				interrupts = <14 4 3>;
+				interrupts = <AT91SAM9G45_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi0>;
 				status = "disabled";
@@ -658,7 +659,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xfffa8000 0x200>;
-				interrupts = <15 4 3>;
+				interrupts = <AT91SAM9G45_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_spi1>;
 				status = "disabled";
@@ -670,7 +671,7 @@
 				compatible = "atmel,at91sam9rl-udc";
 				reg = <0x00600000 0x80000
 				       0xfff78000 0x400>;
-				interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9G45_ID_UDPHS IRQ_TYPE_LEVEL_HIGH 0>;
 				status = "disabled";
 
 				ep0 {
@@ -748,14 +749,14 @@
 		usb0: ohci at 00700000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00700000 0x100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9G45_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 
 		usb1: ehci at 00800000 {
 			compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 			reg = <0x00800000 0x100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9G45_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45.h b/arch/arm/mach-at91/include/mach/at91sam9g45.h
index 3f1a509..361fbc3 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9g45.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9g45.h
@@ -18,7 +18,7 @@
 /*
  * Peripheral identifiers/interrupts.
  */
-#include <dt-bindings/at91/at91sam9263/peripherals.h>
+#include <dt-bindings/at91/at91sam9g45/peripherals.h>
 
 /*
  * User Peripheral physical base addresses.
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 6/8] ARM: at91/dt: use periph id macros for at91sam9n12 interrupt definitions
  2013-08-01  6:48 ` Boris BREZILLON
@ 2013-08-01  6:58   ` Boris BREZILLON
  -1 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:58 UTC (permalink / raw)
  To: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Wenyou Yang
  Cc: devicetree, linux-kernel, linux-arm-kernel, Boris BREZILLON

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9n12/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9n12.dtsi |   43 ++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index bb7f564..5e082f4 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -12,6 +12,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9n12/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9N12 SoC";
@@ -65,7 +66,7 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <31>;
+				atmel,external-irqs = <AT91SAM9N12_ID_IRQ0>;
 			};
 
 			ramc0: ramc@ffffe800 {
@@ -86,7 +87,7 @@
 			pit: timer@fffffe30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffe30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			shdwc@fffffe10 {
@@ -97,7 +98,7 @@
 			mmc0: mmc@f0008000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf0008000 0x600>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9N12_ID_MCI IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -108,19 +109,19 @@
 			tcb0: timer@f8008000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf8008000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9N12_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer@f800c000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf800c000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9N12_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			dma: dma-controller@ffffec00 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffec00 0x200>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9N12_ID_DMA IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
@@ -370,7 +371,7 @@
 				pioA: gpio@fffff400 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9N12_ID_PIOAB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -380,7 +381,7 @@
 				pioB: gpio@fffff600 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9N12_ID_PIOAB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -390,7 +391,7 @@
 				pioC: gpio@fffff800 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9N12_ID_PIOCD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -400,7 +401,7 @@
 				pioD: gpio@fffffa00 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9N12_ID_PIOCD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -411,7 +412,7 @@
 			dbgu: serial@fffff200 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffff200 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -420,7 +421,7 @@
 			ssc0: ssc@f0010000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xf0010000 0x4000>;
-				interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_SSC IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -429,7 +430,7 @@
 			usart0: serial@f801c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf801c000 0x4000>;
-				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_USART0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart0>;
 				status = "disabled";
@@ -438,7 +439,7 @@
 			usart1: serial@f8020000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8020000 0x4000>;
-				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_USART1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart1>;
 				status = "disabled";
@@ -447,7 +448,7 @@
 			usart2: serial@f8024000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8024000 0x4000>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_USART2 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart2>;
 				status = "disabled";
@@ -456,7 +457,7 @@
 			usart3: serial@f8028000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8028000 0x4000>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_USART3 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart3>;
 				status = "disabled";
@@ -465,7 +466,7 @@
 			i2c0: i2c@f8010000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8010000 0x100>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9N12_ID_TWI0 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(13)>,
 				       <&dma 1 AT91_DMA_CFG_PER_ID(14)>;
 				dma-names = "tx", "rx";
@@ -477,7 +478,7 @@
 			i2c1: i2c@f8014000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8014000 0x100>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9N12_ID_TWI1 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(15)>,
 				       <&dma 1 AT91_DMA_CFG_PER_ID(16)>;
 				dma-names = "tx", "rx";
@@ -491,7 +492,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0000000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9N12_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(1)>,
 				       <&dma 1 AT91_DMA_CFG_PER_ID(2)>;
 				dma-names = "tx", "rx";
@@ -505,7 +506,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0004000 0x100>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9N12_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(3)>,
 				       <&dma 1 AT91_DMA_CFG_PER_ID(4)>;
 				dma-names = "tx", "rx";
@@ -545,7 +546,7 @@
 		usb0: ohci@00500000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00500000 0x00100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9N12_ID_UHP IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 6/8] ARM: at91/dt: use periph id macros for at91sam9n12 interrupt definitions
@ 2013-08-01  6:58   ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  6:58 UTC (permalink / raw)
  To: linux-arm-kernel

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9n12/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9n12.dtsi |   43 ++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index bb7f564..5e082f4 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -12,6 +12,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9n12/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9N12 SoC";
@@ -65,7 +66,7 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <31>;
+				atmel,external-irqs = <AT91SAM9N12_ID_IRQ0>;
 			};
 
 			ramc0: ramc at ffffe800 {
@@ -86,7 +87,7 @@
 			pit: timer at fffffe30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffe30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			shdwc at fffffe10 {
@@ -97,7 +98,7 @@
 			mmc0: mmc at f0008000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf0008000 0x600>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9N12_ID_MCI IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -108,19 +109,19 @@
 			tcb0: timer at f8008000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf8008000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9N12_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer at f800c000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf800c000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9N12_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			dma: dma-controller at ffffec00 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffec00 0x200>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9N12_ID_DMA IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
@@ -370,7 +371,7 @@
 				pioA: gpio at fffff400 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9N12_ID_PIOAB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -380,7 +381,7 @@
 				pioB: gpio at fffff600 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9N12_ID_PIOAB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -390,7 +391,7 @@
 				pioC: gpio at fffff800 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9N12_ID_PIOCD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -400,7 +401,7 @@
 				pioD: gpio at fffffa00 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9N12_ID_PIOCD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -411,7 +412,7 @@
 			dbgu: serial at fffff200 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffff200 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -420,7 +421,7 @@
 			ssc0: ssc at f0010000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xf0010000 0x4000>;
-				interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_SSC IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -429,7 +430,7 @@
 			usart0: serial at f801c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf801c000 0x4000>;
-				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_USART0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart0>;
 				status = "disabled";
@@ -438,7 +439,7 @@
 			usart1: serial at f8020000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8020000 0x4000>;
-				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_USART1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart1>;
 				status = "disabled";
@@ -447,7 +448,7 @@
 			usart2: serial at f8024000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8024000 0x4000>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_USART2 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart2>;
 				status = "disabled";
@@ -456,7 +457,7 @@
 			usart3: serial at f8028000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8028000 0x4000>;
-				interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9N12_ID_USART3 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart3>;
 				status = "disabled";
@@ -465,7 +466,7 @@
 			i2c0: i2c at f8010000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8010000 0x100>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9N12_ID_TWI0 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(13)>,
 				       <&dma 1 AT91_DMA_CFG_PER_ID(14)>;
 				dma-names = "tx", "rx";
@@ -477,7 +478,7 @@
 			i2c1: i2c at f8014000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8014000 0x100>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9N12_ID_TWI1 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(15)>,
 				       <&dma 1 AT91_DMA_CFG_PER_ID(16)>;
 				dma-names = "tx", "rx";
@@ -491,7 +492,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0000000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9N12_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(1)>,
 				       <&dma 1 AT91_DMA_CFG_PER_ID(2)>;
 				dma-names = "tx", "rx";
@@ -505,7 +506,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0004000 0x100>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9N12_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma 1 AT91_DMA_CFG_PER_ID(3)>,
 				       <&dma 1 AT91_DMA_CFG_PER_ID(4)>;
 				dma-names = "tx", "rx";
@@ -545,7 +546,7 @@
 		usb0: ohci at 00500000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00500000 0x00100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9N12_ID_UHP IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 7/8] ARM: at91/dt: use periph id macros for at91sam9x5 interrupt definitions
  2013-08-01  6:48 ` Boris BREZILLON
@ 2013-08-01  7:00   ` Boris BREZILLON
  -1 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  7:00 UTC (permalink / raw)
  To: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Richard Genoud
  Cc: devicetree, linux-kernel, linux-arm-kernel, Boris BREZILLON

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9x5/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9x5.dtsi |   63 +++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 57d45f5..e65c780 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -14,6 +14,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9x5/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9x5 family SoC";
@@ -67,7 +68,7 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <31>;
+				atmel,external-irqs = <AT91SAM9X5_ID_IRQ0>;
 			};
 
 			ramc0: ramc@ffffe800 {
@@ -93,32 +94,32 @@
 			pit: timer@fffffe30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffe30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			tcb0: timer@f8008000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf8008000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer@f800c000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf800c000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			dma0: dma-controller@ffffec00 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffec00 0x200>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_DMA0 IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
 			dma1: dma-controller@ffffee00 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffee00 0x200>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_DMA1 IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
@@ -498,7 +499,7 @@
 				pioA: gpio@fffff400 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9X5_ID_PIOAB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -508,7 +509,7 @@
 				pioB: gpio@fffff600 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9X5_ID_PIOAB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					#gpio-lines = <19>;
@@ -519,7 +520,7 @@
 				pioC: gpio@fffff800 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9X5_ID_PIOCD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -529,7 +530,7 @@
 				pioD: gpio@fffffa00 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9X5_ID_PIOCD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					#gpio-lines = <22>;
@@ -541,7 +542,7 @@
 			ssc0: ssc@f0010000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xf0010000 0x4000>;
-				interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_SSC IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -550,7 +551,7 @@
 			mmc0: mmc@f0008000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf0008000 0x600>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_MCI0 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -561,7 +562,7 @@
 			mmc1: mmc@f000c000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf000c000 0x600>;
-				interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_MCI1 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -572,7 +573,7 @@
 			dbgu: serial@fffff200 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffff200 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -581,7 +582,7 @@
 			usart0: serial@f801c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf801c000 0x200>;
-				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_USART0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart0>;
 				status = "disabled";
@@ -590,7 +591,7 @@
 			usart1: serial@f8020000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8020000 0x200>;
-				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_USART1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart1>;
 				status = "disabled";
@@ -599,7 +600,7 @@
 			usart2: serial@f8024000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8024000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_USART2 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart2>;
 				status = "disabled";
@@ -608,7 +609,7 @@
 			macb0: ethernet@f802c000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xf802c000 0x100>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9X5_ID_EMAC0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb0_rmii>;
 				status = "disabled";
@@ -617,14 +618,14 @@
 			macb1: ethernet@f8030000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xf8030000 0x100>;
-				interrupts = <27 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9X5_ID_EMAC1 IRQ_TYPE_LEVEL_HIGH 3>;
 				status = "disabled";
 			};
 
 			i2c0: i2c@f8010000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8010000 0x100>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9X5_ID_TWI0 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(7)>,
 				       <&dma0 1 AT91_DMA_CFG_PER_ID(8)>;
 				dma-names = "tx", "rx";
@@ -638,7 +639,7 @@
 			i2c1: i2c@f8014000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8014000 0x100>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9X5_ID_TWI1 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(5)>,
 				       <&dma1 1 AT91_DMA_CFG_PER_ID(6)>;
 				dma-names = "tx", "rx";
@@ -652,7 +653,7 @@
 			i2c2: i2c@f8018000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8018000 0x100>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9X5_ID_TWI2 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(9)>,
 				       <&dma0 1 AT91_DMA_CFG_PER_ID(10)>;
 				dma-names = "tx", "rx";
@@ -666,7 +667,7 @@
 			uart0: serial@f8040000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8040000 0x200>;
-				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_UART0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_uart0>;
 				status = "disabled";
@@ -675,7 +676,7 @@
 			uart1: serial@f8044000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8044000 0x200>;
-				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_UART1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_uart1>;
 				status = "disabled";
@@ -684,7 +685,7 @@
 			adc0: adc@f804c000 {
 				compatible = "atmel,at91sam9260-adc";
 				reg = <0xf804c000 0x100>;
-				interrupts = <19 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_ADC IRQ_TYPE_LEVEL_HIGH 0>;
 				atmel,adc-use-external;
 				atmel,adc-channels-used = <0xffff>;
 				atmel,adc-vref = <3300>;
@@ -727,7 +728,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0000000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9X5_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(1)>,
 				       <&dma0 1 AT91_DMA_CFG_PER_ID(2)>;
 				dma-names = "tx", "rx";
@@ -741,7 +742,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0004000 0x100>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9X5_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(1)>,
 				       <&dma1 1 AT91_DMA_CFG_PER_ID(2)>;
 				dma-names = "tx", "rx";
@@ -756,7 +757,7 @@
 				compatible = "atmel,at91sam9rl-udc";
 				reg = <0x00500000 0x80000
 				       0xf803c000 0x400>;
-				interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_UDPHS IRQ_TYPE_LEVEL_HIGH 0>;
 				status = "disabled";
 
 				ep0 {
@@ -821,7 +822,7 @@
 			rtc@fffffeb0 {
 				compatible = "atmel,at91sam9x5-rtc";
 				reg = <0xfffffeb0 0x40>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				status = "disabled";
 			};
 		};
@@ -850,14 +851,14 @@
 		usb0: ohci@00600000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00600000 0x100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9X5_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 
 		usb1: ehci@00700000 {
 			compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 			reg = <0x00700000 0x100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9X5_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 7/8] ARM: at91/dt: use periph id macros for at91sam9x5 interrupt definitions
@ 2013-08-01  7:00   ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  7:00 UTC (permalink / raw)
  To: linux-arm-kernel

This patch make use of the peripheral id macros defined in
dt-bindings/at91/at91sam9x5/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/at91sam9x5.dtsi |   63 +++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 57d45f5..e65c780 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -14,6 +14,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/at91sam9x5/peripherals.h>
 
 / {
 	model = "Atmel AT91SAM9x5 family SoC";
@@ -67,7 +68,7 @@
 				compatible = "atmel,at91rm9200-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <31>;
+				atmel,external-irqs = <AT91SAM9X5_ID_IRQ0>;
 			};
 
 			ramc0: ramc at ffffe800 {
@@ -93,32 +94,32 @@
 			pit: timer at fffffe30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffe30 0xf>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 
 			tcb0: timer at f8008000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf8008000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			tcb1: timer at f800c000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf800c000 0x100>;
-				interrupts = <17 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_TCB IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			dma0: dma-controller at ffffec00 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffec00 0x200>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_DMA0 IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
 			dma1: dma-controller at ffffee00 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffee00 0x200>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_DMA1 IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
@@ -498,7 +499,7 @@
 				pioA: gpio at fffff400 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9X5_ID_PIOAB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -508,7 +509,7 @@
 				pioB: gpio at fffff600 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x200>;
-					interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9X5_ID_PIOAB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					#gpio-lines = <19>;
@@ -519,7 +520,7 @@
 				pioC: gpio at fffff800 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9X5_ID_PIOCD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -529,7 +530,7 @@
 				pioD: gpio at fffffa00 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x200>;
-					interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <AT91SAM9X5_ID_PIOCD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					#gpio-lines = <22>;
@@ -541,7 +542,7 @@
 			ssc0: ssc at f0010000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xf0010000 0x4000>;
-				interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_SSC IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -550,7 +551,7 @@
 			mmc0: mmc at f0008000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf0008000 0x600>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_MCI0 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -561,7 +562,7 @@
 			mmc1: mmc at f000c000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf000c000 0x600>;
-				interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_MCI1 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				#address-cells = <1>;
@@ -572,7 +573,7 @@
 			dbgu: serial at fffff200 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xfffff200 0x200>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -581,7 +582,7 @@
 			usart0: serial at f801c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf801c000 0x200>;
-				interrupts = <5 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_USART0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart0>;
 				status = "disabled";
@@ -590,7 +591,7 @@
 			usart1: serial at f8020000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8020000 0x200>;
-				interrupts = <6 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_USART1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart1>;
 				status = "disabled";
@@ -599,7 +600,7 @@
 			usart2: serial at f8024000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8024000 0x200>;
-				interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_USART2 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart2>;
 				status = "disabled";
@@ -608,7 +609,7 @@
 			macb0: ethernet at f802c000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xf802c000 0x100>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9X5_ID_EMAC0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb0_rmii>;
 				status = "disabled";
@@ -617,14 +618,14 @@
 			macb1: ethernet at f8030000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xf8030000 0x100>;
-				interrupts = <27 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9X5_ID_EMAC1 IRQ_TYPE_LEVEL_HIGH 3>;
 				status = "disabled";
 			};
 
 			i2c0: i2c at f8010000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8010000 0x100>;
-				interrupts = <9 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9X5_ID_TWI0 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(7)>,
 				       <&dma0 1 AT91_DMA_CFG_PER_ID(8)>;
 				dma-names = "tx", "rx";
@@ -638,7 +639,7 @@
 			i2c1: i2c at f8014000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8014000 0x100>;
-				interrupts = <10 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9X5_ID_TWI1 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(5)>,
 				       <&dma1 1 AT91_DMA_CFG_PER_ID(6)>;
 				dma-names = "tx", "rx";
@@ -652,7 +653,7 @@
 			i2c2: i2c at f8018000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf8018000 0x100>;
-				interrupts = <11 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <AT91SAM9X5_ID_TWI2 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(9)>,
 				       <&dma0 1 AT91_DMA_CFG_PER_ID(10)>;
 				dma-names = "tx", "rx";
@@ -666,7 +667,7 @@
 			uart0: serial at f8040000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8040000 0x200>;
-				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_UART0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_uart0>;
 				status = "disabled";
@@ -675,7 +676,7 @@
 			uart1: serial at f8044000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8044000 0x200>;
-				interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91SAM9X5_ID_UART1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_uart1>;
 				status = "disabled";
@@ -684,7 +685,7 @@
 			adc0: adc at f804c000 {
 				compatible = "atmel,at91sam9260-adc";
 				reg = <0xf804c000 0x100>;
-				interrupts = <19 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_ADC IRQ_TYPE_LEVEL_HIGH 0>;
 				atmel,adc-use-external;
 				atmel,adc-channels-used = <0xffff>;
 				atmel,adc-vref = <3300>;
@@ -727,7 +728,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0000000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9X5_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(1)>,
 				       <&dma0 1 AT91_DMA_CFG_PER_ID(2)>;
 				dma-names = "tx", "rx";
@@ -741,7 +742,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0004000 0x100>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <AT91SAM9X5_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(1)>,
 				       <&dma1 1 AT91_DMA_CFG_PER_ID(2)>;
 				dma-names = "tx", "rx";
@@ -756,7 +757,7 @@
 				compatible = "atmel,at91sam9rl-udc";
 				reg = <0x00500000 0x80000
 				       0xf803c000 0x400>;
-				interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <AT91SAM9X5_ID_UDPHS IRQ_TYPE_LEVEL_HIGH 0>;
 				status = "disabled";
 
 				ep0 {
@@ -821,7 +822,7 @@
 			rtc at fffffeb0 {
 				compatible = "atmel,at91sam9x5-rtc";
 				reg = <0xfffffeb0 0x40>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 				status = "disabled";
 			};
 		};
@@ -850,14 +851,14 @@
 		usb0: ohci at 00600000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00600000 0x100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9X5_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 
 		usb1: ehci at 00700000 {
 			compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 			reg = <0x00700000 0x100000>;
-			interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <AT91SAM9X5_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 	};
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 8/8] ARM: at91/dt: use periph id macros for sama5d3 interrupt definitions
  2013-08-01  6:48 ` Boris BREZILLON
@ 2013-08-01  7:01   ` Boris BREZILLON
  -1 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  7:01 UTC (permalink / raw)
  To: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Lorenzo Pieralisi
  Cc: devicetree, linux-kernel, linux-arm-kernel, Boris BREZILLON

This patch make use of the peripheral id macros defined in
dt-bindings/at91/sama5d3/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/sama5d3.dtsi |   83 ++++++++++++++++++++--------------------
 1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index a1d5e25..01c36b6 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -13,6 +13,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/sama5d3/peripherals.h>
 
 / {
 	model = "Atmel SAMA5D3 family SoC";
@@ -67,7 +68,7 @@
 			mmc0: mmc@f0000000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf0000000 0x600>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_HSMCI0 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				pinctrl-names = "default";
@@ -82,7 +83,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0004000 0x100>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(1)>,
 				       <&dma0 2 AT91_DMA_CFG_PER_ID(2)>;
 				dma-names = "tx", "rx";
@@ -94,7 +95,7 @@
 			ssc0: ssc@f0008000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xf0008000 0x4000>;
-				interrupts = <38 IRQ_TYPE_LEVEL_HIGH 4>;
+				interrupts = <SAMA5D3_ID_SSC0 IRQ_TYPE_LEVEL_HIGH 4>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -103,7 +104,7 @@
 			can0: can@f000c000 {
 				compatible = "atmel,at91sam9x5-can";
 				reg = <0xf000c000 0x300>;
-				interrupts = <40 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_CAN0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_can0_rx_tx>;
 				status = "disabled";
@@ -112,13 +113,13 @@
 			tcb0: timer@f0010000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf0010000 0x100>;
-				interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_TC0 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			i2c0: i2c@f0014000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf0014000 0x4000>;
-				interrupts = <18 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <SAMA5D3_ID_TWI0 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(7)>,
 				       <&dma0 2 AT91_DMA_CFG_PER_ID(8)>;
 				dma-names = "tx", "rx";
@@ -132,7 +133,7 @@
 			i2c1: i2c@f0018000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf0018000 0x4000>;
-				interrupts = <19 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <SAMA5D3_ID_TWI1 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(9)>,
 				       <&dma0 2 AT91_DMA_CFG_PER_ID(10)>;
 				dma-names = "tx", "rx";
@@ -146,7 +147,7 @@
 			usart0: serial@f001c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf001c000 0x100>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_USART0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart0>;
 				status = "disabled";
@@ -155,7 +156,7 @@
 			usart1: serial@f0020000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf0020000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_USART1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart1>;
 				status = "disabled";
@@ -164,7 +165,7 @@
 			macb0: ethernet@f0028000 {
 				compatible = "cdns,pc302-gem", "cdns,gem";
 				reg = <0xf0028000 0x100>;
-				interrupts = <34 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_GMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb0_data_rgmii &pinctrl_macb0_signal_rgmii>;
 				status = "disabled";
@@ -173,14 +174,14 @@
 			isi: isi@f0034000 {
 				compatible = "atmel,at91sam9g45-isi";
 				reg = <0xf0034000 0x4000>;
-				interrupts = <37 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_ISI IRQ_TYPE_LEVEL_HIGH 5>;
 				status = "disabled";
 			};
 
 			mmc1: mmc@f8000000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf8000000 0x600>;
-				interrupts = <22 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_HSMCI1 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				pinctrl-names = "default";
@@ -193,7 +194,7 @@
 			mmc2: mmc@f8004000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf8004000 0x600>;
-				interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_HSMCI2 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(1)>;
 				dma-names = "rxtx";
 				pinctrl-names = "default";
@@ -208,7 +209,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf8008000 0x100>;
-				interrupts = <25 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(15)>,
 				       <&dma1 2 AT91_DMA_CFG_PER_ID(16)>;
 				dma-names = "tx", "rx";
@@ -220,7 +221,7 @@
 			ssc1: ssc@f800c000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xf800c000 0x4000>;
-				interrupts = <39 IRQ_TYPE_LEVEL_HIGH 4>;
+				interrupts = <SAMA5D3_ID_SSC1 IRQ_TYPE_LEVEL_HIGH 4>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
 				status = "disabled";
@@ -229,7 +230,7 @@
 			can1: can@f8010000 {
 				compatible = "atmel,at91sam9x5-can";
 				reg = <0xf8010000 0x300>;
-				interrupts = <41 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_CAN1 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_can1_rx_tx>;
 			};
@@ -237,13 +238,13 @@
 			tcb1: timer@f8014000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf8014000 0x100>;
-				interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_TC1 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			adc0: adc@f8018000 {
 				compatible = "atmel,at91sam9260-adc";
 				reg = <0xf8018000 0x100>;
-				interrupts = <29 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_ADC IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <
 					&pinctrl_adc0_adtrg
@@ -297,7 +298,7 @@
 			tsadcc: tsadcc@f8018000 {
 				compatible = "atmel,at91sam9x5-tsadcc";
 				reg = <0xf8018000 0x4000>;
-				interrupts = <29 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_ADC IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,tsadcc_clock = <300000>;
 				atmel,filtering_average = <0x03>;
 				atmel,pendet_debounce = <0x08>;
@@ -309,7 +310,7 @@
 			i2c2: i2c@f801c000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf801c000 0x4000>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <SAMA5D3_ID_TWI2 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(11)>,
 				       <&dma1 2 AT91_DMA_CFG_PER_ID(12)>;
 				dma-names = "tx", "rx";
@@ -321,7 +322,7 @@
 			usart2: serial@f8020000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8020000 0x100>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_USART2 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart2>;
 				status = "disabled";
@@ -330,7 +331,7 @@
 			usart3: serial@f8024000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8024000 0x100>;
-				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_USART3 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart3>;
 				status = "disabled";
@@ -339,7 +340,7 @@
 			macb1: ethernet@f802c000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xf802c000 0x100>;
-				interrupts = <35 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb1_rmii>;
 				status = "disabled";
@@ -348,32 +349,32 @@
 			sha@f8034000 {
 				compatible = "atmel,sam9g46-sha";
 				reg = <0xf8034000 0x100>;
-				interrupts = <42 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_SHA IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			aes@f8038000 {
 				compatible = "atmel,sam9g46-aes";
 				reg = <0xf8038000 0x100>;
-				interrupts = <43 4 0>;
+				interrupts = <SAMA5D3_ID_AES 4 0>;
 			};
 
 			tdes@f803c000 {
 				compatible = "atmel,sam9g46-tdes";
 				reg = <0xf803c000 0x100>;
-				interrupts = <44 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_TDES IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			dma0: dma-controller@ffffe600 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffe600 0x200>;
-				interrupts = <30 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_DMA0 IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
 			dma1: dma-controller@ffffe800 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffe800 0x200>;
-				interrupts = <31 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_DMA1 IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
@@ -385,7 +386,7 @@
 			dbgu: serial@ffffee00 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xffffee00 0x200>;
-				interrupts = <2 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <SAMA5D3_ID_DBGU IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -396,7 +397,7 @@
 				compatible = "atmel,sama5d3-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <47>;
+				atmel,external-irqs = <SAMA5D3_ID_IRQ0>;
 			};
 
 			pinctrl@fffff200 {
@@ -819,7 +820,7 @@
 				pioA: gpio@fffff200 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff200 0x100>;
-					interrupts = <6 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -829,7 +830,7 @@
 				pioB: gpio@fffff400 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x100>;
-					interrupts = <7 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -839,7 +840,7 @@
 				pioC: gpio@fffff600 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x100>;
-					interrupts = <8 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOC IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -849,7 +850,7 @@
 				pioD: gpio@fffff800 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x100>;
-					interrupts = <9 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -859,7 +860,7 @@
 				pioE: gpio@fffffa00 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x100>;
-					interrupts = <10 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -880,7 +881,7 @@
 			pit: timer@fffffe30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffe30 0xf>;
-				interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91_ID_PIT IRQ_TYPE_LEVEL_HIGH 5>;
 			};
 
 			watchdog@fffffe40 {
@@ -892,7 +893,7 @@
 			rtc@fffffeb0 {
 				compatible = "atmel,at91rm9200-rtc";
 				reg = <0xfffffeb0 0x30>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 		};
 
@@ -902,7 +903,7 @@
 			compatible = "atmel,at91sam9rl-udc";
 			reg = <0x00500000 0x100000
 			       0xf8030000 0x4000>;
-			interrupts = <33 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <SAMA5D3_ID_UDPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 
 			ep0 {
@@ -1014,14 +1015,14 @@
 		usb1: ohci@00600000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00600000 0x100000>;
-			interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <SAMA5D3_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 
 		usb2: ehci@00700000 {
 			compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 			reg = <0x00700000 0x100000>;
-			interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <SAMA5D3_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 
@@ -1037,7 +1038,7 @@
 				0xffffc000 0x00000070	/* NFC HSMC regs */
 				0x00200000 0x00100000	/* NFC SRAM banks */
 				>;
-			interrupts = <5 IRQ_TYPE_LEVEL_HIGH 6>;
+			interrupts = <SAMA5D3_ID_HSMC IRQ_TYPE_LEVEL_HIGH 6>;
 			atmel,nand-addr-offset = <21>;
 			atmel,nand-cmd-offset = <22>;
 			pinctrl-names = "default";
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 42+ messages in thread

* [PATCH 8/8] ARM: at91/dt: use periph id macros for sama5d3 interrupt definitions
@ 2013-08-01  7:01   ` Boris BREZILLON
  0 siblings, 0 replies; 42+ messages in thread
From: Boris BREZILLON @ 2013-08-01  7:01 UTC (permalink / raw)
  To: linux-arm-kernel

This patch make use of the peripheral id macros defined in
dt-bindings/at91/sama5d3/peripherals.h to register peripheral
interrupts.

Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
---
 arch/arm/boot/dts/sama5d3.dtsi |   83 ++++++++++++++++++++--------------------
 1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index a1d5e25..01c36b6 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -13,6 +13,7 @@
 #include <dt-bindings/pinctrl/at91.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/at91/sama5d3/peripherals.h>
 
 / {
 	model = "Atmel SAMA5D3 family SoC";
@@ -67,7 +68,7 @@
 			mmc0: mmc at f0000000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf0000000 0x600>;
-				interrupts = <21 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_HSMCI0 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				pinctrl-names = "default";
@@ -82,7 +83,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf0004000 0x100>;
-				interrupts = <24 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_SPI0 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(1)>,
 				       <&dma0 2 AT91_DMA_CFG_PER_ID(2)>;
 				dma-names = "tx", "rx";
@@ -94,7 +95,7 @@
 			ssc0: ssc at f0008000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xf0008000 0x4000>;
-				interrupts = <38 IRQ_TYPE_LEVEL_HIGH 4>;
+				interrupts = <SAMA5D3_ID_SSC0 IRQ_TYPE_LEVEL_HIGH 4>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>;
 				status = "disabled";
@@ -103,7 +104,7 @@
 			can0: can at f000c000 {
 				compatible = "atmel,at91sam9x5-can";
 				reg = <0xf000c000 0x300>;
-				interrupts = <40 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_CAN0 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_can0_rx_tx>;
 				status = "disabled";
@@ -112,13 +113,13 @@
 			tcb0: timer at f0010000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf0010000 0x100>;
-				interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_TC0 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			i2c0: i2c at f0014000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf0014000 0x4000>;
-				interrupts = <18 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <SAMA5D3_ID_TWI0 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(7)>,
 				       <&dma0 2 AT91_DMA_CFG_PER_ID(8)>;
 				dma-names = "tx", "rx";
@@ -132,7 +133,7 @@
 			i2c1: i2c at f0018000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf0018000 0x4000>;
-				interrupts = <19 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <SAMA5D3_ID_TWI1 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(9)>,
 				       <&dma0 2 AT91_DMA_CFG_PER_ID(10)>;
 				dma-names = "tx", "rx";
@@ -146,7 +147,7 @@
 			usart0: serial at f001c000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf001c000 0x100>;
-				interrupts = <12 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_USART0 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart0>;
 				status = "disabled";
@@ -155,7 +156,7 @@
 			usart1: serial at f0020000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf0020000 0x100>;
-				interrupts = <13 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_USART1 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart1>;
 				status = "disabled";
@@ -164,7 +165,7 @@
 			macb0: ethernet at f0028000 {
 				compatible = "cdns,pc302-gem", "cdns,gem";
 				reg = <0xf0028000 0x100>;
-				interrupts = <34 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_GMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb0_data_rgmii &pinctrl_macb0_signal_rgmii>;
 				status = "disabled";
@@ -173,14 +174,14 @@
 			isi: isi at f0034000 {
 				compatible = "atmel,at91sam9g45-isi";
 				reg = <0xf0034000 0x4000>;
-				interrupts = <37 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_ISI IRQ_TYPE_LEVEL_HIGH 5>;
 				status = "disabled";
 			};
 
 			mmc1: mmc at f8000000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf8000000 0x600>;
-				interrupts = <22 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_HSMCI1 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(0)>;
 				dma-names = "rxtx";
 				pinctrl-names = "default";
@@ -193,7 +194,7 @@
 			mmc2: mmc at f8004000 {
 				compatible = "atmel,hsmci";
 				reg = <0xf8004000 0x600>;
-				interrupts = <23 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_HSMCI2 IRQ_TYPE_LEVEL_HIGH 0>;
 				dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(1)>;
 				dma-names = "rxtx";
 				pinctrl-names = "default";
@@ -208,7 +209,7 @@
 				#size-cells = <0>;
 				compatible = "atmel,at91rm9200-spi";
 				reg = <0xf8008000 0x100>;
-				interrupts = <25 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_SPI1 IRQ_TYPE_LEVEL_HIGH 3>;
 				dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(15)>,
 				       <&dma1 2 AT91_DMA_CFG_PER_ID(16)>;
 				dma-names = "tx", "rx";
@@ -220,7 +221,7 @@
 			ssc1: ssc at f800c000 {
 				compatible = "atmel,at91sam9g45-ssc";
 				reg = <0xf800c000 0x4000>;
-				interrupts = <39 IRQ_TYPE_LEVEL_HIGH 4>;
+				interrupts = <SAMA5D3_ID_SSC1 IRQ_TYPE_LEVEL_HIGH 4>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>;
 				status = "disabled";
@@ -229,7 +230,7 @@
 			can1: can at f8010000 {
 				compatible = "atmel,at91sam9x5-can";
 				reg = <0xf8010000 0x300>;
-				interrupts = <41 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_CAN1 IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_can1_rx_tx>;
 			};
@@ -237,13 +238,13 @@
 			tcb1: timer at f8014000 {
 				compatible = "atmel,at91sam9x5-tcb";
 				reg = <0xf8014000 0x100>;
-				interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_TC1 IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			adc0: adc at f8018000 {
 				compatible = "atmel,at91sam9260-adc";
 				reg = <0xf8018000 0x100>;
-				interrupts = <29 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_ADC IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <
 					&pinctrl_adc0_adtrg
@@ -297,7 +298,7 @@
 			tsadcc: tsadcc@f8018000 {
 				compatible = "atmel,at91sam9x5-tsadcc";
 				reg = <0xf8018000 0x4000>;
-				interrupts = <29 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_ADC IRQ_TYPE_LEVEL_HIGH 5>;
 				atmel,tsadcc_clock = <300000>;
 				atmel,filtering_average = <0x03>;
 				atmel,pendet_debounce = <0x08>;
@@ -309,7 +310,7 @@
 			i2c2: i2c at f801c000 {
 				compatible = "atmel,at91sam9x5-i2c";
 				reg = <0xf801c000 0x4000>;
-				interrupts = <20 IRQ_TYPE_LEVEL_HIGH 6>;
+				interrupts = <SAMA5D3_ID_TWI2 IRQ_TYPE_LEVEL_HIGH 6>;
 				dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(11)>,
 				       <&dma1 2 AT91_DMA_CFG_PER_ID(12)>;
 				dma-names = "tx", "rx";
@@ -321,7 +322,7 @@
 			usart2: serial at f8020000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8020000 0x100>;
-				interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_USART2 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart2>;
 				status = "disabled";
@@ -330,7 +331,7 @@
 			usart3: serial at f8024000 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xf8024000 0x100>;
-				interrupts = <15 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <SAMA5D3_ID_USART3 IRQ_TYPE_LEVEL_HIGH 5>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_usart3>;
 				status = "disabled";
@@ -339,7 +340,7 @@
 			macb1: ethernet at f802c000 {
 				compatible = "cdns,at32ap7000-macb", "cdns,macb";
 				reg = <0xf802c000 0x100>;
-				interrupts = <35 IRQ_TYPE_LEVEL_HIGH 3>;
+				interrupts = <SAMA5D3_ID_EMAC IRQ_TYPE_LEVEL_HIGH 3>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_macb1_rmii>;
 				status = "disabled";
@@ -348,32 +349,32 @@
 			sha at f8034000 {
 				compatible = "atmel,sam9g46-sha";
 				reg = <0xf8034000 0x100>;
-				interrupts = <42 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_SHA IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			aes at f8038000 {
 				compatible = "atmel,sam9g46-aes";
 				reg = <0xf8038000 0x100>;
-				interrupts = <43 4 0>;
+				interrupts = <SAMA5D3_ID_AES 4 0>;
 			};
 
 			tdes at f803c000 {
 				compatible = "atmel,sam9g46-tdes";
 				reg = <0xf803c000 0x100>;
-				interrupts = <44 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_TDES IRQ_TYPE_LEVEL_HIGH 0>;
 			};
 
 			dma0: dma-controller at ffffe600 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffe600 0x200>;
-				interrupts = <30 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_DMA0 IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
 			dma1: dma-controller at ffffe800 {
 				compatible = "atmel,at91sam9g45-dma";
 				reg = <0xffffe800 0x200>;
-				interrupts = <31 IRQ_TYPE_LEVEL_HIGH 0>;
+				interrupts = <SAMA5D3_ID_DMA1 IRQ_TYPE_LEVEL_HIGH 0>;
 				#dma-cells = <2>;
 			};
 
@@ -385,7 +386,7 @@
 			dbgu: serial at ffffee00 {
 				compatible = "atmel,at91sam9260-usart";
 				reg = <0xffffee00 0x200>;
-				interrupts = <2 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <SAMA5D3_ID_DBGU IRQ_TYPE_LEVEL_HIGH 7>;
 				pinctrl-names = "default";
 				pinctrl-0 = <&pinctrl_dbgu>;
 				status = "disabled";
@@ -396,7 +397,7 @@
 				compatible = "atmel,sama5d3-aic";
 				interrupt-controller;
 				reg = <0xfffff000 0x200>;
-				atmel,external-irqs = <47>;
+				atmel,external-irqs = <SAMA5D3_ID_IRQ0>;
 			};
 
 			pinctrl at fffff200 {
@@ -819,7 +820,7 @@
 				pioA: gpio at fffff200 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff200 0x100>;
-					interrupts = <6 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOA IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -829,7 +830,7 @@
 				pioB: gpio at fffff400 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff400 0x100>;
-					interrupts = <7 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOB IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -839,7 +840,7 @@
 				pioC: gpio at fffff600 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff600 0x100>;
-					interrupts = <8 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOC IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -849,7 +850,7 @@
 				pioD: gpio at fffff800 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffff800 0x100>;
-					interrupts = <9 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOD IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -859,7 +860,7 @@
 				pioE: gpio at fffffa00 {
 					compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio";
 					reg = <0xfffffa00 0x100>;
-					interrupts = <10 IRQ_TYPE_LEVEL_HIGH 1>;
+					interrupts = <SAMA5D3_ID_PIOE IRQ_TYPE_LEVEL_HIGH 1>;
 					#gpio-cells = <2>;
 					gpio-controller;
 					interrupt-controller;
@@ -880,7 +881,7 @@
 			pit: timer at fffffe30 {
 				compatible = "atmel,at91sam9260-pit";
 				reg = <0xfffffe30 0xf>;
-				interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>;
+				interrupts = <AT91_ID_PIT IRQ_TYPE_LEVEL_HIGH 5>;
 			};
 
 			watchdog at fffffe40 {
@@ -892,7 +893,7 @@
 			rtc at fffffeb0 {
 				compatible = "atmel,at91rm9200-rtc";
 				reg = <0xfffffeb0 0x30>;
-				interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
+				interrupts = <AT91_ID_SYS IRQ_TYPE_LEVEL_HIGH 7>;
 			};
 		};
 
@@ -902,7 +903,7 @@
 			compatible = "atmel,at91sam9rl-udc";
 			reg = <0x00500000 0x100000
 			       0xf8030000 0x4000>;
-			interrupts = <33 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <SAMA5D3_ID_UDPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 
 			ep0 {
@@ -1014,14 +1015,14 @@
 		usb1: ohci at 00600000 {
 			compatible = "atmel,at91rm9200-ohci", "usb-ohci";
 			reg = <0x00600000 0x100000>;
-			interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <SAMA5D3_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 
 		usb2: ehci at 00700000 {
 			compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
 			reg = <0x00700000 0x100000>;
-			interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>;
+			interrupts = <SAMA5D3_ID_UHPHS IRQ_TYPE_LEVEL_HIGH 2>;
 			status = "disabled";
 		};
 
@@ -1037,7 +1038,7 @@
 				0xffffc000 0x00000070	/* NFC HSMC regs */
 				0x00200000 0x00100000	/* NFC SRAM banks */
 				>;
-			interrupts = <5 IRQ_TYPE_LEVEL_HIGH 6>;
+			interrupts = <SAMA5D3_ID_HSMC IRQ_TYPE_LEVEL_HIGH 6>;
 			atmel,nand-addr-offset = <21>;
 			atmel,nand-cmd-offset = <22>;
 			pinctrl-names = "default";
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 42+ messages in thread

* Re: [PATCH 0/8] ARM: at91/dt: make use of periph id macros
  2013-08-01  6:48 ` Boris BREZILLON
@ 2013-08-01  7:37   ` Richard Genoud
  -1 siblings, 0 replies; 42+ messages in thread
From: Richard Genoud @ 2013-08-01  7:37 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Mark Brown, devicetree,
	linux-kernel, linux-arm-kernel

2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
> Hello,
>
> This patch series move at91 SoCs peripheral id definitions from machine
> specific include dir to dt-bindings include dir.
> These macros are used to reference interrupts instead of peripheral numbers.
>
> This makes dt definitions cleaner and easier to debug (one can easily tell if
> the peripheral macro used to reference an interrupt line is not the good one).
>
> These macros will be used for clk definitions and references too.
>
> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
> definitions as there are no soc specific directories in dt-bindings include
> dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
> 'include/dt-bindings/peripherals/at91/xxx' would be better.
> What do you think ?
Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
has been dropped for new atmel SoCs (sama5 for instance).

my 2 cents...

Richard.

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 0/8] ARM: at91/dt: make use of periph id macros
@ 2013-08-01  7:37   ` Richard Genoud
  0 siblings, 0 replies; 42+ messages in thread
From: Richard Genoud @ 2013-08-01  7:37 UTC (permalink / raw)
  To: linux-arm-kernel

2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
> Hello,
>
> This patch series move at91 SoCs peripheral id definitions from machine
> specific include dir to dt-bindings include dir.
> These macros are used to reference interrupts instead of peripheral numbers.
>
> This makes dt definitions cleaner and easier to debug (one can easily tell if
> the peripheral macro used to reference an interrupt line is not the good one).
>
> These macros will be used for clk definitions and references too.
>
> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
> definitions as there are no soc specific directories in dt-bindings include
> dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
> 'include/dt-bindings/peripherals/at91/xxx' would be better.
> What do you think ?
Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
has been dropped for new atmel SoCs (sama5 for instance).

my 2 cents...

Richard.

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 0/8] ARM: at91/dt: make use of periph id macros
  2013-08-01  7:37   ` Richard Genoud
@ 2013-08-01  9:27     ` Richard Genoud
  -1 siblings, 0 replies; 42+ messages in thread
From: Richard Genoud @ 2013-08-01  9:27 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, devicetree, linux-kernel,
	linux-arm-kernel, Mark Brown

2013/8/1 Richard Genoud <richard.genoud@gmail.com>:
> 2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
>> Hello,
>>
>> This patch series move at91 SoCs peripheral id definitions from machine
>> specific include dir to dt-bindings include dir.
>> These macros are used to reference interrupts instead of peripheral numbers.
>>
>> This makes dt definitions cleaner and easier to debug (one can easily tell if
>> the peripheral macro used to reference an interrupt line is not the good one).
>>
>> These macros will be used for clk definitions and references too.
>>
>> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
>> definitions as there are no soc specific directories in dt-bindings include
>> dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
>> 'include/dt-bindings/peripherals/at91/xxx' would be better.
>> What do you think ?
> Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
> has been dropped for new atmel SoCs (sama5 for instance).

[changed Mark Brown address from opensource.wolfsonmicro.com to
kernel.org (the 1st one failed)]

The whole serie seems good to me (add adding the missing defines is great).

You can add my:
Reviewed-by: Richard Genoud <richard.genoud@gmail.com>
on the whole serie.

and my
Tested-by: Richard Genoud <richard.genoud@gmail.com>
on patch 7/8


Richard.

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 0/8] ARM: at91/dt: make use of periph id macros
@ 2013-08-01  9:27     ` Richard Genoud
  0 siblings, 0 replies; 42+ messages in thread
From: Richard Genoud @ 2013-08-01  9:27 UTC (permalink / raw)
  To: linux-arm-kernel

2013/8/1 Richard Genoud <richard.genoud@gmail.com>:
> 2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
>> Hello,
>>
>> This patch series move at91 SoCs peripheral id definitions from machine
>> specific include dir to dt-bindings include dir.
>> These macros are used to reference interrupts instead of peripheral numbers.
>>
>> This makes dt definitions cleaner and easier to debug (one can easily tell if
>> the peripheral macro used to reference an interrupt line is not the good one).
>>
>> These macros will be used for clk definitions and references too.
>>
>> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
>> definitions as there are no soc specific directories in dt-bindings include
>> dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
>> 'include/dt-bindings/peripherals/at91/xxx' would be better.
>> What do you think ?
> Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
> has been dropped for new atmel SoCs (sama5 for instance).

[changed Mark Brown address from opensource.wolfsonmicro.com to
kernel.org (the 1st one failed)]

The whole serie seems good to me (add adding the missing defines is great).

You can add my:
Reviewed-by: Richard Genoud <richard.genoud@gmail.com>
on the whole serie.

and my
Tested-by: Richard Genoud <richard.genoud@gmail.com>
on patch 7/8


Richard.

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 0/8] ARM: at91/dt: make use of periph id macros
  2013-08-01  9:27     ` Richard Genoud
@ 2013-08-01 11:06       ` boris brezillon
  -1 siblings, 0 replies; 42+ messages in thread
From: boris brezillon @ 2013-08-01 11:06 UTC (permalink / raw)
  To: Richard Genoud
  Cc: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, devicetree, linux-kernel,
	linux-arm-kernel, Mark Brown

Hello Richard,

On 01/08/2013 11:27, Richard Genoud wrote:
> 2013/8/1 Richard Genoud <richard.genoud@gmail.com>:
>> 2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
>>> Hello,
>>>
>>> This patch series move at91 SoCs peripheral id definitions from machine
>>> specific include dir to dt-bindings include dir.
>>> These macros are used to reference interrupts instead of peripheral numbers.
>>>
>>> This makes dt definitions cleaner and easier to debug (one can easily tell if
>>> the peripheral macro used to reference an interrupt line is not the good one).
>>>
>>> These macros will be used for clk definitions and references too.
>>>
>>> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
>>> definitions as there are no soc specific directories in dt-bindings include
>>> dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
>>> 'include/dt-bindings/peripherals/at91/xxx' would be better.
>>> What do you think ?
>> Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
>> has been dropped for new atmel SoCs (sama5 for instance).

Sure, I will replace at91 by atmel, but I'd like to get some feedback 
from at91
maintainers before doing this.

Could devicetree maintainers take a look at this series too ?
I don't want to mess with dt-bindings include directory by adding some 
files at
the wrong place...

> [changed Mark Brown address from opensource.wolfsonmicro.com to
> kernel.org (the 1st one failed)]

Sorry Mark. Do you want me to resend you the whole series ?

>
> The whole serie seems good to me (add adding the missing defines is great).
>
> You can add my:
> Reviewed-by: Richard Genoud <richard.genoud@gmail.com>
> on the whole serie.
>
> and my
> Tested-by: Richard Genoud <richard.genoud@gmail.com>
> on patch 7/8
>
>
> Richard.

Thanks for the review and the tests.

Best Regards,

Boris

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 0/8] ARM: at91/dt: make use of periph id macros
@ 2013-08-01 11:06       ` boris brezillon
  0 siblings, 0 replies; 42+ messages in thread
From: boris brezillon @ 2013-08-01 11:06 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Richard,

On 01/08/2013 11:27, Richard Genoud wrote:
> 2013/8/1 Richard Genoud <richard.genoud@gmail.com>:
>> 2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
>>> Hello,
>>>
>>> This patch series move at91 SoCs peripheral id definitions from machine
>>> specific include dir to dt-bindings include dir.
>>> These macros are used to reference interrupts instead of peripheral numbers.
>>>
>>> This makes dt definitions cleaner and easier to debug (one can easily tell if
>>> the peripheral macro used to reference an interrupt line is not the good one).
>>>
>>> These macros will be used for clk definitions and references too.
>>>
>>> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
>>> definitions as there are no soc specific directories in dt-bindings include
>>> dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
>>> 'include/dt-bindings/peripherals/at91/xxx' would be better.
>>> What do you think ?
>> Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
>> has been dropped for new atmel SoCs (sama5 for instance).

Sure, I will replace at91 by atmel, but I'd like to get some feedback 
from at91
maintainers before doing this.

Could devicetree maintainers take a look at this series too ?
I don't want to mess with dt-bindings include directory by adding some 
files at
the wrong place...

> [changed Mark Brown address from opensource.wolfsonmicro.com to
> kernel.org (the 1st one failed)]

Sorry Mark. Do you want me to resend you the whole series ?

>
> The whole serie seems good to me (add adding the missing defines is great).
>
> You can add my:
> Reviewed-by: Richard Genoud <richard.genoud@gmail.com>
> on the whole serie.
>
> and my
> Tested-by: Richard Genoud <richard.genoud@gmail.com>
> on patch 7/8
>
>
> Richard.

Thanks for the review and the tests.

Best Regards,

Boris

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 0/8] ARM: at91/dt: make use of periph id macros
  2013-08-01 11:06       ` boris brezillon
@ 2013-08-01 11:13         ` Mark Brown
  -1 siblings, 0 replies; 42+ messages in thread
From: Mark Brown @ 2013-08-01 11:13 UTC (permalink / raw)
  To: boris brezillon
  Cc: Richard Genoud, Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, devicetree, linux-kernel,
	linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

On Thu, Aug 01, 2013 at 01:06:20PM +0200, boris brezillon wrote:

> >[changed Mark Brown address from opensource.wolfsonmicro.com to
> >kernel.org (the 1st one failed)]

> Sorry Mark. Do you want me to resend you the whole series ?

If it's just DT changes that don't require driver changes it's probably
not worth worrying about.  If there's driver changes please resend at
least those.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 0/8] ARM: at91/dt: make use of periph id macros
@ 2013-08-01 11:13         ` Mark Brown
  0 siblings, 0 replies; 42+ messages in thread
From: Mark Brown @ 2013-08-01 11:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Aug 01, 2013 at 01:06:20PM +0200, boris brezillon wrote:

> >[changed Mark Brown address from opensource.wolfsonmicro.com to
> >kernel.org (the 1st one failed)]

> Sorry Mark. Do you want me to resend you the whole series ?

If it's just DT changes that don't require driver changes it's probably
not worth worrying about.  If there's driver changes please resend at
least those.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130801/7ebffae8/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 0/8] ARM: at91/dt: make use of periph id macros
  2013-08-01 11:13         ` Mark Brown
@ 2013-08-01 11:20           ` boris brezillon
  -1 siblings, 0 replies; 42+ messages in thread
From: boris brezillon @ 2013-08-01 11:20 UTC (permalink / raw)
  To: Mark Brown
  Cc: Richard Genoud, Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, devicetree, linux-kernel,
	linux-arm-kernel

On 01/08/2013 13:13, Mark Brown wrote:
> On Thu, Aug 01, 2013 at 01:06:20PM +0200, boris brezillon wrote:
>
>>> [changed Mark Brown address from opensource.wolfsonmicro.com to
>>> kernel.org (the 1st one failed)]
>> Sorry Mark. Do you want me to resend you the whole series ?
> If it's just DT changes that don't require driver changes it's probably
> not worth worrying about.  If there's driver changes please resend at
> least those.
It's just DT changes.

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 0/8] ARM: at91/dt: make use of periph id macros
@ 2013-08-01 11:20           ` boris brezillon
  0 siblings, 0 replies; 42+ messages in thread
From: boris brezillon @ 2013-08-01 11:20 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/08/2013 13:13, Mark Brown wrote:
> On Thu, Aug 01, 2013 at 01:06:20PM +0200, boris brezillon wrote:
>
>>> [changed Mark Brown address from opensource.wolfsonmicro.com to
>>> kernel.org (the 1st one failed)]
>> Sorry Mark. Do you want me to resend you the whole series ?
> If it's just DT changes that don't require driver changes it's probably
> not worth worrying about.  If there's driver changes please resend at
> least those.
It's just DT changes.

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 0/8] ARM: at91/dt: make use of periph id macros
  2013-08-01  7:37   ` Richard Genoud
@ 2013-08-02  9:04     ` boris brezillon
  -1 siblings, 0 replies; 42+ messages in thread
From: boris brezillon @ 2013-08-02  9:04 UTC (permalink / raw)
  To: Richard Genoud
  Cc: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Mark Brown, devicetree,
	linux-kernel, linux-arm-kernel

Hello Richard,

On 01/08/2013 09:37, Richard Genoud wrote:
> 2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
>> Hello,
>>
>> This patch series move at91 SoCs peripheral id definitions from machine
>> specific include dir to dt-bindings include dir.
>> These macros are used to reference interrupts instead of peripheral numbers.
>>
>> This makes dt definitions cleaner and easier to debug (one can easily tell if
>> the peripheral macro used to reference an interrupt line is not the good one).
>>
>> These macros will be used for clk definitions and references too.
>>
>> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
>> definitions as there are no soc specific directories in dt-bindings include
>> dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
>> 'include/dt-bindings/peripherals/at91/xxx' would be better.
>> What do you think ?
> Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
> has been dropped for new atmel SoCs (sama5 for instance).

Should I do the same for at91 clk series (replace drivers/clk/at91 directory
by drivers/clk/atmel and include/linux/clk/at91_pmc.h by
include/linux/clk/atmel_pmc.h) ?

>
> my 2 cents...
>
> Richard.

Best Regards,

Boris

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 0/8] ARM: at91/dt: make use of periph id macros
@ 2013-08-02  9:04     ` boris brezillon
  0 siblings, 0 replies; 42+ messages in thread
From: boris brezillon @ 2013-08-02  9:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Richard,

On 01/08/2013 09:37, Richard Genoud wrote:
> 2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
>> Hello,
>>
>> This patch series move at91 SoCs peripheral id definitions from machine
>> specific include dir to dt-bindings include dir.
>> These macros are used to reference interrupts instead of peripheral numbers.
>>
>> This makes dt definitions cleaner and easier to debug (one can easily tell if
>> the peripheral macro used to reference an interrupt line is not the good one).
>>
>> These macros will be used for clk definitions and references too.
>>
>> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put these
>> definitions as there are no soc specific directories in dt-bindings include
>> dir right now. Maybe something like 'include/dt-bindings/soc/at91/xxx' or
>> 'include/dt-bindings/peripherals/at91/xxx' would be better.
>> What do you think ?
> Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
> has been dropped for new atmel SoCs (sama5 for instance).

Should I do the same for at91 clk series (replace drivers/clk/at91 directory
by drivers/clk/atmel and include/linux/clk/at91_pmc.h by
include/linux/clk/atmel_pmc.h) ?

>
> my 2 cents...
>
> Richard.

Best Regards,

Boris

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 0/8] ARM: at91/dt: make use of periph id macros
  2013-08-02  9:04     ` boris brezillon
@ 2013-08-02  9:28       ` Richard Genoud
  -1 siblings, 0 replies; 42+ messages in thread
From: Richard Genoud @ 2013-08-02  9:28 UTC (permalink / raw)
  To: boris brezillon
  Cc: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, Mark Brown, devicetree,
	linux-kernel, linux-arm-kernel

On 02/08/2013 11:04, boris brezillon wrote:
> Hello Richard,
> 
> On 01/08/2013 09:37, Richard Genoud wrote:
>> 2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
>>> Hello,
>>>
>>> This patch series move at91 SoCs peripheral id definitions from machine
>>> specific include dir to dt-bindings include dir.
>>> These macros are used to reference interrupts instead of peripheral
>>> numbers.
>>>
>>> This makes dt definitions cleaner and easier to debug (one can easily
>>> tell if
>>> the peripheral macro used to reference an interrupt line is not the
>>> good one).
>>>
>>> These macros will be used for clk definitions and references too.
>>>
>>> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put
>>> these
>>> definitions as there are no soc specific directories in dt-bindings
>>> include
>>> dir right now. Maybe something like
>>> 'include/dt-bindings/soc/at91/xxx' or
>>> 'include/dt-bindings/peripherals/at91/xxx' would be better.
>>> What do you think ?
>> Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
>> has been dropped for new atmel SoCs (sama5 for instance).
> 
> Should I do the same for at91 clk series (replace drivers/clk/at91
> directory
> by drivers/clk/atmel and include/linux/clk/at91_pmc.h by
> include/linux/clk/atmel_pmc.h) ?
I would say so, but like you said, that needs atmel maintainer's feedback !


^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 0/8] ARM: at91/dt: make use of periph id macros
@ 2013-08-02  9:28       ` Richard Genoud
  0 siblings, 0 replies; 42+ messages in thread
From: Richard Genoud @ 2013-08-02  9:28 UTC (permalink / raw)
  To: linux-arm-kernel

On 02/08/2013 11:04, boris brezillon wrote:
> Hello Richard,
> 
> On 01/08/2013 09:37, Richard Genoud wrote:
>> 2013/8/1 Boris BREZILLON <b.brezillon@overkiz.com>:
>>> Hello,
>>>
>>> This patch series move at91 SoCs peripheral id definitions from machine
>>> specific include dir to dt-bindings include dir.
>>> These macros are used to reference interrupts instead of peripheral
>>> numbers.
>>>
>>> This makes dt definitions cleaner and easier to debug (one can easily
>>> tell if
>>> the peripheral macro used to reference an interrupt line is not the
>>> good one).
>>>
>>> These macros will be used for clk definitions and references too.
>>>
>>> I am not sure 'include/dt-bindings/at91/xxx' is the best place to put
>>> these
>>> definitions as there are no soc specific directories in dt-bindings
>>> include
>>> dir right now. Maybe something like
>>> 'include/dt-bindings/soc/at91/xxx' or
>>> 'include/dt-bindings/peripherals/at91/xxx' would be better.
>>> What do you think ?
>> Well, I'd rather use "atmel" than "at91" because, AFAIK, this prefix
>> has been dropped for new atmel SoCs (sama5 for instance).
> 
> Should I do the same for at91 clk series (replace drivers/clk/at91
> directory
> by drivers/clk/atmel and include/linux/clk/at91_pmc.h by
> include/linux/clk/atmel_pmc.h) ?
I would say so, but like you said, that needs atmel maintainer's feedback !

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
  2013-08-01  6:52   ` Boris BREZILLON
@ 2013-08-07 20:24     ` Arnd Bergmann
  -1 siblings, 0 replies; 42+ messages in thread
From: Arnd Bergmann @ 2013-08-07 20:24 UTC (permalink / raw)
  To: Boris BREZILLON
  Cc: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, devicetree, linux-kernel,
	linux-arm-kernel

On Thursday 01 August 2013, Boris BREZILLON wrote:
> 
> This patch moves peripheral id definitions from machine specific include
> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
> 
> These definitions will be used inside dt to define interrupt ids and
> peripheral clk ids.
> 
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>

This seems counterproductive, why would you do that?

There is no sharing of identifiers across SoCs here, you just move the
data around, and changing the .dts files to use the abstract macros would
just end up making them harder to understand, not easier, since you then
have to look up the numbers in another file.

	Arnd

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
@ 2013-08-07 20:24     ` Arnd Bergmann
  0 siblings, 0 replies; 42+ messages in thread
From: Arnd Bergmann @ 2013-08-07 20:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 01 August 2013, Boris BREZILLON wrote:
> 
> This patch moves peripheral id definitions from machine specific include
> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
> 
> These definitions will be used inside dt to define interrupt ids and
> peripheral clk ids.
> 
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>

This seems counterproductive, why would you do that?

There is no sharing of identifiers across SoCs here, you just move the
data around, and changing the .dts files to use the abstract macros would
just end up making them harder to understand, not easier, since you then
have to look up the numbers in another file.

	Arnd

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
  2013-08-07 20:24     ` Arnd Bergmann
@ 2013-08-08  4:09       ` boris brezillon
  -1 siblings, 0 replies; 42+ messages in thread
From: boris brezillon @ 2013-08-08  4:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Nicolas Ferre, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, devicetree, linux-kernel,
	linux-arm-kernel

Hello Arnd,

On 07/08/2013 22:24, Arnd Bergmann wrote:
> On Thursday 01 August 2013, Boris BREZILLON wrote:
>> This patch moves peripheral id definitions from machine specific include
>> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
>> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
>>
>> These definitions will be used inside dt to define interrupt ids and
>> peripheral clk ids.
>>
>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> This seems counterproductive, why would you do that?

This was requested by Jean-Christophe Plagniol-Villard (and proposed by 
Richard Genoud)
for the 3rd version of the "ARM: at91: move to common clk framework" 
patch series (see
https://lkml.org/lkml/2013/7/29/361) and thought it was a good idea too 
(even if I didn't know
where to put the macro files as there are no soc specific macro files in 
dt-bindings include
dir).

Indeed I found it much easier to detect bugs in dt definition using 
macros because
the macro names and dt node names are the same (it does not protect 
against errors
in the macro definitions).

If you think these macro definitions should be dropped, I won't argue 
against this.
But please, have a talk with Jean-Christophe first.

Best Regards,

Boris

> There is no sharing of identifiers across SoCs here, you just move the
> data around, and changing the .dts files to use the abstract macros would
> just end up making them harder to understand, not easier, since you then
> have to look up the numbers in another file.
>
> 	Arnd


^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
@ 2013-08-08  4:09       ` boris brezillon
  0 siblings, 0 replies; 42+ messages in thread
From: boris brezillon @ 2013-08-08  4:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Arnd,

On 07/08/2013 22:24, Arnd Bergmann wrote:
> On Thursday 01 August 2013, Boris BREZILLON wrote:
>> This patch moves peripheral id definitions from machine specific include
>> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
>> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
>>
>> These definitions will be used inside dt to define interrupt ids and
>> peripheral clk ids.
>>
>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
> This seems counterproductive, why would you do that?

This was requested by Jean-Christophe Plagniol-Villard (and proposed by 
Richard Genoud)
for the 3rd version of the "ARM: at91: move to common clk framework" 
patch series (see
https://lkml.org/lkml/2013/7/29/361) and thought it was a good idea too 
(even if I didn't know
where to put the macro files as there are no soc specific macro files in 
dt-bindings include
dir).

Indeed I found it much easier to detect bugs in dt definition using 
macros because
the macro names and dt node names are the same (it does not protect 
against errors
in the macro definitions).

If you think these macro definitions should be dropped, I won't argue 
against this.
But please, have a talk with Jean-Christophe first.

Best Regards,

Boris

> There is no sharing of identifiers across SoCs here, you just move the
> data around, and changing the .dts files to use the abstract macros would
> just end up making them harder to understand, not easier, since you then
> have to look up the numbers in another file.
>
> 	Arnd

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
  2013-08-08  4:09       ` boris brezillon
@ 2013-08-19 16:46         ` Nicolas Ferre
  -1 siblings, 0 replies; 42+ messages in thread
From: Nicolas Ferre @ 2013-08-19 16:46 UTC (permalink / raw)
  To: boris brezillon, Arnd Bergmann, Jean-Christophe Plagniol-Villard,
	Richard Genoud
  Cc: Ludovic Desroches, Russell King, devicetree, linux-kernel,
	linux-arm-kernel

On 08/08/2013 06:09, boris brezillon :
> Hello Arnd,
>
> On 07/08/2013 22:24, Arnd Bergmann wrote:
>> On Thursday 01 August 2013, Boris BREZILLON wrote:
>>> This patch moves peripheral id definitions from machine specific include
>>> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
>>> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
>>>
>>> These definitions will be used inside dt to define interrupt ids and
>>> peripheral clk ids.
>>>
>>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>> This seems counterproductive, why would you do that?
>
> This was requested by Jean-Christophe Plagniol-Villard (and proposed by
> Richard Genoud)
> for the 3rd version of the "ARM: at91: move to common clk framework"
> patch series (see
> https://lkml.org/lkml/2013/7/29/361) and thought it was a good idea too
> (even if I didn't know
> where to put the macro files as there are no soc specific macro files in
> dt-bindings include
> dir).
>
> Indeed I found it much easier to detect bugs in dt definition using
> macros because
> the macro names and dt node names are the same (it does not protect
> against errors
> in the macro definitions).
>
> If you think these macro definitions should be dropped, I won't argue
> against this.
> But please, have a talk with Jean-Christophe first.

[..]

>> There is no sharing of identifiers across SoCs here, you just move the
>> data around, and changing the .dts files to use the abstract macros would
>> just end up making them harder to understand, not easier, since you then
>> have to look up the numbers in another file.

Boris, Jean-Christophe and Richard,

Well, I must say that I do agree with Arnd on this point.

I think that a simple numeric field in a cell has to be represented as a 
number and even if this simple information is used twice (interrupt 
number and clock bit position in PMC). The possibility of error is very 
low compared to the big amount of unneeded definitions added by this 
solution.

Moreover, I had the hope to completely remove this long list of 
peripheral definitions for all SoC when we have a full DT kernel (with 
your patches about common clock framework). So I think it is not 
interesting to move in this direction and continue to build such a list 
for future full DT products...

Believe me, I am sorry that I didn't entered the discussion earlier and 
avoid unnecessary work... Anyway, give me your opinion, but I do think 
that the simpler is the best.

Bye,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
@ 2013-08-19 16:46         ` Nicolas Ferre
  0 siblings, 0 replies; 42+ messages in thread
From: Nicolas Ferre @ 2013-08-19 16:46 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/08/2013 06:09, boris brezillon :
> Hello Arnd,
>
> On 07/08/2013 22:24, Arnd Bergmann wrote:
>> On Thursday 01 August 2013, Boris BREZILLON wrote:
>>> This patch moves peripheral id definitions from machine specific include
>>> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
>>> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
>>>
>>> These definitions will be used inside dt to define interrupt ids and
>>> peripheral clk ids.
>>>
>>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>> This seems counterproductive, why would you do that?
>
> This was requested by Jean-Christophe Plagniol-Villard (and proposed by
> Richard Genoud)
> for the 3rd version of the "ARM: at91: move to common clk framework"
> patch series (see
> https://lkml.org/lkml/2013/7/29/361) and thought it was a good idea too
> (even if I didn't know
> where to put the macro files as there are no soc specific macro files in
> dt-bindings include
> dir).
>
> Indeed I found it much easier to detect bugs in dt definition using
> macros because
> the macro names and dt node names are the same (it does not protect
> against errors
> in the macro definitions).
>
> If you think these macro definitions should be dropped, I won't argue
> against this.
> But please, have a talk with Jean-Christophe first.

[..]

>> There is no sharing of identifiers across SoCs here, you just move the
>> data around, and changing the .dts files to use the abstract macros would
>> just end up making them harder to understand, not easier, since you then
>> have to look up the numbers in another file.

Boris, Jean-Christophe and Richard,

Well, I must say that I do agree with Arnd on this point.

I think that a simple numeric field in a cell has to be represented as a 
number and even if this simple information is used twice (interrupt 
number and clock bit position in PMC). The possibility of error is very 
low compared to the big amount of unneeded definitions added by this 
solution.

Moreover, I had the hope to completely remove this long list of 
peripheral definitions for all SoC when we have a full DT kernel (with 
your patches about common clock framework). So I think it is not 
interesting to move in this direction and continue to build such a list 
for future full DT products...

Believe me, I am sorry that I didn't entered the discussion earlier and 
avoid unnecessary work... Anyway, give me your opinion, but I do think 
that the simpler is the best.

Bye,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
  2013-08-19 16:46         ` Nicolas Ferre
@ 2013-08-20  6:11           ` b.brezillon at overkiz.com
  -1 siblings, 0 replies; 42+ messages in thread
From: b.brezillon @ 2013-08-20  6:11 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Arnd Bergmann, Jean-Christophe Plagniol-Villard, Richard Genoud,
	Ludovic Desroches, Russell King, devicetree, linux-kernel,
	linux-arm-kernel

Hello Nicolas,

On Mon, 19 Aug 2013 18:46:13 +0200, Nicolas Ferre
<nicolas.ferre@atmel.com> wrote:
> On 08/08/2013 06:09, boris brezillon :
>> Hello Arnd,
>>
>> On 07/08/2013 22:24, Arnd Bergmann wrote:
>>> On Thursday 01 August 2013, Boris BREZILLON wrote:
>>>> This patch moves peripheral id definitions from machine specific include
>>>> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
>>>> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
>>>>
>>>> These definitions will be used inside dt to define interrupt ids and
>>>> peripheral clk ids.
>>>>
>>>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>>> This seems counterproductive, why would you do that?
>>
>> This was requested by Jean-Christophe Plagniol-Villard (and proposed by
>> Richard Genoud)
>> for the 3rd version of the "ARM: at91: move to common clk framework"
>> patch series (see
>> https://lkml.org/lkml/2013/7/29/361) and thought it was a good idea too
>> (even if I didn't know
>> where to put the macro files as there are no soc specific macro files in
>> dt-bindings include
>> dir).
>>
>> Indeed I found it much easier to detect bugs in dt definition using
>> macros because
>> the macro names and dt node names are the same (it does not protect
>> against errors
>> in the macro definitions).
>>
>> If you think these macro definitions should be dropped, I won't argue
>> against this.
>> But please, have a talk with Jean-Christophe first.
> 
> [..]
> 
>>> There is no sharing of identifiers across SoCs here, you just move the
>>> data around, and changing the .dts files to use the abstract macros would
>>> just end up making them harder to understand, not easier, since you then
>>> have to look up the numbers in another file.
> 
> Boris, Jean-Christophe and Richard,
> 
> Well, I must say that I do agree with Arnd on this point.
> 
> I think that a simple numeric field in a cell has to be represented
> as a number and even if this simple information is used twice
> (interrupt number and clock bit position in PMC). The possibility of
> error is very low compared to the big amount of unneeded definitions
> added by this solution.
> 
> Moreover, I had the hope to completely remove this long list of
> peripheral definitions for all SoC when we have a full DT kernel (with
> your patches about common clock framework). So I think it is not
> interesting to move in this direction and continue to build such a
> list for future full DT products...
> 
> Believe me, I am sorry that I didn't entered the discussion earlier
> and avoid unnecessary work... Anyway, give me your opinion, but I do
> think that the simpler is the best.
> 

As discussed with you (on IRC), I am not absolutely convinced we need
these macro definitions, and given the direction you want to take
(completely
remove the peripheral id definitions), i would say we'd rather drop
this patch.
It won't bother me at all to rework the "sama5 dt clk" patch series
(this is the
only SoC I supported in the 3rd version of the at91 common clk
transition)
to remove references to these macros.

Best Regards,
Boris

> Bye,


^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
@ 2013-08-20  6:11           ` b.brezillon at overkiz.com
  0 siblings, 0 replies; 42+ messages in thread
From: b.brezillon at overkiz.com @ 2013-08-20  6:11 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Nicolas,

On Mon, 19 Aug 2013 18:46:13 +0200, Nicolas Ferre
<nicolas.ferre@atmel.com> wrote:
> On 08/08/2013 06:09, boris brezillon :
>> Hello Arnd,
>>
>> On 07/08/2013 22:24, Arnd Bergmann wrote:
>>> On Thursday 01 August 2013, Boris BREZILLON wrote:
>>>> This patch moves peripheral id definitions from machine specific include
>>>> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds include
>>>> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
>>>>
>>>> These definitions will be used inside dt to define interrupt ids and
>>>> peripheral clk ids.
>>>>
>>>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>>> This seems counterproductive, why would you do that?
>>
>> This was requested by Jean-Christophe Plagniol-Villard (and proposed by
>> Richard Genoud)
>> for the 3rd version of the "ARM: at91: move to common clk framework"
>> patch series (see
>> https://lkml.org/lkml/2013/7/29/361) and thought it was a good idea too
>> (even if I didn't know
>> where to put the macro files as there are no soc specific macro files in
>> dt-bindings include
>> dir).
>>
>> Indeed I found it much easier to detect bugs in dt definition using
>> macros because
>> the macro names and dt node names are the same (it does not protect
>> against errors
>> in the macro definitions).
>>
>> If you think these macro definitions should be dropped, I won't argue
>> against this.
>> But please, have a talk with Jean-Christophe first.
> 
> [..]
> 
>>> There is no sharing of identifiers across SoCs here, you just move the
>>> data around, and changing the .dts files to use the abstract macros would
>>> just end up making them harder to understand, not easier, since you then
>>> have to look up the numbers in another file.
> 
> Boris, Jean-Christophe and Richard,
> 
> Well, I must say that I do agree with Arnd on this point.
> 
> I think that a simple numeric field in a cell has to be represented
> as a number and even if this simple information is used twice
> (interrupt number and clock bit position in PMC). The possibility of
> error is very low compared to the big amount of unneeded definitions
> added by this solution.
> 
> Moreover, I had the hope to completely remove this long list of
> peripheral definitions for all SoC when we have a full DT kernel (with
> your patches about common clock framework). So I think it is not
> interesting to move in this direction and continue to build such a
> list for future full DT products...
> 
> Believe me, I am sorry that I didn't entered the discussion earlier
> and avoid unnecessary work... Anyway, give me your opinion, but I do
> think that the simpler is the best.
> 

As discussed with you (on IRC), I am not absolutely convinced we need
these macro definitions, and given the direction you want to take
(completely
remove the peripheral id definitions), i would say we'd rather drop
this patch.
It won't bother me at all to rework the "sama5 dt clk" patch series
(this is the
only SoC I supported in the 3rd version of the at91 common clk
transition)
to remove references to these macros.

Best Regards,
Boris

> Bye,

^ permalink raw reply	[flat|nested] 42+ messages in thread

* Re: [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
  2013-08-19 16:46         ` Nicolas Ferre
@ 2013-08-20  9:21           ` Richard Genoud
  -1 siblings, 0 replies; 42+ messages in thread
From: Richard Genoud @ 2013-08-20  9:21 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: boris brezillon, Arnd Bergmann, Jean-Christophe Plagniol-Villard,
	Ludovic Desroches, Russell King, devicetree, linux-kernel,
	linux-arm-kernel

2013/8/19 Nicolas Ferre <nicolas.ferre@atmel.com>:
> On 08/08/2013 06:09, boris brezillon :
>
>> Hello Arnd,
>>
>> On 07/08/2013 22:24, Arnd Bergmann wrote:
>>>
>>> On Thursday 01 August 2013, Boris BREZILLON wrote:
>>>>
>>>> This patch moves peripheral id definitions from machine specific include
>>>> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds
>>>> include
>>>> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
>>>>
>>>> These definitions will be used inside dt to define interrupt ids and
>>>> peripheral clk ids.
>>>>
>>>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>>>
>>> This seems counterproductive, why would you do that?
>>
>>
>> This was requested by Jean-Christophe Plagniol-Villard (and proposed by
>> Richard Genoud)
>> for the 3rd version of the "ARM: at91: move to common clk framework"
>> patch series (see
>> https://lkml.org/lkml/2013/7/29/361) and thought it was a good idea too
>> (even if I didn't know
>> where to put the macro files as there are no soc specific macro files in
>> dt-bindings include
>> dir).
>>
>> Indeed I found it much easier to detect bugs in dt definition using
>> macros because
>> the macro names and dt node names are the same (it does not protect
>> against errors
>> in the macro definitions).
>>
>> If you think these macro definitions should be dropped, I won't argue
>> against this.
>> But please, have a talk with Jean-Christophe first.
>
>
> [..]
>
>
>>> There is no sharing of identifiers across SoCs here, you just move the
>>> data around, and changing the .dts files to use the abstract macros would
>>> just end up making them harder to understand, not easier, since you then
>>> have to look up the numbers in another file.
>
>
> Boris, Jean-Christophe and Richard,
>
> Well, I must say that I do agree with Arnd on this point.
>
> I think that a simple numeric field in a cell has to be represented as a
> number and even if this simple information is used twice (interrupt number
> and clock bit position in PMC). The possibility of error is very low
> compared to the big amount of unneeded definitions added by this solution.

Well, maybe the use of macro there is a bit overkill...
But after reviewing the patches (and found an error), I thought it was
useful to use macros, because verifying each number according to the
SoC manual is a pain !
It's way easier to check the header once for all, then there's no
possible error in the dtsi (or at least, we can see it from far far
away...)
On the downside, I agree, it adds a lot of defines. (and once it has
been validated, the dtsi should not change)

my 2 cents...

^ permalink raw reply	[flat|nested] 42+ messages in thread

* [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir
@ 2013-08-20  9:21           ` Richard Genoud
  0 siblings, 0 replies; 42+ messages in thread
From: Richard Genoud @ 2013-08-20  9:21 UTC (permalink / raw)
  To: linux-arm-kernel

2013/8/19 Nicolas Ferre <nicolas.ferre@atmel.com>:
> On 08/08/2013 06:09, boris brezillon :
>
>> Hello Arnd,
>>
>> On 07/08/2013 22:24, Arnd Bergmann wrote:
>>>
>>> On Thursday 01 August 2013, Boris BREZILLON wrote:
>>>>
>>>> This patch moves peripheral id definitions from machine specific include
>>>> dir (arch/arm/mach-at91/include/mach/'soc-name'.h) to dt-bindinds
>>>> include
>>>> dir (include/dt-bindings/at91/'soc-name'/peripherals.h).
>>>>
>>>> These definitions will be used inside dt to define interrupt ids and
>>>> peripheral clk ids.
>>>>
>>>> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
>>>
>>> This seems counterproductive, why would you do that?
>>
>>
>> This was requested by Jean-Christophe Plagniol-Villard (and proposed by
>> Richard Genoud)
>> for the 3rd version of the "ARM: at91: move to common clk framework"
>> patch series (see
>> https://lkml.org/lkml/2013/7/29/361) and thought it was a good idea too
>> (even if I didn't know
>> where to put the macro files as there are no soc specific macro files in
>> dt-bindings include
>> dir).
>>
>> Indeed I found it much easier to detect bugs in dt definition using
>> macros because
>> the macro names and dt node names are the same (it does not protect
>> against errors
>> in the macro definitions).
>>
>> If you think these macro definitions should be dropped, I won't argue
>> against this.
>> But please, have a talk with Jean-Christophe first.
>
>
> [..]
>
>
>>> There is no sharing of identifiers across SoCs here, you just move the
>>> data around, and changing the .dts files to use the abstract macros would
>>> just end up making them harder to understand, not easier, since you then
>>> have to look up the numbers in another file.
>
>
> Boris, Jean-Christophe and Richard,
>
> Well, I must say that I do agree with Arnd on this point.
>
> I think that a simple numeric field in a cell has to be represented as a
> number and even if this simple information is used twice (interrupt number
> and clock bit position in PMC). The possibility of error is very low
> compared to the big amount of unneeded definitions added by this solution.

Well, maybe the use of macro there is a bit overkill...
But after reviewing the patches (and found an error), I thought it was
useful to use macros, because verifying each number according to the
SoC manual is a pain !
It's way easier to check the header once for all, then there's no
possible error in the dtsi (or at least, we can see it from far far
away...)
On the downside, I agree, it adds a lot of defines. (and once it has
been validated, the dtsi should not change)

my 2 cents...

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2013-08-20  9:21 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-01  6:48 [PATCH 0/8] ARM: at91/dt: make use of periph id macros Boris BREZILLON
2013-08-01  6:48 ` Boris BREZILLON
2013-08-01  6:52 ` [PATCH 1/8] ARM: at91: move peripheral id definitions to dt-bindings include dir Boris BREZILLON
2013-08-01  6:52   ` Boris BREZILLON
2013-08-07 20:24   ` Arnd Bergmann
2013-08-07 20:24     ` Arnd Bergmann
2013-08-08  4:09     ` boris brezillon
2013-08-08  4:09       ` boris brezillon
2013-08-19 16:46       ` Nicolas Ferre
2013-08-19 16:46         ` Nicolas Ferre
2013-08-20  6:11         ` b.brezillon
2013-08-20  6:11           ` b.brezillon at overkiz.com
2013-08-20  9:21         ` Richard Genoud
2013-08-20  9:21           ` Richard Genoud
2013-08-01  6:53 ` [PATCH 2/8] ARM: at91/dt: use periph id macros for at91rm9200 interrupt definitions Boris BREZILLON
2013-08-01  6:53   ` Boris BREZILLON
2013-08-01  6:54 ` [PATCH 3/8] ARM: at91/dt: use periph id macros for at91sam9260 " Boris BREZILLON
2013-08-01  6:54   ` Boris BREZILLON
2013-08-01  6:55 ` [PATCH 4/8] ARM: at91/dt: use periph id macros for at91sam9263 " Boris BREZILLON
2013-08-01  6:55   ` Boris BREZILLON
2013-08-01  6:57 ` [PATCH 5/8] ARM: at91/dt: use periph id macros for at91sam9g45 " Boris BREZILLON
2013-08-01  6:57   ` Boris BREZILLON
2013-08-01  6:58 ` [PATCH 6/8] ARM: at91/dt: use periph id macros for at91sam9n12 " Boris BREZILLON
2013-08-01  6:58   ` Boris BREZILLON
2013-08-01  7:00 ` [PATCH 7/8] ARM: at91/dt: use periph id macros for at91sam9x5 " Boris BREZILLON
2013-08-01  7:00   ` Boris BREZILLON
2013-08-01  7:01 ` [PATCH 8/8] ARM: at91/dt: use periph id macros for sama5d3 " Boris BREZILLON
2013-08-01  7:01   ` Boris BREZILLON
2013-08-01  7:37 ` [PATCH 0/8] ARM: at91/dt: make use of periph id macros Richard Genoud
2013-08-01  7:37   ` Richard Genoud
2013-08-01  9:27   ` Richard Genoud
2013-08-01  9:27     ` Richard Genoud
2013-08-01 11:06     ` boris brezillon
2013-08-01 11:06       ` boris brezillon
2013-08-01 11:13       ` Mark Brown
2013-08-01 11:13         ` Mark Brown
2013-08-01 11:20         ` boris brezillon
2013-08-01 11:20           ` boris brezillon
2013-08-02  9:04   ` boris brezillon
2013-08-02  9:04     ` boris brezillon
2013-08-02  9:28     ` Richard Genoud
2013-08-02  9:28       ` Richard Genoud

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.