Re: [PATCH] arm64: dts: ti: Add support for Siemens IOT2050 boards

2021-02-09 Thread Nishanth Menon
On 18:40-20210209, Jan Kiszka wrote:
> On 09.02.21 15:44, Nishanth Menon wrote:
> > Jan,
> > 
> > A few quick scan comments below, you might need to post based off
> > 5.12-rc1 once available..
> > 
> > Also, I see a bit of warnings with dtbs_check, which probably needs a
> > little more digging into (pcie insists to get a device_type property,
> > etc..)
> > 
> > you could use kernel_patch_verify or 
> > https://github.com/nmenon/kernel_patch_verify/blob/master/Dockerbuild.md
> > 
> > it throws up a report like this https://pastebin.ubuntu.com/p/SdkZr432z3/
> > 
> 
> Ok, will have a look - is that checkpatch on steroids?

It does a bit more than execute checkpatch.. you can see the script 
https://github.com/nmenon/kernel_patch_verify/blob/master/kernel_patch_verify

as well, but depending on files, for example: with dts, it does a
dtbs_check, W=2 build, converts dtb to dts and back to dtb to wiggle out
as many issues that people seem to hit against..

There are other solutions out there (patman etc).. in effect just a
wrapper script around standard kernel based checkers..

> 
> > So, many of my comments below are just first pass parse of that log -> I
> > usually do recommend building with W=2 and dtbs_check (with yamlint etc)
> > to make sure things are a bit sane. Will be good to have additional
> > eyes.
> > 
> > On 11:21-20210209, Jan Kiszka wrote:
> >> From: Jan Kiszka 
> >>
> >> Add support for two Siemens SIMATIC IOT2050 variants, Basic and
> >> Advanced. They are based on the TI AM6528 and AM6548 SOCs.
> >>
> >> Based on original version by Le Jin.
> > 
> > Might be good to add links to the boards as well (if available), for
> > future reference.
> > 
> 
> Sure, though stability of links is not under my control. But I could
> additionally drop https://github.com/siemens/meta-iot2050 here.

hmm.. Something of a reference for folks may be 5 or 10 years down the
road, as to answer "what is this board"? Upto you though..

[...]

