[PATCH] arm: imx: Rework i.MX specific commands to be excluded from SPL

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] arm: imx: Rework i.MX specific commands to be excluded from SPL

Tom Rini-4
The "clocks" and "bootaux" commands are only usable in full U-Boot, not
SPL, so do not link them inside of SPL.  Rework a little of the bootaux
related code to make use of __weak and declare parts of it static as
it's local to the file.

Cc: Stefano Babic <[hidden email]>
Cc: Fabio Estevam <[hidden email]>
Signed-off-by: Tom Rini <[hidden email]>
---
 arch/arm/mach-imx/Makefile       |  2 ++
 arch/arm/mach-imx/imx_bootaux.c  | 13 ++++---------
 arch/arm/mach-imx/mx5/clock.c    |  4 +++-
 arch/arm/mach-imx/mx7/clock.c    |  2 ++
 arch/arm/mach-imx/mx7ulp/clock.c |  2 ++
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index d77c10e17684..783b2c8602ba 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -28,7 +28,9 @@ obj-y += cache.o init.o
 obj-$(CONFIG_SATA) += sata.o
 obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
 obj-$(CONFIG_IMX_RDC) += rdc-sema.o
+ifneq ($(CONFIG_SPL_BUILD),y)
 obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
+endif
 obj-$(CONFIG_SECURE_BOOT)    += hab.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx7ulp))
diff --git a/arch/arm/mach-imx/imx_bootaux.c b/arch/arm/mach-imx/imx_bootaux.c
index 69026df7630f..b62dfbf6bf6c 100644
--- a/arch/arm/mach-imx/imx_bootaux.c
+++ b/arch/arm/mach-imx/imx_bootaux.c
@@ -6,27 +6,22 @@
 
 #include <common.h>
 #include <command.h>
+#include <linux/compiler.h>
 
 /* Allow for arch specific config before we boot */
-static int __arch_auxiliary_core_up(u32 core_id, u32 boot_private_data)
+int __weak arch_auxiliary_core_up(u32 core_id, u32 boot_private_data)
 {
  /* please define platform specific arch_auxiliary_core_up() */
  return CMD_RET_FAILURE;
 }
 
-int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data)
- __attribute__((weak, alias("__arch_auxiliary_core_up")));
-
 /* Allow for arch specific config before we boot */
-static int __arch_auxiliary_core_check_up(u32 core_id)
+int __weak arch_auxiliary_core_check_up(u32 core_id)
 {
  /* please define platform specific arch_auxiliary_core_check_up() */
  return 0;
 }
 
-int arch_auxiliary_core_check_up(u32 core_id)
- __attribute__((weak, alias("__arch_auxiliary_core_check_up")));
-
 /*
  * To i.MX6SX and i.MX7D, the image supported by bootaux needs
  * the reset vector at the head for the image, with SP and PC
@@ -40,7 +35,7 @@ int arch_auxiliary_core_check_up(u32 core_id)
  * The TCMUL is mapped to (M4_BOOTROM_BASE_ADDR) at A core side for
  * accessing the M4 TCMUL.
  */
-int do_bootaux(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_bootaux(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
  ulong addr;
  int ret, up;
diff --git a/arch/arm/mach-imx/mx5/clock.c b/arch/arm/mach-imx/mx5/clock.c
index 610098c175e9..284f6d4cde3d 100644
--- a/arch/arm/mach-imx/mx5/clock.c
+++ b/arch/arm/mach-imx/mx5/clock.c
@@ -911,10 +911,11 @@ void mxc_set_sata_internal_clock(void)
 }
 #endif
 
+#ifndef CONFIG_SPL_BUILD
 /*
  * Dump some core clockes.
  */
-int do_mx5_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_mx5_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
  u32 freq;
 
@@ -947,3 +948,4 @@ U_BOOT_CMD(
  "display clocks",
  ""
 );
+#endif
diff --git a/arch/arm/mach-imx/mx7/clock.c b/arch/arm/mach-imx/mx7/clock.c
index 8150faa1a313..c11042d6f5ed 100644
--- a/arch/arm/mach-imx/mx7/clock.c
+++ b/arch/arm/mach-imx/mx7/clock.c
@@ -1096,6 +1096,7 @@ void epdc_clock_disable(void)
 }
 #endif
 
