Re: [PATCH v1] arm: dts: k3-am625-verdin: add tifsstub to tispl.bin

2024-04-15 Thread Marcel Ziswiler
Hi Francesco

On Mon, 2024-04-15 at 09:54 +0200, Francesco Dolcini wrote:
> From: Parth Pancholi 
> 
> Adds tifsstub binaries, this is required for deepsleep functionality.
> 
> This implements the same change as commit 128f81290b7d ("arm: dts: k3:
> binman: am625: add support for signing TIFSSTUB Images") did for TI AM62
> SK board.
> 
> Signed-off-by: Parth Pancholi 
> Signed-off-by: Francesco Dolcini 

Acked-by: Marcel Ziswiler 

Just one minor note in-lined further below.

> ---
>  .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 140 +-
>  1 file changed, 138 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi 
> b/arch/arm/dts/k3-am625-verdin-wifi-dev-
> binman.dtsi
> index 6f5845024f27..a9b86b61e53e 100644
> --- a/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
> +++ b/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
> @@ -150,12 +150,107 @@
>   filename = 
> "ti-dm/am62xx/ipc_echo_testb_mcu1_0_release_strip.xer5f";
>   };
>   };
> +
> + tifsstub-hs {
> + filename = "tifsstub.bin_hs";
> + ti-secure-rom {
> + content = <_hs_cert>;
> + core = "secure";
> + load = <0x4>;
> + sw-rev = ;
> + keyfile = "custMpk.pem";
> + countersign;
> + tifsstub;
> + };
> + tifsstub_hs_cert: tifsstub-hs-cert.bin {
> + filename = 
> "ti-sysfw/ti-fs-stub-firmware-am62x-hs-cert.bin";
> + type = "blob-ext";
> + optional;
> + };
> + tifsstub_hs_enc: tifsstub-hs-enc.bin {
> + filename = 
> "ti-sysfw/ti-fs-stub-firmware-am62x-hs-enc.bin";
> + type = "blob-ext";
> + optional;
> + };
> + };
> +
> + tifsstub-fs {
> + filename = "tifsstub.bin_fs";
> + tifsstub_fs_cert: tifsstub-fs-cert.bin {
> + filename = 
> "ti-sysfw/ti-fs-stub-firmware-am62x-hs-cert.bin";
> + type = "blob-ext";
> + optional;
> + };
> + tifsstub_fs_enc: tifsstub-fs-enc.bin {
> + filename = 
> "ti-sysfw/ti-fs-stub-firmware-am62x-hs-enc.bin";
> + type = "blob-ext";
> + optional;
> + };
> +
> + };
> +
> + tifsstub-gp {
> + filename = "tifsstub.bin_gp";
> + ti-secure-rom {
> + content = <_gp>;
> + core = "secure";
> + load = <0x6>;
> + sw-rev = ;
> + keyfile = "ti-degenerate-key.pem";
> + tifsstub;
> + };
> + tifsstub_gp: tifsstub-gp.bin {
> + filename = "ti-sysfw/ti-fs-stub-firmware-am62x-gp.bin";
> + type = "blob-ext";
> + optional;
> + };
> + };
> +
>   ti-spl {
>   insert-template = <_spl_template>;
>  
>   fit {
>

We also might want to clean-up this spurious newline being a remnant of
commit 4509b9ff0b8c ("arm: dts: k3-*-binman: Move to using templated FITs").

>   images {
> + tifsstub-hs {
> + description = "TIFSSTUB";
> + type = "firmware";
> + arch = "arm32";
> + compression = "none";
> + os = "tifsstub-hs";
> + load = <0x9dc0>;
> + entry = <0x9dc0>;
> + blob-ext {
> + filename = "tifsstub.bin_hs";
> + };
> + };
> +
> + tifsstub-fs {
> + description = "TIFSSTUB";
> + type = "firmware";
> + arch = "arm32";
> +  

[PATCH v1] verdin-imx8mm/verdin-imx8mp: move imx verdins to OF_UPSTREAM

2024-04-03 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Move verdin-imx8mm and verdin-imx8mp to OF_UPSTREAM:
- handle the fact that dtbs now have a 'freescale/' prefix
- imply OF_UPSTREAM
- remove redundant files from arch/arm/dts leaving only the
  *-u-boot.dtsi files
- update MAINTAINERS files

Signed-off-by: Marcel Ziswiler 

---

 arch/arm/dts/Makefile   |2 -
 arch/arm/dts/imx8mm-verdin-dev.dtsi |  160 ---
 arch/arm/dts/imx8mm-verdin-wifi-dev.dts |   18 -
 arch/arm/dts/imx8mm-verdin-wifi.dtsi|   94 --
 arch/arm/dts/imx8mm-verdin.dtsi | 1319 -
 arch/arm/dts/imx8mp-verdin-dev.dtsi |  165 ---
 arch/arm/dts/imx8mp-verdin-wifi-dev.dts |   18 -
 arch/arm/dts/imx8mp-verdin-wifi.dtsi|   87 --
 arch/arm/dts/imx8mp-verdin.dtsi | 1438 ---
 arch/arm/mach-imx/imx8m/Kconfig |2 +
 board/toradex/verdin-imx8mm/MAINTAINERS |4 -
 board/toradex/verdin-imx8mp/MAINTAINERS |4 -
 configs/verdin-imx8mm_defconfig |2 +-
 configs/verdin-imx8mp_defconfig |2 +-
 14 files changed, 4 insertions(+), 3311 deletions(-)
 delete mode 100644 arch/arm/dts/imx8mm-verdin-dev.dtsi
 delete mode 100644 arch/arm/dts/imx8mm-verdin-wifi-dev.dts
 delete mode 100644 arch/arm/dts/imx8mm-verdin-wifi.dtsi
 delete mode 100644 arch/arm/dts/imx8mm-verdin.dtsi
 delete mode 100644 arch/arm/dts/imx8mp-verdin-dev.dtsi
 delete mode 100644 arch/arm/dts/imx8mp-verdin-wifi-dev.dts
 delete mode 100644 arch/arm/dts/imx8mp-verdin-wifi.dtsi
 delete mode 100644 arch/arm/dts/imx8mp-verdin.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 18fedc16740..cd8aa0b4143 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1082,7 +1082,6 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
imx8mm-phg.dtb \
imx8mm-phyboard-polis-rdk.dtb \
imx8mm-phygate-tauri-l.dtb \
-   imx8mm-verdin-wifi-dev.dtb \
imx8mn-bsh-smm-s2.dtb \
imx8mn-bsh-smm-s2pro.dtb \
imx8mq-cm.dtb \
@@ -1104,7 +1103,6 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
imx8mp-icore-mx8mp-edimm2.2.dtb \
imx8mp-msc-sm2s.dtb \
imx8mp-phyboard-pollux-rdk.dtb \
-   imx8mp-verdin-wifi-dev.dtb \
imx8mq-pico-pi.dtb \
imx8mq-kontron-pitx-imx8m.dtb \
imx8mq-librem5-r4.dtb
diff --git a/arch/arm/dts/imx8mm-verdin-dev.dtsi 
b/arch/arm/dts/imx8mm-verdin-dev.dtsi
deleted file mode 100644
index 3c4b8ca125e..000
--- a/arch/arm/dts/imx8mm-verdin-dev.dtsi
+++ /dev/null
@@ -1,160 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/*
- * Copyright 2022 Toradex
- */
-
-/ {
-   sound_card: sound-card {
-   compatible = "simple-audio-card";
-   simple-audio-card,bitclock-master = <_master>;
-   simple-audio-card,format = "i2s";
-   simple-audio-card,frame-master = <_master>;
-   simple-audio-card,mclk-fs = <256>;
-   simple-audio-card,name = "imx8mm-nau8822";
-   simple-audio-card,routing =
-   "Headphones", "LHP",
-   "Headphones", "RHP",
-   "Speaker", "LSPK",
-   "Speaker", "RSPK",
-   "Line Out", "AUXOUT1",
-   "Line Out", "AUXOUT2",
-   "LAUX", "Line In",
-   "RAUX", "Line In",
-   "LMICP", "Mic In",
-   "RMICP", "Mic In";
-   simple-audio-card,widgets =
-   "Headphones", "Headphones",
-   "Line Out", "Line Out",
-   "Speaker", "Speaker",
-   "Microphone", "Mic In",
-   "Line", "Line In";
-
-   dailink_master: simple-audio-card,codec {
-   clocks = < IMX8MM_CLK_SAI2_ROOT>;
-   sound-dai = <_1a>;
-   };
-
-   simple-audio-card,cpu {
-   sound-dai = <>;
-   };
-   };
-};
-
-/* Verdin SPI_1 */
- {
-   status = "okay";
-};
-
-/* EEPROM on display adapter boards */
-_display_adapter {
-   status = "okay";
-};
-
-/* EEPROM on Verdin Development board */
-_carrier_board {
-   status = "okay";
-};
-
- {
-   status = "okay";
-};
-
-/* Verdin QSPI_1 */
- {
-   status = "okay";
-};
-
-/* Current measurement into module VCC */
- {
-   status = "okay";
-};
-
-_temp {
-   vs-supply = <_1p8v>;
-   status = "okay";
-};
-
- {
-   status = "okay&qu

[PATCH v1] verdin-am62: move verdin am62 to OF_UPSTREAM

2024-04-03 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Move verdin-am62 to OF_UPSTREAM:
- handle the fact that dtbs now have a 'ti/' prefix
- imply OF_UPSTREAM
- remove redundant files from arch/arm/dts leaving only the
  *-u-boot.dtsi files
- update MAINTAINERS file

Signed-off-by: Marcel Ziswiler 

---

 arch/arm/dts/Makefile |1 -
 arch/arm/dts/k3-am62-verdin-dev.dtsi  |  240 ---
 arch/arm/dts/k3-am62-verdin-wifi.dtsi |   45 -
 arch/arm/dts/k3-am62-verdin.dtsi  | 1443 -
 .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  |2 +-
 arch/arm/dts/k3-am625-verdin-wifi-dev.dts |   22 -
 arch/arm/mach-k3/am62x/Kconfig|1 +
 board/toradex/verdin-am62/MAINTAINERS |4 -
 configs/verdin-am62_a53_defconfig |2 +-
 9 files changed, 3 insertions(+), 1757 deletions(-)
 delete mode 100644 arch/arm/dts/k3-am62-verdin-dev.dtsi
 delete mode 100644 arch/arm/dts/k3-am62-verdin-wifi.dtsi
 delete mode 100644 arch/arm/dts/k3-am62-verdin.dtsi
 delete mode 100644 arch/arm/dts/k3-am625-verdin-wifi-dev.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 7b7788f7550..18fedc16740 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1416,7 +1416,6 @@ dtb-$(CONFIG_SOC_K3_AM625) += k3-am625-sk.dtb \
  k3-am625-r5-sk.dtb \
  k3-am625-beagleplay.dtb \
  k3-am625-r5-beagleplay.dtb \
- k3-am625-verdin-wifi-dev.dtb \
  k3-am625-verdin-r5.dtb \
  k3-am625-phyboard-lyra-rdk.dtb \
  k3-am625-r5-phycore-som-2gb.dtb
diff --git a/arch/arm/dts/k3-am62-verdin-dev.dtsi 
b/arch/arm/dts/k3-am62-verdin-dev.dtsi
deleted file mode 100644
index 6701cb8974b..000
--- a/arch/arm/dts/k3-am62-verdin-dev.dtsi
+++ /dev/null
@@ -1,240 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/*
- * Copyright 2023 Toradex
- *
- * Common dtsi for Verdin AM62 SoM on Development carrier board
- *
- * https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62
- * https://www.toradex.com/products/carrier-board/verdin-development-board-kit
- */
-
-/ {
-   sound {
-   compatible = "simple-audio-card";
-   simple-audio-card,bitclock-master = <_dai>;
-   simple-audio-card,format = "i2s";
-   simple-audio-card,frame-master = <_dai>;
-   simple-audio-card,name = "verdin-nau8822";
-   simple-audio-card,routing =
-   "Headphones", "LHP",
-   "Headphones", "RHP",
-   "Speaker", "LSPK",
-   "Speaker", "RSPK",
-   "Line Out", "AUXOUT1",
-   "Line Out", "AUXOUT2",
-   "LAUX", "Line In",
-   "RAUX", "Line In",
-   "LMICP", "Mic In",
-   "RMICP", "Mic In";
-   simple-audio-card,widgets =
-   "Headphones", "Headphones",
-   "Line Out", "Line Out",
-   "Speaker", "Speaker",
-   "Microphone", "Mic In",
-   "Line", "Line In";
-
-   codec_dai: simple-audio-card,codec {
-   clocks = <_refclk1>;
-   sound-dai = <_1a>;
-   };
-
-   simple-audio-card,cpu {
-   sound-dai = <>;
-   };
-   };
-};
-
-/* Verdin ETHs */
- {
-   pinctrl-names = "default";
-   pinctrl-0 = <_rgmii1>, <_rgmii2>;
-   status = "okay";
-};
-
-/* MDIO, shared by Verdin ETH_1 (On-module PHY) and Verdin ETH_2_RGMII */
-_mdio {
-   status = "okay";
-
-   cpsw3g_phy1: ethernet-phy@7 {
-   compatible = "ethernet-phy-ieee802.3-c22";
-   reg = <7>;
-   interrupt-parent = <_gpio0>;
-   interrupts = <38 IRQ_TYPE_EDGE_FALLING>;
-   pinctrl-names = "default";
-   pinctrl-0 = <_eth2_rgmii_int>;
-   micrel,led-mode = <0>;
-   };
-};
-
-/* Verdin ETH_1 (On-module PHY) */
-_port1 {
-   status = "okay";
-};
-
-/* Verdin ETH_2_RGMII */
-_port2 {
-   phy-handle = <_phy1>;
-   phy-mode = "rgmii-rxid";
-   status = "okay";
-};
-
-/* Verdin PWM_1, PWM_2 */
- {
-   status = "okay";
-};
-
-/* Verdin PW

Re: [PATCH] colibri-imx8x: Fix sc_misc_otp_fuse_read() error check

2024-03-13 Thread Marcel Ziswiler
Hi Fabio

Thanks!

On Tue, 2024-03-12 at 21:36 -0300, Fabio Estevam wrote:
> Commit aa6e698a7acd ("imx: toradex/colibri-imx8x: correct SCU API usage")
> made an incorrect logic change in the error code check of
> sc_misc_otp_fuse_read():
> 
> -   if (sc_err == SC_ERR_NONE) {
> +   if (sc_err) {
>     /* DX has two A35 cores disabled */
>     return (val & 0xf) != 0x0;
>     }
> 
> The other changes in this commit are correct.
> 
> sc_misc_otp_fuse_read() returns 0 on a successful fuse read.
> 
> This inversion causes board_mem_get_layout() to report incorrect RAM size.
> 
> Go back the original error check logic to fix the problem.
> 
> Fixes: aa6e698a7acd ("imx: toradex/colibri-imx8x: correct SCU API usage")
> Reported-by: Hiago De Franco 
> Signed-off-by: Fabio Estevam 

Acked-by: Marcel Ziswiler 

> diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c 
> b/board/toradex/colibri-imx8x/colibri-imx8x.c
> index 2c673a4a6b06..6fc8076163c6 100644
> --- a/board/toradex/colibri-imx8x/colibri-imx8x.c
> +++ b/board/toradex/colibri-imx8x/colibri-imx8x.c
> @@ -46,7 +46,7 @@ static int is_imx8dx(void)
>   u32 val = 0;
>   int sc_err = sc_misc_otp_fuse_read(-1, 6, );
>  
> - if (sc_err) {
> + if (!sc_err) {
>   /* DX has two A35 cores disabled */
>   return (val & 0xf) != 0x0;
>   }

Cheers

Marcel


Re: [PATCH] apalis-imx8: Fix sc_misc_otp_fuse_read() error check

2024-03-13 Thread Marcel Ziswiler
Hi Fabio

Thanks!

On Tue, 2024-03-12 at 21:59 -0300, Fabio Estevam wrote:
> Commit bfb3409d676f ("imx: toradex/apalis-imx8: correct SCU API usage")
> made an incorrect logic change in the error code check of
> sc_misc_otp_fuse_read():
> 
> -   if (scierr == SC_ERR_NONE) {
> +   if (scierr) {
>     /* QP has one A72 core disabled */
>     is_quadplus = ((val >> 4) & 0x3) != 0x0;
>     }
> 
> The other changes in this commit are correct.
> 
> sc_misc_otp_fuse_read() returns 0 on a successful fuse read.
> 
> This inversion causes board_mem_get_layout() to report incorrect RAM size.
> 
> Go back the original error check logic to fix the problem.
> 
> Fixes: bfb3409d676f ("imx: toradex/apalis-imx8: correct SCU API usage")
> Signed-off-by: Fabio Estevam 

Acked-by: Marcel Ziswiler 

> ---
>  board/toradex/apalis-imx8/apalis-imx8.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/board/toradex/apalis-imx8/apalis-imx8.c 
> b/board/toradex/apalis-imx8/apalis-imx8.c
> index 2483a63c6733..49719f2f5533 100644
> --- a/board/toradex/apalis-imx8/apalis-imx8.c
> +++ b/board/toradex/apalis-imx8/apalis-imx8.c
> @@ -133,7 +133,7 @@ void board_mem_get_layout(u64 *phys_sdram_1_start,
>   struct tdx_user_fuses tdxramfuses;
>   int scierr = sc_misc_otp_fuse_read(-1, 6, );
>  
> - if (scierr) {
> + if (!scierr) {
>   /* QP has one A72 core disabled */
>   is_quadplus = ((val >> 4) & 0x3) != 0x0;
>   }

Cheers

Marcel


Re: [PATCH v10 00/15] Introduce initial TI's J784S4 and AM69 support

2024-02-28 Thread Marcel Ziswiler
Hi Apurva

On Wed, 2024-02-28 at 16:59 +0530, Apurva Nandan wrote:
> Hi Marcel,
> 
> On 27/02/24 21:45, Marcel Ziswiler wrote:
> > Hi Apurva
> > 
> > On Sat, 2024-02-24 at 01:51 +0530, Apurva Nandan wrote:
> > > Hello Everyone!
> > > 
> > > This series will introduce basic support (SD and UART) support for Texas
> > > Instruments J784S4 EVM.
> > > 
> > > The J784S4 SoC device tree patches are taken from kernel patch submissions
> > > and will be updated as they are accepted and merged to the kernel tree.
> 
> 
> Sorry about that. I didn't update that part of the cover letter. So now, 
> we will be using
> Linux dts as a git subtree inside U-Boot. And hence, this series doesn't 
> has a Linux DTS sync/copy patch.
> 
> You can get all details in this series:
> https://lore.kernel.org/all/20240222093607.3085545-1-sumit.g...@linaro.org/#r

Yes, sorry. I got that now and with that it applies/compiles perfectly.

> > This patch set does not include any such, right?
> > 
> > Anyway, for my tests I took them from linux-next on kernel.org.
> > 
> > However, I could not get the SD card working apart from it booting U-Boot 
> > off of it:
> > 
> > U-Boot SPL 2024.04-rc3-00015-g7186697f1ff (Feb 27 2024 - 14:27:29 +0100)
> > SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
> > Initialized 4 DRAM controllers
> > SPL initial stack usage: 13416 bytes
> > Trying to boot from MMC2
> > Authentication passed
> > Authentication passed
> > Authentication passed
> > Loading Environment from nowhere... OK
> > Authentication passed
> > Authentication passed
> > Starting ATF on ARM64 core...
> >     
> > NOTICE:  BL31: v2.10.0(release):v2.10.0-412-g885e93f90
> > NOTICE:  BL31: Built : 09:48:15, Feb 27 2024
> > I/TC:
> > I/TC: OP-TEE version: 4.1.0-140-g4078bcde9 (gcc version 13.2.1 20231009 
> > (Arm GNU
> >   Toolchain 13.2.rel1 (Build arm-13.7))) #1 Tue Feb 27 08:54:24 UTC 2024 
> > aarch64
> > I/TC: WARNING: This OP-TEE configuration might be insecure!
> > I/TC: WARNING: Please check 
> > https://optee.readthedocs.io/en/latest/architecture/
> > porting_guidelines.html
> > I/TC: Primary CPU initializing
> > I/TC: GIC redistributor base address not provided
> > I/TC: Assuming default GIC group status and modifier
> > I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
> > I/TC: HUK Initialized
> > I/TC: Activated SA2UL device
> > I/TC: Enabled firewalls for SA2UL TRNG device
> > I/TC: SA2UL TRNG initialized
> > I/TC: SA2UL Drivers initialized
> > I/TC: Primary CPU switching to normal world boot
> >     
> > U-Boot SPL 2024.04-rc3-00015-g7186697f1ff-dirty (Feb 27 2024 - 16:40:07 
> > +0100)
> > SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
> > Trying to boot from MMC2
> > Authentication passed
> > Authentication passed
> > 
> > 
> > U-Boot 2024.04-rc3-00015-g7186697f1ff-dirty (Feb 27 2024 - 16:40:07 +0100)
> > 
> > SoC:   J784S4 SR1.0 HS-FS
> > Model: Texas Instruments J784S4 EVM
> > DRAM:  2 GiB (effective 32 GiB)
> > Core:  87 devices, 30 uclasses, devicetree: separate
> > Flash: 0 Bytes
> > MMC:   mmc@4f8: 0, mmc@4fb: 1
> > Loading Environment from nowhere... OK
> > In:    serial@288
> > Out:   serial@288
> > Err:   serial@288
> > am65_cpsw_nuss ethernet@4600: K3 CPSW: nuss_ver: 0x6BA02102 cpsw_ver: 
> > 0x6BA82102 ale_ver: 0x00293904
> > Ports:1 mdio_freq:100
> > Net:   eth0: ethernet@4600port@1
> > Hit any key to stop autoboot:  0
> > => mmc dev 0
> > switch to partitions #0, OK
> > mmc0(part 0) is current device
> > => mmc info
> > Device: mmc@4f8
> > Manufacturer ID: 13
> > OEM: 4e
> > Name: G1M15L
> > Bus Speed: 2
> > Mode: HS400 (200MHz)
> > Rd Block Len: 512
> > MMC version 5.1
> > High Capacity: Yes
> > Capacity: 29.6 GiB
> > Bus Width: 8-bit DDR
> > Erase Group Size: 512 KiB
> > HC WP Group Size: 8 MiB
> > User Capacity: 29.6 GiB WRREL
> > Boot Capacity: 31.5 MiB ENH
> > RPMB Capacity: 4 MiB ENH
> > Boot area 0 is not write protected
> > Boot area 1 is not write protected
> > => mmc dev 1
> > i2c_write: error waiting for data ACK (status=0x116)
> > pca953x gpio@22: Error reading output register
> > Card did not respond to voltage select! : -110
> > mmc_init: -95, time 114
> > =>
> > 
> > Not sur

Re: [PATCH v10 00/15] Introduce initial TI's J784S4 and AM69 support

2024-02-28 Thread Marcel Ziswiler
Hi Sumit

On Wed, 2024-02-28 at 11:04 +0530, Sumit Garg wrote:
> Hi Marcel,
> 
> On Tue, 27 Feb 2024 at 21:45, Marcel Ziswiler
>  wrote:
> > 
> > Hi Apurva
> > 
> > On Sat, 2024-02-24 at 01:51 +0530, Apurva Nandan wrote:
> > > Hello Everyone!
> > > 
> > > This series will introduce basic support (SD and UART) support for Texas
> > > Instruments J784S4 EVM.
> > > 
> > > The J784S4 SoC device tree patches are taken from kernel patch submissions
> > > and will be updated as they are accepted and merged to the kernel tree.
> > 
> > This patch set does not include any such, right?
> > 
> 
> I suppose you have missed to apply dependencies for this patch-set,
> look for following:
> 
> Note: This series is dependent on the following series for OF_UPSTREAM support
> https://lore.kernel.org/all/20240222093607.3085545-1-sumit.g...@linaro.org/

Yes, sorry, I missed that one. With that it applies/compiles perfectly. Thanks!

However, still the same issue with the SD card:

U-Boot SPL 2024.04-rc3-00028-g9edcd6ffd06 (Feb 28 2024 - 11:53:27 +0100)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
Initialized 4 DRAM controllers
SPL initial stack usage: 13416 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed
Authentication passed
Loading Environment from nowhere... OK
Authentication passed
Authentication passed
Starting ATF on ARM64 core...
   
NOTICE:  BL31: v2.10.0(release):v2.10.0-412-g885e93f90
NOTICE:  BL31: Built : 09:48:15, Feb 27 2024
I/TC:
I/TC: OP-TEE version: 4.1.0-140-g4078bcde9 (gcc version 13.2.1 20231009 (Arm GNU
 Toolchain 13.2.rel1 (Build arm-13.7))) #1 Tue Feb 27 08:54:24 UTC 2024 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/
porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: GIC redistributor base address not provided
I/TC: Assuming default GIC group status and modifier
I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
I/TC: HUK Initialized
I/TC: Activated SA2UL device
I/TC: Enabled firewalls for SA2UL TRNG device
I/TC: SA2UL TRNG initialized
I/TC: SA2UL Drivers initialized
I/TC: Primary CPU switching to normal world boot
   
U-Boot SPL 2024.04-rc3-00028-g9edcd6ffd06 (Feb 28 2024 - 11:54:01 +0100)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
Trying to boot from MMC2
Authentication passed
Authentication passed


U-Boot 2024.04-rc3-00028-g9edcd6ffd06 (Feb 28 2024 - 11:54:01 +0100)

SoC:   J784S4 SR1.0 HS-FS
Model: Texas Instruments J784S4 EVM
DRAM:  2 GiB (effective 32 GiB)
Core:  81 devices, 30 uclasses, devicetree: separate
Flash: 0 Bytes
MMC:   mmc@4f8: 0, mmc@4fb: 1
Loading Environment from nowhere... OK
In:serial@288
Out:   serial@288
Err:   serial@288
am65_cpsw_nuss ethernet@4600: K3 CPSW: nuss_ver: 0x6BA02102 cpsw_ver: 
0x6BA82102 ale_ver: 0x00293904
Ports:1 mdio_freq:100
Net:   eth0: ethernet@4600port@1
Hit any key to stop autoboot:  0 
=> mmc dev 0
switch to partitions #0, OK
mmc0(part 0) is current device
=> mmc info
Device: mmc@4f8
Manufacturer ID: 13
OEM: 4e
Name: G1M15L 
Bus Speed: 2
Mode: HS400 (200MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 29.6 GiB
Bus Width: 8-bit DDR
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 29.6 GiB WRREL
Boot Capacity: 31.5 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
=> mmc dev 1
i2c_write: error waiting for data ACK (status=0x116)
pca953x gpio@22: Error reading output register
Card did not respond to voltage select! : -110
mmc_init: -95, time 114
=> 

And yes, the SD card previously did work properly. Any ideas?

> And, '[PATCH 01/15] Makefile: remove hardcoded device tree source
> directory' has been
> cherry-picked from PATCH 11 of
> https://lore.kernel.org/all/20240201030634.1120963-16...@ti.com/ by
> Bryan
> Brattlof
> 
> -Sumit
> 
> [snip]

Cheers

Marcel


Re: [PATCH v10 13/15] configs: j784s4_evm: Add defconfig for J784S4 EVM board

2024-02-27 Thread Marcel Ziswiler
Hi Apurva

On Sat, 2024-02-24 at 01:51 +0530, Apurva Nandan wrote:
> Add defconfigs for building R5 U-Boot SPL and A72 U-Boot.
> 
> Signed-off-by: Hari Nagalla 
> Signed-off-by: Apurva Nandan 
> ---
>  board/ti/j784s4/MAINTAINERS  |   2 +
>  configs/j784s4_evm_a72_defconfig | 159 +++
>  configs/j784s4_evm_r5_defconfig  | 153 +
>  3 files changed, 314 insertions(+)
>  create mode 100644 configs/j784s4_evm_a72_defconfig
>  create mode 100644 configs/j784s4_evm_r5_defconfig
> 
> diff --git a/board/ti/j784s4/MAINTAINERS b/board/ti/j784s4/MAINTAINERS
> index 8b03a7adb1e..2b6bff2f5be 100644
> --- a/board/ti/j784s4/MAINTAINERS
> +++ b/board/ti/j784s4/MAINTAINERS
> @@ -4,6 +4,8 @@ S:Maintained
>  F:   board/ti/j784s4
>  F:   arch/arm/mach-k3/j784s4
>  F:   include/configs/j784s4_evm.h
> +F:   configs/j784s4_evm_r5_defconfig
> +F:   configs/j784s4_evm_a72_defconfig
>  F:   arch/arm/dts/k3-j784s4-evm-u-boot.dtsi
>  F:   arch/arm/dts/k3-j784s4-r5-evm.dts
>  F:   arch/arm/dts/k3-j784s4-ddr.dtsi
> diff --git a/configs/j784s4_evm_a72_defconfig 
> b/configs/j784s4_evm_a72_defconfig
> new file mode 100644
> index 000..6c62403613a
> --- /dev/null
> +++ b/configs/j784s4_evm_a72_defconfig
> @@ -0,0 +1,159 @@
> +CONFIG_ARM=y
> +CONFIG_ARCH_K3=y
> +CONFIG_TI_SECURE_DEVICE=y
> +CONFIG_SYS_MALLOC_F_LEN=0x8000
> +CONFIG_SPL_GPIO=y
> +CONFIG_SPL_LIBCOMMON_SUPPORT=y
> +CONFIG_SPL_LIBGENERIC_SUPPORT=y
> +CONFIG_NR_DRAM_BANKS=2
> +CONFIG_SOC_K3_J784S4=y
> +CONFIG_TARGET_J784S4_A72_EVM=y
> +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x8048
> +CONFIG_SF_DEFAULT_SPEED=2500
> +CONFIG_ENV_SIZE=0x2
> +CONFIG_DM_GPIO=y
> +CONFIG_SPL_DM_SPI=y
> +CONFIG_OF_UPSTREAM=y
> +CONFIG_DEFAULT_DEVICE_TREE="ti/k3-j784s4-evm"

Same device trees vendor folder here.

> +CONFIG_SPL_TEXT_BASE=0x8008
> +CONFIG_OF_LIBFDT_OVERLAY=y
> +CONFIG_DM_RESET=y
> +CONFIG_SPL_MMC=y
> +CONFIG_SPL_SERIAL=y
> +CONFIG_SPL_DRIVERS_MISC=y
> +CONFIG_SPL_STACK_R_ADDR=0x8200
> +CONFIG_SPL_FS_FAT=y
> +CONFIG_SPL_LIBDISK_SUPPORT=y
> +CONFIG_SPL_SPI_FLASH_SUPPORT=y
> +CONFIG_SPL_SPI=y
> +CONFIG_SPL_LOAD_FIT=y
> +CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
> +CONFIG_BOOTSTD_FULL=y
> +CONFIG_BOOTSTD_DEFAULTS=y
> +CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"
> +CONFIG_BOARD_LATE_INIT=y
> +CONFIG_LOGLEVEL=7
> +CONFIG_SPL_MAX_SIZE=0xc
> +CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
> +CONFIG_SPL_BSS_START_ADDR=0x80a0
> +CONFIG_SPL_BSS_MAX_SIZE=0x8
> +CONFIG_SPL_BOARD_INIT=y
> +CONFIG_SPL_SYS_MALLOC_SIMPLE=y
> +CONFIG_SPL_STACK_R=y
> +CONFIG_SYS_SPL_MALLOC=y
> +CONFIG_SYS_SPL_MALLOC_SIZE=0x80
> +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
> +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400
> +CONFIG_SPL_DMA=y
> +CONFIG_SPL_ENV_SUPPORT=y
> +CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img"
> +CONFIG_SPL_I2C=y
> +CONFIG_SPL_DM_MAILBOX=y
> +CONFIG_SPL_MTD_SUPPORT=y
> +CONFIG_SPL_DM_SPI_FLASH=y
> +CONFIG_SPL_DM_RESET=y
> +CONFIG_SPL_POWER_DOMAIN=y
> +CONFIG_SPL_RAM_SUPPORT=y
> +CONFIG_SPL_RAM_DEVICE=y
> +CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
> +CONFIG_SPL_SPI_LOAD=y
> +CONFIG_SYS_SPI_U_BOOT_OFFS=0x28
> +CONFIG_SPL_THERMAL=y
> +CONFIG_SPL_YMODEM_SUPPORT=y
> +CONFIG_SYS_MAXARGS=64
> +CONFIG_CMD_ASKENV=y
> +CONFIG_CMD_GPIO=y
> +CONFIG_CMD_GPT=y
> +CONFIG_CMD_I2C=y
> +CONFIG_CMD_MMC=y
> +CONFIG_CMD_MTD=y
> +CONFIG_CMD_TIME=y
> +CONFIG_CMD_EXT4_WRITE=y
> +CONFIG_OF_CONTROL=y
> +CONFIG_SPL_OF_CONTROL=y
> +CONFIG_SPL_MULTI_DTB_FIT=y
> +CONFIG_OF_LIST="ti/k3-j784s4-evm"

And here.

> +CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
> +CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
> +CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_NET_RANDOM_ETHADDR=y
> +CONFIG_SPL_DM=y
> +CONFIG_SPL_DM_SEQ_ALIAS=y
> +CONFIG_REGMAP=y
> +CONFIG_SPL_REGMAP=y
> +CONFIG_SPL_SYSCON=y
> +CONFIG_SPL_OF_TRANSLATE=y
> +CONFIG_CLK=y
> +CONFIG_SPL_CLK=y
> +CONFIG_CLK_CCF=y
> +CONFIG_CLK_TI_SCI=y
> +CONFIG_DMA_CHANNELS=y
> +CONFIG_TI_K3_NAVSS_UDMA=y
> +CONFIG_TI_SCI_PROTOCOL=y
> +CONFIG_DA8XX_GPIO=y
> +CONFIG_DM_PCA953X=y
> +CONFIG_DM_I2C=y
> +CONFIG_DM_I2C_GPIO=y
> +CONFIG_SYS_I2C_OMAP24XX=y
> +CONFIG_DM_MAILBOX=y
> +CONFIG_K3_SEC_PROXY=y
> +CONFIG_SUPPORT_EMMC_BOOT=y
> +CONFIG_MMC_IO_VOLTAGE=y
> +CONFIG_MMC_UHS_SUPPORT=y
> +CONFIG_MMC_HS400_SUPPORT=y
> +CONFIG_SPL_MMC_HS400_SUPPORT=y
> +CONFIG_MMC_SDHCI=y
> +CONFIG_MMC_SDHCI_ADMA=y
> +CONFIG_SPL_MMC_SDHCI_ADMA=y
> +CONFIG_MMC_SDHCI_AM654=y
> +CONFIG_MTD=y
> +CONFIG_DM_MTD=y
> +CONFIG_MTD_NOR_FLASH=y
> +CONFIG_CFI_FLASH=y
> +CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
> +CONFIG_FLASH_CFI_MTD=y
> +CONFIG_SYS_FLASH_CFI=y
> +CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y
> +CONFIG_DM_SPI_FLASH=y
> +CONFIG_SPI_FLASH_SFDP_SUPPORT=y
> +CONFIG_SPI_FLASH_SOFT_RESET=y
> +CONFIG_SPI_FLASH_SOFT_RESET_ON_BOOT=y
> +CONFIG_SPI_FLASH_SPANSION=y
> +CONFIG_SPI_FLASH_S28HX_T=y
> +CONFIG_SPI_FLASH_STMICRO=y
> +CONFIG_SPI_FLASH_MT35XU=y
> +CONFIG_SPI_FLASH_MTD=y
> +CONFIG_MULTIPLEXER=y
> +CONFIG_MUX_MMIO=y
> 

Re: [PATCH v10 11/15] arm: dts: Introduce j784s4 u-boot dts files

2024-02-27 Thread Marcel Ziswiler
Hi Apurva

On Sat, 2024-02-24 at 01:51 +0530, Apurva Nandan wrote:
> Introduce the base dts files needed for u-boot or to augment the linux
> dtbs for use in the u-boot-spl and u-boot binaries.
> 
> Signed-off-by: Hari Nagalla 
> [ add binman and ddr dtsi files ]
> Signed-off-by: Neha Malcom Francis 
> Signed-off-by: Dasnavis Sabiya 
> Signed-off-by: Apurva Nandan 
> ---
>  arch/arm/dts/Makefile    |    3 +
>  arch/arm/dts/k3-j784s4-binman.dtsi   |  345 +
>  arch/arm/dts/k3-j784s4-ddr-evm-lp4-4266.dtsi | 8757 +
>  arch/arm/dts/k3-j784s4-ddr.dtsi  | 8858 ++
>  arch/arm/dts/k3-j784s4-evm-u-boot.dtsi   |   31 +
>  arch/arm/dts/k3-j784s4-r5-evm.dts    |  106 +
>  board/ti/j784s4/MAINTAINERS  |    4 +
>  7 files changed, 18104 insertions(+)
>  create mode 100644 arch/arm/dts/k3-j784s4-binman.dtsi
>  create mode 100644 arch/arm/dts/k3-j784s4-ddr-evm-lp4-4266.dtsi
>  create mode 100644 arch/arm/dts/k3-j784s4-ddr.dtsi
>  create mode 100644 arch/arm/dts/k3-j784s4-evm-u-boot.dtsi
>  create mode 100644 arch/arm/dts/k3-j784s4-r5-evm.dts
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 7c2681eb937..e484112dd7c 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -1412,6 +1412,9 @@ dtb-$(CONFIG_SOC_K3_J721S2) += 
> k3-am68-sk-base-board.dtb\
>      k3-am68-sk-r5-base-board.dtb\
>      k3-j721s2-common-proc-board.dtb\
>      k3-j721s2-r5-common-proc-board.dtb
> +
> +dtb-$(CONFIG_SOC_K3_J784S4) += k3-j784s4-r5-evm.dtb
> +
>  dtb-$(CONFIG_SOC_K3_AM642) += k3-am642-evm.dtb \
>     k3-am642-r5-evm.dtb \
>     k3-am642-sk.dtb \
> diff --git a/arch/arm/dts/k3-j784s4-binman.dtsi 
> b/arch/arm/dts/k3-j784s4-binman.dtsi
> new file mode 100644
> index 000..e4dd6e14a66
> --- /dev/null
> +++ b/arch/arm/dts/k3-j784s4-binman.dtsi
> @@ -0,0 +1,345 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
> + */
> +
> +#include "k3-binman.dtsi"
> +
> +#ifdef CONFIG_TARGET_J784S4_R5_EVM
> +
> +_yaml_tifs {
> + config = "tifs-rm-cfg.yaml";
> +};
> +
> + {
> + tiboot3-j784s4-hs-evm.bin {
> + filename = "tiboot3-j784s4-hs-evm.bin";
> +
> + ti-secure-rom {
> + content = <_boot_spl>, <_fs_enc>, 
> <_tifs_cfg>,
> + <_dm_cfg>, <_inner_cert>;
> + combined;
> + dm-data;
> + sysfw-inner-cert;
> + keyfile = "custMpk.pem";
> + sw-rev = <1>;
> + content-sbl = <_boot_spl>;
> + content-sysfw = <_fs_enc>;
> + content-sysfw-data = <_tifs_cfg>;
> + content-sysfw-inner-cert = <_inner_cert>;
> + content-dm-data = <_dm_cfg>;
> + load = <0x41c0>;
> + load-sysfw = <0x4>;
> + load-sysfw-data = <0x66800>;
> + load-dm-data = <0x41c8>;
> + };
> +
> + u_boot_spl: u-boot-spl {
> + no-expanded;
> + };
> +
> + ti_fs_enc: ti-fs-enc.bin {
> + filename = "ti-sysfw/ti-fs-firmware-j784s4-hs-enc.bin";
> + type = "blob-ext";
> + optional;
> + };
> +
> + combined_tifs_cfg: combined-tifs-cfg.bin {
> + filename = "combined-tifs-cfg.bin";
> + type = "blob-ext";
> + };
> +
> + sysfw_inner_cert: sysfw-inner-cert {
> + filename = "ti-sysfw/ti-fs-firmware-j784s4-hs-cert.bin";
> + type = "blob-ext";
> + optional;
> + };
> +
> + combined_dm_cfg: combined-dm-cfg.bin {
> + filename = "combined-dm-cfg.bin";
> + type = "blob-ext";
> + };
> + };
> +};
> +
> + {
> + tiboot3-j784s4-hs-fs-evm.bin {
> + filename = "tiboot3-j784s4-hs-fs-evm.bin";
> +
> + ti-secure-rom {
> + content = <_boot_spl_fs>, <_fs_enc_fs>, 
> <_tifs_cfg_fs>,
> + <_dm_cfg_fs>, <_inner_cert_fs>;
> + combined;
> + dm-data;
> + sysfw-inner-cert;
> + keyfile = "custMpk.pem";
> + sw-rev = <1>;
> + content-sbl = <_boot_spl_fs>;
> + content-sysfw = <_fs_enc_fs>;
> + content-sysfw-data = <_tifs_cfg_fs>;
> + content-sysfw-inner-cert = <_inner_cert_fs>;
> + content-dm-data = <_dm_cfg_fs>;
> +   

Re: [PATCH v10 12/15] arm: dts: Introduce am69-sk u-boot dts files

2024-02-27 Thread Marcel Ziswiler
Hi Apurva

On Sat, 2024-02-24 at 01:51 +0530, Apurva Nandan wrote:
> From: Dasnavis Sabiya 
> 
> Introduce the base dts files needed for u-boot or to augment the linux
> dtbs for use in the u-boot-spl and u-boot binaries.
> 
> Signed-off-by: Dasnavis Sabiya 
> Signed-off-by: Apurva Nandan 
> ---
>  arch/arm/dts/Makefile   |   3 +-
>  arch/arm/dts/k3-am69-r5-sk.dts  | 106 
>  arch/arm/dts/k3-am69-sk-u-boot.dtsi |  54 ++
>  board/ti/j784s4/MAINTAINERS |   6 ++
>  4 files changed, 168 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/k3-am69-r5-sk.dts
>  create mode 100644 arch/arm/dts/k3-am69-sk-u-boot.dtsi
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index e484112dd7c..e3a47d055b0 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -1413,7 +1413,8 @@ dtb-$(CONFIG_SOC_K3_J721S2) += 
> k3-am68-sk-base-board.dtb\
>      k3-j721s2-common-proc-board.dtb\
>      k3-j721s2-r5-common-proc-board.dtb
>  
> -dtb-$(CONFIG_SOC_K3_J784S4) += k3-j784s4-r5-evm.dtb
> +dtb-$(CONFIG_SOC_K3_J784S4) += k3-am69-r5-sk.dtb \
> +    k3-j784s4-r5-evm.dtb
>  
>  dtb-$(CONFIG_SOC_K3_AM642) += k3-am642-evm.dtb \
>     k3-am642-r5-evm.dtb \
> diff --git a/arch/arm/dts/k3-am69-r5-sk.dts b/arch/arm/dts/k3-am69-r5-sk.dts
> new file mode 100644
> index 000..f177f563527
> --- /dev/null
> +++ b/arch/arm/dts/k3-am69-r5-sk.dts
> @@ -0,0 +1,106 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2022-2023 Texas Instruments Incorporated - 
> https://www.ti.com/
> + */
> +
> +/dts-v1/;
> +
> +#include "k3-am69-sk.dts"
> +#include "k3-j784s4-ddr-evm-lp4-4266.dtsi"
> +#include "k3-j784s4-ddr.dtsi"
> +#include "k3-am69-sk-u-boot.dtsi"
> +
> +/ {
> + chosen {
> + tick-timer = _timer0;
> + };
> +
> + aliases {
> + remoteproc0 = 
> + remoteproc1 = _0;
> + };
> +
> + a72_0: a72@0 {
> + compatible = "ti,am654-rproc";
> + reg = <0x0 0x00a9 0x0 0x10>;
> + power-domains = <_pds 61 TI_SCI_PD_EXCLUSIVE>,
> + <_pds 202 TI_SCI_PD_EXCLUSIVE>;
> + resets = <_reset 202 0>;
> + clocks = <_clks 61 0>;
> + assigned-clocks = <_clks 61 0>, <_clks 202 0>;
> + assigned-clock-parents = <_clks 61 2>;
> + assigned-clock-rates = <2>, <20>;
> + ti,sci = <>;
> + ti,sci-proc-id = <32>;
> + ti,sci-host-id = <10>;
> + bootph-pre-ram;
> + };
> +
> + dm_tifs: dm-tifs {
> + compatible = "ti,j721e-dm-sci";
> + ti,host-id = <3>;
> + ti,secure-host;
> + mbox-names = "rx", "tx";
> + mboxes= <_proxy_mcu 21>, <_proxy_mcu 23>;
> + bootph-pre-ram;
> + };
> +};
> +
> +_timer0 {
> + status = "okay";
> + clock-frequency = <25000>;
> + bootph-pre-ram;
> +};
> +
> +_proxy_sa3 {
> + status = "okay";
> + bootph-pre-ram;
> +};
> +
> +_proxy_mcu {
> + status = "okay";
> + bootph-pre-ram;
> +};
> +
> +_mcu_wakeup {
> + sysctrler: sysctrler {
> + compatible = "ti,am654-system-controller";
> + mboxes= <_proxy_mcu 4>,
> + <_proxy_mcu 5>,
> + <_proxy_sa3 5>;
> + mbox-names = "tx", "rx", "boot_notify";
> + bootph-pre-ram;
> + };
> +};
> +
> + {
> + mboxes= <_proxy_mcu 8>, <_proxy_mcu 6>, 
> <_proxy_mcu 5>;
> + mbox-names = "tx", "rx", "notify";
> + ti,host-id = <4>;
> + ti,secure-host;
> + bootph-pre-ram;
> +};
> +
> +/* WKUP UART0 is used for DM firmware logs */
> +_uart0 {
> + bootph-pre-ram;
> + status = "okay";
> +};
> +
> + {
> + reg = <0x0 0x4704 0x0 0x100>,
> +   <0x0 0x5000 0x0 0x800>;
> +};
> +
> + {
> + reg = <0x0 0x4705 0x0 0x100>,
> +   <0x0 0x5800 0x0 0x800>;
> +};
> +
> +_ringacc {
> + ti,sci = <_tifs>;
> +};
> +
> +_udmap {
> + ti,sci = <_tifs>;
> +};
> diff --git a/arch/arm/dts/k3-am69-sk-u-boot.dtsi 
> b/arch/arm/dts/k3-am69-sk-u-boot.dtsi
> new file mode 100644
> index 000..bed330e6d4e
> --- /dev/null
> +++ b/arch/arm/dts/k3-am69-sk-u-boot.dtsi
> @@ -0,0 +1,54 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2022-2023 Texas Instruments Incorporated - 
> https://www.ti.com/
> + */
> +
> +#include "k3-j784s4-binman.dtsi"
> +
> +/ {
> + memory@8000 {
> + bootph-all;
> + };
> +};
> +
> +_udmap {
> + reg =   <0x0 0x285c 0x0 0x100>,
> + <0x0 0x284c 0x0 0x4000>,
> + <0x0 0x2a80 0x0 0x4>,
> + <0x0 0x284a 0x0 0x4000>,
> + <0x0 0x2aa0 0x0 0x4>,
> + <0x0 0x2840 0x0 0x2000>;
> 

Re: [PATCH v10 00/15] Introduce initial TI's J784S4 and AM69 support

2024-02-27 Thread Marcel Ziswiler
Hi Apurva

On Sat, 2024-02-24 at 01:51 +0530, Apurva Nandan wrote:
> Hello Everyone!
> 
> This series will introduce basic support (SD and UART) support for Texas
> Instruments J784S4 EVM.
> 
> The J784S4 SoC device tree patches are taken from kernel patch submissions
> and will be updated as they are accepted and merged to the kernel tree.

This patch set does not include any such, right?

Anyway, for my tests I took them from linux-next on kernel.org.

However, I could not get the SD card working apart from it booting U-Boot off 
of it:

U-Boot SPL 2024.04-rc3-00015-g7186697f1ff (Feb 27 2024 - 14:27:29 +0100)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
Initialized 4 DRAM controllers
SPL initial stack usage: 13416 bytes
Trying to boot from MMC2
Authentication passed
Authentication passed
Authentication passed
Loading Environment from nowhere... OK
Authentication passed
Authentication passed
Starting ATF on ARM64 core...
   
NOTICE:  BL31: v2.10.0(release):v2.10.0-412-g885e93f90
NOTICE:  BL31: Built : 09:48:15, Feb 27 2024
I/TC:
I/TC: OP-TEE version: 4.1.0-140-g4078bcde9 (gcc version 13.2.1 20231009 (Arm GNU
 Toolchain 13.2.rel1 (Build arm-13.7))) #1 Tue Feb 27 08:54:24 UTC 2024 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/
porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: GIC redistributor base address not provided
I/TC: Assuming default GIC group status and modifier
I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
I/TC: HUK Initialized
I/TC: Activated SA2UL device
I/TC: Enabled firewalls for SA2UL TRNG device
I/TC: SA2UL TRNG initialized
I/TC: SA2UL Drivers initialized
I/TC: Primary CPU switching to normal world boot
   
U-Boot SPL 2024.04-rc3-00015-g7186697f1ff-dirty (Feb 27 2024 - 16:40:07 +0100)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.9--v09.01.09 (Kool Koala)')
Trying to boot from MMC2
Authentication passed
Authentication passed


U-Boot 2024.04-rc3-00015-g7186697f1ff-dirty (Feb 27 2024 - 16:40:07 +0100)

SoC:   J784S4 SR1.0 HS-FS
Model: Texas Instruments J784S4 EVM
DRAM:  2 GiB (effective 32 GiB)
Core:  87 devices, 30 uclasses, devicetree: separate
Flash: 0 Bytes
MMC:   mmc@4f8: 0, mmc@4fb: 1
Loading Environment from nowhere... OK
In:serial@288
Out:   serial@288
Err:   serial@288
am65_cpsw_nuss ethernet@4600: K3 CPSW: nuss_ver: 0x6BA02102 cpsw_ver: 
0x6BA82102 ale_ver: 0x00293904
Ports:1 mdio_freq:100
Net:   eth0: ethernet@4600port@1
Hit any key to stop autoboot:  0
=> mmc dev 0
switch to partitions #0, OK
mmc0(part 0) is current device
=> mmc info
Device: mmc@4f8
Manufacturer ID: 13
OEM: 4e
Name: G1M15L
Bus Speed: 2
Mode: HS400 (200MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 29.6 GiB
Bus Width: 8-bit DDR
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 29.6 GiB WRREL
Boot Capacity: 31.5 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
=> mmc dev 1
i2c_write: error waiting for data ACK (status=0x116)
pca953x gpio@22: Error reading output register
Card did not respond to voltage select! : -110
mmc_init: -95, time 114
=> 

Not sure what the issue may be.

> All other patches are specific to SPL and u-boot and do not have
> dependency on other trees. Appreciate a review for acceptance to u-boot
> tree.
> 
> Here are some of the salient features of the J784S4 automotive grade
> application processor:
> 
> The J784S4 SoC belongs to the K3 Multicore SoC architecture
> platform, providing advanced system integration in automotive,
> ADAS and industrial applications requiring AI at the network edge.
> This SoC extends the K3 Jacinto 7 family of SoCs with focus on
> raising performance and integration while providing interfaces,
> memory architecture and compute performance for multi-sensor, high
> concurrency applications.
> 
> Some highlights of this SoC are:
> * Up to 8 Cortex-A72s, four clusters of lockstep capable dual Cortex-R5F MCUs,
>   4 C7x floating point vector DSPs with Matrix Multiply Accelerator(MMA) for
>   deep learning and CNN.
> * 3D GPU: Automotive grade IMG BXS-4-64 MC1
> * Vision Processing Accelerator (VPAC) with image signal processor and Depth
>   and Motion Processing Accelerator (DMPAC)
> * Three CSI2.0 4L RX plus two CSI2.0 4L TX, two DSI Tx, one eDP/DP and one
>   DPI interface.
> * Integrated gigabit ethernet switch, up to 8 ports (TDA4VH), two ports
>   support 10Gb USXGMII; Two 4 lane PCIe-GEN3 controllers, USB3.0 Dual-role
>   device subsystems, Up to 20 MCANs, among other peripherals.
> 
> See J784S4 Technical Reference Manual (SPRUJ52 - JUNE 2022)
> for further details: http://www.ti.com/lit/zip/spruj52
> 
> In addtion, the J784S4 EVM board is designed for TI J784S4 SoC. It
> supports the following interfaces:
> * 32 GB DDR4 RAM
> * x2 Gigabit Ethernet interfaces capable 

Re: [PATCH 7/7] verdin-imx8mp_defconfig: Enable PCIe/NVMe support

2024-02-22 Thread Marcel Ziswiler
On Wed, 2024-02-21 at 15:31 +0100, Francesco Dolcini wrote:
> On Wed, Feb 21, 2024 at 09:18:51AM +0000, Marcel Ziswiler wrote:
> > On Wed, 2024-02-21 at 08:55 +0100, Francesco Dolcini wrote:
> > > On Tue, Feb 20, 2024 at 06:40:56PM +0530, Sumit Garg wrote:
> > > > Also, enable reset driver which is a prerequisite for PCIe support.
> > > > 
> > > > Signed-off-by: Sumit Garg 
> > > > ---
> > > >  configs/verdin-imx8mp_defconfig | 9 +
> > > >  1 file changed, 9 insertions(+)
> > > > 
> > > > diff --git a/configs/verdin-imx8mp_defconfig 
> > > > b/configs/verdin-imx8mp_defconfig
> > > > index 22b8a334dfa..d8bd644322b 100644
> > > > --- a/configs/verdin-imx8mp_defconfig
> > > > +++ b/configs/verdin-imx8mp_defconfig
> > > > @@ -185,3 +185,12 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
> > > >  CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
> > > >  CONFIG_IMX_WATCHDOG=y
> > > >  CONFIG_HEXDUMP=y
> > > > +CONFIG_DM_RESET=y
> > > > +CONFIG_RESET_IMX=y
> > > > +CONFIG_PCI=y
> > > > +CONFIG_PCIE_DW_IMX8=y
> > > > +CONFIG_PHY_IMX8M_PCIE=y
> > > > +CONFIG_CMD_PCI=y
> > > > +CONFIG_NVME=y
> > > > +CONFIG_NVME_PCI=y
> > > > +CONFIG_CMD_NVME=y
> > > 
> > > This will increase the u-boot proper size
> > 
> > Yes, I checked and it is actually slightly more than 32 K.
> > 
> > > and marginally increase the
> > > boot time (because of a bigger binary to be read from the eMMC).
> > 
> > That was also my concern.
> > 
> > > Apart of that do you expect any other impact on those changes? SPL
> > > binary size should not be affected, correct?
> > > 
> > > Asking this out loudly to confirm that nothing unexpected is going to
> > > happen because of these changes.
> > 
> > Other than that I actually gave it a quick try and PCIe/NVMe does indeed 
> > work and the regular boot is not
> > affected (other than the slight size and boot time increase, of course).
> > 
> > > For my curiosity, care to share what's the use case? Do you plan to have
> > > the OS stored into an NVME device?
> > 
> > For us the question is basically whether that use case does mandate
> > enforcing such changes for each and every customer. Plus the regular
> > expected maintenance effort any such change brings with it, of course.
> 
> Marcel, given all you wrote here I would personally be fine
> on having this enabled in the verdin_imx8mp defconfig.
> 
> What's your idea? Are you good with it?

Yes, I do agree.

> Francesco

Cheers

Marcel


Re: [PATCH v1 5/7] toradex: common: Add sysinfo driver

2024-02-21 Thread Marcel Ziswiler
Hi Tom

On Wed, 2024-02-21 at 08:10 -0500, Tom Rini wrote:
> On Tue, Feb 20, 2024 at 07:51:35PM +0000, Marcel Ziswiler wrote:
> > On Tue, 2024-02-20 at 21:14 +0200, Svyatoslav Ryhel wrote:
> > > вт, 20 лют. 2024 р. о 20:29 Francesco Dolcini  пише:
> > > > 
> > > > From: Emanuele Ghidoli 
> > > > 
> > > > This commit introduces support for the Toradex sysinfo driver in U-Boot,
> > > > which uses information from Toradex config block to print correct
> > > > board model.
> > > > In case the Toradex config block is not present sysinfo prints the model
> > > > of the board provided by device tree removing per board specific prints.
> > > > 
> > > > Signed-off-by: Emanuele Ghidoli 
> > > > Signed-off-by: Francesco Dolcini 
> > > > ---
> > > >  arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |  6 +++
> > > >  arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |  6 +++
> > > >  .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  4 ++
> > > >  arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  4 ++
> > > >  .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  4 ++
> > > >  .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  4 ++
> > > >  .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  4 ++
> > > >  .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  4 ++
> > > >  .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  4 ++
> > > >  arch/arm/dts/tegra124-apalis-u-boot.dtsi  | 12 +
> > > >  arch/arm/dts/tegra20-colibri-u-boot.dtsi  | 12 +
> > > >  arch/arm/dts/tegra30-apalis-u-boot.dtsi   | 12 +
> > > >  arch/arm/dts/tegra30-colibri-u-boot.dtsi  | 12 +
> > > >  .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |  4 ++
> > > >  board/toradex/common/Kconfig  |  1 +
> > > >  board/toradex/common/tdx-common.c | 50 ---
> > > >  16 files changed, 136 insertions(+), 7 deletions(-)
> > > >  create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi
> > > >  create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi
> > > >  create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi
> > > >  create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi
> > > > 
> > > 
> > > Greetings! Thank you for contribution but may you at split patches
> > > according to SoC vendor at least? For imx, tegra and ti since it
> > > would be hard to both review and pick them to correct custodian
> > > trees.
> > 
> > I would assume for those urgent fixes to go through Tom directly to master. 
> > Thanks!
> 
> So this is a series we need for v2024.04 then?

Yes, please. From the cover letter:

> This series fixes two regressions affecting multiple Toradex boards (i.MX, TI 
> and TEGRA based) and targets
the current master, e.g. v2024.04 release.

Thanks!

Cheers

Marcel


Re: [PATCH 7/7] verdin-imx8mp_defconfig: Enable PCIe/NVMe support

2024-02-21 Thread Marcel Ziswiler
Hi Sumit

On Wed, 2024-02-21 at 08:55 +0100, Francesco Dolcini wrote:
> Hello Sumit,
> 
> On Tue, Feb 20, 2024 at 06:40:56PM +0530, Sumit Garg wrote:
> > Also, enable reset driver which is a prerequisite for PCIe support.
> > 
> > Signed-off-by: Sumit Garg 
> > ---
> >  configs/verdin-imx8mp_defconfig | 9 +
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/configs/verdin-imx8mp_defconfig 
> > b/configs/verdin-imx8mp_defconfig
> > index 22b8a334dfa..d8bd644322b 100644
> > --- a/configs/verdin-imx8mp_defconfig
> > +++ b/configs/verdin-imx8mp_defconfig
> > @@ -185,3 +185,12 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
> >  CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
> >  CONFIG_IMX_WATCHDOG=y
> >  CONFIG_HEXDUMP=y
> > +CONFIG_DM_RESET=y
> > +CONFIG_RESET_IMX=y
> > +CONFIG_PCI=y
> > +CONFIG_PCIE_DW_IMX8=y
> > +CONFIG_PHY_IMX8M_PCIE=y
> > +CONFIG_CMD_PCI=y
> > +CONFIG_NVME=y
> > +CONFIG_NVME_PCI=y
> > +CONFIG_CMD_NVME=y
> 
> This will increase the u-boot proper size

Yes, I checked and it is actually slightly more than 32 K.

> and marginally increase the
> boot time (because of a bigger binary to be read from the eMMC).

That was also my concern.

> Apart of that do you expect any other impact on those changes? SPL
> binary size should not be affected, correct?
> 
> Asking this out loudly to confirm that nothing unexpected is going to
> happen because of these changes.

Other than that I actually gave it a quick try and PCIe/NVMe does indeed work 
and the regular boot is not
affected (other than the slight size and boot time increase, of course).

> For my curiosity, care to share what's the use case? Do you plan to have
> the OS stored into an NVME device?

For us the question is basically whether that use case does mandate enforcing 
such changes for each and every
customer. Plus the regular expected maintenance effort any such change brings 
with it, of course.

> Francesco

Cheers

Marcel


Re: [PATCH v1 5/7] toradex: common: Add sysinfo driver

2024-02-20 Thread Marcel Ziswiler
On Tue, 2024-02-20 at 21:14 +0200, Svyatoslav Ryhel wrote:
> вт, 20 лют. 2024 р. о 20:29 Francesco Dolcini  пише:
> > 
> > From: Emanuele Ghidoli 
> > 
> > This commit introduces support for the Toradex sysinfo driver in U-Boot,
> > which uses information from Toradex config block to print correct
> > board model.
> > In case the Toradex config block is not present sysinfo prints the model
> > of the board provided by device tree removing per board specific prints.
> > 
> > Signed-off-by: Emanuele Ghidoli 
> > Signed-off-by: Francesco Dolcini 
> > ---
> >  arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |  6 +++
> >  arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |  6 +++
> >  .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  4 ++
> >  arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  4 ++
> >  .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  4 ++
> >  .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  4 ++
> >  .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  4 ++
> >  .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  4 ++
> >  .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  4 ++
> >  arch/arm/dts/tegra124-apalis-u-boot.dtsi  | 12 +
> >  arch/arm/dts/tegra20-colibri-u-boot.dtsi  | 12 +
> >  arch/arm/dts/tegra30-apalis-u-boot.dtsi   | 12 +
> >  arch/arm/dts/tegra30-colibri-u-boot.dtsi  | 12 +
> >  .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |  4 ++
> >  board/toradex/common/Kconfig  |  1 +
> >  board/toradex/common/tdx-common.c | 50 ---
> >  16 files changed, 136 insertions(+), 7 deletions(-)
> >  create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi
> >  create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi
> > 
> 
> Greetings! Thank you for contribution but may you at split patches
> according to SoC vendor at least? For imx, tegra and ti since it
> would be hard to both review and pick them to correct custodian
> trees.

I would assume for those urgent fixes to go through Tom directly to master. 
Thanks!

> > diff --git a/arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi 
> > b/arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi
> > index c54a59e89c5d..d73be74d2112 100644
> > --- a/arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi
> > +++ b/arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi
> > @@ -3,6 +3,12 @@
> >   * Copyright 2019 Toradex AG
> >   */
> > 
> > +/ {
> > +   sysinfo {
> > +   compatible = "toradex,sysinfo";
> > +   };
> > +};
> > +
> >   {
> >     bootph-some-ram;
> >  };
> > diff --git a/arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi 
> > b/arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi
> > index 6ab6b1f9ee69..60c4cd6fc01f 100644
> > --- a/arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi
> > +++ b/arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi
> > @@ -3,6 +3,12 @@
> >   * Copyright 2019 Toradex AG
> >   */
> > 
> > +/ {
> > +   sysinfo {
> > +   compatible = "toradex,sysinfo";
> > +   };
> > +};
> > +
> >  &{/imx8qx-pm} {
> > 
> >     bootph-some-ram;
> > diff --git a/arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi 
> > b/arch/arm/dts/imx6dl-colibri-eval-v3-u-
> > boot.dtsi
> > index 0eea4d1862ae..5a91d0aca204 100644
> > --- a/arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi
> > +++ b/arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi
> > @@ -16,6 +16,10 @@
> >     mmc0 = 
> >     mmc1 = 
> >     };
> > +
> > +   sysinfo {
> > +   compatible = "toradex,sysinfo";
> > +   };
> >  };
> > 
> >   {
> > diff --git a/arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi 
> > b/arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi
> > index 3c6e503d043b..59412635420a 100644
> > --- a/arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi
> > +++ b/arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi
> > @@ -19,6 +19,10 @@
> >     mmc1 = 
> >     mmc2 = 
> >     };
> > +
> > +   sysinfo {
> > +   compatible = "toradex,sysinfo";
> > +   };
> >  };
> > 
> >   {
> > diff --git a/arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi 
> > b/arch/arm/dts/imx6ull-colibri-eval-v3-u-
> > boot.dtsi
> > index 6823b42d4514..731814216e1f 100644
> > --- a/arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi
> > +++ b/arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi
> > @@ -9,6 +9,10 @@
> >     usb0 =  /* required for ums */
> >     display0 = 
> >     };
> > +
> > +   sysinfo {
> > +   compatible = "toradex,sysinfo";
> > +   };
> >  };
> > 
> >  _uart1 {
> > diff --git a/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi 
> > b/arch/arm/dts/imx7d-colibri-eval-v3-u-
> > boot.dtsi
> > index b2c12a413daf..68142769d360 100644
> > --- a/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi
> > +++ b/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi
> > @@ -11,6 +11,10 @@
> >     mmc0 = 
> >     mmc1 = 

Re: [PATCH v1 0/7] toradex: fix reset and hardware detection regressions

2024-02-20 Thread Marcel Ziswiler
On Tue, 2024-02-20 at 19:29 +0100, Francesco Dolcini wrote:
> From: Francesco Dolcini 
> 
> This series fixes two regressions affecting multiple Toradex boards
> (i.MX, TI and TEGRA based) and targets the current master, e.g. v2024.04 
> release.
> 
> U-Boot `reset` command is broken on all Tordex i.MX6* based SoMs since
> v2023.07, this series fixes it enabling the `wdt-reboot` driver.
> 
> Since v2024.04-rc1 reading the Toradex configuration block is not working
> properly anymore, the serial number and the hardware version are not read
> correctly, preventing the board from functioning correctly (wrong mac address,
> wrong DT, ...). This is fixed by reading the config block in `EVT_SETTINGS_R` 
> and
> adding a toradex sysinfo driver. In addition to that, we now use a random mac
> address in case the config block is invalid.
> 
> 
> Reported-by: Sahaj Sarup 
> Closes: 
> https://lore.kernel.org/all/CAKZ1LvM45MB8N0CqgU+C7i9=bjb6kqntxwo2tv407hklwtc...@mail.gmail.com/
> Reported-by: Marcel Ziswiler 
> Closes: 
> https://lore.kernel.org/all/e40ed93bd8f371ec56b8fc451dcb458f3ce6dcba.ca...@toradex.com/
> Reported-by: Francesco Dolcini 
> Closes: https://lore.kernel.org/all/ZY2ZDWAQuTlRjV9H@francesco-nb/

For the whole series:

Acked-by: Marcel Ziswiler 
Tested-by: Marcel Ziswiler  # Verdin iMX8M Plus

> Emanuele Ghidoli (6):
>   toradex: Fix recursive call to checkboard
>   toradex: Remove not necessary model prints from checkboard()
>   toradex: common: Use SETTINGS_R event to read toradex config block
>   arm: dts: Refactor device trees using "&{/aliases}" syntax
>   toradex: common: Add sysinfo driver
>   toradex: common: Use random mac address if toradex config block is
>     missing
> 
> Parth Pancholi (1):
>   toradex: imx6*: fix reset using wdt-reboot driver
> 
>  arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |   6 +
>  arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |   6 +
>  .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  28 +++-
>  arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  36 +++--
>  .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  14 ++
>  .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  14 +-
>  .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  16 +-
>  .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  16 +-
>  .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |   4 +
>  arch/arm/dts/tegra124-apalis-u-boot.dtsi  |  12 ++
>  arch/arm/dts/tegra20-colibri-u-boot.dtsi  |  12 ++
>  arch/arm/dts/tegra30-apalis-u-boot.dtsi   |  12 ++
>  arch/arm/dts/tegra30-colibri-u-boot.dtsi  |  12 ++
>  .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |   4 +
>  board/toradex/apalis-imx8/apalis-imx8.c   |  10 --
>  board/toradex/apalis-tk1/apalis-tk1.c |   7 -
>  board/toradex/apalis_imx6/apalis_imx6.c   |  21 ---
>  board/toradex/apalis_t30/apalis_t30.c |   8 -
>  .../toradex/colibri-imx6ull/colibri-imx6ull.c |   7 -
>  board/toradex/colibri-imx8x/colibri-imx8x.c   |  10 --
>  board/toradex/colibri_imx6/colibri_imx6.c |  20 ---
>  board/toradex/colibri_imx7/colibri_imx7.c |   8 -
>  board/toradex/colibri_t20/colibri_t20.c   |  10 --
>  board/toradex/colibri_t30/colibri_t30.c   |   7 -
>  board/toradex/colibri_vf/colibri_vf.c |  10 --
>  board/toradex/common/Kconfig  |   1 +
>  board/toradex/common/tdx-common.c | 137 +-
>  board/toradex/common/tdx-common.h |   1 -
>  configs/apalis-imx8_defconfig |   1 +
>  configs/apalis-tk1_defconfig  |   1 +
>  configs/apalis_imx6_defconfig |   4 +
>  configs/apalis_t30_defconfig  |   1 +
>  configs/colibri-imx6ull-emmc_defconfig    |   4 +
>  configs/colibri-imx6ull_defconfig |   4 +
>  configs/colibri-imx8x_defconfig   |   1 +
>  configs/colibri_imx6_defconfig    |   4 +
>  configs/colibri_imx7_defconfig    |   1 +
>  configs/colibri_imx7_emmc_defconfig   |   1 +
>  configs/colibri_t20_defconfig |   1 +
>  configs/colibri_t30_defconfig |   1 +
>  configs/colibri_vf_defconfig  |   1 +
>  configs/verdin-am62_a53_defconfig |   1 +
>  configs/verdin-am62_r5_defconfig  |   1 +
>  configs/verdin-imx8mm_defconfig   |   1 +
>  configs/verdin-imx8mp_defconfig   |   1 +
>  45 files changed, 284 insertions(+), 194 deletions(-)
>  create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi
>  create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi
>  create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi
>  create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi


Re: REGRESSION: [PATCH 5/9] toradex: Use checkboard() instead of show_board_info()

2024-02-07 Thread Marcel Ziswiler
Gentle ping on this. Any opinion on that matter much appreciated. Thanks!

On Wed, 2024-01-24 at 18:16 +0100, Marcel Ziswiler wrote:
> Hi Simon
> 
> Sorry, I missed this one, also due to a longer Xmas/New Year and later skiing 
> vacation.
> 
> On Sun, 2023-11-12 at 19:58 -0700, Simon Glass wrote:
> > Boards can use a sysinfo driver if a particular model name is needed.
> 
> Okay, but so far we did print more than just a model name:
> 
> On Apalis/Colibri:
> 
> Model: Toradex 0028 Apalis iMX6Q 2GB IT V1.1D
> Serial#: 10867499
> 
> On Verdin:
> 
> Model: Toradex 0058 Verdin iMX8M Plus Quad 4GB WB IT V1.1A
> Serial#: 14772913
> Carrier: Toradex Dahlia V1.1A, Serial# 10870316
> 
> Optionally there would even be display adapters with potentially more model 
> (serial) information.
> 
> Now with your change we get the following:
> 
> On Apalis/Colibri:
> 
> Model: Toradex Apalis iMX6Q/D Module on Apalis Evaluation Board
> Model: Toradex Apalis iMX6 Quad 2GB IT
> Model: Toradex 0028 Apalis iMX6Q 2GB IT V1.1D
> Serial#: 11211073
> 
> The first line gets printed from the information in the device tree, the 
> second Line from the fall-back in
> our
> board file (which so far was only used for the case when we failed reading 
> the ConfigBlock) and the third and
> fourth lines are the previous information. Ugly, but so far so good.
> 
> On Verdin:
> 
> Model: Toradex Verdin iMX8M Plus WB on Verdin Development Board
> 
> Here only the device tree information gets printed and the ConfigBlock is not 
> even read at all which
> subsequently fails detecting the variant (e.g. Wi-Fi vs. non-Wi-Fi) and later 
> Ethernet fails due to an
> invalid
> MAC address. This does not look good...
> 
> Anyway, I don't propose to just revert your work but instead looked into 
> converting our previous
> show_board_info (now tdx_checkboard) to a proper sysinfo driver. The basics 
> actually worked quite smoothly
> but
> we would need more than just SYSINFO_ID_BOARD_MODEL, just like you do with 
> CONFIG_SYSINFO_EXTRA. Of course, I
> could just do a CONFIG_SYSINFO_TORADEX, with e.g. SYSINFO_ID_BOARD_SERIAL and 
> optionally
> SYSINFO_ID_BOARD_CARRIER or something but maybe a more generic way of 
> extending sysinfo would make more
> sense.
> 
> What do you think?
> 
> > Update this board to use checkboard() directly, rather than having a
> > weak function laid on top of a weak function.
> 
> Unfortunately, as mentioned above, this does not quite lead to any desired 
> behaviour.
> 
> > Make all the checkboard() functions call the new tdx_checkboard() so
> > that the same information is displayed.
> 
> Not quite.
> 
> > Signed-off-by: Simon Glass 
> > ---
> > 
> >  board/toradex/apalis-imx8/apalis-imx8.c | 2 +-
> >  board/toradex/apalis-tk1/apalis-tk1.c   | 2 +-
> >  board/toradex/apalis_imx6/apalis_imx6.c | 3 ++-
> >  board/toradex/apalis_t30/apalis_t30.c   | 2 +-
> >  board/toradex/colibri-imx6ull/colibri-imx6ull.c | 2 +-
> >  board/toradex/colibri-imx8x/colibri-imx8x.c | 2 +-
> >  board/toradex/colibri_imx6/colibri_imx6.c   | 3 ++-
> >  board/toradex/colibri_imx7/colibri_imx7.c   | 2 +-
> >  board/toradex/colibri_t20/colibri_t20.c | 2 +-
> >  board/toradex/colibri_t30/colibri_t30.c | 2 +-
> >  board/toradex/colibri_vf/colibri_vf.c   | 2 +-
> >  board/toradex/common/tdx-common.c   | 2 +-
> >  board/toradex/common/tdx-common.h   | 1 +
> >  13 files changed, 15 insertions(+), 12 deletions(-)
> 
> [snip]
> 
> 
> Cheers
> 
> Marcel


REGRESSION: [PATCH 5/9] toradex: Use checkboard() instead of show_board_info()

2024-01-24 Thread Marcel Ziswiler
Hi Simon

Sorry, I missed this one, also due to a longer Xmas/New Year and later skiing 
vacation.

On Sun, 2023-11-12 at 19:58 -0700, Simon Glass wrote:
> Boards can use a sysinfo driver if a particular model name is needed.

Okay, but so far we did print more than just a model name:

On Apalis/Colibri:

Model: Toradex 0028 Apalis iMX6Q 2GB IT V1.1D
Serial#: 10867499

On Verdin:

Model: Toradex 0058 Verdin iMX8M Plus Quad 4GB WB IT V1.1A
Serial#: 14772913
Carrier: Toradex Dahlia V1.1A, Serial# 10870316

Optionally there would even be display adapters with potentially more model 
(serial) information.

Now with your change we get the following:

On Apalis/Colibri:

Model: Toradex Apalis iMX6Q/D Module on Apalis Evaluation Board
Model: Toradex Apalis iMX6 Quad 2GB IT
Model: Toradex 0028 Apalis iMX6Q 2GB IT V1.1D
Serial#: 11211073

The first line gets printed from the information in the device tree, the second 
Line from the fall-back in our
board file (which so far was only used for the case when we failed reading the 
ConfigBlock) and the third and
fourth lines are the previous information. Ugly, but so far so good.

On Verdin:

Model: Toradex Verdin iMX8M Plus WB on Verdin Development Board

Here only the device tree information gets printed and the ConfigBlock is not 
even read at all which
subsequently fails detecting the variant (e.g. Wi-Fi vs. non-Wi-Fi) and later 
Ethernet fails due to an invalid
MAC address. This does not look good...

Anyway, I don't propose to just revert your work but instead looked into 
converting our previous
show_board_info (now tdx_checkboard) to a proper sysinfo driver. The basics 
actually worked quite smoothly but
we would need more than just SYSINFO_ID_BOARD_MODEL, just like you do with 
CONFIG_SYSINFO_EXTRA. Of course, I
could just do a CONFIG_SYSINFO_TORADEX, with e.g. SYSINFO_ID_BOARD_SERIAL and 
optionally
SYSINFO_ID_BOARD_CARRIER or something but maybe a more generic way of extending 
sysinfo would make more sense.

What do you think?

> Update this board to use checkboard() directly, rather than having a
> weak function laid on top of a weak function.

Unfortunately, as mentioned above, this does not quite lead to any desired 
behaviour.

> Make all the checkboard() functions call the new tdx_checkboard() so
> that the same information is displayed.

Not quite.

> Signed-off-by: Simon Glass 
> ---
> 
>  board/toradex/apalis-imx8/apalis-imx8.c | 2 +-
>  board/toradex/apalis-tk1/apalis-tk1.c   | 2 +-
>  board/toradex/apalis_imx6/apalis_imx6.c | 3 ++-
>  board/toradex/apalis_t30/apalis_t30.c   | 2 +-
>  board/toradex/colibri-imx6ull/colibri-imx6ull.c | 2 +-
>  board/toradex/colibri-imx8x/colibri-imx8x.c | 2 +-
>  board/toradex/colibri_imx6/colibri_imx6.c   | 3 ++-
>  board/toradex/colibri_imx7/colibri_imx7.c   | 2 +-
>  board/toradex/colibri_t20/colibri_t20.c | 2 +-
>  board/toradex/colibri_t30/colibri_t30.c | 2 +-
>  board/toradex/colibri_vf/colibri_vf.c   | 2 +-
>  board/toradex/common/tdx-common.c   | 2 +-
>  board/toradex/common/tdx-common.h   | 1 +
>  13 files changed, 15 insertions(+), 12 deletions(-)

[snip]


Cheers

Marcel


Re: [PATCH] toradex: tdx-cfg-block: Add new apalis and colibri pid

2024-01-22 Thread Marcel Ziswiler
On Mon, 2024-01-22 at 17:09 -0300, Joao Paulo Goncalves wrote:
> From: Joao Paulo Goncalves 
> 
> Add new apalis imx6 and colibri imx6/imx7 products IDs.
> 
> Signed-off-by: Joao Paulo Goncalves 

Acked-by: Marcel Ziswiler 

> ---
>  board/toradex/common/tdx-cfg-block.c | 9 +
>  board/toradex/common/tdx-cfg-block.h | 9 +
>  2 files changed, 18 insertions(+)
> 
> diff --git a/board/toradex/common/tdx-cfg-block.c 
> b/board/toradex/common/tdx-cfg-block.c
> index 7187e1ba377..7affc290395 100644
> --- a/board/toradex/common/tdx-cfg-block.c
> +++ b/board/toradex/common/tdx-cfg-block.c
> @@ -147,6 +147,15 @@ const struct toradex_som toradex_modules[] = {
>   [74] = { "Verdin AM62 Dual 1GB IT",  
> TARGET_IS_ENABLED(VERDIN_AM62_A53) },
>   [75] = { "Verdin AM62 Dual 1GB WB IT",   
> TARGET_IS_ENABLED(VERDIN_AM62_A53) },
>   [76] = { "Verdin AM62 Quad 2GB WB IT",   
> TARGET_IS_ENABLED(VERDIN_AM62_A53) },
> + [77] = { "Colibri iMX6S 256MB",  
> TARGET_IS_ENABLED(COLIBRI_IMX6)    },
> + [78] = { "Colibri iMX6S 256MB IT",   
> TARGET_IS_ENABLED(COLIBRI_IMX6)    },
> + [79] = { "Colibri iMX6DL 512MB", 
> TARGET_IS_ENABLED(COLIBRI_IMX6)    },  
> + [80] = { "Colibri iMX6DL 512MB IT",  
> TARGET_IS_ENABLED(COLIBRI_IMX6)    },
> + [81] = { "Colibri iMX7D 512MB",  
> TARGET_IS_ENABLED(COLIBRI_IMX7)    },
> + [82] = { "Apalis iMX6D 512MB",   
> TARGET_IS_ENABLED(APALIS_IMX6) },
> + [83] = { "Apalis iMX6Q 1GB", 
> TARGET_IS_ENABLED(APALIS_IMX6) },
> + [84] = { "Apalis iMX6D 1GB IT",  
> TARGET_IS_ENABLED(APALIS_IMX6) },
> + [85] = { "Apalis iMX6Q 2GB IT",  
> TARGET_IS_ENABLED(APALIS_IMX6) },
>  };
>  
>  struct pid4list {
> diff --git a/board/toradex/common/tdx-cfg-block.h 
> b/board/toradex/common/tdx-cfg-block.h
> index ea58bd43b17..b783537ce76 100644
> --- a/board/toradex/common/tdx-cfg-block.h
> +++ b/board/toradex/common/tdx-cfg-block.h
> @@ -102,6 +102,15 @@ enum {
>   VERDIN_AM62D_1G_IT,
>   VERDIN_AM62D_1G_WIFI_BT_IT, /* 75 */
>   VERDIN_AM62Q_2G_WIFI_BT_IT,
> + COLIBRI_IMX6S_NOWINCE,
> + COLIBRI_IMX6S_IT_NOWINCE,
> + COLIBRI_IMX6DL_NOWINCE,
> + COLIBRI_IMX6DL_IT_NOWINCE, /* 80 */
> + COLIBRI_IMX7D_NOWINCE,
> + APALIS_IMX6D_NOWINCE,
> + APALIS_IMX6Q_NOWINCE,
> + APALIS_IMX6D_IT_NOWINCE,
> + APALIS_IMX6Q_IT_NOWINCE, /* 85 */
>  };
>  
>  enum {


Re: [RFC][PATCH] ARM: imx: verdin-imx8mm: Set CAN oscillator frequency based on model

2024-01-14 Thread Marcel Ziswiler
Hi Guys

On Sat, 2024-01-13 at 21:45 +0100, Francesco Dolcini wrote:
> On Sat, Jan 13, 2024 at 06:40:19PM +0000, Marcel Ziswiler wrote:
> > Hi Marek
> > 
> > Thanks, seems like a decent idea. I guess we just did not do it as those 
> > previous revisions were just
> > samples
> > but with this change can still be used much easier (e.g. without requiring 
> > manual intervention).
> > 
> > On Sat, 2024-01-13 at 19:33 +0100, Marek Vasut wrote:
> > > The older i.MX8M Mini Verdin SoMs before rev. 1.1C came with 20 MHz SPI 
> > > CAN
> > > controller oscillator, the newer SoMs use 40 MHz oscillator. Handle both 
> > > by
> > > overriding the oscillator frequency just before booting the kernel.
> > > 
> > > Signed-off-by: Marek Vasut 
> > > ---
> > > Cc: "NXP i.MX U-Boot Team" 
> > > Cc: Fabio Estevam 
> > > Cc: Francesco Dolcini 
> > > Cc: Marcel Ziswiler 
> > > Cc: Philippe Schenker 
> > > Cc: Stefano Babic 
> > 
> > Acked-by: Marcel Ziswiler 
> 
> Marcel, that patch is buggy.
> 
> The assembly version makes sense only for a specific major/minor
> hardware version.

Yes, sorry, I did not look at it careful enough.

> So what you need to check if revision < 1.1C, while the code from Marek
> check just for the assembly version C.
> 
> > 
> > > ---
> > >  board/toradex/verdin-imx8mm/verdin-imx8mm.c | 19 +++
> > >  1 file changed, 19 insertions(+)
> > > 
> > > diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
> > > b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
> > > index b2781b51d6a..8bc1a51eeb1 100644
> > > --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
> > > +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
> > > @@ -142,6 +142,25 @@ int board_phys_sdram_size(phys_size_t *size)
> > >  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
> > >  int ft_board_setup(void *blob, struct bd_info *bd)
> > >  {
> > > + const char *canoscpath = "/oscillator";
> > > + int canoscoff, freq, ret;
> > > +
> > > + canoscoff = fdt_path_offset(blob, canoscpath);
> > > + if (canoscoff < 0)  /* No CAN oscillator found. */
> > > + goto exit;
> > > +
> > > + if (tdx_hw_tag.ver_assembly < 2)    /* rev. A or B */
> I would suggest a slightly different approach.
> 
> First you need to check also for major/minor version. The revision
> restart from A every time there is a change in a version.
> 
> Second I would set the 20MHz oscillator only for older version and do
> nothing, not set anything, for the newer one.

Yes, I agree. So worst case it will always use the new/fixed setting.

> On Sat, Jan 13, 2024 at 04:52:57PM -0300, Fabio Estevam wrote:
> > On Sat, Jan 13, 2024 at 3:34 PM Marek Vasut  wrote:
> > > 
> > > The older i.MX8M Mini Verdin SoMs before rev. 1.1C came with 20 MHz SPI 
> > > CAN
> > > controller oscillator, the newer SoMs use 40 MHz oscillator. Handle both 
> > > by
> > > overriding the oscillator frequency just before booting the kernel.
> > > 
> > > Signed-off-by: Marek Vasut 
> > 
> > Applied, thanks.
> 
> Fabio, you were too fast ... please revert it.
> 
> Francesco

Cheers

Marcel


Re: [RFC][PATCH] ARM: imx: verdin-imx8mm: Set CAN oscillator frequency based on model

2024-01-13 Thread Marcel Ziswiler
Hi Marek

Thanks, seems like a decent idea. I guess we just did not do it as those 
previous revisions were just samples
but with this change can still be used much easier (e.g. without requiring 
manual intervention).

On Sat, 2024-01-13 at 19:33 +0100, Marek Vasut wrote:
> The older i.MX8M Mini Verdin SoMs before rev. 1.1C came with 20 MHz SPI CAN
> controller oscillator, the newer SoMs use 40 MHz oscillator. Handle both by
> overriding the oscillator frequency just before booting the kernel.
> 
> Signed-off-by: Marek Vasut 
> ---
> Cc: "NXP i.MX U-Boot Team" 
> Cc: Fabio Estevam 
> Cc: Francesco Dolcini 
> Cc: Marcel Ziswiler 
> Cc: Philippe Schenker 
> Cc: Stefano Babic 

Acked-by: Marcel Ziswiler 

> ---
>  board/toradex/verdin-imx8mm/verdin-imx8mm.c | 19 +++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c 
> b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
> index b2781b51d6a..8bc1a51eeb1 100644
> --- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
> +++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
> @@ -142,6 +142,25 @@ int board_phys_sdram_size(phys_size_t *size)
>  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
>  int ft_board_setup(void *blob, struct bd_info *bd)
>  {
> + const char *canoscpath = "/oscillator";
> + int canoscoff, freq, ret;
> +
> + canoscoff = fdt_path_offset(blob, canoscpath);
> + if (canoscoff < 0)  /* No CAN oscillator found. */
> + goto exit;
> +
> + if (tdx_hw_tag.ver_assembly < 2)    /* rev. A or B */
> + freq = 2000;
> + else/* rev. C or newer */
> + freq = 4000;
> +
> + ret = fdt_setprop_u32(blob, canoscoff, "clock-frequency", freq);
> + if (ret < 0) {
> + printf("Failed to set CAN oscillator clock-frequency, ret=%d\n",
> + ret);
> + }
> +
> +exit:
>   return ft_common_board_setup(blob, bd);
>  }
>  #endif

Cheers

Marcel


Re: [PATCH v1] arm: dts: k3-am625-verdin: fix DDRSS configuration

2023-12-19 Thread Marcel Ziswiler
On Tue, 2023-12-19 at 09:25 +0100, Francesco Dolcini wrote:
> From: Emanuele Ghidoli 
> 
> The current DDR subsystem configuration occasionally results in write 
> failures,
> impacting memory stability, on Verdin AM62 Solo 512MB WB IT 0072 SKU.
> This commit addresses the issue by adjusting Drive Pull-Up/Down and
> Write Latency to improve the eye diagram and ensure reliable write operations.
> This configuration is shared with all Verdin AM62 SoM and
> it does not introduce regressions.
> 
> Configurations changes from previous / default values:
> - Drive Pull-Up/Down from 40 to 34.3 Ohm
> - Write Latency from 8 to 10
> - ODTLon / ODTLoff latency from 0 / 0 to 4 / 20 nCK
> - VREF control range 1 at 27 %
> - tFAW from 30 to 40 ns
> 
> Configuration is output from SysConfig [1] web tool, currently at version
> 1.18.1+3343 (DDR SubSystem v9.10).
> 
> [1] https://dev.ti.com/sysconfig
> 
> Fixes: 7d1a10659f5b ("board: toradex: add verdin am62 support")
> Signed-off-by: Emanuele Ghidoli 
> Signed-off-by: Francesco Dolcini 

Acked-by: Marcel Ziswiler 

> ---
>  .../dts/k3-am625-verdin-lpddr4-1600MTs.dtsi   | 151 +-
>  1 file changed, 76 insertions(+), 75 deletions(-)
> 
> diff --git a/arch/arm/dts/k3-am625-verdin-lpddr4-1600MTs.dtsi 
> b/arch/arm/dts/k3-am625-verdin-lpddr4-
> 1600MTs.dtsi
> index 9bad4309b491..841541bb2433 100644
> --- a/arch/arm/dts/k3-am625-verdin-lpddr4-1600MTs.dtsi
> +++ b/arch/arm/dts/k3-am625-verdin-lpddr4-1600MTs.dtsi
> @@ -1,19 +1,20 @@
>  // SPDX-License-Identifier: GPL-2.0+
>  /*
>   * This file was generated with the
> - * AM62x SysConfig DDR Subsystem Register Configuration Tool v0.09.08
> - * Fri Jun 09 2023 08:01:37 GMT+0200 (Central European Summer Time)
> + * AM62x SysConfig DDR Subsystem Register Configuration Tool v0.09.10
> + * Mon Dec 11 2023 17:07:35 GMT+0100 (Central European Standard Time)
>   * DDR Type: LPDDR4
>   * F0 = 50MHz    F1 = NA F2 = 800MHz
>   * Density (per channel): 16Gb
>   * Write DBI: Enable
>   * Number of Ranks: 1
> - */
> +*/
>  
>  #define DDRSS_PLL_FHS_CNT 3
>  #define DDRSS_PLL_FREQUENCY_1 4
>  #define DDRSS_PLL_FREQUENCY_2 4
>  
> +
>  #define DDRSS_CTL_0_DATA 0x0B00
>  #define DDRSS_CTL_1_DATA 0x
>  #define DDRSS_CTL_2_DATA 0x
> @@ -54,20 +55,20 @@
>  #define DDRSS_CTL_37_DATA 0x
>  #define DDRSS_CTL_38_DATA 0x040C
>  #define DDRSS_CTL_39_DATA 0x
> -#define DDRSS_CTL_40_DATA 0x081C
> +#define DDRSS_CTL_40_DATA 0x0A1C
>  #define DDRSS_CTL_41_DATA 0x
> -#define DDRSS_CTL_42_DATA 0x081C
> +#define DDRSS_CTL_42_DATA 0x0A1C
>  #define DDRSS_CTL_43_DATA 0x
>  #define DDRSS_CTL_44_DATA 0x05000804
>  #define DDRSS_CTL_45_DATA 0x0B00
>  #define DDRSS_CTL_46_DATA 0x09090004
> -#define DDRSS_CTL_47_DATA 0x0204
> +#define DDRSS_CTL_47_DATA 0x0304
>  #define DDRSS_CTL_48_DATA 0x00370008
>  #define DDRSS_CTL_49_DATA 0x09090024
> -#define DDRSS_CTL_50_DATA 0x1910
> +#define DDRSS_CTL_50_DATA 0x2110
>  #define DDRSS_CTL_51_DATA 0x00370008
>  #define DDRSS_CTL_52_DATA 0x09090024
> -#define DDRSS_CTL_53_DATA 0x09001910
> +#define DDRSS_CTL_53_DATA 0x09002110
>  #define DDRSS_CTL_54_DATA 0x000A0A09
>  #define DDRSS_CTL_55_DATA 0x0400036D
>  #define DDRSS_CTL_56_DATA 0x09092004
> @@ -223,19 +224,19 @@
>  #define DDRSS_CTL_206_DATA 0x
>  #define DDRSS_CTL_207_DATA 0x
>  #define DDRSS_CTL_208_DATA 0x0024
> -#define DDRSS_CTL_209_DATA 0x0012
> +#define DDRSS_CTL_209_DATA 0x001A
>  #define DDRSS_CTL_210_DATA 0x
>  #define DDRSS_CTL_211_DATA 0x0024
> -#define DDRSS_CTL_212_DATA 0x0012
> +#define DDRSS_CTL_212_DATA 0x001A
>  #define DDRSS_CTL_213_DATA 0x
>  #define DDRSS_CTL_214_DATA 0x0004
>  #define DDRSS_CTL_215_DATA 0x
>  #define DDRSS_CTL_216_DATA 0x
>  #define DDRSS_CTL_217_DATA 0x0024
> -#define DDRSS_CTL_218_DATA 0x0012
> +#define DDRSS_CTL_218_DATA 0x001A
>  #define DDRSS_CTL_219_DATA 0x
>  #define DDRSS_CTL_220_DATA 0x0024
> -#define DDRSS_CTL_221_DATA 0x0012
> +#define DDRSS_CTL_221_DATA 0x001A
>  #define DDRSS_CTL_222_DATA 0x
>  #define DDRSS_CTL_223_DATA 0x
>  #define DDRSS_CTL_224_DATA 0x0031
> @@ -268,21 +269,21 @@
>  #define DDRSS_CTL_251_DATA 0x
>  #define DDRSS_CTL_252_DATA 0x
>  #define DDRSS_CTL_253_DATA 0x
> -#define DDRSS_CTL_254_DATA 0x46004646
> -#define DDRSS_CTL_255_DATA 0x2746
> -#define DDRSS_CTL_256_DATA 0x0027
> -#define DDRSS_CTL_257_DATA 0x0027
> -#define DDRSS_CTL_258_DATA 0x0027
>

Re: [PATCH v6 00/17] Introduce initial TI's J784S4 and AM69 support

2023-12-15 Thread Marcel Ziswiler
On Fri, 2023-12-15 at 08:23 -0600, Nishanth Menon wrote:

[snip]

> > > What version of TIFS are you running? Not getting a response usually 
> > > means firmware is dead or we're not using the right thread to talk.
> > 
> > Yeah, sorry. I was always running the latest from the ti-linux-firmware 
> > branch:
> > 
> > SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.2--v09.01.02 (Kool Koala)')
> > 
> > So, it is really TF-A which seems to cause the issue.
> 
> Actually not TFA either (TFA complains correctly). we have an internal
> ticket that is in the middle of getting fixed for TIFS and PDK to
> enable this. a bit of history: A new api TISCI_MSG_QUERY_FW_CAPS[1]
> was introduced to help determine which version of firmware combination
> supports what features (such as Low power, etc). This allows for
> consistent TFA/Kernel implementation that can dynamically detect
> platforms (since LPM also involved a bit of firmware handshaking for
> board specific details - PMIC control and the like). This API is as
> fundamental as version message API that all firmware are supposed to
> implement. unfortunately the defconfig option for that API wasn't
> properly implemented for various firmware components correctly. -
> impacted chips are: j721e, j7200, j721s2/am68, j784s4/am69. Other
> K3 processor firmware have it implemented correctly. The latest
> 9.1.8--v09.01.08 has the bug as well - but hopefully should be fixed
> and released soon-ish.

Thanks, Nishanth. Glad you guys are aware of this and I am not just seeing 
things (;-p).

> [1] 
> https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/core.html#tisci-msg-query-fw-caps
> --
> Regards,
> Nishanth Menon
> Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 
> 849D 1736 249D

Cheers

Marcel


Re: [PATCH v6 00/17] Introduce initial TI's J784S4 and AM69 support

2023-12-15 Thread Marcel Ziswiler
On Thu, 2023-12-14 at 14:28 -0600, Andrew Davis wrote:
> On 12/14/23 2:10 PM, b...@ti.com wrote:
> > On December 14, 2023 thus sayeth Marcel Ziswiler:
> > > Hi Apurva
> > > 
> > > Thanks!
> > > 
> > > On Wed, 2023-12-06 at 18:07 +0530, Apurva Nandan wrote:
> > > > Hello Everyone!
> > > > 
> > > > This series will introduce basic support (SD and UART) support for Texas
> > > > Instruments J784S4 EVM.
> > > 
> > > For the whole series:
> > > 
> > > Tested-by: Marcel Ziswiler 
> > > 
> > > However, one thing I noticed is that with upstream TF-A I do get the 
> > > following errors:
> > > 
> > > NOTICE:  BL31: v2.10.0  (release):v2.10.0-76-g02091541d
> > > NOTICE:  BL31: Built : 18:13:08, Dec 14 2023
> > > ERROR:   Failed to get response (-19)
> > > ERROR:   Transfer send failed (-19)
> > > ERROR:   Unable to query firmware capabilities (-19)
> > > 
> > > While with latest TF-A from downstream TI BSP (both 9.0 and 9.1 use the 
> > > same versin) I do not get any
> > > errors:
> > > 
> > > NOTICE:  BL31: v2.9(release):v2.9.0-614-gd7a7135d3
> > > NOTICE:  BL31: Built : 18:40:38, Dec 14 2023
> > > 
> > 
> > What version of TIFS are you running? Not getting a response usually
> > means firmware is dead or we're not using the right thread to talk.
> > 
> 
> In this case the early versions of TIFS/DM for J784S4/AM69 had
> a bug where the "query firmware capabilities" API was left disabled.
> This is fixed in the next version of firmware, this error message
> is harmless today anyway (no LPM yet).

No, I was always running the latest from the ti-linux-firmware branch:

SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.2--v09.01.02 (Kool Koala)')

So, it is really TF-A which seems to cause the issue here.

> Andrew

Cheers

Marcel


Re: [PATCH v6 00/17] Introduce initial TI's J784S4 and AM69 support

2023-12-15 Thread Marcel Ziswiler
On Thu, 2023-12-14 at 14:10 -0600, b...@ti.com wrote:
> On December 14, 2023 thus sayeth Marcel Ziswiler:
> > Hi Apurva
> > 
> > Thanks!
> > 
> > On Wed, 2023-12-06 at 18:07 +0530, Apurva Nandan wrote:
> > > Hello Everyone!
> > > 
> > > This series will introduce basic support (SD and UART) support for Texas
> > > Instruments J784S4 EVM.
> > 
> > For the whole series:
> > 
> > Tested-by: Marcel Ziswiler 
> > 
> > However, one thing I noticed is that with upstream TF-A I do get the 
> > following errors:
> > 
> > NOTICE:  BL31: v2.10.0  (release):v2.10.0-76-g02091541d
> > NOTICE:  BL31: Built : 18:13:08, Dec 14 2023
> > ERROR:   Failed to get response (-19)
> > ERROR:   Transfer send failed (-19)
> > ERROR:   Unable to query firmware capabilities (-19)
> > 
> > While with latest TF-A from downstream TI BSP (both 9.0 and 9.1 use the 
> > same versin) I do not get any
> > errors:
> > 
> > NOTICE:  BL31: v2.9(release):v2.9.0-614-gd7a7135d3
> > NOTICE:  BL31: Built : 18:40:38, Dec 14 2023
> > 
> 
> What version of TIFS are you running? Not getting a response usually 
> means firmware is dead or we're not using the right thread to talk.

Yeah, sorry. I was always running the latest from the ti-linux-firmware branch:

SYSFW ABI: 3.1 (firmware rev 0x0009 '9.1.2--v09.01.02 (Kool Koala)')

So, it is really TF-A which seems to cause the issue.

> ~Bryan


Re: [PATCH v6 00/17] Introduce initial TI's J784S4 and AM69 support

2023-12-14 Thread Marcel Ziswiler
Hi Apurva

Thanks!

On Wed, 2023-12-06 at 18:07 +0530, Apurva Nandan wrote:
> Hello Everyone!
> 
> This series will introduce basic support (SD and UART) support for Texas
> Instruments J784S4 EVM.

For the whole series:

Tested-by: Marcel Ziswiler 

However, one thing I noticed is that with upstream TF-A I do get the following 
errors:

NOTICE:  BL31: v2.10.0  (release):v2.10.0-76-g02091541d
NOTICE:  BL31: Built : 18:13:08, Dec 14 2023
ERROR:   Failed to get response (-19)
ERROR:   Transfer send failed (-19)
ERROR:   Unable to query firmware capabilities (-19)

While with latest TF-A from downstream TI BSP (both 9.0 and 9.1 use the same 
versin) I do not get any errors:

NOTICE:  BL31: v2.9(release):v2.9.0-614-gd7a7135d3
NOTICE:  BL31: Built : 18:40:38, Dec 14 2023

Any idea?

Cheers

Marcel

> The J784S4 SoC device tree patches are taken from kernel patch submissions
> and will be updated as they are accepted and merged to the kernel tree.
> All other patches are specific to SPL and u-boot and do not have
> dependency on other trees. Appreciate a review for acceptance to u-boot
> tree.
> 
> Here are some of the salient features of the J784S4 automotive grade 
> application processor:
> 
> The J784S4 SoC belongs to the K3 Multicore SoC architecture
> platform, providing advanced system integration in automotive,
> ADAS and industrial applications requiring AI at the network edge.
> This SoC extends the K3 Jacinto 7 family of SoCs with focus on
> raising performance and integration while providing interfaces,
> memory architecture and compute performance for multi-sensor, high
> concurrency applications.
> 
> Some highlights of this SoC are:
> * Up to 8 Cortex-A72s, four clusters of lockstep capable dual Cortex-R5F MCUs,
>   4 C7x floating point vector DSPs with Matrix Multiply Accelerator(MMA) for
>   deep learning and CNN.
> * 3D GPU: Automotive grade IMG BXS-4-64 MC1 
> * Vision Processing Accelerator (VPAC) with image signal processor and Depth
>   and Motion Processing Accelerator (DMPAC)
> * Three CSI2.0 4L RX plus two CSI2.0 4L TX, two DSI Tx, one eDP/DP and one
>   DPI interface.
> * Integrated gigabit ethernet switch, up to 8 ports (TDA4VH), two ports
>   support 10Gb USXGMII; Two 4 lane PCIe-GEN3 controllers, USB3.0 Dual-role
>   device subsystems, Up to 20 MCANs, among other peripherals.
> 
> See J784S4 Technical Reference Manual (SPRUJ52 - JUNE 2022)
> for further details: http://www.ti.com/lit/zip/spruj52
> 
> In addtion, the J784S4 EVM board is designed for TI J784S4 SoC. It 
> supports the following interfaces:
> * 32 GB DDR4 RAM
> * x2 Gigabit Ethernet interfaces capable of working in Switch and MAC mode
> * x1 Input Audio Jack, x1 Output Audio Jack
> * x1 USB2.0 Hub with two Type A host and x1 USB 3.1 Type-C Port
> * x2 4L PCIe connector
> * x1 UHS-1 capable micro-SD card slot
> * 512 Mbit OSPI flash, 1 Gbit Octal NAND flash, 512 Mbit QSPI flash,
>   UFS flash.
> * x6 UART through UART-USB bridge
> * XDS110 for onboard JTAG debug using USB
> * Temperature sensors, user push buttons and LEDs
> * 40-pin User Expansion Connector
> * x2 ENET Expansion Connector, x1 GESI expander, x2 Display connector
> * x1 15-pin CSI header
> * x6 MCAN instances
> 
> Schematics: https://www.ti.com/lit/zip/sprr458
> 
> eMMC UDA moode bootlog:
> https://gist.githubusercontent.com/apurvanandan1997/3cffada252d50a8aa0c00a91f1f2f856/raw/
> 
> Changes in v6:
> 1) Move bootph-all of memory node to u-boot.dtsi
> 2) Used a while loop for DRAM controller init, instead of hard-coding for 4 
> DRAM
> 3) Fixed build error by adding board/ti/j784s4/Kconfig
> 4) Trimmed out j784s4_evm.h
> 5) Fixed checkpatch warnings
> 
> Link to v5:
> https://patchwork.ozlabs.org/project/uboot/cover/20231130115552.3580995-1-a-nan...@ti.com/
> 
> Changes in v5:
> 1) Incorporated Andrew Davis' "Move R5 specific code into new r5/ directory" 
> and
>    "Move board selection to mach-k3" series changes.
> 2) Incorporated Neha Francis' "Move to using templated FITs" series changes.
> 3) Synced device tree files with Linux v6.7-rc1
> 4) Changed ti_mmc to mmc1 target from bootstd
> 5) Updated doc based on review comments
> 6) Removed remoteproc support from the series
> 7) Splitted board files patch into smaller patches
> 8) Trimmed j784s4.env to necessary variables
> 9) Used fdtdec_setup_mem_size_base fdtdec_setup_memory_banksize in evm.c
> 10) Trimmed down evm.c to essential header files.
> 11) Switched to multi-dtb fit compilation with config fragments
> 
> Link to v4:
> https://lore.kernel.org/u-boot/20231001165545.494212-1-a-nan...@ti.com/
> 
> Changes in v4:
> 1) Cleaned up Copyright and SPDX identifiers
> 2) Syn

Re: [PATCH v1] configs: verdin-am62: Disable SPL FIT Overlay

2023-12-11 Thread Marcel Ziswiler
On Mon, 2023-12-11 at 14:45 +0100, Francesco Dolcini wrote:
> From: Francesco Dolcini 
> 
> Disable CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY, this is not required nor used
> on verdin am62, disable it to save precious binary size.
> 
> Update defconfig using savedefconfig, this adds CONFIG_OF_LIBFDT_OVERLAY
> explicitly.
> 
> Signed-off-by: Francesco Dolcini 

Acked-by: Marcel Ziswiler 

> ---
>  configs/verdin-am62_a53_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/verdin-am62_a53_defconfig 
> b/configs/verdin-am62_a53_defconfig
> index 780860180879..cdd6ba8baed4 100644
> --- a/configs/verdin-am62_a53_defconfig
> +++ b/configs/verdin-am62_a53_defconfig
> @@ -17,6 +17,7 @@ CONFIG_ENV_OFFSET=0xDE00
>  CONFIG_DM_GPIO=y
>  CONFIG_DEFAULT_DEVICE_TREE="k3-am625-verdin-wifi-dev"
>  CONFIG_SPL_TEXT_BASE=0x8008
> +CONFIG_OF_LIBFDT_OVERLAY=y
>  CONFIG_DM_RESET=y
>  CONFIG_SPL_MMC=y
>  CONFIG_SPL_SERIAL=y
> @@ -33,7 +34,6 @@ CONFIG_SYS_MEMTEST_END=0xB000
>  CONFIG_FIT_VERBOSE=y
>  CONFIG_SPL_LOAD_FIT=y
>  CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
> -CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY=y
>  CONFIG_LEGACY_IMAGE_FORMAT=y
>  CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_BOOTDELAY=1


Re: [PATCH v5 09/17] board: ti: j784s4: Add board support for J784S4 EVM

2023-12-01 Thread Marcel Ziswiler
Hi Apurva 

Thanks for the update, however, it does not seem to compile. See below...

On Thu, 2023-11-30 at 17:25 +0530, Apurva Nandan wrote:
> Add board files for J784S4 EVM.
> 
> Signed-off-by: Hari Nagalla 
> [ add env and board specific yaml files for binman ]
> Signed-off-by: Neha Malcom Francis 
> [ cleaned up the env files ]
> Signed-off-by: Manorit Chawdhry 
> Signed-off-by: Dasnavis Sabiya 
> Signed-off-by: Apurva Nandan 
> ---
>  arch/arm/mach-k3/Kconfig    |  1 +
>  arch/arm/mach-k3/j784s4/Kconfig | 35 ++
>  board/ti/j784s4/Makefile    |  7 ++
>  board/ti/j784s4/evm.c   | 38 +
>  include/configs/j784s4_evm.h    | 20 +
>  5 files changed, 101 insertions(+)
>  create mode 100644 arch/arm/mach-k3/j784s4/Kconfig
>  create mode 100644 board/ti/j784s4/Makefile
>  create mode 100644 board/ti/j784s4/evm.c
>  create mode 100644 include/configs/j784s4_evm.h
> 
> diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
> index 150d0bfa14..445b49e245 100644
> --- a/arch/arm/mach-k3/Kconfig
> +++ b/arch/arm/mach-k3/Kconfig
> @@ -157,5 +157,6 @@ source "arch/arm/mach-k3/am62x/Kconfig"
>  source "arch/arm/mach-k3/am62ax/Kconfig"
>  source "arch/arm/mach-k3/j721e/Kconfig"
>  source "arch/arm/mach-k3/j721s2/Kconfig"
> +source "arch/arm/mach-k3/j784s4/Kconfig"
>  
>  endif
> diff --git a/arch/arm/mach-k3/j784s4/Kconfig b/arch/arm/mach-k3/j784s4/Kconfig
> new file mode 100644
> index 00..03d3f91371
> --- /dev/null
> +++ b/arch/arm/mach-k3/j784s4/Kconfig
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +#
> +# Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
> +#Hari Nagalla 
> +
> +if SOC_K3_J784S4
> +
> +choice
> + prompt "K3 J784S4 board"
> + optional
> +
> +config TARGET_J784S4_A72_EVM
> + bool "TI K3 based J784S4 EVM running on A72"
> + select ARM64
> + select BOARD_LATE_INIT
> + select SYS_DISABLE_DCACHE_OPS
> + select BINMAN
> +
> +config TARGET_J784S4_R5_EVM
> + bool "TI K3 based J784S4 EVM running on R5"
> + select CPU_V7R
> + select SYS_THUMB_BUILD
> + select K3_LOAD_SYSFW
> + select RAM
> + select SPL_RAM
> + select K3_DDRSS
> + select BINMAN
> + imply SYS_K3_SPL_ATF
> +
> +endchoice
> +
> +source "board/ti/j784s4/Kconfig"

Where exactly would that one come from?

⬢[zim@toolbox u-boot.git]$ make j784s4_evm_r5_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  YACCscripts/kconfig/zconf.tab.c
  LEX scripts/kconfig/zconf.lex.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
arch/arm/mach-k3/j784s4/Kconfig:32: can't open file "board/ti/j784s4/Kconfig"
make[1]: *** [scripts/kconfig/Makefile:96: j784s4_evm_r5_defconfig] Error 1
make: *** [Makefile:586: j784s4_evm_r5_defconfig] Error 2

> +
> +endif
> +
> diff --git a/board/ti/j784s4/Makefile b/board/ti/j784s4/Makefile
> new file mode 100644
> index 00..3fc70eb8fb
> --- /dev/null
> +++ b/board/ti/j784s4/Makefile
> @@ -0,0 +1,7 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +#
> +# Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
> +#Hari Nagalla 
> +#
> +
> +obj-y += evm.o
> diff --git a/board/ti/j784s4/evm.c b/board/ti/j784s4/evm.c
> new file mode 100644
> index 00..4857c9d2f6
> --- /dev/null
> +++ b/board/ti/j784s4/evm.c
> @@ -0,0 +1,38 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Board specific initialization for J784S4 EVM
> + *
> + * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
> + *   Hari Nagalla 
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +int board_init(void)
> +{
> + return 0;
> +}
> +
> +int dram_init(void)
> +{
> + return fdtdec_setup_mem_size_base();
> +}
> +
> +int dram_init_banksize(void)
> +{
> + return fdtdec_setup_memory_banksize();
> +}
> +
> +int board_late_init(void)
> +{
> + return 0;
> +}
> +
> +void spl_board_init(void)
> +{
> +}
> diff --git a/include/configs/j784s4_evm.h b/include/configs/j784s4_evm.h
> new file mode 100644
> index 00..1b780134ca
> --- /dev/null
> +++ b/include/configs/j784s4_evm.h
> @@ -0,0 +1,20 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Configuration header file for K3 J784S4 EVM
> + *
> + * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
> + *   Hari Nagalla 
> + */
> +
> +#ifndef __CONFIG_J784S4_EVM_H
> +#define __CONFIG_J784S4_EVM_H
> +
> +#include 
> +
> +/* DDR Configuration */
> +#define CFG_SYS_SDRAM_BASE1  0x88000
> +
> +/* Now for the remaining common defines */
> +#include 
> +
> +#endif /* __CONFIG_J784S4_EVM_H */

Cheers

Marcel


Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

2023-11-20 Thread Marcel Ziswiler
On Fri, 2023-11-17 at 14:42 -0500, Tom Rini wrote:
> On Thu, Oct 26, 2023 at 09:32:20AM +0200, Marcel Ziswiler wrote:
> 
> > From: Marcel Ziswiler 
> > 
> > This fixes a regression in the eMMC fast boot mode case where the buffer
> > was missing 464 bytes.
> > 
> > The code figures out how many bytes must at least be fetched to honor
> > the current read, rounds that up to the ss->pagesize [which is a no-op
> > in the USB download case because that has ->pagesize==1], fetches that
> > many bytes, but then recorded the original upper bound as the new end of
> > the valid data. However, this did not take into account the rounding up
> > to the ss->pagesize. Fix this by recording the actual bytes downloaded.
> > 
> > Fixes: 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of 
> > spl_load_simple_fit() to get full FIT size")
> > Signed-off-by: Marcel Ziswiler 
> > Acked-by: Rasmus Villemoes 
> > Reviewed-by: Fabio Estevam 
> 
> Applied to u-boot/master, thanks!

Finally our weekly master/upstream CI is passing on all i.MX 8M Plus SKUs again!

Thanks!

Cheers

Marcel


Re: [PATCH 1/2] arm: dts: k3-binman: Add support for FIT templates

2023-11-16 Thread Marcel Ziswiler
Hi Simon

On Thu, 2023-11-16 at 09:03 -0700, Simon Glass wrote:
> Hi Neha,
> 
> On Wed, 15 Nov 2023 at 03:10, Neha Malcom Francis  wrote:
> > 
> > Add templates for FIT images used extensively across K3 boards with most
> > of the code common. This includes the FIT portions of:
> >     - tispl.bin
> >     - u-boot.img
> >     - sysfw.itb (in case of legacy boot flow)
> > 
> > Signed-off-by: Neha Malcom Francis 
> > ---
> >  arch/arm/dts/k3-binman.dtsi | 327 
> >  1 file changed, 327 insertions(+)
> > 
> 
> Reviewed-by: Simon Glass 
> 
> What is the DM binary?

From [1]:

DM - Device Management firmware also called TI System Control Interface server 
(TISCI Server) - This component
purely plays the role of managing device resources such as power, clock, 
interrupts, dma etc. This firmware
runs on a dedicated or multi-use microcontroller outside the security enclave.

[1] https://docs.u-boot.org/en/latest/board/ti/am62x_sk.html

> Regards,
> Simon

Cheers

Marcel


Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

2023-11-16 Thread Marcel Ziswiler
Hi Tom

On Thu, 2023-11-02 at 08:09 +0100, Marcel Ziswiler wrote:
> Hi Stefano
> 
> On Thu, 2023-10-26 at 10:36 +0200, Stefano Babic wrote:
> > On 26.10.23 10:29, Rasmus Villemoes wrote:
> > > On 26/10/2023 09.32, Marcel Ziswiler wrote:
> > > > From: Marcel Ziswiler 
> > > > 
> > > > This fixes a regression in the eMMC fast boot mode case where the buffer
> > > > was missing 464 bytes.
> > > > 
> > > > The code figures out how many bytes must at least be fetched to honor
> > > > the current read, rounds that up to the ss->pagesize [which is a no-op
> > > > in the USB download case because that has ->pagesize==1], fetches that
> > > > many bytes, but then recorded the original upper bound as the new end of
> > > > the valid data. However, this did not take into account the rounding up
> > > > to the ss->pagesize. Fix this by recording the actual bytes downloaded.
> > > > 
> > > > Fixes: 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of 
> > > > spl_load_simple_fit() to get full FIT
> > > > size")
> > > > Signed-off-by: Marcel Ziswiler 
> > > > 
> > > 
> > > Thanks for reporting and fixing this, and sorry for the trouble.
> > > 
> > > Acked-by: Rasmus Villemoes 
> > > 
> > 
> > And thanks for all your work - I will apply this fix soon.
> 
> Any news on applying this fix? Note that master still stays broken as of 
> today.

And two weeks later still broken!

Anyway, I feel i.MX maintainership seems rather stalled at times most of the 
time. I don't want to criticise
anybody knowing how busy our trade can get. However, if it helps the cause 
Toradex would be ready to step up.
Let me know what you think. Thanks!

> > Regards,
> > Stefano

Cheers

Marcel


Re: [PATCH 0/2] Cleanup K3 binman FIT images

2023-11-15 Thread Marcel Ziswiler
Hi Neha

On Wed, 2023-11-15 at 15:40 +0530, Neha Malcom Francis wrote:
> Instead of duplicating the same FIT formats over and over again for
> different K3 devices, make use of the templating support to have FIT
> templates for the same. 
> 
> Note: I purposely did not add the trial to template out the non-FIT
> bootloader image (tiboot3.bin) as it reduces the readibility and
> understandability of how the image is packaged because of the various
> different boot flows.
> 
> Boot logs:
> https://gist.github.com/nehamalcom/9abe7955ebb4a251923e76412834c886

For the whole series:

Tested-by: Marcel Ziswiler 

> Neha Malcom Francis (2):
>   arm: dts: k3-binman: Add support for FIT templates
>   arm: dts: k3-*-binman: Move to using templated FITs
> 
>  arch/arm/dts/k3-am625-sk-binman.dtsi  | 157 +
>  .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  | 155 +---
>  arch/arm/dts/k3-am62a-sk-binman.dtsi  | 158 +
>  arch/arm/dts/k3-am64x-binman.dtsi | 151 +---
>  arch/arm/dts/k3-am65x-binman.dtsi | 273 +-
>  arch/arm/dts/k3-binman.dtsi   | 327 +
>  arch/arm/dts/k3-j7200-binman.dtsi | 159 +
>  arch/arm/dts/k3-j721e-binman.dtsi | 332 +-
>  arch/arm/dts/k3-j721s2-binman.dtsi    | 157 +
>  9 files changed, 381 insertions(+), 1488 deletions(-)

Thanks!

Cheers

Marcel


Re: [PATCH V2 0/4] arm: dts: k3-am625*: Upgrade kernel dts to v6.7-rc1

2023-11-15 Thread Marcel Ziswiler
Hi Nishanth

On Tue, 2023-11-14 at 21:28 -0600, Nishanth Menon wrote:
> Hi,
> rev 2 of the series to sync am62 with v6.7-rc1.

For the whole series:

Tested-by: Marcel Ziswiler 

> Changes:
> - picked up reviews, tested tags.
> - minor commit message correction in patch #4.
> 
> Boot logs:
> https://gist.github.com/nmenon/d62c4795c6d3d40c83ba36d1cd047c42
> 
> WARNING: This will have  a minor conflict (binman) with:
> https://lore.kernel.org/u-boot/20231104080137.9628-1...@ti.com/
> 
> 
> I haven't had a chance to test this out on verdin (only build tested)
> - going to depend on any checks folks can provide.
> 
> V1: https://lore.kernel.org/all/20231113145919.1928812-1...@ti.com/
> 
> Nishanth Menon (4):
>   arm: dts: k3-am625*: Sync with kernel v6.7-rc1
>   arm: dts: k3-am625: Drop SoC provided bootph params from board
>     u-boot/r5 dtsi
>   arm: dts: k3-am625-beagleplay-u-boot: drop duplicate bootph-nodes
>   arm: dts: k3-am625-sk-r5/u-boot: Drop duplicate bootph-nodes
> 
>  arch/arm/dts/k3-am62-main.dtsi    |  12 +-
>  arch/arm/dts/k3-am62-mcu.dtsi |   2 +
>  arch/arm/dts/k3-am62-verdin-wifi.dtsi |   6 +
>  arch/arm/dts/k3-am62-verdin.dtsi  |   1 +
>  arch/arm/dts/k3-am62-wakeup.dtsi  |   2 +
>  arch/arm/dts/k3-am62.dtsi |   3 +
>  arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi  | 110 -
>  arch/arm/dts/k3-am625-beagleplay.dts  |  34 +++-
>  arch/arm/dts/k3-am625-r5-beagleplay.dts   |   9 --
>  arch/arm/dts/k3-am625-r5-sk.dts   |  21 +--
>  arch/arm/dts/k3-am625-sk-u-boot.dtsi  | 145 --
>  arch/arm/dts/k3-am625-sk.dts  |  27 
>  arch/arm/dts/k3-am625-verdin-r5.dts   |   9 --
>  .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  55 +--
>  arch/arm/dts/k3-am62x-sk-common.dtsi  | 109 -
>  15 files changed, 197 insertions(+), 348 deletions(-)

Thanks!

Cheers

Marcel


Re: [PATCH] arm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix DMA with BCDMA

2023-11-15 Thread Marcel Ziswiler
Hi Roger

On Tue, 2023-11-14 at 22:28 +0200, Roger Quadros wrote:
> BCDMA can be used at SPL for OSPI boot and mem-to-mem DMA
> so add "bootph-all" to BCDMA node.

Might not be strictly required (at least we do not support OSPI boot on our HW) 
but also does not hurt.

> Suggested-by: Nishanth Menon 
> Fixes: 9a3f2b6798b0 ("arm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix 
> DMA/Ethernet")
> Signed-off-by: Roger Quadros 

Tested-by: Marcel Ziswiler 

> ---
>  arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi 
> b/arch/arm/dts/k3-am625-verdin-wifi-dev-u-
> boot.dtsi
> index 75cb60b57d..588d9594a8 100644
> --- a/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
> +++ b/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
> @@ -53,6 +53,7 @@
>     <0x00 0x484c2000 0x00 0x2000>;
>   reg-names = "gcfg", "bchanrt", "rchanrt", "tchanrt",
>       "ringrt" , "cfg", "tchan", "rchan";
> + bootph-all;
>  };
>  
>  _pktdma {
> 
> base-commit: 92b27528d777ce85362af45e7d2974a6c856219b

Thanks!

Cheers

Marcel


Re: [PATCH v5 1/2] arm: mediatek: add mt8195 SOC support

2023-11-10 Thread Marcel Ziswiler
Hi guys

On Fri, 2023-08-04 at 19:04 +0800, Macpaul Lin wrote:
> From: Fabien Parent 
> 
> The MediaTek MT8195 is a ARM64-based SoC with a quad-core Cortex-A73 and
> a quad-core Cortex-A53. It is including UART, SPI, USB3.0 device and hosts,
> SD and MMC cards, UFS, PWM, I2C, I2S, S/PDIF, and several LPDDR3
> and LPDDR4 options.
> 
> Signed-off-by: Fabien Parent 
> Signed-off-by: Macpaul Lin 
> ---
>  MAINTAINERS    |   2 +
>  arch/arm/dts/mt8195.dtsi   | 370 +
>  arch/arm/mach-mediatek/Kconfig |  13 +-
>  arch/arm/mach-mediatek/Makefile    |   1 +
>  arch/arm/mach-mediatek/mt8195/Kconfig  |  13 +
>  arch/arm/mach-mediatek/mt8195/Makefile |   3 +
>  arch/arm/mach-mediatek/mt8195/init.c   |  97 +++
>  7 files changed, 498 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/mt8195.dtsi
>  create mode 100644 arch/arm/mach-mediatek/mt8195/Kconfig
>  create mode 100644 arch/arm/mach-mediatek/mt8195/Makefile
>  create mode 100644 arch/arm/mach-mediatek/mt8195/init.c
> 
> Changes for v2:
>  - Correct node name to t-phy for u3phy0.
>  - Add platform compatible string "mediatek,mt8195-tphy" to all usb phy nodes.
>  - remove clock nodes that software cannot controlled in phy nodes.
>  - Test and add back "mac" for HOST only xhci nodes.
> 
> Changes for v3:
>  - Revise device node name from "xhciX: xhciX@" to "xhciX: xhci@".
> 
> Changes for v4:
>  - No change.
> 
> Changes for v5:
>  - Fix Copyright year to 2023.
>  - Fix memory map in dram_init() to support 8GB onboard memory.
>  - Add '#if !IS_ENABLED(CONFIG_SYSRESET)' with reset_cpu().
>  - Correct reset_cpu() function prototype.
>  - rebase patchset to v2023-10.rc1
>  - Add missing arch/arm/mach-mediatek/mt8195/Kconfig.

[snip]

I finally got my hands on an EVK and gave this a try. However, I did not get 
that far. This is with latest
downstream TF-A as I still struggle with upstream there as well. Any ideas?

U-Boot 2024.01-rc1-00056-g5237f2b48bb (Nov 10 2023 - 15:33:34 +0100)

CPU:   MediaTek MT8195
DRAM:  8 GiB
mtu3 usb@1120: clks of sts1 are not stable!
mtu3-peripheral ssusb@1120: device enable failed -110
mtu3-peripheral ssusb@1120: mtu3 hw init failed:-110
board_init: Cannot find USB device
initcall failed at call ffe46a50 (err=-110)
### ERROR ### Please RESET the board ###

Cheers

Marcel


TF-A Hang on NXP i.MX 8M Plus QuadLite

2023-11-02 Thread Marcel Ziswiler
Hi there

We recently got our first batch of i.MX 8M Plus QuadLite based SoMs. While NXP 
downstream works just fine on
them they just hang booting with latest upstream U-Boot (and TF-A). Replacing 
TF-A with the downstream NXP one
made upstream U-Boot work as well. Further debugging TF-A showed 
imx_gpc_pm_domain_enable() to be the culprit.
Looking more specifically I discovered the following so far downstream-only 
commit [1]. So it looks like in
downstream NXP is limiting the to-be-enabled power management domains to 
HSIOMIX, USB1_PHY and USB2_PHY.
Anybody knows why exactly this is done and why this got never upstreamed?

Thank you very much for any insights into this matter.

[1] 
https://github.com/nxp-imx/imx-atf/commit/47759cfca10b2286a218062915d4a280848cfc15

Cheers

Marcel


Re: [PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

2023-11-02 Thread Marcel Ziswiler
Hi Stefano

On Thu, 2023-10-26 at 10:36 +0200, Stefano Babic wrote:
> On 26.10.23 10:29, Rasmus Villemoes wrote:
> > On 26/10/2023 09.32, Marcel Ziswiler wrote:
> > > From: Marcel Ziswiler 
> > > 
> > > This fixes a regression in the eMMC fast boot mode case where the buffer
> > > was missing 464 bytes.
> > > 
> > > The code figures out how many bytes must at least be fetched to honor
> > > the current read, rounds that up to the ss->pagesize [which is a no-op
> > > in the USB download case because that has ->pagesize==1], fetches that
> > > many bytes, but then recorded the original upper bound as the new end of
> > > the valid data. However, this did not take into account the rounding up
> > > to the ss->pagesize. Fix this by recording the actual bytes downloaded.
> > > 
> > > Fixes: 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of 
> > > spl_load_simple_fit() to get full FIT
> > > size")
> > > Signed-off-by: Marcel Ziswiler 
> > > 
> > 
> > Thanks for reporting and fixing this, and sorry for the trouble.
> > 
> > Acked-by: Rasmus Villemoes 
> > 
> 
> And thanks for all your work - I will apply this fix soon.

Any news on applying this fix? Note that master still stays broken as of today.

> Regards,
> Stefano

Cheers

Marcel


Re: [PATCH 0/3] arm: dts: k3-am6: Fix Ethernet/DMA

2023-10-28 Thread Marcel Ziswiler
Hi Nishanth

On Fri, 2023-10-27 at 15:46 -0500, Nishanth Menon wrote:
> On 16:46-20231027, Roger Quadros wrote:
> > Hi,
> > 
> > Since commit [1], Ethernet is broken on TI AM62 and AM64 platforms.
> > 
> > The commit [1] is not the culprit. It just unearths the problem by fixing
> > the error check in k3-udma.c. This issue was silently being ignored earlier
> > due to wrong error check. [NULL instead of FDT_ADDR_T_NONE].
> > 
> > Fix the issue by adding the necessary register spaces for the u-boot K3-UDMA
> > driver for AM62 and AM64 platforms.
> > 
> > [1] - 5fecea171de3dd ("treewide: use dev_read_addr_*_ptr() where 
> > appropriate")
> > 
> > cheers,
> > -roger
> > 
> > Roger Quadros (1):
> >   arm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix DMA/Ethernet
> > 
> > Siddharth Vadapalli (2):
> >   arm: dts: k3-am625-sk-u-boot.dtsi: Update main_bcdma and main_pktdma
> >     nodes
> >   arm: dts: k3-am642: Update main_bcdma and main_pktdma nodes
> > 
> >  arch/arm/dts/k3-am625-sk-u-boot.dtsi  | 27 +++
> >  .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  | 27 +++
> >  arch/arm/dts/k3-am642-evm-u-boot.dtsi | 27 +++
> >  arch/arm/dts/k3-am642-sk-u-boot.dtsi  | 23 
> >  4 files changed, 104 insertions(+)
> > 
> > 
> > base-commit: 351da15f71e3d70dbc63e90781b403415452d864
> > -- 
> > 2.34.1
> > 
> 
> 
> Thanks for this.
> 
> Reviewed-by: Nishanth Menon 
> 
> NOTE: These extra properties are already in discussion in Linux
> community.
> 
> https://lore.kernel.org/linux-arm-kernel/20230810174356.3322583-1-vigne...@ti.com/
> 
> Marcel, could the Toradex team confirm as well?

Yes, I just successfully tested it. With what you say above I also assume 
eventually those properties will move
to the SoC dtsi rather than having to be separately defined U-Boot-specific in 
each and every board.

Thanks guys.

Cheers

Marcel


Re: [PATCH 2/3] arm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix DMA/Ethernet

2023-10-28 Thread Marcel Ziswiler
On Fri, 2023-10-27 at 16:46 +0300, Roger Quadros wrote:
> Update main_bcdma and main_pktdma nodes for native configuration in the
> absence of DM services. u-boot k3-udma driver expects these additional
> register fields else probe will fail.
> 
> Reported-by: Nishanth Menon 
> Signed-off-by: Roger Quadros 

With just one minor nitpick blow.

Tested-by: Marcel Ziswiler 

> ---
>  .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  | 27 +++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi 
> b/arch/arm/dts/k3-am625-verdin-wifi-dev-u-
> boot.dtsi
> index afa24d07a4..730cb21ce9 100644
> --- a/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
> +++ b/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
> @@ -42,6 +42,33 @@
>   bootph-all;
>  };
>  
> +_bcdma {
> + reg = <0x00 0x485c0100 0x00 0x100>,
> +   <0x00 0x4c00 0x00 0x2>,
> +   <0x00 0x4a82 0x00 0x2>,
> +   <0x00 0x4aa4 0x00 0x2>,
> +   <0x00 0x4bc0 0x00 0x10>,
> +   <0x00 0x4860 0x00 0x8000>,
> +   <0x00 0x484a4000 0x00 0x2000>,
> +   <0x00 0x484c2000 0x00 0x2000>;
> + reg-names = "gcfg", "bchanrt", "rchanrt", "tchanrt",
> +     "ringrt" , "cfg", "tchan", "rchan";
> +};
> +
> +_pktdma {
> + bootph-all;

Ditto, I believe that property would usually be added as the last item of a 
node.

> + reg = <0x00 0x485c 0x00 0x100>,
> +   <0x00 0x4a80 0x00 0x2>,
> +   <0x00 0x4aa0 0x00 0x2>,
> +   <0x00 0x4b80 0x00 0x20>,
> +   <0x00 0x485e 0x00 0x1>,
> +   <0x00 0x484a 0x00 0x2000>,
> +   <0x00 0x484c 0x00 0x2000>,
> +   <0x00 0x4843 0x00 0x1000>;
> + reg-names = "gcfg", "rchanrt", "tchanrt", "ringrt",
> +     "cfg", "tchan", "rchan", "rflow";
> +};
> +
>   {
>   bootph-all;
>  };


Re: [PATCH 1/3] arm: dts: k3-am625-sk-u-boot.dtsi: Update main_bcdma and main_pktdma nodes

2023-10-28 Thread Marcel Ziswiler
On Fri, 2023-10-27 at 16:46 +0300, Roger Quadros wrote:
> From: Siddharth Vadapalli 
> 
> Update main_bcdma and main_pktdma nodes for native configuration in the
> absence of DM services.
> 
> Reported-by: Nishanth Menon 
> Signed-off-by: Siddharth Vadapalli 
> Signed-off-by: Roger Quadros 
> ---
>  arch/arm/dts/k3-am625-sk-u-boot.dtsi | 27 +++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/arch/arm/dts/k3-am625-sk-u-boot.dtsi 
> b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
> index b78d34b459..7186f0830f 100644
> --- a/arch/arm/dts/k3-am625-sk-u-boot.dtsi
> +++ b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
> @@ -154,6 +154,33 @@
>   bootph-all;
>  };
>  
> +_bcdma {
> + reg = <0x00 0x485c0100 0x00 0x100>,
> +   <0x00 0x4c00 0x00 0x2>,
> +   <0x00 0x4a82 0x00 0x2>,
> +   <0x00 0x4aa4 0x00 0x2>,
> +   <0x00 0x4bc0 0x00 0x10>,
> +   <0x00 0x4860 0x00 0x8000>,
> +   <0x00 0x484a4000 0x00 0x2000>,
> +   <0x00 0x484c2000 0x00 0x2000>;
> + reg-names = "gcfg", "bchanrt", "rchanrt", "tchanrt",
> +     "ringrt" , "cfg", "tchan", "rchan";
> +};
> +
> +_pktdma {
> + bootph-all;

I believe that property would usually be added as the last item of a node.

> + reg = <0x00 0x485c 0x00 0x100>,
> +   <0x00 0x4a80 0x00 0x2>,
> +   <0x00 0x4aa0 0x00 0x2>,
> +   <0x00 0x4b80 0x00 0x20>,
> +   <0x00 0x485e 0x00 0x1>,
> +   <0x00 0x484a 0x00 0x2000>,
> +   <0x00 0x484c 0x00 0x2000>,
> +   <0x00 0x4843 0x00 0x1000>;
> + reg-names = "gcfg", "rchanrt", "tchanrt", "ringrt",
> +     "cfg", "tchan", "rchan", "rflow";
> +};
> +
>   {
>   bootph-all;
>   ethernet-ports {


Re: [PATCH v5 2/2] board: mediatek: add mt8195 demo board

2023-10-26 Thread Marcel Ziswiler
Hi Fabien and Macpaul

Thanks for your patch set.

On Fri, 2023-08-04 at 19:04 +0800, Macpaul Lin wrote:
> From: Fabien Parent 
> 
> Add mt8195-demo board support.
> This demo purpose board uses MediaTek's MT8195 SoC.
> 
> Signed-off-by: Fabien Parent 
> Signed-off-by: Amjad Ouled-Ameur 
> Signed-off-by: Macpaul Lin 
> ---
>  MAINTAINERS |   1 +
>  arch/arm/dts/Makefile   |   1 +
>  arch/arm/dts/mt8195-demo.dts    | 122 
>  board/mediatek/mt8195/MAINTAINERS   |   6 ++
>  board/mediatek/mt8195/Makefile  |   3 +
>  board/mediatek/mt8195/README    |  65 +++

Rather than such scattered README files nowadays it is preferred adding such 
documentation at
doc/board/mediatek.

>  board/mediatek/mt8195/mt8195_demo.c |  38 +
>  configs/mt8195_demo_defconfig   |  99 ++
>  include/configs/mt8195.h    |  46 +++
>  9 files changed, 381 insertions(+)
>  create mode 100644 arch/arm/dts/mt8195-demo.dts
>  create mode 100644 board/mediatek/mt8195/MAINTAINERS
>  create mode 100644 board/mediatek/mt8195/Makefile
>  create mode 100644 board/mediatek/mt8195/README
>  create mode 100644 board/mediatek/mt8195/mt8195_demo.c
>  create mode 100644 configs/mt8195_demo_defconfig
>  create mode 100644 include/configs/mt8195.h
> 
> Changes for v2 and v3:
>  - no change.
> 
> Changes for v4:
>  - Remove CONFIG_SYS_NS16550 related settings in mt8195.h.
> 
> Changes for v5:
>  - Fix Copyright year to 2023.
>  - Fix build error by adding 'CONFIG_TEXT_BASE' in defconfig.
>  - Add README for mt8195-demo board includes toolchain setting
>    'CROSS_COMPILE=aarch64-linux-gnu-' 
>  - Fix 'CONFIG_EXTRA_ENV_SETTINGS' with 'CFG_EXTRA_ENV_SETTINGS'
>    according to checkpatch error.
>  - Update dram to 8GB size.
>  - dts
>   - Add optee and pcsi support in firmware section.
>  - mt8195_demo_defconfig
>   - enable I2C, DFU, GPT, MBR support
>   - enable some USB ethernet adaptors
>  - rebase patchset to v2023-10.rc1
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 4d0f017e7e..454d3615f4 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -396,6 +396,7 @@ F:drivers/watchdog/mtk_wdt.c
>  F:   drivers/net/mtk_eth.c
>  F:   drivers/net/mtk_eth.h
>  F:   drivers/reset/reset-mediatek.c
> +F:   include/configs/mt8195.h
>  F:   tools/mtk_image.c
>  F:   tools/mtk_image.h
>  F:   tools/mtk_nand_headers.c
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index e66c32e268..d7104b77bf 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -1342,6 +1342,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
>   mt7986a-emmc-rfb.dtb \
>   mt7986b-emmc-rfb.dtb \
>   mt8183-pumpkin.dtb \
> + mt8195-demo.dtb \
>   mt8512-bm1-emmc.dtb \
>   mt8516-pumpkin.dtb \
>   mt8518-ap1-emmc.dtb
> diff --git a/arch/arm/dts/mt8195-demo.dts b/arch/arm/dts/mt8195-demo.dts
> new file mode 100644
> index 00..e4063cd143
> --- /dev/null
> +++ b/arch/arm/dts/mt8195-demo.dts
> @@ -0,0 +1,122 @@
> +// SPDX-License-Identifier: GPL-2.0 OR MIT
> +/*
> + * Copyright (C) 2023 MediaTek Inc.
> + * Copyright (C) 2023 BayLibre SAS.
> + * Author: Macpaul Lin 
> + * Author: Fabien Parent 
> + */
> +
> +/dts-v1/;
> +
> +#include 
> +#include "mt8195.dtsi"
> +
> +/ {
> + model = "MediaTek MT8195 demo board";
> + compatible = "mediatek,mt8195-demo", "mediatek,mt8195";
> +
> + memory@4000 {
> + /* 8GB */
> + device_type = "memory";
> + reg = <0 0x4000 2 0x>;
> + };
> +
> + firmware: firmware {
> + optee {
> + compatible = "linaro,optee-tz";
> + method = "smc";
> + };
> +
> + psci: psci {
> + compatible = "arm,psci-1.0";
> + method = "smc";
> + };
> + };
> +
> + reserved-memory {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + ranges;
> +
> + /* 2 MiB reserved for ARM Trusted Firmware (BL31) */
> + bl31_secmon_reserved: secmon@5460 {
> + no-map;
> + reg = <0 0x5460 0x0 0x20>;
> + };
> +
> + /* 12 MiB reserved for OP-TEE (BL32)
> +  * +---+ 0x43e0_
> +  * |  SHMEM 2MiB   |
> +  * +---+ 0x43c0_
> +  * |    | TA_RAM  8MiB |
> +  * + TZDRAM +--+ 0x4340_
> +  * |    | TEE_RAM 2MiB |
> +  * +---+ 0x4320_
> +  */
> + optee_reserved: optee@4320 {
> + no-map;
> + reg = <0 0x4320 0 0x00c0>;
> + };
> + };
> +
> + chosen {
> + stdout-path = 
> + };
> +
> + reg_1p8v: regulator-1p8v 

Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-26 Thread Marcel Ziswiler
Hi Rasmus

On Wed, 2023-10-25 at 20:35 +0200, Rasmus Villemoes wrote:
> On 25/10/2023 18.01, Marcel Ziswiler wrote:
> > Hi Rasmus
> > 
> > On Tue, 2023-10-24 at 16:32 +0200, Rasmus Villemoes wrote:
> 
> > > What am I missing?
> > 
> > Good question. Some more debugging revealed that we are missing 464 bytes 
> > at the beginning of the buffer.
> > Why
> > would that be?
> 
> [slaps forehead]
> 
>   bytes = end - ss->end;
>   bytes += ss->pagesize - 1;
>   bytes /= ss->pagesize;
>   bytes *= ss->pagesize;
> 
>   ret = rom_api_download_image(ss->end, 0, bytes);
> ...
>   ss->end = end;
> 
> So I figure out how many bytes must at least be fetched to honor the
> current read, round that up to the ss->pagesize [which is a no-op in the
> usb download case because that has ->pagesize==1, so I even considered
> leaving that rounding-up out], fetch that many bytes, but then record
> the original upper bound as the new end of the valid data. That can
> certainly account for losing something 0 < foo < pagesize number of bytes.
> 
> So let's try if changing that last line to
> 
>   ss->end += bytes;
> 
> works better.

Yes, that cuts it. Please find the fix here [1].

> Rasmus

Thanks again for all your help!

[1] https://lore.kernel.org/all/20231026073220.244387-1-mar...@ziswiler.com

Cheers

Marcel


[PATCH v1 2/2] imx: spl_imx_romapi: fix emmc fast boot mode case

2023-10-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

This fixes a regression in the eMMC fast boot mode case where the buffer
was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor
the current read, rounds that up to the ss->pagesize [which is a no-op
in the USB download case because that has ->pagesize==1], fetches that
many bytes, but then recorded the original upper bound as the new end of
the valid data. However, this did not take into account the rounding up
to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Fixes: 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of 
spl_load_simple_fit() to get full FIT size")
Signed-off-by: Marcel Ziswiler 

---

 arch/arm/mach-imx/spl_imx_romapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/spl_imx_romapi.c 
b/arch/arm/mach-imx/spl_imx_romapi.c
index cb220869b50..5eb5a3d3c4a 100644
--- a/arch/arm/mach-imx/spl_imx_romapi.c
+++ b/arch/arm/mach-imx/spl_imx_romapi.c
@@ -162,7 +162,7 @@ static ulong spl_romapi_read_stream(struct spl_load_info 
*load, ulong sector,
return 0;
}
 
-   ss->end = end;
+   ss->end += bytes;
}
 
memcpy(buf, (void *)(sector), count);
-- 
2.36.1



[PATCH v1 0/2] imx: spl_imx_romapi: fixes

2023-10-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 


The first patch is a trivial spelling fix in comments. The second fixes
a recent regression that only manifests in the eMMC fast boot mode case
which does actually also use streaming rather than seekable.

Thanks go to Rasmus who helped me debug this and suggested the fix.

@Stefano: This one is also still missing [1]. Thanks!

[1] https://lore.kernel.org/all/20230828213803.454303-1-mar...@ziswiler.com


Marcel Ziswiler (2):
  imx: spl_imx_romapi: fix comment about stream(usb) download failure
  imx: spl_imx_romapi: fix emmc fast boot mode case

 arch/arm/mach-imx/spl_imx_romapi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.36.1



[PATCH v1 1/2] imx: spl_imx_romapi: fix comment about stream(usb) download failure

2023-10-26 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Fix comment about Stream(USB) download failure.

Fixes: 1cbebc786276 ("imx: add rom api support")
Signed-off-by: Marcel Ziswiler 
---

 arch/arm/mach-imx/spl_imx_romapi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/spl_imx_romapi.c 
b/arch/arm/mach-imx/spl_imx_romapi.c
index 93d48e56aca..cb220869b50 100644
--- a/arch/arm/mach-imx/spl_imx_romapi.c
+++ b/arch/arm/mach-imx/spl_imx_romapi.c
@@ -285,7 +285,7 @@ static int spl_romapi_load_image_stream(struct 
spl_image_info *spl_image,
ret = rom_api_download_image(p, 0, pg);
 
if (ret != ROM_API_OKAY) {
-   puts("Steam(USB) download failure\n");
+   puts("Stream(USB) download failure\n");
return -1;
}
 
@@ -305,7 +305,7 @@ static int spl_romapi_load_image_stream(struct 
spl_image_info *spl_image,
ret = rom_api_download_image(p, 0, pg);
 
if (ret != ROM_API_OKAY) {
-   puts("Steam(USB) download failure\n");
+   puts("Stream(USB) download failure\n");
return -1;
}
 
-- 
2.36.1



Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-25 Thread Marcel Ziswiler
Hi Rasmus

On Tue, 2023-10-24 at 16:32 +0200, Rasmus Villemoes wrote:
> On 24/10/2023 15.15, Marcel Ziswiler wrote:
> 
> Hi Marcel
> 
> tl;dr: can you try
> 
> @@ -330,7 +335,7 @@ static int spl_romapi_load_image_stream(struct
> spl_image_info *spl_image,
> 
>     ss.base = phdr;
>     ss.end = p;
> -   ss.pagesize = pagesize;
> +   ss.pagesize = 1024;
> 
>     memset(, 0, sizeof(load));
>     load.bl_len = 1;
> 
> and also put 1024 in the binman node so u-boot.itb is also 1024-byte
> aligned?

That did not help.


> This will likely break usb boot (where pagesize==1), so if you want the
> binary to work with usb you can make the RHS instead "(pagesize > 1 ?
> 1024 : 1)" or something like that.
> 
> I don't think it will work, but OTOH my analysis below doesn't find any
> other (fundamental) difference between the old and new code.
> 
> > 
> > On Tue, 2023-10-24 at 13:17 +0200, Rasmus Villemoes wrote:
> > 
> > > 
> > > and this works just fine. But in my case ss->pagesize is 1, whereas you
> > > have 512.
> > > 
> > > Just exactly how are you booting? It says "Boot Stage: Primary boot"
> > > whereas I'm doing serial download with uuu (i.e. "Boot Stage: USB boot").
> > 
> > Yes, regular eMMC boot.
> 
> [snip]
> 
> > 
> > At least I am not aware that we would be doing anything special for eMMC 
> > boot.
> 
> Well, I/we usually do boot from eMMC (except during bootstrap where we
> use uuu), more precisely from the eMMC boot partitions, but that doesn't
> end up using the spl_romapi_load_image_stream() but instead the expected
> spl_romapi_load_image_seekable().
> 
> Perhaps some NXP folks can explain the logic behind
> 
> static int is_boot_from_stream_device(u32 boot)
> {
>   u32 interface;
> 
>   interface = boot >> 16;
>   if (interface >= BT_DEV_TYPE_USB)
>   return 1;
> 
>   if (interface == BT_DEV_TYPE_MMC && (boot & 1))
>   return 1;
> 
>   return 0;
> }
> 
> Apparently that "boot & 1" is an indication that "eMMC fast boot mode"
> is enabled (not to be confused with fastboot which is a USB protocol
> that only becomes relevant once U-Boot proper is up and running).

Yes, we use eMMC fast boot mode.

> As I've complained about previously, the ROM API is almost entirely
> undocumented. There's something in imx93rm.pdf (which is where I have
> that eMMC fast boot info from), but I have no idea if that applies to
> imx8/imx8mp as well.
> 
> Are there any alignment requirements on the destination and/or the size
> parameter? Is there some timing requirements so that if we read too late
> the data is lost? So could e.g. a bunch of printf debugging break boot?
> 
> Because I really can't see the fundamental difference between now and
> then. Both before and after the commit in question, the code does:
> 
> - read 1024 bytes at a time, search each chunk for FDT magic
> 
> This then gives the "Find img info 0x4802b000"
> 
> - make sure the leftover within that 1024 chunk is a full FDT header
> (usually ok, so no output)
> 
> - read the FDT size from that header, round up to a multiple of 1024,
> fetch that - that's the "Need continue download 1024".
> 
> And then the flow deviates.
> 
> The old code would do the fake spl_fit_load to figure out the maximum
> offset (thus the real total .itb size), then take that remaining size,
> round up to ->pagesize (512), and fetch that with one final
> rom_api_download_image(p, 0, imagesize);.
> 
> My code instead does a number of rom_api_download_image() calls, where
> each size argument is rounded up to the ->pagesize from the boot_info
> query (i.e. 512). So it's possible that for one of those calls, the
> destination is only 512-byte aligned (because a previous call fetched an
> odd number of 512 byte blocks), and that doesn't happen in the previous
> case where all but the last rom_api_download_image() have fetched 1024
> byte aligned chunks.
> 
> What am I missing?

Good question. Some more debugging revealed that we are missing 464 bytes at 
the beginning of the buffer. Why
would that be?

> Rasmus

Cheers

Marcel


Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-25 Thread Marcel Ziswiler
Hi Fabio

Thanks!

On Wed, 2023-10-25 at 09:20 -0300, Fabio Estevam wrote:
> Hi Marcel,
> 
> On Tue, Oct 24, 2023 at 10:16 AM Marcel Ziswiler
>  wrote:
> 
> > Yes, regular eMMC boot. Serial download also works for me (note this 
> > requires a patch still not merged
> > upstream
> 
> I tried the top of tree U-Boot on the imx8mp-evk and I was not able to
> reproduce the error here.
> 
> Below is the boot log from the SD card:

Yes, it only seems to be an issue for the eMMC Fastboot case as that one has 
some special handling (whatever
that is).

> U-Boot SPL 2024.01-rc1-00054-gfb428b618194 (Oct 25 2023 - 09:17:12 -0300)
> SEC0:  RNG instantiated
> Normal Boot
> WDT:   Started watchdog@3028 with servicing every 1000ms (60s timeout)
> Trying to boot from BOOTROM
> Boot Stage: Primary boot
> image offset 0x8000, pagesize 0x200, ivt offset 0x0
> NOTICE:  BL31: v2.6(release):lf-6.1.1-1.0.0-0-g616a4588f333
> NOTICE:  BL31: Built : 10:38:04, Oct 12 2023
> 
> 
> U-Boot 2024.01-rc1-00054-gfb428b618194 (Oct 25 2023 - 09:17:12 -0300)
> 
> CPU:   Freescale i.MX8MP[8] rev1.0 at 1200 MHz
> Reset cause: POR
> Model: NXP i.MX8MPlus EVK board
> DRAM:  6 GiB
> Core:  103 devices, 26 uclasses, devicetree: separate
> WDT:   Started watchdog@3028 with servicing every 1000ms (60s timeout)
> MMC:   FSL_SDHC: 1, FSL_SDHC: 2
> Loading Environment from MMC... OK
> In:    serial@3089
> Out:   serial@3089
> Err:   serial@3089
> SEC0:  RNG instantiated
> Net:
> Error: ethernet@30bf address not set.
> 
> Error: ethernet@30be address not set.
> Could not get PHY for FEC0: addr 1
> 
> Error: ethernet@30bf address not set.
> 
> Error: ethernet@30bf address not set.
> No ethernet found.
> 
> Hit any key to stop autoboot:  0
> u-boot=>


Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-24 Thread Marcel Ziswiler
Hi Rasmus

Thanks again.

On Tue, 2023-10-24 at 13:17 +0200, Rasmus Villemoes wrote:

[snip]
> 

> > 
> So this is interesting. I tried disabling CONFIG_IMX_HAB (because that
> case doesn't create an .itb with external data) and boot on a board
> which is not locked down, and I get
> 
> Trying to boot from BOOTROM
> Boot Stage: USB boot
> Find img info 0x4802df00, size 1504
> already have 256 bytes
> Need continue download 2048
> spl_romapi_read_stream(): ss->pagesize = 0x1
> spl_romapi_read_stream(): ss->pagesize = 0x1
> downloading another 0x9d768 bytes
> spl_romapi_read_stream(): rom_api_download_image -> 240
> spl_romapi_read_stream(): ss->pagesize = 0x1
> downloading another 0x1ff18 bytes
> spl_romapi_read_stream(): rom_api_download_image -> 240
> spl_romapi_read_stream(): ss->pagesize = 0x1
> spl_romapi_read_stream(): ss->pagesize = 0x1
> downloading another 0x1622 bytes
> spl_romapi_read_stream(): rom_api_download_image -> 240
> NOTICE:  BL31: v2.6(release):lf-5.15.71-2.2.0-0-g3c1583ba0-dirty
> NOTICE:  BL31: Built : 11:00:38, Nov 21 2022
> 
> and this works just fine. But in my case ss->pagesize is 1, whereas you
> have 512.
> 
> Just exactly how are you booting? It says "Boot Stage: Primary boot"
> whereas I'm doing serial download with uuu (i.e. "Boot Stage: USB boot").

Yes, regular eMMC boot. Serial download also works for me (note this requires a 
patch still not merged upstream
[1]):

U-Boot SPL 2024.01-rc1-1-g36413e27727-dirty (Oct 24 2023 - 15:03:05 +0200)
Training FAILED
DDR configured as single rank
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog@3028 with servicing every 1000ms (60s timeout)
Trying to boot from BOOTROM
Boot Stage: USB boot
Find img info 0x4802b000, size 1044
Need continue download 1024
spl_romapi_read_stream ss->pagesize 0x1
spl_romapi_read_stream ss->pagesize 0x1
downloading another 0xd6480 bytes
rom_api_download_image()=240
spl_romapi_read_stream ss->pagesize 0x1
downloading another 0x1ac70 bytes
rom_api_download_image()=240
spl_romapi_read_stream ss->pagesize 0x1
NOTICE:  Do not release JR0 to NS as it can be used by HAB
NOTICE:  BL31: v2.9(release):v2.9.0-619-g5f01b0b11
NOTICE:  BL31: Built : 11:08:02, Sep  6 2023


U-Boot 2024.01-rc1-1-g36413e27727-dirty (Oct 24 2023 - 15:03:05 +0200)

CPU:   Freescale i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)

[snip]

> It seems weird that you even end up in the is_boot_from_stream_device()
> if you're booting from eMMC (which would explain the 512 byte page size).

At least I am not aware that we would be doing anything special for eMMC boot.

> Also, the prints above reveal that the download of the 0x1ae00 succeeds,
> but then we enter the function once more, and for some reason your
> printf() gets cut short; in my boot, that's for fetching another 0x1622
> bytes. My guess is that the board hangs because it tries to download
> more data than the stream can supply, due to the rounding-up to
> ss->pagesize. Can you try with this
> 
> diff --git a/arch/arm/dts/imx8mp-u-boot.dtsi
> b/arch/arm/dts/imx8mp-u-boot.dtsi
> index e54df1766fa..4b5e9ff466f 100644
> --- a/arch/arm/dts/imx8mp-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mp-u-boot.dtsi
> @@ -100,6 +100,7 @@
> 
>     itb {
>     filename = "u-boot.itb";
> +   align-size = <512>;
> 
>     fit {
>     description = "Configuration to load ATF before
> U-Boot";
> 
> so that u-boot.itb is extended so it's a multiple of 512 bytes?

Unfortunately, that did not help. I mean it does make the u-boot.itb a multiple 
of 512 but keeps crashing the
exact way as before.

> Rasmus

[1] https://lore.kernel.org/all/20230828213803.454303-1-mar...@ziswiler.com

Cheers

Marcel


Re: [REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-24 Thread Marcel Ziswiler
Hi Rasmus

Thanks for your help.

On Tue, 2023-10-24 at 11:18 +0200, Rasmus Villemoes wrote:


[snip]

> Hm. Can you show the result of 'fdtdump u-boot.itb | head'

⬢[zim@toolbox u-boot.git]$ fdtdump u-boot.itb | head

 fdtdump is a low-level debugging tool, not meant for general use.
 If you want to decompile a dtb, you probably want
 dtc -I dtb -O dts 

/dts-v1/;
// magic:   0xd00dfeed
// totalsize:   0x414 (1044)
// off_dt_struct:   0x38
// off_dt_strings:  0x370
// off_mem_rsvmap:  0x28
// version: 17
// last_comp_version:   2
// boot_cpuid_phys: 0x0
// size_dt_strings: 0xa1

>  as well as
> just the actual file sizes of u-boot.itb and flash.bin.

⬢[zim@toolbox u-boot.git]$ ls -l u-boot.itb u-boot.bin
-rw-r--r--. 1 zim zim 882984 Oct 24 11:42 u-boot.bin
-rw-r--r--. 1 zim zim 934504 Oct 24 11:42 u-boot.itb

> Also, in spl_romapi_read_stream(), can you add a print out what
> ss->pagesize is, and also an unconditional printf() after the
> rom_api_download_image() - we apparently don't hit the "Failure download
> %d", but I'd still like to see if we even return from that
> rom_api_download_image() call.

U-Boot SPL 2024.01-rc1-dirty (Oct 24 2023 - 11:56:41 +0200)
Training FAILED
DDR configured as single rank
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog@3028 with servicing every 1000ms (60s timeout)
Trying to boot from BOOTROM
Boot Stage: Primary boot
Find img info 0x4802b000, size 1044
Need continue download 1024
spl_romapi_read_stream ss->pagesize 0x200
spl_romapi_read_stream ss->pagesize 0x200
downloading another 0xc9000 bytes
rom_api_download_image()=240
spl_romapi_read_stream ss->pagesize 0x200
downloading another 0x1ae00 bytes
rom_api_download_image()=240
spl_romapi_read_stream�

> Rasmus

Cheers

Marcel


[REGRESSION] imx: spl_imx_romapi: boot loops

2023-10-24 Thread Marcel Ziswiler
Hi

On our weekly master upstream CI build we noticed Verdin iMX8M Plus boot 
looping.

Bisecting pointed to the following commit:

commit 4b4472438f5a ("imx: spl_imx_romapi: avoid tricky use of 
spl_load_simple_fit() to get full FIT size")

It looks like this introduced a regression.

Before and after console output (with DEBUG defined in 
arch/arm/mach-imx/spl_imx_romapi.c) below:

Any comments?

Cheers

Marcel


Before:

U-Boot SPL 2023.10-00969-g9960d4a5402-dirty (Oct 24 2023 - 09:20:03 +0200)
Training FAILED
DDR configured as single rank
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog@3028 with servicing every 1000ms (60s timeout)
Trying to boot from BOOTROM
Boot Stage: Primary boot
Find img info 0x4802b000, size 1044
Need continue download 1024
Download 932864, Total size 934544
NOTICE:  Do not release JR0 to NS as it can be used by HAB
NOTICE:  BL31: v2.9(release):v2.9.0-619-g5f01b0b11
NOTICE:  BL31: Built : 11:08:02, Sep  6 2023


U-Boot 2023.10-00969-g9960d4a5402-dirty (Oct 24 2023 - 09:20:03 +0200)

CPU:   Freescale i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
[snip]


After (e.g. commit 4b4472438f5 or master):

U-Boot SPL 2024.01-rc1-dirty (Oct 24 2023 - 09:28:26 +0200)
Training FAILED
DDR configured as single rank
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog@3028 with servicing every 1000ms (60s timeout)
Trying to boot from BOOTROM
Boot Stage: Primary boot
Find img info 0x4802b000, size 1044
Need continue download 1024
downloading another 0xc9000 bytes
downloading another 0x1ae00 bytes

=> this crash/resets and boot loops forever


Re: [PATCH v1] board: toradex: verdin-imx8mp: enable usb device and fastboot support

2023-10-17 Thread Marcel Ziswiler
Hi Stefano

Maybe you missed that one (i.MX 8M Plus vs. Mini)? Thanks!

Cheers

Marcel

On Mon, 2023-08-28 at 19:24 -0300, Fabio Estevam wrote:
> Hi Marcel,
> 
> On Mon, Aug 28, 2023 at 6:38 PM Marcel Ziswiler  wrote:
> > 
> > From: Marcel Ziswiler 
> > 
> > Enable USB device and fastboot support which may be used to load the
> > Toradex Easy Installer FIT image.
> > 
> > While at it also enable USB mass storage aka UMS support.
> > 
> > Note that the i.MX 8M Plus recovery mode support is based on the USB
> > boot stage of the BOOTROM and does NOT require USB SDP SPL aka serial
> > downloader support.
> > 
> > Signed-off-by: Marcel Ziswiler 
> 
> Reviewed-by: Fabio Estevam 


[PATCH v1] arm: dts: k3-am625-verdin: fix boot

2023-10-10 Thread Marcel Ziswiler
From: Marcel Ziswiler 

A53 U-Boot proper got broken because nodes marked as 'bootph-pre-ram'
are no longer available in U-Boot proper before relocation.

Fix this by marking all nodes in u-boot.dtsi as 'bootph-all'.

Fixes: 9e644284ab812 ("dm: core: Report bootph-pre-ram/sram node as pre-reloc 
after relocation")
Signed-off-by: Marcel Ziswiler 

---

 .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  | 72 +--
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi 
b/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
index 5d564603eb2..afa24d07a4c 100644
--- a/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
+++ b/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
@@ -17,49 +17,49 @@
};
 
memory@8000 {
-   bootph-pre-ram;
+   bootph-all;
};
 };
 
 _main {
-   bootph-pre-ram;
+   bootph-all;
 
timer@240 {
clock-frequency = <2500>;
-   bootph-pre-ram;
+   bootph-all;
};
 };
 
 _mcu {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _wakeup {
-   bootph-pre-ram;
+   bootph-all;
 };
 
  {
-   bootph-pre-ram;
+   bootph-all;
 };
 
  {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _phy0 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _phy1 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _port1 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _port2 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 /* MDIO, shared by Verdin ETH_1 (On-module PHY) and Verdin ETH_2_RGMII */
@@ -67,40 +67,40 @@
/delete-property/ assigned-clocks;
/delete-property/ assigned-clock-parents;
/delete-property/ assigned-clock-rates;
-   bootph-pre-ram;
+   bootph-all;
 };
 
  {
-   bootph-pre-ram;
+   bootph-all;
 
k3_sysreset: sysreset-controller {
compatible = "ti,sci-sysreset";
-   bootph-pre-ram;
+   bootph-all;
};
 };
 
  {
-   bootph-pre-ram;
+   bootph-all;
 };
 
  {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _clks {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _pds {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _reset {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _gpio0 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 /* On-module I2C - PMIC_I2C */
@@ -130,53 +130,53 @@
 };
 
 _pmx0 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 /* Verdin UART_3, used as the Linux console */
 _uart0 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 /* Verdin UART_1 */
 _uart1 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _pmx0 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _ctrl_sleep_moci {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _i2c0 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _i2c1 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _sdhci0 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _uart0 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _uart1 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _wkup_uart0 {
-   bootph-pre-ram;
+   bootph-all;
 };
 
  {
-   bootph-pre-ram;
+   bootph-all;
 };
 
  {
@@ -184,18 +184,18 @@
 };
 
 _proxy_main {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _ctrl_sleep_moci {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 _conf {
-   bootph-pre-ram;
+   bootph-all;
 };
 
 /* Verdin UART_2 */
 _uart0 {
-   bootph-pre-ram;
+   bootph-all;
 };
-- 
2.36.1



Re: [PATCH] toradex: verdin-imx8mm/imx8mp: Remove bootcmd_mfg

2023-10-04 Thread Marcel Ziswiler
On Wed, 2023-10-04 at 16:13 -0300, Francesco Dolcini wrote:
> From: Joao Paulo Goncalves 
> 
> The bootcmd_mfg env variable is legacy from IMX downstream u-boot branch
> and is not needed on mainline.
> 
> Signed-off-by: Joao Paulo Goncalves 
> Signed-off-by: Francesco Dolcini 

Acked-by: Marcel Ziswiler 

> ---
>  include/configs/verdin-imx8mm.h | 1 -
>  include/configs/verdin-imx8mp.h | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/include/configs/verdin-imx8mm.h b/include/configs/verdin-imx8mm.h
> index 8cb1f1aff353..8072d5d503f2 100644
> --- a/include/configs/verdin-imx8mm.h
> +++ b/include/configs/verdin-imx8mm.h
> @@ -37,7 +37,6 @@
>  #define CFG_EXTRA_ENV_SETTINGS \
>   BOOTENV \
>   MEM_LAYOUT_ENV_SETTINGS \
> - "bootcmd_mfg=fastboot 0\0" \
>   "boot_file=Image\0" \
>   "boot_script_dhcp=boot.scr\0" \
>   "console=ttymxc0\0" \
> diff --git a/include/configs/verdin-imx8mp.h b/include/configs/verdin-imx8mp.h
> index 942081ab84d7..5a34f6a9b205 100644
> --- a/include/configs/verdin-imx8mp.h
> +++ b/include/configs/verdin-imx8mp.h
> @@ -46,7 +46,6 @@
>  #define CFG_EXTRA_ENV_SETTINGS \
>   BOOTENV \
>   MEM_LAYOUT_ENV_SETTINGS \
> - "bootcmd_mfg=fastboot 0\0" \
>   "boot_file=Image\0" \
>   "boot_scripts=" BOOT_SCRIPT "\0" \
>   "boot_script_dhcp=" BOOT_SCRIPT "\0" \


Re: [PATCH] toradex: colibri_imx7: Enable nand/emmc detection and set boot variant

2023-10-02 Thread Marcel Ziswiler
On Mon, 2023-10-02 at 08:57 -0300, Hiago De Franco wrote:
> From: Hiago De Franco 
> 
> Add detection of eMMC vs NAND devices on the Colibri iMX7
> board. A GPIO is configured to detect the presence of an on-board resistor
> that is configured differently based on the flash memory used. Depending on
> the detection result, the 'variant' environment variable is set to '-emmc'
> or cleared, indicating the type of storage device.
> 
> This enhancement improves variant detection during system initialization
> through USB recovery mode, where U-Boot is loaded directly to RAM. This
> allows variant detection for an accurate device tree selection.
> 
> Signed-off-by: Hiago De Franco 

Acked-by: Marcel Ziswiler 

> ---
>  board/toradex/colibri_imx7/colibri_imx7.c | 24 +++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/board/toradex/colibri_imx7/colibri_imx7.c 
> b/board/toradex/colibri_imx7/colibri_imx7.c
> index 119e67b47f..f0356af008 100644
> --- a/board/toradex/colibri_imx7/colibri_imx7.c
> +++ b/board/toradex/colibri_imx7/colibri_imx7.c
> @@ -53,6 +53,11 @@ DECLARE_GLOBAL_DATA_PTR;
>  
>  #define USB_CDET_GPIOIMX_GPIO_NR(7, 14)
>  
> +#define FLASH_DETECTION_CTRL (PAD_CTL_HYS | PAD_CTL_PUE)
> +#define FLASH_DET_GPIO IMX_GPIO_NR(6, 11)
> +
> +static bool is_emmc;
> +
>  int dram_init(void)
>  {
>   gd->ram_size = get_ram_size((void *)PHYS_SDRAM, imx_ddr_size());
> @@ -60,6 +65,10 @@ int dram_init(void)
>   return 0;
>  }
>  
> +static iomux_v3_cfg_t const flash_detection_pads[] = {
> + MX7D_PAD_SD3_RESET_B__GPIO6_IO11 | MUX_PAD_CTRL(FLASH_DETECTION_CTRL),
> +};
> +
>  static iomux_v3_cfg_t const uart1_pads[] = {
>   MX7D_PAD_UART1_RX_DATA__UART1_DTE_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
>   MX7D_PAD_UART1_TX_DATA__UART1_DTE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
> @@ -183,6 +192,16 @@ int board_init(void)
>   /* address of boot parameters */
>   gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
>  
> + /*
> +  * Enable GPIO on NAND_WE_B/eMMC_RST with 100k pull-down. eMMC_RST
> +  * is pulled high with 4.7k for eMMC devices. This allows to reliably
> +  * detect eMMC/NAND flash
> +  */
> + imx_iomux_v3_setup_multiple_pads(flash_detection_pads, 
> ARRAY_SIZE(flash_detection_pads));
> + gpio_request(FLASH_DET_GPIO, "flash-detection-gpio");
> + is_emmc = gpio_get_value(FLASH_DET_GPIO);
> + gpio_free(FLASH_DET_GPIO);
> +
>  #ifdef CONFIG_FEC_MXC
>   setup_fec();
>  #endif
> @@ -348,6 +367,11 @@ int board_late_init(void)
>   env_set("bootcmd", "sdp 0");
>   }
>  #endif
> + if (is_emmc)
> + env_set("variant", "-emmc");
> + else
> + env_set("variant", "");
> +
>   return 0;
>  }
>  #endif /* CONFIG_BOARD_LATE_INIT */


Re: [PATCH v1] board: toradex: verdin-imx8mm: set fixed LPDDR4 refresh rate as per errata ERR050805

2023-09-28 Thread Marcel Ziswiler
On Thu, 2023-09-28 at 16:39 +0200, Andrejs Cainikovs wrote:
> From: Andrejs Cainikovs 
> 
> Update lpddr4 configuration and training using updated spreadsheet and
> tools from NXP using data from previous spreadsheet and verified
> toward datasheet:
> 
> - MX8M_Mini_LPDDR4_RPA_v22.xlsx
> - mscale_ddr_tool_v3.31_setup.exe
> 
> The most relevant update is related to errata ERR050805:
> "DRAM: Controller automatic derating logic may not work when
> the LPDDR4 memory temperature is above 85 °C at initialization"
> 
> Other relevant fixes:
> - DRAMTMG7 register: corrected calculation of T_CKPDX parameter
>   (equal to tCKCKEH for LPDDR4)
> - RANKCTL register: corrected calculations for ODTLon and ODTLoff
>   to follow the JEDEC specification
> - ADDRMAP7 register: added support for 17-row devices
> 
> As per errata ERR050805:
> 
> An issue exists with the automatic derating logic of the DDR
> controller that only samples the LPDDR4 MR4 register when the
> Temperature Update Flag (TUF) field (MR4[7] ) is 1’b1. If the
> LPDDR4 memory is initialized and starts operation above 85 °C
> (MR4[2:0] > 3’b011), the MR4 Temperature Update Flag (TUF) will
> not be set. The DDR Controller will therefore not automatically
> adjust the memory refresh rate or de-rate memory timings based
> on the LPDDR4 memory temperature. This may cause the controller
> incorrectly setting the refresh period, potentially cause the
> LPDDR4 memory losing data contents and lead to possible data
> integrity issues above 85 °C.
> 
> Errata provides three possible workaround options, while option 2
> is the most reasonable:
> 
> Disable the automatic derating logic of the DDR controller and
> apply fixed x2 refresh rate (0.5x refresh). This option is
> suitable for designs that are expected to boot at or above 85 °C
> and memory’s MR4[2:0] (Refresh Rate) DOES NOT report the following
> conditions:
> 3b101: 0.25x refresh, no de-rating
> 3b110: 0.25x refresh, with de-rating
> 3b111: SDRAM High temperature operating limit exceeded
> 
> [1]: https://www.nxp.com/docs/en/errata/IMX8MM_0N87W.pdf
> 
> Signed-off-by: Andrejs Cainikovs 

Acked-by: Marcel Ziswiler 

> ---
>  board/toradex/verdin-imx8mm/lpddr4_timing.c | 51 ++---
>  1 file changed, 24 insertions(+), 27 deletions(-)
> 
> diff --git a/board/toradex/verdin-imx8mm/lpddr4_timing.c 
> b/board/toradex/verdin-imx8mm/lpddr4_timing.c
> index d114abf9d67..4dfec679b11 100644
> --- a/board/toradex/verdin-imx8mm/lpddr4_timing.c
> +++ b/board/toradex/verdin-imx8mm/lpddr4_timing.c
> @@ -1,12 +1,11 @@
>  // SPDX-License-Identifier: GPL-2.0+
>  /*
> - * Copyright 2020 Toradex
> + * Copyright 2023 Toradex
>   *
>   * Generated code from MX8M_DDR_tool
> - * Align with uboot-imx_v2018.03_4.14.78_1.0.0_ga
>   *
> - * DDR calibration created with mscale_ddr_tool_v210_setup.exe using
> - * MX8M_Mini_LPDDR4_RPA_v14 Verdin iMX8MM V1.0.xlsx as of 1. Nov. 2019.
> + * DDR calibration created with mscale_ddr_tool_v3.31_setup.exe using
> + * MX8M_Mini_LPDDR4_RPA_v22 Verdin iMX8MM V1.0.xlsx as of 7. Aug. 2023.
>   */
>  
>  #include 
> @@ -17,22 +16,22 @@ struct dram_cfg_param ddr_ddrc_cfg[] = {
>   {0x3d400304, 0x1},
>   {0x3d400030, 0x1},
>   {0x3d40, 0xa1080020},
> - {0x3d400020, 0x203},
> + {0x3d400020, 0x202},
>   {0x3d400024, 0x3a980},
> - {0x3d400064, 0x5b00d2},
> + {0x3d400064, 0x2d00d2},
>   {0x3d4000d0, 0xc00305ba},
>   {0x3d4000d4, 0x94},
>   {0x3d4000dc, 0xd4002d},
>   {0x3d4000e0, 0x31},
>   {0x3d4000e8, 0x66004d},
>   {0x3d4000ec, 0x16004d},
> - {0x3d400100, 0x191e1920},
> + {0x3d400100, 0x191e0c20},
>   {0x3d400104, 0x60630},
>   {0x3d40010c, 0xb0b000},
>   {0x3d400110, 0xe04080e},
>   {0x3d400114, 0x2040c0c},
>   {0x3d400118, 0x1010007},
> - {0x3d40011c, 0x401},
> + {0x3d40011c, 0x402},
>   {0x3d400130, 0x20600},
>   {0x3d400134, 0xc12},
>   {0x3d400138, 0xd8},
> @@ -49,7 +48,7 @@ struct dram_cfg_param ddr_ddrc_cfg[] = {
>   {0x3d4001b0, 0x11},
>   {0x3d4001c0, 0x1},
>   {0x3d4001c4, 0x1},
> - {0x3d4000f4, 0xc99},
> + {0x3d4000f4, 0x699},
>   {0x3d400108, 0x70e1617},
>   {0x3d400200, 0x1f},
>   {0x3d40020c, 0x0},
> @@ -57,6 +56,7 @@ struct dram_cfg_param ddr_ddrc_cfg[] = {
>   {0x3d400204, 0x80808},
>   {0x3d400214, 0x7070707},
>   {0x3d400218, 0x7070707},
> + {0x3d40021c, 0xf0f},
>   {0x3d400250, 0x29001701},
>   {0x3d400254, 0x2c},
>   {0x3d40025c, 0x430},
> @@ -68,22 +68,22 @@ struct dram_cfg_param ddr_ddrc_cfg[] = {
>   {0x3d4004

Re: [PATCH v3 16/16] doc: board: ti: k3: Add J784S4 EVM and AM69 SK documentation

2023-09-12 Thread Marcel Ziswiler
On Fri, 2023-09-08 at 16:35 +0530, Apurva Nandan wrote:
> TI K3 J784S4 and AM69 SK are new additions to the K3 SoC family.
> Add documentation about the J784S4 EVM and AM69 SK.
> 
> Signed-off-by: Dasnavis Sabiya 
> Signed-off-by: Apurva Nandan 
> ---
>  board/ti/j784s4/MAINTAINERS |   1 +
>  doc/board/ti/j784s4_evm.rst | 339 
>  doc/board/ti/k3.rst |   1 +
>  3 files changed, 341 insertions(+)
>  create mode 100644 doc/board/ti/j784s4_evm.rst
> 
> diff --git a/board/ti/j784s4/MAINTAINERS b/board/ti/j784s4/MAINTAINERS
> index 7d3549dd31..be2f9a04b7 100644
> --- a/board/ti/j784s4/MAINTAINERS
> +++ b/board/ti/j784s4/MAINTAINERS
> @@ -18,3 +18,4 @@ F:arch/arm/dts/k3-j784s4-ddr-evm-lp4-4266.dtsi
>  F: arch/arm/dts/k3-am69-sk.dts
>  F: arch/arm/dts/k3-am69-sk-u-boot.dtsi
>  F: arch/arm/dts/k3-am69-r5-sk.dts
> +F: doc/board/ti/j784s4_evm.rst
> diff --git a/doc/board/ti/j784s4_evm.rst b/doc/board/ti/j784s4_evm.rst
> new file mode 100644
> index 00..1e2b7f3820
> --- /dev/null
> +++ b/doc/board/ti/j784s4_evm.rst
> @@ -0,0 +1,339 @@
> +.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause

Should be:

GPL-2.0-or-later OR BSD-3-Clause

> +.. sectionauthor:: Apurva Nandan 
> +
> +J784S4 and AM69 Platforms
> +=
> +
> +Introduction:
> +-
> +The J784S4 SoC belongs to the K3 Multicore SoC architecture
> +platform, providing advanced system integration in automotive,
> +ADAS and industrial applications requiring AI at the network edge.
> +This SoC extends the K3 Jacinto 7 family of SoCs with focus on
> +raising performance and integration while providing interfaces,
> +memory architecture and compute performance for multi-sensor, high
> +concurrency applications.
> +
> +The device is partitioned into three functional domains, each containing
> +specific processing cores and peripherals:
> +
> +1. Wake-up (WKUP) domain:
> +    * ARM Cortex-M4F processor, runs TI Foundational Security (TIFS)
> +
> +2. Microcontroller (MCU) domain:
> +    * Dual core ARM Cortex-R5F processor, runs device management
> +  and SoC early boot
> +
> +3. MAIN domain:
> +    * Dual core 64-bit ARM Cortex-A72, runs HLOS
> +
> +More info can be found in TRM: http://www.ti.com/lit/zip/spruj52
> +
> +Platform information:
> +
> +* https://www.ti.com/tool/J784S4XEVM
> +* https://www.ti.com/tool/SK-AM69
> +
> +Boot Flow:
> +--
> +Below is the pictorial representation of boot flow:
> +
> +.. image:: img/boot_diagram_k3_current.svg
> +
> +- On this platform, "TI Foundational Security (TIFS)" functions as the
> +  security enclave master. While "Device Manager (DM)", also known as the
> +  "TISCI server" in TI terminology, offers all the essential services.
> +
> +- As illustrated in the diagram above, R5 SPL manages power and clock
> +  services independently before handing over control to DM. The A72 or
> +  the C7x (Aux core) software components request TIFS/DM to handle
> +  security or device management services.
> +
> +Sources:
> +
> +
> +.. include::  k3.rst
> +    :start-after: .. k3_rst_include_start_boot_sources
> +    :end-before: .. k3_rst_include_end_boot_sources
> +
> +Build procedure:
> +
> +0. Setup the environment variables:
> +
> +.. include::  k3.rst
> +    :start-after: .. k3_rst_include_start_common_env_vars_desc
> +    :end-before: .. k3_rst_include_end_common_env_vars_desc
> +
> +.. include::  k3.rst
> +    :start-after: .. k3_rst_include_start_board_env_vars_desc
> +    :end-before: .. k3_rst_include_end_board_env_vars_desc
> +
> +Set the variables corresponding to this platform:
> +
> +.. include::  k3.rst
> +    :start-after: .. k3_rst_include_start_common_env_vars_defn
> +    :end-before: .. k3_rst_include_end_common_env_vars_defn
> +.. code-block:: bash
> +
> + $ export UBOOT_CFG_CORTEXR=j784s4_evm_r5_defconfig
> + $ export UBOOT_CFG_CORTEXA=j784s4_evm_a72_defconfig
> + $ export TFA_BOARD=generic
> + $ export TFA_EXTRA_ARGS="K3_USART=0x8"
> + $ export OPTEE_PLATFORM=k3-j784s4
> + $ export OPTEE_EXTRA_ARGS="CFG_CONSOLE_UART=0x8"
> +
> +.. j784s4_evm_rst_include_start_build_steps
> +
> +1. Trusted Firmware-A:
> +
> +.. include::  k3.rst
> +    :start-after: .. k3_rst_include_start_build_steps_tfa
> +    :end-before: .. k3_rst_include_end_build_steps_tfa
> +
> +
> +2. OP-TEE:
> +
> +.. include::  k3.rst
> +    :start-after: .. k3_rst_include_start_build_steps_optee
> +    :end-before: .. k3_rst_include_end_build_steps_optee
> +
> +3. U-Boot:
> +
> +.. _j784s4_evm_rst_u_boot_r5:
> +
> +* 3.1 R5:
> +
> +.. include::  k3.rst
> +    :start-after: .. k3_rst_include_start_build_steps_spl_r5
> +    :end-before: .. k3_rst_include_end_build_steps_spl_r5
> +
> +.. _j784s4_evm_rst_u_boot_a72:
> +
> +* 3.2 A72:
> +
> +.. include::  k3.rst
> +    :start-after: .. k3_rst_include_start_build_steps_uboot
> +    :end-before: .. k3_rst_include_end_build_steps_uboot
> +.. j784s4_evm_rst_include_end_build_steps

Re: [PATCH v3 13/16] arm: dts: Introduce am69-sk u-boot dts files

2023-09-12 Thread Marcel Ziswiler
On Fri, 2023-09-08 at 16:35 +0530, Apurva Nandan wrote:
> From: Dasnavis Sabiya 
> 
> Introduce the base dts files needed for u-boot or to augment the linux
> dtbs for use in the u-boot-spl and u-boot binaries.
> 
> Signed-off-by: Dasnavis Sabiya 
> Signed-off-by: Apurva Nandan 
> ---
>  arch/arm/dts/Makefile   |   3 +-
>  arch/arm/dts/k3-am69-r5-sk.dts  | 105 
>  arch/arm/dts/k3-am69-sk-u-boot.dtsi |  25 +++
>  3 files changed, 132 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/k3-am69-r5-sk.dts
>  create mode 100644 arch/arm/dts/k3-am69-sk-u-boot.dtsi
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 1bcdbea9e5..bb7ae79745 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -1330,7 +1330,8 @@ dtb-$(CONFIG_SOC_K3_J721S2) += 
> k3-am68-sk-base-board.dtb\
>    k3-am68-sk-r5-base-board.dtb\
>    k3-j721s2-common-proc-board.dtb\
>    k3-j721s2-r5-common-proc-board.dtb
> -dtb-$(CONFIG_SOC_K3_J784S4) += k3-am69-sk.dtb\
> +dtb-$(CONFIG_SOC_K3_J784S4) += k3-am69-r5-sk.dtb\
> +  k3-am69-sk.dtb\
>    k3-j784s4-evm.dtb\
>    k3-j784s4-r5-evm.dtb
>  dtb-$(CONFIG_SOC_K3_AM642) += k3-am642-evm.dtb \
> diff --git a/arch/arm/dts/k3-am69-r5-sk.dts b/arch/arm/dts/k3-am69-r5-sk.dts
> new file mode 100644
> index 00..8c789c4f28valuation module (EVM) is a pl
> --- /dev/null
> +++ b/arch/arm/dts/k3-am69-r5-sk.dts
> @@ -0,0 +1,105 @@
> +// SPDX-License-Identifier: GPL-2.0

Should be:

GPL-2.0-only

BTW: Why is TI not releasing their device trees with a more permissive license 
like GPL-2.0-or-later OR MIT
like most others do?

> +/*
> + * Copyright (C) 2022-2023 Texas Instruments Incorporated - 
> https://www.ti.com/
> + */
> +
> +/dts-v1/;
> +
> +#include "k3-am69-sk.dts"
> +#include "k3-j784s4-ddr-evm-lp4-4266.dtsi"
> +#include "k3-j784s4-ddr.dtsi"
> +#include "k3-am69-sk-u-boot.dtsi"
> +
> +/ {
> +   chosen {
> +   tick-timer = _timer0;
> +   };
> +
> +   aliases {
> +   remoteproc0 = 
> +   remoteproc1 = _0;
> +   };
> +
> +   a72_0: a72@0 {
> +   compatible = "ti,am654-rproc";
> +   reg = <0x0 0x00a9 0x0 0x10>;
> +   power-domains = <_pds 61 TI_SCI_PD_EXCLUSIVE>,
> +   <_pds 202 TI_SCI_PD_EXCLUSIVE>;
> +   resets = <_reset 202 0>;
> +   clocks = <_clks 61 0>;
> +   assigned-clocks = <_clks 61 0>, <_clks 202 0>;
> +   assigned-clock-parents = <_clks 61 2>;
> +   assigned-clock-rates = <2>, <20>;
> +   ti,sci = <>;
> +   ti,sci-proc-id = <32>;
> +   ti,sci-host-id = <10>;
> +   bootph-pre-ram;
> +   };
> +
> +   dm_tifs: dm-tifs {
> +   compatible = "ti,j721e-dm-sci";
> +   ti,host-id = <3>;
> +   ti,secure-host;
> +   mbox-names = "rx", "tx";
> +   mboxes= <_proxy_mcu 21>, <_proxy_mcu 23>;
> +   bootph-pre-ram;
> +   };
> +};
> +
> +_timer0 {
> +   status = "okay";
> +   clock-frequency = <25000>;
> +   bootph-pre-ram;
> +};
> +
> +_proxy_sa3 {
> +   status = "okay";
> +   bootph-pre-ram;
> +};
> +
> +_proxy_mcu {
> +   status = "okay";
> +   bootph-pre-ram;
> +};
> +
> +_mcu_wakeup {
> +   sysctrler: sysctrler {
> +   compatible = "ti,am654-system-controller";
> +   mboxes= <_proxy_mcu 4>,
> +   <_proxy_mcu 5>,
> +   <_proxy_sa3 5>;
> +   mbox-names = "tx", "rx", "boot_notify";
> +   bootph-pre-ram;
> +   };
> +};
> +
> + {
> +   mboxes= <_proxy_mcu 8>, <_proxy_mcu 6>, 
> <_proxy_mcu 5>;
> +   mbox-names = "tx", "rx", "notify";
> +   ti,host-id = <4>;
> +   ti,secure-host;
> +   bootph-pre-ram;
> +};
> +
> +_uart0 {
> +   bootph-pre-ram;
> +   status = "okay";
> +};
> +
> + {
> +   reg = <0x0 0x4704 0x0 0x100>,
> + <0x0 0x5000 0x0 0x800>;
> +};
> +
> + {
> +   reg = <0x0 0x4705 0x0 0x100>,
> + <0x0 0x5800 0x0 0x800>;
> +};
> +
> +_ringacc {
> +   ti,sci = <_tifs>;
> +};
> +
> +_udmap {
> +   ti,sci = <_tifs>;
> +};
> diff --git a/arch/arm/dts/k3-am69-sk-u-boot.dtsi 
> b/arch/arm/dts/k3-am69-sk-u-boot.dtsi
> new file mode 100644
> index 00..c8944499e8
> --- /dev/null
> +++ b/arch/arm/dts/k3-am69-sk-u-boot.dtsi
> @@ -0,0 +1,25 @@
> +// SPDX-License-Identifier: GPL-2.0

Ditto.

> +/*
> + * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/
> + */
> +
> +#include "k3-j784s4-binman.dtsi"
> +
> +_udmap {
> +   reg =   <0x0 0x285c 0x0 0x100>,
> +   <0x0 

Re: [PATCH v3 10/16] arm: dts: Introduce am69-sk dts from linux kernel

2023-09-12 Thread Marcel Ziswiler
On Fri, 2023-09-08 at 16:35 +0530, Apurva Nandan wrote:
> From: Dasnavis Sabiya 
> 
> Introduce the basic am69-sk evm dts from the next-20230905 tag of the
> linux kernel.
> 
> Signed-off-by: Dasnavis Sabiya 
> Signed-off-by: Apurva Nandan 
> ---
>  arch/arm/dts/Makefile   |   3 +-
>  arch/arm/dts/k3-am69-sk.dts | 364 
>  2 files changed, 366 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/dts/k3-am69-sk.dts
> 
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 363f7a1171..1bcdbea9e5 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -1330,7 +1330,8 @@ dtb-$(CONFIG_SOC_K3_J721S2) += 
> k3-am68-sk-base-board.dtb\
>    k3-am68-sk-r5-base-board.dtb\
>    k3-j721s2-common-proc-board.dtb\
>    k3-j721s2-r5-common-proc-board.dtb
> -dtb-$(CONFIG_SOC_K3_J784S4) += k3-j784s4-evm.dtb\
> +dtb-$(CONFIG_SOC_K3_J784S4) += k3-am69-sk.dtb\
> +  k3-j784s4-evm.dtb\
>    k3-j784s4-r5-evm.dtb
>  dtb-$(CONFIG_SOC_K3_AM642) += k3-am642-evm.dtb \
>   k3-am642-r5-evm.dtb \
> diff --git a/arch/arm/dts/k3-am69-sk.dts b/arch/arm/dts/k3-am69-sk.dts
> new file mode 100644
> index 00..0699370911
> --- /dev/null
> +++ b/arch/arm/dts/k3-am69-sk.dts
> @@ -0,0 +1,364 @@
> +// SPDX-License-Identifier: GPL-2.0

Should be:

GPL-2.0-only

> +/*
> + * Copyright (C) 2022-2023 Texas Instruments Incorporated - 
> https://www.ti.com/
> + *
> + * Design Files: https://www.ti.com/lit/zip/SPRR466
> + * TRM: https://www.ti.com/lit/zip/spruj52
> + */
> +
> +/dts-v1/;
> +
> +#include 
> +#include 
> +#include "k3-j784s4.dtsi"
> +
> +/ {
> +   compatible = "ti,am69-sk", "ti,j784s4";
> +   model = "Texas Instruments AM69 SK";

I never understood TI's naming. Somewhere they call it Evaluation Module (EVM), 
somewhere Starter Kit (SK) and
even at other places Evaluation Board (EVB).

> +
> +   chosen {
> +   stdout-path = "serial2:115200n8";
> +   };
> +
> +   aliases {
> +   serial0 = _uart0;
> +   serial1 = _uart0;
> +   serial2 = _uart8;
> +   mmc0 = _sdhci0;
> +   mmc1 = _sdhci1;
> +   i2c0 = _i2c0;
> +   i2c3 = _i2c0;
> +   ethernet0 = _cpsw_port1;
> +   };
> +
> +   memory@8000 {
> +   device_type = "memory";
> +   /* 32G RAM */
> +   reg = <0x00 0x8000 0x00 0x8000>,
> + <0x08 0x8000 0x07 0x8000>;
> +   };
> +
> +   reserved_memory: reserved-memory {
> +   #address-cells = <2>;
> +   #size-cells = <2>;
> +   ranges;
> +
> +   secure_ddr: optee@9e80 {
> +   reg = <0x00 0x9e80 0x00 0x0180>;
> +   no-map;
> +   };
> +   };
> +
> +   vusb_main: regulator-vusb-main5v0 {
> +   /* USB MAIN INPUT 5V DC */
> +   compatible = "regulator-fixed";
> +   regulator-name = "vusb-main5v0";
> +   regulator-min-microvolt = <500>;
> +   regulator-max-microvolt = <500>;
> +   regulator-always-on;
> +   regulator-boot-on;
> +   };
> +
> +   vsys_5v0: regulator-vsys5v0 {
> +   /* Output of LM61460 */
> +   compatible = "regulator-fixed";
> +   regulator-name = "vsys_5v0";
> +   regulator-min-microvolt = <500>;
> +   regulator-max-microvolt = <500>;
> +   vin-supply = <_main>;
> +   regulator-always-on;
> +   regulator-boot-on;
> +   };
> +
> +   vsys_3v3: regulator-vsys3v3 {
> +   /* Output of LM5143 */
> +   compatible = "regulator-fixed";
> +   regulator-name = "vsys_3v3";
> +   regulator-min-microvolt = <330>;
> +   regulator-max-microvolt = <330>;
> +   vin-supply = <_main>;
> +   regulator-always-on;
> +   regulator-boot-on;
> +   };
> +
> +   vdd_mmc1: regulator-sd {
> +   /* Output of TPS22918 */
> +   compatible = "regulator-fixed";
> +   regulator-name = "vdd_mmc1";
> +   regulator-min-microvolt = <330>;
> +   regulator-max-microvolt = <330>;
> +   regulator-boot-on;
> +   enable-active-high;
> +   vin-supply = <_3v3>;
> +   gpio = < 2 GPIO_ACTIVE_HIGH>;
> +   };
> +
> +   vdd_sd_dv: regulator-tlv71033 {
> +   /* Output of TLV71033 */
> +   compatible = "regulator-gpio";
> +   regulator-name = "tlv71033";
> +   pinctrl-names = "default";
> +   pinctrl-0 = 

Re: [PATCH v3 05/16] drivers: dma: Add support for J784S4 SoC

2023-09-12 Thread Marcel Ziswiler
On Fri, 2023-09-08 at 16:35 +0530, Apurva Nandan wrote:
> Add support for DMA in J784S4 SoC.
> 
> Signed-off-by: Jayesh Choudhary 
> Signed-off-by: Hari Nagalla 
> Signed-off-by: Apurva Nandan 
> ---
>  drivers/dma/ti/Makefile   |   1 +
>  drivers/dma/ti/k3-psil-j784s4.c   | 166 ++
>  drivers/dma/ti/k3-psil-priv.h |   1 +
>  drivers/dma/ti/k3-psil.c  |   2 +
>  drivers/firmware/ti_sci_static_data.h |  34 ++
>  drivers/ram/Kconfig   |   2 +-
>  6 files changed, 205 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/dma/ti/k3-psil-j784s4.c
> 
> diff --git a/drivers/dma/ti/Makefile b/drivers/dma/ti/Makefile
> index 6807eb8e8b..bd4ce68d9c 100644
> --- a/drivers/dma/ti/Makefile
> +++ b/drivers/dma/ti/Makefile
> @@ -8,3 +8,4 @@ k3-psil-data-$(CONFIG_SOC_K3_J721E) += k3-psil-j721e.o
>  k3-psil-data-$(CONFIG_SOC_K3_J721S2) += k3-psil-j721s2.o
>  k3-psil-data-$(CONFIG_SOC_K3_AM642) += k3-psil-am64.o
>  k3-psil-data-$(CONFIG_SOC_K3_AM625) += k3-psil-am62.o
> +k3-psil-data-$(CONFIG_SOC_K3_J784S4) += k3-psil-j784s4.o
> diff --git a/drivers/dma/ti/k3-psil-j784s4.c b/drivers/dma/ti/k3-psil-j784s4.c
> new file mode 100644
> index 00..d62d5e9c33
> --- /dev/null
> +++ b/drivers/dma/ti/k3-psil-j784s4.c
> @@ -0,0 +1,166 @@
> +// SPDX-License-Identifier: GPL-2.0

Should be:

GPL-2.0-only

> +/*
> + *  Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com
> + */
> +#include 
> +
> +#include "k3-psil-priv.h"
> +
> +#define PSIL_PDMA_XY_TR(x) \
> +   {   \
> +   .thread_id = x, \
> +   .ep_config = {  \
> +   .ep_type = PSIL_EP_PDMA_XY, \
> +   },  \
> +   }
> +
> +#define PSIL_PDMA_XY_PKT(x)\
> +   {   \
> +   .thread_id = x, \
> +   .ep_config = {  \
> +   .ep_type = PSIL_EP_PDMA_XY, \
> +   .pkt_mode = 1,  \
> +   },  \
> +   }
> +
> +#define PSIL_PDMA_MCASP(x) \
> +   {   \
> +   .thread_id = x, \
> +   .ep_config = {  \
> +   .ep_type = PSIL_EP_PDMA_XY, \
> +   .pdma_acc32 = 1,\
> +   .pdma_burst = 1,\
> +   },  \
> +   }
> +
> +#define PSIL_ETHERNET(x)   \
> +   {   \
> +   .thread_id = x, \
> +   .ep_config = {  \
> +   .ep_type = PSIL_EP_NATIVE,  \
> +   .pkt_mode = 1,  \
> +   .needs_epib = 1,\
> +   .psd_size = 16, \
> +   },  \
> +   }
> +
> +#define PSIL_SA2UL(x, tx)  \
> +   {   \
> +   .thread_id = x, \
> +   .ep_config = {  \
> +   .ep_type = PSIL_EP_NATIVE,  \
> +   .pkt_mode = 1,  \
> +   .needs_epib = 1,\
> +   .psd_size = 64, \
> +   .notdpkt = tx,  \
> +   },  \
> +   }
> +
> +/* PSI-L source thread IDs, used for RX (DMA_DEV_TO_MEM) */
> +static struct psil_ep j784s4_src_ep_map[] = {
> +   /* PDMA_MCASP - McASP0-4 */
> +   PSIL_PDMA_MCASP(0x4400),
> +   PSIL_PDMA_MCASP(0x4401),
> +   PSIL_PDMA_MCASP(0x4402),
> +   PSIL_PDMA_MCASP(0x4403),
> +   PSIL_PDMA_MCASP(0x4404),
> +   /* PDMA_SPI_G0 - SPI0-3 */
> +   PSIL_PDMA_XY_PKT(0x4600),
> +   PSIL_PDMA_XY_PKT(0x4601),
> +   PSIL_PDMA_XY_PKT(0x4602),
> +   PSIL_PDMA_XY_PKT(0x4603),
> +   PSIL_PDMA_XY_PKT(0x4604),
> +   PSIL_PDMA_XY_PKT(0x4605),
> +   PSIL_PDMA_XY_PKT(0x4606),
> +   PSIL_PDMA_XY_PKT(0x4607),
> +   PSIL_PDMA_XY_PKT(0x4608),
> +   PSIL_PDMA_XY_PKT(0x4609),
> +   PSIL_PDMA_XY_PKT(0x460a),
> +   PSIL_PDMA_XY_PKT(0x460b),
> +   PSIL_PDMA_XY_PKT(0x460c),
> +   PSIL_PDMA_XY_PKT(0x460d),
> +   PSIL_PDMA_XY_PKT(0x460e),
> +   PSIL_PDMA_XY_PKT(0x460f),
> +   /* PDMA_SPI_G1 - SPI4-7 */
> +   

Re: [PATCH v3 04/16] arm: mach-k3: j784s4: Add clk and power support

2023-09-12 Thread Marcel Ziswiler
On Fri, 2023-09-08 at 16:35 +0530, Apurva Nandan wrote:
> Add clk and device data which can be used by respective drivers
> to configure clocks and PSC.
> 
> Signed-off-by: Hari Nagalla 
> Signed-off-by: Apurva Nandan 
> ---
>  arch/arm/mach-k3/j784s4/Makefile   |   5 +
>  arch/arm/mach-k3/j784s4/clk-data.c | 428 +
>  arch/arm/mach-k3/j784s4/dev-data.c |  98 ++
>  drivers/clk/ti/clk-k3.c    |   6 +
>  drivers/power/domain/ti-power-domain.c |   6 +
>  include/k3-clk.h   |   1 +
>  include/k3-dev.h   |   1 +
>  7 files changed, 545 insertions(+)
>  create mode 100644 arch/arm/mach-k3/j784s4/Makefile
>  create mode 100644 arch/arm/mach-k3/j784s4/clk-data.c
>  create mode 100644 arch/arm/mach-k3/j784s4/dev-data.c
> 
> diff --git a/arch/arm/mach-k3/j784s4/Makefile 
> b/arch/arm/mach-k3/j784s4/Makefile
> new file mode 100644
> index 00..b6cd23457d
> --- /dev/null
> +++ b/arch/arm/mach-k3/j784s4/Makefile
> @@ -0,0 +1,5 @@
> +# SPDX-License-Identifier: GPL-2.0+

Should be:

GPL-2.0-or-later

> +#
> +# Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/
> +obj-y += clk-data.o
> +obj-y += dev-data.o
> diff --git a/arch/arm/mach-k3/j784s4/clk-data.c 
> b/arch/arm/mach-k3/j784s4/clk-data.c
> new file mode 100644
> index 00..1c9f0698ea
> --- /dev/null
> +++ b/arch/arm/mach-k3/j784s4/clk-data.c
> @@ -0,0 +1,428 @@
> +// SPDX-License-Identifier: GPL-2.0+

Ditto.

> +/*
> + * J784S4 specific clock platform data
> + *
> + * This file is auto generated. Please do not hand edit and report any issues
> + * to Bryan Brattlof .
> + *
> + * Copyright (C) 2020-2022 Texas Instruments Incorporated - 
> https://www.ti.com/
> + */
> +
> +#include 
> +#include "k3-clk.h"
> +
> +static const char * const gluelogic_hfosc0_clkout_parents[] = {
> +   "osc_19_2_mhz",
> +   "osc_20_mhz",
> +   "osc_24_mhz",
> +   "osc_25_mhz",
> +   "osc_26_mhz",
> +   "osc_27_mhz",
> +};
> +
> +static const char * const mcu_ospi0_iclk_sel_out0_parents[] = {
> +   "board_0_mcu_ospi0_dqs_out",
> +   "fss_mcu_0_ospi_0_ospi_oclk_clk",
> +};
> +
> +static const char * const mcu_ospi1_iclk_sel_out0_parents[] = {
> +   "board_0_mcu_ospi1_dqs_out",
> +   "fss_mcu_0_ospi_1_ospi_oclk_clk",
> +};
> +
> +static const char * const wkup_fref_clksel_out0_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   "j7am_wakeup_16ff_wkup_0_wkup_rcosc_12p5m_clk",
> +};
> +
> +static const char * const k3_pll_ctrl_wrap_wkup_0_sysclkout_clk_parents[] = {
> +   "wkup_fref_clksel_out0",
> +   "hsdiv1_16fft_mcu_0_hsdivout0_clk",
> +};
> +
> +static const char * const mcu_ospi_ref_clk_sel_out0_parents[] = {
> +   "hsdiv4_16fft_mcu_1_hsdivout4_clk",
> +   "hsdiv4_16fft_mcu_2_hsdivout4_clk",
> +};
> +
> +static const char * const mcu_ospi_ref_clk_sel_out1_parents[] = {
> +   "hsdiv4_16fft_mcu_1_hsdivout4_clk",
> +   "hsdiv4_16fft_mcu_2_hsdivout4_clk",
> +};
> +
> +static const char * const wkup_gpio0_clksel_out0_parents[] = {
> +   "k3_pll_ctrl_wrap_wkup_0_chip_div1_clk_clk",
> +   "k3_pll_ctrl_wrap_wkup_0_chip_div1_clk_clk",
> +   "j7am_wakeup_16ff_wkup_0_wkup_rcosc_32k_clk",
> +   "j7am_wakeup_16ff_wkup_0_wkup_rcosc_12p5m_clk",
> +};
> +
> +static const char * const mcu_usart_clksel_out0_parents[] = {
> +   "hsdiv4_16fft_mcu_1_hsdivout3_clk",
> +   "postdiv3_16fft_main_1_hsdivout5_clk",
> +};
> +
> +static const char * const wkup_i2c_mcupll_bypass_out0_parents[] = {
> +   "hsdiv4_16fft_mcu_1_hsdivout3_clk",
> +   "gluelogic_hfosc0_clkout",
> +};
> +
> +static const char * const main_pll_hfosc_sel_out0_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   "board_0_hfosc1_clk_out",
> +};
> +
> +static const char * const main_pll_hfosc_sel_out1_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   "board_0_hfosc1_clk_out",
> +};
> +
> +static const char * const main_pll_hfosc_sel_out12_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   "board_0_hfosc1_clk_out",
> +};
> +
> +static const char * const main_pll_hfosc_sel_out19_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   "board_0_hfosc1_clk_out",
> +};
> +
> +static const char * const main_pll_hfosc_sel_out2_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   "board_0_hfosc1_clk_out",
> +};
> +
> +static const char * const main_pll_hfosc_sel_out26_0_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   "board_0_hfosc1_clk_out",
> +};
> +
> +static const char * const main_pll_hfosc_sel_out27_0_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   "board_0_hfosc1_clk_out",
> +};
> +
> +static const char * const main_pll_hfosc_sel_out28_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   "board_0_hfosc1_clk_out",
> +};
> +
> +static const char * const main_pll_hfosc_sel_out3_parents[] = {
> +   "gluelogic_hfosc0_clkout",
> +   

Re: [PATCH v3 03/16] soc: ti: k3-socinfo: Add entry for J784S4 SoC

2023-09-12 Thread Marcel Ziswiler
On Fri, 2023-09-08 at 16:35 +0530, Apurva Nandan wrote:
> Add support for J784S4 SoC Identification.
> 
> Signed-off-by: Hari Nagalla 
> Signed-off-by: Apurva Nandan 
> ---
>  arch/arm/mach-k3/include/mach/hardware.h | 1 +
>  drivers/soc/soc_ti_k3.c  | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-k3/include/mach/hardware.h 
> b/arch/arm/mach-k3/include/mach/hardware.h
> index 03b18f6bad..bada87d0b2 100644
> --- a/arch/arm/mach-k3/include/mach/hardware.h
> +++ b/arch/arm/mach-k3/include/mach/hardware.h
> @@ -50,6 +50,7 @@
>  #define JTAG_ID_PARTNO_J721S2  0xbb75
>  #define JTAG_ID_PARTNO_AM62X   0xbb7e
>  #define JTAG_ID_PARTNO_AM62AX   0xbb8d
> +#define JTAG_ID_PARTNO_J784S4  0xbb80

Not sure whether it would be smarter to sort this based on the JTAG ID or the 
name of the define like you did.

>  #define K3_SOC_ID(id, ID) \
>  static inline bool soc_is_##id(void) \
> diff --git a/drivers/soc/soc_ti_k3.c b/drivers/soc/soc_ti_k3.c
> index b720131ae5..6f7fcf9e11 100644
> --- a/drivers/soc/soc_ti_k3.c
> +++ b/drivers/soc/soc_ti_k3.c
> @@ -45,6 +45,9 @@ static const char *get_family_string(u32 idreg)
> case JTAG_ID_PARTNO_AM62AX:
> family = "AM62AX";
> break;
> +   case JTAG_ID_PARTNO_J784S4:
> +   family = "J784S4";
> +   break;
> default:
> family = "Unknown Silicon";
> };


Re: [PATCH v3 02/16] arm: mach-k3: Add basic support for J784S4 SoC definition

2023-09-12 Thread Marcel Ziswiler
On Fri, 2023-09-08 at 16:35 +0530, Apurva Nandan wrote:
> Add j784s4 initialization files for initial SPL boot.
> 
> Signed-off-by: Hari Nagalla 
> [ add firewall configurations and change the R5 MCU scratchpad ]
> Signed-off-by: Manorit Chawdhry 
> Signed-off-by: Dasnavis Sabiya 
> Signed-off-by: Apurva Nandan 
> ---
>  arch/arm/mach-k3/Kconfig  |  16 +-
>  arch/arm/mach-k3/Makefile |   3 +
>  arch/arm/mach-k3/arm64-mmu.c  |  52 +++
>  arch/arm/mach-k3/include/mach/hardware.h  |   4 +
>  .../mach-k3/include/mach/j784s4_hardware.h    |  60 
>  arch/arm/mach-k3/include/mach/j784s4_spl.h    |  46 +++
>  arch/arm/mach-k3/include/mach/spl.h   |   6 +-
>  arch/arm/mach-k3/j784s4_fdt.c |  15 +
>  arch/arm/mach-k3/j784s4_init.c    | 332 ++
>  9 files changed, 526 insertions(+), 8 deletions(-)
>  create mode 100644 arch/arm/mach-k3/include/mach/j784s4_hardware.h
>  create mode 100644 arch/arm/mach-k3/include/mach/j784s4_spl.h
>  create mode 100644 arch/arm/mach-k3/j784s4_fdt.c
>  create mode 100644 arch/arm/mach-k3/j784s4_init.c
> 
> diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
> index 9168bf842d..0af2ec6ddb 100644
> --- a/arch/arm/mach-k3/Kconfig
> +++ b/arch/arm/mach-k3/Kconfig
> @@ -22,6 +22,9 @@ config SOC_K3_AM625
>  config SOC_K3_AM62A7
> bool "TI's K3 based AM62A7 SoC Family Support"
>  
> +config SOC_K3_J784S4
> +   bool "TI's K3 based J784S4 SoC Family Support"
> +
>  endchoice
>  
>  config SYS_SOC
> @@ -30,7 +33,7 @@ config SYS_SOC
>  config SYS_K3_NON_SECURE_MSRAM_SIZE
> hex
> default 0x8 if SOC_K3_AM654
> -   default 0x10 if SOC_K3_J721E || SOC_K3_J721S2
> +   default 0x10 if SOC_K3_J721E || SOC_K3_J721S2 || SOC_K3_J784S4
> default 0x1c if SOC_K3_AM642
> default 0x3c000 if SOC_K3_AM625 || SOC_K3_AM62A7
> help
> @@ -42,7 +45,7 @@ config SYS_K3_NON_SECURE_MSRAM_SIZE
>  config SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
> hex
> default 0x58000 if SOC_K3_AM654
> -   default 0xc if SOC_K3_J721E || SOC_K3_J721S2
> +   default 0xc if SOC_K3_J721E || SOC_K3_J721S2 || SOC_K3_J784S4
> default 0x18 if SOC_K3_AM642
> default 0x38000 if SOC_K3_AM625 || SOC_K3_AM62A7
> help
> @@ -52,15 +55,14 @@ config SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
>  config SYS_K3_MCU_SCRATCHPAD_BASE
> hex
> default 0x4028 if SOC_K3_AM654
> -   default 0x41cff9fc if SOC_K3_J721S2
> -   default 0x41cff9fc if SOC_K3_J721E
> +   default 0x41cff9fc if SOC_K3_J721E || SOC_K3_J721S2 || SOC_K3_J784S4
> help
>   Describes the base address of MCU Scratchpad RAM.
>  
>  config SYS_K3_MCU_SCRATCHPAD_SIZE
> hex
> default 0x200 if SOC_K3_AM654
> -   default 0x200 if SOC_K3_J721E || SOC_K3_J721S2
> +   default 0x200 if SOC_K3_J721E || SOC_K3_J721S2 || SOC_K3_J784S4
> help
>   Describes the size of MCU Scratchpad RAM.
>  
> @@ -68,7 +70,7 @@ config SYS_K3_BOOT_PARAM_TABLE_INDEX
> hex
> default 0x41c7fbfc if SOC_K3_AM654
> default 0x41cffbfc if SOC_K3_J721E
> -   default 0x41cfdbfc if SOC_K3_J721S2
> +   default 0x41cfdbfc if SOC_K3_J721S2 || SOC_K3_J784S4
> default 0x701bebfc if SOC_K3_AM642
> default 0x43c3f290 if SOC_K3_AM625
> default 0x43c3f290 if SOC_K3_AM62A7 && CPU_V7R
> @@ -172,7 +174,7 @@ config K3_ATF_LOAD_ADDR
>  
>  config K3_DM_FW
> bool "Separate DM firmware image"
> -   depends on SPL && CPU_V7R && (SOC_K3_J721E || SOC_K3_J721S2 || 
> SOC_K3_AM625 || SOC_K3_AM62A7) &&
> !CLK_TI_SCI && !TI_SCI_POWER_DOMAIN
> +   depends on SPL && CPU_V7R && (SOC_K3_J721E || SOC_K3_J721S2 || 
> SOC_K3_AM625 || SOC_K3_AM62A7 ||
> SOC_K3_J784S4) && !CLK_TI_SCI && !TI_SCI_POWER_DOMAIN
> default y
> help
>   Enabling this will indicate that the system has separate DM
> diff --git a/arch/arm/mach-k3/Makefile b/arch/arm/mach-k3/Makefile
> index fd77b8bbba..6fe36c265c 100644
> --- a/arch/arm/mach-k3/Makefile
> +++ b/arch/arm/mach-k3/Makefile
> @@ -7,6 +7,7 @@ obj-$(CONFIG_SOC_K3_J721E) += j721e/ j7200/
>  obj-$(CONFIG_SOC_K3_J721S2) += j721s2/
>  obj-$(CONFIG_SOC_K3_AM625) += am62x/
>  obj-$(CONFIG_SOC_K3_AM62A7) += am62ax/
> +obj-$(CONFIG_SOC_K3_J784S4) += j784s4/
>  obj-$(CONFIG_ARM64) += arm64-mmu.o
>  obj-$(CONFIG_CPU_V7R) += r5_mpu.o lowlevel_init.o
>  obj-$(CONFIG_ARM64) += cache.o
> @@ -16,6 +17,7 @@ obj-$(CONFIG_SOC_K3_AM654) += am654_fdt.o
>  obj-$(CONFIG_SOC_K3_J721E) += j721e_fdt.o
>  obj-$(CONFIG_SOC_K3_J721S2) += j721s2_fdt.o
>  obj-$(CONFIG_SOC_K3_AM625) += am625_fdt.o
> +obj-$(CONFIG_SOC_K3_J784S4) += j784s4_fdt.o
>  endif
>  ifeq ($(CONFIG_SPL_BUILD),y)
>  obj-$(CONFIG_SOC_K3_AM654) += am654_init.o
> @@ -24,6 +26,7 @@ obj-$(CONFIG_SOC_K3_J721S2) += j721s2_init.o
>  obj-$(CONFIG_SOC_K3_AM642) += am642_init.o
>  

Re: [PATCH v3 00/16]Introduce initial TI's J784S4 and AM69 support

2023-09-12 Thread Marcel Ziswiler
On Fri, 2023-09-08 at 16:35 +0530, Apurva Nandan wrote:
> Hello Everyone!
> 
> This series will introduce basic support (SD and UART) support for Texas
> Instruments J784S4 EVM.
> 
> The J784S4 SoC device tree patches are taken from kernel patch submissions
> and will be updated as they are accepted and merged to the kernel tree.
> All other patches are specific to SPL and u-boot and do not have
> dependency on other trees. Appreciate a review for acceptance to u-boot
> tree.
> 
> Here are some of the salient features of the J784S4 automotive grade 
> application processor:
> 
> The J784S4 SoC belongs to the K3 Multicore SoC architecture
> platform, providing advanced system integration in automotive,
> ADAS and industrial applications requiring AI at the network edge.
> This SoC extends the K3 Jacinto 7 family of SoCs with focus on
> raising performance and integration while providing interfaces,
> memory architecture and compute performance for multi-sensor, high
> concurrency applications.
> 
> Some highlights of this SoC are:
> * Up to 8 Cortex-A72s, four clusters of lockstep capable dual Cortex-R5F MCUs,
>   4 C7x floating point vector DSPs with Matrix Multiply Accelerator(MMA) for
>   deep learning and CNN.
> * 3D GPU: Automotive grade IMG BXS-4-64

BTW: Is it actually an IMG BXS-4-64 MC1 or MC4?

> * Vision Processing Accelerator (VPAC) with image signal processor and Depth
>   and Motion Processing Accelerator (DMPAC)
> * Three CSI2.0 4L RX plus two CSI2.0 4L TX, two DSI Tx, one eDP/DP and one
>   DPI interface.
> * Integrated gigabit ethernet switch, up to 8 ports (TDA4VH), two ports
>   support 10Gb USXGMII; Two 4 lane PCIe-GEN3 controllers, USB3.0 Dual-role
>   device subsystems, Up to 20 MCANs, among other peripherals.
> 
> See J784S4 Technical Reference Manual (SPRUJ52 - JUNE 2022)
> for further details: http://www.ti.com/lit/zip/spruj52
> 
> In addtion, the J784S4 EVM board is designed for TI J784S4 SoC. It 
> supports the following interfaces:
> * 32 GB DDR4 RAM
> * x2 Gigabit Ethernet interfaces capable of working in Switch and MAC mode
> * x1 Input Audio Jack, x1 Output Audio Jack
> * x1 USB2.0 Hub with two Type A host and x1 USB 3.1 Type-C Port
> * x2 4L PCIe connector
> * x1 UHS-1 capable micro-SD card slot
> * 512 Mbit OSPI flash, 1 Gbit Octal NAND flash, 512 Mbit QSPI flash,
>   UFS flash.
> * x6 UART through UART-USB bridge
> * XDS110 for onboard JTAG debug using USB
> * Temperature sensors, user push buttons and LEDs
> * 40-pin User Expansion Connector
> * x2 ENET Expansion Connector, x1 GESI expander, x2 Display connector
> * x1 15-pin CSI header
> * x6 MCAN instances
> 
> Schematics: https://www.ti.com/lit/zip/sprr458
> 
> bootlog: 
> https://paste.sr.ht/~hnagalla/f14840abc854519f912923662f1fdc8075d92107
> 
> Changes in v3:
> 1) Added AM69 SK support in the series
> 2) Switched from distroboot to bootstd support
> 3) Added remoteproc support for J784S4
> 4) Added documentation for both SoCs
> 5) Added binman support
> 6) Removed unnecessarry nodes from r5-evm.dts and evm-u-boot.dtsi
> 7) Added HS device support
> 8) Added env file for environement variables
> 9) Removed ti-serdes-mux bindings
> 10) Cleaned up all files and synced with latest
> 11) Addressed all previous review comments
> 
> Note: The base dts files have been sync from next-20230905 linux tag as per 
> review comment received
> on previous re-roll:
> https://lore.kernel.org/u-boot/20230321155227.GV8135@bill-the-cat/
> 
> Link to v2:
> https://lore.kernel.org/u-boot/20230321141028.24456-1-hnaga...@ti.com/
> 
> Changes in v2:
> - Refactored environement scripts to 'j784s4.env' and removed scripts not
>   needed for basic board bootup.
> - Imported the J7874S4 basic device tree files from v6.2 linux kernel.
> - Moved j784s4 clock definitions and clock data into one patch/commit.
> - coalesce board commits into one commit.
> 
> Apurva Nandan (9):
>   arm: dts: Introduce j784s4 dts from linux kernel
>   arm: mach-k3: Add basic support for J784S4 SoC definition
>   soc: ti: k3-socinfo: Add entry for J784S4 SoC
>   arm: mach-k3: j784s4: Add clk and power support
>   drivers: dma: Add support for J784S4 SoC
>   board: ti: j784s4: Add board support for J784S4 EVM
>   arm: dts: Introduce j784s4 u-boot dts files
>   configs: j784s4_evm: Add defconfig for j784s4 evm and am69 sk
>   doc: board: ti: k3: Add J784S4 EVM and AM69 SK documentation
> 
> Dasnavis Sabiya (5):
>   arm: dts: Introduce am69-sk dts from linux kernel
>   board: ti: j784s4: Add support for board detection by EEPROM read
>   board: ti: j784s4: Update env to use am69-sk dtb
>   arm: dts: Introduce am69-sk u-boot dts files
>   arm: dts: k3-j784s4-binman: Add support for AM69 SK
> 
> Hari Nagalla (2):
>   remoteproc: k3-r5: Extend support for R5F clusters on J784S4 SoCs
>   remoteproc: k3-dsp: Extend support for C71x DSPs on J784S4 SoCs
> 
>  arch/arm/dts/Makefile |    4 +
>  arch/arm/dts/k3-am69-r5-sk.dts    |  105 +
>  

Re: [PATCH] verdin-imx8mp: drop unused tdx easy installer ifdef

2023-09-04 Thread Marcel Ziswiler
Hi Hiago

Thanks!

On Mon, 2023-09-04 at 10:24 -0300, Hiago De Franco wrote:
> From: Hiago De Franco 
> 
> Drop unused code related to CONFIG_TDX_EASY_INSTALLER, that existed only on
> toradex downstream branch.
> 
> Signed-off-by: Hiago De Franco 

Acked-by: Marcel Ziswiler 

> ---
>  include/configs/verdin-imx8mp.h | 10 ++
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/include/configs/verdin-imx8mp.h b/include/configs/verdin-imx8mp.h
> index 942081ab84..d980bd66ae 100644
> --- a/include/configs/verdin-imx8mp.h
> +++ b/include/configs/verdin-imx8mp.h
> @@ -36,20 +36,14 @@
> func(DHCP, dhcp, na)
>  #include 
>  
> -#if defined(CONFIG_TDX_EASY_INSTALLER)
> -#  define BOOT_SCRIPT  "boot-tezi.scr"
> -#else
> -#  define BOOT_SCRIPT  "boot.scr"
> -#endif
> -
>  /* Initial environment variables */
>  #define CFG_EXTRA_ENV_SETTINGS \
> BOOTENV \
> MEM_LAYOUT_ENV_SETTINGS \
> "bootcmd_mfg=fastboot 0\0" \
> "boot_file=Image\0" \
> -   "boot_scripts=" BOOT_SCRIPT "\0" \
> -   "boot_script_dhcp=" BOOT_SCRIPT "\0" \
> +   "boot_scripts=boot.scr\0" \
> +   "boot_script_dhcp=boot.scr\0" \
> "console=ttymxc2\0" \
> "fdt_board=dev\0" \
> "initrd_addr=0x4380\0" \

Cheers

Marcel


Re: [PATCH 02/32] spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_...

2023-08-31 Thread Marcel Ziswiler
Hi Simon

For the Toradex Apalis, Colibri and Verdin SoMs.

On Wed, 2023-08-30 at 12:04 -0600, Simon Glass wrote:
> We like to put the SPL first so it is clear that it relates to SPL. Rename
> various malloc-related options which have crept in, to stick to this
> convention.
> 
> Signed-off-by: Simon Glass 

Reviewed-by: Marcel Ziswiler 

[snip]

Cheers

Marcel


Re: [PATCH v1 1/2] verdin-am62: add u-boot update wrappers

2023-08-28 Thread Marcel Ziswiler
On Thu, 2023-08-24 at 16:42 +0200, Francesco Dolcini wrote:
> Hello Nishanth,
> 
> On Thu, Aug 24, 2023 at 07:10:57AM -0500, Nishanth Menon wrote:
> > On 13:19-20230824, Francesco Dolcini wrote:
> > > On Thu, Aug 24, 2023 at 10:08:49AM +0200, Emanuele Ghidoli wrote:
> > > > From: Emanuele Ghidoli 
> > > > 
> > > > Add update_tiboot3, update_tispl and update_uboot wrappers to update
> > > > R5 SPL, A53 SPL and A53 U-boot respectively.
> > > > 
> > > > Usage example:
> > > > > tftpboot ${loadaddr} tiboot3-am62x-gp-verdin.bin
> > > > > run update_tiboot3
> > > > 
> > > > > tftpboot ${loadaddr} tispl.bin
> > > > > run update_tispl
> > > > 
> > > > > tftpboot ${loadaddr} u-boot.img
> > > > > run update_uboot
> > > > 
> > > > Signed-off-by: Emanuele Ghidoli 
> > > 
> > > Acked-by: Francesco Dolcini 
> > 
> > Should you update documentation to indicate the usage?
> 
> Yeah, probably we could add it. I would not remove the existing direct
> command usage since this is adding just env variables that could be
> removed from the env even at runtime.
> 
> In general the reason for these commands is that our users are
> accustomed to have a "guided" way to update u-boot without having to dig
> into the documentation. They are just convenient.
> 
> Marcel: what do you think?

Sure, we took care of it here:

https://lore.kernel.org/all/20230828220154.483362-1-mar...@ziswiler.com

> Francesco

Cheers

Marcel


[PATCH v1 2/2] doc: board: toradex: verdin-am62: document update u-boot wrapper

2023-08-28 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Now with the update U-Boot wrappers having been sorted out, document
their usage.

Signed-off-by: Marcel Ziswiler 

---

 doc/board/toradex/verdin-am62.rst | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/doc/board/toradex/verdin-am62.rst 
b/doc/board/toradex/verdin-am62.rst
index ecc7e0777cb..e8d90273288 100644
--- a/doc/board/toradex/verdin-am62.rst
+++ b/doc/board/toradex/verdin-am62.rst
@@ -74,6 +74,20 @@ Flash to eMMC
 => fatload mmc 1 ${loadaddr} u-boot.img
 => mmc write ${loadaddr} 0x1400 0x2000
 
+As a convenience, instead of having to remember all those addresses and sizes,
+one may also use the update U-Boot wrappers:
+
+.. code-block:: bash
+
+> tftpboot ${loadaddr} tiboot3-am62x-gp-verdin.bin
+> run update_tiboot3
+
+> tftpboot ${loadaddr} tispl.bin
+> run update_tispl
+
+> tftpboot ${loadaddr} u-boot.img
+> run update_uboot
+
 Boot
 
 
-- 
2.36.1



[PATCH v1 1/2] doc: board: toradex: minor documentation update

2023-08-28 Thread Marcel Ziswiler
From: Marcel Ziswiler 

- Update SPDX-License-Identifier from obsolete GPL-2.0+ to
  GPL-2.0-or-later.
- Add links to product websites of SoM and carrier board where missing.
- Add information about update U-Boot wrapper where missing.
- Add sectionauthor where missing.
- Update information about imx-seco from version 3.7.4 to 3.8.1.
- Various minor grammatic and spelling fixes.
- Improve whitespace by adding or removing new lines.
- Change from code-block for output to just Output::.

Signed-off-by: Marcel Ziswiler 
---

 doc/board/toradex/apalis-imx8.rst   | 22 +
 doc/board/toradex/colibri-imx8x.rst | 31 ---
 doc/board/toradex/colibri_imx7.rst  | 38 +++--
 doc/board/toradex/verdin-am62.rst   |  8 +++---
 doc/board/toradex/verdin-imx8mm.rst |  9 +++
 doc/board/toradex/verdin-imx8mp.rst |  9 +++
 6 files changed, 71 insertions(+), 46 deletions(-)

diff --git a/doc/board/toradex/apalis-imx8.rst 
b/doc/board/toradex/apalis-imx8.rst
index 849b1172bd4..ffc4c7d222a 100644
--- a/doc/board/toradex/apalis-imx8.rst
+++ b/doc/board/toradex/apalis-imx8.rst
@@ -1,7 +1,11 @@
-.. SPDX-License-Identifier: GPL-2.0+
+.. SPDX-License-Identifier: GPL-2.0-or-later
+.. sectionauthor:: Marcel Ziswiler 
 
-Apalis iMX8QM V1.0B Module
-==
+Apalis iMX8 Module
+==
+
+- SoM: https://www.toradex.com/computer-on-modules/apalis-arm-family/nxp-imx-8
+- Carrier board: 
https://www.toradex.com/products/carrier-board/apalis-evaluation-board
 
 Quick Start
 ---
@@ -49,6 +53,7 @@ Copy the following firmware to the U-Boot folder:
 
 Build U-Boot
 
+
 .. code-block:: bash
 
 $ make apalis-imx8_defconfig
@@ -61,8 +66,8 @@ Get the latest version of the universal update utility (uuu) 
aka ``mfgtools 3.0`
 
 
https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FNXPmicro%2Fmfgtools%2Freleases
 
-Put the module into USB recovery aka serial downloader mode, connect USB device
-to your host and execute uuu:
+Put the module into USB recovery aka serial downloader mode, connect the USB
+device to your host and execute ``uuu``:
 
 .. code-block:: bash
 
@@ -80,3 +85,10 @@ partition and boot:
 setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200
 mmc dev 0 1
 mmc write ${loadaddr} 0x0 ${blkcnt}
+
+As a convenience, instead of the last three commands, one may also use the
+update U-Boot wrapper:
+
+.. code-block:: bash
+
+> run update_uboot
diff --git a/doc/board/toradex/colibri-imx8x.rst 
b/doc/board/toradex/colibri-imx8x.rst
index 545568c844a..9e61d98c6b1 100644
--- a/doc/board/toradex/colibri-imx8x.rst
+++ b/doc/board/toradex/colibri-imx8x.rst
@@ -1,7 +1,11 @@
-.. SPDX-License-Identifier: GPL-2.0+
+.. SPDX-License-Identifier: GPL-2.0-or-later
+.. sectionauthor:: Marcel Ziswiler 
 
-Colibri iMX8QXP V1.0D Module
-
+Colibri iMX8X Module
+
+
+- SoM: 
https://www.toradex.com/computer-on-modules/colibri-arm-family/nxp-imx-8x
+- Carrier board: 
https://www.toradex.com/products/carrier-board/colibri-evaluation-board
 
 Quick Start
 ---
@@ -23,18 +27,19 @@ Get and Build the ARM Trusted Firmware
 
 Get scfw_tcm.bin and ahab-container.img
 ---
+
 .. code-block:: bash
 
 $ wget 
https://github.com/toradex/i.MX-System-Controller-Firmware/raw/master/src/scfw_export_mx8qx_b0/build_mx8qx_b0/mx8qx-colibri-scfw-tcm.bin
-$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-3.7.4.bin
-$ sh imx-seco-3.7.4.bin --auto-accept
+$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-seco-3.8.1.bin
+$ sh imx-seco-3.8.1.bin --auto-accept
 
 Copy the following firmware to the U-Boot folder:
 
 .. code-block:: bash
 
 $ cp imx-atf/build/imx8qx/release/bl31.bin .
-$ cp imx-seco-3.7.4/firmware/seco/mx8qxc0-ahab-container.img 
mx8qx-ahab-container.img
+$ cp imx-seco-3.8.1/firmware/seco/mx8qxc0-ahab-container.img 
mx8qx-ahab-container.img
 
 Build U-Boot
 
@@ -51,8 +56,8 @@ Get the latest version of the universal update utility (uuu) 
aka ``mfgtools 3.0`
 
 
https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FNXPmicro%2Fmfgtools%2Freleases
 
-Put the module into USB recovery aka serial downloader mode, connect USB device
-to your host and execute ``uuu``:
+Put the module into USB recovery aka serial downloader mode, connect the USB
+device to your host and execute ``uuu``:
 
 .. code-block:: bash
 
@@ -61,7 +66,8 @@ to your host and execute ``uuu``:
 Flash the U-Boot Binary into the eMMC
 -
 
-Burn the ``u-boot-dtb.imx`` binary to the primary eMMC hardware boot area 
partition:
+Burn the ``u-boot-dtb.imx`` binary to the primary eMMC hardware boot area
+partition and boot:
 
 .. code-block:: bash
 
@@ -69,3 +75,10 @@ Burn the ``u-boot-dtb.imx`` binary to the primary eMMC 
hardware boot 

[PATCH v1 0/2] doc: board: toradex: documentation update

2023-08-28 Thread Marcel Ziswiler
From: Marcel Ziswiler 


This series contains some minor documentation updates. The second commit
documents what got discussed here [1] and therefore depends on
Emanuele's series landing first.

[1] https://lore.kernel.org/all/zodsx2vmnf20i...@francesco-nb.int.toradex.com


Marcel Ziswiler (2):
  doc: board: toradex: minor documentation update
  doc: board: toradex: verdin-am62: document update u-boot wrapper

 doc/board/toradex/apalis-imx8.rst   | 22 +
 doc/board/toradex/colibri-imx8x.rst | 31 ---
 doc/board/toradex/colibri_imx7.rst  | 38 +++--
 doc/board/toradex/verdin-am62.rst   | 22 ++---
 doc/board/toradex/verdin-imx8mm.rst |  9 +++
 doc/board/toradex/verdin-imx8mp.rst |  9 +++
 6 files changed, 85 insertions(+), 46 deletions(-)

-- 
2.36.1



Re: [PATCH V5 02/17] include: configs: am62x_evm: Drop unused SDRAM address

2023-08-28 Thread Marcel Ziswiler
On Thu, 2023-08-24 at 18:15 +0200, Francesco Dolcini wrote:

[snip]

> > > > > What about include/configs/verdin-am62.h ?
> > > > > 
> > > > > It seems that that board, which is am62x based, also has the un-needed
> > > > > include.
> > > > > 
> > > > > Since i'm not 100% sure, I have added Marcel (who posted the verdin 
> > > > > am62
> > > > > support) here.
> > > > 
> > > > Toradex team, Can you handle that cleanup? I stayed focussed on 
> > > > am62x_evm side
> > > > of things.
> > > 
> > > Yes, of course.
> > 
> > I believe that this is used on verdin-am62, please double check marcel.
> 
> No, likely I need to go home and not spread incomplete information here ...

(;-p)

We took care of it.

https://lore.kernel.org/all/20230828215037.482278-1-mar...@ziswiler.com

Thanks!

Cheers

Marcel


[PATCH v1] include: configs: verdin-am62: drop unused sdram address

2023-08-28 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Drop unused macro. This was copied straight from the AM62x EVM but while
meant for a second region of DDR this is not even needed for the AM62x
EVM configurations and has meanwhile also been dropped there.

Note that on the Verdin AM62, we do auto-detect the amount of SDRAM.

While at it also update the comment noting that CFG_SYS_SDRAM_SIZE is
the maximum which is only used for such auto-detection.

Signed-off-by: Marcel Ziswiler 

---

 include/configs/verdin-am62.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/configs/verdin-am62.h b/include/configs/verdin-am62.h
index 7990ea83102..e1a5f5ad44b 100644
--- a/include/configs/verdin-am62.h
+++ b/include/configs/verdin-am62.h
@@ -13,8 +13,7 @@
 
 /* DDR Configuration */
 #define CFG_SYS_SDRAM_BASE 0x8000
-#define CFG_SYS_SDRAM_BASE10x88000
-#define CFG_SYS_SDRAM_SIZE SZ_2G /* Maximum supported size */
+#define CFG_SYS_SDRAM_SIZE SZ_2G /* Maximum supported size, auto-detection 
is used */
 
 #define MEM_LAYOUT_ENV_SETTINGS \
"fdt_addr_r=0x9020\0" \
-- 
2.36.1



[PATCH v1] board: toradex: verdin-imx8mp: enable usb device and fastboot support

2023-08-28 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Enable USB device and fastboot support which may be used to load the
Toradex Easy Installer FIT image.

While at it also enable USB mass storage aka UMS support.

Note that the i.MX 8M Plus recovery mode support is based on the USB
boot stage of the BOOTROM and does NOT require USB SDP SPL aka serial
downloader support.

Signed-off-by: Marcel Ziswiler 

---

 configs/verdin-imx8mp_defconfig | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/configs/verdin-imx8mp_defconfig b/configs/verdin-imx8mp_defconfig
index 2df0f4f3443..4c6650c3453 100644
--- a/configs/verdin-imx8mp_defconfig
+++ b/configs/verdin-imx8mp_defconfig
@@ -79,6 +79,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_READ=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_BOOTCOUNT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
@@ -108,6 +109,12 @@ CONFIG_BOOTCOUNT_ENV=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_IMX8MP=y
 CONFIG_FSL_CAAM=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x4280
+CONFIG_FASTBOOT_BUF_SIZE=0x4000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_GPIO_HOG=y
 CONFIG_SPL_GPIO_HOG=y
 CONFIG_MXC_GPIO=y
@@ -138,6 +145,7 @@ CONFIG_DWC_ETH_QOS_IMX=y
 CONFIG_FEC_MXC=y
 CONFIG_RGMII=y
 CONFIG_MII=y
+CONFIG_PHY=y
 CONFIG_PHY_IMX8MQ_USB=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
@@ -160,14 +168,20 @@ CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_TMU=y
 CONFIG_USB=y
+# CONFIG_SPL_DM_USB is not set
+CONFIG_DM_USB_GADGET=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y
 CONFIG_USB_EHCI_HCD=y
-CONFIG_MXC_USB_OTG_HACTIVE=y
+# CONFIG_USB_EHCI_MX7 is not set
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
 CONFIG_IMX_WATCHDOG=y
 CONFIG_HEXDUMP=y
-- 
2.36.1



Re: [PATCH v2 1/3] arm: dts: imx8mm: move firmware/optee node to common imx8mm-u-boot.dtsi

2023-08-26 Thread Marcel Ziswiler
Hi Tim

Thanks!

On Thu, 2023-08-24 at 12:01 -0700, Tim Harvey wrote:
> Move the firmware/optee node to the common imx8mm-u-boot.dtsi and
> protect it with an ifdef CONFIG_OPTEE as it is a meaningless node
> without the optee driver enabled.
> 
> Signed-off-by: Tim Harvey 
> Reviewed-by: Fabio Estevam 

For the entire series.

Reviewed-by: Marcel Ziswiler 

> ---
> v2: added Fabio's rb tag
> ---
>  arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi | 7 ---
>  arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi   | 7 ---
>  arch/arm/dts/imx8mm-evk-u-boot.dtsi   | 7 ---
>  arch/arm/dts/imx8mm-kontron-bl-common-u-boot.dtsi | 7 ---
>  arch/arm/dts/imx8mm-phg-u-boot.dtsi   | 7 ---
>  arch/arm/dts/imx8mm-u-boot.dtsi   | 9 +
>  arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi   | 7 ---
>  7 files changed, 9 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi 
> b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-
> boot.dtsi
> index 484e31824b85..d12ce6069cc7 100644
> --- a/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-cl-iot-gate-optee-u-boot.dtsi
> @@ -6,13 +6,6 @@
>  #include "imx8mm-u-boot.dtsi"
>  
>  / {
> -   firmware {
> -   optee {
> -   compatible = "linaro,optee-tz";
> -   method = "smc";
> -   };
> -   };
> -
> wdt-reboot {
> compatible = "wdt-reboot";
> bootph-pre-ram;
> diff --git a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi 
> b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
> index 1878c4e13fbe..219504f61105 100644
> --- a/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-cl-iot-gate-u-boot.dtsi
> @@ -6,13 +6,6 @@
>  #include "imx8mm-u-boot.dtsi"
>  
>  / {
> -   firmware {
> -   optee {
> -   compatible = "linaro,optee-tz";
> -   method = "smc";
> -   };
> -   };
> -
> wdt-reboot {
> compatible = "wdt-reboot";
> bootph-pre-ram;
> diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi 
> b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
> index 13688ec0d0f2..155670da18d1 100644
> --- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
> @@ -11,13 +11,6 @@
> wdt = <>;
> bootph-pre-ram;
> };
> -
> -   firmware {
> -   optee {
> -   compatible = "linaro,optee-tz";
> -   method = "smc";
> -   };
> -   };
>  };
>  
>   {
> diff --git a/arch/arm/dts/imx8mm-kontron-bl-common-u-boot.dtsi 
> b/arch/arm/dts/imx8mm-kontron-bl-common-u-
> boot.dtsi
> index 65dfd33725ee..1ad9d49a1118 100644
> --- a/arch/arm/dts/imx8mm-kontron-bl-common-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-kontron-bl-common-u-boot.dtsi
> @@ -16,13 +16,6 @@
> wdt = <>;
> bootph-pre-ram;
> };
> -
> -   firmware {
> -   optee {
> -   compatible = "linaro,optee-tz";
> -   method = "smc";
> -   };
> -   };
>  };
>  
>   {
> diff --git a/arch/arm/dts/imx8mm-phg-u-boot.dtsi 
> b/arch/arm/dts/imx8mm-phg-u-boot.dtsi
> index 3ced97cfaafa..c9e0b4420500 100644
> --- a/arch/arm/dts/imx8mm-phg-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-phg-u-boot.dtsi
> @@ -11,13 +11,6 @@
> wdt = <>;
> bootph-pre-ram;
> };
> -
> -   firmware {
> -   optee {
> -   compatible = "linaro,optee-tz";
> -   method = "smc";
> -   };
> -   };
>  };
>  
>   {
> diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
> index 035282bf0b00..a843bb851eaf 100644
> --- a/arch/arm/dts/imx8mm-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-u-boot.dtsi
> @@ -7,6 +7,15 @@
> binman: binman {
> multiple-images;
> };
> +
> +#ifdef CONFIG_OPTEE
> +   firmware {
> +   optee {
> +   compatible = "linaro,optee-tz";
> +   method = "smc";
> +   };
> +   };
> +#endif
>  };
>  
>   {
> diff --git a/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi 
> b/arch/arm/dts/imx8mm-verdin-wifi-dev-u-
> boot.dtsi
> index 2b268f55cb95..24e565a06c2f 100644
> --- a/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi
> @@ -6,13 +6,6 @@
>  #include "imx8mm-u-boot.dtsi"
>  
>  / {
> -   firmware {
> -   optee {
> -   compatible = "linaro,optee-tz";
> -   method = "smc";
> -   };
> -   };
> -
> wdt-reboot {
> compatible = "wdt-reboot";
> bootph-pre-ram;

Cheers

Marcel


Re: [PATCH v2] arm: dts: imx8m: move CAAM nodes into common u-boot.dtsi

2023-08-26 Thread Marcel Ziswiler
Hi Tim

Thanks!

On Thu, 2023-08-24 at 12:03 -0700, Tim Harvey wrote:
> Move the crypto and sec_jr* nodes from board-specific
> u-boot.dtsi files into the common files. Additionally protect the
> nodes with ifdef CONFIG_FSL_CAAM as they don't serve any purpose if
> that is not enabled.
> 
> Signed-off-by: Tim Harvey 

Reviewed-by: Marcel Ziswiler 

> ---
> v2:
>  - fix invalid ifdef
>  - add rb tags from Fabio and Peng
> ---
>  arch/arm/dts/imx8mm-evk-u-boot.dtsi   | 16 ---
>  .../dts/imx8mm-kontron-bl-common-u-boot.dtsi  | 16 ---
>  arch/arm/dts/imx8mm-u-boot.dtsi   | 20 +++
>  arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi  | 16 ---
>  arch/arm/dts/imx8mn-u-boot.dtsi   | 20 +++
>  arch/arm/dts/imx8mp-beacon-kit-u-boot.dtsi    | 16 ---
>  arch/arm/dts/imx8mp-evk-u-boot.dtsi   | 16 ---
>  .../imx8mp-icore-mx8mp-edimm2.2-u-boot.dtsi   | 16 ---
>  arch/arm/dts/imx8mp-u-boot.dtsi   | 20 +++
>  .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    | 16 ---
>  10 files changed, 60 insertions(+), 112 deletions(-)
> 
> diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi 
> b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
> index 155670da18d1..9a5b0795133b 100644
> --- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
> @@ -65,22 +65,6 @@
> bootph-pre-ram;
>  };
>  
> - {
> -   bootph-pre-ram;
> -};
> -
> -_jr0 {
> -   bootph-pre-ram;
> -};
> -
> -_jr1 {
> -   bootph-pre-ram;
> -};
> -
> -_jr2 {
> -   bootph-pre-ram;
> -};
> -
>   {
> bootph-pre-ram;
>  };
> diff --git a/arch/arm/dts/imx8mm-kontron-bl-common-u-boot.dtsi 
> b/arch/arm/dts/imx8mm-kontron-bl-common-u-
> boot.dtsi
> index 1ad9d49a1118..ae542fdcffad 100644
> --- a/arch/arm/dts/imx8mm-kontron-bl-common-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-kontron-bl-common-u-boot.dtsi
> @@ -18,22 +18,6 @@
> };
>  };
>  
> - {
> -   bootph-pre-ram;
> -};
> -
> -_jr0 {
> -   bootph-pre-ram;
> -};
> -
> -_jr1 {
> -   bootph-pre-ram;
> -};
> -
> -_jr2 {
> -   bootph-pre-ram;
> -};
> -
>   {
> bootph-pre-ram;
> bootph-all;
> diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
> index a843bb851eaf..0bd7ad980b66 100644
> --- a/arch/arm/dts/imx8mm-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mm-u-boot.dtsi
> @@ -18,6 +18,12 @@
>  #endif
>  };
>  
> +#ifdef CONFIG_FSL_CAAM
> + {
> +   bootph-pre-ram;
> +};
> +#endif
> +
>   {
> bootph-all;
> bootph-pre-ram;
> @@ -216,6 +222,20 @@
> bootph-pre-ram;
>  };
>  
> +#ifdef CONFIG_FSL_CAAM
> +_jr0 {
> +   bootph-pre-ram;
> +};
> +
> +_jr1 {
> +   bootph-pre-ram;
> +};
> +
> +_jr2 {
> +   bootph-pre-ram;
> +};
> +#endif
> +
>   {
> bootph-all;
> bootph-pre-ram;
> diff --git a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi 
> b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
> index 315714f39848..c31f3dec3de4 100644
> --- a/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-ddr4-evk-u-boot.dtsi
> @@ -57,22 +57,6 @@
> bootph-pre-ram;
>  };
>  
> - {
> -   bootph-pre-ram;
> -};
> -
> -_jr0 {
> -   bootph-pre-ram;
> -};
> -
> -_jr1 {
> -   bootph-pre-ram;
> -};
> -
> -_jr2 {
> -   bootph-pre-ram;
> -};
> -
>   {
> bootph-pre-ram;
>  };
> diff --git a/arch/arm/dts/imx8mn-u-boot.dtsi b/arch/arm/dts/imx8mn-u-boot.dtsi
> index 86c9a6cd67f0..3a9e4c16281e 100644
> --- a/arch/arm/dts/imx8mn-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mn-u-boot.dtsi
> @@ -54,6 +54,12 @@
> /delete-property/ assigned-clock-rates;
>  };
>  
> +#ifdef CONFIG_FSL_CAAM
> + {
> +   bootph-pre-ram;
> +};
> +#endif
> +
>   {
> bootph-pre-ram;
>  };
> @@ -63,6 +69,20 @@
> bootph-all;
>  };
>  
> +#ifdef CONFIG_FSL_CAAM
> +_jr0 {
> +   bootph-pre-ram;
> +};
> +
> +_jr1 {
> +   bootph-pre-ram;
> +};
> +
> +_jr2 {
> +   bootph-pre-ram;
> +};
> +#endif
> +
>   {
> bootph-pre-ram;
>  };
> diff --git a/arch/arm/dts/imx8mp-beacon-kit-u-boot.dtsi 
> b/arch/arm/dts/imx8mp-beacon-kit-u-boot.dtsi
> index c69f7c9c32c0..393fd8ec2e5b 100644
> --- a/arch/arm/dts/imx8mp-beacon-kit-u-boot.dtsi
> +++ b/arch/arm/dts/imx8mp-beacon-kit-u-boot.dtsi
> @@ -21,10 +21,6 @@
> bootph-pre-ram;
>  };
>  
&g

Re: [PATCH v2 3/3] board: toradex: add verdin am62 support

2023-08-25 Thread Marcel Ziswiler
Sali Alexander

On August 25, 2023 6:24:01 PM GMT+02:00, "Sverdlin, Alexander" 
 wrote:
>Hello Marcel,
>
>On Fri, 2023-08-25 at 15:20 +0200, Alexander Sverdlin wrote:
>> > +Build U-Boot for R5
>> > +---
>> > +
>> > +.. code-block:: bash
>> > +
>> > +    $ export ARCH=arm
>> > +    $ export CROSS_COMPILE=arm-none-linux-gnueabihf-
>> > +    $ make verdin-am62_r5_defconfig O=/tmp/r5
>> > +    $ make O=/tmp/r5
>> > +    $ cd ../k3-image-gen
>> > +    $ make SOC=am62x SBL=/tmp/r5/spl/u-boot-spl.bin 
>> > SYSFW_PATH=../ti-linux-firmware/ti-sysfw/ti-fs-firmware-am62x-gp.bin
>> > +    $ cp tiboot3-am62x-gp-evm.bin ../tiboot3.bin
>> > +
>> 
>> the existing K3 platforms have been converted to binman workflow:
>> https://patchwork.ozlabs.org/project/uboot/patch/20230721184446.5821-21-n-fran...@ti.com/
>> 
>> Do you think it makes sense to convert the newly added Verdin board
>> to binman workflow as well?
>
>I'm sorry for the noise, I totally missed the fact this has been fixed and
>accepted already!

Don't worry and enjoy (;-p).

Cheers

Marcel


Re: [PATCH v7 1/2] phy: phy-imx8mq-usb: add vbus regulator support

2023-08-24 Thread Marcel Ziswiler
Hi Tim

Thanks!

On Thu, 2023-07-13 at 11:56 -0700, Tim Harvey wrote:
> Add support for enabling and disabling vbus-supply regulator found
> on several imx8mp boards in the usb3_phy0 and usb3_phy1 nodes.
> 
> Signed-off-by: Tim Harvey 
> Reviewed-by: Adam Ford 
> Reviewed-by: Marek Vasut 

Tested-by: Marcel Ziswiler 

> ---
> v7:
>  - add #ifdef protection around clk_disable error path
> 
> v6:
>  - move changes to clk to separate patch
>  - sort new vars in reverse christmas tree style
> 
> v5:
>  - remove #if CONFIG_IS_ENABLED around struct members
>    (you can not conditionally include if using if (CONFIG_IS_ENABLED(foo)) )
>  - replace clk '#if CONFIG_IS_ENABLED(CLK)' with 'if (CONFIG_IS_ENABLED(CLK))'
> 
> v4:
>  - use regulator_set_enable_if_allowed to handle regulator reference
> counting
>    errors
>  - added Marek's rb tag
> 
> v3:
>  - change pr_err to dev_err
>  - add #if CONFIG_IS_ENABLED around vbus_supply in struct
>  - add fail path to disable clock if regulator enable failed
> 
> v2:
>  - protect ret with __maybe_unused in case CONFIG_CLK and
>    CONFIG_DM_REGULATOR not defined
>  - add error prints on failures
>  - add Adam's rb tag
> Signed-off-by: Tim Harvey 
> ---
>  drivers/phy/phy-imx8mq-usb.c | 39 +---
>  1 file changed, 36 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/phy/phy-imx8mq-usb.c b/drivers/phy/phy-imx8mq-usb.c
> index 69f01de55538..9fa78ef4da3d 100644
> --- a/drivers/phy/phy-imx8mq-usb.c
> +++ b/drivers/phy/phy-imx8mq-usb.c
> @@ -14,6 +14,8 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
>  
>  #define PHY_CTRL0  0x0
>  #define PHY_CTRL0_REF_SSP_EN   BIT(2)
> @@ -81,6 +83,7 @@ struct imx8mq_usb_phy {
>  #endif
> void __iomem *base;
> enum imx8mpq_phy_type type;
> +   struct udevice *vbus_supply;
>  };
>  
>  static const struct udevice_id imx8mq_usb_phy_of_match[] = {
> @@ -173,9 +176,9 @@ static int imx8mq_usb_phy_power_on(struct phy *usb_phy)
> struct udevice *dev = usb_phy->dev;
> struct imx8mq_usb_phy *imx_phy = dev_get_priv(dev);
> u32 value;
> +   int ret;
>  
>  #if CONFIG_IS_ENABLED(CLK)
> -   int ret;
> ret = clk_enable(_phy->phy_clk);
> if (ret) {
> printf("Failed to enable usb phy clock\n");
> @@ -183,12 +186,26 @@ static int imx8mq_usb_phy_power_on(struct phy *usb_phy)
> }
>  #endif
>  
> +   if (CONFIG_IS_ENABLED(DM_REGULATOR) && imx_phy->vbus_supply) {
> +   ret = regulator_set_enable_if_allowed(imx_phy->vbus_supply, 
> true);
> +   if (ret && ret != -ENOSYS) {
> +   dev_err(dev, "Failed to enable VBUS regulator: %d\n", 
> ret);
> +   goto err;
> +   }
> +   }
> +
> /* Disable rx term override */
> value = readl(imx_phy->base + PHY_CTRL6);
> value &= ~PHY_CTRL6_RXTERM_OVERRIDE_SEL;
> writel(value, imx_phy->base + PHY_CTRL6);
>  
> return 0;
> +
> +err:
> +#if CONFIG_IS_ENABLED(CLK)
> +   clk_disable(_phy->phy_clk);
> +#endif
> +   return ret;
>  }
>  
>  static int imx8mq_usb_phy_power_off(struct phy *usb_phy)
> @@ -196,6 +213,7 @@ static int imx8mq_usb_phy_power_off(struct phy *usb_phy)
> struct udevice *dev = usb_phy->dev;
> struct imx8mq_usb_phy *imx_phy = dev_get_priv(dev);
> u32 value;
> +   int ret;
>  
> /* Override rx term to be 0 */
> value = readl(imx_phy->base + PHY_CTRL6);
> @@ -206,6 +224,14 @@ static int imx8mq_usb_phy_power_off(struct phy *usb_phy)
> clk_disable(_phy->phy_clk);
>  #endif
>  
> +   if (CONFIG_IS_ENABLED(DM_REGULATOR) && imx_phy->vbus_supply) {
> +   ret = regulator_set_enable_if_allowed(imx_phy->vbus_supply, 
> false);
> +   if (ret && ret != -ENOSYS) {
> +   dev_err(dev, "Failed to disable VBUS regulator: 
> %d\n", ret);
> +   return ret;
> +   }
> +   }
> +
> return 0;
>  }
>  
> @@ -224,6 +250,7 @@ struct phy_ops imx8mq_usb_phy_ops = {
>  int imx8mq_usb_phy_probe(struct udevice *dev)
>  {
> struct imx8mq_usb_phy *priv = dev_get_priv(dev);
> +   int ret;
>  
> priv->type = dev_get_driver_data(dev);
> priv->base = dev_read_addr_ptr(dev);
> @@ -232,8 +259,6 @@ int imx8mq_usb_phy_probe(struct udevice *dev)
> return -EINVAL;

Re: [PATCH V5 02/17] include: configs: am62x_evm: Drop unused SDRAM address

2023-08-24 Thread Marcel Ziswiler
On Thu, 2023-08-24 at 07:05 -0500, Nishanth Menon wrote:
> On 10:13-20230824, Mattijs Korpershoek wrote:
> > Hi Nishanth,
> > 
> > On mer., août 23, 2023 at 22:10, Nishanth Menon  wrote:
> > 
> > > Drop unused macro. This was meant for a second region of DDR which we
> > > do not need for AM62x evm configurations.
> > > 
> > > Signed-off-by: Nishanth Menon 
> > > ---
> > > New patch (part of bootstd transition)
> > > 
> > >  include/configs/am62x_evm.h | 3 ---
> > >  1 file changed, 3 deletions(-)
> > 
> > What about include/configs/verdin-am62.h ?
> > 
> > It seems that that board, which is am62x based, also has the un-needed
> > include.
> > 
> > Since i'm not 100% sure, I have added Marcel (who posted the verdin am62
> > support) here.
> 
> Toradex team, Can you handle that cleanup? I stayed focussed on am62x_evm side
> of things.

Yes, of course.

> > > diff --git a/include/configs/am62x_evm.h b/include/configs/am62x_evm.h
> > > index 44180dc7687b..379e0c13a395 100644
> > > --- a/include/configs/am62x_evm.h
> > > +++ b/include/configs/am62x_evm.h
> > > @@ -12,9 +12,6 @@
> > >  #include 
> > >  #include 
> > >  
> > > -/* DDR Configuration */
> > > -#define CFG_SYS_SDRAM_BASE10x88000
> > > -
> > >  /* Now for the remaining common defines */
> > >  #include 
> > >  
> > > -- 
> > > 2.40.0


[PATCH v1] board: toradex: verdin-imx8mm: enable usb sdp spl recovery support

2023-08-22 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Enable USB SDP SPL aka serial downloader recovery mode support.

While at it also enable fastboot support which may be used to
subsequently load further stages like a Toradex Easy Installer FIT
image.

Signed-off-by: Marcel Ziswiler 

---

 .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi| 17 
 configs/verdin-imx8mm_defconfig   | 20 +++
 2 files changed, 37 insertions(+)

diff --git a/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi 
b/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi
index 2b268f55cb9..b06ce3fa034 100644
--- a/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi
@@ -34,6 +34,10 @@
bootph-pre-ram;
 };
 
+ {
+   bootph-pre-ram;
+};
+
 _uboot {
offset = <0x5fc00>;
 };
@@ -124,6 +128,19 @@
bootph-pre-ram;
 };
 
+ {
+   bootph-pre-ram;
+};
+
+/* Verdin USB_1 */
+ {
+   bootph-pre-ram;
+};
+
+ {
+   bootph-pre-ram;
+};
+
  {
bootph-pre-ram;
 };
diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index 09e14c6f8c4..2fbde394577 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -69,6 +69,8 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_READ=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_BOOTCOUNT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
@@ -97,6 +99,12 @@ CONFIG_SPL_CLK_COMPOSITE_CCF=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_SPL_CLK_IMX8MM=y
 CONFIG_CLK_IMX8MM=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x4280
+CONFIG_FASTBOOT_BUF_SIZE=0x4000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_GPIO_HOG=y
 CONFIG_SPL_GPIO_HOG=y
 CONFIG_MXC_GPIO=y
@@ -120,6 +128,8 @@ CONFIG_PHY_FIXED=y
 CONFIG_DM_MDIO=y
 CONFIG_FEC_MXC=y
 CONFIG_MII=y
+CONFIG_SPL_PHY=y
+CONFIG_SPL_NOP_PHY=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
@@ -139,8 +149,18 @@ CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_TMU=y
 CONFIG_USB=y
+CONFIG_SPL_USB_HOST=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_MXC_USB_OTG_HACTIVE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_GADGET=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Toradex"
+CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
+CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
+CONFIG_CI_UDC=y
+CONFIG_SDP_LOADADDR=0x4040
+CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_IMX_WATCHDOG=y
 CONFIG_HEXDUMP=y
-- 
2.36.1



Re: [PATCH v2 0/8] Add DFU, emmc and usb boot for TI am62x

2023-08-21 Thread Marcel Ziswiler
Hi Sjoerd

On Thu, 2023-06-01 at 08:37 +0200, Sjoerd Simons wrote:
> On Wed, 2023-05-31 at 17:14 -0400, Tom Rini wrote:
> > On Thu, Apr 06, 2023 at 08:55:34PM +0200, Sjoerd Simons wrote:
> > 
> > > This series adds more boot sources for the TI am62x. For that the
> > > dts'
> > > are synced from the upstream ti-next git tree (to add usb nodes),
> > > some
> > > dwc3 glue is and finally the default configuration is tuned to add
> > > support for DFU and USB (host and gadget)
> > 
> > This seems, conceptually, fine.  But as we're getting the TI dts
> > files
> > in sync with the kernel, I'm deferring this version and you'll want
> > to
> > rebase and re-post once everything has settled.
> 
> Thanks for the update/hint ;) I also got a few review comments so the
> plan is to include those and repost.. Just my may has been stupidly
> busy causing me to not get around it in the first place, so maybe that
> turned into good timing in the end.

Any progress on this?

I still carry your re-based series on top of latest master [1] and USB DFU is 
working very well on Verdin AM62.

Thanks!

[1] https://github.com/ziswiler/u-boot/tree/verdin-am62-usb-support

Cheers

Marcel


[PATCH v1] doc: board: toradex: fix verdin module output

2023-08-06 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Fix the Verdin module output which was missing white space for correct
rendering.

While at it also leave product links, add section author also for the
Verdin iMX8M Mini and Plus, and add a missing CROSS_COMPILE export for
the Verdin iMX8M Mini.

Signed-off-by: Marcel Ziswiler 

---
- Add missing white space to output for correct rendering.
- Also leave product links.
Thanks to Nishanth for suggesting those.
- Add section author also for the Verdin iMX8M Mini and Plus.
- Add a missing CROSS_COMPILE export for the Verdin iMX8M Mini

 doc/board/toradex/verdin-am62.rst   | 111 ++--
 doc/board/toradex/verdin-imx8mm.rst |  61 ---
 doc/board/toradex/verdin-imx8mp.rst |  70 +-
 3 files changed, 127 insertions(+), 115 deletions(-)

diff --git a/doc/board/toradex/verdin-am62.rst 
b/doc/board/toradex/verdin-am62.rst
index ac0e86b3001..36db149cda0 100644
--- a/doc/board/toradex/verdin-am62.rst
+++ b/doc/board/toradex/verdin-am62.rst
@@ -4,6 +4,9 @@
 Verdin AM62 Module
 ==
 
+- SoM: https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62
+- Carrier board: 
https://www.toradex.com/products/carrier-board/verdin-development-board-kit
+
 Quick Start
 ---
 
@@ -74,57 +77,57 @@ Boot
 
 Output:
 
-.. code-block:: bash
-
-U-Boot SPL 2023.10-rc1-00210-gb678170a34c (Aug 03 2023 - 00:09:14 +0200)
-SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.1--v09.00.01 (Kool Koala)')
-SPL initial stack usage: 13368 bytes
-Trying to boot from MMC1
-Authentication passed
-Authentication passed
-Authentication passed
-Authentication passed
-Authentication passed
-Starting ATF on ARM64 core...
-
-NOTICE:  BL31: v2.9(release):v2.9.0-73-g463655cc8
-NOTICE:  BL31: Built : 14:51:42, Jun  5 2023
-I/TC:
-I/TC: OP-TEE version: 3.21.0-168-g322cf9e33 (gcc version 12.2.1 20221205 (Arm 
GNU Toolchain 12.2.Rel1 (Build arm-12.24))) #2 Mon Jun  5 13:04:15 UTC 2023 
aarch64
-I/TC: WARNING: This OP-TEE configuration might be insecure!
-I/TC: WARNING: Please check 
https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
-I/TC: Primary CPU initializing
-I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.1--v09.00.01 (Kool Koala)')
-I/TC: HUK Initialized
-I/TC: Primary CPU switching to normal world boot
-
-U-Boot SPL 2023.10-rc1-00210-gb678170a34c (Aug 03 2023 - 00:09:41 +0200)
-SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.1--v09.00.01 (Kool Koala)')
-SPL initial stack usage: 1840 bytes
-Trying to boot from MMC1
-Authentication passed
-Authentication passed
-
-
-U-Boot 2023.10-rc1-00210-gb678170a34c (Aug 03 2023 - 00:09:41 +0200)
-
-SoC:   AM62X SR1.0 HS-FS
-DRAM:  2 GiB
-Core:  136 devices, 28 uclasses, devicetree: separate
-MMC:   mmc@fa1: 0, mmc@fa0: 1
-Loading Environment from MMC... OK
-In:serial@280
-Out:   serial@280
-Err:   serial@280
-Model: Toradex 0076 Verdin AM62 Quad 2GB WB IT V1.0A
-Serial#: 15037380
-Carrier: Toradex Verdin Development Board V1.1A, Serial# 10754333
-am65_cpsw_nuss ethernet@800: K3 CPSW: nuss_ver: 0x6BA01103 cpsw_ver: 
0x6BA81103 ale_ver: 0x00290105 Ports:2 mdio_freq:100
-Setting variant to wifi
-Net:
-Warning: ethernet@800port@1 MAC addresses don't match:
-Address in ROM is  1c:63:49:22:5f:f9
-Address in environment is  00:14:2d:e5:73:c4
-eth0: ethernet@800port@1 [PRIME], eth1: ethernet@800port@2
-Hit any key to stop autoboot:  0
-Verdin AM62 #
+.. code-block:: none
+
+  U-Boot SPL 2023.10-rc1-00210-gb678170a34c (Aug 03 2023 - 00:09:14 +0200)
+  SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.1--v09.00.01 (Kool Koala)')
+  SPL initial stack usage: 13368 bytes
+  Trying to boot from MMC1
+  Authentication passed
+  Authentication passed
+  Authentication passed
+  Authentication passed
+  Authentication passed
+  Starting ATF on ARM64 core...
+
+  NOTICE:  BL31: v2.9(release):v2.9.0-73-g463655cc8
+  NOTICE:  BL31: Built : 14:51:42, Jun  5 2023
+  I/TC:
+  I/TC: OP-TEE version: 3.21.0-168-g322cf9e33 (gcc version 12.2.1 20221205 
(Arm GNU Toolchain 12.2.Rel1 (Build arm-12.24))) #2 Mon Jun  5 13:04:15 UTC 
2023 aarch64
+  I/TC: WARNING: This OP-TEE configuration might be insecure!
+  I/TC: WARNING: Please check 
https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
+  I/TC: Primary CPU initializing
+  I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.1--v09.00.01 (Kool Koala)')
+  I/TC: HUK Initialized
+  I/TC: Primary CPU switching to normal world boot
+
+  U-Boot SPL 2023.10-rc1-00210-gb678170a34c (Aug 03 2023 - 00:09:41 +0200)
+  SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.1--v09.00.01 (Kool Koala)')
+  SPL initial stack usage: 1840 bytes
+  Trying to boot from MMC1
+  Authentication passed
+  Authentication passed
+
+
+  U-Boot 2023.10-rc1-00210-gb678170a34c (Aug 03 2023 - 00:09:41 +0200)
+
+  SoC:   AM62X SR1.0 HS-FS
+  DRAM:  2 GiB
+  Core:  136 devices, 28 uclasses, devicetree: separate
+  MMC:   mmc@fa1: 0, mmc@fa0: 1
+  Loading

Re: [PATCH v4 0/3] board: toradex: add verdin am62 support

2023-08-06 Thread Marcel Ziswiler
Sorry about that. Looks like patman somehow choose you. I will add a rule to no 
longer do that. Thanks!

On August 6, 2023 12:58:29 PM GMT+02:00, "Pali Rohár"  wrote:
>I'm not responsible for k3, so do not send me these emails.
>
>On Friday 28 July 2023 22:54:53 Marcel Ziswiler wrote:
>> From: Marcel Ziswiler 
>> 
>> 
>> This series adds initial support for the Toradex Verdin AM62 SoM [1].
>> The first commit adds resp. PID4s to the ConfigBlock, the second one
>> fixes an early clocking issue confirmed to be a weird bug in TI's
>> scripting. And last but not least support for the Toradex Verdin AM62
>> is added.
>> 
>> [1] https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62
>> 
>> Changes in v4:
>> - Re-based on top of master with recent binman integration, mac_efuse,
>>   cpsw-phy-sel and mdio clean-up and dtsi bump from linux v6.5-rc1.
>> - Verdin AM62 binman enablement and further clean-up after re-base.
>> - Removed all ifdefs from DTs now with bumped Linux dtsi.
>> - Avoid relocated U-Boot and DT reserved-memory clash.
>> - Enable of_system_setup.
>> 
>> Changes in v3:
>> - Add Verdin AM62 launch configuration SKUs as well.
>> - Integrate our recent find of CTRL_SLEEP_MOCI# needing to be driven
>>   from A53 SPL as it may be used to control some power-rails on the
>>   carrier board. E.g. on the Yavia carrier board it is needed to power
>>   the I2C EEPROM on the carrier board.
>> - Improve boot environment in R5 SPL vs. A53.
>> - Integrate launch configuration SKUs to Wi-Fi handling.
>> - Re-sync device trees from Linux kernel v6.5-rc1.
>> - Add warning if memory is less than expected.
>> 
>> Changes in v2:
>> - Add Bryan's reviewed-by tag. Thanks!
>> - Use 1.2 GHz rather than 1.25 GHz A53 clock as on the EVM/SK.
>> - Also add power-domain 166 as on the EVM/SK.
>> - Get rid of main_bcdma and main_pktdma as not required in R5 SPL.
>> - Get rid of all bootph-pre-ram in Ethernet and SDHC1 aka SD card
>>   related pinctrls as not required in any SPL.
>> - Enable CONFIG_TI_SECURE_DEVICE by default as Non-HS devices will
>>   continue to boot due to runtime device type detection.
>> - Disable FAT and SPI support as not required in R5 SPL.
>> - Also enable CONFIG_SPL_MMC_HS200_SUPPORT in R5 SPL.
>> - Enable CONFIG_LEGACY_IMAGE_FORMAT to allow sourcing unsigned script
>>   images e.g. like our current boot scripts.
>> - Increase CONFIG_SYS_BOOTM_LEN to 64 MB to allow booting bigger
>>   compressed images as e.g. in the Toradex Easy Installer case.
>> - Change memory configurations to operate at temperatures of up to 95
>>   degrees celsius.
>> - Increase CONFIG_SYS_MAXARGS from default 16 to 64.
>> - Enable CONFIG_CMD_REMOTEPROC, CONFIG_SPL_DM_GPIO_LOOKUP_LABEL and
>>   CONFIG_SPL_I2C_EEPROM.
>> - For R5 SPL increase CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN to 0x14,
>>   enable CONFIG_SPL_I2C, CONFIG_DM_I2C and CONFIG_SYS_I2C_OMAP24XX and
>>   savedefconfig got rid of CONFIG_SPL_FIT_IMAGE_POST_PROCESS.
>> 
>> Marcel Ziswiler (3):
>>   toradex: tdx-cfg-block: add verdin am62 skus
>>   arm: mach-k3: am62: fix 2nd mux option of clkout0
>>   board: toradex: add verdin am62 support
>> 
>>  arch/arm/dts/Makefile |4 +-
>>  arch/arm/dts/k3-am62-verdin-dev.dtsi  |  192 ++
>>  arch/arm/dts/k3-am62-verdin-wifi.dtsi |   39 +
>>  arch/arm/dts/k3-am62-verdin.dtsi  | 1405 +++
>>  .../dts/k3-am625-verdin-lpddr4-1600MTs.dtsi   | 2190 +
>>  arch/arm/dts/k3-am625-verdin-r5.dts   |  116 +
>>  .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  |  570 +
>>  .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  201 ++
>>  arch/arm/dts/k3-am625-verdin-wifi-dev.dts |   22 +
>>  arch/arm/mach-k3/Kconfig  |1 +
>>  arch/arm/mach-k3/am62x/clk-data.c |5 +-
>>  board/toradex/common/tdx-cfg-block.c  |7 +
>>  board/toradex/common/tdx-cfg-block.h  |   10 +-
>>  board/toradex/verdin-am62/Kconfig |   82 +
>>  board/toradex/verdin-am62/MAINTAINERS |   17 +
>>  board/toradex/verdin-am62/Makefile|6 +
>>  board/toradex/verdin-am62/board-cfg.yaml  |   36 +
>>  board/toradex/verdin-am62/pm-cfg.yaml |   12 +
>>  board/toradex/verdin-am62/rm-cfg.yaml | 1088 
>>  board/toradex/verdin-am62/sec-cfg.yaml|  379 +++
>>  board/toradex/verdin-am62/verdin-am62.c   |  131 +
>>  configs/verdin-am62_a53_defconfig |  1

Re: [PATCH v6 4/4] board: toradex: add verdin am62 support

2023-08-04 Thread Marcel Ziswiler



On August 4, 2023 8:43:13 PM GMT+02:00, Nishanth Menon  wrote:
>On 14:35-20230804, Tom Rini wrote:
>[..]
>> > > +Output:
>> > > +
>> > > +.. code-block:: bash
>> [snip]
>> > I think you missed adding white space here.
>> > 
>> > It renders as this: 
>> > https://usercontent.irccloud-cdn.com/file/625Dsdcq/image.png
>> 
>> This is how all of the verdin boot logs render, and are all wrong.  It
>> should instead be:
>> 
>> Output::
>> 
>>   U-Boot SPL 2023.10-rc1-00210-gb678170a34c (Aug 03 2023 - 00:09:14 +0200)
>>   ...
>> 
>> And I think we can take both of these as a follow-up patch that Heinrich
>> will take and pass along before v2023.10 is out.
>
>yup, I am good with that (Marcel, I assume you will send a follow on
>fix up patch). Thanks.
>
>-- 
>Regards,
>Nishanth Menon
>Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 
>849D 1736 249D

Yes, don't worry and thanks for all the valuable feedback.

Cheers

Marcel


Re: [PATCH v6 4/4] board: toradex: add verdin am62 support

2023-08-04 Thread Marcel Ziswiler
Hi Nishanth

On Fri, 2023-08-04 at 05:50 -0500, Nishanth Menon wrote:
> On 12:08-20230804, Marcel Ziswiler wrote:
> > From: Marcel Ziswiler 
> > 
> > This adds initial support for the Toradex Verdin AM62 Quad 1GB WB IT
> > V1.0A module and subsequent V1.1 launch configuration SKUs. They are
> > strapped to boot from their on-module eMMC. U-Boot supports booting
> > from the on-module eMMC only, DFU support is disabled for now due to
> > missing AM62x USB support.
> > 
> > The device trees were taken straight from Linux v6.5-rc1.
> > 
> > Boot sequence is:
> > SYSFW ---> R5 SPL (both in tiboot3.bin) ---> ATF (TF-A) ---> OP-TEE
> >   ---> A53 SPL (part of tispl.bin) ---> U-boot proper (u-boot.img)
> > 
> > Signed-off-by: Marcel Ziswiler 
> > 
> 
> it looks like this patch is stuck in the mail-size quarantine.

Yeah, I guess not much I may do about it. However, just to be on the safe side 
I did CC it to Tom directly
individually just to make sure he has it (;-p).

Cheers

Marcel


[PATCH v6 0/4] board: toradex: add verdin am62 support

2023-08-04 Thread Marcel Ziswiler
From: Marcel Ziswiler 


This series adds initial support for the Toradex Verdin AM62 SoM [1].
The first commit adds resp. PID4s to the ConfigBlock, the second one
fixes an early clocking issue confirmed to be a weird bug in TI's
scripting, the third one fixes some binman labeling issue. And last but
not least support for the Toradex Verdin AM62 is added.

Azure CI still running [2]. Thanks!

[1] https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62
[2] https://dev.azure.com/u-boot/u-boot/_build/results?buildId=6804=results

Changes in v6:
- New commit fixing rcfg_yaml and pcfg_yaml labels actually pointing
  at correct yamls and adding labels for the remaining items.
- Instead of duplicating the whole binman configuration just use
  phandles to override relevant properties where feasible.
- Fix indentation in include/configs/verdin-am62.h.
Thanks to Neha for pointing me towards actually making use of those
labels.
- Also remove some spurious newlines from our binman configuration file.

Changes in v5:
- Fix doc/board/toradex/verdin-am62.rst title underline being too short.
- Add verdin-am62 to doc/board/toradex/index.rst.
Thanks to Emanuele having run this series on the azure CI to find out.
- Update U-Boot output in doc/board/toradex/verdin-am62.rst to latest.
- State that the device trees were taken straight from Linux v6.5-rc1.
- Remove k3-am625-verdin-wifi-dev-binman.dtsi include from r5 dts.
- Remove memory@ and reserved-memory nodes.
- Simplify sa_secproxy and esm nodes.
- Get rid of ifdef zeros around usb stuff in device trees.
- Re-work doc/board/toradex/verdin-am62.rst in a more re-usable way.
Thanks to Nishanth for pointing those differences out as compared to
arch/arm/dts/k3-am625-r5-sk.dts and his suggestions on the rst stuff.

Changes in v4:
- Re-based on top of master with recent binman integration, mac_efuse,
  cpsw-phy-sel and mdio clean-up and dtsi bump from linux v6.5-rc1.
- Verdin AM62 binman enablement and further clean-up after re-base.
- Removed all ifdefs from DTs now with bumped Linux dtsi.
- Avoid relocated U-Boot and DT reserved-memory clash.
- Enable of_system_setup.

Changes in v3:
- Add Verdin AM62 launch configuration SKUs as well.
- Integrate our recent find of CTRL_SLEEP_MOCI# needing to be driven
  from A53 SPL as it may be used to control some power-rails on the
  carrier board. E.g. on the Yavia carrier board it is needed to power
  the I2C EEPROM on the carrier board.
- Improve boot environment in R5 SPL vs. A53.
- Integrate launch configuration SKUs to Wi-Fi handling.
- Re-sync device trees from Linux kernel v6.5-rc1.
- Add warning if memory is less than expected.

Changes in v2:
- Add Bryan's reviewed-by tag. Thanks!
- Use 1.2 GHz rather than 1.25 GHz A53 clock as on the EVM/SK.
- Also add power-domain 166 as on the EVM/SK.
- Get rid of main_bcdma and main_pktdma as not required in R5 SPL.
- Get rid of all bootph-pre-ram in Ethernet and SDHC1 aka SD card
  related pinctrls as not required in any SPL.
- Enable CONFIG_TI_SECURE_DEVICE by default as Non-HS devices will
  continue to boot due to runtime device type detection.
- Disable FAT and SPI support as not required in R5 SPL.
- Also enable CONFIG_SPL_MMC_HS200_SUPPORT in R5 SPL.
- Enable CONFIG_LEGACY_IMAGE_FORMAT to allow sourcing unsigned script
  images e.g. like our current boot scripts.
- Increase CONFIG_SYS_BOOTM_LEN to 64 MB to allow booting bigger
  compressed images as e.g. in the Toradex Easy Installer case.
- Change memory configurations to operate at temperatures of up to 95
  degrees celsius.
- Increase CONFIG_SYS_MAXARGS from default 16 to 64.
- Enable CONFIG_CMD_REMOTEPROC, CONFIG_SPL_DM_GPIO_LOOKUP_LABEL and
  CONFIG_SPL_I2C_EEPROM.
- For R5 SPL increase CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN to 0x14,
  enable CONFIG_SPL_I2C, CONFIG_DM_I2C and CONFIG_SYS_I2C_OMAP24XX and
  savedefconfig got rid of CONFIG_SPL_FIT_IMAGE_POST_PROCESS.

Marcel Ziswiler (4):
  toradex: tdx-cfg-block: add verdin am62 skus
  arm: mach-k3: am62: fix 2nd mux option of clkout0
  arm: dts: k3-binman: fix rcfg_yaml and pcfg_yaml labels
  board: toradex: add verdin am62 support

 arch/arm/dts/Makefile |4 +-
 arch/arm/dts/k3-am62-verdin-dev.dtsi  |  190 ++
 arch/arm/dts/k3-am62-verdin-wifi.dtsi |   39 +
 arch/arm/dts/k3-am62-verdin.dtsi  | 1401 +++
 .../dts/k3-am625-verdin-lpddr4-1600MTs.dtsi   | 2190 +
 arch/arm/dts/k3-am625-verdin-r5.dts   |   84 +
 .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  |  532 
 .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  201 ++
 arch/arm/dts/k3-am625-verdin-wifi-dev.dts |   22 +
 arch/arm/dts/k3-binman.dtsi   |   16 +-
 arch/arm/mach-k3/Kconfig  |1 +
 arch/arm/mach-k3/am62x/clk-data.c |5 +-
 board/toradex/common/tdx-cfg-block.c  |7 +
 board/toradex/common/tdx-cfg-block.h  |   10 +-
 board/toradex/verdin-am62

[PATCH v6 3/4] arm: dts: k3-binman: fix rcfg_yaml and pcfg_yaml labels

2023-08-04 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Fix rcfg_yaml to really point to rm-cfg.yaml and pcfg_yaml to really
point to pm-cfg.yaml which likely is the intention.

While at it also add labels for the remaining items like custmpk_pem,
dkey_pem, bcfg_yaml_sysfw, scfg_yaml_sysfw, pcfg_yaml_sysfw and
rcfg_yaml_sysfw.

Signed-off-by: Marcel Ziswiler 

---

Changes in v6:
- New commit fixing rcfg_yaml and pcfg_yaml labels actually pointing
  at correct yamls and adding labels for the remaining items.
Thanks to Neha for pointing me towards actually making use of those
labels.

 arch/arm/dts/k3-binman.dtsi | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm/dts/k3-binman.dtsi b/arch/arm/dts/k3-binman.dtsi
index 2a67cebf94f..2ea2dd18a12 100644
--- a/arch/arm/dts/k3-binman.dtsi
+++ b/arch/arm/dts/k3-binman.dtsi
@@ -12,14 +12,14 @@
  {
custMpk {
filename = "custMpk.pem";
-   blob-ext {
+   custmpk_pem: blob-ext {
filename = "../keys/custMpk.pem";
};
};
 
ti-degenerate-key {
filename = "ti-degenerate-key.pem";
-   blob-ext {
+   dkey_pem: blob-ext {
filename = "../keys/ti-degenerate-key.pem";
};
};
@@ -37,14 +37,14 @@
};
pm-cfg {
filename = "pm-cfg.bin";
-   rcfg_yaml: ti-board-config {
+   pcfg_yaml: ti-board-config {
config = "pm-cfg.yaml";
schema = "../common/schema.yaml";
};
};
rm-cfg {
filename = "rm-cfg.bin";
-   pcfg_yaml: ti-board-config {
+   rcfg_yaml: ti-board-config {
config = "rm-cfg.yaml";
schema = "../common/schema.yaml";
};
@@ -93,19 +93,19 @@
combined-sysfw-cfg {
filename = "combined-sysfw-cfg.bin";
ti-board-config {
-   board-cfg {
+   bcfg_yaml_sysfw: board-cfg {
config = "board-cfg.yaml";
schema = "../common/schema.yaml";
};
-   sec-cfg {
+   scfg_yaml_sysfw: sec-cfg {
config = "sec-cfg.yaml";
schema = "../common/schema.yaml";
};
-   pm-cfg {
+   pcfg_yaml_sysfw: pm-cfg {
config = "pm-cfg.yaml";
schema = "../common/schema.yaml";
};
-   rm-cfg {
+   rcfg_yaml_sysfw: rm-cfg {
config = "rm-cfg.yaml";
schema = "../common/schema.yaml";
};
-- 
2.36.1



[PATCH v6 2/4] arm: mach-k3: am62: fix 2nd mux option of clkout0

2023-08-04 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Fix second mux option of clkout0 which should really be
DEV_BOARD0_CLKOUT0_IN_PARENT_HSDIV4_16FFT_MAIN_2_HSDIVOUT1_CLK10
rather than twice the same according to [1].

[1] 
https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am62x/clocks.html#clocks-for-board0-device

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Bryan Brattlof 

---

(no changes since v2)

Changes in v2:
- Add Bryan's reviewed-by tag. Thanks!

 arch/arm/mach-k3/am62x/clk-data.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/am62x/clk-data.c 
b/arch/arm/mach-k3/am62x/clk-data.c
index c0881778fe7..d7bfed0e031 100644
--- a/arch/arm/mach-k3/am62x/clk-data.c
+++ b/arch/arm/mach-k3/am62x/clk-data.c
@@ -57,7 +57,7 @@ static const char * const 
sam62_pll_ctrl_wrap_mcu_0_sysclkout_clk_parents[] = {
 
 static const char * const clkout0_ctrl_out0_parents[] = {
"hsdiv4_16fft_main_2_hsdivout1_clk",
-   "hsdiv4_16fft_main_2_hsdivout1_clk",
+   "hsdiv4_16fft_main_2_hsdivout1_clk10",
 };
 
 static const char * const clk_32k_rc_sel_out0_parents[] = {
@@ -195,6 +195,7 @@ static const struct clk_data clk_list[] = {
CLK_DIV("hsdiv4_16fft_main_1_hsdivout1_clk", 
"pllfracf_ssmod_16fft_main_1_foutvcop_clk", 0x681084, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_main_1_hsdivout2_clk", 
"pllfracf_ssmod_16fft_main_1_foutvcop_clk", 0x681088, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_main_2_hsdivout1_clk", 
"pllfracf_ssmod_16fft_main_2_foutvcop_clk", 0x682084, 0, 7, 0, 0),
+   CLK_DIV("hsdiv4_16fft_main_2_hsdivout1_clk10", 
"pllfracf_ssmod_16fft_main_2_foutvcop_clk", 0x682084, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_main_2_hsdivout2_clk", 
"pllfracf_ssmod_16fft_main_2_foutvcop_clk", 0x682088, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_mcu_0_hsdivout0_clk", 
"pllfracf_ssmod_16fft_mcu_0_foutvcop_clk", 0x4040080, 0, 7, 0, 0),
CLK_MUX_PLLCTRL("sam62_pll_ctrl_wrap_main_0_sysclkout_clk", 
sam62_pll_ctrl_wrap_main_0_sysclkout_clk_parents, 2, 0x41, 0),
@@ -313,7 +314,7 @@ static const struct dev_clk soc_dev_clk_data[] = {
DEV_CLK(146, 5, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
DEV_CLK(157, 20, "clkout0_ctrl_out0"),
DEV_CLK(157, 21, "hsdiv4_16fft_main_2_hsdivout1_clk"),
-   DEV_CLK(157, 22, "hsdiv4_16fft_main_2_hsdivout1_clk"),
+   DEV_CLK(157, 22, "hsdiv4_16fft_main_2_hsdivout1_clk10"),
DEV_CLK(157, 24, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
DEV_CLK(157, 25, "board_0_ddr0_ck0_out"),
DEV_CLK(157, 40, "mshsi2c_main_0_porscl"),
-- 
2.36.1



[PATCH v6 1/4] toradex: tdx-cfg-block: add verdin am62 skus

2023-08-04 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Add initial Verdin AM62 Quad 1GB WB IT prototype and launch
configuration SKUs to ConfigBlock handling.

0069: Verdin AM62 Quad 1GB WB IT
0071: Verdin AM62 Solo 512MB
0072: Verdin AM62 Solo 512MB WB IT
0073: Verdin AM62 Dual 1GB ET
0074: Verdin AM62 Dual 1GB IT
0075: Verdin AM62 Dual 1GB WB IT
0076: Verdin AM62 Quad 2GB WB IT

Signed-off-by: Marcel Ziswiler 
Signed-off-by: Emanuele Ghidoli 

---

(no changes since v3)

Changes in v3:
- Add Verdin AM62 launch configuration SKUs as well.

 board/toradex/common/tdx-cfg-block.c |  7 +++
 board/toradex/common/tdx-cfg-block.h | 10 --
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/board/toradex/common/tdx-cfg-block.c 
b/board/toradex/common/tdx-cfg-block.c
index e513f4a2919..8ad4907bfe4 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -139,7 +139,14 @@ const struct toradex_som toradex_modules[] = {
[66] = { "Verdin iMX8M Plus Quad 8GB WB",
TARGET_IS_ENABLED(VERDIN_IMX8MP)   },
[67] = { "Apalis iMX8QM 8GB WB IT",  
TARGET_IS_ENABLED(APALIS_IMX8) },
[68] = { "Verdin iMX8M Mini Quad 2GB WB IT", 
TARGET_IS_ENABLED(VERDIN_IMX8MM)   },
+   [69] = { "Verdin AM62 Quad 1GB WB IT",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
[70] = { "Verdin iMX8M Plus Quad 8GB WB IT", 
TARGET_IS_ENABLED(VERDIN_IMX8MP)   },
+   [71] = { "Verdin AM62 Solo 512MB",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [72] = { "Verdin AM62 Solo 512MB WB IT", 
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [73] = { "Verdin AM62 Dual 1GB ET",  
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [74] = { "Verdin AM62 Dual 1GB IT",  
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [75] = { "Verdin AM62 Dual 1GB WB IT",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [76] = { "Verdin AM62 Quad 2GB WB IT",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
 };
 
 const char * const toradex_carrier_boards[] = {
diff --git a/board/toradex/common/tdx-cfg-block.h 
b/board/toradex/common/tdx-cfg-block.h
index 45fa04ca38a..5c204931a2d 100644
--- a/board/toradex/common/tdx-cfg-block.h
+++ b/board/toradex/common/tdx-cfg-block.h
@@ -94,8 +94,14 @@ enum {
VERDIN_IMX8MPQ_8GB_WIFI_BT,
APALIS_IMX8QM_8GB_WIFI_BT_IT,
VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN,
-   /* 69 */
-   VERDIN_IMX8MPQ_8GB_WIFI_BT_IT = 70, /* 70 */
+   VERDIN_AM62Q_WIFI_BT_IT,
+   VERDIN_IMX8MPQ_8GB_WIFI_BT_IT, /* 70 */
+   VERDIN_AM62S_512MB,
+   VERDIN_AM62S_512MB_WIFI_BT_IT,
+   VERDIN_AM62D_1G_ET,
+   VERDIN_AM62D_1G_IT,
+   VERDIN_AM62D_1G_WIFI_BT_IT, /* 75 */
+   VERDIN_AM62Q_2G_WIFI_BT_IT,
 };
 
 enum {
-- 
2.36.1



Re: [PATCH v5 3/3] board: toradex: add verdin am62 support

2023-08-04 Thread Marcel Ziswiler
Hi Neha

On Fri, 2023-08-04 at 12:04 +0530, Neha Malcom Francis wrote:
> Hi Marcel
> 
> Repeating my comments from v4, as I missed seeing this version.
> 
> On 03/08/23 19:30, Marcel Ziswiler wrote:
> > From: Marcel Ziswiler 
> > 
> > This adds initial support for the Toradex Verdin AM62 Quad 1GB WB IT
> > V1.0A module and subsequent V1.1 launch configuration SKUs. They are
> > strapped to boot from their on-module eMMC. U-Boot supports booting
> > from the on-module eMMC only, DFU support is disabled for now due to
> > missing AM62x USB support.
> > 
> > The device trees were taken straight from Linux v6.5-rc1.
> > 
> > Boot sequence is:
> > SYSFW ---> R5 SPL (both in tiboot3.bin) ---> ATF (TF-A) ---> OP-TEE
> >    ---> A53 SPL (part of tispl.bin) ---> U-boot proper (u-boot.img)
> > 
> > Signed-off-by: Marcel Ziswiler 
> > 
> > ---
> > 
> 
> [...]
> 
> > +   /* We require this for boot handshake */
> > +   status = "okay";
> > +};
> > diff --git a/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi 
> > b/arch/arm/dts/k3-am625-verdin-wifi-dev-
> > binman.dtsi
> > new file mode 100644
> > index 000..e8c926f48b9
> > --- /dev/null
> > +++ b/arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
> > @@ -0,0 +1,570 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
> > +/*
> > + * Copyright 2023 Toradex
> > + */
> > +
> > +#include "k3-binman.dtsi"
> > +
> > + {
> > +   custMpk {
> > +   filename = "custMpk.pem";
> > +   blob-ext {
> > +   filename = "../../ti/keys/custMpk.pem";
> > +   };
> > +   };
> > +
> > +   ti-degenerate-key {
> > +   filename = "ti-degenerate-key.pem";
> > +   blob-ext {
> > +   filename = "../../ti/keys/ti-degenerate-key.pem";
> > +   };
> > +   };
> > +};
> > +
> > +#ifndef CONFIG_ARM64
> > +
> > + {
> > +   board-cfg {
> > +   filename = "board-cfg.bin";
> > +   bcfg_yaml: ti-board-config {
> > +   config = "board-cfg.yaml";
> > +   schema = "../../ti/common/schema.yaml";
> > +   };
> > +   };
> > +   pm-cfg {
> > +   filename = "pm-cfg.bin";
> > +   rcfg_yaml: ti-board-config {
> > +   config = "pm-cfg.yaml";
> > +   schema = "../../ti/common/schema.yaml";
> > +   };
> > +   };
> > +   rm-cfg {
> > +   filename = "rm-cfg.bin";
> > +   pcfg_yaml: ti-board-config {
> > +   config = "rm-cfg.yaml";
> > +   schema = "../../ti/common/schema.yaml";
> > +   };
> > +   };
> > +   sec-cfg {
> > +   filename = "sec-cfg.bin";
> > +   scfg_yaml: ti-board-config {
> > +   config = "sec-cfg.yaml";
> > +   schema = "../../ti/common/schema.yaml";
> > +   };
> > +   };
> > +   combined-tifs-cfg {
> > +   filename = "combined-tifs-cfg.bin";
> > +   ti-board-config {
> > +   bcfg_yaml_tifs: board-cfg {
> > +   config = "board-cfg.yaml";
> > +   schema = "../../ti/common/schema.yaml";
> > +   };
> > +   scfg_yaml_tifs: sec-cfg {
> > +   config = "sec-cfg.yaml";
> > +   schema = "../../ti/common/schema.yaml";
> > +   };
> > +   pcfg_yaml_tifs: pm-cfg {
> > +   config = "pm-cfg.yaml";
> > +   schema = "../../ti/common/schema.yaml";
> > +   };
> > +   rcfg_yaml_tifs: rm-cfg {
> > +   config = "rm-cfg.yaml";
> > +   schema = "../../ti/common/schema.yaml";
> > +   };
> > +  

Re: [PATCH v5 3/3] board: toradex: add verdin am62 support

2023-08-04 Thread Marcel Ziswiler
On Fri, 2023-08-04 at 10:15 +0200, Francesco Dolcini wrote:
> On Fri, Aug 04, 2023 at 08:12:36AM +0000, Marcel Ziswiler wrote:
> > Hi Neha
> > 
> > On Fri, 2023-08-04 at 13:35 +0530, Neha Malcom Francis wrote:
> > > Hi Francesco
> > > 
> > > On 04/08/23 13:24, Francesco Dolcini wrote:
> > > > On Fri, Aug 04, 2023 at 12:04:59PM +0530, Neha Malcom Francis wrote:
> > > > > On 03/08/23 19:30, Marcel Ziswiler wrote:
> > > > > > +   combined-sysfw-cfg {
> > > > > > +   filename = "combined-sysfw-cfg.bin";
> > > > > > +   ti-board-config {
> > > > > > +   board-cfg {
> > > > > > +   config = "board-cfg.yaml";
> > > > > > +   schema = 
> > > > > > "../../ti/common/schema.yaml";
> > > > > > +   };
> > > > > > +   sec-cfg {
> > > > > > +   config = "sec-cfg.yaml";
> > > > > > +   schema = 
> > > > > > "../../ti/common/schema.yaml";
> > > > > > +   };
> > > > > > +   pm-cfg {
> > > > > > +   config = "pm-cfg.yaml";
> > > > > > +   schema = 
> > > > > > "../../ti/common/schema.yaml";
> > > > > > +   };
> > > > > > +   rm-cfg {
> > > > > > +   config = "rm-cfg.yaml";
> > > > > > +   schema = 
> > > > > > "../../ti/common/schema.yaml";
> > > > > > +   };
> > > > > > +   };
> > > > > > +   };
> > > > > > +};
> > > > > > +
> > > > > 
> > > > > ^ If you are already including k3-binman.dtsi, why are you redefining 
> > > > > these?
> > > > 
> > > > We want/need out own `config`. Any other solution apart of this one?
> > > > 
> > > 
> > > Ah I see, how about using the cfg phandle to replace it with your own? 
> > > See 
> > > example in arch/arm/dts/k3-j7200-binman.dtsi
> > 
> > Yes, I missed that. Let me do it that way and post a v6.
> 
> Will it work? in k3-binman.dtsi the schema is referenced with such
> relative path: `schema = "../common/schema.yaml";` there.
> 
> There is an assumption of this being used from board/ti/$boardname if I
> understand it correctly.

Yes, but we can still override only that with labels rather than duplicating 
the whole thing. I am cleaning it
up that minute...


Re: [PATCH v5 3/3] board: toradex: add verdin am62 support

2023-08-04 Thread Marcel Ziswiler
Hi Neha

On Fri, 2023-08-04 at 13:35 +0530, Neha Malcom Francis wrote:
> Hi Francesco
> 
> On 04/08/23 13:24, Francesco Dolcini wrote:
> > On Fri, Aug 04, 2023 at 12:04:59PM +0530, Neha Malcom Francis wrote:
> > > On 03/08/23 19:30, Marcel Ziswiler wrote:
> > > > +   combined-sysfw-cfg {
> > > > +   filename = "combined-sysfw-cfg.bin";
> > > > +   ti-board-config {
> > > > +   board-cfg {
> > > > +   config = "board-cfg.yaml";
> > > > +   schema = "../../ti/common/schema.yaml";
> > > > +   };
> > > > +   sec-cfg {
> > > > +   config = "sec-cfg.yaml";
> > > > +   schema = "../../ti/common/schema.yaml";
> > > > +   };
> > > > +   pm-cfg {
> > > > +   config = "pm-cfg.yaml";
> > > > +   schema = "../../ti/common/schema.yaml";
> > > > +   };
> > > > +   rm-cfg {
> > > > +   config = "rm-cfg.yaml";
> > > > +   schema = "../../ti/common/schema.yaml";
> > > > +   };
> > > > +   };
> > > > +   };
> > > > +};
> > > > +
> > > 
> > > ^ If you are already including k3-binman.dtsi, why are you redefining 
> > > these?
> > 
> > We want/need out own `config`. Any other solution apart of this one?
> > 
> 
> Ah I see, how about using the cfg phandle to replace it with your own? See 
> example in arch/arm/dts/k3-j7200-binman.dtsi

Yes, I missed that. Let me do it that way and post a v6.

Thanks!

> > Francesco

Cheers

Marcel


Re: [PATCH v4 3/3] board: toradex: add verdin am62 support

2023-08-03 Thread Marcel Ziswiler
Hi Nishanth

On Wed, 2023-08-02 at 17:54 -0500, Nishanth Menon wrote:
> On 22:54-20230728, Marcel Ziswiler wrote:
> > From: Marcel Ziswiler 
> [...]
> 
> > diff --git a/doc/board/toradex/verdin-am62.rst 
> > b/doc/board/toradex/verdin-am62.rst
> > new file mode 100644
> > index 000..2ece3757a41
> > --- /dev/null
> > +++ b/doc/board/toradex/verdin-am62.rst
> > @@ -0,0 +1,169 @@
> > +.. SPDX-License-Identifier: GPL-2.0-or-later
> > +.. sectionauthor:: Marcel Ziswiler 
> > +
> > +Verdin AM62 Module
> > +==
> > +
> > +Quick Start
> > +---
> > +
> > +- Get the binary-only SYSFW
> > +- Get binary-only TI Linux firmware
> > +- Build the ARM trusted firmware binary
> > +- Build the OPTEE binary
> > +- Build U-Boot for the R5
> > +- Build U-Boot for the A53
> > +- Flash to eMMC
> > +- Boot
> > +
> > +For an overview of the TI AM62 SoC boot flow please head over to:
> > +.. file:: ../ti/am62x_sk.rst
> > +
> > +Get the SYSFW
> > +-
> > +
> > +.. code-block:: bash
> > +
> > +    $ echo "Downloading SYSFW..."
> > +    $ git clone git://git.ti.com/k3-image-gen/k3-image-gen.git
> 
> we dont need k3-image-gen anymore..

Yes, true.

> > +
> > +Get the TI Linux Firmware
> > +-
> 
>  Umm..
>  
> https://u-boot.readthedocs.io/en/latest/build/documentation.html?highlight=htmldocs#html-documentation
>  make htmldocs:
>  u-boot/doc/board/toradex/verdin-am62.rst:31:Title underline too short.

Yes, Emanuele already spotted that trying to run Azure CI earlier today.

> If you like, please consider the following diff to your changes - as I
> had setup am62x doc to be a bit re-usable to help keep things sane and
> central:

Cool, thanks. I applied this, run Azure CI on it [1] and sent a v5 [2].

Thanks again!

> diff --git a/doc/board/ti/am62x_sk.rst b/doc/board/ti/am62x_sk.rst
> index 637985cb096e..4646bc0f5257 100644
> --- a/doc/board/ti/am62x_sk.rst
> +++ b/doc/board/ti/am62x_sk.rst
> @@ -54,7 +54,7 @@ Below is the pictorial representation of boot flow:
>  Sources:
>  
>  
> -.. include::  k3.rst
> +.. include::  ../ti/k3.rst
>  :start-after: .. k3_rst_include_start_boot_sources
>  :end-before: .. k3_rst_include_end_boot_sources
>  
> @@ -62,17 +62,17 @@ Build procedure:
>  
>  0. Setup the environment variables:
>  
> -.. include::  k3.rst
> +.. include::  ../ti/k3.rst
>  :start-after: .. k3_rst_include_start_common_env_vars_desc
>  :end-before: .. k3_rst_include_end_common_env_vars_desc
>  
> -.. include::  k3.rst
> +.. include::  ../ti/k3.rst
>  :start-after: .. k3_rst_include_start_board_env_vars_desc
>  :end-before: .. k3_rst_include_end_board_env_vars_desc
>  
>  Set the variables corresponding to this platform:
>  
> -.. include::  k3.rst
> +.. include::  ../ti/k3.rst
>  :start-after: .. k3_rst_include_start_common_env_vars_defn
>  :end-before: .. k3_rst_include_end_common_env_vars_defn
>  .. code-block:: bash
> @@ -89,14 +89,14 @@ Set the variables corresponding to this platform:
>  
>  1. Trusted Firmware-A:
>  
> -.. include::  k3.rst
> +.. include::  ../ti/k3.rst
>  :start-after: .. k3_rst_include_start_build_steps_tfa
>  :end-before: .. k3_rst_include_end_build_steps_tfa
>  
>  
>  2. OP-TEE:
>  
> -.. include::  k3.rst
> +.. include::  ../ti/k3.rst
>  :start-after: .. k3_rst_include_start_build_steps_optee
>  :end-before: .. k3_rst_include_end_build_steps_optee
>  
> @@ -104,13 +104,13 @@ Set the variables corresponding to this platform:
>  
>  * 4.1 R5:
>  
> -.. include::  k3.rst
> +.. include::  ../ti/k3.rst
>  :start-after: .. k3_rst_include_start_build_steps_spl_r5
>  :end-before: .. k3_rst_include_end_build_steps_spl_r5
>  
>  * 4.2 A53:
>  
> -.. include::  k3.rst
> +.. include::  ../ti/k3.rst
>  :start-after: .. k3_rst_include_start_build_steps_uboot
>  :end-before: .. k3_rst_include_end_build_steps_uboot
>  .. am62x_evm_rst_include_end_build_steps
> diff --git a/doc/board/ti/k3.rst b/doc/board/ti/k3.rst
> index 74fdc6b41c9b..02cfd9316883 100644
> --- a/doc/board/ti/k3.rst
> +++ b/doc/board/ti/k3.rst
> @@ -31,6 +31,7 @@ K3 Based SoCs
>     :maxdepth: 1
>  
>     am62x_sk
> +   ../toradex/verdin-am62
>     am64x_evm
>     am65x_evm
>     j7200_evm
> diff --git a/doc/board/toradex/index.rst b/doc/board/toradex/index.rst
> index ead5efbb9551..7728b9db6629 100644
> --- a/doc/board/toradex/index.rst
> +++ b/doc/board/toradex/index.rst
> @@ -11

[PATCH v5 0/3] board: toradex: add verdin am62 support

2023-08-03 Thread Marcel Ziswiler
From: Marcel Ziswiler 


This series adds initial support for the Toradex Verdin AM62 SoM [1].
The first commit adds resp. PID4s to the ConfigBlock, the second one
fixes an early clocking issue confirmed to be a weird bug in TI's
scripting. And last but not least support for the Toradex Verdin AM62
is added.

Azure CI all passed [2]. Thanks!

[1] https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62
[2] https://dev.azure.com/u-boot/u-boot/_build/results?buildId=6792=results

Changes in v5:
- Fix doc/board/toradex/verdin-am62.rst title underline being too short.
- Add verdin-am62 to doc/board/toradex/index.rst.
Thanks to Emanuele having run this series on the azure CI to find out.
- Update U-Boot output in doc/board/toradex/verdin-am62.rst to latest.
- State that the device trees were taken straight from Linux v6.5-rc1.
- Remove k3-am625-verdin-wifi-dev-binman.dtsi include from r5 dts.
- Remove memory@ and reserved-memory nodes.
- Simplify sa_secproxy and esm nodes.
- Get rid of ifdef zeros around usb stuff in device trees.
- Re-work doc/board/toradex/verdin-am62.rst in a more re-usable way.
Thanks to Nishanth for pointing those differences out as compared to
arch/arm/dts/k3-am625-r5-sk.dts and his suggestions on the rst stuff.

Changes in v4:
- Re-based on top of master with recent binman integration, mac_efuse,
  cpsw-phy-sel and mdio clean-up and dtsi bump from linux v6.5-rc1.
- Verdin AM62 binman enablement and further clean-up after re-base.
- Removed all ifdefs from DTs now with bumped Linux dtsi.
- Avoid relocated U-Boot and DT reserved-memory clash.
- Enable of_system_setup.

Changes in v3:
- Add Verdin AM62 launch configuration SKUs as well.
- Integrate our recent find of CTRL_SLEEP_MOCI# needing to be driven
  from A53 SPL as it may be used to control some power-rails on the
  carrier board. E.g. on the Yavia carrier board it is needed to power
  the I2C EEPROM on the carrier board.
- Improve boot environment in R5 SPL vs. A53.
- Integrate launch configuration SKUs to Wi-Fi handling.
- Re-sync device trees from Linux kernel v6.5-rc1.
- Add warning if memory is less than expected.

Changes in v2:
- Add Bryan's reviewed-by tag. Thanks!
- Use 1.2 GHz rather than 1.25 GHz A53 clock as on the EVM/SK.
- Also add power-domain 166 as on the EVM/SK.
- Get rid of main_bcdma and main_pktdma as not required in R5 SPL.
- Get rid of all bootph-pre-ram in Ethernet and SDHC1 aka SD card
  related pinctrls as not required in any SPL.
- Enable CONFIG_TI_SECURE_DEVICE by default as Non-HS devices will
  continue to boot due to runtime device type detection.
- Disable FAT and SPI support as not required in R5 SPL.
- Also enable CONFIG_SPL_MMC_HS200_SUPPORT in R5 SPL.
- Enable CONFIG_LEGACY_IMAGE_FORMAT to allow sourcing unsigned script
  images e.g. like our current boot scripts.
- Increase CONFIG_SYS_BOOTM_LEN to 64 MB to allow booting bigger
  compressed images as e.g. in the Toradex Easy Installer case.
- Change memory configurations to operate at temperatures of up to 95
  degrees celsius.
- Increase CONFIG_SYS_MAXARGS from default 16 to 64.
- Enable CONFIG_CMD_REMOTEPROC, CONFIG_SPL_DM_GPIO_LOOKUP_LABEL and
  CONFIG_SPL_I2C_EEPROM.
- For R5 SPL increase CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN to 0x14,
  enable CONFIG_SPL_I2C, CONFIG_DM_I2C and CONFIG_SYS_I2C_OMAP24XX and
  savedefconfig got rid of CONFIG_SPL_FIT_IMAGE_POST_PROCESS.

Marcel Ziswiler (3):
  toradex: tdx-cfg-block: add verdin am62 skus
  arm: mach-k3: am62: fix 2nd mux option of clkout0
  board: toradex: add verdin am62 support

 arch/arm/dts/Makefile |4 +-
 arch/arm/dts/k3-am62-verdin-dev.dtsi  |  190 ++
 arch/arm/dts/k3-am62-verdin-wifi.dtsi |   39 +
 arch/arm/dts/k3-am62-verdin.dtsi  | 1401 +++
 .../dts/k3-am625-verdin-lpddr4-1600MTs.dtsi   | 2190 +
 arch/arm/dts/k3-am625-verdin-r5.dts   |   84 +
 .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  |  570 +
 .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  201 ++
 arch/arm/dts/k3-am625-verdin-wifi-dev.dts |   22 +
 arch/arm/mach-k3/Kconfig  |1 +
 arch/arm/mach-k3/am62x/clk-data.c |5 +-
 board/toradex/common/tdx-cfg-block.c  |7 +
 board/toradex/common/tdx-cfg-block.h  |   10 +-
 board/toradex/verdin-am62/Kconfig |   82 +
 board/toradex/verdin-am62/MAINTAINERS |   17 +
 board/toradex/verdin-am62/Makefile|6 +
 board/toradex/verdin-am62/board-cfg.yaml  |   36 +
 board/toradex/verdin-am62/pm-cfg.yaml |   12 +
 board/toradex/verdin-am62/rm-cfg.yaml | 1088 
 board/toradex/verdin-am62/sec-cfg.yaml|  379 +++
 board/toradex/verdin-am62/verdin-am62.c   |  131 +
 configs/verdin-am62_a53_defconfig |  187 ++
 configs/verdin-am62_r5_defconfig  |  111 +
 doc/board/ti/am62x_sk.rst |   16 +-
 doc/board/ti/k3.rst

[PATCH v5 2/3] arm: mach-k3: am62: fix 2nd mux option of clkout0

2023-08-03 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Fix second mux option of clkout0 which should really be
DEV_BOARD0_CLKOUT0_IN_PARENT_HSDIV4_16FFT_MAIN_2_HSDIVOUT1_CLK10
rather than twice the same according to [1].

[1] 
https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am62x/clocks.html#clocks-for-board0-device

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Bryan Brattlof 

---

(no changes since v2)

Changes in v2:
- Add Bryan's reviewed-by tag. Thanks!

 arch/arm/mach-k3/am62x/clk-data.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/am62x/clk-data.c 
b/arch/arm/mach-k3/am62x/clk-data.c
index c0881778fe7..d7bfed0e031 100644
--- a/arch/arm/mach-k3/am62x/clk-data.c
+++ b/arch/arm/mach-k3/am62x/clk-data.c
@@ -57,7 +57,7 @@ static const char * const 
sam62_pll_ctrl_wrap_mcu_0_sysclkout_clk_parents[] = {
 
 static const char * const clkout0_ctrl_out0_parents[] = {
"hsdiv4_16fft_main_2_hsdivout1_clk",
-   "hsdiv4_16fft_main_2_hsdivout1_clk",
+   "hsdiv4_16fft_main_2_hsdivout1_clk10",
 };
 
 static const char * const clk_32k_rc_sel_out0_parents[] = {
@@ -195,6 +195,7 @@ static const struct clk_data clk_list[] = {
CLK_DIV("hsdiv4_16fft_main_1_hsdivout1_clk", 
"pllfracf_ssmod_16fft_main_1_foutvcop_clk", 0x681084, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_main_1_hsdivout2_clk", 
"pllfracf_ssmod_16fft_main_1_foutvcop_clk", 0x681088, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_main_2_hsdivout1_clk", 
"pllfracf_ssmod_16fft_main_2_foutvcop_clk", 0x682084, 0, 7, 0, 0),
+   CLK_DIV("hsdiv4_16fft_main_2_hsdivout1_clk10", 
"pllfracf_ssmod_16fft_main_2_foutvcop_clk", 0x682084, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_main_2_hsdivout2_clk", 
"pllfracf_ssmod_16fft_main_2_foutvcop_clk", 0x682088, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_mcu_0_hsdivout0_clk", 
"pllfracf_ssmod_16fft_mcu_0_foutvcop_clk", 0x4040080, 0, 7, 0, 0),
CLK_MUX_PLLCTRL("sam62_pll_ctrl_wrap_main_0_sysclkout_clk", 
sam62_pll_ctrl_wrap_main_0_sysclkout_clk_parents, 2, 0x41, 0),
@@ -313,7 +314,7 @@ static const struct dev_clk soc_dev_clk_data[] = {
DEV_CLK(146, 5, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
DEV_CLK(157, 20, "clkout0_ctrl_out0"),
DEV_CLK(157, 21, "hsdiv4_16fft_main_2_hsdivout1_clk"),
-   DEV_CLK(157, 22, "hsdiv4_16fft_main_2_hsdivout1_clk"),
+   DEV_CLK(157, 22, "hsdiv4_16fft_main_2_hsdivout1_clk10"),
DEV_CLK(157, 24, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
DEV_CLK(157, 25, "board_0_ddr0_ck0_out"),
DEV_CLK(157, 40, "mshsi2c_main_0_porscl"),
-- 
2.36.1



[PATCH v5 1/3] toradex: tdx-cfg-block: add verdin am62 skus

2023-08-03 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Add initial Verdin AM62 Quad 1GB WB IT prototype and launch
configuration SKUs to ConfigBlock handling.

0069: Verdin AM62 Quad 1GB WB IT
0071: Verdin AM62 Solo 512MB
0072: Verdin AM62 Solo 512MB WB IT
0073: Verdin AM62 Dual 1GB ET
0074: Verdin AM62 Dual 1GB IT
0075: Verdin AM62 Dual 1GB WB IT
0076: Verdin AM62 Quad 2GB WB IT

Signed-off-by: Marcel Ziswiler 
Signed-off-by: Emanuele Ghidoli 

---

(no changes since v3)

Changes in v3:
- Add Verdin AM62 launch configuration SKUs as well.

 board/toradex/common/tdx-cfg-block.c |  7 +++
 board/toradex/common/tdx-cfg-block.h | 10 --
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/board/toradex/common/tdx-cfg-block.c 
b/board/toradex/common/tdx-cfg-block.c
index e513f4a2919..8ad4907bfe4 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -139,7 +139,14 @@ const struct toradex_som toradex_modules[] = {
[66] = { "Verdin iMX8M Plus Quad 8GB WB",
TARGET_IS_ENABLED(VERDIN_IMX8MP)   },
[67] = { "Apalis iMX8QM 8GB WB IT",  
TARGET_IS_ENABLED(APALIS_IMX8) },
[68] = { "Verdin iMX8M Mini Quad 2GB WB IT", 
TARGET_IS_ENABLED(VERDIN_IMX8MM)   },
+   [69] = { "Verdin AM62 Quad 1GB WB IT",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
[70] = { "Verdin iMX8M Plus Quad 8GB WB IT", 
TARGET_IS_ENABLED(VERDIN_IMX8MP)   },
+   [71] = { "Verdin AM62 Solo 512MB",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [72] = { "Verdin AM62 Solo 512MB WB IT", 
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [73] = { "Verdin AM62 Dual 1GB ET",  
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [74] = { "Verdin AM62 Dual 1GB IT",  
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [75] = { "Verdin AM62 Dual 1GB WB IT",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [76] = { "Verdin AM62 Quad 2GB WB IT",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
 };
 
 const char * const toradex_carrier_boards[] = {
diff --git a/board/toradex/common/tdx-cfg-block.h 
b/board/toradex/common/tdx-cfg-block.h
index 45fa04ca38a..5c204931a2d 100644
--- a/board/toradex/common/tdx-cfg-block.h
+++ b/board/toradex/common/tdx-cfg-block.h
@@ -94,8 +94,14 @@ enum {
VERDIN_IMX8MPQ_8GB_WIFI_BT,
APALIS_IMX8QM_8GB_WIFI_BT_IT,
VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN,
-   /* 69 */
-   VERDIN_IMX8MPQ_8GB_WIFI_BT_IT = 70, /* 70 */
+   VERDIN_AM62Q_WIFI_BT_IT,
+   VERDIN_IMX8MPQ_8GB_WIFI_BT_IT, /* 70 */
+   VERDIN_AM62S_512MB,
+   VERDIN_AM62S_512MB_WIFI_BT_IT,
+   VERDIN_AM62D_1G_ET,
+   VERDIN_AM62D_1G_IT,
+   VERDIN_AM62D_1G_WIFI_BT_IT, /* 75 */
+   VERDIN_AM62Q_2G_WIFI_BT_IT,
 };
 
 enum {
-- 
2.36.1



Re: [PATCH v4 3/3] board: toradex: add verdin am62 support

2023-08-03 Thread Marcel Ziswiler
Hi Nishanth

On Wed, 2023-08-02 at 17:29 -0500, Nishanth Menon wrote:
> On 22:54-20230728, Marcel Ziswiler wrote:
> > From: Marcel Ziswiler 
> > 
> > This adds initial support for the Toradex Verdin AM62 Quad 1GB WB IT
> > V1.0A module and subsequent V1.1 launch configuration SKUs. They are
> > strapped to boot from their on-module eMMC. U-Boot supports booting
> > from the on-module eMMC only, DFU support is disabled for now due to
> > missing AM62x USB support.
> > 
> > Boot sequence is:
> > SYSFW ---> R5 SPL (both in tiboot3.bin) ---> ATF (TF-A) ---> OP-TEE
> >   ---> A53 SPL (part of tispl.bin) ---> U-boot proper (u-boot.img)
> 
> Please state the dts is from v6.5-rc1 - this is to ensure we can track
> over time the updates needed - typically we want to get to a place where
> we can update in one shot to stay in sync.

I did, but only in the change log. Let me add it to the commit message as well.

> just a side note: we might want to see how to get those eeproms merged
> in for kernel (we'd really like to get rid of u-boot.dtsi)

Yes, one may dream...

> Also drop  #include "k3-am625-verdin-wifi-dev-binman.dtsi" from r5.dts
> (you already get it from u-boot.dtsi)

Okay.


> you also dont need the memory@, reserved-memory sa_secproxy, esm etc in
> r5.dts - please see am62-r5-sk.dts to see how it is done. all of these
> are now inherited from SoC.dtsi or board.dts.. (yaay - your r5.dts is
> going to be much tinier once you clean that up)..

I guess I missed that recent change. Thanks!

> > Signed-off-by: Marcel Ziswiler 
> > 
> > ---
> > 
> 
> [...]
> 
> Marcel, copying the files from v6.5-rc1, I see the following deltas
> 
> we try to migrate the dts files as is.. so trying to understand the
> #if 0 here. Just disabling the driver in defconfig should get the
> feature out, correct?
> 
> I suspect some debuggy stuff creeped in perhaps?

No, USB support is not there yet and this used to fail. I actually still do 
have a series on top adding USB
support and dropped those there, but yeah, now with the synced stuff I may drop 
those here already. Thanks!

> diff --git a/arch/arm/dts/k3-am62-verdin-dev.dtsi 
> b/arch/arm/dts/k3-am62-verdin-dev.dtsi
> index e5443cd3c2d3..846caee7dfa4 100644
> --- a/arch/arm/dts/k3-am62-verdin-dev.dtsi
> +++ b/arch/arm/dts/k3-am62-verdin-dev.dtsi
> @@ -160,7 +160,6 @@
> status = "okay";
>  };
>  
> -#if 0
>  /* Verdin USB_1 */
>   {
> status = "okay";
> @@ -178,7 +177,6 @@
>   {
> status = "okay";
>  };
> -#endif
>  
>  /* Verdin CTRL_WAKE1_MICO# */
>  _gpio_keys {
> diff --git a/arch/arm/dts/k3-am62-verdin.dtsi 
> b/arch/arm/dts/k3-am62-verdin.dtsi
> index 9f626c869725..57dd061911ab 100644
> --- a/arch/arm/dts/k3-am62-verdin.dtsi
> +++ b/arch/arm/dts/k3-am62-verdin.dtsi
> @@ -36,10 +36,8 @@
> serial2 = _uart0;
> serial3 = _uart0;
> serial4 = _uart5;
> -#if 0
> usb0 = 
> usb1 = 
> -#endif
> };
>  
> verdin_gpio_keys: gpio-keys {
> @@ -1369,7 +1367,6 @@
> status = "disabled";
>  };
>  
> -#if 0
>  /* Verdin USB_1 */
>   {
> ti,vbus-divider;
> @@ -1395,7 +1392,6 @@
> dr_mode = "host";
> status = "disabled";
>  };
> -#endif
>  
>  /* Verdin UART_2 */
>  _uart0 {

Cheers

Marcel


[PATCH v4 0/3] board: toradex: add verdin am62 support

2023-07-28 Thread Marcel Ziswiler
From: Marcel Ziswiler 


This series adds initial support for the Toradex Verdin AM62 SoM [1].
The first commit adds resp. PID4s to the ConfigBlock, the second one
fixes an early clocking issue confirmed to be a weird bug in TI's
scripting. And last but not least support for the Toradex Verdin AM62
is added.

[1] https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62

Changes in v4:
- Re-based on top of master with recent binman integration, mac_efuse,
  cpsw-phy-sel and mdio clean-up and dtsi bump from linux v6.5-rc1.
- Verdin AM62 binman enablement and further clean-up after re-base.
- Removed all ifdefs from DTs now with bumped Linux dtsi.
- Avoid relocated U-Boot and DT reserved-memory clash.
- Enable of_system_setup.

Changes in v3:
- Add Verdin AM62 launch configuration SKUs as well.
- Integrate our recent find of CTRL_SLEEP_MOCI# needing to be driven
  from A53 SPL as it may be used to control some power-rails on the
  carrier board. E.g. on the Yavia carrier board it is needed to power
  the I2C EEPROM on the carrier board.
- Improve boot environment in R5 SPL vs. A53.
- Integrate launch configuration SKUs to Wi-Fi handling.
- Re-sync device trees from Linux kernel v6.5-rc1.
- Add warning if memory is less than expected.

Changes in v2:
- Add Bryan's reviewed-by tag. Thanks!
- Use 1.2 GHz rather than 1.25 GHz A53 clock as on the EVM/SK.
- Also add power-domain 166 as on the EVM/SK.
- Get rid of main_bcdma and main_pktdma as not required in R5 SPL.
- Get rid of all bootph-pre-ram in Ethernet and SDHC1 aka SD card
  related pinctrls as not required in any SPL.
- Enable CONFIG_TI_SECURE_DEVICE by default as Non-HS devices will
  continue to boot due to runtime device type detection.
- Disable FAT and SPI support as not required in R5 SPL.
- Also enable CONFIG_SPL_MMC_HS200_SUPPORT in R5 SPL.
- Enable CONFIG_LEGACY_IMAGE_FORMAT to allow sourcing unsigned script
  images e.g. like our current boot scripts.
- Increase CONFIG_SYS_BOOTM_LEN to 64 MB to allow booting bigger
  compressed images as e.g. in the Toradex Easy Installer case.
- Change memory configurations to operate at temperatures of up to 95
  degrees celsius.
- Increase CONFIG_SYS_MAXARGS from default 16 to 64.
- Enable CONFIG_CMD_REMOTEPROC, CONFIG_SPL_DM_GPIO_LOOKUP_LABEL and
  CONFIG_SPL_I2C_EEPROM.
- For R5 SPL increase CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN to 0x14,
  enable CONFIG_SPL_I2C, CONFIG_DM_I2C and CONFIG_SYS_I2C_OMAP24XX and
  savedefconfig got rid of CONFIG_SPL_FIT_IMAGE_POST_PROCESS.

Marcel Ziswiler (3):
  toradex: tdx-cfg-block: add verdin am62 skus
  arm: mach-k3: am62: fix 2nd mux option of clkout0
  board: toradex: add verdin am62 support

 arch/arm/dts/Makefile |4 +-
 arch/arm/dts/k3-am62-verdin-dev.dtsi  |  192 ++
 arch/arm/dts/k3-am62-verdin-wifi.dtsi |   39 +
 arch/arm/dts/k3-am62-verdin.dtsi  | 1405 +++
 .../dts/k3-am625-verdin-lpddr4-1600MTs.dtsi   | 2190 +
 arch/arm/dts/k3-am625-verdin-r5.dts   |  116 +
 .../dts/k3-am625-verdin-wifi-dev-binman.dtsi  |  570 +
 .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  201 ++
 arch/arm/dts/k3-am625-verdin-wifi-dev.dts |   22 +
 arch/arm/mach-k3/Kconfig  |1 +
 arch/arm/mach-k3/am62x/clk-data.c |5 +-
 board/toradex/common/tdx-cfg-block.c  |7 +
 board/toradex/common/tdx-cfg-block.h  |   10 +-
 board/toradex/verdin-am62/Kconfig |   82 +
 board/toradex/verdin-am62/MAINTAINERS |   17 +
 board/toradex/verdin-am62/Makefile|6 +
 board/toradex/verdin-am62/board-cfg.yaml  |   36 +
 board/toradex/verdin-am62/pm-cfg.yaml |   12 +
 board/toradex/verdin-am62/rm-cfg.yaml | 1088 
 board/toradex/verdin-am62/sec-cfg.yaml|  379 +++
 board/toradex/verdin-am62/verdin-am62.c   |  131 +
 configs/verdin-am62_a53_defconfig |  187 ++
 configs/verdin-am62_r5_defconfig  |  111 +
 doc/board/toradex/verdin-am62.rst |  169 ++
 include/configs/verdin-am62.h |   55 +
 25 files changed, 7030 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/k3-am62-verdin-dev.dtsi
 create mode 100644 arch/arm/dts/k3-am62-verdin-wifi.dtsi
 create mode 100644 arch/arm/dts/k3-am62-verdin.dtsi
 create mode 100644 arch/arm/dts/k3-am625-verdin-lpddr4-1600MTs.dtsi
 create mode 100644 arch/arm/dts/k3-am625-verdin-r5.dts
 create mode 100644 arch/arm/dts/k3-am625-verdin-wifi-dev-binman.dtsi
 create mode 100644 arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
 create mode 100644 arch/arm/dts/k3-am625-verdin-wifi-dev.dts
 create mode 100644 board/toradex/verdin-am62/Kconfig
 create mode 100644 board/toradex/verdin-am62/MAINTAINERS
 create mode 100644 board/toradex/verdin-am62/Makefile
 create mode 100644 board/toradex/verdin-am62/board-cfg.yaml
 create mode 100644 board/toradex/verdin-am62/pm-cfg.yaml
 create mode 100644 board

[PATCH v4 2/3] arm: mach-k3: am62: fix 2nd mux option of clkout0

2023-07-28 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Fix second mux option of clkout0 which should really be
DEV_BOARD0_CLKOUT0_IN_PARENT_HSDIV4_16FFT_MAIN_2_HSDIVOUT1_CLK10
rather than twice the same according to [1].

[1] 
https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am62x/clocks.html#clocks-for-board0-device

Signed-off-by: Marcel Ziswiler 
Reviewed-by: Bryan Brattlof 

---

(no changes since v2)

Changes in v2:
- Add Bryan's reviewed-by tag. Thanks!

 arch/arm/mach-k3/am62x/clk-data.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-k3/am62x/clk-data.c 
b/arch/arm/mach-k3/am62x/clk-data.c
index c0881778fe7..d7bfed0e031 100644
--- a/arch/arm/mach-k3/am62x/clk-data.c
+++ b/arch/arm/mach-k3/am62x/clk-data.c
@@ -57,7 +57,7 @@ static const char * const 
sam62_pll_ctrl_wrap_mcu_0_sysclkout_clk_parents[] = {
 
 static const char * const clkout0_ctrl_out0_parents[] = {
"hsdiv4_16fft_main_2_hsdivout1_clk",
-   "hsdiv4_16fft_main_2_hsdivout1_clk",
+   "hsdiv4_16fft_main_2_hsdivout1_clk10",
 };
 
 static const char * const clk_32k_rc_sel_out0_parents[] = {
@@ -195,6 +195,7 @@ static const struct clk_data clk_list[] = {
CLK_DIV("hsdiv4_16fft_main_1_hsdivout1_clk", 
"pllfracf_ssmod_16fft_main_1_foutvcop_clk", 0x681084, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_main_1_hsdivout2_clk", 
"pllfracf_ssmod_16fft_main_1_foutvcop_clk", 0x681088, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_main_2_hsdivout1_clk", 
"pllfracf_ssmod_16fft_main_2_foutvcop_clk", 0x682084, 0, 7, 0, 0),
+   CLK_DIV("hsdiv4_16fft_main_2_hsdivout1_clk10", 
"pllfracf_ssmod_16fft_main_2_foutvcop_clk", 0x682084, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_main_2_hsdivout2_clk", 
"pllfracf_ssmod_16fft_main_2_foutvcop_clk", 0x682088, 0, 7, 0, 0),
CLK_DIV("hsdiv4_16fft_mcu_0_hsdivout0_clk", 
"pllfracf_ssmod_16fft_mcu_0_foutvcop_clk", 0x4040080, 0, 7, 0, 0),
CLK_MUX_PLLCTRL("sam62_pll_ctrl_wrap_main_0_sysclkout_clk", 
sam62_pll_ctrl_wrap_main_0_sysclkout_clk_parents, 2, 0x41, 0),
@@ -313,7 +314,7 @@ static const struct dev_clk soc_dev_clk_data[] = {
DEV_CLK(146, 5, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
DEV_CLK(157, 20, "clkout0_ctrl_out0"),
DEV_CLK(157, 21, "hsdiv4_16fft_main_2_hsdivout1_clk"),
-   DEV_CLK(157, 22, "hsdiv4_16fft_main_2_hsdivout1_clk"),
+   DEV_CLK(157, 22, "hsdiv4_16fft_main_2_hsdivout1_clk10"),
DEV_CLK(157, 24, "sam62_pll_ctrl_wrap_main_0_chip_div1_clk_clk"),
DEV_CLK(157, 25, "board_0_ddr0_ck0_out"),
DEV_CLK(157, 40, "mshsi2c_main_0_porscl"),
-- 
2.36.1



[PATCH v4 1/3] toradex: tdx-cfg-block: add verdin am62 skus

2023-07-28 Thread Marcel Ziswiler
From: Marcel Ziswiler 

Add initial Verdin AM62 Quad 1GB WB IT prototype and launch
configuration SKUs to ConfigBlock handling.

0069: Verdin AM62 Quad 1GB WB IT
0071: Verdin AM62 Solo 512MB
0072: Verdin AM62 Solo 512MB WB IT
0073: Verdin AM62 Dual 1GB ET
0074: Verdin AM62 Dual 1GB IT
0075: Verdin AM62 Dual 1GB WB IT
0076: Verdin AM62 Quad 2GB WB IT

Signed-off-by: Marcel Ziswiler 
Signed-off-by: Emanuele Ghidoli 

---

(no changes since v3)

Changes in v3:
- Add Verdin AM62 launch configuration SKUs as well.

 board/toradex/common/tdx-cfg-block.c |  7 +++
 board/toradex/common/tdx-cfg-block.h | 10 --
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/board/toradex/common/tdx-cfg-block.c 
b/board/toradex/common/tdx-cfg-block.c
index e513f4a2919..8ad4907bfe4 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -139,7 +139,14 @@ const struct toradex_som toradex_modules[] = {
[66] = { "Verdin iMX8M Plus Quad 8GB WB",
TARGET_IS_ENABLED(VERDIN_IMX8MP)   },
[67] = { "Apalis iMX8QM 8GB WB IT",  
TARGET_IS_ENABLED(APALIS_IMX8) },
[68] = { "Verdin iMX8M Mini Quad 2GB WB IT", 
TARGET_IS_ENABLED(VERDIN_IMX8MM)   },
+   [69] = { "Verdin AM62 Quad 1GB WB IT",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
[70] = { "Verdin iMX8M Plus Quad 8GB WB IT", 
TARGET_IS_ENABLED(VERDIN_IMX8MP)   },
+   [71] = { "Verdin AM62 Solo 512MB",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [72] = { "Verdin AM62 Solo 512MB WB IT", 
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [73] = { "Verdin AM62 Dual 1GB ET",  
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [74] = { "Verdin AM62 Dual 1GB IT",  
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [75] = { "Verdin AM62 Dual 1GB WB IT",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
+   [76] = { "Verdin AM62 Quad 2GB WB IT",   
TARGET_IS_ENABLED(VERDIN_AM62_A53) },
 };
 
 const char * const toradex_carrier_boards[] = {
diff --git a/board/toradex/common/tdx-cfg-block.h 
b/board/toradex/common/tdx-cfg-block.h
index 45fa04ca38a..5c204931a2d 100644
--- a/board/toradex/common/tdx-cfg-block.h
+++ b/board/toradex/common/tdx-cfg-block.h
@@ -94,8 +94,14 @@ enum {
VERDIN_IMX8MPQ_8GB_WIFI_BT,
APALIS_IMX8QM_8GB_WIFI_BT_IT,
VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN,
-   /* 69 */
-   VERDIN_IMX8MPQ_8GB_WIFI_BT_IT = 70, /* 70 */
+   VERDIN_AM62Q_WIFI_BT_IT,
+   VERDIN_IMX8MPQ_8GB_WIFI_BT_IT, /* 70 */
+   VERDIN_AM62S_512MB,
+   VERDIN_AM62S_512MB_WIFI_BT_IT,
+   VERDIN_AM62D_1G_ET,
+   VERDIN_AM62D_1G_IT,
+   VERDIN_AM62D_1G_WIFI_BT_IT, /* 75 */
+   VERDIN_AM62Q_2G_WIFI_BT_IT,
 };
 
 enum {
-- 
2.36.1



Re: [PATCH v4 1/2] net: ti: am65-cpsw-nuss: Enforce pinctrl state on the MDIO child node

2023-07-28 Thread Marcel Ziswiler
Hi Maxime

On Fri, 2023-07-28 at 15:52 +0200, mrip...@kernel.org wrote:
> On Fri, Jul 28, 2023 at 01:34:38PM +0000, Marcel Ziswiler wrote:

[snip]

> > However, so far I could not make this work for our use-case [1]. It just 
> > keeps crashing. Any ideas?
> > 
> > [snip]

[snip]

> > [1] https://lore.kernel.org/all/20230715074050.941051-1-mar...@ziswiler.com
> 
> It looks like this series is fairly outdated and won't reasonably work
> with these patches. Do you have a branch where you pulled our patches?

I figured it out now. I was missing CONFIG_PHY_ETHERNET_ID required for 
reset-gpios in the PHY node to work in
U-Boot. Sorry for the noise. Cleaned-up v4 of our stuff incoming...


Thanks!

> Maxime

Cheers

Marcel


Re: [PATCH v4 1/2] net: ti: am65-cpsw-nuss: Enforce pinctrl state on the MDIO child node

2023-07-28 Thread Marcel Ziswiler
Hi Maxime

Just a minor nitpick in the comments below.

On Mon, 2023-07-24 at 15:57 +0200, Maxime Ripard wrote:
> The binding represents the MDIO controller as a child device tree
> node of the MAC device tree node.
> 
> The U-Boot driver mostly ignores that child device tree node and just
> hardcodes the resources it uses to support both the MAC and MDIO in a
> single driver.
> 
> However, some resources like pinctrl muxing states are thus ignored.
> This has been a problem with some device trees that will put some
> pinctrl states on the MDIO device tree node, like the SK-AM62 Device
> Tree does.
> 
> Let's rework the driver a bit to create a dummy MDIO driver that we will
> then get during our initialization to force the core to select the right
> muxing.
> 
> Signed-off-by: Maxime Ripard 
> ---
>  drivers/net/ti/Kconfig  |  1 +
>  drivers/net/ti/am65-cpsw-nuss.c | 60 
> +
>  2 files changed, 61 insertions(+)
> 
> diff --git a/drivers/net/ti/Kconfig b/drivers/net/ti/Kconfig
> index d9f1c019a885..02660e4fbb44 100644
> --- a/drivers/net/ti/Kconfig
> +++ b/drivers/net/ti/Kconfig
> @@ -41,6 +41,7 @@ endchoice
>  config TI_AM65_CPSW_NUSS
> bool "TI K3 AM65x MCU CPSW Nuss Ethernet controller driver"
> depends on ARCH_K3
> +   imply DM_MDIO
> imply MISC_INIT_R
> imply MISC
> imply SYSCON
> diff --git a/drivers/net/ti/am65-cpsw-nuss.c b/drivers/net/ti/am65-cpsw-nuss.c
> index ce52106e5238..51a8167d14a9 100644
> --- a/drivers/net/ti/am65-cpsw-nuss.c
> +++ b/drivers/net/ti/am65-cpsw-nuss.c
> @@ -15,6 +15,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -605,14 +606,62 @@ static const struct soc_attr k3_mdio_soc_data[] = {
> { /* sentinel */ },
>  };
>  
> +static ofnode am65_cpsw_find_mdio(ofnode parent)
> +{
> +   ofnode node;
> +
> +   ofnode_for_each_subnode(node, parent)
> +   if (ofnode_device_is_compatible(node, "ti,cpsw-mdio"))
> +   return node;
> +
> +   return ofnode_null();
> +}
> +
> +static int am65_cpsw_mdio_setup(struct udevice *dev)
> +{
> +   struct am65_cpsw_priv *priv = dev_get_priv(dev);
> +   struct am65_cpsw_common *cpsw_common = priv->cpsw_common;
> +   struct udevice *mdio_dev;
> +   ofnode mdio;
> +   int ret;
> +
> +   mdio = am65_cpsw_find_mdio(dev_ofnode(cpsw_common->dev));
> +   if (!ofnode_valid(mdio))
> +   return 0;
> +
> +   /*
> +    * The MDIO controller is represented in the DT binding by a
> +    * subnode of the MAC controller.
> +    *
> +    * We don't have a DM driver for the MDIO device yet, and thus any
> +    * pinctrl setting on its node will be ignored.
> +    *
> +    * However, we do need to make sure the pins states tied to the
> +    * MDIO node are configured properly. Fortunately, the core DM
> +    * does that for use when we get a device, so we can work around

Does that for us?

> +    * that whole issue by just requesting a dummy MDIO driver to
> +    * probe, and our pins will get muxed.
> +    */
> +   ret = uclass_get_device_by_ofnode(UCLASS_MDIO, mdio, _dev);
> +   if (ret)
> +   return ret;
> +
> +   return 0;
> +}
> +
>  static int am65_cpsw_mdio_init(struct udevice *dev)
>  {
> struct am65_cpsw_priv *priv = dev_get_priv(dev);
> struct am65_cpsw_common *cpsw_common = priv->cpsw_common;
> +   int ret;
>  
> if (!priv->has_phy || cpsw_common->bus)
> return 0;
>  
> +   ret = am65_cpsw_mdio_setup(dev);
> +   if (ret)
> +   return ret;
> +
> cpsw_common->bus = cpsw_mdio_init(dev->name,
>   cpsw_common->mdio_base,
>   cpsw_common->bus_freq,
> @@ -868,3 +917,14 @@ U_BOOT_DRIVER(am65_cpsw_nuss_port) = {
> .plat_auto  = sizeof(struct eth_pdata),
> .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_OS_PREPARE,
>  };
> +
> +static const struct udevice_id am65_cpsw_mdio_ids[] = {
> +   { .compatible = "ti,cpsw-mdio" },
> +   { }
> +};
> +
> +U_BOOT_DRIVER(am65_cpsw_mdio) = {
> +   .name   = "am65_cpsw_mdio",
> +   .id = UCLASS_MDIO,
> +   .of_match   = am65_cpsw_mdio_ids,
> +};

However, so far I could not make this work for our use-case [1]. It just keeps 
crashing. Any ideas?

[snip]

Model: Toradex 0076 Verdin AM62 Quad 2GB WB IT V1.0A
Serial#: 15037380
Carrier: Toradex Dahlia V1.1A, Serial# 10763237
am65_cpsw_nuss ethernet@800: K3 CPSW: nuss_ver: 0x6BA01103 cpsw_ver: 0x6BA81
103 ale_ver: 0x00290105 Ports:2 mdio_freq:100
Setting variant to wifi
Net:
Warning: ethernet@800port@1 MAC addresses don't match:
Address in ROM is   1c:63:49:22:5f:f9
Address in environment is   00:14:2d:e5:73:c4
eth0: ethernet@800port@1 

  1   2   3   4   5   6   7   8   9   10   >