diff options
| author | Tom Rini <[email protected]> | 2021-08-21 13:50:17 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-08-31 17:46:37 -0400 |
| commit | efb5dab7ba8a9a6f89e44c4e60b0adb768c77e84 (patch) | |
| tree | 3e7132dcd7e90d3ca7f0a4564517b3b11dd6bed9 /include | |
| parent | 222d22a39a459f8982778bc28fad6fc4acc2e3a7 (diff) | |
nxp: Migrate CONFIG_DDR_CLK_FREQ to Kconfig
As this symbol can either be a fixed value or the function
get_board_ddr_clk, migration is tricky. Introduce a choice of DYNAMIC
or STATIC_DDR_CLK_FREQ. If DYNAMIC, we continue to use the board
defined get_board_ddr_clk function. If STATIC, set CONFIG_DDR_CLK_FREQ
to that value and now include/clock_legacy.h contains the function
prototype or defines get_board_ddr_clk() to that static value. Update
callers to test for DYNAMIC or STATIC.
Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'include')
28 files changed, 11 insertions, 44 deletions
diff --git a/include/clock_legacy.h b/include/clock_legacy.h index b0a8333ea6e..29261b680d0 100644 --- a/include/clock_legacy.h +++ b/include/clock_legacy.h @@ -11,4 +11,15 @@ int get_clocks(void); unsigned long get_bus_freq(unsigned long dummy); int get_serial_clock(void); +/* + * If we have CONFIG_DYNAMIC_DDR_CLK_FREQ then there will be an + * implentation of get_board_ddr_clk() somewhere. Otherwise we have + * a static value to use now. + */ +#ifdef CONFIG_DYNAMIC_DDR_CLK_FREQ +unsigned long get_board_ddr_clk(void); +#else +#define get_board_ddr_clk() CONFIG_DDR_CLK_FREQ +#endif + #endif diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h index a222ec93b1e..9c1cc2f14cf 100644 --- a/include/configs/P1010RDB.h +++ b/include/configs/P1010RDB.h @@ -153,7 +153,6 @@ #define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */ #endif -#define CONFIG_DDR_CLK_FREQ 66666666 /* DDRCLK on P1010 RDB */ #define CONFIG_SYS_CLK_FREQ 66666666 /* SYSCLK for P1010 RDB */ #define CONFIG_HWCONFIG diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h index 95aafe1a322..8dc9f9e2ecb 100644 --- a/include/configs/T102xRDB.h +++ b/include/configs/T102xRDB.h @@ -134,11 +134,9 @@ #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_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 2b6238e0899..a9b38118977 100644 --- a/include/configs/T104xRDB.h +++ b/include/configs/T104xRDB.h @@ -164,7 +164,6 @@ $(SRCTREE)/board/freescale/t104xrdb/t1042d4_sd_rcw.cfg #endif #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 66666666 /* * These can be toggled for performance analysis, otherwise use default. diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h index cd729cf0c79..714bc3cc3fa 100644 --- a/include/configs/T208xQDS.h +++ b/include/configs/T208xQDS.h @@ -109,11 +109,9 @@ #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif #define CONFIG_SYS_CLK_FREQ get_board_sys_clk() -#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk() /* * Config the L3 Cache as L3 SRAM diff --git a/include/configs/T208xRDB.h b/include/configs/T208xRDB.h index be8ead70da5..7309581b380 100644 --- a/include/configs/T208xRDB.h +++ b/include/configs/T208xRDB.h @@ -98,11 +98,9 @@ #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif #define CONFIG_SYS_CLK_FREQ 66660000 -#define CONFIG_DDR_CLK_FREQ 133330000 /* * Config the L3 Cache as L3 SRAM diff --git a/include/configs/T4240RDB.h b/include/configs/T4240RDB.h index 839a7c50f89..0a0214ae474 100644 --- a/include/configs/T4240RDB.h +++ b/include/configs/T4240RDB.h @@ -242,11 +242,9 @@ "bootm 0x01000000 - 0x00f00000" #define CONFIG_SYS_CLK_FREQ 66666666 -#define CONFIG_DDR_CLK_FREQ 133333333 #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif /* diff --git a/include/configs/UCP1020.h b/include/configs/UCP1020.h index a3caee4254b..51083569a88 100644 --- a/include/configs/UCP1020.h +++ b/include/configs/UCP1020.h @@ -149,7 +149,6 @@ #define CONFIG_LBA48 #define CONFIG_SYS_CLK_FREQ 66666666 -#define CONFIG_DDR_CLK_FREQ 66666666 #define CONFIG_HWCONFIG diff --git a/include/configs/km/pg-wcom-ls102xa.h b/include/configs/km/pg-wcom-ls102xa.h index 23494657a44..69fac2bafdf 100644 --- a/include/configs/km/pg-wcom-ls102xa.h +++ b/include/configs/km/pg-wcom-ls102xa.h @@ -26,12 +26,6 @@ CONFIG_KM_RESERVED_PRAM) >> 10) #define CONFIG_SYS_CLK_FREQ 66666666 -/* - * Take into account default implementation where DDR_FDBK_MULTI is consider as - * configured for DDR_PLL = 2*MEM_PLL_RAT. - * In our case DDR_FDBK_MULTI is 2, means DDR_PLL = MEM_PLL_RAT. - */ -#define CONFIG_DDR_CLK_FREQ (100000000 >> 1) #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 90e7ba8327b..087b6cc04f1 100644 --- a/include/configs/kmcent2.h +++ b/include/configs/kmcent2.h @@ -177,7 +177,6 @@ #define CONFIG_VERY_BIG_RAM #define CONFIG_SYS_DDR_SDRAM_BASE 0x00000000 #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE -#define CONFIG_DDR_CLK_FREQ 66666666 #define CONFIG_DIMM_SLOTS_PER_CTLR 1 #define CONFIG_CHIP_SELECTS_PER_CTRL (2 * CONFIG_DIMM_SLOTS_PER_CTLR) diff --git a/include/configs/kontron_sl28.h b/include/configs/kontron_sl28.h index bfb4e67c8f4..30633fa796a 100644 --- a/include/configs/kontron_sl28.h +++ b/include/configs/kontron_sl28.h @@ -53,7 +53,6 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4) /* ethernet */ diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h index 6c1cedf2613..b88c16f95ea 100644 --- a/include/configs/ls1021aiot.h +++ b/include/configs/ls1021aiot.h @@ -20,7 +20,6 @@ #define CONFIG_SYS_INIT_RAM_SIZE OCRAM_SIZE #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 /* * DDR: 800 MHz ( 1600 MT/s data rate ) diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h index a71c3e8b586..e2e45b0cab8 100644 --- a/include/configs/ls1021aqds.h +++ b/include/configs/ls1021aqds.h @@ -25,16 +25,13 @@ #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #define CONFIG_QIXIS_I2C_ACCESS #else #define CONFIG_SYS_CLK_FREQ get_board_sys_clk() -#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk() #endif #ifdef CONFIG_RAMBOOT_PBL diff --git a/include/configs/ls1021atsn.h b/include/configs/ls1021atsn.h index 7ce808bc53f..490e86f6488 100644 --- a/include/configs/ls1021atsn.h +++ b/include/configs/ls1021atsn.h @@ -22,7 +22,6 @@ #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #define DDR_SDRAM_CFG 0x470c0008 #define DDR_CS0_BNDS 0x008000bf diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h index 379a143c103..56f30ff4b31 100644 --- a/include/configs/ls1021atwr.h +++ b/include/configs/ls1021atwr.h @@ -23,7 +23,6 @@ #define CONFIG_SYS_INIT_RAM_SIZE OCRAM_SIZE #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #define DDR_SDRAM_CFG 0x470c0008 #define DDR_CS0_BNDS 0x008000bf diff --git a/include/configs/ls1028aqds.h b/include/configs/ls1028aqds.h index 9ae37b96ceb..fe20363e690 100644 --- a/include/configs/ls1028aqds.h +++ b/include/configs/ls1028aqds.h @@ -9,7 +9,6 @@ #include "ls1028a_common.h" #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4) /* DDR */ diff --git a/include/configs/ls1028ardb.h b/include/configs/ls1028ardb.h index 1a80cb945df..348db1e2f8c 100644 --- a/include/configs/ls1028ardb.h +++ b/include/configs/ls1028ardb.h @@ -9,7 +9,6 @@ #include "ls1028a_common.h" #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4) #define CONFIG_SYS_RTC_BUS_NUM 0 diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h index 2677090249c..d0bb6e552c7 100644 --- a/include/configs/ls1043aqds.h +++ b/include/configs/ls1043aqds.h @@ -10,11 +10,9 @@ #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif #define CONFIG_SYS_CLK_FREQ get_board_sys_clk() -#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk() #define CONFIG_SKIP_LOWLEVEL_INIT diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h index 985b1cbe09c..577fe296049 100644 --- a/include/configs/ls1043ardb.h +++ b/include/configs/ls1043ardb.h @@ -9,7 +9,6 @@ #include "ls1043a_common.h" #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #define CONFIG_LAYERSCAPE_NS_ACCESS diff --git a/include/configs/ls1046afrwy.h b/include/configs/ls1046afrwy.h index d97555c430c..7da08605f5a 100644 --- a/include/configs/ls1046afrwy.h +++ b/include/configs/ls1046afrwy.h @@ -9,7 +9,6 @@ #include "ls1046a_common.h" #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #define CONFIG_LAYERSCAPE_NS_ACCESS diff --git a/include/configs/ls1046aqds.h b/include/configs/ls1046aqds.h index b7e6ba890f8..f3e4f6a4c56 100644 --- a/include/configs/ls1046aqds.h +++ b/include/configs/ls1046aqds.h @@ -10,11 +10,9 @@ #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif #define CONFIG_SYS_CLK_FREQ get_board_sys_clk() -#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk() #define CONFIG_SKIP_LOWLEVEL_INIT diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h index c90dc209ccb..4a657533ef8 100644 --- a/include/configs/ls1046ardb.h +++ b/include/configs/ls1046ardb.h @@ -10,7 +10,6 @@ #include "ls1046a_common.h" #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #define CONFIG_LAYERSCAPE_NS_ACCESS diff --git a/include/configs/ls1088aqds.h b/include/configs/ls1088aqds.h index f556fb387f0..d9d7af24e78 100644 --- a/include/configs/ls1088aqds.h +++ b/include/configs/ls1088aqds.h @@ -11,7 +11,6 @@ #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif #ifdef CONFIG_TFABOOT @@ -23,11 +22,9 @@ unsigned long get_board_ddr_clk(void); #define SYS_NO_FLASH #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_CLK_FREQ 100000000 #else #define CONFIG_QIXIS_I2C_ACCESS #define CONFIG_SYS_CLK_FREQ get_board_sys_clk() -#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk() #endif #define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ/4) diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h index fcafea13dc9..21416da48ed 100644 --- a/include/configs/ls1088ardb.h +++ b/include/configs/ls1088ardb.h @@ -17,7 +17,6 @@ #endif #define CONFIG_SYS_CLK_FREQ 100000000 -#define CONFIG_DDR_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 dc5f347e510..f0c794d0fe0 100644 --- a/include/configs/ls2080aqds.h +++ b/include/configs/ls2080aqds.h @@ -11,7 +11,6 @@ #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif #ifdef CONFIG_FSL_QSPI @@ -21,7 +20,6 @@ unsigned long get_board_ddr_clk(void); #define CONFIG_SYS_I2C_FPGA_ADDR 0x66 #define CONFIG_SYS_CLK_FREQ get_board_sys_clk() -#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk() #define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ/4) #define CONFIG_DDR_SPD diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h index 6362b7f8f0b..27843c1ea4a 100644 --- a/include/configs/ls2080ardb.h +++ b/include/configs/ls2080ardb.h @@ -36,7 +36,6 @@ unsigned long get_board_sys_clk(void); #endif #define CONFIG_SYS_CLK_FREQ get_board_sys_clk() -#define CONFIG_DDR_CLK_FREQ 133333333 #define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ/4) #define CONFIG_DDR_SPD diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h index 3cdd627003f..a060a1f9ddd 100644 --- a/include/configs/lx2160a_common.h +++ b/include/configs/lx2160a_common.h @@ -151,11 +151,9 @@ #ifndef __ASSEMBLY__ unsigned long get_board_sys_clk(void); -unsigned long get_board_ddr_clk(void); #endif #define CONFIG_SYS_CLK_FREQ get_board_sys_clk() -#define CONFIG_DDR_CLK_FREQ get_board_ddr_clk() #define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4) #define CONFIG_HWCONFIG diff --git a/include/configs/p1_p2_rdb_pc.h b/include/configs/p1_p2_rdb_pc.h index c1571c2235e..0a4f8a3ef77 100644 --- a/include/configs/p1_p2_rdb_pc.h +++ b/include/configs/p1_p2_rdb_pc.h @@ -157,7 +157,6 @@ #else #define CONFIG_SYS_CLK_FREQ 66666666 #endif -#define CONFIG_DDR_CLK_FREQ 66666666 #define CONFIG_HWCONFIG /* |
