
-----Original Message----- From: U-Boot [mailto:u-boot-bounces@lists.denx.de] On Behalf Of York Sun Sent: Thursday, September 22, 2016 4:21 AM To: trini@konsulko.com Cc: u-boot@lists.denx.de Subject: [U-Boot] [RFC Patch 2/5] driver: ddr: fsl_mmdc: Pass board parameters through data structure
Instead of using multiple macros, a data structure is used to pass board-specific parameters to MMDC DDR driver.
Signed-off-by: York Sun york.sun@nxp.com CC: Shengzhou Liu Shengzhou.Liu@nxp.com
I doubt if it is one of the reason for root-cause. May not be part of this patch set
board/freescale/ls1012afrdm/ls1012afrdm.c | 18 ++++++++++++++- board/freescale/ls1012aqds/ls1012aqds.c | 18 ++++++++++++++- board/freescale/ls1012ardb/ls1012ardb.c | 18 ++++++++++++++- drivers/ddr/fsl/fsl_mmdc.c | 38 +++++++++++++++---------------- include/configs/ls1012afrdm.h | 16 ------------- include/configs/ls1012aqds.h | 16 ------------- include/configs/ls1012ardb.h | 15 ------------ include/fsl_mmdc.h | 21 +++++++++++++---- 8 files changed, 87 insertions(+), 73 deletions(-)
diff --git a/board/freescale/ls1012afrdm/ls1012afrdm.c b/board/freescale/ls1012afrdm/ls1012afrdm.c index d644e94..b03bdb8 100644 --- a/board/freescale/ls1012afrdm/ls1012afrdm.c +++ b/board/freescale/ls1012afrdm/ls1012afrdm.c @@ -26,7 +26,23 @@ int checkboard(void)
int dram_init(void) {
- mmdc_init();
- static const struct fsl_mmdc_info mparam = {
0x04180000, /* mdctl */
0x00030035, /* mdpdc */
0x12554000, /* mdotc */
0xbabf7954, /* mdcfg0 */
0xdb328f64, /* mdcfg1 */
0x01ff00db, /* mdcfg2 */
0x00001680, /* mdmisc */
0x0f3c8000, /* mdref */
0x00002000, /* mdrwd */
0x00bf1023, /* mdor */
0x0000003f, /* mdasp */
0x0000022a, /* mpodtctrl */
0xa1390003, /* mpzqhwctrl */
- };
- mmdc_init(&mparam);
Why cannot #define directly be used in fsl_mmdc.c.
If objective is to remove #define from board file, they even be required to avoid magic numbers.
-prabhakar