diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-03-10 09:03:24 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-03-18 07:11:17 +0100 |
commit | f5ac186c973856752fac2b7eee210afd94135f1c (patch) | |
tree | c8ba0123707af6a0cae7737da2224e5e960891e2 /arch | |
parent | fd5b60241bd072b9020baf159f63adade54ac1dd (diff) | |
download | barebox-f5ac186c973856752fac2b7eee210afd94135f1c.tar.gz barebox-f5ac186c973856752fac2b7eee210afd94135f1c.tar.xz |
ARM: at91: sama5d27-som1: clean up lowlevel.c
In ARM, stack decrements before storing values, so decrementing a number
from the stack base is unnecessary. Existing instances of this were
removed in 6b3dc4abd8 ("ARM: Cleanup stack offset cargo cult"), but the
sama5d27-som1 board was added later than that. Fix the cargo cult here
as well and while at it, turn a macro that doesn't need to be one
into a static inline function.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boards/sama5d27-som1/lowlevel.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/boards/sama5d27-som1/lowlevel.c b/arch/arm/boards/sama5d27-som1/lowlevel.c index 7df5a4772d..6907dcf812 100644 --- a/arch/arm/boards/sama5d27-som1/lowlevel.c +++ b/arch/arm/boards/sama5d27-som1/lowlevel.c @@ -22,8 +22,10 @@ /* PCK = 492MHz, MCK = 164MHz */ #define MASTER_CLOCK 164000000 -#define sama5d2_pmc_enable_periph_clock(clk) \ - at91_pmc_sam9x5_enable_periph_clock(IOMEM(SAMA5D2_BASE_PMC), clk) +static inline void sama5d2_pmc_enable_periph_clock(int clk) +{ + at91_pmc_sam9x5_enable_periph_clock(IOMEM(SAMA5D2_BASE_PMC), clk); +} static void ek_turn_led(unsigned color) { @@ -69,7 +71,7 @@ ENTRY_FUNCTION(start_sama5d27_som1_ek, r0, r1, r2) arm_cpu_lowlevel_init(); - arm_setup_stack(SAMA5D2_SRAM_BASE + SAMA5D2_SRAM_SIZE - 16); + arm_setup_stack(SAMA5D2_SRAM_BASE + SAMA5D2_SRAM_SIZE); if (IS_ENABLED(CONFIG_DEBUG_LL)) ek_dbgu_init(); |