Re: [PATCH v3 01/17] dm: Emit the arch_cpu_init_dm() even only before relocation

2023-06-12 Thread Simon Glass
Hi Jan,

On Sun, 4 Jun 2023 at 13:05, Jan Kiszka  wrote:
>
> On 05.05.23 00:50, Simon Glass wrote:
> > The original function was only called once, before relocation. The new
> > one is called again after relocation. This was not the intent of the
> > original call. Fix this by renaming and updating the calling logic.
> >
> > With this, chromebook_link64 makes it through SPL.
> >
> > Fixes: 7fe32b3442f ("event: Convert arch_cpu_init_dm() to")
> > Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
> > Reviewed-by: Bin Meng 
> >
> > Signed-off-by: Simon Glass 
> > ---
> >
> > Changes in v3:
> > - Fix 'intend' typo
> >
> >  arch/arm/mach-imx/imx8/cpu.c| 2 +-
> >  arch/arm/mach-imx/imx8m/soc.c   | 2 +-
> >  arch/arm/mach-imx/imx8ulp/soc.c | 2 +-
> >  arch/arm/mach-imx/imx9/soc.c| 2 +-
> >  arch/arm/mach-omap2/am33xx/board.c  | 2 +-
> >  arch/arm/mach-omap2/hwinit-common.c | 2 +-
> >  arch/mips/mach-pic32/cpu.c  | 2 +-
> >  arch/nios2/cpu/cpu.c| 2 +-
> >  arch/riscv/cpu/cpu.c| 2 +-
> >  arch/x86/cpu/baytrail/cpu.c | 2 +-
> >  arch/x86/cpu/broadwell/cpu.c| 2 +-
> >  arch/x86/cpu/ivybridge/cpu.c| 2 +-
> >  arch/x86/cpu/quark/quark.c  | 2 +-
> >  arch/x86/lib/fsp2/fsp_init.c| 2 +-
> >  doc/develop/event.rst   | 6 +++---
> >  drivers/core/root.c | 4 ++--
> >  drivers/cpu/microblaze_cpu.c| 2 +-
> >  include/event.h | 2 +-
> >  18 files changed, 21 insertions(+), 21 deletions(-)
> >
> > diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
> > index be1f4edded1..99772f68c32 100644
> > --- a/arch/arm/mach-imx/imx8/cpu.c
> > +++ b/arch/arm/mach-imx/imx8/cpu.c
> > @@ -89,7 +89,7 @@ static int imx8_init_mu(void *ctx, struct event *event)
> >
> >   return 0;
> >  }
> > -EVENT_SPY(EVT_DM_POST_INIT, imx8_init_mu);
> > +EVENT_SPY(EVT_DM_POST_INIT_F, imx8_init_mu);
> >
> >  #if defined(CONFIG_ARCH_MISC_INIT)
> >  int arch_misc_init(void)
> > diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
> > index 4705e6c1192..5a4f8358c9f 100644
> > --- a/arch/arm/mach-imx/imx8m/soc.c
> > +++ b/arch/arm/mach-imx/imx8m/soc.c
> > @@ -549,7 +549,7 @@ static int imx8m_check_clock(void *ctx, struct event 
> > *event)
> >
> >   return 0;
> >  }
> > -EVENT_SPY(EVT_DM_POST_INIT, imx8m_check_clock);
> > +EVENT_SPY(EVT_DM_POST_INIT_F, imx8m_check_clock);
> >
> >  static void imx8m_setup_snvs(void)
> >  {
> > diff --git a/arch/arm/mach-imx/imx8ulp/soc.c 
> > b/arch/arm/mach-imx/imx8ulp/soc.c
> > index 8424332f429..81eae02b6a8 100644
> > --- a/arch/arm/mach-imx/imx8ulp/soc.c
> > +++ b/arch/arm/mach-imx/imx8ulp/soc.c
> > @@ -808,7 +808,7 @@ static int imx8ulp_evt_dm_post_init(void *ctx, struct 
> > event *event)
> >  {
> >   return imx8ulp_dm_post_init();
> >  }
> > -EVENT_SPY(EVT_DM_POST_INIT, imx8ulp_evt_dm_post_init);
> > +EVENT_SPY(EVT_DM_POST_INIT_F, imx8ulp_evt_dm_post_init);
> >
> >  #if defined(CONFIG_SPL_BUILD)
> >  __weak void __noreturn jump_to_image_no_args(struct spl_image_info 
> > *spl_image)
> > diff --git a/arch/arm/mach-imx/imx9/soc.c b/arch/arm/mach-imx/imx9/soc.c
> > index a16e22ea6bb..252663a9eec 100644
> > --- a/arch/arm/mach-imx/imx9/soc.c
> > +++ b/arch/arm/mach-imx/imx9/soc.c
> > @@ -262,7 +262,7 @@ int imx9_probe_mu(void *ctx, struct event *event)
> >
> >   return 0;
> >  }
> > -EVENT_SPY(EVT_DM_POST_INIT, imx9_probe_mu);
> > +EVENT_SPY(EVT_DM_POST_INIT_F, imx9_probe_mu);
> >
> >  int timer_init(void)
> >  {
> > diff --git a/arch/arm/mach-omap2/am33xx/board.c 
> > b/arch/arm/mach-omap2/am33xx/board.c
> > index a52d04d85c8..ecc0a592e99 100644
> > --- a/arch/arm/mach-omap2/am33xx/board.c
> > +++ b/arch/arm/mach-omap2/am33xx/board.c
> > @@ -535,4 +535,4 @@ static int am33xx_dm_post_init(void *ctx, struct event 
> > *event)
> >  #endif
> >   return 0;
> >  }
> > -EVENT_SPY(EVT_DM_POST_INIT, am33xx_dm_post_init);
> > +EVENT_SPY(EVT_DM_POST_INIT_F, am33xx_dm_post_init);
> > diff --git a/arch/arm/mach-omap2/hwinit-common.c 
> > b/arch/arm/mach-omap2/hwinit-common.c
> > index c4a8eabc3eb..771533394bc 100644
> > --- a/arch/arm/mach-omap2/hwinit-common.c
> > +++ b/arch/arm/mach-omap2/hwinit-common.c
> > @@ -246,7 +246,7 @@ static int omap2_system_init(void *ctx, struct event 
> > *event)
> >
> >   return 0;
> >  }
> > -EVENT_SPY(EVT_DM_POST_INIT, omap2_system_init);
> > +EVENT_SPY(EVT_DM_POST_INIT_F, omap2_system_init);
> >
> >  /*
> >   * Routine: wait_for_command_complete
> > diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c
> > index de449e3c6a2..ec3c2505313 100644
> > --- a/arch/mips/mach-pic32/cpu.c
> > +++ b/arch/mips/mach-pic32/cpu.c
> > @@ -102,7 +102,7 @@ static int pic32_flash_prefetch(void *ctx, struct event 
> > *event)
> >   prefetch_init();
> >   return 0;
> >  }
> > -EVENT_SPY(EVT_DM_POST_INIT, pic32_flash_prefetch);
> > +EVENT_SPY(EVT_DM_POST_INIT_F, 

Re: [PATCH v3 01/17] dm: Emit the arch_cpu_init_dm() even only before relocation

2023-06-04 Thread Jan Kiszka
On 05.05.23 00:50, Simon Glass wrote:
> The original function was only called once, before relocation. The new
> one is called again after relocation. This was not the intent of the
> original call. Fix this by renaming and updating the calling logic.
> 
> With this, chromebook_link64 makes it through SPL.
> 
> Fixes: 7fe32b3442f ("event: Convert arch_cpu_init_dm() to")
> Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
> Reviewed-by: Bin Meng 
> 
> Signed-off-by: Simon Glass 
> ---
> 
> Changes in v3:
> - Fix 'intend' typo
> 
>  arch/arm/mach-imx/imx8/cpu.c| 2 +-
>  arch/arm/mach-imx/imx8m/soc.c   | 2 +-
>  arch/arm/mach-imx/imx8ulp/soc.c | 2 +-
>  arch/arm/mach-imx/imx9/soc.c| 2 +-
>  arch/arm/mach-omap2/am33xx/board.c  | 2 +-
>  arch/arm/mach-omap2/hwinit-common.c | 2 +-
>  arch/mips/mach-pic32/cpu.c  | 2 +-
>  arch/nios2/cpu/cpu.c| 2 +-
>  arch/riscv/cpu/cpu.c| 2 +-
>  arch/x86/cpu/baytrail/cpu.c | 2 +-
>  arch/x86/cpu/broadwell/cpu.c| 2 +-
>  arch/x86/cpu/ivybridge/cpu.c| 2 +-
>  arch/x86/cpu/quark/quark.c  | 2 +-
>  arch/x86/lib/fsp2/fsp_init.c| 2 +-
>  doc/develop/event.rst   | 6 +++---
>  drivers/core/root.c | 4 ++--
>  drivers/cpu/microblaze_cpu.c| 2 +-
>  include/event.h | 2 +-
>  18 files changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
> index be1f4edded1..99772f68c32 100644
> --- a/arch/arm/mach-imx/imx8/cpu.c
> +++ b/arch/arm/mach-imx/imx8/cpu.c
> @@ -89,7 +89,7 @@ static int imx8_init_mu(void *ctx, struct event *event)
>  
>   return 0;
>  }
> -EVENT_SPY(EVT_DM_POST_INIT, imx8_init_mu);
> +EVENT_SPY(EVT_DM_POST_INIT_F, imx8_init_mu);
>  
>  #if defined(CONFIG_ARCH_MISC_INIT)
>  int arch_misc_init(void)
> diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
> index 4705e6c1192..5a4f8358c9f 100644
> --- a/arch/arm/mach-imx/imx8m/soc.c
> +++ b/arch/arm/mach-imx/imx8m/soc.c
> @@ -549,7 +549,7 @@ static int imx8m_check_clock(void *ctx, struct event 
> *event)
>  
>   return 0;
>  }
> -EVENT_SPY(EVT_DM_POST_INIT, imx8m_check_clock);
> +EVENT_SPY(EVT_DM_POST_INIT_F, imx8m_check_clock);
>  
>  static void imx8m_setup_snvs(void)
>  {
> diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c
> index 8424332f429..81eae02b6a8 100644
> --- a/arch/arm/mach-imx/imx8ulp/soc.c
> +++ b/arch/arm/mach-imx/imx8ulp/soc.c
> @@ -808,7 +808,7 @@ static int imx8ulp_evt_dm_post_init(void *ctx, struct 
> event *event)
>  {
>   return imx8ulp_dm_post_init();
>  }
> -EVENT_SPY(EVT_DM_POST_INIT, imx8ulp_evt_dm_post_init);
> +EVENT_SPY(EVT_DM_POST_INIT_F, imx8ulp_evt_dm_post_init);
>  
>  #if defined(CONFIG_SPL_BUILD)
>  __weak void __noreturn jump_to_image_no_args(struct spl_image_info 
> *spl_image)
> diff --git a/arch/arm/mach-imx/imx9/soc.c b/arch/arm/mach-imx/imx9/soc.c
> index a16e22ea6bb..252663a9eec 100644
> --- a/arch/arm/mach-imx/imx9/soc.c
> +++ b/arch/arm/mach-imx/imx9/soc.c
> @@ -262,7 +262,7 @@ int imx9_probe_mu(void *ctx, struct event *event)
>  
>   return 0;
>  }
> -EVENT_SPY(EVT_DM_POST_INIT, imx9_probe_mu);
> +EVENT_SPY(EVT_DM_POST_INIT_F, imx9_probe_mu);
>  
>  int timer_init(void)
>  {
> diff --git a/arch/arm/mach-omap2/am33xx/board.c 
> b/arch/arm/mach-omap2/am33xx/board.c
> index a52d04d85c8..ecc0a592e99 100644
> --- a/arch/arm/mach-omap2/am33xx/board.c
> +++ b/arch/arm/mach-omap2/am33xx/board.c
> @@ -535,4 +535,4 @@ static int am33xx_dm_post_init(void *ctx, struct event 
> *event)
>  #endif
>   return 0;
>  }
> -EVENT_SPY(EVT_DM_POST_INIT, am33xx_dm_post_init);
> +EVENT_SPY(EVT_DM_POST_INIT_F, am33xx_dm_post_init);
> diff --git a/arch/arm/mach-omap2/hwinit-common.c 
> b/arch/arm/mach-omap2/hwinit-common.c
> index c4a8eabc3eb..771533394bc 100644
> --- a/arch/arm/mach-omap2/hwinit-common.c
> +++ b/arch/arm/mach-omap2/hwinit-common.c
> @@ -246,7 +246,7 @@ static int omap2_system_init(void *ctx, struct event 
> *event)
>  
>   return 0;
>  }
> -EVENT_SPY(EVT_DM_POST_INIT, omap2_system_init);
> +EVENT_SPY(EVT_DM_POST_INIT_F, omap2_system_init);
>  
>  /*
>   * Routine: wait_for_command_complete
> diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c
> index de449e3c6a2..ec3c2505313 100644
> --- a/arch/mips/mach-pic32/cpu.c
> +++ b/arch/mips/mach-pic32/cpu.c
> @@ -102,7 +102,7 @@ static int pic32_flash_prefetch(void *ctx, struct event 
> *event)
>   prefetch_init();
>   return 0;
>  }
> -EVENT_SPY(EVT_DM_POST_INIT, pic32_flash_prefetch);
> +EVENT_SPY(EVT_DM_POST_INIT_F, pic32_flash_prefetch);
>  
>  /* Un-gate DDR2 modules (gated by default) */
>  static void ddr2_pmd_ungate(void)
> diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
> index 85544503a5e..da167f4b29e 100644
> --- a/arch/nios2/cpu/cpu.c
> +++ b/arch/nios2/cpu/cpu.c
> @@ -80,7 +80,7 @@ static int

