diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-03-04 11:46:32 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-03-04 11:46:32 +0000 |
commit | 3c0f12df65da872d5fbccae469f2cb21ed1c03b7 (patch) | |
tree | da8e1ea0ee497fea96ed2bf52ef5ca93285bc9f4 /hw/misc/bcm2835_property.c | |
parent | 2d3b7c0164e1b9287304bc70dd6ed071ba3e8dfc (diff) | |
parent | ba63cf47a93041137a94e86b7d0cd87fc896949b (diff) |
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160304' into staging
target-arm queue:
* Correct handling of writes to CPSR from gdbstub in user mode
* virt: lift maximum RAM limit to 255GB
* sdhci: implement reset
* virt: if booting in Secure mode, provide secure-only RAM, make first
flash device secure-only, and assume the EL3 boot rom will handle PSCI
* bcm2835: use explicit endianness accessors rather than ldl/stl_phys
* support big-endian in system mode for ARM
* implement SETEND instruction
* arm_gic: implement the GICv2 GICC_DIR register
* fix SRS bug: only trap from S-EL1 to EL3 if specified mode is Mon
# gpg: Signature made Fri 04 Mar 2016 11:38:53 GMT using RSA key ID 14360CDE
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
# gpg: aka "Peter Maydell <pmaydell@gmail.com>"
# gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>"
* remotes/pmaydell/tags/pull-target-arm-20160304: (30 commits)
target-arm: Only trap SRS from S-EL1 if specified mode is MON
hw/intc/arm_gic.c: Implement GICv2 GICC_DIR
arm: boot: Support big-endian elfs
loader: Add data swap option to load-elf
loader: load_elf(): Add doc comment
loader: add API to load elf header
target-arm: implement BE32 mode in system emulation
target-arm: implement setend
target-arm: introduce tbflag for endianness
target-arm: a64: Add endianness support
target-arm: introduce disas flag for endianness
target-arm: pass DisasContext to gen_aa32_ld*/st*
target-arm: implement SCTLR.EE
linux-user: arm: handle CPSR.E correctly in strex emulation
linux-user: arm: set CPSR.E/SCTLR.E0E correctly for BE mode
arm: cpu: handle BE32 user-mode as BE
target-arm: cpu: Move cpu_is_big_endian to header
target-arm: implement SCTLR.B, drop bswap_code
linux-user: arm: pass env to get_user_code_*
linux-user: arm: fix coding style for some linux-user signal functions
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/misc/bcm2835_property.c')
-rw-r--r-- | hw/misc/bcm2835_property.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 581922abd7..41fbbe3e7f 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -22,20 +22,20 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) s->addr = value; - tot_len = ldl_phys(&s->dma_as, value); + tot_len = ldl_le_phys(&s->dma_as, value); /* @(addr + 4) : Buffer response code */ value = s->addr + 8; while (value + 8 <= s->addr + tot_len) { - tag = ldl_phys(&s->dma_as, value); - bufsize = ldl_phys(&s->dma_as, value + 4); + tag = ldl_le_phys(&s->dma_as, value); + bufsize = ldl_le_phys(&s->dma_as, value + 4); /* @(value + 8) : Request/response indicator */ resplen = 0; switch (tag) { case 0x00000000: /* End tag */ break; case 0x00000001: /* Get firmware revision */ - stl_phys(&s->dma_as, value + 12, 346337); + stl_le_phys(&s->dma_as, value + 12, 346337); resplen = 4; break; case 0x00010001: /* Get board model */ @@ -44,7 +44,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) resplen = 4; break; case 0x00010002: /* Get board revision */ - stl_phys(&s->dma_as, value + 12, s->board_rev); + stl_le_phys(&s->dma_as, value + 12, s->board_rev); resplen = 4; break; case 0x00010003: /* Get board MAC address */ @@ -58,24 +58,24 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) break; case 0x00010005: /* Get ARM memory */ /* base */ - stl_phys(&s->dma_as, value + 12, 0); + stl_le_phys(&s->dma_as, value + 12, 0); /* size */ - stl_phys(&s->dma_as, value + 16, s->ram_size); + stl_le_phys(&s->dma_as, value + 16, s->ram_size); resplen = 8; break; case 0x00028001: /* Set power state */ /* Assume that whatever device they asked for exists, * and we'll just claim we set it to the desired state */ - tmp = ldl_phys(&s->dma_as, value + 16); - stl_phys(&s->dma_as, value + 16, (tmp & 1)); + tmp = ldl_le_phys(&s->dma_as, value + 16); + stl_le_phys(&s->dma_as, value + 16, (tmp & 1)); resplen = 8; break; /* Clocks */ case 0x00030001: /* Get clock state */ - stl_phys(&s->dma_as, value + 16, 0x1); + stl_le_phys(&s->dma_as, value + 16, 0x1); resplen = 8; break; @@ -88,15 +88,15 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) case 0x00030002: /* Get clock rate */ case 0x00030004: /* Get max clock rate */ case 0x00030007: /* Get min clock rate */ - switch (ldl_phys(&s->dma_as, value + 12)) { + switch (ldl_le_phys(&s->dma_as, value + 12)) { case 1: /* EMMC */ - stl_phys(&s->dma_as, value + 16, 50000000); + stl_le_phys(&s->dma_as, value + 16, 50000000); break; case 2: /* UART */ - stl_phys(&s->dma_as, value + 16, 3000000); + stl_le_phys(&s->dma_as, value + 16, 3000000); break; default: - stl_phys(&s->dma_as, value + 16, 700000000); + stl_le_phys(&s->dma_as, value + 16, 700000000); break; } resplen = 8; @@ -113,19 +113,19 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) /* Temperature */ case 0x00030006: /* Get temperature */ - stl_phys(&s->dma_as, value + 16, 25000); + stl_le_phys(&s->dma_as, value + 16, 25000); resplen = 8; break; case 0x0003000A: /* Get max temperature */ - stl_phys(&s->dma_as, value + 16, 99000); + stl_le_phys(&s->dma_as, value + 16, 99000); resplen = 8; break; case 0x00060001: /* Get DMA channels */ /* channels 2-5 */ - stl_phys(&s->dma_as, value + 12, 0x003C); + stl_le_phys(&s->dma_as, value + 12, 0x003C); resplen = 4; break; @@ -143,12 +143,12 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) break; } - stl_phys(&s->dma_as, value + 8, (1 << 31) | resplen); + stl_le_phys(&s->dma_as, value + 8, (1 << 31) | resplen); value += bufsize + 12; } /* Buffer response code */ - stl_phys(&s->dma_as, s->addr + 4, (1 << 31)); + stl_le_phys(&s->dma_as, s->addr + 4, (1 << 31)); } static uint64_t bcm2835_property_read(void *opaque, hwaddr offset, |