public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically
@ 2014-11-10 19:38 Fabio Estevam
  2014-11-10 19:51 ` Otavio Salvador
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Fabio Estevam @ 2014-11-10 19:38 UTC (permalink / raw)
  To: u-boot

From: Fabio Estevam <fabio.estevam@freescale.com>

Since kernel 3.15 there are two dtb's for the imx53-qsb board:

imx53-qsb.dtb - For the boards with DA9053 PMIC
imx53-qsrb.dtb - For the boards with MC34708 PMIC

Change the 'fdt_file' dynamically, so that the correct dtb can be used depending
on the board variant.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 board/freescale/mx53loco/mx53loco.c | 4 ++++
 include/configs/mx53loco.h          | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
index b32a97f..7569ded 100644
--- a/board/freescale/mx53loco/mx53loco.c
+++ b/board/freescale/mx53loco/mx53loco.c
@@ -242,6 +242,8 @@ static int power_init(void)
 		if (!p)
 			return -ENODEV;
 
+		setenv("fdt_file", "imx53-qsb.dtb");
+
 		/* Set VDDA to 1.25V */
 		val = DA9052_BUCKCORE_BCOREEN | DA_BUCKCORE_VBCORE_1_250V;
 		ret = pmic_reg_write(p, DA9053_BUCKCORE_REG, val);
@@ -283,6 +285,8 @@ static int power_init(void)
 		if (!p)
 			return -ENODEV;
 
+		setenv("fdt_file", "imx53-qsrb.dtb");
+
 		/* Set VDDGP to 1.25V for 1GHz on SW1 */
 		pmic_reg_read(p, REG_SW_0, &val);
 		val = (val & ~SWx_VOLT_MASK_MC34708) | SWx_1_250V_MC34708;
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index a74508c..10fb1f4 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -107,7 +107,6 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"script=boot.scr\0" \
 	"image=zImage\0" \
-	"fdt_file=imx53-qsb.dtb\0" \
 	"fdt_addr=0x71000000\0" \
 	"boot_fdt=try\0" \
 	"ip_dyn=yes\0" \
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically
  2014-11-10 19:38 [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically Fabio Estevam
@ 2014-11-10 19:51 ` Otavio Salvador
  2014-11-12  8:19 ` Stefano Babic
  2014-11-13 15:35 ` Stefano Babic
  2 siblings, 0 replies; 5+ messages in thread
From: Otavio Salvador @ 2014-11-10 19:51 UTC (permalink / raw)
  To: u-boot

On Mon, Nov 10, 2014 at 5:38 PM, Fabio Estevam <festevam@gmail.com> wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Since kernel 3.15 there are two dtb's for the imx53-qsb board:
>
> imx53-qsb.dtb - For the boards with DA9053 PMIC
> imx53-qsrb.dtb - For the boards with MC34708 PMIC
>
> Change the 'fdt_file' dynamically, so that the correct dtb can be used depending
> on the board variant.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Otavio Salvador <otavio@ossystems.com.br>

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically
  2014-11-10 19:38 [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically Fabio Estevam
  2014-11-10 19:51 ` Otavio Salvador
@ 2014-11-12  8:19 ` Stefano Babic
  2014-11-12 15:51   ` Fabio Estevam
  2014-11-13 15:35 ` Stefano Babic
  2 siblings, 1 reply; 5+ messages in thread
From: Stefano Babic @ 2014-11-12  8:19 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On 10/11/2014 20:38, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Since kernel 3.15 there are two dtb's for the imx53-qsb board:
> 
> imx53-qsb.dtb - For the boards with DA9053 PMIC
> imx53-qsrb.dtb - For the boards with MC34708 PMIC
> 
> Change the 'fdt_file' dynamically, so that the correct dtb can be used depending
> on the board variant.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  board/freescale/mx53loco/mx53loco.c | 4 ++++
>  include/configs/mx53loco.h          | 1 -
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
> index b32a97f..7569ded 100644
> --- a/board/freescale/mx53loco/mx53loco.c
> +++ b/board/freescale/mx53loco/mx53loco.c
> @@ -242,6 +242,8 @@ static int power_init(void)
>  		if (!p)
>  			return -ENODEV;
>  
> +		setenv("fdt_file", "imx53-qsb.dtb");
> +

Generally, I do not find a good idea to overwrite the environment in
code. A user (I mean, a developer) becomes crazy if the environment he
has previously set with "setenv" and "saveenv" has no worth, because
some part of code has overwritten. Let's think to a developer working
with kernel and not with U-Boot, and he has several DTB, depending on
what he want to do.

Anyway, I understand that this helps for a ready-to-use board. I won't
NACK the patch, and you as maintainer of the board are in the best
position to decide, but I want only to ask you what do you think in such
as a case before applying.

Thanks,
Stefano



-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically
  2014-11-12  8:19 ` Stefano Babic
@ 2014-11-12 15:51   ` Fabio Estevam
  0 siblings, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2014-11-12 15:51 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On Wed, Nov 12, 2014 at 6:19 AM, Stefano Babic <sbabic@denx.de> wrote:

> Generally, I do not find a good idea to overwrite the environment in
> code. A user (I mean, a developer) becomes crazy if the environment he
> has previously set with "setenv" and "saveenv" has no worth, because
> some part of code has overwritten. Let's think to a developer working
> with kernel and not with U-Boot, and he has several DTB, depending on
> what he want to do.

You bring a good point and I also agree that in general we should
avoid 'setenv' inside the code.

> Anyway, I understand that this helps for a ready-to-use board. I won't
> NACK the patch, and you as maintainer of the board are in the best
> position to decide, but I want only to ask you what do you think in such
> as a case before applying.

Yes, the idea here was that U-boot could retrieve the correct dtb
automatically for the two board revisions and provide a better user
experience.

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically
  2014-11-10 19:38 [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically Fabio Estevam
  2014-11-10 19:51 ` Otavio Salvador
  2014-11-12  8:19 ` Stefano Babic
@ 2014-11-13 15:35 ` Stefano Babic
  2 siblings, 0 replies; 5+ messages in thread
From: Stefano Babic @ 2014-11-13 15:35 UTC (permalink / raw)
  To: u-boot

On 10/11/2014 20:38, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Since kernel 3.15 there are two dtb's for the imx53-qsb board:
> 
> imx53-qsb.dtb - For the boards with DA9053 PMIC
> imx53-qsrb.dtb - For the boards with MC34708 PMIC
> 
> Change the 'fdt_file' dynamically, so that the correct dtb can be used depending
> on the board variant.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-13 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-10 19:38 [U-Boot] [PATCH] mx53loco: Change 'fdt_file' dynamically Fabio Estevam
2014-11-10 19:51 ` Otavio Salvador
2014-11-12  8:19 ` Stefano Babic
2014-11-12 15:51   ` Fabio Estevam
2014-11-13 15:35 ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox