diff mbox

[U-Boot,v3,5/7] zynq: Add support for auto nandboot

Message ID dfeead1d-0cc5-4bb4-9c4b-8e7d9f27821b@TX2EHSMHS006.ehs.local
State Changes Requested
Delegated to: Albert ARIBAUD
Headers show

Commit Message

Siva Durga Prasad Paladugu Feb. 17, 2014, 12:26 p.m. UTC
From: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>

Added support to find the nand bootmode and also
updated the default env. with nandboot.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
---
Changes for v3:
-Separated out the nand patch series
 as per Michal comment.
Changes for v2:
-None
---
 board/xilinx/zynq/board.c     |    4 ++++
 doc/README.zynq               |    3 ++-
 include/configs/zynq-common.h |    3 +++
 3 files changed, 9 insertions(+), 1 deletions(-)

Comments

Andrew Murray Feb. 17, 2014, 1:04 p.m. UTC | #1
On 17 February 2014 12:26, Siva Durga Prasad Paladugu
<siva.durga.paladugu@xilinx.com> wrote:
> From: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
>
> Added support to find the nand bootmode and also
> updated the default env. with nandboot.
>
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
> ---
> Changes for v3:
> -Separated out the nand patch series
>  as per Michal comment.
> Changes for v2:
> -None
> ---
>  board/xilinx/zynq/board.c     |    4 ++++
>  doc/README.zynq               |    3 ++-
>  include/configs/zynq-common.h |    3 +++
>  3 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
> index 5a47149..9dd158c 100644
> --- a/board/xilinx/zynq/board.c
> +++ b/board/xilinx/zynq/board.c
> @@ -15,6 +15,7 @@ DECLARE_GLOBAL_DATA_PTR;
>  /* Bootmode setting values */
>  #define ZYNQ_BM_MASK           0x0F
>  #define ZYNQ_BM_NOR            0x02
> +#define ZYNQ_BM_NAND           0x04
>  #define ZYNQ_BM_SD             0x05
>  #define ZYNQ_BM_JTAG           0x0
>
> @@ -75,6 +76,9 @@ int board_late_init(void)
>         case ZYNQ_BM_NOR:
>                 setenv("modeboot", "norboot");
>                 break;
> +       case ZYNQ_BM_NAND:
> +               setenv("modeboot", "nandboot");
> +               break;
>         case ZYNQ_BM_SD:
>                 setenv("modeboot", "sdboot");
>                 break;
> diff --git a/doc/README.zynq b/doc/README.zynq
> index 043c970..e0b38cf 100644
> --- a/doc/README.zynq
> +++ b/doc/README.zynq
> @@ -54,10 +54,11 @@ is intern used in autoboot.
>
>  SLCR bootmode register Bit[3:0] values
>  #define ZYNQ_BM_NOR            0x02
> +#define ZYNQ_BM_NOR            0x04
>  #define ZYNQ_BM_SD             0x05
>  #define ZYNQ_BM_JTAG           0x0
>
> -"modeboot" variable can assign any of "norboot", "sdboot" or "jtagboot"
> +"modeboot" variable can assign any of "norboot", "nandboot", "sdboot" or "jtagboot"
>  bootmode strings at runtime.
>
>  5. Mainline status
> diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
> index 08adaa2..068e59a 100644
> --- a/include/configs/zynq-common.h
> +++ b/include/configs/zynq-common.h
> @@ -170,6 +170,9 @@
>         "norboot=echo Copying FIT from NOR flash to RAM... && " \
>                 "cp.b ${nor_flash_off} ${load_addr} ${fit_size} && " \
>                 "bootm ${load_addr}\0" \
> +       "nandboot=echo Copying FIT from NAND flash to RAM... && " \
> +               "nand read ${load_addr} ${flash_off} ${fit_size} && " \
> +               "bootm ${load_addr}\0" \

Is there an opportunity to use 'nboot' here? i.e. nboot ${load_addr} 0
${flash_off} (instead of nand read and bootm)

This would mean you don't waste time reading NAND you don't use and
you don't have to worry about maintaining ${fit_size} whenever the
kernel changes size.

Andrew Murray

>         "sdboot=echo Copying FIT from SD to RAM... && " \
>                 "fatload mmc 0 ${load_addr} ${fit_image} && " \
>                 "bootm ${load_addr}\0" \
> --
> 1.7.4
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
Jagan Teki Feb. 17, 2014, 2:33 p.m. UTC | #2
On Mon, Feb 17, 2014 at 6:34 PM, Andrew Murray
<amurray@embedded-bits.co.uk> wrote:
> On 17 February 2014 12:26, Siva Durga Prasad Paladugu
> <siva.durga.paladugu@xilinx.com> wrote:
>> From: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
>>
>> Added support to find the nand bootmode and also
>> updated the default env. with nandboot.
>>
>> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
>> Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
>> ---
>> Changes for v3:
>> -Separated out the nand patch series
>>  as per Michal comment.
>> Changes for v2:
>> -None
>> ---
>>  board/xilinx/zynq/board.c     |    4 ++++
>>  doc/README.zynq               |    3 ++-
>>  include/configs/zynq-common.h |    3 +++
>>  3 files changed, 9 insertions(+), 1 deletions(-)
>>
>> diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
>> index 5a47149..9dd158c 100644
>> --- a/board/xilinx/zynq/board.c
>> +++ b/board/xilinx/zynq/board.c
>> @@ -15,6 +15,7 @@ DECLARE_GLOBAL_DATA_PTR;
>>  /* Bootmode setting values */
>>  #define ZYNQ_BM_MASK           0x0F
>>  #define ZYNQ_BM_NOR            0x02
>> +#define ZYNQ_BM_NAND           0x04
>>  #define ZYNQ_BM_SD             0x05
>>  #define ZYNQ_BM_JTAG           0x0
>>
>> @@ -75,6 +76,9 @@ int board_late_init(void)
>>         case ZYNQ_BM_NOR:
>>                 setenv("modeboot", "norboot");
>>                 break;
>> +       case ZYNQ_BM_NAND:
>> +               setenv("modeboot", "nandboot");
>> +               break;
>>         case ZYNQ_BM_SD:
>>                 setenv("modeboot", "sdboot");
>>                 break;
>> diff --git a/doc/README.zynq b/doc/README.zynq
>> index 043c970..e0b38cf 100644
>> --- a/doc/README.zynq
>> +++ b/doc/README.zynq
>> @@ -54,10 +54,11 @@ is intern used in autoboot.
>>
>>  SLCR bootmode register Bit[3:0] values
>>  #define ZYNQ_BM_NOR            0x02
>> +#define ZYNQ_BM_NOR            0x04
>>  #define ZYNQ_BM_SD             0x05
>>  #define ZYNQ_BM_JTAG           0x0
>>
>> -"modeboot" variable can assign any of "norboot", "sdboot" or "jtagboot"
>> +"modeboot" variable can assign any of "norboot", "nandboot", "sdboot" or "jtagboot"
>>  bootmode strings at runtime.
>>
>>  5. Mainline status
>> diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
>> index 08adaa2..068e59a 100644
>> --- a/include/configs/zynq-common.h
>> +++ b/include/configs/zynq-common.h
>> @@ -170,6 +170,9 @@
>>         "norboot=echo Copying FIT from NOR flash to RAM... && " \
>>                 "cp.b ${nor_flash_off} ${load_addr} ${fit_size} && " \
>>                 "bootm ${load_addr}\0" \
>> +       "nandboot=echo Copying FIT from NAND flash to RAM... && " \
>> +               "nand read ${load_addr} ${flash_off} ${fit_size} && " \
>> +               "bootm ${load_addr}\0" \
>
> Is there an opportunity to use 'nboot' here? i.e. nboot ${load_addr} 0
> ${flash_off} (instead of nand read and bootm)
>
> This would mean you don't waste time reading NAND you don't use and
> you don't have to worry about maintaining ${fit_size} whenever the
> kernel changes size.

Yes - we can use, thanks for pointing.

>
> Andrew Murray
>
>>         "sdboot=echo Copying FIT from SD to RAM... && " \
>>                 "fatload mmc 0 ${load_addr} ${fit_image} && " \
>>                 "bootm ${load_addr}\0" \
>> --
>> 1.7.4

thanks!
Jagan Teki Feb. 17, 2014, 2:35 p.m. UTC | #3
Hi Siva,

