All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/3] imx: move CONFIG_SYSCOUNTER_TIMER to Kconfig
@ 2018-01-05 14:08 Stefan Agner
  2018-01-05 14:08 ` [U-Boot] [PATCH v2 2/3] imx: introduce CONFIG_GPT_TIMER Stefan Agner
  2018-01-05 14:08 ` [U-Boot] [PATCH v2 3/3] imx: initialize and use generic timer on i.MX 6UL/ULL Stefan Agner
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Agner @ 2018-01-05 14:08 UTC (permalink / raw)
  To: u-boot

From: Stefan Agner <stefan.agner@toradex.com>

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
---

Changes in v2: None

 arch/arm/mach-imx/Kconfig     | 3 +++
 arch/arm/mach-imx/mx7/Kconfig | 1 +
 include/configs/mx7_common.h  | 1 -
 scripts/config_whitelist.txt  | 1 -
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index e687048b31..653819123c 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -7,6 +7,9 @@ config IMX_CONFIG
 config ROM_UNIFIED_SECTIONS
 	bool
 
+config SYSCOUNTER_TIMER
+	bool
+
 config IMX_RDC
 	bool "i.MX Resource domain controller driver"
 	depends on ARCH_MX6 || ARCH_MX7
diff --git a/arch/arm/mach-imx/mx7/Kconfig b/arch/arm/mach-imx/mx7/Kconfig
index 4f8b4e138e..2a3db860bb 100644
--- a/arch/arm/mach-imx/mx7/Kconfig
+++ b/arch/arm/mach-imx/mx7/Kconfig
@@ -3,6 +3,7 @@ if ARCH_MX7
 config MX7
 	bool
 	select ROM_UNIFIED_SECTIONS
+	select SYSCOUNTER_TIMER
 	select CPU_V7_HAS_VIRT
 	select CPU_V7_HAS_NONSEC
 	select ARCH_SUPPORT_PSCI
diff --git a/include/configs/mx7_common.h b/include/configs/mx7_common.h
index 16e4d95ff4..17850400c1 100644
--- a/include/configs/mx7_common.h
+++ b/include/configs/mx7_common.h
@@ -19,7 +19,6 @@
 
 /* Timer settings */
 #define CONFIG_MXC_GPT_HCLK
-#define CONFIG_SYSCOUNTER_TIMER
 #define CONFIG_SC_TIMER_CLK 8000000 /* 8Mhz */
 #define COUNTER_FREQUENCY CONFIG_SC_TIMER_CLK
 #define CONFIG_SYS_FSL_CLK
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 43a4ff0892..5d8d907cc4 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2219,7 +2219,6 @@ CONFIG_SUPPORT_RAW_INITRD
 CONFIG_SUPPORT_VFAT
 CONFIG_SUVD3
 CONFIG_SXNI855T
-CONFIG_SYSCOUNTER_TIMER
 CONFIG_SYSFLAGS_ADDR
 CONFIG_SYSFS
 CONFIG_SYSMGR_ISWGRP_HANDOFF
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2 2/3] imx: introduce CONFIG_GPT_TIMER
  2018-01-05 14:08 [U-Boot] [PATCH v2 1/3] imx: move CONFIG_SYSCOUNTER_TIMER to Kconfig Stefan Agner
@ 2018-01-05 14:08 ` Stefan Agner
  2018-01-05 14:08 ` [U-Boot] [PATCH v2 3/3] imx: initialize and use generic timer on i.MX 6UL/ULL Stefan Agner
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Agner @ 2018-01-05 14:08 UTC (permalink / raw)
  To: u-boot

From: Stefan Agner <stefan.agner@toradex.com>

Introduce a new config symbol to select the i.MX
General Purpose Timer (GPT).

Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
---

Changes in v2:
- Fix Kconfig for MX5

 arch/arm/mach-imx/Kconfig     | 3 +++
 arch/arm/mach-imx/Makefile    | 3 ++-
 arch/arm/mach-imx/mx5/Kconfig | 1 +
 arch/arm/mach-imx/mx6/Kconfig | 1 +
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 653819123c..3aec89d440 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -10,6 +10,9 @@ config ROM_UNIFIED_SECTIONS
 config SYSCOUNTER_TIMER
 	bool
 
+config GPT_TIMER
+	bool
+
 config IMX_RDC
 	bool "i.MX Resource domain controller driver"
 	depends on ARCH_MX6 || ARCH_MX7
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index d77c10e176..9322c1ce83 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -11,7 +11,8 @@ ifeq ($(SOC),$(filter $(SOC),mx25 mx35 mx5 mx6 mx7 vf610))
 obj-y	= iomux-v3.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx5 mx6))
