[PATCH 6/7] arm: omap2plus: Move CONFIG_SYS_PTV out of CONFIG namespace

Tom Rini trini at konsulko.com
Fri May 13 04:44:06 CEST 2022


This is always defined to 2, and referenced in two places.  Move the
define to <asm/omap_common.h> and make sure the code that uses this
includes that file.  Make <asm/arch-omap*/clock.h> not include that
file, as we don't need to be doing so.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 arch/arm/include/asm/arch-omap4/clock.h | 1 -
 arch/arm/include/asm/arch-omap5/clock.h | 1 -
 arch/arm/include/asm/omap_common.h      | 1 +
 arch/arm/mach-omap2/sata.c              | 1 +
 arch/arm/mach-omap2/timer.c             | 5 +++--
 drivers/timer/omap-timer.c              | 5 +++--
 include/configs/bur_am335x_common.h     | 1 -
 include/configs/nokia_rx51.h            | 1 -
 include/configs/siemens-am33x-common.h  | 1 -
 include/configs/sniper.h                | 1 -
 include/configs/ti814x_evm.h            | 1 -
 include/configs/ti816x_evm.h            | 1 -
 include/configs/ti_armv7_common.h       | 3 ---
 13 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/arch/arm/include/asm/arch-omap4/clock.h b/arch/arm/include/asm/arch-omap4/clock.h
index 0a626fe647a2..4054dd8edcbc 100644
--- a/arch/arm/include/asm/arch-omap4/clock.h
+++ b/arch/arm/include/asm/arch-omap4/clock.h
@@ -7,7 +7,6 @@
  */
 #ifndef _CLOCKS_OMAP4_H_
 #define _CLOCKS_OMAP4_H_
-#include <asm/omap_common.h>
 
 /*
  * Assuming a maximum of 1.5 GHz ARM speed and a minimum of 2 cycles per
diff --git a/arch/arm/include/asm/arch-omap5/clock.h b/arch/arm/include/asm/arch-omap5/clock.h
index a00626e357c9..b18ef459decc 100644
--- a/arch/arm/include/asm/arch-omap5/clock.h
+++ b/arch/arm/include/asm/arch-omap5/clock.h
@@ -8,7 +8,6 @@
  */
 #ifndef _CLOCKS_OMAP5_H_
 #define _CLOCKS_OMAP5_H_
-#include <asm/omap_common.h>
 
 /*
  * Assuming a maximum of 1.5 GHz ARM speed and a minimum of 2 cycles per
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 264a2e717a70..17fdfbcffb7a 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -13,6 +13,7 @@
 #include <linux/types.h>
 
 #define NUM_SYS_CLKS	7
+#define SYS_PTV		2	/* Divisor: 2^(PTV+1) => 8 */
 
 struct bd_info;
 
diff --git a/arch/arm/mach-omap2/sata.c b/arch/arm/mach-omap2/sata.c
index 4672dc534c5e..53c39ce1fb68 100644
--- a/arch/arm/mach-omap2/sata.c
+++ b/arch/arm/mach-omap2/sata.c
@@ -13,6 +13,7 @@
 #include <asm/arch/sata.h>
 #include <sata.h>
 #include <asm/io.h>
