qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 09/20] hw/block: Factor pflash_cfi01_create() out of pflash_c


From: Bin Meng
Subject: Re: [PATCH 09/20] hw/block: Factor pflash_cfi01_create() out of pflash_cfi01_register()
Date: Sun, 8 Jan 2023 13:32:34 +0800

On Thu, Jan 5, 2023 at 6:16 AM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Currently pflash_cfi01_register():
>
>  1/ creates a TYPE_PFLASH_CFI01 qdev instance
>  2/ maps the first MMIO region to the system bus
>
> The first minor issue is the implicit sysbus mapping is not
> obvious (the function name could mention it), and the function
> is not documented.
>
> Another issue is we are forced to map on sysbus, thus code
> wanting to simply instantiate this device are forced to open
> code the qdev creation.
>
> This is a problem in a heterogeneous system where not all cores
> has access to the sysbus, or if we want to map the pflash on
> different address spaces.
>
> To clarify this API, extract the qdev creation in a new helper
> named pflash_cfi01_create().
>
> We don't document pflash_cfi01_register() because we are going
> to remove it in a few commits.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/block/pflash_cfi01.c  | 34 +++++++++++++++++++++++++---------
>  include/hw/block/flash.h | 14 +++++++++++++-
>  2 files changed, 38 insertions(+), 10 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>



reply via email to

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