From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754084AbdA3S6J (ORCPT ); Mon, 30 Jan 2017 13:58:09 -0500 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:38795 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753612AbdA3S6I (ORCPT ); Mon, 30 Jan 2017 13:58:08 -0500 Subject: Re: [PATCH 2/6] ARCv2: MCIP: Add structure for build register of IDU To: Yuriy Kolerov , References: <1485561703-20921-1-git-send-email-yuriy.kolerov@synopsys.com> <1485561703-20921-3-git-send-email-yuriy.kolerov@synopsys.com> CC: , , Newsgroups: gmane.linux.kernel,gmane.linux.kernel.arc From: Vineet Gupta Message-ID: Date: Mon, 30 Jan 2017 10:57:59 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1485561703-20921-3-git-send-email-yuriy.kolerov@synopsys.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.10.161.49] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/27/2017 04:01 PM, Yuriy Kolerov wrote: > This structure is necessary for retrieving of supported > number of common interrupts in IDU interrupt controller. > > Signed-off-by: Yuriy Kolerov > --- > include/soc/arc/mcip.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/include/soc/arc/mcip.h b/include/soc/arc/mcip.h > index 6902c2a..798c01b 100644 > --- a/include/soc/arc/mcip.h > +++ b/include/soc/arc/mcip.h > @@ -14,6 +14,7 @@ > #include > > #define ARC_REG_MCIP_BCR 0x0d0 > +#define ARC_REG_MCIP_IDU_BCR 0x0D5 > #define ARC_REG_MCIP_CMD 0x600 > #define ARC_REG_MCIP_WDATA 0x601 > #define ARC_REG_MCIP_READBACK 0x602 > @@ -69,6 +70,22 @@ struct mcip_bcr { > #endif > }; > > +struct mcip_idu_bcr { > +#ifdef CONFIG_CPU_BIG_ENDIAN > + unsigned int pad:21, cirqnum:3, ver:8; > +#else > + unsigned int ver:8, cirqnum:3, pad:21; > +#endif > +}; > + > + > +/* > + * Build register for IDU contains not an actual number of supported common > + * interrupts but an exponent of 2 which must be multiplied by 4 to > + * get a number of supported common interrupts. > + */ > +#define mcip_idu_bcr_to_nr_irqs(bcr) (4 * (1 << (bcr).cirqnum)) > + > /* > * MCIP programming model > * > Please squash this into patch which uses this infrastructure !