All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] board/ls2080ardb: Update board env based on SoC
@ 2017-08-24  7:06 Priyanka Jain
  2017-08-24 14:55 ` York Sun
  0 siblings, 1 reply; 5+ messages in thread
From: Priyanka Jain @ 2017-08-24  7:06 UTC (permalink / raw)
  To: u-boot

As per current implemenetation, default value of board env is
based on board filename i.e ls2080ardb.

With distro support changes, this env is used to decide upon
kernel dtb which is different for other SoCs (ls2088a, ls2081a)
combination supported with this board.

Add support to modify board env based on SoC type

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
---
 board/freescale/ls2080ardb/ls2080ardb.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c
index d7122b3..ca9c047 100644
--- a/board/freescale/ls2080ardb/ls2080ardb.c
+++ b/board/freescale/ls2080ardb/ls2080ardb.c
@@ -247,6 +247,8 @@ int misc_init_r(void)
 	char *env_hwconfig;
 	u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
 	u32 val;
+	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+	u32 svr = gur_in32(&gur->svr);
 
 	val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4);
 
@@ -274,6 +276,16 @@ int misc_init_r(void)
 
 	if (adjust_vdd(0))
 		printf("Warning: Adjusting core voltage failed.\n");
+	/*
+	 * Default value of board env is based on filename which is
+	 * ls2080ardb. Modify board env for other supported SoCs
+	 */
+	if ((SVR_SOC_VER(svr) == SVR_LS2088A) ||
+	    (SVR_SOC_VER(svr) == SVR_LS2048A))
+		setenv("board", "ls2088ardb");
+	else if ((SVR_SOC_VER(svr) == SVR_LS2081A) ||
+	    (SVR_SOC_VER(svr) == SVR_LS2041A))
+		setenv("board", "ls2081ardb");
 
 	return 0;
 }
-- 
1.7.4.1

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

* [U-Boot] [PATCH] board/ls2080ardb: Update board env based on SoC
  2017-08-24  7:06 [U-Boot] [PATCH] board/ls2080ardb: Update board env based on SoC Priyanka Jain
@ 2017-08-24 14:55 ` York Sun
  2017-08-25  4:52   ` Priyanka Jain
  0 siblings, 1 reply; 5+ messages in thread
From: York Sun @ 2017-08-24 14:55 UTC (permalink / raw)
  To: u-boot

On 08/24/2017 12:07 AM, Priyanka Jain wrote:
> As per current implemenetation, default value of board env is
> based on board filename i.e ls2080ardb.
> 
> With distro support changes, this env is used to decide upon
> kernel dtb which is different for other SoCs (ls2088a, ls2081a)
> combination supported with this board.
> 
> Add support to modify board env based on SoC type

Please point me to where environmental variable "board" is used for 
distro boot. I only see it for PXE.

> 
> Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
> ---
>   board/freescale/ls2080ardb/ls2080ardb.c |   12 ++++++++++++
>   1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/board/freescale/ls2080ardb/ls2080ardb.c b/board/freescale/ls2080ardb/ls2080ardb.c
> index d7122b3..ca9c047 100644
> --- a/board/freescale/ls2080ardb/ls2080ardb.c
> +++ b/board/freescale/ls2080ardb/ls2080ardb.c
> @@ -247,6 +247,8 @@ int misc_init_r(void)
>   	char *env_hwconfig;
>   	u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
>   	u32 val;
> +	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
> +	u32 svr = gur_in32(&gur->svr);
>   
>   	val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4);
>   
> @@ -274,6 +276,16 @@ int misc_init_r(void)
>   
>   	if (adjust_vdd(0))
>   		printf("Warning: Adjusting core voltage failed.\n");
> +	/*
> +	 * Default value of board env is based on filename which is
> +	 * ls2080ardb. Modify board env for other supported SoCs
> +	 */
> +	if ((SVR_SOC_VER(svr) == SVR_LS2088A) ||
> +	    (SVR_SOC_VER(svr) == SVR_LS2048A))
> +		setenv("board", "ls2088ardb");
> +	else if ((SVR_SOC_VER(svr) == SVR_LS2081A) ||
> +	    (SVR_SOC_VER(svr) == SVR_LS2041A))
> +		setenv("board", "ls2081ardb");

Please double check this. I think "setenv" has been replaced by 
"env_set" as of commit 382bee57f.

York

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

* [U-Boot] [PATCH] board/ls2080ardb: Update board env based on SoC
  2017-08-24 14:55 ` York Sun
