Skip to contentSkip to conversation

Convert COUNTER_FREQUENCY to CONFIG_COUNTER_FREQUENCY

PATCH Superseded Peng Fan (OSS) 3 participants 14 messages Apr 10, 2022 – Apr 12, 2022

Subsystems (9)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Convert COUNTER_FREQUENCY to CONFIG_COUNTER_FREQUENCY

From: Peng Fan <[email protected]>

V2:
Drop imx93 which is wrongly included

This patchset is to convert COUNTER_FREQUENCY to CONFIG_COUNTER_FREQUENCY for arm64. arm32 is not included for now, this could be in following up patches if this patchset is accepted.

This patchset touches lots of boards, so please help review.

Peng Fan (6):
xilinx: versal: board: use CONFIG_COUNTER_FREQUENCY
arch: arm: move COUNTER_FREQUENCY from versal to arm
arch: arm: Kconfig: set default COUNTER_FREQUENCY for i.MX
configs: set CONFIG_COUNTER_FREQUENCY
armv8: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid include/configs: drop COUNTER_FREQUENCY

 arch/arm/Kconfig                              | 8 ++++++++
 arch/arm/cpu/armv8/fsl-layerscape/spintable.S | 2 +-
 arch/arm/cpu/armv8/start.S                    | 4 ++--
 arch/arm/mach-versal/Kconfig                  | 6 ------
 board/xilinx/versal/board.c                   | 2 +-
 configs/a3y17lte_defconfig                    | 1 +
 configs/a5y17lte_defconfig                    | 1 +
 configs/a7y17lte_defconfig                    | 1 +
 configs/apalis-imx8_defconfig                 | 1 +
 configs/apalis-imx8x_defconfig                | 1 +
 configs/bubblegum_96_defconfig                | 1 +
 configs/cgtqmx8_defconfig                     | 1 +
 configs/colibri-imx8x_defconfig               | 1 +
 configs/cortina_presidio-asic-base_defconfig  | 1 +
 configs/cortina_presidio-asic-emmc_defconfig  | 1 +
 configs/cortina_presidio-asic-pnand_defconfig | 1 +
 configs/cubieboard7_defconfig                 | 1 +
 configs/deneb_defconfig                       | 1 +
 configs/dragonboard410c_defconfig             | 1 +
 configs/dragonboard820c_defconfig             | 1 +
 configs/espresso7420_defconfig                | 1 +
 configs/evb-px30_defconfig                    | 1 +
 configs/evb-px5_defconfig                     | 1 +
 configs/evb-rk3308_defconfig                  | 1 +
 configs/evb-rk3328_defconfig                  | 1 +
 configs/evb-rk3399_defconfig                  | 1 +
 configs/evb-rk3568_defconfig                  | 1 +
 configs/firefly-px30_defconfig                | 1 +
 configs/firefly-rk3399_defconfig              | 1 +
 configs/hihope_rzg2_defconfig                 | 1 +
 configs/hikey960_defconfig                    | 1 +
 configs/hikey_defconfig                       | 1 +
 configs/imx8qm_mek_defconfig                  | 1 +
 configs/imx8qm_rom7720_a1_4G_defconfig        | 1 +
 configs/imx8qxp_mek_defconfig                 | 1 +
 configs/khadas-edge-captain-rk3399_defconfig  | 1 +
 configs/khadas-edge-rk3399_defconfig          | 1 +
 configs/khadas-edge-v-rk3399_defconfig        | 1 +
 configs/leez-rk3399_defconfig                 | 1 +
 configs/ls1012a2g5rdb_qspi_defconfig          | 1 +
 configs/ls1012a2g5rdb_tfa_defconfig           | 1 +
 configs/ls1043aqds_defconfig                  | 1 +
 configs/ls1043aqds_lpuart_defconfig           | 1 +
 configs/ls1043aqds_nand_defconfig             | 1 +
 configs/ls1043aqds_nor_ddr3_defconfig         | 1 +
 configs/ls1043aqds_qspi_defconfig             | 1 +
 configs/ls1043aqds_sdcard_ifc_defconfig       | 1 +
 configs/ls1043aqds_sdcard_qspi_defconfig      | 1 +
 configs/ls1043aqds_tfa_SECURE_BOOT_defconfig  | 1 +
 configs/ls1043aqds_tfa_defconfig              | 1 +
 configs/ls1046afrwy_tfa_SECURE_BOOT_defconfig | 1 +
 configs/ls1046afrwy_tfa_defconfig             | 1 +
 configs/mt8183_pumpkin_defconfig              | 1 +
 configs/mt8512_bm1_emmc_defconfig             | 1 +
 configs/mt8516_pumpkin_defconfig              | 1 +
 configs/mt8518_ap1_emmc_defconfig             | 1 +
 configs/nanopc-t4-rk3399_defconfig            | 1 +
 configs/nanopi-m4-2gb-rk3399_defconfig        | 1 +
 configs/nanopi-m4-rk3399_defconfig            | 1 +
 configs/nanopi-m4b-rk3399_defconfig           | 1 +
 configs/nanopi-neo4-rk3399_defconfig          | 1 +
 configs/nanopi-r2s-rk3328_defconfig           | 1 +
 configs/nanopi-r4s-rk3399_defconfig           | 1 +
 configs/orangepi-rk3399_defconfig             | 1 +
 configs/p2371-2180_defconfig                  | 1 +
 configs/p2771-0000-000_defconfig              | 1 +
 configs/p2771-0000-500_defconfig              | 1 +
 configs/p3450-0000_defconfig                  | 1 +
 configs/r8a77970_eagle_defconfig              | 1 +
 configs/r8a77980_condor_defconfig             | 1 +
 configs/r8a77990_ebisu_defconfig              | 1 +
 configs/r8a77995_draak_defconfig              | 1 +
 configs/r8a779a0_falcon_defconfig             | 1 +
 configs/rcar3_salvator-x_defconfig            | 1 +
 configs/rcar3_ulcb_defconfig                  | 1 +
 configs/roc-cc-rk3328_defconfig               | 1 +
 configs/rock-pi-4-rk3399_defconfig            | 1 +
 configs/rock-pi-4c-rk3399_defconfig           | 1 +
 configs/rock-pi-e-rk3328_defconfig            | 1 +
 configs/rock-pi-n10-rk3399pro_defconfig       | 1 +
 configs/rock64-rk3328_defconfig               | 1 +
 configs/silinux_ek874_defconfig               | 1 +
 configs/socfpga_agilex_atf_defconfig          | 1 +
 configs/socfpga_agilex_defconfig              | 1 +
 configs/socfpga_agilex_vab_defconfig          | 1 +
 configs/starqltechn_defconfig                 | 1 +
 configs/ten64_tfa_defconfig                   | 1 +
 configs/thunderx_88xx_defconfig               | 1 +
 configs/vexpress_aemv8a_juno_defconfig        | 1 +
 configs/vexpress_aemv8a_semi_defconfig        | 1 +
 configs/vexpress_aemv8r_defconfig             | 1 +
 include/configs/apalis-imx8.h                 | 1 -
 include/configs/apalis-imx8x.h                | 1 -
 include/configs/capricorn-common.h            | 1 -
 include/configs/cgtqmx8.h                     | 1 -
 include/configs/colibri-imx8x.h               | 1 -
 include/configs/condor.h                      | 1 -
 include/configs/draak.h                       | 1 -
 include/configs/dragonboard410c.h             | 1 -
 include/configs/dragonboard820c.h             | 1 -
 include/configs/eagle.h                       | 1 -
 include/configs/ebisu.h                       | 1 -
 include/configs/exynos7420-common.h           | 1 -
 include/configs/exynos78x0-common.h           | 1 -
 include/configs/falcon.h                      | 1 -
 include/configs/hihope-rzg2.h                 | 1 -
 include/configs/hikey.h                       | 1 -
 include/configs/hikey960.h                    | 1 -
 include/configs/imx8qm_mek.h                  | 1 -
 include/configs/imx8qm_rom7720.h              | 1 -
 include/configs/imx8qxp_mek.h                 | 1 -
 include/configs/ls1012a_common.h              | 1 -
 include/configs/ls1028a_common.h              | 1 -
 include/configs/ls1043a_common.h              | 1 -
 include/configs/ls1046a_common.h              | 1 -
 include/configs/ls2080a_common.h              | 1 -
 include/configs/mt8183.h                      | 1 -
 include/configs/mt8512.h                      | 1 -
 include/configs/mt8516.h                      | 1 -
 include/configs/mt8518.h                      | 1 -
 include/configs/owl-common.h                  | 1 -
 include/configs/p2371-2180.h                  | 1 -
 include/configs/p2771-0000.h                  | 1 -
 include/configs/p3450-0000.h                  | 1 -
 include/configs/presidio_asic.h               | 3 +--
 include/configs/px30_common.h                 | 1 -
 include/configs/rk3308_common.h               | 1 -
 include/configs/rk3328_common.h               | 1 -
 include/configs/rk3368_common.h               | 1 -
 include/configs/rk3399_common.h               | 1 -
 include/configs/rk3568_common.h               | 1 -
 include/configs/salvator-x.h                  | 1 -
 include/configs/sdm845.h                      | 1 -
 include/configs/silinux-ek874.h               | 1 -
 include/configs/socfpga_soc64_common.h        | 1 -
 include/configs/ten64.h                       | 1 -
 include/configs/thunderx_88xx.h               | 1 -
 include/configs/ulcb.h                        | 1 -
 include/configs/vexpress_aemv8.h              | 1 -
 139 files changed, 99 insertions(+), 59 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/6 xilinx: versal: board: use CONFIG_COUNTER_FREQUENCY