On Mon, Feb 17, 2014 at 5:56 PM, Siva Durga Prasad Paladugu
<siva.durga.paladugu@xilinx.com> wrote:
> From: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
>
> Added support to find the nand bootmode and also
> updated the default env. with nandboot.
>
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
> ---
> Changes for v3:
> -Separated out the nand patch series
>  as per Michal comment.
> Changes for v2:
> -None
> ---
>  board/xilinx/zynq/board.c     |    4 ++++
>  doc/README.zynq               |    3 ++-
>  include/configs/zynq-common.h |    3 +++
>  3 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
> index 5a47149..9dd158c 100644
> --- a/board/xilinx/zynq/board.c
> +++ b/board/xilinx/zynq/board.c
> @@ -15,6 +15,7 @@ DECLARE_GLOBAL_DATA_PTR;
>  /* Bootmode setting values */
>  #define ZYNQ_BM_MASK           0x0F
>  #define ZYNQ_BM_NOR            0x02
> +#define ZYNQ_BM_NAND           0x04
>  #define ZYNQ_BM_SD             0x05
>  #define ZYNQ_BM_JTAG           0x0
>
> @@ -75,6 +76,9 @@ int board_late_init(void)
>         case ZYNQ_BM_NOR:
>                 setenv("modeboot", "norboot");
>                 break;
> +       case ZYNQ_BM_NAND:
> +               setenv("modeboot", "nandboot");
> +               break;
>         case ZYNQ_BM_SD:
>                 setenv("modeboot", "sdboot");
>                 break;
> diff --git a/doc/README.zynq b/doc/README.zynq
> index 043c970..e0b38cf 100644
> --- a/doc/README.zynq
> +++ b/doc/README.zynq
> @@ -54,10 +54,11 @@ is intern used in autoboot.
>
>  SLCR bootmode register Bit[3:0] values
>  #define ZYNQ_BM_NOR            0x02
> +#define ZYNQ_BM_NOR            0x04

Can you please correct this typo - I think it's ZYNQ_BM_NAND

>  #define ZYNQ_BM_SD             0x05
>  #define ZYNQ_BM_JTAG           0x0
>
> -"modeboot" variable can assign any of "norboot", "sdboot" or "jtagboot"
> +"modeboot" variable can assign any of "norboot", "nandboot", "sdboot" or "jtagboot"
>  bootmode strings at runtime.
>
>  5. Mainline status
> diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
> index 08adaa2..068e59a 100644
> --- a/include/configs/zynq-common.h
> +++ b/include/configs/zynq-common.h
> @@ -170,6 +170,9 @@
>         "norboot=echo Copying FIT from NOR flash to RAM... && " \
>                 "cp.b ${nor_flash_off} ${load_addr} ${fit_size} && " \
>                 "bootm ${load_addr}\0" \
> +       "nandboot=echo Copying FIT from NAND flash to RAM... && " \
> +               "nand read ${load_addr} ${flash_off} ${fit_size} && " \
> +               "bootm ${load_addr}\0" \
>         "sdboot=echo Copying FIT from SD to RAM... && " \
>                 "fatload mmc 0 ${load_addr} ${fit_image} && " \
>                 "bootm ${load_addr}\0" \
> --
> 1.7.4
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot


thanks!
diff mbox

Patch

diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c
index 5a47149..9dd158c 100644
--- a/board/xilinx/zynq/board.c
+++ b/board/xilinx/zynq/board.c
@@ -15,6 +15,7 @@  DECLARE_GLOBAL_DATA_PTR;
 /* Bootmode setting values */
 #define ZYNQ_BM_MASK		0x0F
 #define ZYNQ_BM_NOR		0x02
+#define ZYNQ_BM_NAND		0x04
 #define ZYNQ_BM_SD		0x05
 #define ZYNQ_BM_JTAG		0x0
 
@@ -75,6 +76,9 @@  int board_late_init(void)
 	case ZYNQ_BM_NOR:
 		setenv("modeboot", "norboot");
 		break;
+	case ZYNQ_BM_NAND:
+		setenv("modeboot", "nandboot");
+		break;
 	case ZYNQ_BM_SD:
 		setenv("modeboot", "sdboot");
 		break;
diff --git a/doc/README.zynq b/doc/README.zynq
index 043c970..e0b38cf 100644
--- a/doc/README.zynq
+++ b/doc/README.zynq
@@ -54,10 +54,11 @@  is intern used in autoboot.
 
 SLCR bootmode register Bit[3:0] values
 #define ZYNQ_BM_NOR		0x02
+#define ZYNQ_BM_NOR		0x04
 #define ZYNQ_BM_SD		0x05
 #define ZYNQ_BM_JTAG		0x0
 
-"modeboot" variable can assign any of "norboot", "sdboot" or "jtagboot"
+"modeboot" variable can assign any of "norboot", "nandboot", "sdboot" or "jtagboot"
 bootmode strings at runtime.
 
 5. Mainline status
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 08adaa2..068e59a 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -170,6 +170,9 @@ 
 	"norboot=echo Copying FIT from NOR flash to RAM... && " \
 		"cp.b ${nor_flash_off} ${load_addr} ${fit_size} && " \
 		"bootm ${load_addr}\0" \
+	"nandboot=echo Copying FIT from NAND flash to RAM... && " \
+		"nand read ${load_addr} ${flash_off} ${fit_size} && " \
+		"bootm ${load_addr}\0" \
 	"sdboot=echo Copying FIT from SD to RAM... && " \
 		"fatload mmc 0 ${load_addr} ${fit_image} && " \
 		"bootm ${load_addr}\0" \