Fix interval interrupt of cadence ttc when timer is in decrement mode
The interval interrupt is not set if the timer is in decrement mode. This is because x >=0 and x < interval after leaving the while-loop. Signed-off-by: Johannes Schlatow <schlatow@ida.ing.tu-bs.de> Message-id: 20150630135821.51f3b4fd@johanness-latitude Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
		
							parent
							
								
									2a6332d968
								
							
						
					
					
						commit
						a7ffaf5c96
					
				| 
						 | 
					@ -208,15 +208,14 @@ static void cadence_timer_sync(CadenceTimerState *s)
 | 
				
			||||||
            s->reg_intr |= (2 << i);
 | 
					            s->reg_intr |= (2 << i);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    if ((x < 0) || (x >= interval)) {
 | 
				
			||||||
 | 
					        s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
 | 
				
			||||||
 | 
					            COUNTER_INTR_IV : COUNTER_INTR_OV;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    while (x < 0) {
 | 
					    while (x < 0) {
 | 
				
			||||||
        x += interval;
 | 
					        x += interval;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    s->reg_value = (uint32_t)(x % interval);
 | 
					    s->reg_value = (uint32_t)(x % interval);
 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (s->reg_value != x) {
 | 
					 | 
				
			||||||
        s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
 | 
					 | 
				
			||||||
            COUNTER_INTR_IV : COUNTER_INTR_OV;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    cadence_timer_update(s);
 | 
					    cadence_timer_update(s);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue