Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp4527840ybn; Sat, 28 Sep 2019 02:24:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrxOaYRbKi5Fs3TE7JQfABrXm8Q6CSO/h5EXXMQZl18ktEWLdwzu2Yxk2FkXzTr5TW+oD9 X-Received: by 2002:a05:6402:1858:: with SMTP id v24mr9086890edy.130.1569662662021; Sat, 28 Sep 2019 02:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569662662; cv=none; d=google.com; s=arc-20160816; b=K8fp6Y9MpWR21cW3MgIVPpRxWr8VxIeYiQWgeiQ6pjWlxj6vKLvSXMqQ+c6kUD2zmS LD/j5ryVBlTVMZXC5Uv6/CTDKxswuaok4AZ5uPWRf7pbALnkj6BIUvQ13vozNLwjYFFz y33wZTqU15WPUBDgch1NZDs+KMjplGnA/48o/5cuSYyzWfytganrCoD/blOTO9gUQrYa 3x8wA1Fp4CPN3ELIdlC3/fE2CGGXts0mHwKmVO8Wugj6VOVwNR+TSFYG+d60/vsur135 sup5pumj71P59EhtJiM4fmEDCFdklavZEu1Tw+IeMjErvtqDmzDAwoRtgCo7Q90kuLkf QwwA== 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; bh=iVV20r0iSrDV4YQ+RGD0xvbmhfqdoXZaPLmZydXG77U=; b=rRRWpqH5VboB+sYaYH40pBRxbhYAWiKyckN3lRDwCZEOuN3eTfJinS9Kjs543NhmXM pphJUvNI9FGiahAX7gTeWe3jEKcyFHZg6t6Ljgkhm2BFJNf798xT7aR7Mhail5DirkkF wA4KBEDpH/6/leyPrRXQtf5qYuECPxDH6vktiHps33wB7+VbGKFFpTgGqtrVDey5NlkF smVMhTMqTdH7XQzpnyfRkkIx33Q87jXozZBsd/1CAArGuvslBSeZCr1RmP7c7X830dHY 4cNZ66lL6yFUJ/NbhN5BmSMVwV8Tf7jQot9rbtgxmr62+h3WmK/cxRAO0jW3ZClICLKC 8GcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y22si4023354ejw.144.2019.09.28.02.23.47; Sat, 28 Sep 2019 02:24:22 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726026AbfI1JXm (ORCPT + 99 others); Sat, 28 Sep 2019 05:23:42 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:48209 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbfI1JXm (ORCPT ); Sat, 28 Sep 2019 05:23:42 -0400 Received: from p200300d06f16eff20347f9711eb7065e.dip0.t-ipconnect.de ([2003:d0:6f16:eff2:347:f971:1eb7:65e] helo=linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1iE8wy-0006UX-Qb; Sat, 28 Sep 2019 11:23:36 +0200 Date: Sat, 28 Sep 2019 11:23:31 +0200 From: Kurt Kanzenbach To: Rasmus Villemoes Cc: Rob Herring , Thomas Gleixner , Jason Cooper , Marc Zyngier , Mark Rutland , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: Re: [PATCH v6 2/2] dt/bindings: Add bindings for Layerscape external irqs Message-ID: <20190928092331.GB1894@linutronix.de> References: <20190923101513.32719-1-kurt@linutronix.de> <20190923101513.32719-3-kurt@linutronix.de> <20190927161118.GA19333@bogus> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 27, 2019 at 09:16:50PM +0000, Rasmus Villemoes wrote: > On 27/09/2019 18.11, Rob Herring wrote: > > On Mon, Sep 23, 2019 at 12:15:13PM +0200, Kurt Kanzenbach wrote: > >> +Required properties: > >> +- compatible: should be "fsl,-extirq", e.g. "fsl,ls1021a-extirq". > >> +- interrupt-controller: Identifies the node as an interrupt controller > >> +- #interrupt-cells: Must be 2. The first element is the index of the > >> + external interrupt line. The second element is the trigger type. > >> +- interrupt-parent: phandle of GIC. > >> +- reg: Specifies the Interrupt Polarity Control Register (INTPCR) in the SCFG. > >> +- fsl,extirq-map: Specifies the mapping to interrupt numbers in the parent > >> + interrupt controller. Interrupts are mapped one-to-one to parent > >> + interrupts. > > > > This should be an 'interrupt-map' instead. > > Rob, thanks for your review comments. I know you said the same thing at > v5, and it might seem like they are ignored. Well, I didn't ignore them. It just wasn't clear to me from the previous discussions which way you want to go. > However, I asked a couple of followup questions > (https://lore.kernel.org/lkml/0bb4533d-c749-d8ff-e1f2-4b08eb724713@prevas.dk/). > I'd really appreciate it if you could (a) point to some documentation > on how to write that interrupt-map and (b) explain how this is > different from the Qualcomm PDC case I tried to copy and which had > your Reviewed-By. I guess, we can have a look at other interrupt controllers and how they handle the interrupt-map property. For example: https://www.kernel.org/doc/Documentation/devicetree/bindings/interrupt-controller/renesas,rza1-irqc.txt I need to send a v7 anyway, because I forgot to include the SOC_LS1021A in the build process. > > >> + > >> +Optional properties: > >> +- fsl,bit-reverse: This boolean property should be set on the LS1021A > >> + if the SCFGREVCR register has been set to all-ones (which is usually > >> + the case), meaning that all reads and writes of SCFG registers are > >> + implicitly bit-reversed. Other compatible platforms do not have such > >> + a register. > > > > Couldn't you just read that register and tell? > > In theory, yes, but as far as I understand (and as I wrote) it's > specific to the ls1021a. Of course one can decide whether it's > necessary/possible to read it based on the compatible string, but one > would also need an extra reg property to have its address - but that > register is not really part of the extirq "device" we're trying to > describe. So would it need to be represented as its own subnode of scfg? Keep in mind, that not all Layerscapes have that feature and the corresponding register. As you said that may be handled via compatible string. However, the bit-reverse property looks like the simplest solution to me. > > If it is set at all, it's done within the first few instructions after > reset (before control is even handed to the bootloader), so I see it as > a kind of quirk of the hardware. The data sheet says "SCFG bit reverse > (SCFG_SCFGREVCR) must be written 0xFFFF_FFFF as a part of initialization > sequence before writing to any other SCFG register." which, taken > literally, means we don't need the property at all and can just assume > it for the ls1021a (i.e., do it based on compatible string alone) - but > I think it should be read as "if you're going to write this register, it > must be done first thing". > > > Does this apply to only the extirq register or all of scfg? > > All of scfg. It really seems like some accident/bad joke coming out of a > discussion between a hardware and software engineer on the enumeration > of bits, with the hardware guy ending up saying "alright, have it > whichever way you want it", causing even more pain :( > > >> + > >> +Example: > >> + scfg: scfg@1570000 { > >> + compatible = "fsl,ls1021a-scfg", "syscon"; > >> + #address-cells = <1>; > >> + #size-cells = <0>; > > > > As the child node(s) are memory mapped, this should not be 0. And you > > need 'ranges'. > > Indeed - I think I understand this a little better now than I did back then. > Okay. > Thanks, > Rasmus Thanks, Kurt --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEooWgvezyxHPhdEojeSpbgcuY8KYFAl2PJpIACgkQeSpbgcuY 8Kajvg//UY/iWpJ5yvrHwwEiYOH2DbJAxGiyGQVXkHjCReroDWbMPXfY6rxMfz3G SesspSgDF0yD2JTfOjvEX343oB+iWJYT+/RWLrfaNQRWcGp3iDp3ZCopXvzMPFpA qLpZogd2ttYHSu4gkw4sc6jZcLJ+39Wk5rIO08AyufvPIjPjr8TROfJJgNcEYoyp g6DUEheatnqhlk6rGqAlzr+/pLnJocu9gYkeV0IOG07v/HaIfPKzuhYX3yQF+1Vj l9t/r+DXfOZLkr4Hq9kItxtlSb498lAb1QE8dbu1LC7Oz155ihujSoPh9Twf6e9b h8Ys9ljYH3W+TteL6iqznefoqgz18hE/F6d6GxKx9EmOy2Il/c2c5AtsLMlZEYtf pT5iYe+rkToYUofURWi6BhH+kQPLqUTl9p5IORavL26S8lIKmWbaJa9QNRBxV6rc HBJSKMd7BB9P8ztqTiXoGyl73JIPWBmIp8knjFnojiHFLYfv6ydt67RpxozB8oU7 FX+oheQ0r2xh85BAlSdX8seFI73yMigaVIZ8AyUkIm7rlhhtqeB/APf53tJurz3n 4a2Bmpx42e576fQlyHRsOODk4O596ACqUVYBvg11G/aREsK7luZLilfuzBZ4cybc Nlyl7Lx5ksVGO9iZVTKUftFZ4cZIt1xTT6Z37jerdYQ5OyFTk18= =3dnz -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip--