All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] imx: imx8mp_evk: fix boot issue
@ 2020-05-11  6:18 Peng Fan
  2020-05-11  6:18 ` [PATCH 2/2] imx8mp_evk: simplify board spl code Peng Fan
  2020-05-11 14:19 ` [PATCH 1/2] imx: imx8mp_evk: fix boot issue Fabio Estevam
  0 siblings, 2 replies; 6+ messages in thread
From: Peng Fan @ 2020-05-11  6:18 UTC (permalink / raw)
  To: u-boot

The u-boot-spl.bin pad with ddr firmware conflicts with the
CONFIG_MALLOC_F_ADDR area, the ddr firmware will be overwritten
by malloc in SPL stage and cause ddr initialization not able
to finish. So update the related addresses to fix the issue.

Reported-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 include/configs/imx8mp_evk.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h
index 80e5738961..b90a4f6932 100644
--- a/include/configs/imx8mp_evk.h
+++ b/include/configs/imx8mp_evk.h
@@ -23,15 +23,15 @@
 #ifdef CONFIG_SPL_BUILD
 /*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/
 #define CONFIG_SPL_LDSCRIPT		"arch/arm/cpu/armv8/u-boot-spl.lds"
-#define CONFIG_SPL_STACK		0x990000
-#define CONFIG_SPL_BSS_START_ADDR      0x0095e000
-#define CONFIG_SPL_BSS_MAX_SIZE        0x2000	/* 8 KB */
+#define CONFIG_SPL_STACK		0x98fc00
+#define CONFIG_SPL_BSS_START_ADDR      0x0098fc00
+#define CONFIG_SPL_BSS_MAX_SIZE        0x400	/* 1 KB */
 #define CONFIG_SYS_SPL_MALLOC_START    0x42200000
 #define CONFIG_SYS_SPL_MALLOC_SIZE     SZ_512K	/* 512 KB */
 #define CONFIG_SYS_ICACHE_OFF
 #define CONFIG_SYS_DCACHE_OFF
 
-#define CONFIG_MALLOC_F_ADDR		0x940000
+#define CONFIG_MALLOC_F_ADDR		0x950000
 
 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
 
-- 
2.16.4

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

* [PATCH 2/2] imx8mp_evk: simplify board spl code
  2020-05-11  6:18 [PATCH 1/2] imx: imx8mp_evk: fix boot issue Peng Fan
@ 2020-05-11  6:18 ` Peng Fan
  2020-05-11 14:19 ` [PATCH 1/2] imx: imx8mp_evk: fix boot issue Fabio Estevam
  1 sibling, 0 replies; 6+ messages in thread
From: Peng Fan @ 2020-05-11  6:18 UTC (permalink / raw)
  To: u-boot

Simplify board SPL code
 - BSS area will be cleared by crt0_64.S
 - No need to get ccm device in spl_board_init
 - Use spl_early_init, not spl_init
 - timer_init has been invoked in arch_cpu_init

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/freescale/imx8mp_evk/spl.c | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)

diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c
index c5f640dc7b..5f3ea0b6a1 100644
--- a/board/freescale/imx8mp_evk/spl.c
+++ b/board/freescale/imx8mp_evk/spl.c
@@ -25,11 +25,6 @@
 #include <mmc.h>
 #include <asm/arch/ddr.h>
 
-#include <dm/uclass.h>
-#include <dm/device.h>
-#include <dm/uclass-internal.h>
-#include <dm/device-internal.h>
-
 DECLARE_GLOBAL_DATA_PTR;
 
 int spl_board_boot_device(enum boot_device boot_dev_spl)
@@ -44,16 +39,7 @@ void spl_dram_init(void)
 
 void spl_board_init(void)
 {
-	struct udevice *dev;
-	int ret;
-
 	puts("Normal Boot\n");
-
-	ret = uclass_get_device_by_name(UCLASS_CLK,
-					"clock-controller at 30380000",
-					&dev);
-	if (ret < 0)
-		printf("Failed to find clock node. Check device tree\n");
 }
 
 #define I2C_PAD_CTRL (PAD_CTL_DSE6 | PAD_CTL_HYS | PAD_CTL_PUE | PAD_CTL_PE)