From: Peng Fan <[email protected]>

Since versal has CONFIG_COUNTER_FREQUENCY, so use it. And COUNTER_FREQUENCY will be dropped.

---
 board/xilinx/versal/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/xilinx/versal/board.c +1 -1
index 9940f2aeb337..2e2807eee463 100644
@@ -74,7 +74,7 @@ int board_early_init_r(void)
 	 * Program freq register in System counter and
 	 * enable system counter.
 	 */
-	writel(COUNTER_FREQUENCY,
+	writel(CONFIG_COUNTER_FREQUENCY,
 	       &iou_scntr_secure->base_frequency_id_register);
 
 	debug("counter val 0x%x\n",
Signature · 1 line
2.25.1
Reviewed-by on v2 1/6
#2 lore raw

Re: [PATCH V2 1/6] xilinx: versal: board: use CONFIG_COUNTER_FREQUENCY

Quoted 15 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Since versal has CONFIG_COUNTER_FREQUENCY, so use it. And COUNTER_FREQUENCY will be dropped.

---
  board/xilinx/versal/board.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/xilinx/versal/board.c +0 -0
index 9940f2aeb337..2e2807eee463 100644

board/xilinx/versal/board.c int board_early_init_r(void) · line 80

Quoted 8 lines
board/xilinx/versal/board.c +1 -1
@@ -74,7 +74,7 @@ int board_early_init_r(void)
  	 * Program freq register in System counter and
  	 * enable system counter.
  	 */
-	writel(COUNTER_FREQUENCY,
+	writel(CONFIG_COUNTER_FREQUENCY,
  	       &iou_scntr_secure->base_frequency_id_register);
 
  	debug("counter val 0x%x\n",

Thanks,
Michal

#3 lore raw

PATCH v2 2/6 arch: arm: move COUNTER_FREQUENCY from versal to arm

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Make COUNTER_FREQUENCY usable to armv8 and armv7-a, not limited to versal.

---
 arch/arm/Kconfig             | 7 +++++++
 arch/arm/mach-versal/Kconfig | 6 ------
 2 files changed, 7 insertions(+), 6 deletions(-)
arch/arm/Kconfig +7 -0
index 6771f14b1059..d84c10d732e5 100644
@@ -19,6 +19,13 @@ config ARM64_CRC32
 	  not be present on all ARMv8.0, but is always present on ARMv8.1 and
 	  newer.
 
+config COUNTER_FREQUENCY
+	int "Timer clock frequency"
+	depends on ARM64 || CPU_V7A
+	default 0
+	help
+	  Setup time clock frequency for certain platform
+
 config POSITION_INDEPENDENT
 	bool "Generate position-independent pre-relocation code"
 	depends on ARM64 || CPU_V7A
arch/arm/mach-versal/Kconfig +0 -6
index 0c6ad345ffda..645f06add44d 100644
@@ -24,12 +24,6 @@ config SYS_CONFIG_NAME
 config SYS_MALLOC_LEN
 	default 0x2000000
 
-config COUNTER_FREQUENCY
-	int "Timer clock frequency"
-	default 0
-	help
-	  Setup time clock frequency for certain platform
-
 config ZYNQ_SDHCI_MAX_FREQ
 	default 200000000
 
Signature · 1 line
2.25.1
#4 lore raw

Re: [PATCH V2 2/6] arch: arm: move COUNTER_FREQUENCY from versal to arm

Quoted 16 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Make COUNTER_FREQUENCY usable to armv8 and armv7-a, not limited to versal.

---
 arch/arm/Kconfig             | 7 +++++++
 arch/arm/mach-versal/Kconfig | 6 ------
 2 files changed, 7 insertions(+), 6 deletions(-)
arch/arm/Kconfig +0 -0
index 6771f14b1059..d84c10d732e5 100644

arch/arm/Kconfig config ARM64_CRC32 · line 27

Quoted 9 lines
arch/arm/Kconfig +6 -0
@@ -19,6 +19,13 @@ config ARM64_CRC32
 	  not be present on all ARMv8.0, but is always present on ARMv8.1 and
 	  newer.
 
+config COUNTER_FREQUENCY
+	int "Timer clock frequency"
+	depends on ARM64 || CPU_V7A
+	default 0
+	help
+	  Setup time clock frequency for certain platform

We need to expand this help text more to note what it is for, and when zero is a valid value. Thanks.

Signature · 1 line
Tom
#5 lore raw

Re: [PATCH V2 2/6] arch: arm: move COUNTER_FREQUENCY from versal to arm

Quoted 20 lines · Tom Rini
Quoted 19 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Make COUNTER_FREQUENCY usable to armv8 and armv7-a, not limited to versal.

---
  arch/arm/Kconfig             | 7 +++++++
  arch/arm/mach-versal/Kconfig | 6 ------
  2 files changed, 7 insertions(+), 6 deletions(-)
arch/arm/Kconfig +0 -0
index 6771f14b1059..d84c10d732e5 100644
@@ -19,6 +19,13 @@ config ARM64_CRC32
  	  not be present on all ARMv8.0, but is always present on ARMv8.1 and
  	  newer.
 
Quoted 10 lines

arch/arm/Kconfig config ARM64_CRC32 · line 27

Quoted 6 lines
arch/arm/Kconfig +6 -0
+config COUNTER_FREQUENCY
+	int "Timer clock frequency"
+	depends on ARM64 || CPU_V7A
+	default 0
+	help
+	  Setup time clock frequency for certain platform

We need to expand this help text more to note what it is for, and when zero is a valid value. Thanks.

zero is not a valid value. When it is 0, it means U-Boot no need configure cntfrq_el0. Will post out v3 later, see whether people have comments on other patches in this patchset.

Thanks,
Peng.

#6 lore raw

PATCH v2 3/6 arch: arm: Kconfig: set default COUNTER_FREQUENCY for i.MX

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

i.MX6UL/ULL/7D/8QM/8QXP all has system counter frequency run at 8MHz, so set default value for them.

---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/Kconfig +1 -0
index d84c10d732e5..c515abb73ffc 100644
@@ -23,6 +23,7 @@ config COUNTER_FREQUENCY
 	int "Timer clock frequency"
 	depends on ARM64 || CPU_V7A
 	default 0
+	default 8000000 if IMX8 || MX7 || MX6UL || MX6ULL
 	help
 	  Setup time clock frequency for certain platform
 
Signature · 1 line
2.25.1
#7 lore raw

PATCH v2 4/6 configs: set CONFIG_COUNTER_FREQUENCY

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Set CONFIG_COUNTER_FREQUENCY according to COUNTER_FREQUENCY in config header file.

---
 configs/a3y17lte_defconfig                    | 1 +
 configs/a5y17lte_defconfig                    | 1 +
 configs/a7y17lte_defconfig                    | 1 +
 configs/apalis-imx8_defconfig                 | 1 +
 configs/apalis-imx8x_defconfig                | 1 +
 configs/bubblegum_96_defconfig                | 1 +
 configs/cgtqmx8_defconfig                     | 1 +
 configs/colibri-imx8x_defconfig               | 1 +
 configs/cortina_presidio-asic-base_defconfig  | 1 +
 configs/cortina_presidio-asic-emmc_defconfig  | 1 +
 configs/cortina_presidio-asic-pnand_defconfig | 1 +
 configs/cubieboard7_defconfig                 | 1 +
 configs/deneb_defconfig                       | 1 +
 configs/dragonboard410c_defconfig             | 1 +
 configs/dragonboard820c_defconfig             | 1 +
 configs/espresso7420_defconfig                | 1 +
 configs/evb-px30_defconfig                    | 1 +
 configs/evb-px5_defconfig                     | 1 +
 configs/evb-rk3308_defconfig                  | 1 +
 configs/evb-rk3328_defconfig                  | 1 +
 configs/evb-rk3399_defconfig                  | 1 +
 configs/evb-rk3568_defconfig                  | 1 +
 configs/firefly-px30_defconfig                | 1 +
 configs/firefly-rk3399_defconfig              | 1 +
 configs/hihope_rzg2_defconfig                 | 1 +
 configs/hikey960_defconfig                    | 1 +
 configs/hikey_defconfig                       | 1 +
 configs/imx8qm_mek_defconfig                  | 1 +
 configs/imx8qm_rom7720_a1_4G_defconfig        | 1 +
 configs/imx8qxp_mek_defconfig                 | 1 +
 configs/khadas-edge-captain-rk3399_defconfig  | 1 +
 configs/khadas-edge-rk3399_defconfig          | 1 +
 configs/khadas-edge-v-rk3399_defconfig        | 1 +
 configs/leez-rk3399_defconfig                 | 1 +
 configs/ls1012a2g5rdb_qspi_defconfig          | 1 +
 configs/ls1012a2g5rdb_tfa_defconfig           | 1 +
 configs/ls1043aqds_defconfig                  | 1 +
 configs/ls1043aqds_lpuart_defconfig           | 1 +
 configs/ls1043aqds_nand_defconfig             | 1 +
 configs/ls1043aqds_nor_ddr3_defconfig         | 1 +
 configs/ls1043aqds_qspi_defconfig             | 1 +
 configs/ls1043aqds_sdcard_ifc_defconfig       | 1 +
 configs/ls1043aqds_sdcard_qspi_defconfig      | 1 +
 configs/ls1043aqds_tfa_SECURE_BOOT_defconfig  | 1 +
 configs/ls1043aqds_tfa_defconfig              | 1 +
 configs/ls1046afrwy_tfa_SECURE_BOOT_defconfig | 1 +
 configs/ls1046afrwy_tfa_defconfig             | 1 +
 configs/mt8183_pumpkin_defconfig              | 1 +
 configs/mt8512_bm1_emmc_defconfig             | 1 +
 configs/mt8516_pumpkin_defconfig              | 1 +
 configs/mt8518_ap1_emmc_defconfig             | 1 +
 configs/nanopc-t4-rk3399_defconfig            | 1 +
 configs/nanopi-m4-2gb-rk3399_defconfig        | 1 +
 configs/nanopi-m4-rk3399_defconfig            | 1 +
 configs/nanopi-m4b-rk3399_defconfig           | 1 +
 configs/nanopi-neo4-rk3399_defconfig          | 1 +
 configs/nanopi-r2s-rk3328_defconfig           | 1 +
 configs/nanopi-r4s-rk3399_defconfig           | 1 +
 configs/orangepi-rk3399_defconfig             | 1 +
 configs/p2371-2180_defconfig                  | 1 +
 configs/p2771-0000-000_defconfig              | 1 +
 configs/p2771-0000-500_defconfig              | 1 +
 configs/p3450-0000_defconfig                  | 1 +
 configs/r8a77970_eagle_defconfig              | 1 +
 configs/r8a77980_condor_defconfig             | 1 +
 configs/r8a77990_ebisu_defconfig              | 1 +
 configs/r8a77995_draak_defconfig              | 1 +
 configs/r8a779a0_falcon_defconfig             | 1 +
 configs/rcar3_salvator-x_defconfig            | 1 +
 configs/rcar3_ulcb_defconfig                  | 1 +
 configs/roc-cc-rk3328_defconfig               | 1 +
 configs/rock-pi-4-rk3399_defconfig            | 1 +
 configs/rock-pi-4c-rk3399_defconfig           | 1 +
 configs/rock-pi-e-rk3328_defconfig            | 1 +
 configs/rock-pi-n10-rk3399pro_defconfig       | 1 +
 configs/rock64-rk3328_defconfig               | 1 +
 configs/silinux_ek874_defconfig               | 1 +
 configs/socfpga_agilex_atf_defconfig          | 1 +
 configs/socfpga_agilex_defconfig              | 1 +
 configs/socfpga_agilex_vab_defconfig          | 1 +
 configs/starqltechn_defconfig                 | 1 +
 configs/ten64_tfa_defconfig                   | 1 +
 configs/thunderx_88xx_defconfig               | 1 +
 configs/vexpress_aemv8a_juno_defconfig        | 1 +
 configs/vexpress_aemv8a_semi_defconfig        | 1 +
 configs/vexpress_aemv8r_defconfig             | 1 +
 86 files changed, 86 insertions(+)
configs/a3y17lte_defconfig +1 -0
index 7ca7ce0daf25..8081168371b2 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_SYS_CONFIG_NAME="exynos78x0-common"
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=26000000
 CONFIG_ARCH_EXYNOS=y
 CONFIG_SYS_TEXT_BASE=0x40001000
 CONFIG_ARCH_EXYNOS7=y
configs/a5y17lte_defconfig +1 -0
index 793389eb735d..b6d2bb7e8caa 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_SYS_CONFIG_NAME="exynos78x0-common"
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=26000000
 CONFIG_ARCH_EXYNOS=y
 CONFIG_SYS_TEXT_BASE=0x40001000
 CONFIG_ARCH_EXYNOS7=y
configs/a7y17lte_defconfig +1 -0
index eaa448d84d25..5114e6079fcf 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_SYS_CONFIG_NAME="exynos78x0-common"
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=26000000
 CONFIG_ARCH_EXYNOS=y
 CONFIG_SYS_TEXT_BASE=0x40001000
 CONFIG_ARCH_EXYNOS7=y
configs/apalis-imx8_defconfig +1 -0
index 19edbbb69784..58c90664e25e 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=8000000
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
 CONFIG_SYS_MALLOC_LEN=0x2800000
configs/apalis-imx8x_defconfig +1 -0
index b67cdece71c6..32e614b3f6ef 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=8000000
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
 CONFIG_SYS_MALLOC_LEN=0x2800000
configs/bubblegum_96_defconfig +1 -0
index f4e6abc4110b..a21b245c845e 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_OWL=y
 CONFIG_SYS_MALLOC_LEN=0x2000000
 CONFIG_ENV_SIZE=0x2000
configs/cgtqmx8_defconfig +1 -0
index 094cb41c038c..2a24dca774a0 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_SPL_SYS_ICACHE_OFF=y
 CONFIG_SPL_SYS_DCACHE_OFF=y
+CONFIG_COUNTER_FREQUENCY=8000000
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
 CONFIG_SYS_MALLOC_LEN=0x2400000
configs/colibri-imx8x_defconfig +1 -0
index 80bc27b1881f..3b53d0e5a155 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=8000000
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
 CONFIG_SYS_MALLOC_LEN=0x2800000
configs/cortina_presidio-asic-base_defconfig +1 -0
index f102b75c355a..e1adbf1bcee5 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 # CONFIG_SYS_ARCH_TIMER is not set
 CONFIG_TARGET_PRESIDIO_ASIC=y
 CONFIG_SYS_TEXT_BASE=0x04000000
configs/cortina_presidio-asic-emmc_defconfig +1 -0
index c22dcef7ec05..4f6e2e7bcaff 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 # CONFIG_SYS_ARCH_TIMER is not set
 CONFIG_TARGET_PRESIDIO_ASIC=y
 CONFIG_SYS_TEXT_BASE=0x04000000
configs/cortina_presidio-asic-pnand_defconfig +1 -0
index a20b99f4bffa..2ee440d07ca4 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 # CONFIG_SYS_ARCH_TIMER is not set
 CONFIG_TARGET_PRESIDIO_ASIC=y
 CONFIG_SYS_TEXT_BASE=0x04000000
configs/cubieboard7_defconfig +1 -0
index e73d8d8ed763..677bff64b90d 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_OWL=y
 CONFIG_SYS_MALLOC_LEN=0x2000000
 CONFIG_DEFAULT_DEVICE_TREE="s700-cubieboard7"
configs/deneb_defconfig +1 -0
index 55034ad5fb56..111e3b27883a 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=8000000
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
 CONFIG_SYS_MALLOC_LEN=0x2800000
configs/dragonboard410c_defconfig +1 -0
index 33cb31c72514..dc136f986121 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=19000000
 CONFIG_ARCH_SNAPDRAGON=y
 CONFIG_SYS_TEXT_BASE=0x8f600000
 CONFIG_SYS_MALLOC_LEN=0x802000
configs/dragonboard820c_defconfig +1 -0
index 4797153968eb..3bd22aa34f0b 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=19000000
 CONFIG_ARCH_SNAPDRAGON=y
 CONFIG_SYS_TEXT_BASE=0x80080000
 CONFIG_SYS_MALLOC_LEN=0x804000
configs/espresso7420_defconfig +1 -0
index b3d10ecf4d71..09e213fe371d 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_EXYNOS=y
 CONFIG_SYS_TEXT_BASE=0x43E00000
configs/evb-px30_defconfig +1 -0
index 061d76e86a35..36eaf4e6b954 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_SYS_MALLOC_F_LEN=0x2000
configs/evb-px5_defconfig +1 -0
index 581b8cdfada6..1e2b0f03087c 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/evb-rk3308_defconfig +1 -0
index 26d124827ed4..b4ce8a1a3962 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00600000
 CONFIG_SYS_MALLOC_F_LEN=0x2000
configs/evb-rk3328_defconfig +1 -0
index 78fb93bf9785..7e0c4c50a617 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/evb-rk3399_defconfig +1 -0
index a18e6225800c..a9afb63fdd9b 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/evb-rk3568_defconfig +1 -0
index a4720435838f..d2af961eafcb 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00a00000
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
configs/firefly-px30_defconfig +1 -0
index 873b34b792c4..01858a65b4cc 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_SYS_MALLOC_F_LEN=0x2000
configs/firefly-rk3399_defconfig +1 -0
index 2858c35d1047..3803e42f380a 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/hihope_rzg2_defconfig +1 -0
index 05dd00a45fde..3e1077389c22 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=16666666
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
configs/hikey960_defconfig +1 -0
index cb03c6f4b008..e0561638b46d 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=19000000
 CONFIG_TARGET_HIKEY960=y
 CONFIG_SYS_TEXT_BASE=0x1ac98000
 CONFIG_SYS_MALLOC_LEN=0x801000
configs/hikey_defconfig +1 -0
index 6f929037fdbf..2955e6239eb0 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=19000000
 CONFIG_SYS_TEXT_BASE=0x35000000
 CONFIG_SYS_MALLOC_LEN=0x801000
 CONFIG_SYS_MALLOC_F_LEN=0x2000
configs/imx8qm_mek_defconfig +1 -0
index 090bd3c85e5d..de5121ff1741 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=8000000
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
 CONFIG_SYS_MALLOC_LEN=0x2400000
configs/imx8qm_rom7720_a1_4G_defconfig +1 -0
index fa1968b356bd..aa92c37fa356 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=8000000
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
 CONFIG_SYS_MALLOC_LEN=0x2800000
configs/imx8qxp_mek_defconfig +1 -0
index 36cf67e7e122..e9eec043d49c 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=8000000
 CONFIG_ARCH_IMX8=y
 CONFIG_SYS_TEXT_BASE=0x80020000
 CONFIG_SYS_MALLOC_LEN=0x2400000
configs/khadas-edge-captain-rk3399_defconfig +1 -0
index fffdc61e0fc0..cddf5228b608 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/khadas-edge-rk3399_defconfig +1 -0
index 2c6f32e27cfd..bd52c015fa4d 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/khadas-edge-v-rk3399_defconfig +1 -0
index 3f3cf7d2cdae..21bf9487a863 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/leez-rk3399_defconfig +1 -0
index e2bb140bb882..2fa8d563ebe2 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/ls1012a2g5rdb_qspi_defconfig +1 -0
index ff5cfaca6d76..cb9ad24b1226 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1012A2G5RDB=y
 CONFIG_SYS_TEXT_BASE=0x40100000
 CONFIG_SYS_MALLOC_LEN=0x500000
configs/ls1012a2g5rdb_tfa_defconfig +1 -0
index c2807c1a7c99..8763e0d7b04a 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1012A2G5RDB=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
configs/ls1043aqds_defconfig +1 -0
index 24eb2706e27c..52f20c3f59a0 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_TEXT_BASE=0x60100000
 CONFIG_SYS_MALLOC_LEN=0x120000
configs/ls1043aqds_lpuart_defconfig +1 -0
index 013b776919b6..172721801563 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_TEXT_BASE=0x60100000
 CONFIG_SYS_MALLOC_LEN=0x120000
configs/ls1043aqds_nand_defconfig +1 -0
index ee584f8acea0..ba3e4a404b54 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SYS_MALLOC_LEN=0x102000
configs/ls1043aqds_nor_ddr3_defconfig +1 -0
index fd6a4945c88b..6b45850774cd 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_TEXT_BASE=0x60100000
 CONFIG_SYS_MALLOC_LEN=0x120000
configs/ls1043aqds_qspi_defconfig +1 -0
index 5d0743083378..6da4520edc43 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_TEXT_BASE=0x40100000
 CONFIG_SYS_MALLOC_LEN=0x102000
configs/ls1043aqds_sdcard_ifc_defconfig +1 -0
index 186004021393..5c519df13385 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SYS_MALLOC_LEN=0x102000
configs/ls1043aqds_sdcard_qspi_defconfig +1 -0
index e384e4a42451..ee2168903ddc 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_TEXT_BASE=0x82000000
 CONFIG_SYS_MALLOC_LEN=0x102000
configs/ls1043aqds_tfa_SECURE_BOOT_defconfig +1 -0
index 8a62239fa649..6f920ef8a885 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
configs/ls1043aqds_tfa_defconfig +1 -0
index 3ed054fd4ee6..e59c93a05e30 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
configs/ls1046afrwy_tfa_SECURE_BOOT_defconfig +1 -0
index 93d323d3bafd..3cbe1b7c10f0 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1046AFRWY=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
configs/ls1046afrwy_tfa_defconfig +1 -0
index 7cddc0c7d1ef..791ee08ea96f 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_LS1046AFRWY=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
configs/mt8183_pumpkin_defconfig +1 -0
index 42627a2538b5..ea7ab5c8096d 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=13000000
 CONFIG_POSITION_INDEPENDENT=y
 CONFIG_ARCH_MEDIATEK=y
 CONFIG_SYS_TEXT_BASE=0x4c000000
configs/mt8512_bm1_emmc_defconfig +1 -0
index 546d1dc80d37..7e711b1b469f 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=13000000
 CONFIG_POSITION_INDEPENDENT=y
 CONFIG_ARCH_MEDIATEK=y
 CONFIG_SYS_TEXT_BASE=0x44e00000
configs/mt8516_pumpkin_defconfig +1 -0
index 458b4fb0846c..52c12609b152 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=13000000
 CONFIG_POSITION_INDEPENDENT=y
 CONFIG_ARCH_MEDIATEK=y
 CONFIG_SYS_TEXT_BASE=0x4C000000
configs/mt8518_ap1_emmc_defconfig +1 -0
index 444da0be93e8..a994cd3a2da9 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=13000000
 CONFIG_POSITION_INDEPENDENT=y
 CONFIG_ARCH_MEDIATEK=y
 CONFIG_SYS_TEXT_BASE=0x40008000
configs/nanopc-t4-rk3399_defconfig +1 -0
index 164b066b9165..31de4bd1a946 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/nanopi-m4-2gb-rk3399_defconfig +1 -0
index d3075e6a4a36..7c8eff869b63 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/nanopi-m4-rk3399_defconfig +1 -0
index 957879b14b85..d500ebe58dc4 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/nanopi-m4b-rk3399_defconfig +1 -0
index 805549bf3b3f..16e39035e5e5 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/nanopi-neo4-rk3399_defconfig +1 -0
index c9d7be19db32..753ba92d0ed1 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/nanopi-r2s-rk3328_defconfig +1 -0
index 899b14caa0d4..453e54295de1 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_SPL_GPIO=y
configs/nanopi-r4s-rk3399_defconfig +1 -0
index 359673fe603e..46ba07f4d555 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/orangepi-rk3399_defconfig +1 -0
index 04e1f4e1363b..461300fd1060 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/p2371-2180_defconfig +1 -0
index 67657b0369c9..5977325973ef 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=19200000
 CONFIG_SYS_L2CACHE_OFF=y
 CONFIG_ARCH_TEGRA=y
 CONFIG_SYS_TEXT_BASE=0x80080000
configs/p2771-0000-000_defconfig +1 -0
index 53d98b11f5d3..47be8a1c2863 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=19200000
 CONFIG_SYS_L2CACHE_OFF=y
 CONFIG_ARCH_TEGRA=y
 CONFIG_SYS_TEXT_BASE=0x80080000
configs/p2771-0000-500_defconfig +1 -0
index 2e3eec0ee130..94866cd7693c 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=19200000
 CONFIG_SYS_L2CACHE_OFF=y
 CONFIG_ARCH_TEGRA=y
 CONFIG_SYS_TEXT_BASE=0x80080000
configs/p3450-0000_defconfig +1 -0
index 46f4cd01102b..ec813dd7a5b8 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=19200000
 CONFIG_SYS_L2CACHE_OFF=y
 CONFIG_ARCH_TEGRA=y
 CONFIG_SYS_TEXT_BASE=0x80080000
configs/r8a77970_eagle_defconfig +1 -0
index b3fbe8692855..7b050d824573 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=16666666
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
configs/r8a77980_condor_defconfig +1 -0
index 88901ec46c08..c3b6e99ae77b 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=16666666
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
configs/r8a77990_ebisu_defconfig +1 -0
index 13422a10be27..fba03a760fc9 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=16666666
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
configs/r8a77995_draak_defconfig +1 -0
index 640f303bffd2..008254715e2f 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=16666666
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
configs/r8a779a0_falcon_defconfig +1 -0
index c3f56e4b1a09..f76b1132a8e7 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=16666666
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
configs/rcar3_salvator-x_defconfig +1 -0
index b6b63829fe20..b3c47c308ec5 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=16666666
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_MALLOC_LEN=0x4000000
configs/rcar3_ulcb_defconfig +1 -0
index 85a2e48f96e5..a7ef4f1c0eec 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=16666666
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
configs/roc-cc-rk3328_defconfig +1 -0
index a60731d5466a..5fc4dd779434 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_SPL_GPIO=y
configs/rock-pi-4-rk3399_defconfig +1 -0
index 1099aad5dd41..80d1e63b59c8 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/rock-pi-4c-rk3399_defconfig +1 -0
index ae4aec22ab69..bda4b70dbf9b 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_NR_DRAM_BANKS=1
configs/rock-pi-e-rk3328_defconfig +1 -0
index 31581630badd..36038d905309 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_SPL_GPIO=y
configs/rock-pi-n10-rk3399pro_defconfig +1 -0
index c205479b1fca..7151da4c1910 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_SPL_GPIO=y
configs/rock64-rk3328_defconfig +1 -0
index 6704946c16c0..ea61fe738f2f 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
 CONFIG_SPL_GPIO=y
configs/silinux_ek874_defconfig +1 -0
index 61c2a739281a..099a200539fe 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=16666666
 CONFIG_ARCH_CPU_INIT=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
configs/socfpga_agilex_atf_defconfig +1 -0
index a048595b5a10..bddacad62db9 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=400000000
 CONFIG_SPL_LDSCRIPT="arch/arm/mach-socfpga/u-boot-spl-soc64.lds"
 CONFIG_ARCH_SOCFPGA=y
 CONFIG_SYS_TEXT_BASE=0x200000
configs/socfpga_agilex_defconfig +1 -0
index ab18b24531b4..4fad9997ba18 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=400000000
 CONFIG_ARCH_SOCFPGA=y
 CONFIG_SYS_TEXT_BASE=0x1000
 CONFIG_SYS_MALLOC_LEN=0x500000
configs/socfpga_agilex_vab_defconfig +1 -0
index 2acfd044e27c..a991f3d22b5a 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=400000000
 CONFIG_SPL_LDSCRIPT="arch/arm/mach-socfpga/u-boot-spl-soc64.lds"
 CONFIG_ARCH_SOCFPGA=y
 CONFIG_SYS_TEXT_BASE=0x200000
configs/starqltechn_defconfig +1 -0
index e3b2f7c24986..608d001b6df5 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=19000000
 CONFIG_POSITION_INDEPENDENT=y
 CONFIG_ARCH_SNAPDRAGON=y
 CONFIG_DEFAULT_DEVICE_TREE="starqltechn"
configs/ten64_tfa_defconfig +1 -0
index fd38aca040ab..f417a8e8c912 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25000000
 CONFIG_TARGET_TEN64=y
 CONFIG_TFABOOT=y
 CONFIG_SYS_TEXT_BASE=0x82000000
configs/thunderx_88xx_defconfig +1 -0
index 9b0966cfe4a0..247e25d4a659 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=25165824
 CONFIG_TARGET_THUNDERX_88XX=y
 CONFIG_SYS_TEXT_BASE=0x00500000
 CONFIG_SYS_MALLOC_LEN=0x101000
configs/vexpress_aemv8a_juno_defconfig +1 -0
index 374fa32cbf40..967bc560936f 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_VEXPRESS64=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_DEFAULT_DEVICE_TREE="juno-r2"
configs/vexpress_aemv8a_semi_defconfig +1 -0
index eca61764ba44..1a4cbc1cdd06 100644
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 # CONFIG_ARM64_CRC32 is not set
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_VEXPRESS64=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_DEFAULT_DEVICE_TREE="fvp-base-revc"
configs/vexpress_aemv8r_defconfig +1 -0
index 612797e47d55..a1c5d8871701 100644
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_COUNTER_FREQUENCY=24000000
 CONFIG_ARCH_VEXPRESS64=y
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_DEFAULT_DEVICE_TREE="arm_fvp"
Signature · 1 line
2.25.1
#8 lore raw

PATCH v2 5/6 armv8: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Since COUNTER_FREQUENCY is obselete, so set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid

---
 arch/arm/cpu/armv8/start.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/cpu/armv8/start.S +2 -2
index 6a6a4f86502b..d328e8c08a18 100644
@@ -138,9 +138,9 @@ pie_fixup_done:
 0:
 	msr	daifclr, #0x4			/* Unmask SError interrupts */
 
-#ifdef COUNTER_FREQUENCY
+#if CONFIG_COUNTER_FREQUENCY
 	branch_if_not_highest_el x0, 4f
-	ldr	x0, =COUNTER_FREQUENCY
+	ldr	x0, =CONFIG_COUNTER_FREQUENCY
 	msr	cntfrq_el0, x0			/* Initialize CNTFRQ */
 #endif
 
Signature · 1 line
2.25.1
#9 lore raw

PATCH v2 6/6 include/configs: drop COUNTER_FREQUENCY

In reply to Peng Fan (OSS)

From: Peng Fan <[email protected]>

Since we have CONFIG_COUNTER_FREQUENCY enabled, no need COUNTER_FREQUENCY

---
 arch/arm/cpu/armv8/fsl-layerscape/spintable.S | 2 +-
 include/configs/apalis-imx8.h                 | 1 -
 include/configs/apalis-imx8x.h                | 1 -
 include/configs/capricorn-common.h            | 1 -
 include/configs/cgtqmx8.h                     | 1 -
 include/configs/colibri-imx8x.h               | 1 -
 include/configs/condor.h                      | 1 -
 include/configs/draak.h                       | 1 -
 include/configs/dragonboard410c.h             | 1 -
 include/configs/dragonboard820c.h             | 1 -
 include/configs/eagle.h                       | 1 -
 include/configs/ebisu.h                       | 1 -
 include/configs/exynos7420-common.h           | 1 -
 include/configs/exynos78x0-common.h           | 1 -
 include/configs/falcon.h                      | 1 -
 include/configs/hihope-rzg2.h                 | 1 -
 include/configs/hikey.h                       | 1 -
 include/configs/hikey960.h                    | 1 -
 include/configs/imx8qm_mek.h                  | 1 -
 include/configs/imx8qm_rom7720.h              | 1 -
 include/configs/imx8qxp_mek.h                 | 1 -
 include/configs/ls1012a_common.h              | 1 -
 include/configs/ls1028a_common.h              | 1 -
 include/configs/ls1043a_common.h              | 1 -
 include/configs/ls1046a_common.h              | 1 -
 include/configs/ls2080a_common.h              | 1 -
 include/configs/mt8183.h                      | 1 -
 include/configs/mt8512.h                      | 1 -
 include/configs/mt8516.h                      | 1 -
 include/configs/mt8518.h                      | 1 -
 include/configs/owl-common.h                  | 1 -
 include/configs/p2371-2180.h                  | 1 -
 include/configs/p2771-0000.h                  | 1 -
 include/configs/p3450-0000.h                  | 1 -
 include/configs/presidio_asic.h               | 3 +--
 include/configs/px30_common.h                 | 1 -
 include/configs/rk3308_common.h               | 1 -
 include/configs/rk3328_common.h               | 1 -
 include/configs/rk3368_common.h               | 1 -
 include/configs/rk3399_common.h               | 1 -
 include/configs/rk3568_common.h               | 1 -
 include/configs/salvator-x.h                  | 1 -
 include/configs/sdm845.h                      | 1 -
 include/configs/silinux-ek874.h               | 1 -
 include/configs/socfpga_soc64_common.h        | 1 -
 include/configs/ten64.h                       | 1 -
 include/configs/thunderx_88xx.h               | 1 -
 include/configs/ulcb.h                        | 1 -
 include/configs/vexpress_aemv8.h              | 1 -
 49 files changed, 2 insertions(+), 50 deletions(-)
arch/arm/cpu/armv8/fsl-layerscape/spintable.S +1 -1
index d6bd1884599c..1eb0c2d4a7e7 100644
@@ -113,6 +113,6 @@ _dead_loop:
 	.align 3
 	.global __real_cntfrq
 __real_cntfrq:
-	.quad COUNTER_FREQUENCY
+	.quad CONFIG_COUNTER_FREQUENCY
 	/* Secondary Boot Code ends here */
 __secondary_boot_code_end:
include/configs/apalis-imx8.h +0 -1
index c87bcd475eff..8cc7538ee7cc 100644
@@ -85,6 +85,5 @@
 					sizeof(CONFIG_SYS_PROMPT) + 16)
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		8000000	/* 8MHz */
 
 #endif /* __APALIS_IMX8_H */
include/configs/apalis-imx8x.h +0 -1
index 71a80f38bbb0..0c8aec321435 100644
@@ -116,7 +116,6 @@
 					sizeof(CONFIG_SYS_PROMPT) + 16)
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		8000000	/* 8MHz */
 
 /* Networking */
 #define CONFIG_FEC_ENET_DEV 0
include/configs/capricorn-common.h +0 -1
index 58d7a3a8ce24..319c97695040 100644
@@ -124,7 +124,6 @@
 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		8000000	/* 8MHz */
 
 #define BOOTAUX_RESERVED_MEM_BASE	0x88000000
 #define BOOTAUX_RESERVED_MEM_SIZE	SZ_128M /* Reserve from second 128MB */
include/configs/cgtqmx8.h +0 -1
index bd5c072382a8..1e05a039c26c 100644
@@ -132,7 +132,6 @@
 #define PHYS_SDRAM_2_SIZE		0x100000000	/* 4 GB */
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		8000000	/* 8MHz */
 
 /* Networking */
 #define CONFIG_FEC_MXC_PHYADDR		-1
include/configs/colibri-imx8x.h +0 -1
index 008fa6ef076c..265b7294fed5 100644
@@ -119,7 +119,6 @@
 					sizeof(CONFIG_SYS_PROMPT) + 16)
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		8000000	/* 8MHz */
 
 #define BOOTAUX_RESERVED_MEM_BASE 0x88000000
 #define BOOTAUX_RESERVED_MEM_SIZE SZ_128M /* Reserve from second 128MB */
include/configs/condor.h +0 -1
index 213e68f15874..402b0f45225b 100644
@@ -25,6 +25,5 @@
 /* XTAL_CLK : 33.33MHz */
 
 /* Generic Timer Definitions (use in assembler source) */
-#define COUNTER_FREQUENCY	0xFE502A	/* 16.66MHz from CPclk */
 
 #endif /* __CONDOR_H */
include/configs/draak.h +0 -1
index 5bd8740c6f84..00b52327291e 100644
@@ -12,7 +12,6 @@
 #include "rcar-gen3-common.h"
 
 /* Generic Timer Definitions (use in assembler source) */
-#define COUNTER_FREQUENCY	0xFE502A	/* 16.66MHz from CPclk */
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 
include/configs/dragonboard410c.h +0 -1
index 43a179f013b6..4500a158ae0b 100644
@@ -24,7 +24,6 @@
 /* UART */
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		19000000
 
 /* Fixup - in init code we switch from device to host mode,
  * it has to be done after each HCD reset */
include/configs/dragonboard820c.h +0 -1
index 229e1a323b6d..57e661e68a95 100644
@@ -24,7 +24,6 @@
 #define CONFIG_SYS_BOOTM_LEN		SZ_64M
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		19000000
 
 #ifndef CONFIG_SPL_BUILD
 #include <config_distro_bootcmd.h>
include/configs/eagle.h +0 -1
index 42fe05771676..0985f32da3bd 100644
@@ -17,6 +17,5 @@
 /* XTAL_CLK : 33.33MHz */
 
 /* Generic Timer Definitions (use in assembler source) */
-#define COUNTER_FREQUENCY	0xFE502A	/* 16.66MHz from CPclk */
 
 #endif /* __EAGLE_H */
include/configs/ebisu.h +0 -1
index ce31a462fcf2..2a168f75797b 100644
@@ -14,7 +14,6 @@
 #include "rcar-gen3-common.h"
 
 /* Generic Timer Definitions (use in assembler source) */
-#define COUNTER_FREQUENCY	0xFE502A	/* 16.66MHz from CPclk */
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 
include/configs/exynos7420-common.h +0 -1
index fcb238fb3e3b..bfd79cbd1cd7 100644
@@ -25,7 +25,6 @@
 /* select serial console configuration */
 
 /* Timer input clock frequency */
-#define COUNTER_FREQUENCY		24000000
 
 /* IRAM Layout */
 #define CONFIG_IRAM_BASE		0x02100000
include/configs/exynos78x0-common.h +0 -1
index 457057ce71fc..bc7bd4bd18a0 100644
@@ -26,7 +26,6 @@
 #define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE
 
 /* Timer input clock frequency */
-#define COUNTER_FREQUENCY		26000000
 
 #define CPU_RELEASE_ADDR		secondary_boot_addr
 
include/configs/falcon.h +0 -1
index 52dcf19ccad2..ef349fc2793b 100644
@@ -25,6 +25,5 @@
 /* XTAL_CLK : 16.66MHz */
 
 /* Generic Timer Definitions (use in assembler source) */
-#define COUNTER_FREQUENCY	0xFE502A	/* 16.66MHz from CPclk */
 
 #endif /* __FALCON_H */
include/configs/hihope-rzg2.h +0 -1
index e46eb07a5e9d..0727a5cc73dc 100644
@@ -12,6 +12,5 @@
 #include "rcar-gen3-common.h"
 
 /* Generic Timer Definitions (use in assembler source) */
-#define COUNTER_FREQUENCY	0xFE502A	/* 16.66MHz from CPclk */
 
 #endif /* __HIHOPE_RZG2_H */
include/configs/hikey.h +0 -1
index 29a0d9438649..bc59a52178c2 100644
@@ -33,7 +33,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		19000000
 
 /* Generic Interrupt Controller Definitions */
 #define GICD_BASE			0xf6801000
include/configs/hikey960.h +0 -1
index f446ecb86479..83490c57a6c3 100644
@@ -25,7 +25,6 @@
 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		19000000
 
 /* Generic Interrupt Controller Definitions */
 #define GICD_BASE			0xe82b1000
include/configs/imx8qm_mek.h +0 -1
index 0fe38e61c4b7..9290640800b6 100644
@@ -131,6 +131,5 @@
 #define PHYS_SDRAM_2_SIZE		0x100000000	/* 4 GB */
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		8000000	/* 8MHz */
 
 #endif /* __IMX8QM_MEK_H */
include/configs/imx8qm_rom7720.h +0 -1
index 7532c6e7551d..f559a633d8e0 100644
@@ -125,7 +125,6 @@
 #define PHYS_SDRAM_2_SIZE		0x80000000	/* 2 GB */
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		8000000	/* 8MHz */
 
 #include <linux/stringify.h>
 #endif /* __IMX8QM_ROM7720_H */
include/configs/imx8qxp_mek.h +0 -1
index beb35c93435f..d21cd95d9637 100644
@@ -130,7 +130,6 @@
 #define PHYS_SDRAM_2_SIZE		0x40000000	/* 1 GB */
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		8000000	/* 8MHz */
 
 #ifndef CONFIG_DM_PCA953X
 #define CONFIG_PCA953X
include/configs/ls1012a_common.h +0 -1
index f92ff17eeb89..ac8192c96b9c 100644
@@ -22,7 +22,6 @@
 #define CONFIG_SYS_DDR_BLOCK2_BASE     0x880000000ULL
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		25000000	/* 25MHz */
 
 /* CSU */
 #define CONFIG_LAYERSCAPE_NS_ACCESS
include/configs/ls1028a_common.h +0 -1
index 7bb6d416ea31..a48f0deb69b8 100644
@@ -26,7 +26,6 @@
 #define CPU_RELEASE_ADDR		secondary_boot_addr
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		25000000	/* 25MHz */
 
 /* GPIO */
 
include/configs/ls1043a_common.h +0 -1
index 83b95c242f01..69b32c888920 100644
@@ -45,7 +45,6 @@
 #define CPU_RELEASE_ADDR               secondary_boot_addr
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		25000000	/* 25MHz */
 
 /* Serial Port */
 #define CONFIG_SYS_NS16550_SERIAL
include/configs/ls1046a_common.h +0 -1
index 7552610e0355..1424f5696cca 100644
@@ -45,7 +45,6 @@
 #define CPU_RELEASE_ADDR               secondary_boot_addr
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		25000000	/* 25MHz */
 
 /* Serial Port */
 #define CONFIG_SYS_NS16550_SERIAL
include/configs/ls2080a_common.h +0 -1
index 82585f5dbfaf..73ece459f1c3 100644
@@ -46,7 +46,6 @@
  * This is not an accurate number. It is used in start.S. The frequency
  * will be udpated later when get_bus_freq(0) is available.
  */
-#define COUNTER_FREQUENCY		25000000	/* 25MHz */
 
 /* GPIO */
 
include/configs/mt8183.h +0 -1
index 2b4e976aa1fe..ee31c02e6ef9 100644
@@ -11,7 +11,6 @@
 
 #include <linux/sizes.h>
 
-#define COUNTER_FREQUENCY		13000000
 
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE	-4
include/configs/mt8512.h +0 -1
index 9c443db9f52d..1af8d2e480c2 100644
@@ -13,7 +13,6 @@
 
 #define CONFIG_SYS_NONCACHED_MEMORY		SZ_1M
 
-#define COUNTER_FREQUENCY			13000000
 
 #define CONFIG_SYS_BOOTM_LEN			SZ_64M
 
include/configs/mt8516.h +0 -1
index 47132c1db1d2..cb2af5843fca 100644
@@ -11,7 +11,6 @@
 
 #include <linux/sizes.h>
 
-#define COUNTER_FREQUENCY		13000000
 
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE	-4
include/configs/mt8518.h +0 -1
index 49ee926b0c94..8ca8d25148a3 100644
@@ -13,7 +13,6 @@
 
 #define CONFIG_SYS_NONCACHED_MEMORY		SZ_1M
 
-#define COUNTER_FREQUENCY			13000000
 
 /* DRAM definition */
 #define CONFIG_SYS_SDRAM_BASE			0x40000000
include/configs/owl-common.h +0 -1
index 96453214eeb9..c808b2f4797b 100644
@@ -14,7 +14,6 @@
 #define CONFIG_SYS_SDRAM_BASE		0x0
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		(24000000)	/* 24MHz */
 
 /* Some commands use this as the default load address */
 
include/configs/p2371-2180.h +0 -1
index ef1fa2a5926e..d7b8c05b9ad7 100644
@@ -25,6 +25,5 @@
 #include "tegra-common-post.h"
 
 /* Crystal is 38.4MHz. clk_m runs at half that rate */
-#define COUNTER_FREQUENCY	19200000
 
 #endif /* _P2371_2180_H */
include/configs/p2771-0000.h +0 -1
index 4c3da224c66d..e4cb9495eb70 100644
@@ -38,6 +38,5 @@
 #include "tegra-common-post.h"
 
 /* Crystal is 38.4MHz. clk_m runs at half that rate */
-#define COUNTER_FREQUENCY	19200000
 
 #endif
include/configs/p3450-0000.h +0 -1
index 1c962be8b8e4..42ecfd9bfc6a 100644
@@ -36,6 +36,5 @@
 #include "tegra-common-post.h"
 
 /* Crystal is 38.4MHz. clk_m runs at half that rate */
-#define COUNTER_FREQUENCY	19200000
 
 #endif /* _P3450_0000_H */
include/configs/presidio_asic.h +1 -2
index 3295d43ed67a..1d526a738027 100644
@@ -12,8 +12,7 @@
 #define CONFIG_SYS_BOOTM_LEN		0x00c00000
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		25000000
-#define CONFIG_SYS_TIMER_RATE		COUNTER_FREQUENCY
+#define CONFIG_SYS_TIMER_RATE		25000000
 #define CONFIG_SYS_TIMER_COUNTER	0xf4321008
 
 /* note: arch/arm/cpu/armv8/start.S which references GICD_BASE/GICC_BASE
include/configs/px30_common.h +0 -1
index 099238715711..a7e8dabff520 100644
@@ -13,7 +13,6 @@
 #define CONFIG_SYS_NS16550_MEM32
 
 #define CONFIG_ROCKCHIP_STIMER_BASE	0xff220020
-#define COUNTER_FREQUENCY		24000000
 
 /* FIXME: ff020000 is pmu_mem (10k), while ff0e0000 is regular int_mem */
 #define CONFIG_IRAM_BASE		0xff020000
include/configs/rk3308_common.h +0 -1
index 1664707ca658..cc7fd03d0dec 100644
@@ -21,7 +21,6 @@
 #define CONFIG_SPL_STACK		0x00400000
 #define CONFIG_SYS_BOOTM_LEN		(64 << 20)	/* 64M */
 
-#define COUNTER_FREQUENCY		24000000
 
 #define CONFIG_SYS_BOOTM_LEN	(64 << 20)	/* 64M */
 
include/configs/rk3328_common.h +0 -1
index c1e26a019b57..a40ef1290ed4 100644
@@ -11,7 +11,6 @@
 #define CONFIG_IRAM_BASE		0xff090000
 
 #define CONFIG_ROCKCHIP_STIMER_BASE    0xff1d0020
-#define COUNTER_FREQUENCY		24000000
 
 #define CONFIG_SYS_CBSIZE		1024
 
include/configs/rk3368_common.h +0 -1
index 8b239ca07da8..c33b654990b8 100644
@@ -16,7 +16,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 
 #define CONFIG_ROCKCHIP_STIMER_BASE	0xff830020
-#define COUNTER_FREQUENCY		24000000
 
 #define CONFIG_IRAM_BASE		0xff8c0000
 
include/configs/rk3399_common.h +0 -1
index ed72c8bb6b11..53d1d0e9a6ca 100644
@@ -10,7 +10,6 @@
 
 #define CONFIG_SYS_CBSIZE		1024
 
-#define COUNTER_FREQUENCY               24000000
 #define CONFIG_ROCKCHIP_STIMER_BASE	0xff8680a0
 
 #define CONFIG_IRAM_BASE		0xff8c0000
include/configs/rk3568_common.h +0 -1
index 25d7c5cc8fff..9197d10bf2bd 100644
@@ -10,7 +10,6 @@
 
 #define CONFIG_SYS_CBSIZE		1024
 
-#define COUNTER_FREQUENCY               24000000
 #define CONFIG_ROCKCHIP_STIMER_BASE	0xfdd1c020
 
 #define CONFIG_IRAM_BASE		0xfdcc0000
include/configs/salvator-x.h +0 -1
index 764bc1bbf292..79724538df82 100644
@@ -12,7 +12,6 @@
 #include "rcar-gen3-common.h"
 
 /* Generic Timer Definitions (use in assembler source) */
-#define COUNTER_FREQUENCY	0xFE502A	/* 16.66MHz from CPclk */
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 
include/configs/sdm845.h +0 -1
index ba57323c74b1..650baf498343 100644
@@ -14,7 +14,6 @@
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 115200, 230400, 460800, 921600 }
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY	19000000
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"bootm_size=0x4000000\0"	\
include/configs/silinux-ek874.h +0 -1
index a99babb48b0a..1e2896b83ebb 100644
@@ -12,6 +12,5 @@
 #include "rcar-gen3-common.h"
 
 /* Generic Timer Definitions (use in assembler source) */