@ 2017-08-25  4:52   ` Priyanka Jain
  2017-08-25 15:22     ` York Sun
  0 siblings, 1 reply; 5+ messages in thread
From: Priyanka Jain @ 2017-08-25  4:52 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: York Sun
> Sent: Thursday, August 24, 2017 8:26 PM
> To: Priyanka Jain <priyanka.jain@nxp.com>; u-boot at lists.denx.de
> Subject: Re: [PATCH] board/ls2080ardb: Update board env based on SoC
> 
> On 08/24/2017 12:07 AM, Priyanka Jain wrote:
> > As per current implemenetation, default value of board env is based on
> > board filename i.e ls2080ardb.
> >
> > With distro support changes, this env is used to decide upon kernel
> > dtb which is different for other SoCs (ls2088a, ls2081a) combination
> > supported with this board.
> >
> > Add support to modify board env based on SoC type
> 
> Please point me to where environmental variable "board" is used for distro boot.
> I only see it for PXE.
Please refer to file end part in "ENV_SETTINGS" section in file "include/configs/ls2080ardb.h", 
Linux boot commands like "nor_bootcmd" uses command "bootm $loadr_addr#$board"
Depending upon board value, kernel dtb is chosen.
> 
> >
> > Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
> > ---
> >   board/freescale/ls2080ardb/ls2080ardb.c |   12 ++++++++++++
> >   1 files changed, 12 insertions(+), 0 deletions(-)
> >
> > diff --git a/board/freescale/ls2080ardb/ls2080ardb.c
> > b/board/freescale/ls2080ardb/ls2080ardb.c
> > index d7122b3..ca9c047 100644
> > --- a/board/freescale/ls2080ardb/ls2080ardb.c
> > +++ b/board/freescale/ls2080ardb/ls2080ardb.c
> > @@ -247,6 +247,8 @@ int misc_init_r(void)
> >   	char *env_hwconfig;
> >   	u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
> >   	u32 val;
> > +	struct ccsr_gur __iomem *gur = (void
> *)(CONFIG_SYS_FSL_GUTS_ADDR);
> > +	u32 svr = gur_in32(&gur->svr);
> >
> >   	val = in_le32(dcfg_ccsr + DCFG_RCWSR13 / 4);
> >
> > @@ -274,6 +276,16 @@ int misc_init_r(void)
> >
> >   	if (adjust_vdd(0))
> >   		printf("Warning: Adjusting core voltage failed.\n");
> > +	/*
> > +	 * Default value of board env is based on filename which is
> > +	 * ls2080ardb. Modify board env for other supported SoCs
> > +	 */
> > +	if ((SVR_SOC_VER(svr) == SVR_LS2088A) ||
> > +	    (SVR_SOC_VER(svr) == SVR_LS2048A))
> > +		setenv("board", "ls2088ardb");
> > +	else if ((SVR_SOC_VER(svr) == SVR_LS2081A) ||
> > +	    (SVR_SOC_VER(svr) == SVR_LS2041A))
> > +		setenv("board", "ls2081ardb");
> 
> Please double check this. I think "setenv" has been replaced by "env_set" as of
> commit 382bee57f.
> 
> York
Thanks, I will change "setenv" to "env_set"

Priyanka

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

