summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-12-14 13:36:40 -0500
committerTom Rini <trini@konsulko.com>2021-12-27 16:20:18 -0500
commit2f8a6db5d83b103e372172422a3d0aff873f1299 (patch)
tree419f0a496c644b438c2702b23f86686eb0758f85 /include
parente4c3ce7e2845d75dc1696b2875bb632993a9c51c (diff)
Finish conversion of CONFIG_SYS_CLK_FREQ to Kconfig
In order to finish moving this symbol to Kconfig for all platforms, we need to do a few more things. First, for all platforms that define this to a function, introduce CONFIG_DYNAMIC_SYS_CLK_FREQ, similar to CONFIG_DYNAMIC_DDR_CLK_FREQ and populate clock_legacy.h. This entails also switching all users from CONFIG_SYS_CLK_FREQ to get_board_sys_clk() and updating a few preprocessor tests. With that done, all platforms that define a value here can be converted to Kconfig, and a fall-back of zero is sufficiently safe to use (and what is used today in cases where code may or may not have this available). Make sure that code which calls this function includes <clock_legacy.h> to get the prototype. Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r--include/clock_legacy.h11
-rw-r--r--include/configs/MPC8540ADS.h4
-rw-r--r--include/configs/MPC8548CDS.h2
-rw-r--r--include/configs/MPC8560ADS.h4
-rw-r--r--include/configs/P1010RDB.h2
-rw-r--r--include/configs/P2041RDB.h2
-rw-r--r--include/configs/T102xRDB.h2
-rw-r--r--include/configs/T104xRDB.h2
-rw-r--r--include/configs/T208xQDS.h6
-rw-r--r--include/configs/T208xRDB.h2
-rw-r--r--include/configs/T4240RDB.h2
-rw-r--r--include/configs/adp-ae3xx.h3
-rw-r--r--include/configs/adp-ag101p.h3
-rw-r--r--include/configs/alt.h1
-rw-r--r--include/configs/armadillo-800eva.h5
-rw-r--r--include/configs/blanche.h1
-rw-r--r--include/configs/condor.h1
-rw-r--r--include/configs/corenet_ds.h2
-rw-r--r--include/configs/da850evm.h4
-rw-r--r--include/configs/eagle.h1
-rw-r--r--include/configs/exynos-common.h3
-rw-r--r--include/configs/falcon.h1
-rw-r--r--include/configs/gose.h1
-rw-r--r--include/configs/grpeach.h1
-rw-r--r--include/configs/km/km-mpc8309.h1
-rw-r--r--include/configs/km/km-mpc832x.h1
-rw-r--r--include/configs/km/pg-wcom-ls102xa.h2
-rw-r--r--include/configs/kmcent2.h2
-rw-r--r--include/configs/kmcoge5ne.h1
-rw-r--r--include/configs/koelsch.h1
-rw-r--r--include/configs/kontron_sl28.h3
-rw-r--r--include/configs/kzm9g.h3
-rw-r--r--include/configs/lager.h1
-rw-r--r--include/configs/legoev3.h4
-rw-r--r--include/configs/ls1012a_common.h2
-rw-r--r--include/configs/ls1021aiot.h2
-rw-r--r--include/configs/ls1021aqds.h7
-rw-r--r--include/configs/ls1021atsn.h2
-rw-r--r--include/configs/ls1021atwr.h2
-rw-r--r--include/configs/ls1028aqds.h3
-rw-r--r--include/configs/ls1028ardb.h3
-rw-r--r--include/configs/ls1043aqds.h6
-rw-r--r--include/configs/ls1043ardb.h2
-rw-r--r--include/configs/ls1046afrwy.h2
-rw-r--r--include/configs/ls1046aqds.h6
-rw-r--r--include/configs/ls1046ardb.h2
-rw-r--r--include/configs/ls1088aqds.h10
-rw-r--r--include/configs/ls1088ardb.h1
-rw-r--r--include/configs/ls2080aqds.h7
-rw-r--r--include/configs/ls2080ardb.h7
-rw-r--r--include/configs/lx2160a_common.h9
-rw-r--r--include/configs/omapl138_lcdk.h4
-rw-r--r--include/configs/p1_p2_rdb_pc.h6
-rw-r--r--include/configs/porter.h1
-rw-r--r--include/configs/qemu-ppce500.h2
-rw-r--r--include/configs/r2dplus.h1
-rw-r--r--include/configs/rcar-gen2-common.h2
-rw-r--r--include/configs/silk.h1
-rw-r--r--include/configs/smdkc100.h1
-rw-r--r--include/configs/socrates.h4
-rw-r--r--include/configs/stout.h1
-rw-r--r--include/configs/ti816x_evm.h1
-rw-r--r--include/configs/xtfpga.h8
-rw-r--r--include/faraday/ftwdt010_wdt.h6
64 files changed, 30 insertions, 166 deletions
diff --git a/include/clock_legacy.h b/include/clock_legacy.h
index 29261b680d..efa483117d 100644
--- a/include/clock_legacy.h
+++ b/include/clock_legacy.h
@@ -22,4 +22,15 @@ unsigned long get_board_ddr_clk(void);
#define get_board_ddr_clk() CONFIG_DDR_CLK_FREQ
#endif
+/*
+ * If we have CONFIG_DYNAMIC_SYS_CLK_FREQ then there will be an
+ * implentation of get_board_sys_clk() somewhere. Otherwise we have
+ * a static value to use now.
+ */
+#ifdef CONFIG_DYNAMIC_SYS_CLK_FREQ
+unsigned long get_board_sys_clk(void);
+#else
+#define get_board_sys_clk() CONFIG_SYS_CLK_FREQ
+#endif
+
#endif
diff --git a/include/configs/MPC8540ADS.h b/include/configs/MPC8540ADS.h
index 94ac0526b1..84e05eafa6 100644
--- a/include/configs/MPC8540ADS.h
+++ b/include/configs/MPC8540ADS.h
@@ -44,10 +44,6 @@
* Note that PCI-X won't work at 33MHz.
*/
-#ifndef CONFIG_SYS_CLK_FREQ
-#define CONFIG_SYS_CLK_FREQ 33000000
-#endif
-
/*
* These can be toggled for performance analysis, otherwise use default.
*/
diff --git a/include/configs/MPC8548CDS.h b/include/configs/MPC8548CDS.h
index 5c1d9b522e..f583aa8b36 100644
--- a/include/configs/MPC8548CDS.h
+++ b/include/configs/MPC8548CDS.h
@@ -24,9 +24,7 @@
#ifndef __ASSEMBLY__
#include <linux/stringify.h>
-extern unsigned long get_board_sys_clk(void);
#endif
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk() /* sysclk for MPC85xx */
/*
* These can be toggled for performance analysis, otherwise use default.
diff --git a/include/configs/MPC8560ADS.h b/include/configs/MPC8560ADS.h
index 32b0f40cec..b8a72d01dd 100644
--- a/include/configs/MPC8560ADS.h
+++ b/include/configs/MPC8560ADS.h
@@ -43,10 +43,6 @@
* in the README.mpc85xxads.
*/
-#ifndef CONFIG_SYS_CLK_FREQ
-#define CONFIG_SYS_CLK_FREQ 33000000
-#endif
-
/*
* These can be toggled for performance analysis, otherwise use default.
*/
diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
index abc76c92cb..6a9c86c9c4 100644
--- a/include/configs/P1010RDB.h
+++ b/include/configs/P1010RDB.h
@@ -146,8 +146,6 @@
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
#endif
-#define CONFIG_SYS_CLK_FREQ 66666666 /* SYSCLK for P1010 RDB */
-
#define CONFIG_HWCONFIG
/*
* These can be toggled for performance analysis, otherwise use default.
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index 424dd72d2e..8ada25dcc7 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -49,10 +49,8 @@
#endif
#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
#include <linux/stringify.h>
#endif
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
/*
* These can be toggled for performance analysis, otherwise use default.
diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h
index aecf2452ad..9b7784a0f3 100644
--- a/include/configs/T102xRDB.h
+++ b/include/configs/T102xRDB.h
@@ -115,8 +115,6 @@
#define CONFIG_RESET_VECTOR_ADDRESS 0xfffffffc
#endif
-#define CONFIG_SYS_CLK_FREQ 100000000
-
/*
* These can be toggled for performance analysis, otherwise use default.
*/
diff --git a/include/configs/T104xRDB.h b/include/configs/T104xRDB.h
index a3085ac3de..7f3b1909dc 100644
--- a/include/configs/T104xRDB.h
+++ b/include/configs/T104xRDB.h
@@ -92,8 +92,6 @@
#endif
#endif
-#define CONFIG_SYS_CLK_FREQ 100000000
-
/*
* These can be toggled for performance analysis, otherwise use default.
*/
diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h
index da20d81f03..aaea314e45 100644
--- a/include/configs/T208xQDS.h
+++ b/include/configs/T208xQDS.h
@@ -93,12 +93,6 @@
#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
#endif
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
-
/*
* Config the L3 Cache as L3 SRAM
*/
diff --git a/include/configs/T208xRDB.h b/include/configs/T208xRDB.h
index e90b30db52..467f6344fa 100644
--- a/include/configs/T208xRDB.h
+++ b/include/configs/T208xRDB.h
@@ -88,8 +88,6 @@
#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
#endif
-#define CONFIG_SYS_CLK_FREQ 66660000
-
/*
* Config the L3 Cache as L3 SRAM
*/
diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h
index 037425bba1..2d632493c1 100644
--- a/include/configs/T4240RDB.h
+++ b/include/configs/T4240RDB.h
@@ -224,8 +224,6 @@
"setenv bootargs config-addr=0x60000000; " \
"bootm 0x01000000 - 0x00f00000"
-#define CONFIG_SYS_CLK_FREQ 66666666
-
/*
* DDR Setup
*/
diff --git a/include/configs/adp-ae3xx.h b/include/configs/adp-ae3xx.h
index d583733971..58e8526048 100644
--- a/include/configs/adp-ae3xx.h
+++ b/include/configs/adp-ae3xx.h
@@ -28,8 +28,7 @@
/*
* Timer
*/
-#define CONFIG_SYS_CLK_FREQ 39062500
-#define VERSION_CLOCK CONFIG_SYS_CLK_FREQ
+#define VERSION_CLOCK get_board_sys_clk()
/*
* Use Externel CLOCK or PCLK
diff --git a/include/configs/adp-ag101p.h b/include/configs/adp-ag101p.h
index f2c0a0002d..1022764985 100644
--- a/include/configs/adp-ag101p.h
+++ b/include/configs/adp-ag101p.h
@@ -30,8 +30,7 @@
/*
* Timer
*/
-#define CONFIG_SYS_CLK_FREQ 39062500
-#define VERSION_CLOCK CONFIG_SYS_CLK_FREQ
+#define VERSION_CLOCK get_board_sys_clk()
/*
* Use Externel CLOCK or PCLK
diff --git a/include/configs/alt.h b/include/configs/alt.h
index 079d2d7194..37b5800d6e 100644
--- a/include/configs/alt.h
+++ b/include/configs/alt.h
@@ -34,7 +34,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Board Clock */
-#define CONFIG_SYS_CLK_FREQ 20000000
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootm_size=0x10000000\0" \
diff --git a/include/configs/armadillo-800eva.h b/include/configs/armadillo-800eva.h
index 73f63c5a9f..7714da40dc 100644
--- a/include/configs/armadillo-800eva.h
+++ b/include/configs/armadillo-800eva.h
@@ -17,7 +17,7 @@
#define CONFIG_TMU_TIMER
#define CONFIG_SYS_TIMER_COUNTS_DOWN
#define CONFIG_SYS_TIMER_COUNTER (TMU_BASE + 0xc) /* TCNT0 */
-#define CONFIG_SYS_TIMER_RATE (CONFIG_SYS_CLK_FREQ / 4)
+#define CONFIG_SYS_TIMER_RATE (get_board_sys_clk() / 4)
/* STACK */
#define CONFIG_SYS_INIT_SP_ADDR 0xE8083000
@@ -72,7 +72,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Board Clock */
-#define CONFIG_SYS_CLK_FREQ 50000000
-#define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ
+#define CONFIG_SH_SCIF_CLK_FREQ get_board_sys_clk()
#endif /* __ARMADILLO_800EVA_H */
diff --git a/include/configs/blanche.h b/include/configs/blanche.h
index f2cc765b96..882b94f55a 100644
--- a/include/configs/blanche.h
+++ b/include/configs/blanche.h
@@ -45,7 +45,6 @@
#endif
/* Board Clock */
-#define CONFIG_SYS_CLK_FREQ 20000000
/* ENV setting */
diff --git a/include/configs/condor.h b/include/configs/condor.h
index 429047b112..822ef7118e 100644
--- a/include/configs/condor.h
+++ b/include/configs/condor.h
@@ -27,7 +27,6 @@
/* Board Clock */
/* XTAL_CLK : 33.33MHz */
-#define CONFIG_SYS_CLK_FREQ 33333333
/* Generic Timer Definitions (use in assembler source) */
#define COUNTER_FREQUENCY 0xFE502A /* 16.66MHz from CPclk */
diff --git a/include/configs/corenet_ds.h b/include/configs/corenet_ds.h
index c8f46ebdb2..f6e0b2a7ea 100644
--- a/include/configs/corenet_ds.h
+++ b/include/configs/corenet_ds.h
@@ -53,8 +53,6 @@
#define CONFIG_FSL_FIXED_MMC_LOCATION
#endif
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk() /* sysclk for MPC85xx */
-
/*
* These can be toggled for performance analysis, otherwise use default.
*/
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index d1c0cc2363..97c9276e0e 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -17,11 +17,7 @@
/*
* SoC Configuration
*/
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
#define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
#define CONFIG_SYS_OSCIN_FREQ 24000000
#define CONFIG_SYS_TIMERBASE DAVINCI_TIMER0_BASE
#define CONFIG_SYS_HZ_CLOCK clk_get(DAVINCI_AUXCLK_CLKID)
diff --git a/include/configs/eagle.h b/include/configs/eagle.h
index 6d17b065fe..b8a7b5a916 100644
--- a/include/configs/eagle.h
+++ b/include/configs/eagle.h
@@ -18,7 +18,6 @@
/* Board Clock */
/* XTAL_CLK : 33.33MHz */
-#define CONFIG_SYS_CLK_FREQ 33333333
/* Generic Timer Definitions (use in assembler source) */
#define COUNTER_FREQUENCY 0xFE502A /* 16.66MHz from CPclk */
diff --git a/include/configs/exynos-common.h b/include/configs/exynos-common.h
index 95aaa747e4..eb2606905f 100644
--- a/include/configs/exynos-common.h
+++ b/include/configs/exynos-common.h
@@ -19,8 +19,7 @@
/* Keep L2 Cache Disabled */
/* input clock of PLL: 24MHz input clock */
-#define CONFIG_SYS_CLK_FREQ 24000000
-#define COUNTER_FREQUENCY CONFIG_SYS_CLK_FREQ
+#define COUNTER_FREQUENCY 24000000
/* select serial console configuration */
diff --git a/include/configs/falcon.h b/include/configs/falcon.h
index f9c3c2b9c7..1d6a9b9b73 100644
--- a/include/configs/falcon.h
+++ b/include/configs/falcon.h
@@ -26,7 +26,6 @@
/* Board Clock */
/* XTAL_CLK : 16.66MHz */
-#define CONFIG_SYS_CLK_FREQ 16666666
/* Generic Timer Definitions (use in assembler source) */
#define COUNTER_FREQUENCY 0xFE502A /* 16.66MHz from CPclk */
diff --git a/include/configs/gose.h b/include/configs/gose.h
index 2e35752664..01657d7a66 100644
--- a/include/configs/gose.h
+++ b/include/configs/gose.h
@@ -30,7 +30,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Board Clock */
-#define CONFIG_SYS_CLK_FREQ 20000000
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootm_size=0x10000000\0"
diff --git a/include/configs/grpeach.h b/include/configs/grpeach.h
index 29a446c2f5..fb01c5614b 100644
--- a/include/configs/grpeach.h
+++ b/include/configs/grpeach.h
@@ -9,7 +9,6 @@
#define __GRPEACH_H
/* Board Clock , P1 clock frequency (XTAL=13.33MHz) */
-#define CONFIG_SYS_CLK_FREQ 66666666
/* Miscellaneous */
#define CONFIG_SYS_PBSIZE 256
diff --git a/include/configs/km/km-mpc8309.h b/include/configs/km/km-mpc8309.h
index 869bd9b30a..47a335bcf8 100644
--- a/include/configs/km/km-mpc8309.h
+++ b/include/configs/km/km-mpc8309.h
@@ -8,7 +8,6 @@
/*
* System Clock Setup
*/
-#define CONFIG_SYS_CLK_FREQ 66000000
#define CONFIG_83XX_PCICLK 66000000
/* QE microcode/firmware address */
diff --git a/include/configs/km/km-mpc832x.h b/include/configs/km/km-mpc832x.h
index de6e7daf06..d985ab7a65 100644
--- a/include/configs/km/km-mpc832x.h
+++ b/include/configs/km/km-mpc832x.h
@@ -6,7 +6,6 @@
/*
* System Clock Setup
*/
-#define CONFIG_SYS_CLK_FREQ 66000000
#define CONFIG_83XX_PCICLK 66000000
/*
diff --git a/include/configs/km/pg-wcom-ls102xa.h b/include/configs/km/pg-wcom-ls102xa.h
index d94572d3ab..ba0e4dd5c6 100644
--- a/include/configs/km/pg-wcom-ls102xa.h
+++ b/include/configs/km/pg-wcom-ls102xa.h
@@ -16,8 +16,6 @@
CONFIG_KM_PHRAM + \
CONFIG_KM_RESERVED_PRAM) >> 10)
-#define CONFIG_SYS_CLK_FREQ 66666666
-
#define PHYS_SDRAM 0x80000000
#define PHYS_SDRAM_SIZE (1u * 1024 * 1024 * 1024)
diff --git a/include/configs/kmcent2.h b/include/configs/kmcent2.h
index 45371ee723..98e572397b 100644
--- a/include/configs/kmcent2.h
+++ b/include/configs/kmcent2.h
@@ -146,8 +146,6 @@
#define CONFIG_ENV_TOTAL_SIZE 0x040000
#define ENV_DEL_ADDR 0xebf00000 /*direct for newenv*/
-#define CONFIG_SYS_CLK_FREQ 66666666
-
/*
* These can be toggled for performance analysis, otherwise use default.
*/
diff --git a/include/configs/kmcoge5ne.h b/include/configs/kmcoge5ne.h
index 60fe4ae383..9e1f802e4e 100644
--- a/include/configs/kmcoge5ne.h
+++ b/include/configs/kmcoge5ne.h
@@ -27,7 +27,6 @@
/*
* System Clock Setup
*/
-#define CONFIG_SYS_CLK_FREQ 66000000
#define CONFIG_83XX_PCICLK 66000000
/**
diff --git a/include/configs/koelsch.h b/include/configs/koelsch.h
index 18a1ebd456..eca8998a51 100644
--- a/include/configs/koelsch.h
+++ b/include/configs/koelsch.h
@@ -30,7 +30,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Board Clock */
-#define CONFIG_SYS_CLK_FREQ 20000000
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootm_size=0x10000000\0"
diff --git a/include/configs/kontron_sl28.h b/include/configs/kontron_sl28.h
index 84dd818aa9..448749a7f8 100644
--- a/include/configs/kontron_sl28.h
+++ b/include/configs/kontron_sl28.h
@@ -42,8 +42,7 @@
/* serial port */
#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0) / 2)
-#define CONFIG_SYS_CLK_FREQ 100000000
-#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4)
+#define COUNTER_FREQUENCY_REAL (get_board_sys_clk() / 4)
/* ethernet */
#define CONFIG_SYS_RX_ETH_BUFFER 8
diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h
index c3f690c7d7..1eb6dafe20 100644
--- a/include/configs/kzm9g.h
+++ b/include/configs/kzm9g.h
@@ -68,9 +68,8 @@
/* Clock */
#define CONFIG_GLOBAL_TIMER
-#define CONFIG_SYS_CLK_FREQ (48000000)
#define CONFIG_SYS_CPU_CLK (1196000000)
-#define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ
+#define CONFIG_SH_SCIF_CLK_FREQ get_board_sys_clk()
#define TMU_CLK_DIVIDER (4) /* 4 (default), 16, 64, 256 or 1024 */
#define CONFIG_NFS_TIMEOUT 10000UL
diff --git a/include/configs/lager.h b/include/configs/lager.h
index 6e003e8466..4c291aa89b 100644
--- a/include/configs/lager.h
+++ b/include/configs/lager.h
@@ -31,7 +31,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Board Clock */
-#define CONFIG_SYS_CLK_FREQ 20000000
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootm_size=0x10000000\0"
diff --git a/include/configs/legoev3.h b/include/configs/legoev3.h
index 21ba9b8da8..b912db11d0 100644
--- a/include/configs/legoev3.h
+++ b/include/configs/legoev3.h
@@ -17,11 +17,7 @@
/*
* SoC Configuration
*/
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
#define CONFIG_SYS_EXCEPTION_VECTORS_HIGH
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
#define CONFIG_SYS_OSCIN_FREQ 24000000
#define CONFIG_SYS_TIMERBASE DAVINCI_TIMER0_BASE
#define CONFIG_SYS_HZ_CLOCK clk_get(DAVINCI_AUXCLK_CLKID)
diff --git a/include/configs/ls1012a_common.h b/include/configs/ls1012a_common.h
index 7cbea26924..5d561009c5 100644
--- a/include/configs/ls1012a_common.h
+++ b/include/configs/ls1012a_common.h
@@ -10,8 +10,6 @@
#include <asm/arch/stream_id_lsch2.h>
#include <linux/sizes.h>
-#define CONFIG_SYS_CLK_FREQ 125000000
-
#ifdef CONFIG_TFABOOT
#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
#else
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
index 3d504599f3..7b4044fba7 100644
--- a/include/configs/ls1021aiot.h
+++ b/include/configs/ls1021aiot.h
@@ -12,8 +12,6 @@
#define CONFIG_SYS_INIT_RAM_ADDR OCRAM_BASE_ADDR
#define CONFIG_SYS_INIT_RAM_SIZE OCRAM_SIZE
-#define CONFIG_SYS_CLK_FREQ 100000000
-
/*
* DDR: 800 MHz ( 1600 MT/s data rate )
*/
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index d8ce83b33f..7ef42a6d8c 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -14,15 +14,8 @@
#define CONFIG_SYS_INIT_RAM_ADDR OCRAM_BASE_ADDR
#define CONFIG_SYS_INIT_RAM_SIZE OCRAM_SIZE
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-
#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
-#define CONFIG_SYS_CLK_FREQ 100000000
#define CONFIG_QIXIS_I2C_ACCESS
-#else
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
#endif
#ifdef CONFIG_SD_BOOT
diff --git a/include/configs/ls1021atsn.h b/include/configs/ls1021atsn.h
index 08fbd72008..5f6c2a0037 100644
--- a/include/configs/ls1021atsn.h
+++ b/include/configs/ls1021atsn.h
@@ -16,8 +16,6 @@
/* XHCI Support - enabled by default */
#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#define CONFIG_SYS_CLK_FREQ 100000000
-
#define DDR_SDRAM_CFG 0x470c0008
#define DDR_CS0_BNDS 0x008000bf
#define DDR_CS0_CONFIG 0x80014302
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index c5ccaa84e5..75fab4328a 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -14,8 +14,6 @@
#define CONFIG_SYS_INIT_RAM_ADDR OCRAM_BASE_ADDR
#define CONFIG_SYS_INIT_RAM_SIZE OCRAM_SIZE
-#define CONFIG_SYS_CLK_FREQ 100000000
-
#define DDR_SDRAM_CFG 0x470c0008
#define DDR_CS0_BNDS 0x008000bf
#define DDR_CS0_CONFIG 0x80014302
diff --git a/include/configs/ls1028aqds.h b/include/configs/ls1028aqds.h
index fe20363e69..8e3bd7790f 100644
--- a/include/configs/ls1028aqds.h
+++ b/include/configs/ls1028aqds.h
@@ -8,8 +8,7 @@
#include "ls1028a_common.h"
-#define CONFIG_SYS_CLK_FREQ 100000000
-#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4)
+#define COUNTER_FREQUENCY_REAL (get_board_sys_clk() / 4)
/* DDR */
#define CONFIG_DIMM_SLOTS_PER_CTLR 2
diff --git a/include/configs/ls1028ardb.h b/include/configs/ls1028ardb.h
index 348db1e2f8..5ce9ebbae9 100644
--- a/include/configs/ls1028ardb.h
+++ b/include/configs/ls1028ardb.h
@@ -8,8 +8,7 @@
#include "ls1028a_common.h"
-#define CONFIG_SYS_CLK_FREQ 100000000
-#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4)
+#define COUNTER_FREQUENCY_REAL (get_board_sys_clk() / 4)
#define CONFIG_SYS_RTC_BUS_NUM 0
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 929830e693..80eff7b1a9 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -8,12 +8,6 @@
#include "ls1043a_common.h"
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
-
#define CONFIG_LAYERSCAPE_NS_ACCESS
#define CONFIG_DIMM_SLOTS_PER_CTLR 1
diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h
index 0d071c4ab7..7b6d19374e 100644
--- a/include/configs/ls1043ardb.h
+++ b/include/configs/ls1043ardb.h
@@ -8,8 +8,6 @@
#include "ls1043a_common.h"
-#define CONFIG_SYS_CLK_FREQ 100000000
-
#define CONFIG_LAYERSCAPE_NS_ACCESS
#define CONFIG_DIMM_SLOTS_PER_CTLR 1
diff --git a/include/configs/ls1046afrwy.h b/include/configs/ls1046afrwy.h
index 4725503111..14ad84a1ef 100644
--- a/include/configs/ls1046afrwy.h
+++ b/include/configs/ls1046afrwy.h
@@ -8,8 +8,6 @@
#include "ls1046a_common.h"
-#define CONFIG_SYS_CLK_FREQ 100000000
-
#define CONFIG_LAYERSCAPE_NS_ACCESS
#define CONFIG_DIMM_SLOTS_PER_CTLR 1
diff --git a/include/configs/ls1046aqds.h b/include/configs/ls1046aqds.h
index d1803d2623..97bf4182be 100644
--- a/include/configs/ls1046aqds.h
+++ b/include/configs/ls1046aqds.h
@@ -8,12 +8,6 @@
#include "ls1046a_common.h"
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
-
#define CONFIG_LAYERSCAPE_NS_ACCESS
#define CONFIG_DIMM_SLOTS_PER_CTLR 1
diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h
index 4fc954c538..8ed1dceb23 100644
--- a/include/configs/ls1046ardb.h
+++ b/include/configs/ls1046ardb.h
@@ -9,8 +9,6 @@
#include "ls1046a_common.h"
-#define CONFIG_SYS_CLK_FREQ 100000000
-
#define CONFIG_LAYERSCAPE_NS_ACCESS
#define CONFIG_DIMM_SLOTS_PER_CTLR 1
diff --git a/include/configs/ls1088aqds.h b/include/configs/ls1088aqds.h
index dcf73a914b..5912fe95cc 100644
--- a/include/configs/ls1088aqds.h
+++ b/include/configs/ls1088aqds.h
@@ -8,22 +8,14 @@
#include "ls1088a_common.h"
-
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-
#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
#define CONFIG_QIXIS_I2C_ACCESS
#define SYS_NO_FLASH
-
-#define CONFIG_SYS_CLK_FREQ 100000000
#else
#define CONFIG_QIXIS_I2C_ACCESS
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
#endif
-#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ/4)
+#define COUNTER_FREQUENCY_REAL (get_board_sys_clk()/4)
#define COUNTER_FREQUENCY 25000000 /* 25MHz */
#define CONFIG_DIMM_SLOTS_PER_CTLR 1
diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h
index 0f7778c58e..400b8adb24 100644
--- a/include/configs/ls1088ardb.h
+++ b/include/configs/ls1088ardb.h
@@ -16,7 +16,6 @@
#define SYS_NO_FLASH
#endif
-#define CONFIG_SYS_CLK_FREQ 100000000
#define COUNTER_FREQUENCY_REAL 25000000 /* 25MHz */
#define COUNTER_FREQUENCY 25000000 /* 25MHz */
diff --git a/include/configs/ls2080aqds.h b/include/configs/ls2080aqds.h
index 3fe0ce7bcf..b0a05dd807 100644
--- a/include/configs/ls2080aqds.h
+++ b/include/configs/ls2080aqds.h
@@ -9,18 +9,13 @@
#include "ls2080a_common.h"
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-
#ifdef CONFIG_FSL_QSPI
#define CONFIG_QIXIS_I2C_ACCESS
#define CONFIG_SYS_I2C_IFDR_DIV 0x7e
#endif
#define CONFIG_SYS_I2C_FPGA_ADDR 0x66
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
-#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ/4)
+#define COUNTER_FREQUENCY_REAL (get_board_sys_clk()/4)
#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
#define SPD_EEPROM_ADDRESS1 0x51
diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
index 96b804b57f..a54387e16c 100644
--- a/include/configs/ls2080ardb.h
+++ b/include/configs/ls2080ardb.h
@@ -25,12 +25,7 @@
#define VDD_MV_MIN 819
#define VDD_MV_MAX 1212
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
-#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ/4)
+#define COUNTER_FREQUENCY_REAL (get_board_sys_clk()/4)
#define CONFIG_MEM_INIT_VALUE 0xdeadbeef
#define SPD_EEPROM_ADDRESS1 0x51
diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h
index 767980fa94..e285109cbb 100644
--- a/include/configs/lx2160a_common.h
+++ b/include/configs/lx2160a_common.h
@@ -126,14 +126,7 @@
#endif
#endif
-/* GPIO */
-
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
-#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4)
+#define COUNTER_FREQUENCY_REAL (get_board_sys_clk() / 4)
#define CONFIG_HWCONFIG
#define HWCONFIG_BUFFER_SIZE 128
diff --git a/include/configs/omapl138_lcdk.h b/include/configs/omapl138_lcdk.h
index 1036a05a29..45297b9a61 100644
--- a/include/configs/omapl138_lcdk.h
+++ b/include/configs/omapl138_lcdk.h
@@ -17,10 +17,6 @@
/*
* SoC Configuration
*/
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
#define CONFIG_SYS_OSCIN_FREQ 24000000
#define CONFIG_SYS_TIMERBASE DAVINCI_TIMER0_BASE
#define CONFIG_SYS_HZ_CLOCK clk_get(DAVINCI_AUXCLK_CLKID)
diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h
index e2330ee87f..2e1331b9b0 100644
--- a/include/configs/p1_p2_rdb_pc.h
+++ b/include/configs/p1_p2_rdb_pc.h
@@ -141,12 +141,6 @@
#define CONFIG_SYS_SATA_MAX_DEVICE 2
#define CONFIG_LBA48
-#if defined(CONFIG_TARGET_P2020RDB)
-#define CONFIG_SYS_CLK_FREQ 100000000
-#else
-#define CONFIG_SYS_CLK_FREQ 66666666
-#endif
-
#define CONFIG_HWCONFIG
/*
* These can be toggled for performance analysis, otherwise use default.
diff --git a/include/configs/porter.h b/include/configs/porter.h
index da2e171e00..867dadaedd 100644
--- a/include/configs/porter.h
+++ b/include/configs/porter.h
@@ -35,7 +35,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Board Clock */
-#define CONFIG_SYS_CLK_FREQ 20000000
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootm_size=0x10000000\0"
diff --git a/include/configs/qemu-ppce500.h b/include/configs/qemu-ppce500.h
index 7d8db6f60d..e257c0ec1f 100644
--- a/include/configs/qemu-ppce500.h
+++ b/include/configs/qemu-ppce500.h
@@ -45,8 +45,6 @@ extern unsigned long long get_phys_ccsrbar_addr_early(void);
#define CONFIG_CHIP_SELECTS_PER_CTRL 0
-#define CONFIG_SYS_CLK_FREQ 33000000
-
#define CONFIG_SYS_BOOT_BLOCK 0x00000000 /* boot TLB */
#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index 1dd83dbf64..680d16d547 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -29,7 +29,6 @@
/*
* SuperH Clock setting
*/
-#define CONFIG_SYS_CLK_FREQ 60000000
#define CONFIG_SYS_PLL_SETTLING_TIME 100/* in us */
/*
diff --git a/include/configs/rcar-gen2-common.h b/include/configs/rcar-gen2-common.h
index 595482c22e..f1f5d07bf8 100644
--- a/include/configs/rcar-gen2-common.h
+++ b/include/configs/rcar-gen2-common.h
@@ -42,6 +42,6 @@
#define CONFIG_TMU_TIMER
#define CONFIG_SYS_TIMER_COUNTS_DOWN
#define CONFIG_SYS_TIMER_COUNTER (TMU_BASE + 0xc) /* TCNT0 */
-#define CONFIG_SYS_TIMER_RATE (CONFIG_SYS_CLK_FREQ / 8)
+#define CONFIG_SYS_TIMER_RATE (get_board_sys_clk() / 8)
#endif /* __RCAR_GEN2_COMMON_H */
diff --git a/include/configs/silk.h b/include/configs/silk.h
index 785caa7b89..29350a635b 100644
--- a/include/configs/silk.h
+++ b/include/configs/silk.h
@@ -35,7 +35,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Board Clock */
-#define CONFIG_SYS_CLK_FREQ 20000000
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootm_size=0x10000000\0"
diff --git a/include/configs/smdkc100.h b/include/configs/smdkc100.h
index 8fdb692713..28ff48bf3d 100644
--- a/include/configs/smdkc100.h
+++ b/include/configs/smdkc100.h
@@ -22,7 +22,6 @@
#include <asm/arch/cpu.h> /* get chip and board defs */
/* input clock of PLL: SMDKC100 has 12MHz input clock */
-#define CONFIG_SYS_CLK_FREQ 12000000
/* DRAM Base */
#define CONFIG_SYS_SDRAM_BASE 0x30000000
diff --git a/include/configs/socrates.h b/include/configs/socrates.h
index 5052c72f54..15e93d044e 100644
--- a/include/configs/socrates.h
+++ b/include/configs/socrates.h
@@ -38,10 +38,6 @@
* in the README.mpc85xxads.
*/
-#ifndef CONFIG_SYS_CLK_FREQ
-#define CONFIG_SYS_CLK_FREQ 66666666
-#endif
-
/*
* These can be toggled for performance analysis, otherwise use default.
*/
diff --git a/include/configs/stout.h b/include/configs/stout.h
index 0d077ea031..df2d9676b5 100644
--- a/include/configs/stout.h
+++ b/include/configs/stout.h
@@ -39,7 +39,6 @@
#define CONFIG_BITBANGMII_MULTI
/* Board Clock */
-#define CONFIG_SYS_CLK_FREQ 20000000
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootm_size=0x10000000\0"
diff --git a/include/configs/ti816x_evm.h b/include/configs/ti816x_evm.h
index 44dca25b43..533673ba5d 100644
--- a/include/configs/ti816x_evm.h
+++ b/include/configs/ti816x_evm.h
@@ -27,7 +27,6 @@
/**
* Platform/Board specific defs
*/
-#define CONFIG_SYS_CLK_FREQ 27000000
#define CONFIG_SYS_TIMERBASE 0x4802E000
#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
diff --git a/include/configs/xtfpga.h b/include/configs/xtfpga.h
index d1ba78a030..c8a6e9a61a 100644
--- a/include/configs/xtfpga.h
+++ b/include/configs/xtfpga.h
@@ -22,12 +22,6 @@
#define CONFIG_XTFPGA
-/* FPGA CPU freq after init */
-#ifndef __ASSEMBLY__
-unsigned long get_board_sys_clk(void);
-#endif
-#define CONFIG_SYS_CLK_FREQ get_board_sys_clk()
-
/*===================*/
/* RAM Layout */
/*===================*/
@@ -172,7 +166,7 @@ unsigned long get_board_sys_clk(void);
#define CONFIG_SYS_NS16550_COM1 IOADDR(0x0D050020) /* Base address */
/* Input clk to NS16550 (in Hz; the SYS_CLK_FREQ is in kHz) */
-#define CONFIG_SYS_NS16550_CLK CONFIG_SYS_CLK_FREQ
+#define CONFIG_SYS_NS16550_CLK get_board_sys_clk()
/*======================*/
/* Ethernet Driver Info */
diff --git a/include/faraday/ftwdt010_wdt.h b/include/faraday/ftwdt010_wdt.h
index 20bf6d3125..804907d645 100644
--- a/include/faraday/ftwdt010_wdt.h
+++ b/include/faraday/ftwdt010_wdt.h
@@ -16,6 +16,8 @@
#ifndef __FTWDT010_H
#define __FTWDT010_H
+#include <clock_legacy.h>
+
struct ftwdt010_wdt {
unsigned int wdcounter; /* Counter Reg - 0x00 */
unsigned int wdload; /* Counter Auto Reload Reg - 0x04 */
@@ -82,10 +84,10 @@ struct ftwdt010_wdt {
/*
* Variable timeout should be set in ms.
- * (CONFIG_SYS_CLK_FREQ/1000) equals 1 ms.
+ * (get_board_sys_clk()/1000) equals 1 ms.
* WDLOAD = timeout * TIMEOUT_FACTOR.
*/
-#define FTWDT010_TIMEOUT_FACTOR (CONFIG_SYS_CLK_FREQ / 1000) /* 1 ms */
+#define FTWDT010_TIMEOUT_FACTOR (get_board_sys_clk() / 1000) /* 1 ms */
void ftwdt010_wdt_reset(void);
void ftwdt010_wdt_disable(void);