-#define COUNTER_FREQUENCY	0xFE502A	/* 16.66MHz from CPclk */
 
 #endif /* __SILINUX_EK874_H */
include/configs/socfpga_soc64_common.h +0 -1
index c288d548f5b4..493e8c99cc27 100644
@@ -111,7 +111,6 @@
 /*
  * Timer & watchdog configurations
  */
-#define COUNTER_FREQUENCY		400000000
 
 /*
  * SDMMC configurations
include/configs/ten64.h +0 -1
index f82b1e0d212a..04772c9e4efc 100644
@@ -9,7 +9,6 @@
 
 #include "ls1088a_common.h"
 
-#define COUNTER_FREQUENCY		25000000	/* 25MHz */
 
 #define CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS 5000
 
include/configs/thunderx_88xx.h +0 -1
index d07a8fe86bc6..e9e27cb92045 100644
@@ -21,7 +21,6 @@
 #define CPU_RELEASE_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x7fff0)
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		(0x1800000)	/* 24MHz */
 
 /* PL011 Serial Configuration */
 
include/configs/ulcb.h +0 -1
index c991bff0e889..c72be0096358 100644
@@ -12,7 +12,6 @@
 #include "rcar-gen3-common.h"
 
 /* Generic Timer Definitions (use in assembler source) */