* [U-Boot] [PATCH] board/ls2080ardb: Update board env based on SoC
  2017-08-25  4:52   ` Priyanka Jain
@ 2017-08-25 15:22     ` York Sun
  2017-08-29  8:54       ` Priyanka Jain
  0 siblings, 1 reply; 5+ messages in thread
From: York Sun @ 2017-08-25 15:22 UTC (permalink / raw)
  To: u-boot

On 08/24/2017 09:52 PM, Priyanka Jain wrote:
> 
> 
>> -----Original Message-----
>> From: York Sun
>> Sent: Thursday, August 24, 2017 8:26 PM
>> To: Priyanka Jain <priyanka.jain@nxp.com>; u-boot at lists.denx.de
>> Subject: Re: [PATCH] board/ls2080ardb: Update board env based on SoC
>>
>> On 08/24/2017 12:07 AM, Priyanka Jain wrote:
>>> As per current implemenetation, default value of board env is based on
>>> board filename i.e ls2080ardb.
>>>
>>> With distro support changes, this env is used to decide upon kernel
>>> dtb which is different for other SoCs (ls2088a, ls2081a) combination
>>> supported with this board.
>>>
>>> Add support to modify board env based on SoC type
>>
>> Please point me to where environmental variable "board" is used for distro boot.
>> I only see it for PXE.
> Please refer to file end part in "ENV_SETTINGS" section in file "include/configs/ls2080ardb.h",
> Linux boot commands like "nor_bootcmd" uses command "bootm $loadr_addr#$board"
> Depending upon board value, kernel dtb is chosen.

I see. It is not a variable used by U-Boot itself. I wonder if you can 
use multiple configurations in FIT image to maximize the flexibility to 
load different device tree image.

York

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

* [U-Boot] [PATCH] board/ls2080ardb: Update board env based on SoC
  2017-08-25 15:22     ` York Sun
@ 2017-08-29  8:54       ` Priyanka Jain
  0 siblings, 0 replies; 5+ messages in thread
From: Priyanka Jain @ 2017-08-29  8:54 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: York Sun
> Sent: Friday, August 25, 2017 8:53 PM
> To: Priyanka Jain <priyanka.jain@nxp.com>; u-boot at lists.denx.de
> Subject: Re: [PATCH] board/ls2080ardb: Update board env based on SoC
> 
> On 08/24/2017 09:52 PM, Priyanka Jain wrote:
> >
> >
> >> -----Original Message-----
> >> From: York Sun
> >> Sent: Thursday, August 24, 2017 8:26 PM
> >> To: Priyanka Jain <priyanka.jain@nxp.com>; u-boot at lists.denx.de
> >> Subject: Re: [PATCH] board/ls2080ardb: Update board env based on SoC
> >>
> >> On 08/24/2017 12:07 AM, Priyanka Jain wrote:
> >>> As per current implemenetation, default value of board env is based
> >>> on board filename i.e ls2080ardb.
> >>>
> >>> With distro support changes, this env is used to decide upon kernel
> >>> dtb which is different for other SoCs (ls2088a, ls2081a) combination
> >>> supported with this board.
> >>>
> >>> Add support to modify board env based on SoC type
> >>
> >> Please point me to where environmental variable "board" is used for distro
> boot.
> >> I only see it for PXE.
> > Please refer to file end part in "ENV_SETTINGS" section in file
> > "include/configs/ls2080ardb.h", Linux boot commands like "nor_bootcmd"
> uses command "bootm $loadr_addr#$board"
> > Depending upon board value, kernel dtb is chosen.
> 
> I see. It is not a variable used by U-Boot itself. I wonder if you can use multiple
> configurations in FIT image to maximize the flexibility to load different device
> tree image.
> 
> York
This is mainly useful when we are booting using separate images , not a FIT image.
Example of use case:
LS2080ARDB can supports ls2080a, ls2081a, ls2088a socs.
Single flash image is build for the board which can support either combination of SoC.
kernel is booted with same itb which is flex_installer_arm64.itb which depending on $board env selects dtb image on NOR flash.
flex_installer_arm64.itb has configuration like:
configurations {
default = "ls2088ardb";

ls2080ardb {
description = "config for ls2080ardb";
kernel = "kernel";
ramdisk = "initrd-installer";
fdt = "ls2080ardb-dtb";
};

ls2088ardb {
description = "config for ls2088ardb";
kernel = "kernel";
ramdisk = "initrd-installer";
fdt = "ls2088ardb-dtb";
};

Priyanka

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

end of thread, other threads:[~2017-08-29  8:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-24  7:06 [U-Boot] [PATCH] board/ls2080ardb: Update board env based on SoC Priyanka Jain
2017-08-24 14:55 ` York Sun
2017-08-25  4:52   ` Priyanka Jain
2017-08-25 15:22     ` York Sun
2017-08-29  8:54       ` Priyanka Jain

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.