Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2835738imu; Fri, 23 Nov 2018 15:46:35 -0800 (PST) X-Google-Smtp-Source: AFSGD/W+6plEIZ6KMeKnBWk/W+oJd13R79Wk4TJjY6hKT2tcoW6CIWt5bJIHfb3MyG3exXgz5j9X X-Received: by 2002:a63:5a57:: with SMTP id k23mr15883667pgm.5.1543016795021; Fri, 23 Nov 2018 15:46:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543016794; cv=none; d=google.com; s=arc-20160816; b=lrRCV8llLp5JSCCqxgesywYlCFxXNpNzWGIU64SiYfkOMe6CKrTa1cWL/gi/X/lfTy LY29XKFBRCjT56LdpYSRX8ikENk2v+RZ3Q//kmDs8SJtetDB2Z/Ry09XRAX2GeDc4HR6 bdeUKMrUScKUngBEW+LQ+ZLLavflYjJ38imZzkXPz/2HqkUFzHHdflz8/fe3jHjwCmFg mfnsaUPfDhz5WOuYuRM67c1d31eyN8MQYkSmmPbwrNJK8c1msOSdp9BNpgfhVOmym5Lg v2PdqXIiL5xOQMCbQ3htr2JiwYAnP37UibVGFvLkIZiRLXD8c17AtDwAmTWgVACfaKc6 aohg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kVZ4aa1WWSiBf0BScwmwCPIOPM1Z1WJtDKh3NCGY4Uc=; b=yCvcBgoaVxNz3rHPveDEcz0ABB+plVdQeWWfcVH7vbaqHssD7EtML8J8/K+mYYt3sd rprlb1Q7m6DHA50vrdY9S2qij42HRwVzzOnBckNrea2pme6N1pH+Xj/it0dWl8x/yXSL fzAe1y/fvszSvqR3T4Fi6S9QK7RtoWi1wGMgAJINtdEJDMUTwf/Yf038aZnKU/9T/uco Yr08qscGy5ebCqNr21ePVy7fulBgxWVeiH7gQMjpSo4eIgdhZb8i3RystayHJuSjU/p1 SbIr4wqGRmp8rTXhDnWBXFsJwBp5GnPfDWBGkqMhQGA+rIi2c2BFYjL0wmWQ9TRTIXXE 5J/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AI+joUyk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23si13262940pgb.479.2018.11.23.15.46.17; Fri, 23 Nov 2018 15:46:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AI+joUyk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405702AbeKWBls (ORCPT + 99 others); Thu, 22 Nov 2018 20:41:48 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42517 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731038AbeKWBls (ORCPT ); Thu, 22 Nov 2018 20:41:48 -0500 Received: by mail-wr1-f68.google.com with SMTP id q18so9548539wrx.9; Thu, 22 Nov 2018 07:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kVZ4aa1WWSiBf0BScwmwCPIOPM1Z1WJtDKh3NCGY4Uc=; b=AI+joUykO7Y/1xau52rOO/p1Q88lH7Ac4dymFzop7bXXa7yvcn4R4r2IZBEai19Ffz ClNLsxHQu3cUtkmihQBMrHKJlCV4KpV2cr+VRygj5VNGdaHKYzQKd0ztwVXftH5czuQg uRG8C2bIzB+mZEedPRizbK+5RVF/6me2xdDSvJxCW0y4naCTmFBm4CGUN0eESlJORr3y tBIZt5HHMstQU+j9wmQ7amyJOVTxYm/4WQnM9vAVDvYJvmSIiedrMPy0qwO3XQKn8jfv OyAtQijzOqZLBj7BIE99wjyPoFBCbFaVbAJ6YADk1Q9PQdlUqpwW10Hvb4NO2+KVyLxW l6jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kVZ4aa1WWSiBf0BScwmwCPIOPM1Z1WJtDKh3NCGY4Uc=; b=BpWTM+1sShIxlrqxticvvIrtcMMH8gYEfBUHAOBZvpAdhAhp9yX3DcLzF3sCnIjRaA N4I9vnArpQF8hL/Cwz6AnoSPEXTmgyeV77Gl4cUHvSbmRdNsPEWbJJDGlo8bSbgyJKDZ UfNogwG5WB4dbZ/iAdsKWv52VCxhJnR9CI+i02e0qMYGesRiGGW9oa4aDKUvIUbis+UQ rJ6d2T3IvapXziAXnxrzjG0AZWPgOsNgrprQWadt/HLSrR8QIm+WNhnx03yFoni7QnGl 3SQ8kUcurLz/NcoUBVJ9EPEOjoSoLoy73Ac/yfh9lImcnwuLnVtTedzixSrXfmwUzzlo Gnlw== X-Gm-Message-State: AA+aEWauUEUKMupCSrc5VQ9BKL7XqU7fgKPVeT5oNpXjE3TER+LtSMoN 3pDY562F6IoTJim5v4NNVvU= X-Received: by 2002:adf:f28d:: with SMTP id k13mr10480127wro.78.1542898922518; Thu, 22 Nov 2018 07:02:02 -0800 (PST) Received: from localhost ([185.219.177.229]) by smtp.gmail.com with ESMTPSA id j6sm13795500wrw.30.2018.11.22.07.02.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Nov 2018 07:02:01 -0800 (PST) Date: Thu, 22 Nov 2018 18:02:00 +0300 From: Mesih Kilinc To: Maxime Ripard Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-sunxi@googlegroups.com, Chen-Yu Tsai , Russell King , Daniel Lezcano , Marc Zyngier , Linus Walleij , Icenowy Zheng , Rob Herring , Julian Calaby Subject: Re: [RFC PATCH v3 05/17] irqchip/sun4i: add support for suniv interrupt controller Message-ID: <20181122150200.p6e22sp3v4npb42w@ThinkPad> References: <08b40429e46626f4caf8e4d2287b5c4d354e3b7f.1542824904.git.mesihkilinc@gmail.com> <20181122083547.srnopylueqx6p2qj@flea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181122083547.srnopylueqx6p2qj@flea> User-Agent: NeoMutt/20180716-631-34bcda Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/11/22 09:35, Maxime Ripard wrote: > Hi Mesih, > Hi! > On Wed, Nov 21, 2018 at 09:30:38PM +0300, Mesih Kilinc wrote: > > The new F-series SoCs (suniv) from Allwinner use an stripped version of > > the interrupt controller in A10/A13 > > > > Add support for it in irq-sun4i driver. > > > > Signed-off-by: Mesih Kilinc > > --- > > drivers/irqchip/irq-sun4i.c | 104 +++++++++++++++++++++++++++++++------------- > > 1 file changed, 74 insertions(+), 30 deletions(-) > > > > diff --git a/drivers/irqchip/irq-sun4i.c b/drivers/irqchip/irq-sun4i.c > > index e3e5b91..7ca4a4d 100644 > > --- a/drivers/irqchip/irq-sun4i.c > > +++ b/drivers/irqchip/irq-sun4i.c > > @@ -28,11 +28,21 @@ > > #define SUN4I_IRQ_NMI_CTRL_REG 0x0c > > #define SUN4I_IRQ_PENDING_REG(x) (0x10 + 0x4 * x) > > #define SUN4I_IRQ_FIQ_PENDING_REG(x) (0x20 + 0x4 * x) > > -#define SUN4I_IRQ_ENABLE_REG(x) (0x40 + 0x4 * x) > > -#define SUN4I_IRQ_MASK_REG(x) (0x50 + 0x4 * x) > > +#define SUN4I_IRQ_ENABLE_REG(x) (irq_ic_data->enable_req_offset + 0x4 * x) > > +#define SUN4I_IRQ_MASK_REG(x) (irq_ic_data->mask_req_offset + 0x4 * x) > > You shouldn't have all the values you use passed as argument, so > irq_ic_data should be one of them here. > Could you elaborate it a little bit? > > +#define SUN4I_IRQ_ENABLE_REG_OFFSET 0x40 > > +#define SUN4I_IRQ_MASK_REG_OFFSET 0x50 > > +#define SUNIV_IRQ_ENABLE_REG_OFFSET 0x20 > > +#define SUNIV_IRQ_MASK_REG_OFFSET 0x30 > > + > > +struct sunxi_irq_chip_data{ > ^ a space here > > > + void __iomem *irq_base; > > + struct irq_domain *irq_domain; > > + u32 enable_req_offset; > > + u32 mask_req_offset; > > s/req/reg/ ? > Oops sorry ... > > + > > +static int __init suniv_ic_of_init(struct device_node *node, > > + struct device_node *parent) > > +{ > > + irq_ic_data = kzalloc(sizeof(struct sunxi_irq_chip_data), GFP_KERNEL); > > + if (!irq_ic_data) { > > + pr_err("kzalloc failed!\n"); > > + return -ENOMEM; > > + } > > + > > + irq_ic_data->enable_req_offset = SUNIV_IRQ_ENABLE_REG_OFFSET; > > + irq_ic_data->mask_req_offset = SUNIV_IRQ_MASK_REG_OFFSET; > > + > > + return sun4i_of_init(node, parent); > > +} > > + > > +IRQCHIP_DECLARE(allwinner_sunvi_ic, "allwinner,suniv-f1c100s-ic", suniv_ic_of_init); > > You can even split that addition to a new patch as well. OK. I will do 3 patches. First one will add a struct that holds only base and domain. Second one will add register offsets to that struct. Third one will add f1c100s support. Is that ok? Mesih