public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Yann Sionneau <ysionneau@kalrayinc.com>,
	linux-kernel@vger.kernel.org, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: Jonathan Borne <jborne@kalrayinc.com>,
	Julian Vetter <jvetter@kalrayinc.com>,
	devicetree@vger.kernel.org
Subject: Re: [RFC PATCH v3 36/37] kvx: dts: DeviceTree for qemu emulated Coolidge SoC
Date: Wed, 31 Jul 2024 18:57:27 +0200	[thread overview]
Message-ID: <f032dd83-8e5d-4062-b8a7-ef98924ac9b4@kernel.org> (raw)
In-Reply-To: <434c5199-613e-4765-af44-d7404a4554dc@kalrayinc.com>

On 31/07/2024 17:38, Yann Sionneau wrote:

>>
>>> +	#size-cells = <0x02>;
>>> +
>>> +	chosen {
>>> +		stdout-path = "/axi/serial@20210000";
>> No, use phandle/label.
> Ack, I will fix this. However can you point me to where this is documented? In https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt I can see a path is used as example and not a phandle/label.

That's just sanity and common (maybe except Tegra) style... Almost every
source uses this, because it gives you code which is independent of node
ordering, node names and unit addresses.

What if I change in next patch axi->soc, how usually we code it?

Override by label/phandle was mentioned many times on mailing lists as
preferred.

>>
>>> +	};
>>> +
>>> +	memory@100000000 {
>>> +		phandle = <0x40>;
>>> +		reg = <0x01 0x00 0x00 0x8000000>;
>>> +		device_type = "memory";
>>> +	};
>>> +
>>> +	axi {
>>> +		compatible = "simple-bus";
>>> +		#address-cells = <0x02>;
>> Same problem.
> Ack.
>>
>>
>>> +		#size-cells = <0x02>;
>>> +		ranges;
>>> +
>>> +		virtio-mmio@30003c00 {
>> Node names should be generic. See also an explanation and list of
>> examples (not exhaustive) in DT specification:
>> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
> 
> I fail to understand what I should put even after reading the link above. This node is kind of "generic" and could be used either for a virtio-block device or a virtio-net device.
> 
> Could you elaborate on this please?

Just go with virtio.

> 
>>
>>
>>> +			compatible = "virtio,mmio";
>>> +			reg = <0x00 0x30003c00 0x00 0x200>;
>>> +			interrupt-parent = <&itgen0>;
>>> +			interrupts = <0x9e 0x04>;
>>> +		};
>>> +
>>> +		virtio-mmio@30003e00 {
>>> +			compatible = "virtio,mmio";
>>> +			reg = <0x00 0x30003e00 0x00 0x200>;
>>> +			interrupt-parent = <&itgen0>;
>>> +			interrupts = <0x9f 0x04>;
>>> +		};
>>> +
>>> +		itgen0: itgen_soc_periph0@27000000 {
>> Please follow DTS coding style.
> Oops, ack, I will fix this and replace "_" with "-" in node/property names.
>>
>>> +			compatible = "kalray,coolidge-itgen";
>>> +			reg = <0x00 0x27000000 0x00 0x1104>;
>>> +			msi-parent = <&apic_mailbox>;
>>> +			#interrupt-cells = <0x02>;
>>> +			interrupt-controller;
>>> +		};
>>> +
>>> +		serial@20210000 {
>>> +			reg-shift = <0x02>;
>>> +			reg-io-width = <0x04>;
>> Sorry, but width and shift are rarely hex values. Make your code
>> readable. Adhere to existing coding style.
> Ack, I will fix this.
>>
>>
>>> +			clocks = <&ref_clk>;
>>> +			interrupts = <0x29 0x04>;
>>> +			interrupt-parent = <&itgen0>;
>>> +			reg = <0x00 0x20210000 0x00 0x100>;
>>> +			compatible = "snps,dw-apb-uart";
>> Follow DTS coding style - order the properties correctly.
> Oops, ack, I will fix this.
>>
>>
>>> +		};
>>> +
>>> +		serial@20211000 {
>>> +			reg-shift = <0x02>;
>>> +			reg-io-width = <0x04>;
>>> +			phandle = <0x3c>;
>>> +			clocks = <&ref_clk>;
>>> +			interrupts = <0x2a 0x04>;
>>> +			interrupt-parent = <&itgen0>;
>>> +			reg = <0x00 0x20211000 0x00 0x100>;
>>> +			compatible = "snps,dw-apb-uart";
>>> +		};
>>> +
>>> +		serial@20212000 {
>>> +			reg-shift = <0x02>;
>>> +			reg-io-width = <0x04>;
>>> +			phandle = <0x3b>;
>>> +			clocks = <&ref_clk>;
>>> +			interrupts = <0x2b 0x04>;
>>> +			interrupt-parent = <&itgen0>;
>>> +			reg = <0x00 0x20212000 0x00 0x100>;
>>> +			compatible = "snps,dw-apb-uart";
>>> +		};
>>> +
>>> +		serial@20213000 {
>>> +			reg-shift = <0x02>;
>>> +			reg-io-width = <0x04>;
>>> +			phandle = <0x3a>;
>>> +			clocks = <&ref_clk>;
>>> +			interrupts = <0x2c 0x04>;
>>> +			interrupt-parent = <&itgen0>;
>>> +			reg = <0x00 0x20213000 0x00 0x100>;
>>> +			compatible = "snps,dw-apb-uart";
>>> +		};
>>> +
>>> +		serial@20214000 {
>>> +			reg-shift = <0x02>;
>>> +			reg-io-width = <0x04>;
>>> +			phandle = <0x39>;
>>> +			clocks = <&ref_clk>;
>>> +			interrupts = <0x2d 0x04>;
>>> +			interrupt-parent = <&itgen0>;
>>> +			reg = <0x00 0x20214000 0x00 0x100>;
>>> +			compatible = "snps,dw-apb-uart";
>>> +		};
>>> +
>>> +		serial@20215000 {
>>> +			reg-shift = <0x02>;
>>> +			reg-io-width = <0x04>;
>>> +			phandle = <0x38>;
>>> +			clocks = <&ref_clk>;
>>> +			interrupts = <0x2e 0x04>;
>>> +			interrupt-parent = <&itgen0>;
>>> +			reg = <0x00 0x20215000 0x00 0x100>;
>>> +			compatible = "snps,dw-apb-uart";
>>> +		};
>>> +	};
>>> +
>>> +	memory@0 {
>> Why memory is in multiple places?
> I should put all memory nodes one after another? Ok I will do this.
>>
>>> +		device_type = "memory";
>>> +		reg = <0x00 0x00 0x00 0x400000>;
>>> +	};
>>> +
>>> +	apic_mailbox: apic_mailbox@a00000 {
>> Why this is outside of SoC? Where is the SoC anyway?
> 
> Oops, I didn't know it was mandatory to put a soc { } in the DT, I've browsed the DT spec and the "soc" node is not formally described as something special. Maybe this needs to be documented somewhere?
> 
> I reckon it's a nice way to separate what's on the board (PCB) and what's in the SoC.
> 
> I'll add a `soc { [...] };` in the next patch iteration that will contain what's in the SoC.

Coding style, emails, all new DTS since some years or talks on numerous
conferences... All this code looks like you took some vendor downstream
code and sent it. That's not how it works. You take recent, reviewed DTS
and use it as template. Qualcomm sm8650 or x1e8010 are good examples.

> 
>>
>>> +		compatible = "kalray,coolidge-apic-mailbox";
>> Your compatibles are confusing. What is the soc name? In other binding
>> you entirely omitted coolidge. See writing bindings (or any other recent
>> DTS which passed review) - it has rationale behind it.
> 
> SoC name is "Coolidge" and the "APIC Mailbox" hw is in the SoC, it is memory mapped.
> 
> But I guess this point is now already more clear since my last emails answering the "core intc" reviews.
> 
>>


Best regards,
Krzysztof


  reply	other threads:[~2024-07-31 16:57 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22  9:41 [RFC PATCH v3 00/37] Upstream kvx Linux port ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 01/37] Documentation: kvx: Add basic documentation ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 02/37] dt-bindings: soc: kvx: Add binding for kalray,coolidge-pwr-ctrl ysionneau
