diff options
-rw-r--r-- | arch/arm/cpu/armv7/socfpga/sdram.c | 34 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-socfpga/sdram.h | 9 |
2 files changed, 42 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/socfpga/sdram.c b/arch/arm/cpu/armv7/socfpga/sdram.c index a8f8f019b3..8f1419b15b 100644 --- a/arch/arm/cpu/armv7/socfpga/sdram.c +++ b/arch/arm/cpu/armv7/socfpga/sdram.c @@ -1293,7 +1293,39 @@ defined(CONFIG_HPS_SDR_CTRLCFG_DRAMODT_WRITE) } #endif - /***** FPGAPORTRST *****/ + /***** EXTRATIME1 *****/ +#if defined(CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR) || \ +defined(CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC) || \ +defined(CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_CHIP) + debug("Configuring EXTRATIME1\n"); + register_offset = SDR_CTRLGRP_EXTRATIME1_ADDRESS; + /* Read original register value */ + reg_value = readl(SOCFPGA_SDR_ADDRESS + register_offset); +#ifdef CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR + reg_value = sdram_write_register_field(reg_value, + CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR, + SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_LSB, + SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_MASK); +#endif +#ifdef CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC + reg_value = sdram_write_register_field(reg_value, + CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_BC, + SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_BC_LSB, + SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_BC_MASK); +#endif +#ifdef CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_CHIP + reg_value = sdram_write_register_field(reg_value, + CONFIG_HPS_SDR_CTRLCFG_EXTRATIME1_CFG_EXTRA_CTL_CLK_RD_TO_WR_DIFF_CHIP, + SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_DIFF_LSB, + SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_DIFF_MASK); +#endif + if (sdram_write_verify(register_offset, reg_value) == 1) { + status = 1; + COMPARE_FAIL_ACTION + } +#endif + +/***** FPGAPORTRST *****/ #if defined(CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST_READ_PORT_USED) #ifdef DEBUG debug("Configuring FPGAPORTRST\n"); diff --git a/arch/arm/include/asm/arch-socfpga/sdram.h b/arch/arm/include/asm/arch-socfpga/sdram.h index ca69ba01e9..7067f59db4 100644 --- a/arch/arm/include/asm/arch-socfpga/sdram.h +++ b/arch/arm/include/asm/arch-socfpga/sdram.h @@ -73,6 +73,8 @@ void sdram_ecc_init(void); #define SDR_CTRLGRP_LOWPWRTIMING_ADDRESS 0x5014 /* Register: sdr.ctrlgrp.dramodt */ #define SDR_CTRLGRP_DRAMODT_ADDRESS 0x5018 +/* Register: sdr.ctrlgrp.extratime1 */ +#define SDR_CTRLGRP_EXTRATIME1_ADDRESS 0x501C /* Register: sdr.ctrlgrp.dramaddrw */ #define SDR_CTRLGRP_DRAMADDRW_ADDRESS 0x502c /* Register: sdr.ctrlgrp.dramifwidth */ @@ -449,6 +451,13 @@ SDR_CTRLGRP_MPTHRESHOLDRST_MPTHRESHOLDRST_2_THRESHOLDRSTCYCLES_79_64_MASK \ /* Field instance: sdr::ctrlgrp::dramsts */ #define SDR_CTRLGRP_DRAMSTS_DBEERR_MASK 0x00000008 #define SDR_CTRLGRP_DRAMSTS_SBEERR_MASK 0x00000004 +/* Register template: sdr::ctrlgrp::extratime1 */ +#define SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_LSB 20 +#define SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_MASK 0x00f00000 +#define SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_BC_LSB 24 +#define SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_BC_MASK 0x0f000000 +#define SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_DIFF_LSB 28 +#define SDR_CTRLGRP_EXTRATIME1_RD_TO_WR_DIFF_MASK 0xf0000000 /* To determine the duration of SDRAM test */ /* quick test which run around 5s */ |