From mboxrd@z Thu Jan 1 00:00:00 1970 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 24D96C6FD1D for ; Fri, 17 Mar 2023 05:57:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EA3E185ED7; Fri, 17 Mar 2023 06:57:13 +0100 (CET) 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="cML7TLSf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B740885E4A; Fri, 17 Mar 2023 06:57:10 +0100 (CET) Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (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 2982A85958 for ; Fri, 17 Mar 2023 06:57:04 +0100 (CET) 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-jain1@ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 32H5v35U046322; Fri, 17 Mar 2023 00:57:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1679032623; bh=fJ+/xAKy5zqNXx+OQsJgdO0QthObh8pE60/AL0F3ImU=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=cML7TLSft0CVRzqoObGw4D5IdKG0W1vz3a4MnI0GxYzBPHQt18YsAltcUupLT4xAa 9xKAgcuDw+dKgTaCcEgGUl2MpAMKTMkODXLoiABzb9RGS1jBkk6FUHBU0kR5O0PO1q ZFNJEgaLuSWvsGDMjxP9dVoHUGtrRA3gUvCDaiDA= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 32H5v3w8057292 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Mar 2023 00:57:03 -0500 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Fri, 17 Mar 2023 00:57:02 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Fri, 17 Mar 2023 00:57:02 -0500 Received: from [172.24.145.43] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 32H5v0rA003136; Fri, 17 Mar 2023 00:57:01 -0500 Message-ID: Date: Fri, 17 Mar 2023 11:27:00 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 2/3] include: configs: j721s2_evm: Change to using .env Content-Language: en-US To: Neha Malcom Francis , , CC: , References: <20230315052745.110502-1-n-francis@ti.com> <20230315052745.110502-2-n-francis@ti.com> From: Nikhil M Jain In-Reply-To: <20230315052745.110502-2-n-francis@ti.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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 Neha, Thanks for the patch. On 15/03/23 10:57, Neha Malcom Francis wrote: > Move to using .env file for setting up environment variables for J721S2. > > Signed-off-by: Neha Malcom Francis > Reviewed-by: Tom Rini > --- > Changes in v2: > - Added CONFIG_CMD_REMOTEPROC guard to including k3_rproc.env > - Retained Reviewed-by tag > > board/ti/j721s2/Kconfig | 6 ++ > board/ti/j721s2/j721s2.env | 56 +++++++++++++++++ > include/configs/j721s2_evm.h | 118 +---------------------------------- > 3 files changed, 63 insertions(+), 117 deletions(-) > create mode 100644 board/ti/j721s2/j721s2.env > > diff --git a/board/ti/j721s2/Kconfig b/board/ti/j721s2/Kconfig > index 6141798333..70972d1227 100644 > --- a/board/ti/j721s2/Kconfig > +++ b/board/ti/j721s2/Kconfig > @@ -40,6 +40,9 @@ config SYS_VENDOR > config SYS_CONFIG_NAME > default "j721s2_evm" > > +config ENV_SOURCE_FILE > + default "j721s2" > + > source "board/ti/common/Kconfig" > > endif > @@ -55,6 +58,9 @@ config SYS_VENDOR > config SYS_CONFIG_NAME > default "j721s2_evm" > > +config ENV_SOURCE_FILE > + default "j721s2" > + > source "board/ti/common/Kconfig" > > endif > diff --git a/board/ti/j721s2/j721s2.env b/board/ti/j721s2/j721s2.env > new file mode 100644 > index 0000000000..2152f8849f > --- /dev/null > +++ b/board/ti/j721s2/j721s2.env > @@ -0,0 +1,56 @@ > +#include > +#include > +#include > +#include > + > +#if CONFIG_CMD_REMOTEPROC > +#include > +#endif > + > +default_device_tree=k3-j721s2-common-proc-board.dtb > +findfdt= > + setenv name_fdt ${default_device_tree}; > + if test $board_name = j721s2; then \ > + setenv name_fdt k3-j721s2-common-proc-board.dtb; fi; > + if test $board_name = am68-sk; then > + setenv name_fdt k3-am68-sk-base-board.dtb; fi; > + setenv fdtfile ${name_fdt} > +name_kern=Image > +console=ttyS2,115200n8 > +args_all=setenv optargs earlycon=ns16550a,mmio32,0x02880000 > + ${mtdparts} > +run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr} > + > +boot=mmc > +mmcdev=1 > +bootpart=1:2 > +bootdir=/boot > +#if CONFIG_SYS_K3_SPL_ATF > +#if CONFIG_TARGET_J721S2_R5_EVM > +addr_mcur5f0_0load=0x89000000 > +name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw > +#endif > +#endif > +rd_spec=- > +init_mmc=run args_all args_mmc > +get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt} > +get_overlay_mmc= > + fdt address ${fdtaddr}; > + fdt resize 0x100000; > + for overlay in $name_overlays; > + do; > + load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && > + fdt apply ${dtboaddr}; > + done; > +partitions=uuid_disk=${uuid_gpt_disk}; > + name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs} > +get_kern_mmc=load mmc ${bootpart} ${loadaddr} > + ${bootdir}/${name_kern} > +get_fit_mmc=load mmc ${bootpart} ${addr_fit} > + ${bootdir}/${name_fit} > +partitions=uuid_disk=${uuid_gpt_disk}; > + name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs} > + > +rproc_fw_binaries= 2 /lib/firmware/j721s2-main-r5f0_0-fw 3 /lib/firmware/j721s2-main-r5f0_1-fw 4 /lib/firmware/j721s2-main-r5f1_0-fw 5 /lib/firmware/j721s2-main-r5f1_1-fw 6 /lib/firmware/j721s2-c71_0-fw 7 /lib/firmware/j721s2-c71_1-fw > + > + You have two extra lines at the end of the file. > diff --git a/include/configs/j721s2_evm.h b/include/configs/j721s2_evm.h > index bfada9eebc..2fa93b7961 100644 > --- a/include/configs/j721s2_evm.h > +++ b/include/configs/j721s2_evm.h > @@ -11,10 +11,6 @@ > > #include > #include > -#include > -#include > -#include > -#include > > /* DDR Configuration */ > #define CFG_SYS_SDRAM_BASE1 0x880000000 > @@ -27,120 +23,8 @@ > #define CFG_SYS_UBOOT_BASE 0x50080000 > #endif > > -/* U-Boot general configuration */ > -#define EXTRA_ENV_J721S2_BOARD_SETTINGS \ > - "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ > - "findfdt=" \ > - "setenv name_fdt ${default_device_tree};" \ > - "if test $board_name = j721s2; then " \ > - "setenv name_fdt k3-j721s2-common-proc-board.dtb; fi;" \ > - "if test $board_name = am68-sk; then " \ > - "setenv name_fdt k3-am68-sk-base-board.dtb; fi;"\ > - "setenv fdtfile ${name_fdt}\0" \ > - "name_kern=Image\0" \ > - "console=ttyS2,115200n8\0" \ > - "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02880000 " \ > - "${mtdparts}\0" \ > - "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" > - > -#define PARTS_DEFAULT \ > - /* Linux partitions */ \ > - "uuid_disk=${uuid_gpt_disk};" \ > - "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" > - > -#ifdef CONFIG_SYS_K3_SPL_ATF > -#if defined(CONFIG_TARGET_J721S2_R5_EVM) > -#define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \ > - "addr_mcur5f0_0load=0x89000000\0" \ > - "name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw\0" > -#elif defined(CONFIG_TARGET_J7200_R5_EVM) > -#define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \ > - "addr_mcur5f0_0load=0x89000000\0" \ > - "name_mcur5f0_0fw=/lib/firmware/j7200-mcu-r5f0_0-fw\0" > -#endif /* CONFIG_TARGET_J721S2_R5_EVM */ > -#else > -#define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC "" > -#endif /* CONFIG_SYS_K3_SPL_ATF */ > - > -/* U-Boot MMC-specific configuration */ > -#define EXTRA_ENV_J721S2_BOARD_SETTINGS_MMC \ > - "boot=mmc\0" \ > - "mmcdev=1\0" \ > - "bootpart=1:2\0" \ > - "bootdir=/boot\0" \ > - EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \ > - "rd_spec=-\0" \ > - "init_mmc=run args_all args_mmc\0" \ > - "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \ > - "get_overlay_mmc=" \ > - "fdt address ${fdtaddr};" \ > - "fdt resize 0x100000;" \ > - "for overlay in $name_overlays;" \ > - "do;" \ > - "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ > - "fdt apply ${dtboaddr};" \ > - "done;\0" \ > - "partitions=" PARTS_DEFAULT \ > - "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \ > - "${bootdir}/${name_kern}\0" \ > - "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ > - "${bootdir}/${name_fit}\0" \ > - "partitions=" PARTS_DEFAULT > - > -/* Set the default list of remote processors to boot */ > -#if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM) > -#ifdef DEFAULT_RPROCS > -#undef DEFAULT_RPROCS > -#endif > -#endif > - > -#ifdef CONFIG_TARGET_J721S2_A72_EVM > -#define DEFAULT_RPROCS "" \ > - "2 /lib/firmware/j721s2-main-r5f0_0-fw " \ > - "3 /lib/firmware/j721s2-main-r5f0_1-fw " \ > - "4 /lib/firmware/j721s2-main-r5f1_0-fw " \ > - "5 /lib/firmware/j721s2-main-r5f1_1-fw " \ > - "6 /lib/firmware/j721s2-c71_0-fw " \ > - "7 /lib/firmware/j721s2-c71_1-fw " > -#endif /* CONFIG_TARGET_J721S2_A72_EVM */ > - > -#ifdef CONFIG_TARGET_J7200_A72_EVM > -#define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY \ > - "do_main_cpsw0_qsgmii_phyinit=1\0" \ > - "init_main_cpsw0_qsgmii_phy=gpio set gpio@22_17;" \ > - "gpio clear gpio@22_16\0" \ > - "main_cpsw0_qsgmii_phyinit=" \ > - "if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1 && test ${dorprocboot} -eq 1 && " \ > - "test ${boot} = mmc; then " \ > - "run init_main_cpsw0_qsgmii_phy;" \ > - "fi;\0" > -#define DEFAULT_RPROCS "" \ > - "2 /lib/firmware/j7200-main-r5f0_0-fw " \ > - "3 /lib/firmware/j7200-main-r5f0_1-fw " > -#endif /* CONFIG_TARGET_J7200_A72_EVM */ > - > -#ifndef EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY > -#define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY > -#endif > - > -/* set default dfu_bufsiz to 128KB (sector size of OSPI) */ > -#define EXTRA_ENV_DFUARGS \ > - DFU_ALT_INFO_MMC \ > - DFU_ALT_INFO_EMMC \ > - DFU_ALT_INFO_RAM \ > - DFU_ALT_INFO_OSPI > - > /* Incorporate settings into the U-Boot environment */ > -#define CFG_EXTRA_ENV_SETTINGS \ > - DEFAULT_LINUX_BOOT_ENV \ > - DEFAULT_MMC_TI_ARGS \ > - DEFAULT_FIT_TI_ARGS \ > - EXTRA_ENV_J721S2_BOARD_SETTINGS \ > - EXTRA_ENV_J721S2_BOARD_SETTINGS_MMC \ > - EXTRA_ENV_RPROC_SETTINGS \ > - EXTRA_ENV_DFUARGS \ > - DEFAULT_UFS_TI_ARGS \ > - EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY > +#define CFG_EXTRA_ENV_SETTINGS > > /* Now for the remaining common defines */ > #include Regards, Nikhil