2024-07-22  9:47   ` Krzysztof Kozlowski
2024-07-31 14:31     ` Yann Sionneau
2024-07-22 18:41   ` Rob Herring (Arm)
2024-07-22  9:41 ` [RFC PATCH v3 03/37] dt-bindings: Add binding for kalray,kv3-1-intc ysionneau
2024-07-22  9:51   ` Krzysztof Kozlowski
2024-07-31 14:47     ` Yann Sionneau
2024-08-07  7:55       ` Krzysztof Kozlowski
2024-07-23 20:49   ` Rob Herring
2024-07-22  9:41 ` [RFC PATCH v3 04/37] dt-bindings: Add binding for kalray,coolidge-apic-gic ysionneau
2024-07-22 18:41   ` Rob Herring (Arm)
2024-07-22  9:41 ` [RFC PATCH v3 05/37] dt-bindings: Add binding for kalray,coolidge-apic-mailbox ysionneau
2024-07-22 18:41   ` Rob Herring (Arm)
2024-07-22 20:47   ` Rob Herring
2024-09-04 15:07     ` Yann Sionneau
2024-07-22  9:41 ` [RFC PATCH v3 06/37] dt-bindings: Add binding for kalray,coolidge-itgen ysionneau
2024-07-22 18:41   ` Rob Herring (Arm)
2024-07-22  9:41 ` [RFC PATCH v3 07/37] dt-bindings: Add binding for kalray,coolidge-ipi-ctrl ysionneau
2024-07-22 18:41   ` Rob Herring (Arm)
2024-07-22 20:50   ` Rob Herring
2024-09-04 15:37     ` Yann Sionneau
2024-07-22  9:41 ` [RFC PATCH v3 08/37] dt-bindings: Add binding for kalray,coolidge-dsu-clock ysionneau
2024-07-22 18:41   ` Rob Herring (Arm)
2024-07-22 21:45   ` Stephen Boyd
2024-07-22  9:41 ` [RFC PATCH v3 09/37] dt-bindings: Add binding for kalray,kv3-1-timer ysionneau
2024-07-23 20:52   ` Rob Herring
2024-07-22  9:41 ` [RFC PATCH v3 10/37] dt-bindings: kalray: Add CPU bindings for Kalray kvx ysionneau
2024-07-22 18:41   ` Rob Herring (Arm)
2024-07-22 20:58   ` Rob Herring
2024-07-22  9:41 ` [RFC PATCH v3 11/37] dt-bindings: kalray: Add Kalray SoC board compatibles ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 12/37] kvx: Add ELF-related definitions ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 13/37] kvx: Add build infrastructure ysionneau
2024-07-23  9:46   ` Arnd Bergmann
2024-07-22  9:41 ` [RFC PATCH v3 14/37] kvx: Add CPU definition headers ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 15/37] kvx: Add atomic/locking headers ysionneau
2024-07-23  8:26   ` Arnd Bergmann
2024-07-22  9:41 ` [RFC PATCH v3 16/37] kvx: Add other common headers ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 17/37] kvx: Add boot and setup routines ysionneau
2024-07-23  8:44   ` Arnd Bergmann
2024-07-27 14:31   ` Thomas Gleixner
2024-07-22  9:41 ` [RFC PATCH v3 18/37] kvx: Add exception/interrupt handling ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 19/37] irqchip: Add irq-kvx-apic-gic driver ysionneau
2024-07-22 12:28   ` Krzysztof Kozlowski
2024-08-23 12:37     ` Yann Sionneau
2024-07-27 13:10   ` Thomas Gleixner
2024-07-22  9:41 ` [RFC PATCH v3 20/37] irqchip: Add irq-kvx-itgen driver ysionneau
2024-07-22 12:30   ` Krzysztof Kozlowski
2024-08-23 12:42     ` Yann Sionneau
2024-07-27 13:18   ` Thomas Gleixner
2024-07-22  9:41 ` [RFC PATCH v3 21/37] irqchip: Add irq-kvx-apic-mailbox driver ysionneau
2024-07-27 13:35   ` Thomas Gleixner
2024-07-22  9:41 ` [RFC PATCH v3 22/37] irqchip: Add kvx-core-intc core interrupt controller driver ysionneau
2024-07-22 12:32   ` Krzysztof Kozlowski
2024-08-23 12:54     ` Yann Sionneau
2024-07-27 13:37   ` Thomas Gleixner
2024-07-22  9:41 ` [RFC PATCH v3 23/37] kvx: Add process management ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 24/37] kvx: Add memory management ysionneau
2024-07-22 14:58   ` Christoph Hellwig
2024-07-30 13:48     ` Robin Murphy
2024-08-23 16:02     ` Yann Sionneau
2024-07-22  9:41 ` [RFC PATCH v3 25/37] kvx: Add system call support ysionneau
2024-07-23  9:20   ` Arnd Bergmann
2024-07-22  9:41 ` [RFC PATCH v3 26/37] kvx: Add signal handling support ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 27/37] kvx: Add ELF relocations and module support ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 28/37] kvx: Add misc common routines ysionneau
2024-07-23  8:50   ` Arnd Bergmann
2024-07-23  9:58   ` Arnd Bergmann
2024-07-22  9:41 ` [RFC PATCH v3 29/37] kvx: Add some library functions ysionneau
2024-07-23  9:26   ` Arnd Bergmann
2024-07-22  9:41 ` [RFC PATCH v3 30/37] kvx: Add multi-processor (SMP) support ysionneau
2024-07-27 14:22   ` Thomas Gleixner
2024-07-22  9:41 ` [RFC PATCH v3 31/37] kvx: Add kvx default config file ysionneau
2024-07-23  8:55   ` Arnd Bergmann
2024-07-22  9:41 ` [RFC PATCH v3 32/37] kvx: Add debugging related support ysionneau
2024-07-22  9:41 ` [RFC PATCH v3 33/37] kvx: Add support for cpuinfo ysionneau
2024-07-22 12:35   ` Krzysztof Kozlowski
2024-08-23 13:00     ` Yann Sionneau
2024-07-22  9:41 ` [RFC PATCH v3 34/37] kvx: Add power controller driver ysionneau
2024-07-22 12:37   ` Krzysztof Kozlowski
2024-08-23 13:07     ` Yann Sionneau
2024-07-22  9:41 ` [RFC PATCH v3 35/37] kvx: Add IPI driver ysionneau
2024-07-22 12:39   ` Krzysztof Kozlowski
2024-08-23 14:46     ` Yann Sionneau
2024-09-07 13:20       ` Krzysztof Kozlowski
2024-07-27 14:08   ` Thomas Gleixner
2024-07-22  9:41 ` [RFC PATCH v3 36/37] kvx: dts: DeviceTree for qemu emulated Coolidge SoC ysionneau
2024-07-22  9:55   ` Krzysztof Kozlowski
2024-07-22 11:12     ` Conor Dooley
2024-07-31 15:38     ` Yann Sionneau
2024-07-31 16:57       ` Krzysztof Kozlowski [this message]
2024-07-22  9:41 ` [RFC PATCH v3 37/37] Add Kalray Inc. to the list of vendor-prefixes.yaml ysionneau
2024-07-22  9:56   ` Krzysztof Kozlowski
2024-08-01  7:35     ` Yann Sionneau
2024-07-24  7:59 ` [RFC PATCH v3 00/37] Upstream kvx Linux port Arnd Bergmann
2024-07-25 10:07   ` Yann Sionneau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f032dd83-8e5d-4062-b8a7-ef98924ac9b4@kernel.org \
    --to=krzk@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jborne@kalrayinc.com \
    --cc=jvetter@kalrayinc.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=ysionneau@kalrayinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox