Re: [U-Boot] [PATCH ] board: ls2080a: Add "mcinitcmd" env for MC & DPL deployment

2016-06-10 Thread York Sun
On 01/19/2016 10:59 PM, Pratiyush Mohan Srivastava wrote:
> From: Pratiyush Mohan Srivastava 
> 
> Environment variable mcinitcmd is defined to initiate MC and DPL deployment
> from the location where it is stored(NOR, NAND, SD, SATA, USB)during u-boot
> booting.If this variable is not defined then macro MC_BOOT_ENV_VAR will be 
> null and
> MC will not be booted and DPL will not be applied during U-boot booting.
> 
> Signed-off-by: Pratiyush Mohan Srivastava 
> Signed-off-by: Prabhakar Kushwaha 
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/README.lsch3 | 29 
> ++
>  board/freescale/ls2080aqds/eth.c   |  5 +
>  board/freescale/ls2080ardb/eth_ls2080rdb.c |  5 +
>  3 files changed, 39 insertions(+)


Applied to fsl-qoriq master. Awaiting upstream. Thanks.

York

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH ] board: ls2080a: Add "mcinitcmd" env for MC & DPL deployment

2016-02-04 Thread Pratiyush Srivastava
-Original Message-
From: york sun 
Sent: Wednesday, January 20, 2016 9:32 PM
To: Pratiyush Mohan Srivastava ; 
u-boot@lists.denx.de
Cc: Prabhakar Kushwaha ; Pratiyush Srivastava 

Subject: Re: [PATCH ] board: ls2080a: Add "mcinitcmd" env for MC & DPL 
deployment

On 01/19/2016 10:59 PM, Pratiyush Mohan Srivastava wrote:
> From: Pratiyush Mohan Srivastava 
> 
> Environment variable mcinitcmd is defined to initiate MC and DPL 
> deployment from the location where it is stored(NOR, NAND, SD, SATA, 
> USB)during u-boot booting.If this variable is not defined then macro 
> MC_BOOT_ENV_VAR will be null and MC will not be booted and DPL will not be 
> applied during U-boot booting.
> 
> Signed-off-by: Pratiyush Mohan Srivastava 
> 
> Signed-off-by: Prabhakar Kushwaha 
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/README.lsch3 | 29 
> ++
>  board/freescale/ls2080aqds/eth.c   |  5 +
>  board/freescale/ls2080ardb/eth_ls2080rdb.c |  5 +
>  3 files changed, 39 insertions(+)
> 



