Skip to content

Commit

Permalink
cadence_ttc: Fix 'clear on read' behavior
Browse files Browse the repository at this point in the history
A missing call to qemu_set_irq() when reading the IRQ register
required SW to write to the IRQ register to acknowledge an
interrupt. With this patch the behavior is fixed:
 - Reading the interrupt register clears it and updates the timers
   interrupt status
 - Writes to the interrupt register are ignored

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
sorenb-xlnx authored and pm215 committed Oct 12, 2012
1 parent b4ae3cf commit 884285b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/cadence_ttc.c
Expand Up @@ -274,6 +274,7 @@ static uint32_t cadence_ttc_read_imp(void *opaque, target_phys_addr_t offset)
/* cleared after read */
value = s->reg_intr;
s->reg_intr = 0;
cadence_timer_update(s);
return value;

case 0x60: /* interrupt enable */
Expand Down Expand Up @@ -355,7 +356,6 @@ static void cadence_ttc_write(void *opaque, target_phys_addr_t offset,
case 0x54: /* interrupt register */
case 0x58:
case 0x5c:
s->reg_intr &= (~value & 0xfff);
break;

case 0x60: /* interrupt enable */
Expand Down

0 comments on commit 884285b

Please sign in to comment.