+#ifndef CONFIG_SPL_BUILD
 /*
  * Dump some core clockes.
  */
@@ -1131,3 +1132,4 @@ U_BOOT_CMD(
  "display clocks",
  ""
 );
+#endif
diff --git a/arch/arm/mach-imx/mx7ulp/clock.c b/arch/arm/mach-imx/mx7ulp/clock.c
index 77b282addd6e..553d62149de6 100644
--- a/arch/arm/mach-imx/mx7ulp/clock.c
+++ b/arch/arm/mach-imx/mx7ulp/clock.c
@@ -323,6 +323,7 @@ void hab_caam_clock_enable(unsigned char enable)
 }
 #endif
 
+#ifndef CONFIG_SPL_BUILD
 /*
  * Dump some core clockes.
  */
@@ -363,3 +364,4 @@ U_BOOT_CMD(
  "display clocks",
  ""
 );
+#endif
--
2.7.4

_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] arm: imx: Rework i.MX specific commands to be excluded from SPL

Fabio Estevam-2
On Wed, Jan 3, 2018 at 11:52 AM, Tom Rini <[hidden email]> wrote:
> The "clocks" and "bootaux" commands are only usable in full U-Boot, not
> SPL, so do not link them inside of SPL.  Rework a little of the bootaux
> related code to make use of __weak and declare parts of it static as
> it's local to the file.
>
> Cc: Stefano Babic <[hidden email]>
> Cc: Fabio Estevam <[hidden email]>
> Signed-off-by: Tom Rini <[hidden email]>

Reviewed-by: Fabio Estevam <[hidden email]>
_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] arm: imx: Rework i.MX specific commands to be excluded from SPL

Stefano Babic
In reply to this post by Tom Rini-4
On 03/01/2018 14:52, Tom Rini wrote:

