Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753383AbbKUUrl (ORCPT ); Sat, 21 Nov 2015 15:47:41 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:58188 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151AbbKUUri (ORCPT ); Sat, 21 Nov 2015 15:47:38 -0500 From: Arnd Bergmann To: Joshua Henderson Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Cristian Birsan , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , devicetree@vger.kernel.org Subject: Re: [PATCH 01/14] DEVICETREE: Add bindings for PIC32 interrupt controller Date: Sat, 21 Nov 2015 21:47:14 +0100 Message-ID: <7036408.cJ9oZKCcQe@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1448065205-15762-2-git-send-email-joshua.henderson@microchip.com> References: <1448065205-15762-1-git-send-email-joshua.henderson@microchip.com> <1448065205-15762-2-git-send-email-joshua.henderson@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:9uwU2p9RhbbSnSJVp2ow+Fof3ZdRlhQOTpG/lh85mGfIbJcN5Hd ffqJWPMlNaA5mAvSEA0W0KdmcXUYgD60adlhTRctLfoRec/AKZNU7mnD/G40AyBPcAgOGJQ T+0EjiH1RLNlkk2JoFBqEpXI8vDCeHPNNRC/pLhcxGXkZR3NMbAm3cRIsroh59fZcZ6+/F5 HMTnfRXdzqYnTcHaO2YLw== X-UI-Out-Filterresults: notjunk:1;V01:K0:9yAiyW3X7L4=:x9x0fFJJO5hTME5cCkxP4a 6AgeegPW8u3r6iN0KFSHhQnd3nBYWJASmmdHBcpeO8o2ByJsXBTMyTCC+8hTTMrpzONzAhYvV +oCy+75a/UI8T3/lTAXzX8VxjFQkmAjqHJA7mHnciVapu3TIFgo8jdCtZk4OuqRb9E7dBzKOX TGbK9KCsjhkOi+RA1YXxRQ2ksqNBZYhQu41b1tH0RdsFQaKHP78/uirz3on5o208CbQO6HPt2 miVgmwA0mI1lm64ykHxp4uyNVk4m1fze22gnP2wcu/a4nUGvj6qmKch2VlnY7A3gtYQOiX7ig epqEg9HElgDAd3FEWcNRDxWQLAbovK1fesZdrSXcsAam4TKvTv5vwuH3Kxq7yoFztQeAwd5UV RRHeRjwLWBr6IYMwZiL34dXXki1xotQdqS2oBU3bATZ5ItxzLABWHu/4ZPyXpzlYoB33X6nYq kXYNtG5jNVFTv3vhbA+KZg+RiKhcBQ8CVHfq7sVgMHuhoQolQ0EOOy7CkZu/eRkUdkTuE6UCZ 27xj/cE+CqAl3QtmAe9MFnQboR6QZ++8Vca+IfVJdA4T2vncIzQXAENwYJy/09skK91rQ7AVz SK9EuEItIEHQZ+sJxEIlPKFTr1N0MBiH75c3KUgBB4nLBCmXEdgiDeambTFI1g4RDqIHQWjSY aPC1/MZEefkEACtiB2mBAJEpVezUw4e+faR6g2HlKgcDvLLzRnDQ1pkIBTCwCHe4wnR/rstCy t4b6opiII7fwAckd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2869 Lines: 88 On Friday 20 November 2015 17:17:13 Joshua Henderson wrote: > +Example > +------- > + > +evic: interrupt-controller@1f810000 { > + compatible = "microchip,evic-v2"; > + interrupt-controller; > + #interrupt-cells = <3>; > + reg = <0x1f810000 0x1000>; > + device_type="evic-v2"; > +}; This is not a correct use of device_type. Just drop that property. > diff --git a/include/dt-bindings/interrupt-controller/microchip,pic32mz-evic.h b/include/dt-bindings/interrupt-controller/microchip,pic32mz-evic.h > new file mode 100644 > index 0000000..2c466b8 > --- /dev/null > +++ b/include/dt-bindings/interrupt-controller/microchip,pic32mz-evic.h > @@ -0,0 +1,238 @@ > +/* > + * This header provides constants for the MICROCHIP PIC32 EVIC. > + */ > + > +#ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_MICROCHIP_EVIC_H > +#define _DT_BINDINGS_INTERRUPT_CONTROLLER_MICROCHIP_EVIC_H > + > +#include > + > +/* Hardware interrupt number */ > +#define CORE_TIMER_INTERRUPT 0 > +#define CORE_SOFTWARE_INTERRUPT_0 1 > +#define CORE_SOFTWARE_INTERRUPT_1 2 > +#define EXTERNAL_INTERRUPT_0 3 > +#define TIMER1 4 A header file like this is just going to make everyone's life miserable. Try to remove as much as possible here: normally you can just use the numbers from the data sheet that match the actual hardware registers, and put them into the dts file. > +/* Interrupt priority bits */ > +#define PRI_0 0 /* Note:This priority disables the interrupt! */ > +#define PRI_1 1 > +#define PRI_2 2 > +#define PRI_3 3 > +#define PRI_4 4 > +#define PRI_5 5 > +#define PRI_6 6 > +#define PRI_7 7 > +/* Interrupt subpriority bits */ > +#define SUB_PRI_0 0 > +#define SUB_PRI_1 1 > +#define SUB_PRI_2 2 > +#define SUB_PRI_3 3 These are obviously silly and should be removed/ > +#define PRI_MASK 0x7 /* 3 bit priority mask */ > +#define SUBPRI_MASK 0x3 /* 2 bit subpriority mask */ > +#define INT_MASK 0x1F /* 5 bit pri and subpri mask */ > +#define NR_EXT_IRQS 5 /* 5 external interrupts sources */ > + > +#define MICROCHIP_EVIC_MIN_PRIORITY 0 > +#define MICROCHIP_EVIC_MAX_PRIORITY INT_MASK > + > +#define INT_PRI(pri, subpri) \ > + (((pri & PRI_MASK) << 2) | (subpri & SUBPRI_MASK)) > + > +#define DEFINE_INT(irq, pri) { irq, pri } > + > +#define DEFAULT_INT_PRI INT_PRI(2, 0) Is it required to have a specific priority configured for each line? If these are software selectable, it's probably better to not put them into DT in the first place. If you absolutely need them, I would suggest using two separate cells for pri and subpri so you can avoid the macro. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/