@@ -114,6 +100,7 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
+/* Do not use BSS area in this phase */
 void board_init_f(ulong dummy)
 {
 	int ret;
@@ -124,19 +111,10 @@ void board_init_f(ulong dummy)
 
 	board_early_init_f();
 
-	timer_init();
+	spl_early_init();
 
 	preloader_console_init();
 
-	/* Clear the BSS. */
-	memset(__bss_start, 0, __bss_end - __bss_start);
-
-	ret = spl_init();
-	if (ret) {
-		debug("spl_init() failed: %d\n", ret);
-		hang();
-	}
-
 	enable_tzc380();
 
 	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
@@ -145,6 +123,4 @@ void board_init_f(ulong dummy)
 
 	/* DDR initialization */
 	spl_dram_init();
-
-	board_init_r(NULL, 0);
 }
-- 
2.16.4

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

* [PATCH 1/2] imx: imx8mp_evk: fix boot issue
  2020-05-11  6:18 [PATCH 1/2] imx: imx8mp_evk: fix boot issue Peng Fan
  2020-05-11  6:18 ` [PATCH 2/2] imx8mp_evk: simplify board spl code Peng Fan
@ 2020-05-11 14:19 ` Fabio Estevam
  2020-05-12  1:04   ` Peng Fan
  1 sibling, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2020-05-11 14:19 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On Mon, May 11, 2020 at 2:55 AM Peng Fan <peng.fan@nxp.com> wrote:
>
> The u-boot-spl.bin pad with ddr firmware conflicts with the
> CONFIG_MALLOC_F_ADDR area, the ddr firmware will be overwritten
> by malloc in SPL stage and cause ddr initialization not able
> to finish. So update the related addresses to fix the issue.
>
> Reported-by: Fabio Estevam <festevam@gmail.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  include/configs/imx8mp_evk.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h
> index 80e5738961..b90a4f6932 100644
> --- a/include/configs/imx8mp_evk.h
> +++ b/include/configs/imx8mp_evk.h
> @@ -23,15 +23,15 @@
>  #ifdef CONFIG_SPL_BUILD
>  /*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/
>  #define CONFIG_SPL_LDSCRIPT            "arch/arm/cpu/armv8/u-boot-spl.lds"
> -#define CONFIG_SPL_STACK               0x990000
> -#define CONFIG_SPL_BSS_START_ADDR      0x0095e000
> -#define CONFIG_SPL_BSS_MAX_SIZE        0x2000  /* 8 KB */
> +#define CONFIG_SPL_STACK               0x98fc00

On imx6/imx7 we have this kind of SPL information placed in the SoC
related header files:

include/configs/imx6_spl.h
include/configs/imx7_spl.h

We should do the same here instead of repeating these SPL settings in
every board header file.

Thanks

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

* [PATCH 1/2] imx: imx8mp_evk: fix boot issue
  2020-05-11 14:19 ` [PATCH 1/2] imx: imx8mp_evk: fix boot issue Fabio Estevam
@ 2020-05-12  1:04   ` Peng Fan
  2020-05-12  1:32     ` Peng Fan
  0 siblings, 1 reply; 6+ messages in thread
From: Peng Fan @ 2020-05-12  1:04 UTC (permalink / raw)
  To: u-boot

> Subject: Re: [PATCH 1/2] imx: imx8mp_evk: fix boot issue
> 
> Hi Peng,
> 
> On Mon, May 11, 2020 at 2:55 AM Peng Fan <peng.fan@nxp.com> wrote:
> >
> > The u-boot-spl.bin pad with ddr firmware conflicts with the
> > CONFIG_MALLOC_F_ADDR area, the ddr firmware will be overwritten by
> > malloc in SPL stage and cause ddr initialization not able to finish.
> > So update the related addresses to fix the issue.
> >
> > Reported-by: Fabio Estevam <festevam@gmail.com>
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  include/configs/imx8mp_evk.h | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/configs/imx8mp_evk.h
> > b/include/configs/imx8mp_evk.h index 80e5738961..b90a4f6932 100644
> > --- a/include/configs/imx8mp_evk.h
> > +++ b/include/configs/imx8mp_evk.h
> > @@ -23,15 +23,15 @@
> >  #ifdef CONFIG_SPL_BUILD
> >  /*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/
> >  #define CONFIG_SPL_LDSCRIPT
> "arch/arm/cpu/armv8/u-boot-spl.lds"
> > -#define CONFIG_SPL_STACK               0x990000
> > -#define CONFIG_SPL_BSS_START_ADDR      0x0095e000
> > -#define CONFIG_SPL_BSS_MAX_SIZE        0x2000  /* 8 KB */
> > +#define CONFIG_SPL_STACK               0x98fc00
> 
> On imx6/imx7 we have this kind of SPL information placed in the SoC related
> header files:
> 
> include/configs/imx6_spl.h
> include/configs/imx7_spl.h
> 
> We should do the same here instead of repeating these SPL settings in every
> board header file.

