All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 4/5] ARM: ti: consolidate mmc environment variables
Date: Thu, 6 Apr 2017 12:05:59 +0200	[thread overview]
Message-ID: <20170406120559.0727c79f@jawa> (raw)
In-Reply-To: <20170406092257.15541-5-nsekhar@ti.com>

On Thu, 6 Apr 2017 14:52:56 +0530
Sekhar Nori <nsekhar@ti.com> wrote:

> 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 <nsekhar@ti.com>
> ---
>  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 <configs/ti_am335x_common.h>
> -#include <environment/ti/dfu.h>
>  
>  #ifndef CONFIG_SPL_BUILD
>  # define CONFIG_TIMESTAMP
> @@ -96,6 +95,9 @@
>  #include <config_distro_bootcmd.h>
>  
>  #ifndef CONFIG_SPL_BUILD
> +#include <environment/ti/dfu.h>
> +#include <environment/ti/mmc.h>
> +
>  #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 <environment/ti/dfu.h>
>  #include <asm/arch/omap.h>
>  
>  /* NS16550 Configuration */
> @@ -162,6 +161,9 @@
>  #define CONFIG_TI_EDMA3
>  
>  #ifndef CONFIG_SPL_BUILD
> +#include <environment/ti/dfu.h>
> +#include <environment/ti/mmc.h>
> +
>  #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 <environment/ti/mmc.h>
> +
>  /* 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 <config_distro_bootcmd.h>
> +#include <environment/ti/mmc.h>
>  
>  #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 <environment/ti/mmc.h>
> +
>  #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"

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

  reply	other threads:[~2017-04-06 10:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06  9:22 [U-Boot] [PATCH 0/5] davinci: omapl138_lcdk: align mmcboot with rest of TI boards Sekhar Nori
2017-04-06  9:22 ` [U-Boot] [PATCH 1/5] davinci: omapl138_lcdk: remove spiboot Sekhar Nori
2017-04-06  9:57   ` Lukasz Majewski
2017-04-06 16:23   ` Tom Rini
2017-04-10 18:24   ` [U-Boot] [U-Boot,1/5] " Tom Rini
2017-04-06  9:22 ` [U-Boot] [PATCH 2/5] davinci: omapl138_lcdk: enable some filesystem related commands Sekhar Nori
2017-04-06  9:58   ` Lukasz Majewski
2017-04-07  5:20     ` Sekhar Nori
2017-04-06 16:23   ` Tom Rini
2017-04-10 18:24   ` [U-Boot] [U-Boot, " Tom Rini
2017-04-06  9:22 ` [U-Boot] [PATCH 3/5] davinci: omapl138_lcdk: use environment variables for memory addresses Sekhar Nori
2017-04-06  9:59   ` Lukasz Majewski
2017-04-06 16:23   ` Tom Rini
2017-04-10 18:24   ` [U-Boot] [U-Boot, " Tom Rini
2017-04-06  9:22 ` [U-Boot] [PATCH 4/5] ARM: ti: consolidate mmc environment variables Sekhar Nori
2017-04-06 10:05   ` Lukasz Majewski [this message]
2017-04-06 16:23   ` Tom Rini
2017-04-10 18:24   ` [U-Boot] [U-Boot, " Tom Rini
2017-04-06  9:22 ` [U-Boot] [PATCH 5/5] davinci: omapl138_lcdk: switch to using common mmc args Sekhar Nori
2017-04-06 10:06   ` Lukasz Majewski
2017-04-06 16:23   ` Tom Rini
2017-04-10 18:24   ` [U-Boot] [U-Boot, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170406120559.0727c79f@jawa \
    --to=lukma@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.