From patchwork Thu Apr 6 09:22:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 96916 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp642955qgd; Thu, 6 Apr 2017 02:26:42 -0700 (PDT) X-Received: by 10.28.37.135 with SMTP id l129mr21467817wml.49.1491470802841; Thu, 06 Apr 2017 02:26:42 -0700 (PDT) Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id q10si2135568wmg.61.2017.04.06.02.26.42; Thu, 06 Apr 2017 02:26:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ti.com Received: by lists.denx.de (Postfix, from userid 105) id 76E67C21CA4; Thu, 6 Apr 2017 09:24:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 37B38C21C99; Thu, 6 Apr 2017 09:23:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5FB7AC21C81; Thu, 6 Apr 2017 09:23:19 +0000 (UTC) Received: from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17]) by lists.denx.de (Postfix) with ESMTPS id D4A54C21C58 for ; Thu, 6 Apr 2017 09:23:14 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v369NAGi009694; Thu, 6 Apr 2017 04:23:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1491470590; bh=4UPtbKIWGzMYCAEA4/+dCdvsqPPHXGQ4RoRYLGr84Ro=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=pwm7xe3YglwCPDl21lVofmOtN+M9IWsYmnBiL5gpGLsDv14NKizeOVEqfOInwSjK1 Zq74l2tX5WMgN6N2nbfixsxG18+vFohm3IgYKW0zwLqfWp39ByvgJa3nyZli7VhZB5 e8eYM923nNw7wDLBX7X7hHdN2mGrAU7cqFpxVCCU= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v369NAwO010311; Thu, 6 Apr 2017 04:23:10 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Thu, 6 Apr 2017 04:23:09 -0500 Received: from psplinux063.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v369MvS4011120; Thu, 6 Apr 2017 04:23:07 -0500 From: Sekhar Nori To: Tom Rini , Peter Howard , Lokesh Vutla , Vitaly Andrianov Date: Thu, 6 Apr 2017 14:52:56 +0530 Message-ID: <20170406092257.15541-5-nsekhar@ti.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170406092257.15541-1-nsekhar@ti.com> References: <20170406092257.15541-1-nsekhar@ti.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 4/5] ARM: ti: consolidate mmc environment variables X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Introduce include/environment/ti/mmc.h that consolidates environment variable definitions for various TI boards that support MMC/SD. This allows reuse of same environment variables on non-ARMv7 TI platforms like OMAP-L138 for example. While at it, move DFU-related environment variable includes to only non-SPL builds for AM335x and AM437x since they are not really used for SPL today. Signed-off-by: Sekhar Nori Reviewed-by: Lukasz Majewski Reviewed-by: Tom Rini --- include/configs/am335x_evm.h | 4 ++- include/configs/am43xx_evm.h | 4 ++- include/configs/k2g_evm.h | 2 ++ include/configs/ti_armv7_common.h | 61 ----------------------------------- include/configs/ti_omap4_common.h | 1 + include/configs/ti_omap5_common.h | 2 ++ include/environment/ti/mmc.h | 68 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 79 insertions(+), 63 deletions(-) create mode 100644 include/environment/ti/mmc.h diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index 27126871f731..d16b33f6da46 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -17,7 +17,6 @@ #define __CONFIG_AM335X_EVM_H #include -#include #ifndef CONFIG_SPL_BUILD # define CONFIG_TIMESTAMP @@ -96,6 +95,9 @@ #include #ifndef CONFIG_SPL_BUILD +#include +#include + #define CONFIG_EXTRA_ENV_SETTINGS \ DEFAULT_LINUX_BOOT_ENV \ DEFAULT_MMC_TI_ARGS \ diff --git a/include/configs/am43xx_evm.h b/include/configs/am43xx_evm.h index ec99958fcd50..1feb94683435 100644 --- a/include/configs/am43xx_evm.h +++ b/include/configs/am43xx_evm.h @@ -13,7 +13,6 @@ #define CONFIG_MAX_RAM_BANK_SIZE (1024 << 21) /* 2GB */ #define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */ -#include #include /* NS16550 Configuration */ @@ -162,6 +161,9 @@ #define CONFIG_TI_EDMA3 #ifndef CONFIG_SPL_BUILD +#include +#include + #define CONFIG_EXTRA_ENV_SETTINGS \ DEFAULT_LINUX_BOOT_ENV \ DEFAULT_MMC_TI_ARGS \ diff --git a/include/configs/k2g_evm.h b/include/configs/k2g_evm.h index bd252312a20b..cb63bef6fcea 100644 --- a/include/configs/k2g_evm.h +++ b/include/configs/k2g_evm.h @@ -10,6 +10,8 @@ #ifndef __CONFIG_K2G_EVM_H #define __CONFIG_K2G_EVM_H +#include + /* Platform type */ #define CONFIG_SOC_K2G diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h index a4ec4ce00a88..c0cf35e5342a 100644 --- a/include/configs/ti_armv7_common.h +++ b/include/configs/ti_armv7_common.h @@ -51,67 +51,6 @@ "bootm_size=0x10000000\0" \ "boot_fdt=try\0" -#define DEFAULT_MMC_TI_ARGS \ - "mmcdev=0\0" \ - "mmcrootfstype=ext4 rootwait\0" \ - "finduuid=part uuid mmc ${bootpart} uuid\0" \ - "args_mmc=run finduuid;setenv bootargs console=${console} " \ - "${optargs} " \ - "root=PARTUUID=${uuid} rw " \ - "rootfstype=${mmcrootfstype}\0" \ - "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ - "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ - "source ${loadaddr}\0" \ - "bootenvfile=uEnv.txt\0" \ - "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ - "env import -t ${loadaddr} ${filesize}\0" \ - "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \ - "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ - "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ - "envboot=mmc dev ${mmcdev}; " \ - "if mmc rescan; then " \ - "echo SD/MMC found on device ${mmcdev};" \ - "if run loadbootscript; then " \ - "run bootscript;" \ - "else " \ - "if run loadbootenv; then " \ - "echo Loaded env from ${bootenvfile};" \ - "run importbootenv;" \ - "fi;" \ - "if test -n $uenvcmd; then " \ - "echo Running uenvcmd ...;" \ - "run uenvcmd;" \ - "fi;" \ - "fi;" \ - "fi;\0" \ - "mmcloados=run args_mmc; " \ - "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ - "if run loadfdt; then " \ - "bootz ${loadaddr} - ${fdtaddr}; " \ - "else " \ - "if test ${boot_fdt} = try; then " \ - "bootz; " \ - "else " \ - "echo WARN: Cannot load the DT; " \ - "fi; " \ - "fi; " \ - "else " \ - "bootz; " \ - "fi;\0" \ - "mmcboot=mmc dev ${mmcdev}; " \ - "setenv devnum ${mmcdev}; " \ - "setenv devtype mmc; " \ - "if mmc rescan; then " \ - "echo SD/MMC found on device ${mmcdev};" \ - "if run loadimage; then " \ - "if test ${boot_fit} -eq 1; then " \ - "run loadfit; " \ - "else " \ - "run mmcloados;" \ - "fi;" \ - "fi;" \ - "fi;\0" \ - #define DEFAULT_FIT_TI_ARGS \ "boot_fit=0\0" \ "fit_loadaddr=0x88000000\0" \ diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h index d07cb9ffb4b3..b85db500b574 100644 --- a/include/configs/ti_omap4_common.h +++ b/include/configs/ti_omap4_common.h @@ -104,6 +104,7 @@ "run distro_bootcmd" #include +#include #define CONFIG_EXTRA_ENV_SETTINGS \ DEFAULT_LINUX_BOOT_ENV \ diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h index 97bd874e6cdd..d45baabf0b60 100644 --- a/include/configs/ti_omap5_common.h +++ b/include/configs/ti_omap5_common.h @@ -58,6 +58,8 @@ #define DFUARGS #endif +#include + #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_EXTRA_ENV_SETTINGS \ DEFAULT_LINUX_BOOT_ENV \ diff --git a/include/environment/ti/mmc.h b/include/environment/ti/mmc.h new file mode 100644 index 000000000000..b987f71516db --- /dev/null +++ b/include/environment/ti/mmc.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com + * + * Environment variable definitions for MMC/SD on TI boards. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#define DEFAULT_MMC_TI_ARGS \ + "mmcdev=0\0" \ + "mmcrootfstype=ext4 rootwait\0" \ + "finduuid=part uuid mmc ${bootpart} uuid\0" \ + "args_mmc=run finduuid;setenv bootargs console=${console} " \ + "${optargs} " \ + "root=PARTUUID=${uuid} rw " \ + "rootfstype=${mmcrootfstype}\0" \ + "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \ + "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \ + "source ${loadaddr}\0" \ + "bootenvfile=uEnv.txt\0" \ + "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \ + "env import -t ${loadaddr} ${filesize}\0" \ + "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}\0" \ + "loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ + "loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ + "envboot=mmc dev ${mmcdev}; " \ + "if mmc rescan; then " \ + "echo SD/MMC found on device ${mmcdev};" \ + "if run loadbootscript; then " \ + "run bootscript;" \ + "else " \ + "if run loadbootenv; then " \ + "echo Loaded env from ${bootenvfile};" \ + "run importbootenv;" \ + "fi;" \ + "if test -n $uenvcmd; then " \ + "echo Running uenvcmd ...;" \ + "run uenvcmd;" \ + "fi;" \ + "fi;" \ + "fi;\0" \ + "mmcloados=run args_mmc; " \ + "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ + "if run loadfdt; then " \ + "bootz ${loadaddr} - ${fdtaddr}; " \ + "else " \ + "if test ${boot_fdt} = try; then " \ + "bootz; " \ + "else " \ + "echo WARN: Cannot load the DT; " \ + "fi; " \ + "fi; " \ + "else " \ + "bootz; " \ + "fi;\0" \ + "mmcboot=mmc dev ${mmcdev}; " \ + "setenv devnum ${mmcdev}; " \ + "setenv devtype mmc; " \ + "if mmc rescan; then " \ + "echo SD/MMC found on device ${mmcdev};" \ + "if run loadimage; then " \ + "if test ${boot_fit} -eq 1; then " \ + "run loadfit; " \ + "else " \ + "run mmcloados;" \ + "fi;" \ + "fi;" \ + "fi;\0"