-#define COUNTER_FREQUENCY	0xFE502A	/* 16.66MHz from CPclk */
 
 /* Environment in eMMC, at the end of 2nd "boot sector" */
 
include/configs/vexpress_aemv8.h +0 -1
index 4f0ff239e685..0e836ebdaa93 100644
@@ -74,7 +74,6 @@
 #define V2M_SYS_CFGSTAT			(V2M_SYSREGS + 0x0a8)
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		24000000	/* 24MHz */
 
 /* Generic Interrupt Controller Definitions */
 #ifdef CONFIG_GICV3
Signature · 1 line
2.25.1
#10 lore raw

Re: [PATCH V2 6/6] include/configs: drop COUNTER_FREQUENCY

Quoted 5 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

Since we have CONFIG_COUNTER_FREQUENCY enabled, no need COUNTER_FREQUENCY

[snip]

include/configs/apalis-imx8.h line 89

Quoted 11 lines
include/configs/apalis-imx8.h +0 -1
index c87bcd475eff..8cc7538ee7cc 100644
@@ -85,6 +85,5 @@
 					sizeof(CONFIG_SYS_PROMPT) + 16)
 
 /* Generic Timer Definitions */
-#define COUNTER_FREQUENCY		8000000	/* 8MHz */
 
 #endif /* __APALIS_IMX8_H */

