From: David Gibson <david@gibson.dropbear.id.au>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, hpoussin@reactos.org
Subject: Re: [Qemu-devel] [PATCH] 40p: don't use legacy fw_cfg_init_mem() function
Date: Mon, 13 Aug 2018 12:00:31 +1000 [thread overview]
Message-ID: <20180813020031.GH4079@umbus> (raw)
In-Reply-To: <20180810120418.6695-1-mark.cave-ayland@ilande.co.uk>
[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]
On Fri, Aug 10, 2018 at 01:04:18PM +0100, Mark Cave-Ayland wrote:
> Instead initialise the device via qdev to allow us to set device properties
> directly as required.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Applied to ppc-for-3.1, thanks.
> ---
> hw/ppc/prep.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
> index 3401570d98..9cf4a2adc3 100644
> --- a/hw/ppc/prep.c
> +++ b/hw/ppc/prep.c
> @@ -706,7 +706,7 @@ static void ibm_40p_init(MachineState *machine)
> uint16_t cmos_checksum;
> PowerPCCPU *cpu;
> DeviceState *dev;
> - SysBusDevice *pcihost;
> + SysBusDevice *pcihost, *s;
> Nvram *m48t59 = NULL;
> PCIBus *pci_bus;
> ISABus *isa_bus;
> @@ -799,7 +799,16 @@ static void ibm_40p_init(MachineState *machine)
> }
>
> /* Prepare firmware configuration for OpenBIOS */
> - fw_cfg = fw_cfg_init_mem(CFG_ADDR, CFG_ADDR + 2);
> + dev = qdev_create(NULL, TYPE_FW_CFG_MEM);
> + fw_cfg = FW_CFG(dev);
> + qdev_prop_set_uint32(dev, "data_width", 1);
> + qdev_prop_set_bit(dev, "dma_enabled", false);
> + object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG,
> + OBJECT(fw_cfg), NULL);
> + qdev_init_nofail(dev);
> + s = SYS_BUS_DEVICE(dev);
> + sysbus_mmio_map(s, 0, CFG_ADDR);
> + sysbus_mmio_map(s, 1, CFG_ADDR + 2);
>
> if (machine->kernel_filename) {
> /* load kernel */
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-08-13 2:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-10 12:04 [Qemu-devel] [PATCH] 40p: don't use legacy fw_cfg_init_mem() function Mark Cave-Ayland
2018-08-10 20:18 ` Hervé Poussineau
2018-08-10 21:13 ` Mark Cave-Ayland
2018-08-13 2:00 ` David Gibson [this message]
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=20180813020031.GH4079@umbus \
--to=david@gibson.dropbear.id.au \
--cc=hpoussin@reactos.org \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.