Commit 3d9f7264 authored by Hadi Asyrafi's avatar Hadi Asyrafi
Browse files

intel: Fix memory calibration



Increase calibration delay to cater for HPS 1st mode and
reduce clear emif delay which takes too long
Signed-off-by: default avatarHadi Asyrafi <muhammad.hadi.asyrafi.abdul.halim@intel.com>
Change-Id: I1a50a5d8a6518ba085d853cb636efa07326552b4
parent caa0c85d
...@@ -20,9 +20,8 @@ ...@@ -20,9 +20,8 @@
#define PRE_CALIBRATION_DELAY 1 #define PRE_CALIBRATION_DELAY 1
#define POST_CALIBRATION_DELAY 1 #define POST_CALIBRATION_DELAY 1
#define TIMEOUT_EMIF_CALIBRATION 1000 #define TIMEOUT_EMIF_CALIBRATION 1000
#define CLEAR_EMIF_DELAY 50000 #define CLEAR_EMIF_DELAY 1000
#define CLEAR_EMIF_TIMEOUT 0x100000 #define CLEAR_EMIF_TIMEOUT 1000
#define TIMEOUT_INT_RESP 10000
#define DDR_CONFIG(A, B, C, R) (((A) << 24) | ((B) << 16) | ((C) << 8) | (R)) #define DDR_CONFIG(A, B, C, R) (((A) << 24) | ((B) << 16) | ((C) << 8) | (R))
#define DDR_CONFIG_ELEMENTS (sizeof(ddr_config)/sizeof(uint32_t)) #define DDR_CONFIG_ELEMENTS (sizeof(ddr_config)/sizeof(uint32_t))
...@@ -125,7 +124,7 @@ static int mem_calibration(void) ...@@ -125,7 +124,7 @@ static int mem_calibration(void)
data = mmio_read_32(AGX_MPFE_HMC_ADP_DDRCALSTAT); data = mmio_read_32(AGX_MPFE_HMC_ADP_DDRCALSTAT);
if (AGX_MPFE_HMC_ADP_DDRCALSTAT_CAL(data) == 1) if (AGX_MPFE_HMC_ADP_DDRCALSTAT_CAL(data) == 1)
break; break;
mdelay(1); udelay(500);
} while (++timeout < TIMEOUT_EMIF_CALIBRATION); } while (++timeout < TIMEOUT_EMIF_CALIBRATION);
if (AGX_MPFE_HMC_ADP_DDRCALSTAT_CAL(data) == 0) { if (AGX_MPFE_HMC_ADP_DDRCALSTAT_CAL(data) == 0) {
......
...@@ -22,10 +22,9 @@ ...@@ -22,10 +22,9 @@
#define MAX_MEM_CAL_RETRY 3 #define MAX_MEM_CAL_RETRY 3
#define PRE_CALIBRATION_DELAY 1 #define PRE_CALIBRATION_DELAY 1
#define POST_CALIBRATION_DELAY 1 #define POST_CALIBRATION_DELAY 1
#define TIMEOUT_EMIF_CALIBRATION 100 #define TIMEOUT_EMIF_CALIBRATION 1000
#define CLEAR_EMIF_DELAY 50000 #define CLEAR_EMIF_DELAY 1000
#define CLEAR_EMIF_TIMEOUT 0x100000 #define CLEAR_EMIF_TIMEOUT 1000
#define TIMEOUT_INT_RESP 10000
#define DDR_CONFIG(A, B, C, R) (((A) << 24) | ((B) << 16) | ((C) << 8) | (R)) #define DDR_CONFIG(A, B, C, R) (((A) << 24) | ((B) << 16) | ((C) << 8) | (R))
#define DDR_CONFIG_ELEMENTS (sizeof(ddr_config)/sizeof(uint32_t)) #define DDR_CONFIG_ELEMENTS (sizeof(ddr_config)/sizeof(uint32_t))
...@@ -128,7 +127,7 @@ static int mem_calibration(void) ...@@ -128,7 +127,7 @@ static int mem_calibration(void)
data = mmio_read_32(S10_MPFE_HMC_ADP_DDRCALSTAT); data = mmio_read_32(S10_MPFE_HMC_ADP_DDRCALSTAT);
if (S10_MPFE_HMC_ADP_DDRCALSTAT_CAL(data) == 1) if (S10_MPFE_HMC_ADP_DDRCALSTAT_CAL(data) == 1)
break; break;
udelay(1); udelay(500);
} while (++timeout < TIMEOUT_EMIF_CALIBRATION); } while (++timeout < TIMEOUT_EMIF_CALIBRATION);
if (S10_MPFE_HMC_ADP_DDRCALSTAT_CAL(data) == 0) { if (S10_MPFE_HMC_ADP_DDRCALSTAT_CAL(data) == 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment