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 X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB4E5C432BE for ; Mon, 30 Aug 2021 13:17:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D2A4E600AA for ; Mon, 30 Aug 2021 13:17:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D2A4E600AA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 392E38337D; Mon, 30 Aug 2021 15:17:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 33F3E83372; Mon, 30 Aug 2021 15:16:56 +0200 (CEST) Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 50B1783376 for ; Mon, 30 Aug 2021 15:16:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qv1-f50.google.com with SMTP id s16so6371941qvt.13 for ; Mon, 30 Aug 2021 06:16:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iGbythKFMi64bJdezvDDbB9kq9aWLya7ABDSS60acMo=; b=lUoP1saPTjTf7M0vz3sE0rwJmtaw3hASlwNV5ZnrFXxf7hSbkZU6uXu+T9wRbb71HG LUHfCiV7O9J6xfaHMxR0uJCogyWXyInQFWar+1RHBjy4xpbX/SnhVud+CyJJYjMIygtl jlmIearMogjmo45XPd59Yb+l6H3c1IP0u+aI0GWJghyYCEz+lRglGNFRzUssd+YDNDPd c7X+mRSUTRagitETVFvR6j/WmNJMye1V2eJS79WrJBWUwyjAEwkrPtuKskWazvlnLlV8 fjWYTgrQQHQwWCKTD9uFUp7hwx5zCIcy2Fh3RANpf3IRDD6SaMXaUTWJp78X5HZbdlpR v+UA== X-Gm-Message-State: AOAM530cAuIaGC5OfPjm7mPp1p3uWbWJ9z0XS7oH6odIR+rYr7aKO2I8 obNN18sXGctVbYR0ZGLCTfdF6vKCFXdX X-Google-Smtp-Source: ABdhPJygFvOVepCqf6ssZWnsEeYHTkB9KqNerqvSdxrZErrVgaa8cPvEj89sW2qJuokRn/Q/ECQI7Q== X-Received: by 2002:a05:6214:525:: with SMTP id x5mr22051630qvw.8.1630329402754; Mon, 30 Aug 2021 06:16:42 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b01-cbda-8d75-4e9a-efec-7167.res6.spectrum.com. [2603:6081:7b01:cbda:8d75:4e9a:efec:7167]) by smtp.gmail.com with ESMTPSA id s18sm11424103qkj.87.2021.08.30.06.16.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 06:16:42 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Stefano Babic , Fabio Estevam , "NXP i . MX U-Boot Team" Subject: [PATCH 2/5] imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG Date: Mon, 30 Aug 2021 09:16:29 -0400 Message-Id: <20210830131632.18780-2-trini@konsulko.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210830131632.18780-1-trini@konsulko.com> References: <20210830131632.18780-1-trini@konsulko.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean No iMX platforms have supported ATAG-based booting. They have however re-used the CONFIG_SERIAL_TAG option as a way to enable support of reading the OTP fuses and setting the serial# environment variable in some cases. Change the warp7 support to use this symbol, use this for updating the rest of the imx7 code, and update the imx8 conditionals. Cc: Stefano Babic Cc: Fabio Estevam Cc: NXP i.MX U-Boot Team Signed-off-by: Tom Rini --- arch/arm/include/asm/bootm.h | 5 ++++- arch/arm/mach-imx/imx8/cpu.c | 4 ++-- arch/arm/mach-imx/imx8ulp/soc.c | 2 +- arch/arm/mach-imx/mx7/soc.c | 12 +++++++++++- board/warp7/warp7.c | 4 ++-- configs/gwventana_emmc_defconfig | 1 + configs/gwventana_gw5904_defconfig | 1 + configs/gwventana_nand_defconfig | 1 + configs/imx8ulp_evk_defconfig | 1 + configs/puma-rk3399_defconfig | 1 + configs/warp7_bl33_defconfig | 1 + configs/warp7_defconfig | 1 + include/configs/apalis_imx6.h | 1 - include/configs/cm_fx6.h | 1 - include/configs/colibri_imx6.h | 1 - include/configs/gw_ventana.h | 3 --- include/configs/imx8ulp_evk.h | 2 -- include/configs/puma_rk3399.h | 2 -- include/configs/warp7.h | 3 --- 19 files changed, 27 insertions(+), 20 deletions(-) diff --git a/arch/arm/include/asm/bootm.h b/arch/arm/include/asm/bootm.h index a2131ca07c52..27f183b93d6b 100644 --- a/arch/arm/include/asm/bootm.h +++ b/arch/arm/include/asm/bootm.h @@ -41,9 +41,12 @@ extern void udc_disconnect(void); struct tag_serialnr; #ifdef CONFIG_SERIAL_TAG #define BOOTM_ENABLE_SERIAL_TAG 1 -void get_board_serial(struct tag_serialnr *serialnr); #else #define BOOTM_ENABLE_SERIAL_TAG 0 +#endif +#if defined(CONFIG_SERIAL_TAG) || defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) +void get_board_serial(struct tag_serialnr *serialnr); +#else static inline void get_board_serial(struct tag_serialnr *serialnr) { } diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index 02db322f51af..ee5cc479039b 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -172,7 +172,7 @@ enum boot_device get_boot_device(void) return boot_dev; } -#ifdef CONFIG_SERIAL_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define FUSE_UNIQUE_ID_WORD0 16 #define FUSE_UNIQUE_ID_WORD1 17 void get_board_serial(struct tag_serialnr *serialnr) @@ -201,7 +201,7 @@ void get_board_serial(struct tag_serialnr *serialnr) serialnr->low = val1; serialnr->high = val2; } -#endif /*CONFIG_SERIAL_TAG*/ +#endif /*CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG*/ #ifdef CONFIG_ENV_IS_IN_MMC __weak int board_mmc_get_env_dev(int devno) diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c index 1c33acc7dd6e..bba6323f96fa 100644 --- a/arch/arm/mach-imx/imx8ulp/soc.c +++ b/arch/arm/mach-imx/imx8ulp/soc.c @@ -405,7 +405,7 @@ int dram_init(void) return 0; } -#ifdef CONFIG_SERIAL_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG void get_board_serial(struct tag_serialnr *serialnr) { u32 uid[4]; diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c index fda25ba66a36..285c8d5682d8 100644 --- a/arch/arm/mach-imx/mx7/soc.c +++ b/arch/arm/mach-imx/mx7/soc.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -337,10 +338,19 @@ int arch_cpu_init(void) int arch_misc_init(void) { #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + struct tag_serialnr serialnr; + char serial_string[0x20]; + if (is_mx7d()) env_set("soc", "imx7d"); else env_set("soc", "imx7s"); + + /* Set serial# standard environment variable based on OTP settings */ + get_board_serial(&serialnr); + snprintf(serial_string, sizeof(serial_string), "0x%08x%08x", + serialnr.low, serialnr.high); + env_set("serial#", serial_string); #endif #ifdef CONFIG_FSL_CAAM @@ -351,7 +361,7 @@ int arch_misc_init(void) } #endif -#ifdef CONFIG_SERIAL_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG /* * OCOTP_TESTER * i.MX 7Solo Applications Processor Reference Manual, Rev. 0.1, 08/2016 diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index 0f202241dd78..c5c5433048dd 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -134,7 +134,7 @@ int checkboard(void) int board_late_init(void) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR; -#ifdef CONFIG_SERIAL_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG struct tag_serialnr serialnr; char serial_string[0x20]; #endif @@ -156,7 +156,7 @@ int board_late_init(void) env_set_ulong(HAB_ENABLED_ENVNAME, 0); #endif -#ifdef CONFIG_SERIAL_TAG +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG /* Set serial# standard environment variable based on OTP settings */ get_board_serial(&serialnr); snprintf(serial_string, sizeof(serial_string), "WaRP7-0x%08x%08x", diff --git a/configs/gwventana_emmc_defconfig b/configs/gwventana_emmc_defconfig index 9e764f40a229..ca15a720f69f 100644 --- a/configs/gwventana_emmc_defconfig +++ b/configs/gwventana_emmc_defconfig @@ -76,6 +76,7 @@ CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_PART=1 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_NETCONSOLE=y CONFIG_DM=y CONFIG_BOUNCE_BUFFER=y diff --git a/configs/gwventana_gw5904_defconfig b/configs/gwventana_gw5904_defconfig index bab61e7daad0..51665012a40d 100644 --- a/configs/gwventana_gw5904_defconfig +++ b/configs/gwventana_gw5904_defconfig @@ -76,6 +76,7 @@ CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_PART=1 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_NETCONSOLE=y CONFIG_DM=y CONFIG_BOUNCE_BUFFER=y diff --git a/configs/gwventana_nand_defconfig b/configs/gwventana_nand_defconfig index e59efebab777..894f55fefeb6 100644 --- a/configs/gwventana_nand_defconfig +++ b/configs/gwventana_nand_defconfig @@ -78,6 +78,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_NAND=y CONFIG_SYS_REDUNDAND_ENVIRONMENT=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_NETCONSOLE=y CONFIG_DM=y CONFIG_BOUNCE_BUFFER=y diff --git a/configs/imx8ulp_evk_defconfig b/configs/imx8ulp_evk_defconfig index 2a97c6dc4472..12d59bac8609 100644 --- a/configs/imx8ulp_evk_defconfig +++ b/configs/imx8ulp_evk_defconfig @@ -37,6 +37,7 @@ CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_SPL_OF_CONTROL=y CONFIG_ENV_IS_IN_MMC=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_SPL_DM=y CONFIG_IMX_RGPIO2P=y diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig index eaa3cddd4e1c..349787b0d782 100644 --- a/configs/puma-rk3399_defconfig +++ b/configs/puma-rk3399_defconfig @@ -44,6 +44,7 @@ CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_SYS_MMC_ENV_DEV=1 +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig index ec078178abf8..f3b9727ea286 100644 --- a/configs/warp7_bl33_defconfig +++ b/configs/warp7_bl33_defconfig @@ -32,6 +32,7 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_BOUNCE_BUFFER=y CONFIG_DFU_MMC=y diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index 19c0c183f7e5..9642ec1dac27 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -38,6 +38,7 @@ CONFIG_CMD_FS_GENERIC=y CONFIG_OF_CONTROL=y CONFIG_ENV_OVERWRITE=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_BOUNCE_BUFFER=y CONFIG_DFU_MMC=y diff --git a/include/configs/apalis_imx6.h b/include/configs/apalis_imx6.h index 12de0105c6c7..32c5e44fd8fb 100644 --- a/include/configs/apalis_imx6.h +++ b/include/configs/apalis_imx6.h @@ -27,7 +27,6 @@ #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG #define CONFIG_REVISION_TAG -#define CONFIG_SERIAL_TAG /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024) diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h index a496a80e02e5..5ff33a3505cc 100644 --- a/include/configs/cm_fx6.h +++ b/include/configs/cm_fx6.h @@ -186,7 +186,6 @@ /* Boot */ #define CONFIG_SYS_BOOTMAPSZ (8 << 20) -#define CONFIG_SERIAL_TAG /* misc */ #define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024) diff --git a/include/configs/colibri_imx6.h b/include/configs/colibri_imx6.h index 804a144a03e1..8b608f097990 100644 --- a/include/configs/colibri_imx6.h +++ b/include/configs/colibri_imx6.h @@ -25,7 +25,6 @@ #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_INITRD_TAG #define CONFIG_REVISION_TAG -#define CONFIG_SERIAL_TAG /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (32 * 1024 * 1024) diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h index 4f2727363477..3244baa28849 100644 --- a/include/configs/gw_ventana.h +++ b/include/configs/gw_ventana.h @@ -26,9 +26,6 @@ #define CONFIG_MACH_TYPE 4520 /* Gateworks Ventana Platform */ -/* Serial ATAG */ -#define CONFIG_SERIAL_TAG - /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M) diff --git a/include/configs/imx8ulp_evk.h b/include/configs/imx8ulp_evk.h index 32f8773b241e..782c2bfe0a63 100644 --- a/include/configs/imx8ulp_evk.h +++ b/include/configs/imx8ulp_evk.h @@ -33,8 +33,6 @@ #endif -#define CONFIG_SERIAL_TAG - #define CONFIG_REMAKE_ELF #define CONFIG_BOARD_EARLY_INIT_F diff --git a/include/configs/puma_rk3399.h b/include/configs/puma_rk3399.h index f52ea014b5d6..23de326e7208 100644 --- a/include/configs/puma_rk3399.h +++ b/include/configs/puma_rk3399.h @@ -10,6 +10,4 @@ #define SDRAM_BANK_SIZE (2UL << 30) -#define CONFIG_SERIAL_TAG - #endif diff --git a/include/configs/warp7.h b/include/configs/warp7.h index a5d52e3977fd..0d642b4cc67c 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -21,9 +21,6 @@ #define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 -/* Switch on SERIAL_TAG */ -#define CONFIG_SERIAL_TAG - #define CONFIG_DFU_ENV_SETTINGS \ "dfu_alt_info=boot raw 0x2 0x1000 mmcpart 1\0" \ -- 2.17.1