U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] config: imx: Define CFG_SYS_UBOOT_BASE for Phytec's imx8mm SoM QSPI boot
@ 2024-08-20 14:59 Lukasz Majewski
  2024-08-27 18:49 ` Fabio Estevam
  0 siblings, 1 reply; 5+ messages in thread
From: Lukasz Majewski @ 2024-08-20 14:59 UTC (permalink / raw)
  To: Teresa Remmet, Stefano Babic, Fabio Estevam
  Cc: uboot-imx, Cem Tenruh, Tom Rini, u-boot, Yannic Moog,
	Benjamin Hahn, Lukasz Majewski

The image offset when booting from SPI-NOR (QSPI, FSPI driver) is
different than one for SD card / eMMC as extra space (0x1000) is consumed
by FSPI configuration header (CONFIG_FSPI_CONF_HEADER).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Avoid line breaks with defines
---
 include/configs/phycore_imx8mm.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/configs/phycore_imx8mm.h b/include/configs/phycore_imx8mm.h
index 0910ae2d87..a445d842ac 100644
--- a/include/configs/phycore_imx8mm.h
+++ b/include/configs/phycore_imx8mm.h
@@ -11,8 +11,15 @@
 #include <linux/stringify.h>
 #include <asm/arch/imx-regs.h>
 
+#define UBOOT_ITB_OFFSET			0x57C00
+#define FSPI_CONF_BLOCK_SIZE		0x1000
+#define UBOOT_ITB_OFFSET_FSPI (UBOOT_ITB_OFFSET + FSPI_CONF_BLOCK_SIZE)
+#ifdef CONFIG_FSPI_CONF_HEADER
+#define CFG_SYS_UBOOT_BASE (QSPI0_AMBA_BASE + UBOOT_ITB_OFFSET_FSPI)
+#else
 #define CFG_SYS_UBOOT_BASE \
 		(QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
+#endif
 
 #ifdef CONFIG_SPL_BUILD
 /* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
-- 
2.39.2


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

* Re: [PATCH v2] config: imx: Define CFG_SYS_UBOOT_BASE for Phytec's imx8mm SoM QSPI boot
  2024-08-20 14:59 [PATCH v2] config: imx: Define CFG_SYS_UBOOT_BASE for Phytec's imx8mm SoM QSPI boot Lukasz Majewski
@ 2024-08-27 18:49 ` Fabio Estevam
  2024-08-28  7:55   ` Lukasz Majewski
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2024-08-27 18:49 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Teresa Remmet, Stefano Babic, uboot-imx, Cem Tenruh, Tom Rini,
	u-boot, Yannic Moog, Benjamin Hahn

Hi Lukasz,

On Tue, Aug 20, 2024 at 12:00 PM Lukasz Majewski <lukma@denx.de> wrote:
>
> The image offset when booting from SPI-NOR (QSPI, FSPI driver) is
> different than one for SD card / eMMC as extra space (0x1000) is consumed
> by FSPI configuration header (CONFIG_FSPI_CONF_HEADER).
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> Changes for v2:
> - Avoid line breaks with defines

From the other thread, my understanding is that QSPI boot is still not
working with this patch applied.

Please resend this patch when the QSPI boot problem is resolved.

Thanks

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

* Re: [PATCH v2] config: imx: Define CFG_SYS_UBOOT_BASE for Phytec's imx8mm SoM QSPI boot
  2024-08-27 18:49 ` Fabio Estevam
@ 2024-08-28  7:55   ` Lukasz Majewski
  2024-08-30 13:23     ` Benjamin Hahn
  0 siblings, 1 reply; 5+ messages in thread
From: Lukasz Majewski @ 2024-08-28  7:55 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Teresa Remmet, Stefano Babic, uboot-imx, Cem Tenruh, Tom Rini,
	u-boot, Yannic Moog, Benjamin Hahn