[PATCH v3 01/17] dm: Emit the arch_cpu_init_dm() even only before relocation

2023-05-04 Thread Simon Glass
The original function was only called once, before relocation. The new
one is called again after relocation. This was not the intent of the
original call. Fix this by renaming and updating the calling logic.

With this, chromebook_link64 makes it through SPL.

Fixes: 7fe32b3442f ("event: Convert arch_cpu_init_dm() to")
Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events")
Reviewed-by: Bin Meng 

Signed-off-by: Simon Glass 
---

Changes in v3:
- Fix 'intend' typo

 arch/arm/mach-imx/imx8/cpu.c| 2 +-
 arch/arm/mach-imx/imx8m/soc.c   | 2 +-
 arch/arm/mach-imx/imx8ulp/soc.c | 2 +-
 arch/arm/mach-imx/imx9/soc.c| 2 +-
 arch/arm/mach-omap2/am33xx/board.c  | 2 +-
 arch/arm/mach-omap2/hwinit-common.c | 2 +-
 arch/mips/mach-pic32/cpu.c  | 2 +-
 arch/nios2/cpu/cpu.c| 2 +-
 arch/riscv/cpu/cpu.c| 2 +-
 arch/x86/cpu/baytrail/cpu.c | 2 +-
 arch/x86/cpu/broadwell/cpu.c| 2 +-
 arch/x86/cpu/ivybridge/cpu.c| 2 +-
 arch/x86/cpu/quark/quark.c  | 2 +-
 arch/x86/lib/fsp2/fsp_init.c| 2 +-
 doc/develop/event.rst   | 6 +++---
 drivers/core/root.c | 4 ++--
 drivers/cpu/microblaze_cpu.c| 2 +-
 include/event.h | 2 +-
 18 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
