From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
qemu-trivial@nongnu.org, "Michael Tokarev" <mjt@tls.msk.ru>,
"Laurent Vivier" <laurent@vivier.eu>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-arm@nongnu.org, "Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PATCH 1/2] hw/arm/gumstix: Simplify since the machines are little-endian only
Date: Mon, 24 Feb 2020 00:10:43 +0100 [thread overview]
Message-ID: <20200223231044.8003-2-philmd@redhat.com> (raw)
In-Reply-To: <20200223231044.8003-1-philmd@redhat.com>
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
As the Connex and Verdex machines only boot in little-endian,
we can simplify the code.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/gumstix.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c
index f26a0e8010..94904d717b 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);
}
@@ -152,6 +140,9 @@ static const TypeInfo verdex_type = {
static void gumstix_machine_init(void)
{
+ if (target_words_bigendian()) {
+ return;
+ }
type_register_static(&connex_type);
type_register_static(&verdex_type);
}
--
2.21.1
next prev parent reply other threads:[~2020-02-23 23:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-23 23:10 [PATCH 0/2] hw/arm/gumstix: Trivial cleanups Philippe Mathieu-Daudé
2020-02-23 23:10 ` Philippe Mathieu-Daudé [this message]
2020-02-25 11:12 ` [PATCH 1/2] hw/arm/gumstix: Simplify since the machines are little-endian only Peter Maydell
2020-02-25 11:16 ` Philippe Mathieu-Daudé
2020-02-23 23:10 ` [PATCH 2/2] hw/arm/gumstix: Use the IEC binary prefix definitions Philippe Mathieu-Daudé
2020-02-25 11:16 ` Peter Maydell
2020-02-25 11:20 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200223231044.8003-2-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=f4bug@amsat.org \
--cc=laurent@vivier.eu \
--cc=mjt@tls.msk.ru \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).