[-- Attachment #1: Type: text/plain, Size: 1252 bytes --]

Hi Fabio,

> Hi Lukasz,
> 
> On Tue, Aug 20, 2024 at 12:00 PM Lukasz Majewski <lukma@denx.de>
> wrote:
> >
> > The image offset when booting from SPI-NOR (QSPI, FSPI driver) is
> > different than one for SD card / eMMC as extra space (0x1000) is
> > consumed by FSPI configuration header (CONFIG_FSPI_CONF_HEADER).
> >
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> > Changes for v2:
> > - Avoid line breaks with defines  
> 
> From the other thread, my understanding is that QSPI boot is still not
> working with this patch applied.
> 

But this is an orthogonal problem - the problem is with binman image
generation.

This patch follows the code already present in e.g. imx8mm_beacon*
boards.

> Please resend this patch when the QSPI boot problem is resolved.
> 

As I've written above - problem is solely with binman code generation -
after reverting 3 last commits from imx8mm-u-boot.dtsi the image is
correctly generated.

> Thanks




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2] config: imx: Define CFG_SYS_UBOOT_BASE for Phytec's imx8mm SoM QSPI boot
  2024-08-28  7:55   ` Lukasz Majewski
@ 2024-08-30 13:23     ` Benjamin Hahn
  2024-08-30 15:19       ` Lukasz Majewski
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Hahn @ 2024-08-30 13:23 UTC (permalink / raw)
  To: Lukasz Majewski, Fabio Estevam
  Cc: Teresa Remmet, Stefano Babic, uboot-imx@nxp.com, Cem Tenruh,
	Tom Rini, u-boot@lists.denx.de, Yannic Moog

Hi Lukasz,

On 28.08.24 09:55, Lukasz Majewski wrote:
> Hi Fabio,
>
>> Hi Lukasz,
>>
>> On Tue, Aug 20, 2024 at 12:00 PM Lukasz Majewski <lukma@denx.de>
>> wrote:
>>> The image offset when booting from SPI-NOR (QSPI, FSPI driver) is
>>> different than one for SD card / eMMC as extra space (0x1000) is
>>> consumed by FSPI configuration header (CONFIG_FSPI_CONF_HEADER).
>>>
>>> Signed-off-by: Lukasz Majewski <lukma@denx.de>
>>> ---
>>> Changes for v2:
>>> - Avoid line breaks with defines
>>  From the other thread, my understanding is that QSPI boot is still not
>> working with this patch applied.
>>
> But this is an orthogonal problem - the problem is with binman image
> generation.
>
> This patch follows the code already present in e.g. imx8mm_beacon*
> boards.
>
>> Please resend this patch when the QSPI boot problem is resolved.
>>
> As I've written above - problem is solely with binman code generation -
> after reverting 3 last commits from imx8mm-u-boot.dtsi the image is
> correctly generated.

I can also see this. When I apply all your patches and revert those 3 
commits, SDP boot via uuu and flashing SPI NOR flash with the qspi Image 
works. And then also SPI boot works.
When I don't revert the 3 commit, it does not work. (SDP boot via uuu 
does not work and the Image does not boot when flashed into SPI NOR flash).

I haven't investigated what the problem is or how it can be fixed 
though. So I guess further investigation is needed here.

Benjamin

>
>> Thanks
>
>
>
> Best regards,
>
> Lukasz Majewski
>
> --
>
> DENX Software Engineering GmbH,      Managing Director: Erika Unter
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de



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

* Re: [PATCH v2] config: imx: Define CFG_SYS_UBOOT_BASE for Phytec's imx8mm SoM QSPI boot
  2024-08-30 13:23     ` Benjamin Hahn
@ 2024-08-30 15:19       ` Lukasz Majewski
  0 siblings, 0 replies; 5+ messages in thread
From: Lukasz Majewski @ 2024-08-30 15:19 UTC (permalink / raw)
  To: Benjamin Hahn
  Cc: Fabio Estevam, Teresa Remmet, Stefano Babic, uboot-imx@nxp.com,
	Cem Tenruh, Tom Rini, u-boot@lists.denx.de, Yannic Moog

[-- Attachment #1: Type: text/plain, Size: 2736 bytes --]

Hi Benjamin,

> Hi Lukasz,
> 
> On 28.08.24 09:55, Lukasz Majewski wrote:
> > Hi Fabio,
> >
> >> Hi Lukasz,
> >>
> >> On Tue, Aug 20, 2024 at 12:00 PM Lukasz Majewski <lukma@denx.de>
> >> wrote:
> >>> The image offset when booting from SPI-NOR (QSPI, FSPI driver) is
> >>> different than one for SD card / eMMC as extra space (0x1000) is
> >>> consumed by FSPI configuration header (CONFIG_FSPI_CONF_HEADER).
> >>>
> >>> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> >>> ---
> >>> Changes for v2:
> >>> - Avoid line breaks with defines
> >>  From the other thread, my understanding is that QSPI boot is
> >> still not working with this patch applied.
> >>
> > But this is an orthogonal problem - the problem is with binman image
> > generation.
> >
> > This patch follows the code already present in e.g. imx8mm_beacon*
> > boards.
> >
> >> Please resend this patch when the QSPI boot problem is resolved.
> >>
> > As I've written above - problem is solely with binman code
> > generation - after reverting 3 last commits from imx8mm-u-boot.dtsi
> > the image is correctly generated.
> 
> I can also see this. When I apply all your patches and revert those 3 
> commits, SDP boot via uuu and flashing SPI NOR flash with the qspi
> Image works. And then also SPI boot works.
> When I don't revert the 3 commit, it does not work. (SDP boot via uuu 
> does not work and the Image does not boot when flashed into SPI NOR
> flash).
> 
> I haven't investigated what the problem is or how it can be fixed 
> though. 

The "Hackish" solution is to add:

@@ -85,6 +85,10 @@ void ddr_load_train_firmware(enum fw_type type)
                }
        }
 
+       imem_start -= 0x1000;
+       dmem_start -= 0x1000;
+
        pr_from32 = imem_start;
        pr_to32 = IMEM_OFFSET_ADDR;
        for (i = 0x0; i < imem_len; ) {

(The -= 0x1000 is the size of QSPI header added to the beginning of the
image.)

Simon, has recently prepared set of binman related patches, so maybe
they provided offset to fix it.

> So I guess further investigation is needed here.
> 
> Benjamin
> 
> >
> >> Thanks
> >
> >
> >
> > Best regards,
> >
> > Lukasz Majewski
> >
> > --
> >
> > DENX Software Engineering GmbH,      Managing Director: Erika Unter
> > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > lukma@denx.de
> 
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2024-08-30 15:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 14:59 [PATCH v2] config: imx: Define CFG_SYS_UBOOT_BASE for Phytec's imx8mm SoM QSPI boot Lukasz Majewski
2024-08-27 18:49 ` Fabio Estevam
2024-08-28  7:55   ` Lukasz Majewski
2024-08-30 13:23     ` Benjamin Hahn
2024-08-30 15:19       ` Lukasz Majewski

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