> >> diff --git a/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi 
> >> b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
> >> new file mode 100644
> >> index ..de05937dbb60
> >> --- /dev/null
> >> +++ b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
> >> @@ -0,0 +1,649 @@
> >> +// SPDX-License-Identifier: GPL-2.0
> >> +/*
> >> + * Copyright (c) Siemens AG, 2018-2021
> >> + *
> > 
> > Optional: might be nice to add a oneliner comment for reuse scope..
> > 
> 
> You mean something like "Common bits for IOT2050 basic and advanced boards"?

Yeah, that'd help.

[...]

> >> +  gpio-line-names =
> >> +  "wkup_gpio0-base", "", "", "", "UART0-mode1", "UART0-mode0",
> >> +  "UART0-enable", "UART0-terminate", "", "WIFI-disable",
> >> +  "", "", "", "", "", "", "", "", "", "",
> >> +  "", "A4A5-I2C-mux", "", "", "", "USER-button", "", "", "","IO0",
> >> +  "IO1", "IO2", "", "IO3", "IO17-direction",
> >> +  "A5", "IO16-direction", "IO15-direction",
> >> +  "IO14-direction", "A3",
> >> +  "", "IO18-direction", "A4", "A2", "A1",
> >> +  "A0", "", "", "IO13", "IO11",
> >> +  "IO12", "IO10";
> > 
> > Any chance of intending this consistently?
> 
> There is in fact a plan behind this way: I intended every 10 entries, to
> ease counting the pins (and that proved to be valuable more than once
> already).

AAAh.. interesting.. as long as you find it useful, I am ok with it.. it
was'nt obvious to me the first look..

[...]

> >> diff --git a/arch/arm64/boot/dts/ti/k3-am6528-iot2050-basic.dts 
> >> b/arch/arm64/boot/dts/ti/k3-am6528-iot2050-basic.dts
> >> new file mode 100644
> >> index ..bb9ab4fdd74e
> >> --- /dev/null
> >> +++ b/arch/arm64/boot/dts/ti/k3-am6528-iot2050-basic.dts
> >> @@ -0,0 +1,56 @@
> >> +// SPDX-License-Identifier: GPL-2.0
> >> +/*
> >> + * Copyright (c) Siemens AG, 2018-2021
> >> + *
> >> +  cpus {
> >> +  cpu-map {
> >> +  /delete-node/ cluster1;
> >> +  };
> >> +  /delete-node/ cpu@100;
> >> +  /delete-node/ cpu@101;
> >> +  };
> > 
> > Personally, I'd prefer this (handling efuse spins in board files or
> > even overlays) instead of having to create 100s of dtsi per SoC for
> > every permutation & combination of TI efused devices and handle these
> > in board files. I do see examples of similar usage elsewhere in:
> > 
> > $ git grep /delete-node/ arch/arm64/boot/dts/
> > 
> > But, if someone has a different opinion, feel free to pipe up with a
> > reasonable way to prevent file explosion.
> > 

Just a side note to folks (since I got a couple of private poked
on this) -> if we do see a pattern going forward where the efuse
parts have more *upstream* boards coming online, we will consider
spawning off dtsi - but I don't see that yet and I don't really want
to create a explosion of real and imagined unused dtsi combinations
"just because someone might need it". There is always the over

Re: [PATCH] arm64: dts: ti: Add support for Siemens IOT2050 boards

2021-02-09 Thread Jan Kiszka
On 09.02.21 15:44, Nishanth Menon wrote:
> Jan,
> 
> A few quick scan comments below, you might need to post based off
> 5.12-rc1 once available..
> 
> Also, I see a bit of warnings with dtbs_check, which probably needs a
> little more digging into (pcie insists to get a device_type property,
> etc..)
> 
> you could use kernel_patch_verify or 
> https://github.com/nmenon/kernel_patch_verify/blob/master/Dockerbuild.md
> 
> it throws up a report like this https://pastebin.ubuntu.com/p/SdkZr432z3/
> 

Ok, will have a look - is that checkpatch on steroids?

> So, many of my comments below are just first pass parse of that log -> I
> usually do recommend building with W=2 and dtbs_check (with yamlint etc)
> to make sure things are a bit sane. Will be good to have additional
> eyes.
> 
> On 11:21-20210209, Jan Kiszka wrote:
>> From: Jan Kiszka 
>>
>> Add support for two Siemens SIMATIC IOT2050 variants, Basic and
>> Advanced. They are based on the TI AM6528 and AM6548 SOCs.
>>
>> Based on original version by Le Jin.
> 
> Might be good to add links to the boards as well (if available), for
> future reference.
> 

Sure, though stability of links is not under my control. But I could
additionally drop https://github.com/siemens/meta-iot2050 here.

>>
>> Signed-off-by: Jan Kiszka 
>> ---
> 
> Will be nice to see at least a pastebin link for a bootlog on the boards
> in the cover-letter / diffstat section with the v2 - for reference.
> 

Sure.

>>  .../devicetree/bindings/arm/ti/k3.yaml|   2 +
>>  arch/arm64/boot/dts/ti/Makefile   |   4 +
>>  .../boot/dts/ti/k3-am65-iot2050-common.dtsi   | 649 ++
>>  .../boot/dts/ti/k3-am6528-iot2050-basic.dts   |  56 ++
>>  .../dts/ti/k3-am6548-iot2050-advanced.dts |  57 ++
>>  5 files changed, 768 insertions(+)
>>  create mode 100644 arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
>>  create mode 100644 arch/arm64/boot/dts/ti/k3-am6528-iot2050-basic.dts
>>  create mode 100644 arch/arm64/boot/dts/ti/k3-am6548-iot2050-advanced.dts
>>
>> diff --git a/Documentation/devicetree/bindings/arm/ti/k3.yaml 
>> b/Documentation/devicetree/bindings/arm/ti/k3.yaml
>> index c6e1c1e63e43..b1ab0cf4a2d6 100644
>> --- a/Documentation/devicetree/bindings/arm/ti/k3.yaml
>> +++ b/Documentation/devicetree/bindings/arm/ti/k3.yaml
>> @@ -23,6 +23,8 @@ properties:
>>  items:
>>- enum:
>>- ti,am654-evm
>> +  - siemens,iot2050-basic
>> +  - siemens,iot2050-advanced
> 
> - In a separate patch, 
> ./Documentation/devicetree/bindings/vendor-prefixes.yaml -> Could you
>   make sure we add 'siemens' there?
> - and, lets move the bindings to it's own patch, since that is how Rob
>  prefers to review in 
> https://patchwork.ozlabs.org/project/devicetree-bindings/list/
> 
> Both of these patches will need Rob to ack. I think I should be able
> to pick the first one up as well to reduce dependency, but we can
> check with Rob in case there is a preference.
> 

Ok.

>>- const: ti,am654
>>  
>>- description: K3 J721E SoC
>> diff --git a/arch/arm64/boot/dts/ti/Makefile 
>> b/arch/arm64/boot/dts/ti/Makefile
>> index 65506f21ba30..928ea26ce250 100644
>> --- a/arch/arm64/boot/dts/ti/Makefile
>> +++ b/arch/arm64/boot/dts/ti/Makefile
>> @@ -8,6 +8,10 @@
>>  
>>  dtb-$(CONFIG_ARCH_K3) += k3-am654-base-board.dtb
>>  
> 
> - drop the EOL to club am65 dtbs close to each other
> 
>> +dtb-$(CONFIG_ARCH_K3) += k3-am6528-iot2050-basic.dtb
>> +
> 
> - Drop this EOL as well. Something like this:
> 
> dtb-$(CONFIG_ARCH_K3) += k3-am654-base-board.dtb
> dtb-$(CONFIG_ARCH_K3) += k3-am6528-iot2050-basic.dtb
> dtb-$(CONFIG_ARCH_K3) += k3-am6548-iot2050-advanced.dtb
> 
> dtb-$(CONFIG_ARCH_K3) += k3-j721e-common-proc-board.dtb
> 
>> +dtb-$(CONFIG_ARCH_K3) += k3-am6548-iot2050-advanced.dtb
>> +
>>  dtb-$(CONFIG_ARCH_K3) += k3-j721e-common-proc-board.dtb
>>  
>>  dtb-$(CONFIG_ARCH_K3) += k3-j7200-common-proc-board.dtb
>> diff --git a/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi 
>> b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
>> new file mode 100644
>> index ..de05937dbb60
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
>> @@ -0,0 +1,649 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * Copyright (c) Siemens AG, 2018-2021
>> + *
> 
> Optional: might be nice to add a oneliner comment for reuse scope..
> 

You mean something like "Common bits for IOT2050 basic and advanced boards"?

>> + * Authors:
>> + *   Le Jin 
>> + *   Jan Kiszka 
>> + */
>> +
>> +/dts-v1/;
>> +
>> +#include "k3-am654.dtsi"
>> +#include 
>> +
>> +/ {
>> +aliases {
>> +spi0 = &mcu_spi0;
>> +};
>> +
>> +chosen {
>> +stdout-path = "serial3:115200n8";
>> +bootargs = "earlycon=ns16550a,mmio32,0x0280";
> 
> serial3 is main_uart1, did you mean 0x0281 instead of 0x0280 ?

Indeed, this is 0x0281 here. We overwrote this in our image - will
fix

Re: [PATCH] arm64: dts: ti: Add support for Siemens IOT2050 boards

2021-02-09 Thread Nishanth Menon
Jan,

A few quick scan comments below, you might need to post based off
5.12-rc1 once available..

Also, I see a bit of warnings with dtbs_check, which probably needs a
little more digging into (pcie insists to get a device_type property,
etc..)

you could use kernel_patch_verify or 
https://github.com/nmenon/kernel_patch_verify/blob/master/Dockerbuild.md

it throws up a report like this https://pastebin.ubuntu.com/p/SdkZr432z3/

So, many of my comments below are just first pass parse of that log -> I
usually do recommend building with W=2 and dtbs_check (with yamlint etc)
to make sure things are a bit sane. Will be good to have additional
eyes.

On 11:21-20210209, Jan Kiszka wrote:
> From: Jan Kiszka 
> 
> Add support for two Siemens SIMATIC IOT2050 variants, Basic and
> Advanced. They are based on the TI AM6528 and AM6548 SOCs.
> 
> Based on original version by Le Jin.

Might be good to add links to the boards as well (if available), for
future reference.

> 
> Signed-off-by: Jan Kiszka 
> ---

Will be nice to see at least a pastebin link for a bootlog on the boards
in the cover-letter / diffstat section with the v2 - for reference.

>  .../devicetree/bindings/arm/ti/k3.yaml|   2 +
>  arch/arm64/boot/dts/ti/Makefile   |   4 +
>  .../boot/dts/ti/k3-am65-iot2050-common.dtsi   | 649 ++
>  .../boot/dts/ti/k3-am6528-iot2050-basic.dts   |  56 ++
>  .../dts/ti/k3-am6548-iot2050-advanced.dts |  57 ++
>  5 files changed, 768 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am6528-iot2050-basic.dts
>  create mode 100644 arch/arm64/boot/dts/ti/k3-am6548-iot2050-advanced.dts
> 
> diff --git a/Documentation/devicetree/bindings/arm/ti/k3.yaml 
> b/Documentation/devicetree/bindings/arm/ti/k3.yaml
> index c6e1c1e63e43..b1ab0cf4a2d6 100644
> --- a/Documentation/devicetree/bindings/arm/ti/k3.yaml
> +++ b/Documentation/devicetree/bindings/arm/ti/k3.yaml
> @@ -23,6 +23,8 @@ properties:
>  items:
>- enum:
>- ti,am654-evm
> +  - siemens,iot2050-basic
> +  - siemens,iot2050-advanced

- In a separate patch, ./Documentation/devicetree/bindings/vendor-prefixes.yaml 
-> Could you
  make sure we add 'siemens' there?
- and, lets move the bindings to it's own patch, since that is how Rob
 prefers to review in 
https://patchwork.ozlabs.org/project/devicetree-bindings/list/

Both of these patches will need Rob to ack. I think I should be able
to pick the first one up as well to reduce dependency, but we can
check with Rob in case there is a preference.

>- const: ti,am654
>  
>- description: K3 J721E SoC
> diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makefile
> index 65506f21ba30..928ea26ce250 100644
> --- a/arch/arm64/boot/dts/ti/Makefile
> +++ b/arch/arm64/boot/dts/ti/Makefile
> @@ -8,6 +8,10 @@
>  
>  dtb-$(CONFIG_ARCH_K3) += k3-am654-base-board.dtb
>  

- drop the EOL to club am65 dtbs close to each other

> +dtb-$(CONFIG_ARCH_K3) += k3-am6528-iot2050-basic.dtb
> +

- Drop this EOL as well. Something like this:

dtb-$(CONFIG_ARCH_K3) += k3-am654-base-board.dtb
dtb-$(CONFIG_ARCH_K3) += k3-am6528-iot2050-basic.dtb
dtb-$(CONFIG_ARCH_K3) += k3-am6548-iot2050-advanced.dtb

dtb-$(CONFIG_ARCH_K3) += k3-j721e-common-proc-board.dtb

> +dtb-$(CONFIG_ARCH_K3) += k3-am6548-iot2050-advanced.dtb
> +
>  dtb-$(CONFIG_ARCH_K3) += k3-j721e-common-proc-board.dtb
>  
>  dtb-$(CONFIG_ARCH_K3) += k3-j7200-common-proc-board.dtb
> diff --git a/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi 
> b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
> new file mode 100644
> index ..de05937dbb60
> --- /dev/null
> +++ b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi
> @@ -0,0 +1,649 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) Siemens AG, 2018-2021
> + *

Optional: might be nice to add a oneliner comment for reuse scope..

> + * Authors:
> + *   Le Jin 
> + *   Jan Kiszka 
> + */
> +
> +/dts-v1/;
> +
> +#include "k3-am654.dtsi"
> +#include 
> +
> +/ {
> + aliases {
> + spi0 = &mcu_spi0;
> + };
> +
> + chosen {
> + stdout-path = "serial3:115200n8";
> + bootargs = "earlycon=ns16550a,mmio32,0x0280";

serial3 is main_uart1, did you mean 0x0281 instead of 0x0280 ?

> + };
> +
> + reserved-memory {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + ranges;
> +
> + secure_ddr: secure_ddr@9e80 {

"_" is not something we prefer for node names, so something like
secure_ddr: secure-ddr@...

> + reg = <0 0x9e80 0 0x0180>; /* for OP-TEE */
> + alignment = <0x1000>;
> + no-map;
> + };
> +
> + mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@a000 {
> + compatible =