> The "clocks" and "bootaux" commands are only usable in full U-Boot, not
> SPL, so do not link them inside of SPL.  Rework a little of the bootaux
> related code to make use of __weak and declare parts of it static as
> it's local to the file.
>
> Cc: Stefano Babic <[hidden email]>
> Cc: Fabio Estevam <[hidden email]>
> Signed-off-by: Tom Rini <[hidden email]>
> ---
>  arch/arm/mach-imx/Makefile       |  2 ++
>  arch/arm/mach-imx/imx_bootaux.c  | 13 ++++---------
>  arch/arm/mach-imx/mx5/clock.c    |  4 +++-
>  arch/arm/mach-imx/mx7/clock.c    |  2 ++
>  arch/arm/mach-imx/mx7ulp/clock.c |  2 ++
>  5 files changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index d77c10e17684..783b2c8602ba 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -28,7 +28,9 @@ obj-y += cache.o init.o
>  obj-$(CONFIG_SATA) += sata.o
>  obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
>  obj-$(CONFIG_IMX_RDC) += rdc-sema.o
> +ifneq ($(CONFIG_SPL_BUILD),y)
>  obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
> +endif
>  obj-$(CONFIG_SECURE_BOOT)    += hab.o
>  endif
>  ifeq ($(SOC),$(filter $(SOC),mx7ulp))
> diff --git a/arch/arm/mach-imx/imx_bootaux.c b/arch/arm/mach-imx/imx_bootaux.c
> index 69026df7630f..b62dfbf6bf6c 100644
> --- a/arch/arm/mach-imx/imx_bootaux.c
> +++ b/arch/arm/mach-imx/imx_bootaux.c
> @@ -6,27 +6,22 @@
>  
>  #include <common.h>
>  #include <command.h>
> +#include <linux/compiler.h>
>  
>  /* Allow for arch specific config before we boot */
> -static int __arch_auxiliary_core_up(u32 core_id, u32 boot_private_data)
> +int __weak arch_auxiliary_core_up(u32 core_id, u32 boot_private_data)
>  {
>   /* please define platform specific arch_auxiliary_core_up() */
>   return CMD_RET_FAILURE;
>  }
>  
> -int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data)
> - __attribute__((weak, alias("__arch_auxiliary_core_up")));
> -
>  /* Allow for arch specific config before we boot */
> -static int __arch_auxiliary_core_check_up(u32 core_id)
> +int __weak arch_auxiliary_core_check_up(u32 core_id)
>  {
>   /* please define platform specific arch_auxiliary_core_check_up() */
>   return 0;
>  }
>  
> -int arch_auxiliary_core_check_up(u32 core_id)
> - __attribute__((weak, alias("__arch_auxiliary_core_check_up")));
> -
>  /*
>   * To i.MX6SX and i.MX7D, the image supported by bootaux needs
>   * the reset vector at the head for the image, with SP and PC
> @@ -40,7 +35,7 @@ int arch_auxiliary_core_check_up(u32 core_id)
>   * The TCMUL is mapped to (M4_BOOTROM_BASE_ADDR) at A core side for
>   * accessing the M4 TCMUL.
>   */
> -int do_bootaux(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> +static int do_bootaux(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  {
>   ulong addr;
>   int ret, up;
> diff --git a/arch/arm/mach-imx/mx5/clock.c b/arch/arm/mach-imx/mx5/clock.c
> index 610098c175e9..284f6d4cde3d 100644
> --- a/arch/arm/mach-imx/mx5/clock.c
> +++ b/arch/arm/mach-imx/mx5/clock.c
> @@ -911,10 +911,11 @@ void mxc_set_sata_internal_clock(void)
>  }
>  #endif
>  
> +#ifndef CONFIG_SPL_BUILD
>  /*
>   * Dump some core clockes.
>   */
> -int do_mx5_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
> +static int do_mx5_showclocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>  {
>   u32 freq;
>  
> @@ -947,3 +948,4 @@ U_BOOT_CMD(
>   "display clocks",
>   ""
>  );
> +#endif
> diff --git a/arch/arm/mach-imx/mx7/clock.c b/arch/arm/mach-imx/mx7/clock.c
> index 8150faa1a313..c11042d6f5ed 100644
> --- a/arch/arm/mach-imx/mx7/clock.c
> +++ b/arch/arm/mach-imx/mx7/clock.c
> @@ -1096,6 +1096,7 @@ void epdc_clock_disable(void)
>  }
>  #endif
>  
> +#ifndef CONFIG_SPL_BUILD
>  /*
>   * Dump some core clockes.
>   */
> @@ -1131,3 +1132,4 @@ U_BOOT_CMD(
>   "display clocks",
>   ""
>  );
> +#endif
> diff --git a/arch/arm/mach-imx/mx7ulp/clock.c b/arch/arm/mach-imx/mx7ulp/clock.c
> index 77b282addd6e..553d62149de6 100644
> --- a/arch/arm/mach-imx/mx7ulp/clock.c
> +++ b/arch/arm/mach-imx/mx7ulp/clock.c
> @@ -323,6 +323,7 @@ void hab_caam_clock_enable(unsigned char enable)
>  }
>  #endif
>  
> +#ifndef CONFIG_SPL_BUILD
>  /*
>   * Dump some core clockes.
>   */
> @@ -363,3 +364,4 @@ U_BOOT_CMD(
>   "display clocks",
>   ""
>  );
> +#endif
>

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

--
=====================================================================
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: [hidden email]
=====================================================================
_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot
Reply | Threaded
Open this post in threaded view
|

Re: arm: imx: Rework i.MX specific commands to be excluded from SPL

Peng Fan-4
In reply to this post by Tom Rini-4
Sorry, please ignore. I was just testing my git.

-Peng
_______________________________________________
U-Boot mailing list
[hidden email]
https://lists.denx.de/listinfo/u-boot