qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] hw/arm: Remove big-endian checks on machine code
@ 2020-02-28 12:53 Philippe Mathieu-Daudé
  2020-02-28 12:53 ` [PATCH 1/5] hw/arm/gumstix: Simplify since the machines are little-endian only Philippe Mathieu-Daudé
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 12:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-arm, Jan Kiszka, 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

 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(-)

-- 
2.21.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/5] hw/arm/gumstix: Simplify since the machines are little-endian only
  2020-02-28 12:53 [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Philippe Mathieu-Daudé
@ 2020-02-28 12:53 ` Philippe Mathieu-Daudé
  2020-02-28 12:53 ` [PATCH 2/5] hw/arm/mainstone: " Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 12:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Philippe Mathieu-Daudé,
	Philippe Mathieu-Daudé, qemu-arm, Jan Kiszka

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

As the Connex and Verdex machines only boot in little-endian,
we can simplify the code.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
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(-)

diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
index f26a0e8010..3a4bc332c4 100644
--- a/hw/arm/gumstix.c
+++ b/hw/arm/gumstix.c
@@ -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);
     }
-- 
2.21.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/5] hw/arm/mainstone: Simplify since the machines are little-endian only
  2020-02-28 12:53 [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Philippe Mathieu-Daudé
  2020-02-28 12:53 ` [PATCH 1/5] hw/arm/gumstix: Simplify since the machines are little-endian only Philippe Mathieu-Daudé
@ 2020-02-28 12:53 ` Philippe Mathieu-Daudé
  2020-02-28 12:53 ` [PATCH 3/5] hw/arm/omap_sx1: " Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 12:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-arm, Jan Kiszka, Philippe Mathieu-Daudé

We only build the little-endian softmmu configurations. Checking
for big endian is pointless, remove the unused code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/mainstone.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c
index 6e64dfab50..1042017086 100644
--- a/hw/arm/mainstone.c
+++ b/hw/arm/mainstone.c
@@ -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);
         }
-- 
2.21.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/5] hw/arm/omap_sx1: Simplify since the machines are little-endian only
  2020-02-28 12:53 [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Philippe Mathieu-Daudé
  2020-02-28 12:53 ` [PATCH 1/5] hw/arm/gumstix: Simplify since the machines are little-endian only Philippe Mathieu-Daudé
  2020-02-28 12:53 ` [PATCH 2/5] hw/arm/mainstone: " Philippe Mathieu-Daudé
@ 2020-02-28 12:53 ` Philippe Mathieu-Daudé
  2020-02-28 12:53 ` [PATCH 4/5] hw/arm/z2: " Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 12:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-arm, Jan Kiszka, Philippe Mathieu-Daudé

We only build the little-endian softmmu configurations. Checking
for big endian is pointless, remove the unused code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/omap_sx1.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index 2bebab4171..de5ff447dc 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -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);
         }
-- 
2.21.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/5] hw/arm/z2: Simplify since the machines are little-endian only
  2020-02-28 12:53 [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2020-02-28 12:53 ` [PATCH 3/5] hw/arm/omap_sx1: " Philippe Mathieu-Daudé
@ 2020-02-28 12:53 ` Philippe Mathieu-Daudé
  2020-02-28 12:53 ` [PATCH 5/5] hw/arm/musicpal: " Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 12:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-arm, Jan Kiszka, Philippe Mathieu-Daudé

We only build the little-endian softmmu configurations. Checking
for big endian is pointless, remove the unused code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/z2.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/hw/arm/z2.c b/hw/arm/z2.c
index 4bb237f22d..a0f4095990 100644
--- a/hw/arm/z2.c
+++ b/hw/arm/z2.c
@@ -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);
     }
-- 
2.21.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/5] hw/arm/musicpal: Simplify since the machines are little-endian only
  2020-02-28 12:53 [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2020-02-28 12:53 ` [PATCH 4/5] hw/arm/z2: " Philippe Mathieu-Daudé
@ 2020-02-28 12:53 ` Philippe Mathieu-Daudé
  2020-02-29 19:38 ` [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Richard Henderson
  2020-03-02 11:44 ` Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-02-28 12:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, qemu-arm, Jan Kiszka, Philippe Mathieu-Daudé

We only build the little-endian softmmu configurations. Checking
for big endian is pointless, remove the unused code.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/musicpal.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index db8b03cb83..b2d0cfdac8 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -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);
 
-- 
2.21.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/5] hw/arm: Remove big-endian checks on machine code
  2020-02-28 12:53 [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2020-02-28 12:53 ` [PATCH 5/5] hw/arm/musicpal: " Philippe Mathieu-Daudé
@ 2020-02-29 19:38 ` Richard Henderson
  2020-03-02 11:44 ` Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Richard Henderson @ 2020-02-29 19:38 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, qemu-arm, Jan Kiszka

On 2/28/20 4:53 AM, Philippe Mathieu-Daudé wrote:
> 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

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/5] hw/arm: Remove big-endian checks on machine code
  2020-02-28 12:53 [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2020-02-29 19:38 ` [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Richard Henderson
@ 2020-03-02 11:44 ` Peter Maydell
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2020-03-02 11:44 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: qemu-arm, Jan Kiszka, QEMU Developers

On Fri, 28 Feb 2020 at 12:53, Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>
> 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(-)



Applied to target-arm.next, thanks.

-- PMM


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-03-02 11:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-28 12:53 [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Philippe Mathieu-Daudé
2020-02-28 12:53 ` [PATCH 1/5] hw/arm/gumstix: Simplify since the machines are little-endian only Philippe Mathieu-Daudé
2020-02-28 12:53 ` [PATCH 2/5] hw/arm/mainstone: " Philippe Mathieu-Daudé
2020-02-28 12:53 ` [PATCH 3/5] hw/arm/omap_sx1: " Philippe Mathieu-Daudé
2020-02-28 12:53 ` [PATCH 4/5] hw/arm/z2: " Philippe Mathieu-Daudé
2020-02-28 12:53 ` [PATCH 5/5] hw/arm/musicpal: " Philippe Mathieu-Daudé
2020-02-29 19:38 ` [PATCH 0/5] hw/arm: Remove big-endian checks on machine code Richard Henderson
2020-03-02 11:44 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).