ram: rk3399: Clear PI_175 interrupts in data training
authorJagan Teki <jagan@amarulasolutions.com>
Mon, 15 Jul 2019 18:28:40 +0000 (23:58 +0530)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 19 Jul 2019 03:11:09 +0000 (11:11 +0800)
Clear the PI_175 interrupts before processing actual
data training in all relevant calls.

This would help to clear interrupt from previous training.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: YouMin Chen <cym@rock-chips.com>
Reviewed-by: Kever Yang <Kever.yang@rock-chips.com>
drivers/ram/rockchip/sdram_rk3399.c

index e9c0fdf2d46bb00720083e6809d51904831b1041..fe26144f27dcadcba88a7fc05256b426a8d58f79 100644 (file)
@@ -627,6 +627,9 @@ static int data_training_ca(const struct chan_info *chan, u32 channel,
        u32 obs_0, obs_1, obs_2, obs_err = 0;
        u32 rank = params->ch[channel].cap_info.rank;
 
+       /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+       writel(0x00003f7c, (&denali_pi[175]));
+
        for (i = 0; i < rank; i++) {
                select_per_cs_training_index(chan, i);
 
@@ -681,6 +684,9 @@ static int data_training_wl(const struct chan_info *chan, u32 channel,
        u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0;
        u32 rank = params->ch[channel].cap_info.rank;
 
+       /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+       writel(0x00003f7c, (&denali_pi[175]));
+
        for (i = 0; i < rank; i++) {
                select_per_cs_training_index(chan, i);
 
@@ -740,6 +746,9 @@ static int data_training_rg(const struct chan_info *chan, u32 channel,
        u32 obs_0, obs_1, obs_2, obs_3, obs_err = 0;
        u32 rank = params->ch[channel].cap_info.rank;
 
+       /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+       writel(0x00003f7c, (&denali_pi[175]));
+
        for (i = 0; i < rank; i++) {
                select_per_cs_training_index(chan, i);
 
@@ -799,6 +808,9 @@ static int data_training_rl(const struct chan_info *chan, u32 channel,
        u32 i, tmp;
        u32 rank = params->ch[channel].cap_info.rank;
 
+       /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+       writel(0x00003f7c, (&denali_pi[175]));
+
        for (i = 0; i < rank; i++) {
                select_per_cs_training_index(chan, i);
 
@@ -844,6 +856,9 @@ static int data_training_wdql(const struct chan_info *chan, u32 channel,
        u32 i, tmp;
        u32 rank = params->ch[channel].cap_info.rank;
 
+       /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */
+       writel(0x00003f7c, (&denali_pi[175]));
+
        for (i = 0; i < rank; i++) {
                select_per_cs_training_index(chan, i);