Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DFD0C00528 for ; Fri, 4 Aug 2023 09:53:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 99E1C866E1; Fri, 4 Aug 2023 11:53:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="vCcwcmeR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B70DD86852; Fri, 4 Aug 2023 11:53:35 +0200 (CEST) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C1822862DA for ; Fri, 4 Aug 2023 11:53:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=n-francis@ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3749rH3J062803; Fri, 4 Aug 2023 04:53:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1691142797; bh=VvSp9BrHkc8kx7Pc36EpXrll2HKREkgmTH5CLnzgWPI=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=vCcwcmeR88AdFm01TdLhWAC/PZdnAoQWDKgNazUrUMPpo0l8ZSZ7GDy2aqGYLsWZ4 sKqPs0ioIJ7vigq6N00siN+gRuEtdRfL7YiYJsWI2Ldn0MyYLzkCXOBvNX4MiOvH/0 9oQF/byYsaCkDHtMU1AGt1G38NWMQUKSiOGPKz34= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3749rHEY058745 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 4 Aug 2023 04:53:17 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 4 Aug 2023 04:53:16 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 4 Aug 2023 04:53:16 -0500 Received: from [10.24.68.114] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3749rAmf032493; Fri, 4 Aug 2023 04:53:11 -0500 Message-ID: Date: Fri, 4 Aug 2023 15:23:10 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v5 3/3] board: toradex: add verdin am62 support Content-Language: en-US To: Marcel Ziswiler , "u-boot@lists.denx.de" CC: "nm@ti.com" , "frieder.schrempf@kontron.de" , "weijie.gao@mediatek.com" , "kever.yang@rock-chips.com" , "n-jain1@ti.com" , "philippe.reynes@softathome.com" , "marex@denx.de" , "hai.pham.ud@renesas.com" , "m-chawdhry@ti.com" , "jonas@kwiboo.se" , "jm@ti.com" , "william.zhang@broadcom.com" , "sjg@chromium.org" , "neil.armstrong@linaro.org" , "xypron.glpk@gmx.de" , "bb@ti.com" , "u-kumar1@ti.com" , "pali@kernel.org" References: <20230803140016.52846-1-marcel@ziswiler.com> <20230803140016.52846-4-marcel@ziswiler.com> <803b397b-f32f-ea97-ad81-2f5b20f35e4b@ti.com> <31a3072963c06ff8646342d6e124edb008bd30da.camel@toradex.com> From: Neha Malcom Francis In-Reply-To: <31a3072963c06ff8646342d6e124edb008bd30da.camel@toradex.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hi Marcel On 04/08/23 15:13, Marcel Ziswiler wrote: > 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 00000000000..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" >>> + >>> +&binman { >>> +       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 >>> + >>> +&binman { >>> +       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"; >>> +                       }; >>> +               }; >>> +       }; >>> +       combined-dm-cfg { >>> +               filename = "combined-dm-cfg.bin"; >>> +               ti-board-config { >>> +                       pcfg_yaml_dm: pm-cfg { >>> +                               config = "pm-cfg.yaml"; >>> +                               schema = "../../ti/common/schema.yaml"; >>> +                       }; >>> +                       rcfg_yaml_dm: rm-cfg { >>> +                               config = "rm-cfg.yaml"; >>> +                               schema = "../../ti/common/schema.yaml"; >>> +                       }; >>> +               }; >>> +       }; >>> +       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? > > Yes, I agree. Will change it to just overriding relevant properties using phandles. > >>> +#endif /* CONFIG_ARM64 */ >>> + >>> +#ifdef CONFIG_TARGET_VERDIN_AM62_R5 >>> + >>> +&binman { >>> +       tiboot3-am62x-hs-verdin.bin { >>> +               filename = "tiboot3-am62x-hs-verdin.bin"; >>> +               ti-secure-rom { >>> +                       content = <&u_boot_spl>, <&ti_fs_enc>, <&combined_tifs_cfg>, >>> +                               <&combined_dm_cfg>, <&sysfw_inner_cert>; >>> +                       combined; >>> +                       dm-data; >>> +                       sysfw-inner-cert; >>> +                       keyfile = "custMpk.pem"; >>> +                       sw-rev = <1>; >>> +                       content-sbl = <&u_boot_spl>; >>> +                       content-sysfw = <&ti_fs_enc>; >>> +                       content-sysfw-data = <&combined_tifs_cfg>; >>> +                       content-sysfw-inner-cert = <&sysfw_inner_cert>; >>> +                       content-dm-data = <&combined_dm_cfg>; >>> +                       load = <0x43c00000>; >>> +                       load-sysfw = <0x40000>; >>> +                       load-sysfw-data = <0x67000>; >>> +                       load-dm-data = <0x43c3a800>; >>> +               }; >>> +               u_boot_spl: u-boot-spl { >>> +                       no-expanded; >>> +               }; >>> +               ti_fs_enc: ti-fs-enc.bin { >>> +                       filename = "ti-sysfw/ti-fs-firmware-am62x-hs-enc.bin"; >>> +                       type = "blob-ext"; >>> +                       optional; >> >> If the R5 builds are exactly the same as that generated by k3-am625-binman.dtsi, >> would it make sense to include that file and just replace the filenames using >> phandles? > > First, there is no such thing as a k3-am625-binman.dtsi. You probably meant k3-am625-sk-binman.dtsi but that > one is SK specific and not reusable for us due to the target ifdefery in there. I really believe this part > needs to be more or less duplicated. Ah understood. Once we move to using templates to generate all of these, we can reduce this duplication. > >> [...] >> >>> new file mode 100644 >>> index 00000000000..e0c35dfa061 >>> --- /dev/null >>> +++ b/include/configs/verdin-am62.h >>> @@ -0,0 +1,55 @@ >>> +/* SPDX-License-Identifier: GPL-2.0-or-later */ >>> +/* >>> + * Configuration header file for Verdin AM62 SoM >>> + * >>> + * Copyright 2023 Toradex - https://www.toradex.com/ >>> + */ >>> + >>> +#ifndef __VERDIN_AM62_H >>> +#define __VERDIN_AM62_H >>> + >>> +#define RAMDISK_ADDR_R                 0x90300000 >> >> Nitpick: indentation > > Okay. > >>> +#define SCRIPTADDR                     0x90280000 >>> + >>> +/* DDR Configuration */ >>> +#define CFG_SYS_SDRAM_BASE     0x80000000 >>> +#define CFG_SYS_SDRAM_BASE1    0x880000000 >>> +#define CFG_SYS_SDRAM_SIZE     SZ_2G /* Maximum supported size */ >>> + >>> +#define MEM_LAYOUT_ENV_SETTINGS \ >>> +       "fdt_addr_r=0x90200000\0" \ >>> +       "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ >>> +       "kernel_comp_addr_r=0x80200000\0" \ >>> +       "kernel_comp_size=0x08000000\0" \ >>> +       "ramdisk_addr_r=" __stringify(RAMDISK_ADDR_R) "\0" \ >>> +       "scriptaddr=" __stringify(SCRIPTADDR) "\0" >>> + >>> +#if CONFIG_TARGET_VERDIN_AM62_A53 >>> +/* Enable Distro Boot */ >>> +#define BOOT_TARGET_DEVICES(func) \ >>> +       func(MMC, mmc, 1) \ >>> +       func(MMC, mmc, 0) \ >>> +       func(DHCP, dhcp, na) >>> +#include >>> +#else /* CONFIG_TARGET_VERDIN_AM62_A53 */ >>> +#define BOOTENV \ >>> +       "" >>> +#endif /* CONFIG_TARGET_VERDIN_AM62_A53 */ >>> + >>> +/* Incorporate settings into the U-Boot environment */ >>> +#define CFG_EXTRA_ENV_SETTINGS \ >>> +       BOOTENV \ >>> +       MEM_LAYOUT_ENV_SETTINGS \ >>> +       "boot_scripts=boot.scr\0" \ >>> +       "boot_script_dhcp=boot.scr\0" \ >>> +       "console=ttyS2\0" \ >>> +       "fdt_board=dev\0" \ >>> +       "setup=setenv setupargs console=tty1 console=${console},${baudrate} " \ >>> +               "consoleblank=0 earlycon=ns16550a,mmio32,0x02800000\0" \ >>> +       "update_uboot=askenv confirm Did you load flash.bin (y/N)?; " \ >>> +               "if test \"$confirm\" = \"y\"; then " \ >>> +               "setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \ >>> +               "${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x0 " \ >>> +               "${blkcnt}; fi\0" >>> + >>> +#endif /* __VERDIN_AM62_H */ > > Thanks! A cleaned-up v6 is incoming... > > Cheers Thanks! > > Marcel -- Thanking You Neha Malcom Francis