arm: mvebu: Remove timer.c
Subsystems (3)
PATCH 1/2 arm: mvebu: Remove timer.c
Since the move to CONFIG_TIMER with support for CONFIG_TIMER_EARLY, this platform specific init_timer() function is not needed any more. Let's remove it completely.
--- arch/arm/mach-mvebu/Makefile | 5 ----- arch/arm/mach-mvebu/spl.c | 2 -- arch/arm/mach-mvebu/timer.c | 41 ------------------------------------ 3 files changed, 48 deletions(-) delete mode 100644 arch/arm/mach-mvebu/timer.c
arch/arm/mach-mvebu/Makefile +0 -5
@@ -16,10 +16,6 @@ obj-y = dram.o obj-y += gpio.o obj-y += mbus.o -ifndef CONFIG_TIMER -obj-y += timer.o -endif - else # CONFIG_ARCH_KIRKWOOD obj-y = cpu.o
@@ -97,7 +93,6 @@ $(obj)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \ endif # CONFIG_SPL_BUILD obj-y += gpio.o obj-y += mbus.o -obj-y += timer.o obj-$(CONFIG_SPL_BUILD) += spl.o obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.o
arch/arm/mach-mvebu/spl.c +0 -2
@@ -340,8 +340,6 @@ void board_init_f(ulong dummy)preloader_console_init (); -timer_init (); -/* Armada 375 does not support SerDes and DDR3 init yet */ #if !defined(CONFIG_ARMADA_375 )/* First init the serdes PHY's */
arch/arm/mach-mvebu/timer.c deleted +0 -41
41 lines not on this page · raw message
Signature · 1 line
2.37.3
PATCH 2/2 timer: orion-timer: Only init timer once
Move the code making sure that the timer is initialized only once into orion_timer_init(), which is called from timer_early_init() and from orion_timer_probe(). This way the timer is not re-initialized.
--- drivers/timer/orion-timer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/timer/orion-timer.c +5 -5
@@ -28,6 +28,11 @@ static bool early_init_done __section(".data") = false;/* Common functions for early (boot) and DM based timer */ static void orion_timer_init (void *base,enum input_clock_type type) { +/* Only init the timer once */ +if (early_init_done) +return ; + early_init_done = true; +writel (~0 , base +TIMER0_VAL );writel (~0 , base +TIMER0_RELOAD );
@@ -51,11 +56,6 @@ static uint64_t orion_timer_get_count(void *base)/* Early (e.g. bootstage etc) timer functions */ static void notrace timer_early_init(void) { -/* Only init the timer once */ -if (early_init_done) -return ; - early_init_done = true; -if (IS_ENABLED (CONFIG_ARCH_MVEBU ))orion_timer_init ((void *)MVEBU_TIMER_BASE ,INPUT_CLOCK_25MHZ );else
Signature · 1 line
2.37.3
Re: [PATCH 2/2] timer: orion-timer: Only init timer once
Quoted 7 lines · Stefan Roese
Move the code making sure that the timer is initialized only once into
orion_timer_init(), which is called fromtimer_early_init()and fromorion_timer_probe(). This way the timer is not re-initialized.Signed-off-by Stefan Roese <[email protected]>Cc Michael Walle <[email protected]>Cc Pali Rohár <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
Quoted 22 lines
--- drivers/timer/orion-timer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/timer/orion-timer.c +5
-0@@ -28,6 +28,11 @@ static bool early_init_done __section(".data") = false;/* Common functions for early (boot) and DM based timer */ static void orion_timer_init (void *base,enum input_clock_type type) { +/* Only init the timer once */ +if (early_init_done) +return ; + early_init_done = true; +writel (~0 , base +TIMER0_VAL );writel (~0 , base +TIMER0_RELOAD );@@ -51,11 +56,6 @@ static uint64_t orion_timer_get_count(void *base)/* Early (e.g. bootstage etc) timer functions */
drivers/timer/orion-timer.c static uint64_t orion_timer_get_count(void *base) · line 61
Quoted 10 lines
drivers/timer/orion-timer.c +0
-5static void notrace timer_early_init(void) { -/* Only init the timer once */ -if (early_init_done) -return ; - early_init_done = true; -if (IS_ENABLED (CONFIG_ARCH_MVEBU ))orion_timer_init ((void *)MVEBU_TIMER_BASE ,INPUT_CLOCK_25MHZ );else
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
Quoted 7 lines · Stefan Roese
Since the move to
CONFIG_TIMERwith support forCONFIG_TIMER_EARLY, this platform specificinit_timer()function is not needed any more. Let's remove it completely.Signed-off-by Stefan Roese <[email protected]>Cc Michael Walle <[email protected]>Cc Pali Rohár <[email protected]>
Applied to u-boot-marvell/master
Thanks,
Stefan
Quoted 80 lines
--- arch/arm/mach-mvebu/Makefile | 5 ----- arch/arm/mach-mvebu/spl.c | 2 -- arch/arm/mach-mvebu/timer.c | 41 ------------------------------------ 3 files changed, 48 deletions(-)delete mode 100644
arch/arm/mach-mvebu/timer.carch/arm/mach-mvebu/Makefile +0
-5@@ -16,10 +16,6 @@ obj-y = dram.o obj-y += gpio.o obj-y += mbus.o -ifndef CONFIG_TIMER -obj-y += timer.o -endif - else # CONFIG_ARCH_KIRKWOOD obj-y = cpu.o@@ -97,7 +93,6 @@ $(obj)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \ endif # CONFIG_SPL_BUILD obj-y += gpio.o obj-y += mbus.o -obj-y += timer.o obj-$(CONFIG_SPL_BUILD) += spl.o obj-$(CONFIG_SPL_BUILD) += lowlevel_spl.oarch/arm/mach-mvebu/spl.c +0
-2@@ -340,8 +340,6 @@ void board_init_f(ulong dummy)preloader_console_init (); -timer_init (); -/* Armada 375 does not support SerDes and DDR3 init yet */ #if !defined(CONFIG_ARMADA_375 )/* First init the serdes PHY's */ arch/arm/mach-mvebu/timer.c deleted +0
-31@@ -1,41 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* -* Copyright (C) Marvell International Ltd. and its affiliates -* Written-by: Prafulla Wadaskar <[email protected]> -* -* Copyright (C) 2015 Stefan Roese <[email protected]> -*/ - -#include <common.h> -#include <init.h> -#include <asm/io.h> -#include <asm/arch/soc.h> -#include <linux/bitops.h> - -#define TIMER_LOAD_VAL 0xffffffff - -static int init_done __section(".data") = 0; - -/* -* Timer initialization -*/ -int timer_init (void ) -{ -/* Only init the timer once */ -if (init_done) -return 0 ; - init_done =1 ; - -/* load value into timer */ -writel (TIMER_LOAD_VAL ,MVEBU_TIMER_BASE +0x10 ); -writel (TIMER_LOAD_VAL ,MVEBU_TIMER_BASE +0x14 );
arch/arm/mach-mvebu/timer.c line 41
Quoted 10 lines
arch/arm/mach-mvebu/timer.c deleted +0
-10- -#if defined(CONFIG_ARCH_MVEBU ) -/* On Armada XP / 38x ..., the 25MHz clock source needs to be enabled */ -setbits_le32 (MVEBU_TIMER_BASE +0x00 ,BIT (11 )); -#endif -/* enable timer in auto reload mode */ -setbits_le32 (MVEBU_TIMER_BASE +0x00 ,0x3 ); - -return 0 ; -}
Viele Grüße,
Stefan Roese
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]