@@ -25,6 +25,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
+#include "qemu/legacy_binary_info.h"
#include "qapi/error.h"
#include "cpu.h"
#include "hw/sysbus.h"
@@ -71,13 +72,12 @@ petalogix_s3adsp1800_init(MachineState *machine)
MemoryRegion *phys_ram = g_new(MemoryRegion, 1);
qemu_irq irq[32];
MemoryRegion *sysmem = get_system_memory();
- EndianMode endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG
- : ENDIAN_MODE_LITTLE;
+ EndianMode endianness = legacy_binary_endianness();
cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort);
object_property_set_bool(OBJECT(cpu), "little-endian",
- !TARGET_BIG_ENDIAN, &error_abort);
+ endianness == ENDIAN_MODE_LITTLE, &error_abort);
qdev_realize(DEVICE(cpu), NULL, &error_abort);
/* Attach emulated BRAM through the LMB. */
@@ -135,7 +135,8 @@ petalogix_s3adsp1800_init(MachineState *machine)
create_unimplemented_device("xps_gpio", GPIO_BASEADDR, 0x10000);
- microblaze_load_kernel(cpu, !TARGET_BIG_ENDIAN, ddr_base, ram_size,
+ microblaze_load_kernel(cpu, endianness == ENDIAN_MODE_LITTLE,
+ ddr_base, ram_size,
machine->initrd_filename,
BINARY_DEVICE_TREE_FILE,
NULL);
@@ -145,7 +146,9 @@ static void petalogix_s3adsp1800_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
- mc->desc = "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800";
+ mc->desc = legacy_binary_endianness() == ENDIAN_MODE_LITTLE
+ ? "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800 (little endian)"
+ : "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800 (big endian)";
mc->init = petalogix_s3adsp1800_init;
mc->is_default = true;
}
For legacy binaries, legacy_binary_is_big_endian() is equivalent of the compile time TARGET_BIG_ENDIAN definition. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)