* [PATCH V2 1/3] arm: omap3: Make try_unlock_memory() static
2021-06-25 19:23 [PATCH V2 0/3] Make omap3 board functions static Adam Ford
@ 2021-06-25 19:23 ` Adam Ford
2021-06-25 19:23 ` [PATCH V2 2/3] arm: omap3: Make secureworld_exit() static Adam Ford
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Adam Ford @ 2021-06-25 19:23 UTC (permalink / raw)
To: u-boot; +Cc: lukma, pavel, pali, lokeshvutla, aford, Adam Ford
try_unlock_memory() is only used in one file, so make it static
in that file,remove it from the sys_proto header file, and relocate
it into the #ifdef section that call it. This will make it only built
under the conditions when it is called, and it may help with some
further optimization in the future.
Signed-off-by: Adam Ford <aford173@gmail.com>
diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h
index 32ac033515..656f848a73 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -60,7 +60,6 @@ u32 is_running_in_sram(void);
u32 is_running_in_flash(void);
u32 get_device_type(void);
void secureworld_exit(void);
-void try_unlock_memory(void);
u32 get_boot_type(void);
void invalidate_dcache(u32);
u32 wait_on_value(u32, u32, void *, u32);
diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c
index 029bd54595..ef4fa80c7b 100644
--- a/arch/arm/mach-omap2/omap3/board.c
+++ b/arch/arm/mach-omap2/omap3/board.c
@@ -140,12 +140,20 @@ void secureworld_exit(void)
__asm__ __volatile__("mcr p15, 0, %0, c1, c1, 0":"=r"(i));
}
+void early_system_init(void)
+{
+ hw_data_init();
+}
+
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
+ !defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
+
/******************************************************************************
* Routine: try_unlock_sram()
* Description: If chip is GP/EMU(special) type, unlock the SRAM for
* general use.
*****************************************************************************/
-void try_unlock_memory(void)
+static void try_unlock_memory(void)
{
int mode;
int in_sdram = is_running_in_sdram();
@@ -174,13 +182,6 @@ void try_unlock_memory(void)
return;
}
-void early_system_init(void)
-{
- hw_data_init();
-}
-
-#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
- !defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
/******************************************************************************
* Routine: s_init
* Description: Does early system init of muxing and clocks.
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH V2 2/3] arm: omap3: Make secureworld_exit() static
2021-06-25 19:23 [PATCH V2 0/3] Make omap3 board functions static Adam Ford
2021-06-25 19:23 ` [PATCH V2 1/3] arm: omap3: Make try_unlock_memory() static Adam Ford
@ 2021-06-25 19:23 ` Adam Ford
2021-06-25 19:23 ` [PATCH V2 3/3] arm: omap3: Make secure_unlock_mem() static Adam Ford
2021-07-14 6:52 ` [PATCH V2 0/3] Make omap3 board functions static Lokesh Vutla
3 siblings, 0 replies; 5+ messages in thread
From: Adam Ford @ 2021-06-25 19:23 UTC (permalink / raw)
To: u-boot; +Cc: lukma, pavel, pali, lokeshvutla, aford, Adam Ford
secureworld_exit() is only used in one file, so make it static
to that file and remove it from sys_proto.h. This
may help with some further optimization in the future.
Signed-off-by: Adam Ford <aford173@gmail.com>
---
V2: Move secureworld_exit into area encompassed by ifdef to only
define when potentially used to avoid error:
error: 'secure_unlock_mem' defined but not used
diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h
index 656f848a73..a6e9ff84aa 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -59,7 +59,6 @@ u32 is_running_in_sdram(void);
u32 is_running_in_sram(void);
u32 is_running_in_flash(void);
u32 get_device_type(void);
-void secureworld_exit(void);
u32 get_boot_type(void);
void invalidate_dcache(u32);
u32 wait_on_value(u32, u32, void *, u32);
diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c
index ef4fa80c7b..41d0d3ef69 100644
--- a/arch/arm/mach-omap2/omap3/board.c
+++ b/arch/arm/mach-omap2/omap3/board.c
@@ -114,7 +114,7 @@ void secure_unlock_mem(void)
* configure secure registers and exit secure world
* general use.
*****************************************************************************/
-void secureworld_exit(void)
+static void secureworld_exit(void)
{
unsigned long i;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH V2 3/3] arm: omap3: Make secure_unlock_mem() static
2021-06-25 19:23 [PATCH V2 0/3] Make omap3 board functions static Adam Ford
2021-06-25 19:23 ` [PATCH V2 1/3] arm: omap3: Make try_unlock_memory() static Adam Ford
2021-06-25 19:23 ` [PATCH V2 2/3] arm: omap3: Make secureworld_exit() static Adam Ford
@ 2021-06-25 19:23 ` Adam Ford
2021-07-14 6:52 ` [PATCH V2 0/3] Make omap3 board functions static Lokesh Vutla
3 siblings, 0 replies; 5+ messages in thread
From: Adam Ford @ 2021-06-25 19:23 UTC (permalink / raw)
To: u-boot; +Cc: lukma, pavel, pali, lokeshvutla, aford, Adam Ford
secure_unlock_mem() is only used in one file, so make it static
in that file.
Signed-off-by: Adam Ford <aford173@gmail.com>
---
V2: Move secure_unlock_mem into area encompassed by ifdef to only
define it when potentially used to avoid errors.
diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c
index 41d0d3ef69..363af52845 100644
--- a/arch/arm/mach-omap2/omap3/board.c
+++ b/arch/arm/mach-omap2/omap3/board.c
@@ -71,12 +71,20 @@ const struct gpio_bank *const omap_gpio_bank = gpio_bank_34xx;
#endif
+void early_system_init(void)
+{
+ hw_data_init();
+}
+
+#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
+ !defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
+
/******************************************************************************
* Routine: secure_unlock
* Description: Setup security registers for access
* (GP Device only)
*****************************************************************************/
-void secure_unlock_mem(void)
+static void secure_unlock_mem(void)
{
struct pm *pm_rt_ape_base = (struct pm *)PM_RT_APE_BASE_ADDR_ARM;
struct pm *pm_gpmc_base = (struct pm *)PM_GPMC_BASE_ADDR_ARM;
@@ -140,14 +148,6 @@ static void secureworld_exit(void)
__asm__ __volatile__("mcr p15, 0, %0, c1, c1, 0":"=r"(i));
}
-void early_system_init(void)
-{
- hw_data_init();
-}
-
-#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
- !defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
-
/******************************************************************************
* Routine: try_unlock_sram()
* Description: If chip is GP/EMU(special) type, unlock the SRAM for
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH V2 0/3] Make omap3 board functions static
2021-06-25 19:23 [PATCH V2 0/3] Make omap3 board functions static Adam Ford
` (2 preceding siblings ...)
2021-06-25 19:23 ` [PATCH V2 3/3] arm: omap3: Make secure_unlock_mem() static Adam Ford
@ 2021-07-14 6:52 ` Lokesh Vutla
3 siblings, 0 replies; 5+ messages in thread
From: Lokesh Vutla @ 2021-07-14 6:52 UTC (permalink / raw)
To: u-boot, Adam Ford; +Cc: Lokesh Vutla, pavel, pali, aford, lukma
On Fri, 25 Jun 2021 14:23:05 -0500, Adam Ford wrote:
> Several functions in omap3/board.c are only used in that file, and
> two of them are only called when certain conditions are true in an
> ifdef. Rearange these functions to also be inside the ifdef and
> make them static.
>
> Before:
>
> [...]
Applied to https://source.denx.de/u-boot/custodians/u-boot-ti.git for-rc, thanks!
[1/3] arm: omap3: Make try_unlock_memory() static
https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/c19d0431e9
[2/3] arm: omap3: Make secureworld_exit() static
https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/c7c426aeac
[3/3] arm: omap3: Make secure_unlock_mem() static
https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/834f72af36
--
Thanks and Regards,
Lokesh
^ permalink raw reply [flat|nested] 5+ messages in thread