[PATCH 1/4] hw/intc: Mark OpenRISC-specific peripheral as big-endian

Philippe Mathieu-Daudé posted 4 patches 1 month, 2 weeks ago
Maintainers: Laurent Vivier <laurent@vivier.eu>, Jia Liu <proljc@gmail.com>, Stafford Horne <shorne@gmail.com>
[PATCH 1/4] hw/intc: Mark OpenRISC-specific peripheral as big-endian
Posted by Philippe Mathieu-Daudé 1 month, 2 weeks ago
The Open Multi-Processor Interrupt Controller (ompic) is only
used by the OpenRISC target, which is only built as big-endian.
Therefore the DEVICE_NATIVE_ENDIAN definition expand to
DEVICE_BIG_ENDIAN (besides, the DEVICE_LITTLE_ENDIAN case isn't
tested). Simplify directly using DEVICE_BIG_ENDIAN.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/intc/ompic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/intc/ompic.c b/hw/intc/ompic.c
index 047c367478d..ee34501f675 100644
--- a/hw/intc/ompic.c
+++ b/hw/intc/ompic.c
@@ -96,7 +96,7 @@ static void ompic_write(void *opaque, hwaddr addr, uint64_t data, unsigned size)
 static const MemoryRegionOps ompic_ops = {
     .read = ompic_read,
     .write = ompic_write,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_BIG_ENDIAN,
     .impl = {
         .max_access_size = 8,
     },
-- 
2.52.0


Re: [PATCH 1/4] hw/intc: Mark OpenRISC-specific peripheral as big-endian
Posted by Richard Henderson 1 month ago
On 12/25/25 03:18, Philippe Mathieu-Daudé wrote:
> The Open Multi-Processor Interrupt Controller (ompic) is only
> used by the OpenRISC target, which is only built as big-endian.
> Therefore the DEVICE_NATIVE_ENDIAN definition expand to
> DEVICE_BIG_ENDIAN (besides, the DEVICE_LITTLE_ENDIAN case isn't
> tested). Simplify directly using DEVICE_BIG_ENDIAN.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   hw/intc/ompic.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

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

r~

Re: [PATCH 1/4] hw/intc: Mark OpenRISC-specific peripheral as big-endian
Posted by Manos Pitsidianakis 1 month, 1 week ago
On Wed, Dec 24, 2025 at 6:18 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> The Open Multi-Processor Interrupt Controller (ompic) is only
> used by the OpenRISC target, which is only built as big-endian.
> Therefore the DEVICE_NATIVE_ENDIAN definition expand to
> DEVICE_BIG_ENDIAN (besides, the DEVICE_LITTLE_ENDIAN case isn't
> tested). Simplify directly using DEVICE_BIG_ENDIAN.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>

>  hw/intc/ompic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/intc/ompic.c b/hw/intc/ompic.c
> index 047c367478d..ee34501f675 100644
> --- a/hw/intc/ompic.c
> +++ b/hw/intc/ompic.c
> @@ -96,7 +96,7 @@ static void ompic_write(void *opaque, hwaddr addr, uint64_t data, unsigned size)
>  static const MemoryRegionOps ompic_ops = {
>      .read = ompic_read,
>      .write = ompic_write,
> -    .endianness = DEVICE_NATIVE_ENDIAN,
> +    .endianness = DEVICE_BIG_ENDIAN,
>      .impl = {
>          .max_access_size = 8,
>      },
> --
> 2.52.0
>