All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
@ 2017-08-28 19:46 Anatolij Gustschin
  2017-09-19  7:54 ` Stefano Babic
  0 siblings, 1 reply; 10+ messages in thread
From: Anatolij Gustschin @ 2017-08-28 19:46 UTC (permalink / raw)
  To: u-boot

We do not use print_cpuinfo and clock command code in SPL,
disable it when building SPL image.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 arch/arm/mach-imx/cpu.c       |  4 ++--
 arch/arm/mach-imx/mx6/clock.c | 30 ++++++++++++++++--------------
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c
index 1017eb8..18205dc 100644
--- a/arch/arm/mach-imx/cpu.c
+++ b/arch/arm/mach-imx/cpu.c
@@ -25,7 +25,7 @@
 #include <fsl_esdhc.h>
 #endif
 
-#if defined(CONFIG_DISPLAY_CPUINFO)
+#if defined(CONFIG_DISPLAY_CPUINFO) && !defined(CONFIG_SPL_BUILD)
 static u32 reset_cause = -1;
 
 static char *get_reset_cause(void)
@@ -132,7 +132,7 @@ unsigned imx_ddr_size(void)
 }
 #endif
 
-#if defined(CONFIG_DISPLAY_CPUINFO)
+#if defined(CONFIG_DISPLAY_CPUINFO) && !defined(CONFIG_SPL_BUILD)
 
 const char *get_imx_type(u32 imxtype)
 {
diff --git a/arch/arm/mach-imx/mx6/clock.c b/arch/arm/mach-imx/mx6/clock.c
index 0e019c4..71a9e6b 100644
--- a/arch/arm/mach-imx/mx6/clock.c
+++ b/arch/arm/mach-imx/mx6/clock.c
@@ -1220,6 +1220,20 @@ void enable_thermal_clk(void)
 	enable_pll3();
 }
 
+#ifdef CONFIG_MTD_NOR_FLASH
+void enable_eim_clk(unsigned char enable)
+{
+	u32 reg;
+
+	reg = __raw_readl(&imx_ccm->CCGR6);
+	if (enable)
+		reg |= MXC_CCM_CCGR6_EMI_SLOW_MASK;
+	else
+		reg &= ~MXC_CCM_CCGR6_EMI_SLOW_MASK;
+	__raw_writel(reg, &imx_ccm->CCGR6);
+}
+#endif
+
 unsigned int mxc_get_clock(enum mxc_clock clk)
 {
 	switch (clk) {
@@ -1262,6 +1276,7 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
 	return 0;
 }
 
+#ifndef CONFIG_SPL_BUILD
 /*
  * Dump some core clockes.
  */
@@ -1463,20 +1478,6 @@ void select_ldb_di_clock_source(enum ldb_di_clock clk)
 }
 #endif
 
-#ifdef CONFIG_MTD_NOR_FLASH
-void enable_eim_clk(unsigned char enable)
-{
-	u32 reg;
-
-	reg = __raw_readl(&imx_ccm->CCGR6);
-	if (enable)
-		reg |= MXC_CCM_CCGR6_EMI_SLOW_MASK;
-	else
-		reg &= ~MXC_CCM_CCGR6_EMI_SLOW_MASK;
-	__raw_writel(reg, &imx_ccm->CCGR6);
-}
-#endif
-
 /***************************************************/
 
 U_BOOT_CMD(
@@ -1484,3 +1485,4 @@ U_BOOT_CMD(
 	"display clocks",
 	""
 );
+#endif
-- 
2.7.4

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

* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
  2017-08-28 19:46 [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL Anatolij Gustschin
@ 2017-09-19  7:54 ` Stefano Babic
  2017-09-19 12:18   ` Anatolij Gustschin
  2017-09-20  3:18   ` Fabio Estevam
  0 siblings, 2 replies; 10+ messages in thread
From: Stefano Babic @ 2017-09-19  7:54 UTC (permalink / raw)
  To: u-boot

Hi Anatolji,

