All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD boot
@ 2019-03-25 11:57 Pankaj Bansal
  2019-03-27  6:19 ` Prabhakar Kushwaha
  0 siblings, 1 reply; 4+ messages in thread
From: Pankaj Bansal @ 2019-03-25 11:57 UTC (permalink / raw)
  To: u-boot

during SD boot, following error comes:
  MMC read: dev # 0, block # 20480, count 2048 ... 2048 blocks read: OK

  MMC read: dev # 0, block # 28672, count 2048 ... 2048 blocks read: OK
  fsl-mc: ERR: Bad firmware image (bad FIT header)
  Hit any key to stop autoboot:  0

it's occurring because mc 10.14.3 file size is 1064880, which means 0x820
SD blocks which is more than 0x800 blocks (1MB). This results in DPC
loading address 0x80100000 overlapping with MC loading address 0x80000000.

so, update the MC/dpl/dpc addresses as per their addresses in SD card.
Assuming that SD card block size is 512 bytes and 0x0 block in SD card
would get loaded at 0x80000000 (DDR base address), this gives following
addresses for various binaries:

Binary | SD block | DDR offset
------------------------------
MC     | 0x5000   | 0x80a00000
DPL    | 0x6800   | 0x80d00000
DPC    | 0x7000   | 0x80e00000

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
---

Notes:
    V5:
    - Add 2019 in Copyright year
    V4:
    - Modify the commit message to remove any reference to Flexspi flash
    V3:
    - modify the commit message.
    - remove issue/cause/fix from message.
    V2:
    - reduce the mc firmware size blocks from 0x1800 to 0x1200, to save on
      boot time
    - Fix the commit message to indicate that the patch is for LX2160A boards
      only and for SD boot only

 include/configs/lx2160a_common.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h
index 637619cb55..17e8f272a1 100644
--- a/include/configs/lx2160a_common.h
+++ b/include/configs/lx2160a_common.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright 2018 NXP
+ * Copyright 2018-2019 NXP
  */
 
 #ifndef __LX2_COMMON_H
@@ -200,14 +200,14 @@ unsigned long get_board_ddr_clk(void);
 	"fsl_mc start mc 0x20a00000 0x20e00000\0"
 
 #define SD_MC_INIT_CMD				\
-	"mmc read 0x80000000 0x5000 0x800;"	\
-	"mmc read 0x80100000 0x7000 0x800;"	\
+	"mmc read 0x80a00000 0x5000 0x1200;"	\
+	"mmc read 0x80e00000 0x7000 0x800;"	\
 	"env exists secureboot && "		\
 	"mmc read 0x80700000 0x3800 0x10 && "	\
 	"mmc read 0x80740000 0x3A00 0x10 && "	\
 	"esbc_validate 0x80700000 && "		\
 	"esbc_validate 0x80740000 ;"		\
-	"fsl_mc start mc 0x80000000 0x80100000\0"
+	"fsl_mc start mc 0x80a00000 0x80e00000\0"
 
 #define EXTRA_ENV_SETTINGS			\
 	"hwconfig=fsl_ddr:bank_intlv=auto\0"	\
@@ -272,11 +272,11 @@ unsigned long get_board_ddr_clk(void);
 
 #define SD_BOOTCOMMAND						\
 		"env exists mcinitcmd && mmcinfo; "		\
-		"mmc read 0x80001000 0x6800 0x800; "		\
+		"mmc read 0x80d00000 0x6800 0x800; "		\
 		"env exists mcinitcmd && env exists secureboot "	\
 		" && mmc read 0x80780000 0x3C00 0x10 "		\
 		"&& esbc_validate 0x80780000;env exists mcinitcmd "	\
-		"&& fsl_mc lazyapply dpl 0x80001000;"		\
+		"&& fsl_mc lazyapply dpl 0x80d00000;"		\
 		"run distro_bootcmd;run sd_bootcmd;"		\
 		"env exists secureboot && esbc_halt;"
 
-- 
2.17.1

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

* [U-Boot] [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD boot
  2019-03-25 11:57 [U-Boot] [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD boot Pankaj Bansal
@ 2019-03-27  6:19 ` Prabhakar Kushwaha
  2019-04-15  4:09   ` Pankaj Bansal
  0 siblings, 1 reply; 4+ messages in thread
From: Prabhakar Kushwaha @ 2019-03-27  6:19 UTC (permalink / raw)
  To: u-boot


> -----Original Message-----
> From: Pankaj Bansal
> Sent: Monday, March 25, 2019 5:28 PM
> To: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>; Priyanka Jain
> <priyanka.jain@nxp.com>; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>
> Cc: u-boot at lists.denx.de; Pankaj Bansal <pankaj.bansal@nxp.com>
> Subject: [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD
> boot
> 
> during SD boot, following error comes:
>   MMC read: dev # 0, block # 20480, count 2048 ... 2048 blocks read: OK
> 
>   MMC read: dev # 0, block # 28672, count 2048 ... 2048 blocks read: OK
>   fsl-mc: ERR: Bad firmware image (bad FIT header)
>   Hit any key to stop autoboot:  0
> 
> it's occurring because mc 10.14.3 file size is 1064880, which means 0x820 SD
> blocks which is more than 0x800 blocks (1MB). This results in DPC loading
> address 0x80100000 overlapping with MC loading address 0x80000000.
> 
> so, update the MC/dpl/dpc addresses as per their addresses in SD card.
> Assuming that SD card block size is 512 bytes and 0x0 block in SD card would
> get loaded at 0x80000000 (DDR base address), this gives following addresses
> for various binaries:
> 
> Binary | SD block | DDR offset
> ------------------------------
> MC     | 0x5000   | 0x80a00000
> DPL    | 0x6800   | 0x80d00000
> DPC    | 0x7000   | 0x80e00000
> 

This info should be part of README present in board folder. 
No need to add in commit message. 

--pk

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

* [U-Boot] [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD boot
  2019-03-27  6:19 ` Prabhakar Kushwaha
