qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 04/12] hw/misc/allwinner-dramc: Do not use SysBus API to m


From: Thomas Huth
Subject: Re: [PATCH v2 04/12] hw/misc/allwinner-dramc: Do not use SysBus API to map local MMIO region
Date: Thu, 19 Oct 2023 09:44:44 +0200
User-agent: Mozilla Thunderbird

On 19/10/2023 09.16, Philippe Mathieu-Daudé wrote:
There is no point in exposing an internal MMIO region via
SysBus and directly mapping it in the very same device.

Just map it without using the SysBus API.

Transformation done using the following coccinelle script:

   @@
   expression sbdev;
   expression index;
   expression addr;
   expression subregion;
   @@
   -    sysbus_init_mmio(sbdev, subregion);
        ... when != sbdev
   -    sysbus_mmio_map(sbdev, index, addr);
   +    memory_region_add_subregion(get_system_memory(),
   +                                addr, subregion);

   @@
   expression priority;
   @@
   -    sysbus_init_mmio(sbdev, subregion);
        ... when != sbdev
   -    sysbus_mmio_map_overlap(sbdev, index, addr, priority);
   +    memory_region_add_subregion_overlap(get_system_memory(),
   +                                        addr,
   +                                        subregion, priority);

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  hw/misc/allwinner-r40-dramc.c | 13 ++++++-------
  1 file changed, 6 insertions(+), 7 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]