hw/arm: Remove big-endian checks on machine code
cover hw/arm: Remove big-endian checks on machine code
We only build the little-endian softmmu configurations. Checking for big endian is pointless, remove the unused code.
Philippe Mathieu-Daudé (5):
hw/arm/gumstix: Simplify since the machines are little-endian only hw/arm/mainstone: Simplify since the machines are little-endian only hw/arm/omap_sx1: Simplify since the machines are little-endian only hw/arm/z2: Simplify since the machines are little-endian only hw/arm/musicpal: Simplify since the machines are little-endian only
hw/arm/gumstix.c | 16 ++-------------- hw/arm/mainstone.c | 8 +------- hw/arm/musicpal.c | 10 ---------- hw/arm/omap_sx1.c | 11 ++--------- hw/arm/z2.c | 8 +------- 5 files changed, 6 insertions(+), 47 deletions(-)
Signature · 1 line
2.21.1
PATCH 1/5 hw/arm/gumstix: Simplify since the machines are little-endian only
From: Philippe Mathieu-Daudé <[email protected]>
As the Connex and Verdex machines only boot in little-endian, we can simplify the code.
---
v2: Do not use target_words_bigendian(), arm-softmmu is only
little endian (Peter Maydell)
--- hw/arm/gumstix.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-)
hw/arm/gumstix.c +2 -14
@@ -51,7 +51,6 @@ static void connex_init(MachineState *machine) {PXA2xxState *cpu;DriveInfo *dinfo; -int be;MemoryRegion *address_space_mem =get_system_memory ();uint32_t connex_rom =0x01000000 ;
@@ -66,14 +65,9 @@ static void connex_init(MachineState *machine)exit (1 ); } -#ifdef TARGET_WORDS_BIGENDIAN - be =1 ; -#else - be =0 ; -#endif if (!pflash_cfi01_register (0x00000000 ,"connext.rom" , connex_rom, dinfo ?blk_by_legacy_dinfo (dinfo) :NULL , - sector_len,2 ,0 ,0 ,0 ,0 , be)) { + sector_len,2 ,0 ,0 ,0 ,0 ,0 )) {error_report ("Error registering flash memory" );exit (1 ); }
@@ -87,7 +81,6 @@ static void verdex_init(MachineState *machine) {PXA2xxState *cpu;DriveInfo *dinfo; -int be;MemoryRegion *address_space_mem =get_system_memory ();uint32_t verdex_rom =0x02000000 ;
@@ -102,14 +95,9 @@ static void verdex_init(MachineState *machine)exit (1 ); } -#ifdef TARGET_WORDS_BIGENDIAN - be =1 ; -#else - be =0 ; -#endif if (!pflash_cfi01_register (0x00000000 ,"verdex.rom" , verdex_rom, dinfo ?blk_by_legacy_dinfo (dinfo) :NULL , - sector_len,2 ,0 ,0 ,0 ,0 , be)) { + sector_len,2 ,0 ,0 ,0 ,0 ,0 )) {error_report ("Error registering flash memory" );exit (1 ); }
Signature · 1 line
2.21.1
PATCH 5/5 hw/arm/musicpal: Simplify since the machines are little-endian only
In reply to Philippe Mathieu-DaudéWe only build the little-endian softmmu configurations. Checking for big endian is pointless, remove the unused code.
--- hw/arm/musicpal.c | 10 ---------- 1 file changed, 10 deletions(-)
hw/arm/musicpal.c +0 -10
@@ -1645,22 +1645,12 @@ static void musicpal_init(MachineState *machine)* 0xFF800000 (if there is 8 MB flash). So remap flash access if the * image is smaller than 32 MB. */ -#ifdef TARGET_WORDS_BIGENDIAN -pflash_cfi02_register (0x100000000ULL -MP_FLASH_SIZE_MAX , -"musicpal.flash" , flash_size, - blk,0x10000 , -MP_FLASH_SIZE_MAX / flash_size, -2 ,0x00BF ,0x236D ,0x0000 ,0x0000 , -0x5555 ,0x2AAA ,1 ); -#else pflash_cfi02_register (0x100000000ULL -MP_FLASH_SIZE_MAX ,"musicpal.flash" , flash_size, blk,0x10000 ,MP_FLASH_SIZE_MAX / flash_size,2 ,0x00BF ,0x236D ,0x0000 ,0x0000 ,0x5555 ,0x2AAA ,0 ); -#endif - }sysbus_create_simple (TYPE_MV88W8618_FLASHCFG ,MP_FLASHCFG_BASE ,NULL );
Signature · 1 line
2.21.1
PATCH 2/5 hw/arm/mainstone: Simplify since the machines are little-endian only
In reply to Philippe Mathieu-DaudéWe only build the little-endian softmmu configurations. Checking for big endian is pointless, remove the unused code.
--- hw/arm/mainstone.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
hw/arm/mainstone.c +1 -7
@@ -119,7 +119,6 @@ static void mainstone_common_init(MemoryRegion *address_space_mem,DeviceState *mst_irq;DriveInfo *dinfo;int i; -int be;MemoryRegion *rom =g_new (MemoryRegion,1 );/* Setup CPU & memory */
@@ -130,11 +129,6 @@ static void mainstone_common_init(MemoryRegion *address_space_mem,memory_region_set_readonly (rom, true);memory_region_add_subregion (address_space_mem,0 , rom); -#ifdef TARGET_WORDS_BIGENDIAN - be =1 ; -#else - be =0 ; -#endif /* There are two 32MiB flash devices on the board */ for (i =0 ; i <2 ; i ++) { dinfo =drive_get (IF_PFLASH ,0 , i);
@@ -142,7 +136,7 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, i ? "mainstone.flash1" : "mainstone.flash0", MAINSTONE_FLASH, dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, - sector_len, 4, 0, 0, 0, 0, be)) { + sector_len, 4, 0, 0, 0, 0, 0)) {error_report ("Error registering flash memory" );exit (1 ); }
Signature · 1 line
2.21.1
PATCH 3/5 hw/arm/omap_sx1: Simplify since the machines are little-endian only
In reply to Philippe Mathieu-DaudéWe only build the little-endian softmmu configurations. Checking for big endian is pointless, remove the unused code.
--- hw/arm/omap_sx1.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
hw/arm/omap_sx1.c +2 -9
@@ -114,7 +114,6 @@ static void sx1_init(MachineState *machine, const int version)DriveInfo *dinfo;int fl_idx;uint32_t flash_size = flash0_size; -int be;if (machine->ram_size != mc->default_ram_size) {char *sz =size_to_str (mc->default_ram_size);
@@ -154,17 +153,11 @@ static void sx1_init(MachineState *machine, const int version) OMAP_CS2_BASE, &cs[3]); fl_idx =0 ; -#ifdef TARGET_WORDS_BIGENDIAN - be =1 ; -#else - be =0 ; -#endif -if ((dinfo =drive_get (IF_PFLASH ,0 , fl_idx)) !=NULL ) {if (!pflash_cfi01_register (OMAP_CS0_BASE ,"omap_sx1.flash0-1" , flash_size,blk_by_legacy_dinfo (dinfo), - sector_size,4 ,0 ,0 ,0 ,0 , be)) { + sector_size,4 ,0 ,0 ,0 ,0 ,0 )) {fprintf (stderr,"qemu: Error registering flash memory %d.\n" , fl_idx); }
@@ -187,7 +180,7 @@ static void sx1_init(MachineState *machine, const int version)if (!pflash_cfi01_register (OMAP_CS1_BASE ,"omap_sx1.flash1-1" , flash1_size,blk_by_legacy_dinfo (dinfo), - sector_size,4 ,0 ,0 ,0 ,0 , be)) { + sector_size,4 ,0 ,0 ,0 ,0 ,0 )) {fprintf (stderr,"qemu: Error registering flash memory %d.\n" , fl_idx); }
Signature · 1 line
2.21.1
PATCH 4/5 hw/arm/z2: Simplify since the machines are little-endian only
In reply to Philippe Mathieu-DaudéWe only build the little-endian softmmu configurations. Checking for big endian is pointless, remove the unused code.
--- hw/arm/z2.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
hw/arm/z2.c +1 -7
@@ -300,7 +300,6 @@ static void z2_init(MachineState *machine)uint32_t sector_len =0x10000 ;PXA2xxState *mpu;DriveInfo *dinfo; -int be;void *z2_lcd;I2CBus *bus;DeviceState *wm;
@@ -308,15 +307,10 @@ static void z2_init(MachineState *machine)/* Setup CPU & memory */ mpu =pxa270_init (address_space_mem, z2_binfo.ram_size, machine->cpu_type); -#ifdef TARGET_WORDS_BIGENDIAN - be =1 ; -#else - be =0 ; -#endif dinfo =drive_get (IF_PFLASH ,0 ,0 );if (!pflash_cfi01_register (Z2_FLASH_BASE ,"z2.flash0" ,Z2_FLASH_SIZE , dinfo ?blk_by_legacy_dinfo (dinfo) :NULL , - sector_len,4 ,0 ,0 ,0 ,0 , be)) { + sector_len,4 ,0 ,0 ,0 ,0 ,0 )) {error_report ("Error registering flash memory" );exit (1 ); }
Signature · 1 line
2.21.1
Quoted 9 lines · Philippe Mathieu-Daudé
We only build the little-endian softmmu configurations. Checking for big endian is pointless, remove the unused code.
Philippe Mathieu-Daudé (5):
hw/arm/gumstix: Simplify since the machines are little-endian only hw/arm/mainstone: Simplify since the machines are little-endian only hw/arm/omap_sx1: Simplify since the machines are little-endian only hw/arm/z2: Simplify since the machines are little-endian only hw/arm/musicpal: Simplify since the machines are little-endian only
r~
Peter Maydell
AppliedQuoted 11 lines · Philippe Mathieu-Daudé
We only build the little-endian softmmu configurations. Checking for big endian is pointless, remove the unused code.
Philippe Mathieu-Daudé (5):
hw/arm/gumstix: Simplify since the machines are little-endian only hw/arm/mainstone: Simplify since the machines are little-endian only hw/arm/omap_sx1: Simplify since the machines are little-endian only hw/arm/z2: Simplify since the machines are little-endian only hw/arm/musicpal: Simplify since the machines are little-endian only
Quoted 6 lines
hw/arm/gumstix.c | 16 ++-------------- hw/arm/mainstone.c | 8 +------- hw/arm/musicpal.c | 10 ---------- hw/arm/omap_sx1.c | 11 ++--------- hw/arm/z2.c | 8 +------- 5 files changed, 6 insertions(+), 47 deletions(-)
Applied to target-arm.next, thanks.
-- PMM