From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5Pga-0000wI-Vy for qemu-devel@nongnu.org; Fri, 11 Nov 2016 23:13:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5PgX-00069O-S0 for qemu-devel@nongnu.org; Fri, 11 Nov 2016 23:13:00 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:34595) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c5PgX-00069E-JV for qemu-devel@nongnu.org; Fri, 11 Nov 2016 23:12:57 -0500 Received: by mail-lf0-x244.google.com with SMTP id o141so2507696lff.1 for ; Fri, 11 Nov 2016 20:12:57 -0800 (PST) Date: Sat, 12 Nov 2016 05:12:54 +0100 From: "Edgar E. Iglesias" Message-ID: <20161112041254.GQ9606@toto> References: <8430dea044fb614e7e2a2efbb5861c57ab5e7d2a.1478907354.git.alistair.francis@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8430dea044fb614e7e2a2efbb5861c57ab5e7d2a.1478907354.git.alistair.francis@xilinx.com> Subject: Re: [Qemu-devel] [PATCH v1 2/2] xlnx-ep108: Connect the AXI GPIO device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alistair Francis Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org, alistair23@gmail.com, edgar.iglesias@xilinx.com On Fri, Nov 11, 2016 at 03:42:31PM -0800, Alistair Francis wrote: > Connect the new Xilinx AXI GPIO devices based on the defaults used in > the ZCU102 reference board design. Reviewed-by: Edgar E. Iglesias > > Signed-off-by: Alistair Francis > --- > > hw/arm/xlnx-ep108.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c > index 4ec590a..23b3d6e 100644 > --- a/hw/arm/xlnx-ep108.c > +++ b/hw/arm/xlnx-ep108.c > @@ -20,14 +20,27 @@ > #include "qemu-common.h" > #include "cpu.h" > #include "hw/arm/xlnx-zynqmp.h" > +#include "hw/gpio/xlnx-axi-gpio.h" > #include "hw/boards.h" > #include "qemu/error-report.h" > #include "exec/address-spaces.h" > #include "qemu/log.h" > > +#define XLNX_EP108_NUM_AXI_GPIOS 7 > + > +/* These can always be changed, but these seven are the default in the reference > + * board design. > + */ > +static const uint64_t axi_gpio_addr[XLNX_EP108_NUM_AXI_GPIOS] = { > + 0xa1000000, 0x401000000, 0x1001000000, 0xb1000000, 0x501000000, > + 0x4801000000, 0x81000000, > +}; > + > typedef struct XlnxEP108 { > XlnxZynqMPState soc; > MemoryRegion ddr_ram; > + > + XlnxAXIGPIO axi_gpio[XLNX_EP108_NUM_AXI_GPIOS]; > } XlnxEP108; > > static struct arm_boot_info xlnx_ep108_binfo; > @@ -106,6 +119,19 @@ static void xlnx_ep108_init(MachineState *machine) > sysbus_connect_irq(SYS_BUS_DEVICE(&s->soc.spi[i]), 1, cs_line); > } > > + /* Connect the GPIO devices. These aren't on the board, but they are in > + * the PL, so we connect them here instead of in the SoC. > + */ > + for (i = 0; i < XLNX_EP108_NUM_AXI_GPIOS; i++) { > + object_initialize(&s->axi_gpio[i], sizeof(s->axi_gpio[i]), > + TYPE_XLNX_AXI_GPIO); > + qdev_set_parent_bus(DEVICE(&s->axi_gpio[i]), sysbus_get_default()); > + > + object_property_set_bool(OBJECT(&s->axi_gpio[i]), true, "realized", &error_fatal); > + sysbus_mmio_map(SYS_BUS_DEVICE(&s->axi_gpio[i]), 0, axi_gpio_addr[i]); > + /* The device supports interrupts, but they aren't connected */ > + } > + > xlnx_ep108_binfo.ram_size = ram_size; > xlnx_ep108_binfo.kernel_filename = machine->kernel_filename; > xlnx_ep108_binfo.kernel_cmdline = machine->kernel_cmdline; > -- > 2.7.4 >