@ 2019-04-15  4:09   ` Pankaj Bansal
  2019-05-22 17:43     ` Prabhakar Kushwaha
  0 siblings, 1 reply; 4+ messages in thread
From: Pankaj Bansal @ 2019-04-15  4:09 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Prabhakar Kushwaha
> Sent: Wednesday, 27 March, 2019 11:50 AM
> To: Pankaj Bansal <pankaj.bansal@nxp.com>; Meenakshi Aggarwal
> <meenakshi.aggarwal@nxp.com>; Priyanka Jain <priyanka.jain@nxp.com>
> Cc: u-boot at lists.denx.de
> Subject: RE: [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD
> boot
> 
> 
> > -----Original Message-----
> > From: Pankaj Bansal
> > Sent: Monday, March 25, 2019 5:28 PM
> > To: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>; Priyanka Jain
> > <priyanka.jain@nxp.com>; Prabhakar Kushwaha
> > <prabhakar.kushwaha@nxp.com>
> > Cc: u-boot at lists.denx.de; Pankaj Bansal <pankaj.bansal@nxp.com>
> > Subject: [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during
> > SD boot
> >
> > during SD boot, following error comes:
> >   MMC read: dev # 0, block # 20480, count 2048 ... 2048 blocks read:
> > OK
> >
> >   MMC read: dev # 0, block # 28672, count 2048 ... 2048 blocks read: OK
> >   fsl-mc: ERR: Bad firmware image (bad FIT header)
> >   Hit any key to stop autoboot:  0
> >
> > it's occurring because mc 10.14.3 file size is 1064880, which means
> > 0x820 SD blocks which is more than 0x800 blocks (1MB). This results in
> > DPC loading address 0x80100000 overlapping with MC loading address
> 0x80000000.
> >
> > so, update the MC/dpl/dpc addresses as per their addresses in SD card.
> > Assuming that SD card block size is 512 bytes and 0x0 block in SD card
> > would get loaded at 0x80000000 (DDR base address), this gives
> > following addresses for various binaries:
> >
> > Binary | SD block | DDR offset
> > ------------------------------
> > MC     | 0x5000   | 0x80a00000
> > DPL    | 0x6800   | 0x80d00000
> > DPC    | 0x7000   | 0x80e00000
> >
> 
> This info should be part of README present in board folder.
> No need to add in commit message.

It is. Please check https://elixir.bootlin.com/u-boot/latest/source/board/freescale/lx2160a/README#L68

> 
> --pk

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

* [U-Boot] [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD boot
  2019-04-15  4:09   ` Pankaj Bansal
@ 2019-05-22 17:43     ` Prabhakar Kushwaha
  0 siblings, 0 replies; 4+ messages in thread
From: Prabhakar Kushwaha @ 2019-05-22 17:43 UTC (permalink / raw)
  To: u-boot


> -----Original Message-----
> From: Pankaj Bansal
> Sent: Monday, April 15, 2019 9:39 AM
> To: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>; Meenakshi
> Aggarwal <meenakshi.aggarwal@nxp.com>; Priyanka Jain
> <priyanka.jain@nxp.com>
> Cc: u-boot at lists.denx.de
> Subject: RE: [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD
> boot
> 
> 
> 
> > -----Original Message-----
> > From: Prabhakar Kushwaha
> > Sent: Wednesday, 27 March, 2019 11:50 AM
> > To: Pankaj Bansal <pankaj.bansal@nxp.com>; Meenakshi Aggarwal
> > <meenakshi.aggarwal@nxp.com>; Priyanka Jain <priyanka.jain@nxp.com>
> > Cc: u-boot at lists.denx.de
> > Subject: RE: [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading
> > during SD boot
> >
> >
> > > -----Original Message-----
> > > From: Pankaj Bansal
> > > Sent: Monday, March 25, 2019 5:28 PM
> > > To: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>; Priyanka Jain
> > > <priyanka.jain@nxp.com>; Prabhakar Kushwaha
> > > <prabhakar.kushwaha@nxp.com>
> > > Cc: u-boot at lists.denx.de; Pankaj Bansal <pankaj.bansal@nxp.com>
> > > Subject: [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading
> > > during SD boot
> > >
> > > during SD boot, following error comes:
> > >   MMC read: dev # 0, block # 20480, count 2048 ... 2048 blocks read:
> > > OK
> > >
> > >   MMC read: dev # 0, block # 28672, count 2048 ... 2048 blocks read: OK
> > >   fsl-mc: ERR: Bad firmware image (bad FIT header)
> > >   Hit any key to stop autoboot:  0
> > >
> > > it's occurring because mc 10.14.3 file size is 1064880, which means
> > > 0x820 SD blocks which is more than 0x800 blocks (1MB). This results
> > > in DPC loading address 0x80100000 overlapping with MC loading
> > > address
> > 0x80000000.
> > >
> > > so, update the MC/dpl/dpc addresses as per their addresses in SD card.
> > > Assuming that SD card block size is 512 bytes and 0x0 block in SD
> > > card would get loaded at 0x80000000 (DDR base address), this gives
> > > following addresses for various binaries:
> > >
> > > Binary | SD block | DDR offset
> > > ------------------------------
> > > MC     | 0x5000   | 0x80a00000
> > > DPL    | 0x6800   | 0x80d00000
> > > DPC    | 0x7000   | 0x80e00000
> > >
> >
> > This info should be part of README present in board folder.
> > No need to add in commit message.
> 
> It is. Please check https://elixir.bootlin.com/u-
> boot/latest/source/board/freescale/lx2160a/README#L68

Yes, It is part of README.

This is the reason, I asking to remove from commit message. 

--pk

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

end of thread, other threads:[~2019-05-22 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 11:57 [U-Boot] [PATCH v5] board/fsl/lx2160a: Fix MC firmware loading during SD boot Pankaj Bansal
2019-03-27  6:19 ` Prabhakar Kushwaha
2019-04-15  4:09   ` Pankaj Bansal
2019-05-22 17:43     ` Prabhakar Kushwaha

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.