index be1f4edded1..99772f68c32 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -89,7 +89,7 @@ static int imx8_init_mu(void *ctx, struct event *event)
 
return 0;
 }
-EVENT_SPY(EVT_DM_POST_INIT, imx8_init_mu);
+EVENT_SPY(EVT_DM_POST_INIT_F, imx8_init_mu);
 
 #if defined(CONFIG_ARCH_MISC_INIT)
 int arch_misc_init(void)
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index 4705e6c1192..5a4f8358c9f 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -549,7 +549,7 @@ static int imx8m_check_clock(void *ctx, struct event *event)
 
return 0;
 }
-EVENT_SPY(EVT_DM_POST_INIT, imx8m_check_clock);
+EVENT_SPY(EVT_DM_POST_INIT_F, imx8m_check_clock);
 
 static void imx8m_setup_snvs(void)
 {
diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c
index 8424332f429..81eae02b6a8 100644
--- a/arch/arm/mach-imx/imx8ulp/soc.c
+++ b/arch/arm/mach-imx/imx8ulp/soc.c
@@ -808,7 +808,7 @@ static int imx8ulp_evt_dm_post_init(void *ctx, struct event 
*event)
 {
return imx8ulp_dm_post_init();
 }
-EVENT_SPY(EVT_DM_POST_INIT, imx8ulp_evt_dm_post_init);
+EVENT_SPY(EVT_DM_POST_INIT_F, imx8ulp_evt_dm_post_init);
 
 #if defined(CONFIG_SPL_BUILD)
 __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
diff --git a/arch/arm/mach-imx/imx9/soc.c b/arch/arm/mach-imx/imx9/soc.c
index a16e22ea6bb..252663a9eec 100644
--- a/arch/arm/mach-imx/imx9/soc.c
+++ b/arch/arm/mach-imx/imx9/soc.c
@@ -262,7 +262,7 @@ int imx9_probe_mu(void *ctx, struct event *event)
 
return 0;
 }
