aboutsummaryrefslogtreecommitdiff
path: root/hw/misc/bcm2835_mbox.c
diff options
context:
space:
mode:
authorAndrew Baumann <Andrew.Baumann@microsoft.com>2016-03-04 11:30:18 +0000
committerPeter Maydell <peter.maydell@linaro.org>2016-03-04 11:30:18 +0000
commiteab713941ab83c6d30739e430357e817bf81dad1 (patch)
treecce06d5a80235bca5be00a8b8cbccc0ee8c80409 /hw/misc/bcm2835_mbox.c
parent4824a61a6dc1ce768be5c0a81f16224618104a63 (diff)
bcm2835_mbox/property: replace ldl_phys/stl_phys with endian-specific accesses
PMM pointed out that ldl_phys and stl_phys are dependent on the CPU's endianness, whereas device model code should be independent of it. This changes the relevant Raspberry Pi devices to explicitly call the little-endian variants. Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com> Message-id: 1456880233-22568-1-git-send-email-Andrew.Baumann@microsoft.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/misc/bcm2835_mbox.c')
-rw-r--r--hw/misc/bcm2835_mbox.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/misc/bcm2835_mbox.c b/hw/misc/bcm2835_mbox.c
index 500baba7c0..106585a7bf 100644
--- a/hw/misc/bcm2835_mbox.c
+++ b/hw/misc/bcm2835_mbox.c
@@ -98,7 +98,7 @@ static void bcm2835_mbox_update(BCM2835MboxState *s)
*/
for (n = 0; n < MBOX_CHAN_COUNT; n++) {
while (s->available[n] && !(s->mbox[0].status & ARM_MS_FULL)) {
- value = ldl_phys(&s->mbox_as, n << MBOX_AS_CHAN_SHIFT);
+ value = ldl_le_phys(&s->mbox_as, n << MBOX_AS_CHAN_SHIFT);
assert(value != MBOX_INVALID_DATA); /* Pending interrupt but no data */
mbox_push(&s->mbox[0], value);
}
@@ -207,12 +207,12 @@ static void bcm2835_mbox_write(void *opaque, hwaddr offset,
ch = value & 0xf;
if (ch < MBOX_CHAN_COUNT) {
childaddr = ch << MBOX_AS_CHAN_SHIFT;
- if (ldl_phys(&s->mbox_as, childaddr + MBOX_AS_PENDING)) {
+ if (ldl_le_phys(&s->mbox_as, childaddr + MBOX_AS_PENDING)) {
/* Child busy, push delayed. Push it in the arm->vc mbox */
mbox_push(&s->mbox[1], value);
} else {
/* Push it directly to the child device */
- stl_phys(&s->mbox_as, childaddr, value);
+ stl_le_phys(&s->mbox_as, childaddr, value);
}
} else {
/* Invalid channel number */