[PATCH v2 01/14] rockchip: Move the default timer init to a common file

Quentin Schulz quentin.schulz at cherry.de
Tue Aug 6 15:07:45 CEST 2024


Hi Simon,

On 7/21/24 5:25 PM, Simon Glass wrote:
> Rather than repeating the same code in two files (SPL and TPL), move it
> to a shared filed.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Dragan Simic <dsimic at manjaro.org>
> ---
> 
> (no changes since v1)
> 
>   arch/arm/include/asm/arch-rockchip/timer.h |  3 ++
>   arch/arm/mach-rockchip/Makefile            |  4 +--
>   arch/arm/mach-rockchip/spl.c               | 21 +------------
>   arch/arm/mach-rockchip/spl_common.c        | 36 ++++++++++++++++++++++
>   arch/arm/mach-rockchip/tpl.c               | 30 +-----------------
>   5 files changed, 43 insertions(+), 51 deletions(-)
>   create mode 100644 arch/arm/mach-rockchip/spl_common.c
> 
> diff --git a/arch/arm/include/asm/arch-rockchip/timer.h b/arch/arm/include/asm/arch-rockchip/timer.h
> index 77b54220447..b5fc738c98c 100644
> --- a/arch/arm/include/asm/arch-rockchip/timer.h
> +++ b/arch/arm/include/asm/arch-rockchip/timer.h
> @@ -15,4 +15,7 @@ struct rk_timer {
>   	u32 timer_int_status;
>   };
>   
> +/** rockchip_stimer_init() - Set up the timer ready for use */
> +void rockchip_stimer_init(void);
> +
>   #endif
> diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
> index c07bdaee4c3..3b13891ec24 100644
> --- a/arch/arm/mach-rockchip/Makefile
> +++ b/arch/arm/mach-rockchip/Makefile
> @@ -8,9 +8,9 @@
>   # inaccessible/protected memory (and the bootrom-helper assumes that
>   # the stack-pointer is valid before switching to the U-Boot stack).
>   obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
> -obj-spl-$(CONFIG_SPL_ROCKCHIP_COMMON_BOARD) += spl.o spl-boot-order.o
> +obj-spl-$(CONFIG_SPL_ROCKCHIP_COMMON_BOARD) += spl.o spl-boot-order.o spl_common.o
>   obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
> -obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o
> +obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o spl_common.o
>   obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o
>   
>   obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o
> diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
> index 3ce7e792b5a..bbd223bc524 100644
> --- a/arch/arm/mach-rockchip/spl.c
> +++ b/arch/arm/mach-rockchip/spl.c
> @@ -13,6 +13,7 @@
>   #include <ram.h>
>   #include <spl.h>
>   #include <asm/arch-rockchip/bootrom.h>
> +#include <asm/arch-rockchip/timer.h>
>   #include <asm/global_data.h>
>   #include <asm/io.h>
>   #include <linux/bitops.h>
> @@ -86,26 +87,6 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
>   #define	TIMER_FMODE	BIT(0)
>   #define	TIMER_RMODE	BIT(1)
>   

Please also remove the now unused constants just above this line, the 
same way you did for the tpl file.

With that,

Reviewed-by: Quentin Schulz <quentin.schulz at cherry.de>

Thanks!
Quentin


More information about the U-Boot mailing list