-EVENT_SPY(EVT_DM_POST_INIT, imx9_probe_mu);
+EVENT_SPY(EVT_DM_POST_INIT_F, imx9_probe_mu);
 
 int timer_init(void)
 {
diff --git a/arch/arm/mach-omap2/am33xx/board.c 
b/arch/arm/mach-omap2/am33xx/board.c
index a52d04d85c8..ecc0a592e99 100644
--- a/arch/arm/mach-omap2/am33xx/board.c
+++ b/arch/arm/mach-omap2/am33xx/board.c
@@ -535,4 +535,4 @@ static int am33xx_dm_post_init(void *ctx, struct event 
*event)
 #endif
return 0;
 }
-EVENT_SPY(EVT_DM_POST_INIT, am33xx_dm_post_init);
+EVENT_SPY(EVT_DM_POST_INIT_F, am33xx_dm_post_init);
diff --git a/arch/arm/mach-omap2/hwinit-common.c 
b/arch/arm/mach-omap2/hwinit-common.c
index c4a8eabc3eb..771533394bc 100644
--- a/arch/arm/mach-omap2/hwinit-common.c
+++ b/arch/arm/mach-omap2/hwinit-common.c
@@ -246,7 +246,7 @@ static int omap2_system_init(void *ctx, struct event *event)
 
