From f05c11cd42b97c29fb17e08cd953410775ed780a Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 2 Jan 2018 15:49:36 +0100 Subject: imx: initialize and use generic timer on i.MX 6UL/ULL The i.MX 6UL/ULL feature a Cortex-A7 CPU which suppor the ARM generic timer. This change makes use of the ARM generic timer in U-Boot. This is crucial to make the ARM generic timers usable in Linux since timer_init() initalizes the system counter module, which is necessary to use the generic timers CP15 registers. Signed-off-by: Stefan Agner Acked-by: Marcel Ziswiler --- arch/arm/cpu/armv7/mx6/Kconfig | 3 ++- arch/arm/imx-common/Makefile | 2 +- arch/arm/include/asm/arch-mx6/imx-regs.h | 1 + include/configs/mx6_common.h | 5 ++++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig index 0267dced19..51377e22a7 100644 --- a/arch/arm/cpu/armv7/mx6/Kconfig +++ b/arch/arm/cpu/armv7/mx6/Kconfig @@ -1,7 +1,7 @@ if ARCH_MX6 config MX6 - select GPT_TIMER + select GPT_TIMER if !MX6UL && !MX6ULL bool default y @@ -30,6 +30,7 @@ config MX6SX config MX6UL select SYS_L2CACHE_OFF select ROM_UNIFIED_SECTIONS + select SYSCOUNTER_TIMER bool config MX6ULL diff --git a/arch/arm/imx-common/Makefile b/arch/arm/imx-common/Makefile index 4924c6f21d..c9445fae58 100644 --- a/arch/arm/imx-common/Makefile +++ b/arch/arm/imx-common/Makefile @@ -22,7 +22,6 @@ endif ifeq ($(SOC),$(filter $(SOC),mx7)) obj-y += cpu.o obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o -obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o endif ifeq ($(SOC),$(filter $(SOC),mx6 mx7)) obj-y += cache.o init.o @@ -30,6 +29,7 @@ obj-$(CONFIG_CMD_SATA) += sata.o obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o obj-$(CONFIG_IMX_RDC) += rdc-sema.o obj-$(CONFIG_SECURE_BOOT) += hab.o +obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o endif ifeq ($(SOC),$(filter $(SOC),mx6 mx7 vf610)) obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 4ed5df7e39..6e0d133a8c 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -274,6 +274,7 @@ #endif #define IP2APB_TZASC1_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x50000) #ifdef CONFIG_MX6UL +#define SCTR_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x5C000) #define QSPI0_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x60000) #define UART6_BASE_ADDR (AIPS2_OFF_BASE_ADDR + 0x7C000) #elif defined(CONFIG_MX6SX) diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h index d28654b2ed..f77c93f74a 100644 --- a/include/configs/mx6_common.h +++ b/include/configs/mx6_common.h @@ -7,7 +7,10 @@ #ifndef __MX6_COMMON_H #define __MX6_COMMON_H -#ifndef CONFIG_MX6UL +#ifdef CONFIG_MX6UL +#define CONFIG_SC_TIMER_CLK 8000000 /* 8Mhz */ +#define COUNTER_FREQUENCY CONFIG_SC_TIMER_CLK +#else #define CONFIG_ARM_ERRATA_743622 #define CONFIG_ARM_ERRATA_751472 #define CONFIG_ARM_ERRATA_794072 -- cgit v1.2.3