On 28/08/2017 21:46, Anatolij Gustschin wrote:
> We do not use print_cpuinfo and clock command code in SPL,
> disable it when building SPL image.
> 
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  arch/arm/mach-imx/cpu.c       |  4 ++--
>  arch/arm/mach-imx/mx6/clock.c | 30 ++++++++++++++++--------------
>  2 files changed, 18 insertions(+), 16 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c
> index 1017eb8..18205dc 100644
> --- a/arch/arm/mach-imx/cpu.c
> +++ b/arch/arm/mach-imx/cpu.c
> @@ -25,7 +25,7 @@
>  #include <fsl_esdhc.h>
>  #endif
>  
> -#if defined(CONFIG_DISPLAY_CPUINFO)
> +#if defined(CONFIG_DISPLAY_CPUINFO) && !defined(CONFIG_SPL_BUILD)
>  static u32 reset_cause = -1;
>  
>  static char *get_reset_cause(void)
> @@ -132,7 +132,7 @@ unsigned imx_ddr_size(void)
>  }
>  #endif
>  
> -#if defined(CONFIG_DISPLAY_CPUINFO)
> +#if defined(CONFIG_DISPLAY_CPUINFO) && !defined(CONFIG_SPL_BUILD)
>  
>  const char *get_imx_type(u32 imxtype)
>  {
> diff --git a/arch/arm/mach-imx/mx6/clock.c b/arch/arm/mach-imx/mx6/clock.c
> index 0e019c4..71a9e6b 100644
> --- a/arch/arm/mach-imx/mx6/clock.c
> +++ b/arch/arm/mach-imx/mx6/clock.c
> @@ -1220,6 +1220,20 @@ void enable_thermal_clk(void)
>  	enable_pll3();
>  }
>  
> +#ifdef CONFIG_MTD_NOR_FLASH
> +void enable_eim_clk(unsigned char enable)
> +{
> +	u32 reg;
> +
> +	reg = __raw_readl(&imx_ccm->CCGR6);
> +	if (enable)
> +		reg |= MXC_CCM_CCGR6_EMI_SLOW_MASK;
> +	else
> +		reg &= ~MXC_CCM_CCGR6_EMI_SLOW_MASK;
> +	__raw_writel(reg, &imx_ccm->CCGR6);
> +}
> +#endif
> +
>  unsigned int mxc_get_clock(enum mxc_clock clk)
>  {
>  	switch (clk) {
> @@ -1262,6 +1276,7 @@ unsigned int mxc_get_clock(enum mxc_clock clk)
>  	return 0;
>  }
>  
> +#ifndef CONFIG_SPL_BUILD
>  /*
>   * Dump some core clockes.
>   */
> @@ -1463,20 +1478,6 @@ void select_ldb_di_clock_source(enum ldb_di_clock clk)
>  }
>  #endif
>  
> -#ifdef CONFIG_MTD_NOR_FLASH
> -void enable_eim_clk(unsigned char enable)
> -{
> -	u32 reg;
> -
> -	reg = __raw_readl(&imx_ccm->CCGR6);
> -	if (enable)
> -		reg |= MXC_CCM_CCGR6_EMI_SLOW_MASK;
> -	else
> -		reg &= ~MXC_CCM_CCGR6_EMI_SLOW_MASK;
> -	__raw_writel(reg, &imx_ccm->CCGR6);
> -}
> -#endif
> -
>  /***************************************************/
>  
>  U_BOOT_CMD(
> @@ -1484,3 +1485,4 @@ U_BOOT_CMD(
>  	"display clocks",
>  	""
>  );
> +#endif
> 

This patch has some side-effects and breaks some boards. Even if the
changes are correct, some boards (wandboard, icore are examples) don't
disable IPU support in SPL. Even if this is useless and generates only a
bigger footprint.

In fact, I get :

       arm:  +   wandboard
+board/wandboard/built-in.o: In function `setup_display':
+board/wandboard/wandboard.c:355: undefined reference to `enable_ipu_clock'
+make[2]: *** [spl/u-boot-spl] Error 1
+make[1]: *** [spl/u-boot-spl] Error 2
+make: *** [sub-make] Error 2


Reason is clear: boards have in SPL a setup_display() that calls
enable_ipu_clock. But it makes no sense to have IPU support in SPL.

We can fix with a follow-up patch, but this is bad for bisecting. The
other option is to fix here and disable IPU in spl for the affected
boards. What you think ?

Best regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
  2017-09-19  7:54 ` Stefano Babic
@ 2017-09-19 12:18   ` Anatolij Gustschin
  2017-09-20  3:18   ` Fabio Estevam
  1 sibling, 0 replies; 10+ messages in thread
From: Anatolij Gustschin @ 2017-09-19 12:18 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On Tue, 19 Sep 2017 09:54:30 +0200
Stefano Babic sbabic at denx.de wrote:
...
> This patch has some side-effects and breaks some boards. Even if the
> changes are correct, some boards (wandboard, icore are examples) don't
> disable IPU support in SPL. Even if this is useless and generates only a
> bigger footprint.
> 
> In fact, I get :
> 
>        arm:  +   wandboard
> +board/wandboard/built-in.o: In function `setup_display':
> +board/wandboard/wandboard.c:355: undefined reference to `enable_ipu_clock'
> +make[2]: *** [spl/u-boot-spl] Error 1
> +make[1]: *** [spl/u-boot-spl] Error 2
> +make: *** [sub-make] Error 2
> 
> 
> Reason is clear: boards have in SPL a setup_display() that calls
> enable_ipu_clock. But it makes no sense to have IPU support in SPL.
> 
> We can fix with a follow-up patch, but this is bad for bisecting. The
> other option is to fix here and disable IPU in spl for the affected
> boards. What you think ?

Sorry for the build breakage, I didn't test with a full imx6 build.
Yes, we shouldn't break bisection. I'll fix and resubmit. Thanks!

--
Anatolij

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

* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
  2017-09-19  7:54 ` Stefano Babic
  2017-09-19 12:18   ` Anatolij Gustschin
@ 2017-09-20  3:18   ` Fabio Estevam
  2017-09-20 11:22     ` Anatolij Gustschin
  1 sibling, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2017-09-20  3:18 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On Tue, Sep 19, 2017 at 4:54 AM, Stefano Babic <sbabic@denx.de> wrote:

> Reason is clear: boards have in SPL a setup_display() that calls
> enable_ipu_clock. But it makes no sense to have IPU support in SPL.

Good catch, thanks!

Anatolij,

Do you plan to remove IPU code from SPL?

Thanks!

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

* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
  2017-09-20  3:18   ` Fabio Estevam
@ 2017-09-20 11:22     ` Anatolij Gustschin
  2017-09-20 13:04       ` Stefano Babic
  2017-09-23  1:55       ` Fabio Estevam
  0 siblings, 2 replies; 10+ messages in thread
From: Anatolij Gustschin @ 2017-09-20 11:22 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On Wed, 20 Sep 2017 00:18:52 -0300
Fabio Estevam festevam at gmail.com wrote:

> Hi Stefano,
> 
> On Tue, Sep 19, 2017 at 4:54 AM, Stefano Babic <sbabic@denx.de> wrote:
> 
> > Reason is clear: boards have in SPL a setup_display() that calls
> > enable_ipu_clock. But it makes no sense to have IPU support in SPL.  
> 
> Good catch, thanks!
> 
> Anatolij,
> 
> Do you plan to remove IPU code from SPL?

I think we can do it by

diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 3ba4c29..b0f317b 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -63,6 +63,7 @@
 #define CONFIG_PHY_ATHEROS
 
 /* Framebuffer */
+#if !defined(CONFIG_SPL_BUILD)
 #ifdef CONFIG_VIDEO
 #define CONFIG_VIDEO_IPUV3
 #define CONFIG_VIDEO_BMP_RLE8
@@ -74,6 +75,7 @@
 #define CONFIG_IMX_HDMI
 #define CONFIG_IMX_VIDEO_SKIP
 #endif
+#endif
 
 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 #define CONFIG_EXTRA_ENV_SETTINGS \

I'll try to prepare a patch for other board configs later this week.

Thanks,

Anatolij

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

* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
  2017-09-20 11:22     ` Anatolij Gustschin
@ 2017-09-20 13:04       ` Stefano Babic
  2017-09-21  9:10         ` Max Krummenacher
  2017-09-23  1:55       ` Fabio Estevam
  1 sibling, 1 reply; 10+ messages in thread
From: Stefano Babic @ 2017-09-20 13:04 UTC (permalink / raw)
  To: u-boot

Hi Fabio, Anatolji,

just to save time : this is the list of boards that are affected by this
problem.

      cgtqmx6eval
      wandboard
      colibri_imx6
      apalis_imx6
      mx6cuboxi
      mx6sabresd
      imx6qdl_icore_rqs

A good solution is also if the board maintainers (I CCed all of them)
could fix this and I will apply afterwards Anatolji's patch.

Best regards,
Stefano

On 20/09/2017 13:22, Anatolij Gustschin wrote:
> Hi Fabio,
> 
> On Wed, 20 Sep 2017 00:18:52 -0300
> Fabio Estevam festevam at gmail.com wrote:
> 
>> Hi Stefano,
>>
>> On Tue, Sep 19, 2017 at 4:54 AM, Stefano Babic <sbabic@denx.de> wrote:
>>
>>> Reason is clear: boards have in SPL a setup_display() that calls
>>> enable_ipu_clock. But it makes no sense to have IPU support in SPL.  
>>
>> Good catch, thanks!
>>
>> Anatolij,
>>
>> Do you plan to remove IPU code from SPL?
> 
> I think we can do it by
> 
> diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
> index 3ba4c29..b0f317b 100644
> --- a/include/configs/wandboard.h
> +++ b/include/configs/wandboard.h
> @@ -63,6 +63,7 @@
>  #define CONFIG_PHY_ATHEROS
>  
>  /* Framebuffer */
> +#if !defined(CONFIG_SPL_BUILD)
>  #ifdef CONFIG_VIDEO
>  #define CONFIG_VIDEO_IPUV3
>  #define CONFIG_VIDEO_BMP_RLE8
> @@ -74,6 +75,7 @@
>  #define CONFIG_IMX_HDMI
>  #define CONFIG_IMX_VIDEO_SKIP
>  #endif
> +#endif
>  
>  #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
>  #define CONFIG_EXTRA_ENV_SETTINGS \
> 
> I'll try to prepare a patch for other board configs later this week.
> 
> Thanks,
> 
> Anatolij
> 


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
  2017-09-20 13:04       ` Stefano Babic
@ 2017-09-21  9:10         ` Max Krummenacher
  2017-09-21 11:01           ` Anatolij Gustschin
  0 siblings, 1 reply; 10+ messages in thread
From: Max Krummenacher @ 2017-09-21  9:10 UTC (permalink / raw)
  To: u-boot

Hi

On Wed, 2017-09-20 at 15:04 +0200, Stefano Babic wrote:
> Hi Fabio, Anatolji,
> 
> just to save time : this is the list of boards that are affected by this
> problem.
> 
>       cgtqmx6eval
>       wandboard


>       colibri_imx6
>       apalis_imx6

I will prepare a patch for these two.
Max

>       mx6cuboxi
>       mx6sabresd
>       imx6qdl_icore_rqs
> 
> A good solution is also if the board maintainers (I CCed all of them)
> could fix this and I will apply afterwards Anatolji's patch.
> 
> Best regards,
> Stefano
> 
> On 20/09/2017 13:22, Anatolij Gustschin wrote:
> > 
> > Hi Fabio,
> > 
> > On Wed, 20 Sep 2017 00:18:52 -0300
> > Fabio Estevam festevam at gmail.com wrote:
> > 
> > > 
> > > Hi Stefano,
> > > 
> > > On Tue, Sep 19, 2017 at 4:54 AM, Stefano Babic <sbabic@denx.de> wrote:
> > > 
> > > > 
> > > > Reason is clear: boards have in SPL a setup_display() that calls
> > > > enable_ipu_clock. But it makes no sense to have IPU support in SPL.  
> > > 
> > > Good catch, thanks!
> > > 
> > > Anatolij,
> > > 
> > > Do you plan to remove IPU code from SPL?
> > 
> > I think we can do it by
> > 
> > diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
> > index 3ba4c29..b0f317b 100644
> > --- a/include/configs/wandboard.h
> > +++ b/include/configs/wandboard.h
> > @@ -63,6 +63,7 @@
> >  #define CONFIG_PHY_ATHEROS
> >  
> >  /* Framebuffer */
> > +#if !defined(CONFIG_SPL_BUILD)
> >  #ifdef CONFIG_VIDEO
> >  #define CONFIG_VIDEO_IPUV3
> >  #define CONFIG_VIDEO_BMP_RLE8
> > @@ -74,6 +75,7 @@
> >  #define CONFIG_IMX_HDMI
> >  #define CONFIG_IMX_VIDEO_SKIP
> >  #endif
> > +#endif
> >  
> >  #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
> >  #define CONFIG_EXTRA_ENV_SETTINGS \
> > 
> > I'll try to prepare a patch for other board configs later this week.
> > 
> > Thanks,
> > 
> > Anatolij
> > 
> 
> 

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

* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
  2017-09-21  9:10         ` Max Krummenacher
@ 2017-09-21 11:01           ` Anatolij Gustschin
  0 siblings, 0 replies; 10+ messages in thread
From: Anatolij Gustschin @ 2017-09-21 11:01 UTC (permalink / raw)
  To: u-boot

Hi,

On Thu, 21 Sep 2017 09:10:32 +0000
Max Krummenacher max.krummenacher at toradex.com wrote:
...
> >       colibri_imx6
> >       apalis_imx6  
> 
> I will prepare a patch for these two.
> Max

Thanks!

--
Anatolij

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

* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
  2017-09-20 11:22     ` Anatolij Gustschin
  2017-09-20 13:04       ` Stefano Babic
@ 2017-09-23  1:55       ` Fabio Estevam
  2017-09-23 16:29         ` Anatolij Gustschin
  1 sibling, 1 reply; 10+ messages in thread
From: Fabio Estevam @ 2017-09-23  1:55 UTC (permalink / raw)
  To: u-boot

Hi Anatolij,

On Wed, Sep 20, 2017 at 8:22 AM, Anatolij Gustschin <agust@denx.de> wrote:

> I think we can do it by
>
> diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
> index 3ba4c29..b0f317b 100644
> --- a/include/configs/wandboard.h
> +++ b/include/configs/wandboard.h
> @@ -63,6 +63,7 @@
>  #define CONFIG_PHY_ATHEROS
>
>  /* Framebuffer */
> +#if !defined(CONFIG_SPL_BUILD)
>  #ifdef CONFIG_VIDEO
>  #define CONFIG_VIDEO_IPUV3
>  #define CONFIG_VIDEO_BMP_RLE8
> @@ -74,6 +75,7 @@
>  #define CONFIG_IMX_HDMI
>  #define CONFIG_IMX_VIDEO_SKIP
>  #endif
> +#endif

This solution still cause build failures for some boards.

I have a patch locally that avoids calling IPU from SPL code.

Will test it tomorrow and then will submit for all the affected boards.

Thanks

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

* [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL
  2017-09-23  1:55       ` Fabio Estevam
@ 2017-09-23 16:29         ` Anatolij Gustschin
  0 siblings, 0 replies; 10+ messages in thread
From: Anatolij Gustschin @ 2017-09-23 16:29 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On Fri, 22 Sep 2017 22:55:04 -0300
Fabio Estevam festevam at gmail.com wrote:
...
> >  /* Framebuffer */
> > +#if !defined(CONFIG_SPL_BUILD)
> >  #ifdef CONFIG_VIDEO
> >  #define CONFIG_VIDEO_IPUV3
> >  #define CONFIG_VIDEO_BMP_RLE8
> > @@ -74,6 +75,7 @@
> >  #define CONFIG_IMX_HDMI
> >  #define CONFIG_IMX_VIDEO_SKIP
> >  #endif
> > +#endif  
> 
> This solution still cause build failures for some boards.
> 
> I have a patch locally that avoids calling IPU from SPL code.
> 
> Will test it tomorrow and then will submit for all the affected boards.

Thanks!

--
Anatolij

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

end of thread, other threads:[~2017-09-23 16:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28 19:46 [U-Boot] [PATCH] imx6: disable clock command and print_cpuinfo code in SPL Anatolij Gustschin
2017-09-19  7:54 ` Stefano Babic
2017-09-19 12:18   ` Anatolij Gustschin
2017-09-20  3:18   ` Fabio Estevam
2017-09-20 11:22     ` Anatolij Gustschin
2017-09-20 13:04       ` Stefano Babic
2017-09-21  9:10         ` Max Krummenacher
2017-09-21 11:01           ` Anatolij Gustschin
2017-09-23  1:55       ` Fabio Estevam
2017-09-23 16:29         ` Anatolij Gustschin

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.