aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@petalogix.com>2011-02-21 12:30:27 +0100
committerEdgar E. Iglesias <edgar.iglesias@petalogix.com>2011-02-23 12:31:53 +0100
commit082e5be809cb8e9806d34abd57e22080bebb598f (patch)
tree7cdf3c77493a4d855787998fb65fa630a4a60d71
parentc9f7383c6e5423c1b5111d73346a8314b563f019 (diff)
pls3adsp1800: Base load_elf endianness on target endianness
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
-rw-r--r--hw/petalogix_s3adsp1800_mmu.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c
index 42de45963b..6ef4e65588 100644
--- a/hw/petalogix_s3adsp1800_mmu.c
+++ b/hw/petalogix_s3adsp1800_mmu.c
@@ -167,16 +167,21 @@ petalogix_s3adsp1800_init(ram_addr_t ram_size,
if (kernel_filename) {
uint64_t entry, low, high;
uint32_t base32;
+ int big_endian = 0;
+
+#ifdef TARGET_WORDS_BIGENDIAN
+ big_endian = 1;
+#endif
/* Boots a kernel elf binary. */
kernel_size = load_elf(kernel_filename, NULL, NULL,
&entry, &low, &high,
- 1, ELF_MACHINE, 0);
+ big_endian, ELF_MACHINE, 0);
base32 = entry;
if (base32 == 0xc0000000) {
kernel_size = load_elf(kernel_filename, translate_kernel_address,
NULL, &entry, NULL, NULL,
- 1, ELF_MACHINE, 0);
+ big_endian, ELF_MACHINE, 0);
}
/* Always boot into physical ram. */
boot_info.bootstrap_pc = ddr_base + (entry & 0x0fffffff);