> diff --git a/board/freescale/ls2080aqds/eth.c 
> b/board/freescale/ls2080aqds/eth.c
> index 5b9c2d1..db9de77 100644
> --- a/board/freescale/ls2080aqds/eth.c
> +++ b/board/freescale/ls2080aqds/eth.c
> @@ -20,6 +20,7 @@
>  
>  #include "ls2080aqds_qixis.h"
>  
> +#define MC_BOOT_ENV_VAR "mcinitcmd"
>  
>  #ifdef CONFIG_FSL_MC_ENET
>   /* - In LS2080A there are only 16 SERDES lanes, spread across 2 SERDES 
> banks.
> @@ -714,6 +715,7 @@ void ls2080a_handle_phy_interface_xsgmii(int i)  
> int board_eth_init(bd_t *bis)  {
>   int error;
> + char *mc_boot_env_var;
>  #ifdef CONFIG_FSL_MC_ENET
>   struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR;
>   int serdes1_prtcl = (in_le32(>rcwsr[28]) & @@ -781,6 +783,9 @@ 
> int board_eth_init(bd_t *bis)
>   }
>   }
>  
> + mc_boot_env_var = getenv(MC_BOOT_ENV_VAR);
> + if (mc_boot_env_var)
> + run_command_list(mc_boot_env_var, -1, 0);
>   error = cpu_eth_init(bis);

Why not put the code into cpu_eth_init()?

Ans: While deciding on the location of the command "run_command_list" I could 
not find any prior usage in arch/arm folder. Hence I decided that the 
run_command_list command be kept just before calling cpu_eth_init inside board 
folder.

York

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH ] board: ls2080a: Add "mcinitcmd" env for MC & DPL deployment

2016-01-20 Thread york sun
On 01/19/2016 10:59 PM, Pratiyush Mohan Srivastava wrote:
> From: Pratiyush Mohan Srivastava 
> 
> Environment variable mcinitcmd is defined to initiate MC and DPL deployment
> from the location where it is stored(NOR, NAND, SD, SATA, USB)during u-boot
> booting.If this variable is not defined then macro MC_BOOT_ENV_VAR will be 
> null and
> MC will not be booted and DPL will not be applied during U-boot booting.
> 
> Signed-off-by: Pratiyush Mohan Srivastava 
> Signed-off-by: Prabhakar Kushwaha 
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/README.lsch3 | 29 
> ++
>  board/freescale/ls2080aqds/eth.c   |  5 +
>  board/freescale/ls2080ardb/eth_ls2080rdb.c |  5 +
>  3 files changed, 39 insertions(+)
> 



> diff --git a/board/freescale/ls2080aqds/eth.c 
> b/board/freescale/ls2080aqds/eth.c
> index 5b9c2d1..db9de77 100644
> --- a/board/freescale/ls2080aqds/eth.c
> +++ b/board/freescale/ls2080aqds/eth.c
> @@ -20,6 +20,7 @@
>  
>  #include "ls2080aqds_qixis.h"
>  
> +#define MC_BOOT_ENV_VAR "mcinitcmd"
>  
>  #ifdef CONFIG_FSL_MC_ENET
>   /* - In LS2080A there are only 16 SERDES lanes, spread across 2 SERDES 
> banks.
> @@ -714,6 +715,7 @@ void ls2080a_handle_phy_interface_xsgmii(int i)
>  int board_eth_init(bd_t *bis)
>  {
>   int error;
> + char *mc_boot_env_var;
>  #ifdef CONFIG_FSL_MC_ENET
>   struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR;
>   int serdes1_prtcl = (in_le32(>rcwsr[28]) &
> @@ -781,6 +783,9 @@ int board_eth_init(bd_t *bis)
>   }
>   }
>  
> + mc_boot_env_var = getenv(MC_BOOT_ENV_VAR);
> + if (mc_boot_env_var)
> + run_command_list(mc_boot_env_var, -1, 0);
>   error = cpu_eth_init(bis);

Why not put the code into cpu_eth_init()?

York

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH ] board: ls2080a: Add "mcinitcmd" env for MC & DPL deployment

2016-01-19 Thread Pratiyush Mohan Srivastava
From: Pratiyush Mohan Srivastava 

Environment variable mcinitcmd is defined to initiate MC and DPL deployment
from the location where it is stored(NOR, NAND, SD, SATA, USB)during u-boot
booting.If this variable is not defined then macro MC_BOOT_ENV_VAR will be null 
and
MC will not be booted and DPL will not be applied during U-boot booting.

Signed-off-by: Pratiyush Mohan Srivastava 
Signed-off-by: Prabhakar Kushwaha 
---
 arch/arm/cpu/armv8/fsl-layerscape/README.lsch3 | 29 ++
 board/freescale/ls2080aqds/eth.c   |  5 +
 board/freescale/ls2080ardb/eth_ls2080rdb.c |  5 +
 3 files changed, 39 insertions(+)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/README.lsch3 
b/arch/arm/cpu/armv8/fsl-layerscape/README.lsch3
index f9323c1..da5e052 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/README.lsch3
+++ b/arch/arm/cpu/armv8/fsl-layerscape/README.lsch3
@@ -121,6 +121,35 @@ mcboottimeout: MC boot timeout in milliseconds. If 
this variable is not defined
 mcmemsize: MC DRAM block size. If this variable is not defined, the value
CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE will be assumed.
 
+mcinitcmd: This environment variable is defined to initiate MC and DPL 
deployment
+   from the location where it is stored(NOR, NAND, SD, SATA, 
USB)during
+   u-boot booting.If this variable is not defined then 
MC_BOOT_ENV_VAR
+   will be null and MC will not be booted and DPL will not be 
applied
+   during U-boot booting.However the MC, DPC and DPL can be 
applied from
+   console independently.
+   The variable needs to be set from the console once and then on
+   rebooting the parameters set in the varible will automatically 
be
+   executed. The commmand is demostrated taking an example of mc 
boot
+   using NOR Flash i.e. MC, DPL, and DPC is stored in the NOR 
flash:
+
+   cp.b 0xa000 0x58030 $filesize
+   cp.b 0x8000 0x58080 $filesize
+   cp.b 0x9000 0x58070 $filesize
+
+   setenv mcinitcmd 'fsl_mc start mc 0x58030 0x58080'
+
+   If only linux is to be booted then the mcinitcmd environment 
should be set as
+
+   setenv mcinitcmd 'fsl_mc start mc 0x58030 
0x58080;fsl_mc apply DPL 0x58070'
+
+   Here the addresses 0xa000, 0x8000, 0x8000 are of 
DDR to where
+   MC binary, DPC binary and DPL binary are stored and 
0x58030, 0x58080
+   and 0x58070 are addresses in NOR where these are copied. It 
is to be
+   noted that these addresses in 'fsl_mc start mc 0x58030 
0x58080;fsl_mc apply DPL 0x58070'
+   can be replaced with the addresses of DDR to
+   which these will be copied in case of these binaries being 
stored in other
+   devices like SATA, USB, NAND, SD etc.
+
 Booting from NAND
 ---
 Booting from NAND requires two images, RCW and u-boot-with-spl.bin.
diff --git a/board/freescale/ls2080aqds/eth.c b/board/freescale/ls2080aqds/eth.c
index 5b9c2d1..db9de77 100644
--- a/board/freescale/ls2080aqds/eth.c
+++ b/board/freescale/ls2080aqds/eth.c
@@ -20,6 +20,7 @@
 
 #include "ls2080aqds_qixis.h"
 
+#define MC_BOOT_ENV_VAR "mcinitcmd"
 
 #ifdef CONFIG_FSL_MC_ENET
  /* - In LS2080A there are only 16 SERDES lanes, spread across 2 SERDES banks.
@@ -714,6 +715,7 @@ void ls2080a_handle_phy_interface_xsgmii(int i)
 int board_eth_init(bd_t *bis)
 {
int error;
+   char *mc_boot_env_var;
 #ifdef CONFIG_FSL_MC_ENET
struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR;
int serdes1_prtcl = (in_le32(>rcwsr[28]) &
@@ -781,6 +783,9 @@ int board_eth_init(bd_t *bis)
}
}
 
+   mc_boot_env_var = getenv(MC_BOOT_ENV_VAR);
+   if (mc_boot_env_var)
+   run_command_list(mc_boot_env_var, -1, 0);
error = cpu_eth_init(bis);
 
if (hwconfig_f("xqsgmii", env_hwconfig)) {
diff --git a/board/freescale/ls2080ardb/eth_ls2080rdb.c 
b/board/freescale/ls2080ardb/eth_ls2080rdb.c
index 58ea746..758bb3d 100644
--- a/board/freescale/ls2080ardb/eth_ls2080rdb.c
+++ b/board/freescale/ls2080ardb/eth_ls2080rdb.c
@@ -20,9 +20,11 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define MC_BOOT_ENV_VAR "mcinitcmd"
 int board_eth_init(bd_t *bis)
 {
 #if defined(CONFIG_FSL_MC_ENET)
+   char *mc_boot_env_var;
int i, interface;
struct memac_mdio_info mdio_info;
struct mii_dev *dev;
@@ -89,6 +91,9 @@ int board_eth_init(bd_t *bis)
}
}
 
+   mc_boot_env_var = getenv(MC_BOOT_ENV_VAR);
+   if (mc_boot_env_var)
+   run_command_list(mc_boot_env_var, -1, 0);
cpu_eth_init(bis);
 #endif /* CONFIG_FMAN_ENET */
 
--