ok. Fix in next version.

Thanks,
Peng.

> 
> Thanks

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

* [PATCH 1/2] imx: imx8mp_evk: fix boot issue
  2020-05-12  1:04   ` Peng Fan
@ 2020-05-12  1:32     ` Peng Fan
  2020-05-12 11:47       ` Fabio Estevam
  0 siblings, 1 reply; 6+ messages in thread
From: Peng Fan @ 2020-05-12  1:32 UTC (permalink / raw)
  To: u-boot

> Subject: RE: [PATCH 1/2] imx: imx8mp_evk: fix boot issue
> 
> > Subject: Re: [PATCH 1/2] imx: imx8mp_evk: fix boot issue
> >
> > Hi Peng,
> >
> > On Mon, May 11, 2020 at 2:55 AM Peng Fan <peng.fan@nxp.com> wrote:
> > >
> > > The u-boot-spl.bin pad with ddr firmware conflicts with the
> > > CONFIG_MALLOC_F_ADDR area, the ddr firmware will be overwritten by
> > > malloc in SPL stage and cause ddr initialization not able to finish.
> > > So update the related addresses to fix the issue.
> > >
> > > Reported-by: Fabio Estevam <festevam@gmail.com>
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > ---
> > >  include/configs/imx8mp_evk.h | 8 ++++----
> > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/include/configs/imx8mp_evk.h
> > > b/include/configs/imx8mp_evk.h index 80e5738961..b90a4f6932 100644
> > > --- a/include/configs/imx8mp_evk.h
> > > +++ b/include/configs/imx8mp_evk.h
> > > @@ -23,15 +23,15 @@
> > >  #ifdef CONFIG_SPL_BUILD
> > >  /*#define CONFIG_ENABLE_DDR_TRAINING_DEBUG*/
> > >  #define CONFIG_SPL_LDSCRIPT
> > "arch/arm/cpu/armv8/u-boot-spl.lds"
> > > -#define CONFIG_SPL_STACK               0x990000
> > > -#define CONFIG_SPL_BSS_START_ADDR      0x0095e000
> > > -#define CONFIG_SPL_BSS_MAX_SIZE        0x2000  /* 8 KB */
> > > +#define CONFIG_SPL_STACK               0x98fc00
> >
> > On imx6/imx7 we have this kind of SPL information placed in the SoC
> > related header files:
> >
> > include/configs/imx6_spl.h
> > include/configs/imx7_spl.h
> >
> > We should do the same here instead of repeating these SPL settings in
> > every board header file.
> 
> ok. Fix in next version.

After a thought, i.MX8MQ/MM/MN/MP have different OCRAM sizes,
and ATF locates in different places. So I would keep current code as is.

Thanks,
Peng.

> 
> Thanks,
> Peng.
> 
> >
> > Thanks

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

* [PATCH 1/2] imx: imx8mp_evk: fix boot issue
  2020-05-12  1:32     ` Peng Fan
@ 2020-05-12 11:47       ` Fabio Estevam
  0 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2020-05-12 11:47 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On Mon, May 11, 2020 at 10:32 PM Peng Fan <peng.fan@nxp.com> wrote:

> After a thought, i.MX8MQ/MM/MN/MP have different OCRAM sizes,
> and ATF locates in different places. So I would keep current code as is.

Ok, this can be done later as a cleanup. What we should really avoid
is to keep duplicating these SPL configurations in every i.MX8M board
file.

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

end of thread, other threads:[~2020-05-12 11:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11  6:18 [PATCH 1/2] imx: imx8mp_evk: fix boot issue Peng Fan
2020-05-11  6:18 ` [PATCH 2/2] imx8mp_evk: simplify board spl code Peng Fan
2020-05-11 14:19 ` [PATCH 1/2] imx: imx8mp_evk: fix boot issue Fabio Estevam
2020-05-12  1:04   ` Peng Fan
2020-05-12  1:32     ` Peng Fan
2020-05-12 11:47       ` Fabio Estevam

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.