From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Bernhard Beschow <shentey@gmail.com>,
qemu-devel@nongnu.org, BALATON Zoltan <balaton@eik.bme.hu>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
qemu-ppc@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Andrey Smirnov" <andrew.smirnov@gmail.com>,
"Jean-Christophe Dubois" <jcd@tribudubois.net>,
"Guenter Roeck" <linux@roeck-us.net>,
qemu-block@nongnu.org, "Bin Meng" <bmeng.cn@gmail.com>,
qemu-arm@nongnu.org
Subject: Re: [PATCH v4 09/14] hw/sd/sdhci: Unify default MemoryRegionOps
Date: Sun, 9 Mar 2025 23:50:05 +0100 [thread overview]
Message-ID: <6797072b-6a7d-46e0-bfdb-17b9888d8b0b@linaro.org> (raw)
In-Reply-To: <6FAA573C-D92D-451B-B69B-F4B9095F9F0C@gmail.com>
On 9/3/25 10:27, Bernhard Beschow wrote:
>
>
> Am 8. März 2025 21:36:35 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>> Note, sdhci_mmio_le_ops[] was missing .impl.access_size = 4.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> hw/sd/sdhci.c | 46 ++++++++++++++++++++--------------------------
>> 1 file changed, 20 insertions(+), 26 deletions(-)
>>
>> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
>> index a2e7162e289..23af3958a1d 100644
>> --- a/hw/sd/sdhci.c
>> +++ b/hw/sd/sdhci.c
>> @@ -1372,30 +1372,22 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
>> value >> shift, value >> shift);
>> }
>>
>> -static const MemoryRegionOps sdhci_mmio_le_ops = {
>> - .read = sdhci_read,
>> - .write = sdhci_write,
>> - .valid = {
>> - .min_access_size = 1,
>> - .max_access_size = 4,
>> - .unaligned = false
>> +static const MemoryRegionOps sdhci_mmio_ops[2] = {
>> + [0 ... 1] = {
>> + .read = sdhci_read,
>> + .write = sdhci_write,
>> + .impl = {
>> + .min_access_size = 4,
>> + .max_access_size = 4,
>> + },
>> + .valid = {
>> + .min_access_size = 1,
>> + .max_access_size = 4,
>> + .unaligned = false
>> + },
>> },
>> - .endianness = DEVICE_LITTLE_ENDIAN,
>> -};
>> -
>> -static const MemoryRegionOps sdhci_mmio_be_ops = {
>> - .read = sdhci_read,
>> - .write = sdhci_write,
>> - .impl = {
>> - .min_access_size = 4,
>> - .max_access_size = 4,
>> - },
>> - .valid = {
>> - .min_access_size = 1,
>> - .max_access_size = 4,
>> - .unaligned = false
>> - },
>> - .endianness = DEVICE_BIG_ENDIAN,
>> + [0].endianness = DEVICE_LITTLE_ENDIAN,
>> + [1].endianness = DEVICE_BIG_ENDIAN,
>> };
>
> We introduced sdhci_mmio_be_ops and the endianness property specifically for the e500 machine. We always lied about the endianness property to be implemented for all SDHC types, e.g. USDHC doesn't implement it. Since you'll introduce a dedicated FSL_ESDHC type a few commits later, along with its own MemoryRegionOps, I think we should drop the endianness property and sdhci_mmio_ops doesn't need to become an array. Dropping the endianness property also results in avoiding the error conditions you have to deal with in the realize method.
Great idea!
next prev parent reply other threads:[~2025-03-09 22:51 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-08 21:36 [PATCH v4 00/14] hw/sd/sdhci: Set reset value of interrupt registers Philippe Mathieu-Daudé
2025-03-08 21:36 ` [PATCH v4 01/14] hw/qdev-properties-system: Include missing 'qapi/qapi-types-common.h' Philippe Mathieu-Daudé
2025-03-08 21:36 ` [PATCH v4 02/14] hw/sd/sdhci: Remove need for SDHCIState::vendor field Philippe Mathieu-Daudé
2025-03-09 11:20 ` BALATON Zoltan
2025-03-09 13:57 ` Bernhard Beschow
2025-03-08 21:36 ` [PATCH v4 03/14] hw/sd/sdhci: Introduce SDHCIClass stub Philippe Mathieu-Daudé
2025-03-08 22:34 ` BALATON Zoltan
2025-03-08 23:16 ` Philippe Mathieu-Daudé
2025-03-09 0:08 ` BALATON Zoltan
2025-03-09 14:20 ` Philippe Mathieu-Daudé
2025-03-08 21:36 ` [PATCH v4 04/14] hw/sd/sdhci: Make quirks a class property Philippe Mathieu-Daudé
2025-03-09 11:43 ` BALATON Zoltan
2025-03-09 12:19 ` Philippe Mathieu-Daudé
2025-03-09 12:43 ` BALATON Zoltan
2025-03-08 21:36 ` [PATCH v4 05/14] hw/sd/sdhci: Make I/O region size " Philippe Mathieu-Daudé
2025-03-09 11:09 ` BALATON Zoltan
2025-03-08 21:36 ` [PATCH v4 06/14] hw/sd/sdhci: Enforce little endianness on PCI devices Philippe Mathieu-Daudé
2025-03-08 21:36 ` [PATCH v4 07/14] hw/sd/sdhci: Allow SDHCI classes to register their own MemoryRegionOps Philippe Mathieu-Daudé
2025-03-08 21:36 ` [PATCH v4 08/14] hw/sd/sdhci: Simplify MemoryRegionOps endianness check Philippe Mathieu-Daudé
2025-03-08 22:39 ` BALATON Zoltan
2025-03-08 21:36 ` [PATCH v4 09/14] hw/sd/sdhci: Unify default MemoryRegionOps Philippe Mathieu-Daudé
2025-03-09 9:27 ` Bernhard Beschow
2025-03-09 22:50 ` Philippe Mathieu-Daudé [this message]
2025-03-08 21:36 ` [PATCH v4 10/14] hw/sd/sdhci: Convert SDHCIState::endianness to EndianMode Philippe Mathieu-Daudé
2025-03-08 21:36 ` [PATCH v4 11/14] hw/sd/sdhci: Add SDHCIClass::ro::capareg field Philippe Mathieu-Daudé
2025-03-08 21:36 ` [PATCH v4 12/14] hw/sd/sdhci: Allow SDHCI classes to have different register reset values Philippe Mathieu-Daudé
2025-03-09 11:34 ` BALATON Zoltan
2025-03-08 21:36 ` [PATCH v4 13/14] hw/sd/sdhci: Implement Freescale eSDHC as TYPE_FSL_ESDHC Philippe Mathieu-Daudé
2025-03-09 11:04 ` BALATON Zoltan
2025-03-09 12:16 ` Philippe Mathieu-Daudé
2025-03-08 21:36 ` [PATCH v4 14/14] hw/ppc/e500: Replace generic SDHCI by Freescale eSDHC Philippe Mathieu-Daudé
2025-03-09 8:31 ` Bernhard Beschow
2025-03-09 13:59 ` 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=6797072b-6a7d-46e0-bfdb-17b9888d8b0b@linaro.org \
--to=philmd@linaro.org \
--cc=andrew.smirnov@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=berrange@redhat.com \
--cc=bmeng.cn@gmail.com \
--cc=eduardo@habkost.net \
--cc=jcd@tribudubois.net \
--cc=linux@roeck-us.net \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=shentey@gmail.com \
/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).