target-ppc: Fix openpic timer read register offset
commita09f7443bcccd1703adf7c2954af695629c784a5
authorAaron Larson <alarson@ddci.com>
Fri, 2 Jun 2017 11:32:59 +0000 (2 04:32 -0700)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 5 Jun 2017 22:53:24 +0000 (6 08:53 +1000)
tree93603cb5cccb98bbc559b4c8561c8d3180873fba
parent0b55aa91c976b30b527c123fb66d25f5db43d083
target-ppc: Fix openpic timer read register offset

openpic_tmr_read() is incorrectly computing register offset of the
TCCR, TBCR, TVPR, and TDR registers when accessing the open pic timer
registers.  Specifically the offset of timer registers for
openpic_tmr_read() is not accounting for the timer frequency reporting
register (TFFR) which is the first register in the "tmr" memory
region.

openpic_tmr_write() *is* correctly computing the offset by adding
0x10f0 to the address prior to computing the register index.  This
patch instead subtracts 0x10 in both the read and write routines and
eliminates some other gratuitous differences between the functions.

Signed-off-by: Aaron Larson <alarson@ddci.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/openpic.c