As a minor thing, and if you don't do it in v3 I'll do it when applying, we should remove the now useless comment line as well in all of these (an then the extra blank line).

Signature · 1 line
Tom
#11 lore raw
In reply to Peng Fan (OSS)
Quoted 11 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

V2:
Drop imx93 which is wrongly included

This patchset is to convert COUNTER_FREQUENCY to CONFIG_COUNTER_FREQUENCY for arm64. arm32 is not included for now, this could be in following up patches if this patchset is accepted.

This patchset touches lots of boards, so please help review.

Quoted 7 lines

Peng Fan (6):
xilinx: versal: board: use CONFIG_COUNTER_FREQUENCY
arch: arm: move COUNTER_FREQUENCY from versal to arm
arch: arm: Kconfig: set default COUNTER_FREQUENCY for i.MX
configs: set CONFIG_COUNTER_FREQUENCY
armv8: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid include/configs: drop COUNTER_FREQUENCY

I'm glad to see this being done. My only question is, doing it this way, is it still bisectable? Or do we need to squash a few of the patches together? This split does make review easier, yes. Thanks.

Signature · 1 line
Tom
#12 lore raw
Quoted 21 lines · Tom Rini
Quoted 11 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

V2:
Drop imx93 which is wrongly included

This patchset is to convert COUNTER_FREQUENCY to CONFIG_COUNTER_FREQUENCY for arm64. arm32 is not included for now, this could be in following up patches if this patchset is accepted.