return 0;
 }
-EVENT_SPY(EVT_DM_POST_INIT, omap2_system_init);
+EVENT_SPY(EVT_DM_POST_INIT_F, omap2_system_init);
 
 /*
  * Routine: wait_for_command_complete
diff --git a/arch/mips/mach-pic32/cpu.c b/arch/mips/mach-pic32/cpu.c
index de449e3c6a2..ec3c2505313 100644
--- a/arch/mips/mach-pic32/cpu.c
+++ b/arch/mips/mach-pic32/cpu.c
@@ -102,7 +102,7 @@ static int pic32_flash_prefetch(void *ctx, struct event 
*event)
prefetch_init();
return 0;
 }
-EVENT_SPY(EVT_DM_POST_INIT, pic32_flash_prefetch);
+EVENT_SPY(EVT_DM_POST_INIT_F, pic32_flash_prefetch);
 
 /* Un-gate DDR2 modules (gated by default) */
 static void ddr2_pmd_ungate(void)
diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index 85544503a5e..da167f4b29e 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -80,7 +80,7 @@ static int nios_cpu_setup(void *ctx, struct event *event)
 
return 0;
 }
-EVENT_SPY(EVT_DM_POST_INIT, nios_cpu_setup);
+EVENT_SPY(EVT_DM_POST_INIT_F, nios_cpu_setup);
 
 static int altera_nios2_get_desc(const struct udevice *dev, char *buf,
 int size)
diff --git a/arch