On Thu, Jan 5, 2023 at 6:51 AM Philippe Mathieu-Daudé <phi...@linaro.org> wrote: > > Currently pflash_cfi02_register(): > > 1/ creates a TYPE_PFLASH_CFI02 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_cfi02_create(). > > We don't document pflash_cfi02_register() because we are going > to remove it in a pair of commits. > > Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> > --- > hw/block/pflash_cfi02.c | 55 ++++++++++++++++++++++++++-------------- > include/hw/block/flash.h | 14 +++++++++- > 2 files changed, 49 insertions(+), 20 deletions(-) >
Reviewed-by: Bin Meng <bmeng...@gmail.com>