-obj-y	+= timer.o cpu.o speed.o
+obj-y	+= cpu.o speed.o
+obj-$(CONFIG_GPT_TIMER) += timer.o
 obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs))
diff --git a/arch/arm/mach-imx/mx5/Kconfig b/arch/arm/mach-imx/mx5/Kconfig
index 250194b623..3ce6bcfc88 100644
--- a/arch/arm/mach-imx/mx5/Kconfig
+++ b/arch/arm/mach-imx/mx5/Kconfig
@@ -1,6 +1,7 @@
 if ARCH_MX5
 
 config MX5
+	select GPT_TIMER
 	bool
 	default y
 
diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index 752471fb72..1af60df8d8 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -9,6 +9,7 @@ config MX6_SMP
 
 config MX6
 	select ARM_ERRATA_743622 if !MX6UL && !MX6ULL
+	select GPT_TIMER
 	bool
 	default y
 	imply CMD_FUSE
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2 3/3] imx: initialize and use generic timer on i.MX 6UL/ULL
  2018-01-05 14:08 [U-Boot] [PATCH v2 1/3] imx: move CONFIG_SYSCOUNTER_TIMER to Kconfig Stefan Agner
  2018-01-05 14:08 ` [U-Boot] [PATCH v2 2/3] imx: introduce CONFIG_GPT_TIMER Stefan Agner
@ 2018-01-05 14:08 ` Stefan Agner
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Agner @ 2018-01-05 14:08 UTC (permalink / raw)
  To: u-boot

From: Stefan Agner <stefan.agner@toradex.com>

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 <stefan.agner@toradex.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
---

Changes in v2: None

 arch/arm/include/asm/arch-mx6/imx-regs.h | 1 +
 arch/arm/mach-imx/Makefile               | 2 +-
 arch/arm/mach-imx/mx6/Kconfig            | 4 +++-
 include/configs/mx6_common.h             | 5 ++++-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h
index 4be7aab18a..48ce0edd06 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -291,6 +291,7 @@
 #endif
 #define IP2APB_TZASC1_BASE_ADDR     (AIPS2_OFF_BASE_ADDR + 0x50000)
 #if (defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL))
+#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/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 9322c1ce83..d7966cfd4a 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/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
@@ -31,6 +30,7 @@ obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
 obj-$(CONFIG_IMX_RDC) += rdc-sema.o
 obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
 obj-$(CONFIG_SECURE_BOOT)    += hab.o
+obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
 endif
 ifeq ($(SOC),$(filter $(SOC),mx7ulp))
 obj-y  += cache.o
diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index 1af60df8d8..86b80ca576 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -9,7 +9,7 @@ config MX6_SMP
 
 config MX6
 	select ARM_ERRATA_743622 if !MX6UL && !MX6ULL
-	select GPT_TIMER
+	select GPT_TIMER if !MX6UL && !MX6ULL
 	bool
 	default y
 	imply CMD_FUSE
@@ -54,6 +54,7 @@ config MX6UL
 	select HAS_CAAM
 	select SYS_L2CACHE_OFF
 	select ROM_UNIFIED_SECTIONS
+	select SYSCOUNTER_TIMER
 	bool
 
 config MX6UL_LITESOM
@@ -76,6 +77,7 @@ config MX6UL_OPOS6UL
 config MX6ULL
 	select SYS_L2CACHE_OFF
 	select ROM_UNIFIED_SECTIONS
+	select SYSCOUNTER_TIMER
 	bool
 
 config MX6_DDRCAL
diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
index 59e6daea62..ddc645c136 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
 
-#if !(defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL))
+#if (defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL))
+#define CONFIG_SC_TIMER_CLK 8000000 /* 8Mhz */
+#define COUNTER_FREQUENCY CONFIG_SC_TIMER_CLK
+#else
 #ifndef CONFIG_SYS_L2CACHE_OFF
 #define CONFIG_SYS_L2_PL310
 #define CONFIG_SYS_PL310_BASE	L2_PL310_BASE
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-05 14:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-05 14:08 [U-Boot] [PATCH v2 1/3] imx: move CONFIG_SYSCOUNTER_TIMER to Kconfig Stefan Agner
2018-01-05 14:08 ` [U-Boot] [PATCH v2 2/3] imx: introduce CONFIG_GPT_TIMER Stefan Agner
2018-01-05 14:08 ` [U-Boot] [PATCH v2 3/3] imx: initialize and use generic timer on i.MX 6UL/ULL Stefan Agner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.