This patchset touches lots of boards, so please help review.

Quoted 7 lines

Peng Fan (6):
xilinx: versal: board: use CONFIG_COUNTER_FREQUENCY
arch: arm: move COUNTER_FREQUENCY from versal to arm
arch: arm: Kconfig: set default COUNTER_FREQUENCY for i.MX
configs: set CONFIG_COUNTER_FREQUENCY
armv8: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid include/configs: drop COUNTER_FREQUENCY

Quoted 3 lines

I'm glad to see this being done. My only question is, doing it this way, is it still bisectable? Or do we need to squash a few of the patches together? This split does make review easier, yes. Thanks.

I have take git bisect in mind when developing this patchset, and it should not break git bisect, I could give a one by one build try.

Thanks,
Peng.

Quoted 1 line
#13 lore raw
Quoted 24 lines · Peng Fan (OSS)
Quoted 21 lines · Tom Rini
Quoted 18 lines · Peng Fan (OSS)

From: Peng Fan <[email protected]>

V2:
Drop imx93 which is wrongly included

This patchset is to convert COUNTER_FREQUENCY to CONFIG_COUNTER_FREQUENCY for arm64. arm32 is not included for now, this could be in following up patches if this patchset is accepted.

This patchset touches lots of boards, so please help review.

Peng Fan (6):
xilinx: versal: board: use CONFIG_COUNTER_FREQUENCY
arch: arm: move COUNTER_FREQUENCY from versal to arm
arch: arm: Kconfig: set default COUNTER_FREQUENCY for i.MX
configs: set CONFIG_COUNTER_FREQUENCY
armv8: set cntfrq_el0 if CONFIG_COUNTER_FREQUENCY is valid include/configs: drop COUNTER_FREQUENCY

Quoted 6 lines
Quoted 3 lines

I'm glad to see this being done. My only question is, doing it this way, is it still bisectable? Or do we need to squash a few of the patches together? This split does make review easier, yes. Thanks.

I have take git bisect in mind when developing this patchset, and it should not break git bisect, I could give a one by one build try.

If you think it's bisectable, OK, just making sure. Thanks!

Signature · 1 line
Tom