+#include <asm/omap_common.h>
 #include "pipe3-phy.h"
 
 static struct pipe3_dpll_map dpll_map_sata[] = {
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 82b10f6b2487..00d91c10136d 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -22,6 +22,7 @@
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/clock.h>
+#include <asm/omap_common.h>
 #include <linux/delay.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -33,7 +34,7 @@ static ulong get_timer_masked(void);
  * Nothing really to do with interrupts, just starts up a counter.
  */
 
-#define TIMER_CLOCK		(V_SCLK / (2 << CONFIG_SYS_PTV))
+#define TIMER_CLOCK		(V_SCLK / (2 << SYS_PTV))
 #define TIMER_OVERFLOW_VAL	0xffffffff
 #define TIMER_LOAD_VAL		0
 
@@ -42,7 +43,7 @@ int timer_init(void)
 	/* start the counter ticking up, reload value on overflow */
 	writel(TIMER_LOAD_VAL, &timer_base->tldr);
 	/* enable timer */
-	writel((CONFIG_SYS_PTV << 2) | TCLR_PRE | TCLR_AR | TCLR_ST,
+	writel((SYS_PTV << 2) | TCLR_PRE | TCLR_AR | TCLR_ST,
 		&timer_base->tclr);
 
 	return 0;
diff --git a/drivers/timer/omap-timer.c b/drivers/timer/omap-timer.c
index 25a6108fef2c..aa2e4360c1bb 100644
--- a/drivers/timer/omap-timer.c
+++ b/drivers/timer/omap-timer.c
@@ -11,6 +11,7 @@
 #include <timer.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
+#include <asm/omap_common.h>
 #include <linux/bitops.h>
 
 /* Timer register bits */
@@ -61,13 +62,13 @@ static int omap_timer_probe(struct udevice *dev)
 	if (!uc_priv->clock_rate)
 		uc_priv->clock_rate = V_SCLK;
 
-	uc_priv->clock_rate /= (2 << CONFIG_SYS_PTV);
+	uc_priv->clock_rate /= (2 << SYS_PTV);
 
 	/* start the counter ticking up, reload value on overflow */
 	writel(0, &priv->regs->tldr);
 	writel(0, &priv->regs->tcrr);
 	/* enable timer */
-	writel((CONFIG_SYS_PTV << 2) | TCLR_PRE_EN | TCLR_AUTO_RELOAD |
+	writel((SYS_PTV << 2) | TCLR_PRE_EN | TCLR_AUTO_RELOAD |
 	       TCLR_START, &priv->regs->tclr);
 
 	return 0;
diff --git a/include/configs/bur_am335x_common.h b/include/configs/bur_am335x_common.h
index 5fc8ce622b1f..1c3c86eb59f7 100644
--- a/include/configs/bur_am335x_common.h
+++ b/include/configs/bur_am335x_common.h
@@ -24,7 +24,6 @@
 #define CONFIG_MAX_RAM_BANK_SIZE	(1024 << 20)	/* 1GB */
 
 /* Timer information */
-#define CONFIG_SYS_PTV			2	/* Divisor: 2^(PTV+1) => 8 */
 #define CONFIG_SYS_TIMERBASE		0x48040000	/* Use Timer2 */
 
 #include <asm/arch/omap.h>
diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index f273e243e55d..f33dd19ea367 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -153,7 +153,6 @@
  * This rate is divided by a local divisor.
  */
 #define CONFIG_SYS_TIMERBASE		(OMAP34XX_GPT2)
-#define CONFIG_SYS_PTV			2	/* Divisor: 2^(PTV+1) => 8 */
 
 /*
  * Physical Memory Map
diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h
index 322fd24302fa..2b4d05b7165b 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -42,7 +42,6 @@
 						GENERATED_GBL_DATA_SIZE)
  /* Platform/Board specific defs */
 #define CONFIG_SYS_TIMERBASE		0x48040000	/* Use Timer2 */
-#define CONFIG_SYS_PTV			2	/* Divisor: 2^(PTV+1) => 8 */
 
 /* NS16550 Configuration */
 #define CONFIG_SYS_NS16550_SERIAL
diff --git a/include/configs/sniper.h b/include/configs/sniper.h
index 2a2609d9668d..2daaadd3146e 100644
--- a/include/configs/sniper.h
+++ b/include/configs/sniper.h
@@ -16,7 +16,6 @@
  */
 
 #define CONFIG_SYS_TIMERBASE	OMAP34XX_GPT2
-#define CONFIG_SYS_PTV		2
 
 #define V_NS16550_CLK		48000000
 #define V_OSCK			26000000
diff --git a/include/configs/ti814x_evm.h b/include/configs/ti814x_evm.h
index 3ce2c1fdc0aa..ff5bbad90e79 100644
--- a/include/configs/ti814x_evm.h
+++ b/include/configs/ti814x_evm.h
@@ -77,7 +77,6 @@
  * Platform/Board specific defs
  */
 #define CONFIG_SYS_TIMERBASE		0x4802E000
-#define CONFIG_SYS_PTV			2	/* Divisor: 2^(PTV+1) => 8 */
 
 /* NS16550 Configuration */
 #define CONFIG_SYS_NS16550_SERIAL
diff --git a/include/configs/ti816x_evm.h b/include/configs/ti816x_evm.h
index c2dfdebcd5b6..ba3bc43aa0e7 100644
--- a/include/configs/ti816x_evm.h
+++ b/include/configs/ti816x_evm.h
@@ -28,7 +28,6 @@
  * Platform/Board specific defs
  */
 #define CONFIG_SYS_TIMERBASE    0x4802E000
-#define CONFIG_SYS_PTV          2   /* Divisor: 2^(PTV+1) => 8 */
 
 /*
  * NS16550 Configuration
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
index 90dfb1feeb7d..cd136f696a47 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -71,9 +71,6 @@
 						GENERATED_GBL_DATA_SIZE)
 #endif
 
-/* Timer information. */
-#define CONFIG_SYS_PTV			2	/* Divisor: 2^(PTV+1) => 8 */
-
 /* If DM_I2C, enable non-DM I2C support */
 
 /*
-- 
2.25.1



More information about the U-Boot mailing list