[meta-xilinx] [PATCH 21/29] qemu: Add patch to fix XADC access on Zynq targets
Alistair Francis
alistair23 at gmail.com
Wed Sep 28 14:45:29 PDT 2016
On Wed, Sep 28, 2016 at 8:15 AM, Nathan Rossi <nathan at nathanrossi.com> wrote:
> This patch fixes the regression in QEMU 2.7.0 where the devcfg is mapped
> with a memory region that is large enough to overlap the xadc device
> models memory region. This resolves the bug where qemuzynq hangs during
> kernel boot when it attempts to access the xadc device.
>
> Signed-off-by: Nathan Rossi <nathan at nathanrossi.com>
Reviewed-by: Alistair Francis <alistair.francis at xilinx.com>
Thanks,
Alistair
> ---
> .../qemu/files/dma-xlnx-zynq-devcfg.patch | 55 ++++++++++++++++++++++
> recipes-devtools/qemu/qemu_2.7%.bbappend | 1 +
> 2 files changed, 56 insertions(+)
> create mode 100644 recipes-devtools/qemu/files/dma-xlnx-zynq-devcfg.patch
>
> diff --git a/recipes-devtools/qemu/files/dma-xlnx-zynq-devcfg.patch b/recipes-devtools/qemu/files/dma-xlnx-zynq-devcfg.patch
> new file mode 100644
> index 0000000000..eb6a5871d4
> --- /dev/null
> +++ b/recipes-devtools/qemu/files/dma-xlnx-zynq-devcfg.patch
> @@ -0,0 +1,55 @@
> +From a43639b12daff2230a98faffcffc79346c8ebf8c Mon Sep 17 00:00:00 2001
> +From: Nathan Rossi <nathan at nathanrossi.com>
> +Date: Thu, 22 Sep 2016 18:13:08 +0100
> +Subject: [PATCH] dma: xlnx-zynq-devcfg: Fix up XLNX_ZYNQ_DEVCFG_R_MAX
> +
> +Whilst according to the Zynq TRM this device covers a register region of
> +0x000 - 0x120. The register region is also shared with XADCIF prefix
> +registers at 0x100 and above. Due to how the devcfg and the xadc devices
> +are implemented in QEMU these are separate models with individual mmio
> +regions. As such the region registered by the devcfg overlaps with the
> +xadc when initialized in a machine model (e.g. xilinx-zynq-a9).
> +
> +This patch fixes up the incorrect region size, where
> +XLNX_ZYNQ_DEVCFG_R_MAX is missing its '/ 4' causing it to be 0x460 in
> +size. As well as setting the region size to the 0x0 - 0x100 region so
> +that an xadc device instance can be registered in the correct region to
> +pair with the devcfg device instance.
> +
> +Mapping with XLNX_ZYNQ_DEVCFG_R_MAX = 0x118:
> + dev: xlnx.ps7-dev-cfg, id ""
> + mmio 00000000f8007000/0000000000000460
> + dev: xlnx,zynq-xadc, id ""
> + mmio 00000000f8007100/0000000000000020
> +
> +Mapping with XLNX_ZYNQ_DEVCFG_R_MAX = 0x100 / 4:
> + dev: xlnx.ps7-dev-cfg, id ""
> + mmio 00000000f8007000/0000000000000100
> + dev: xlnx,zynq-xadc, id ""
> + mmio 00000000f8007100/0000000000000020
> +
> +Signed-off-by: Nathan Rossi <nathan at nathanrossi.com>
> +Reviewed-by: Alistair Francis <alistair.francis at xilinx.com>
> +Message-id: 20160921180911.32289-1-nathan at nathanrossi.com
> +Signed-off-by: Peter Maydell <peter.maydell at linaro.org>
> +Upstream-Status: Backport
> +---
> + include/hw/dma/xlnx-zynq-devcfg.h | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/include/hw/dma/xlnx-zynq-devcfg.h b/include/hw/dma/xlnx-zynq-devcfg.h
> +index d40e5c8df6..9f5119a89a 100644
> +--- a/include/hw/dma/xlnx-zynq-devcfg.h
> ++++ b/include/hw/dma/xlnx-zynq-devcfg.h
> +@@ -34,7 +34,7 @@
> + #define XLNX_ZYNQ_DEVCFG(obj) \
> + OBJECT_CHECK(XlnxZynqDevcfg, (obj), TYPE_XLNX_ZYNQ_DEVCFG)
> +
> +-#define XLNX_ZYNQ_DEVCFG_R_MAX 0x118
> ++#define XLNX_ZYNQ_DEVCFG_R_MAX (0x100 / 4)
> +
> + #define XLNX_ZYNQ_DEVCFG_DMA_CMD_FIFO_LEN 10
> +
> +--
> +2.9.3
> +
> diff --git a/recipes-devtools/qemu/qemu_2.7%.bbappend b/recipes-devtools/qemu/qemu_2.7%.bbappend
> index eb66caed6a..60ae486dbb 100644
> --- a/recipes-devtools/qemu/qemu_2.7%.bbappend
> +++ b/recipes-devtools/qemu/qemu_2.7%.bbappend
> @@ -3,5 +3,6 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
>
> SRC_URI += " \
> file://8fa2346723fb74e8220ac9f186dabc2f57e4cb43.patch \
> + file://dma-xlnx-zynq-devcfg.patch \
> "
>
> --
> 2.9.3
> --
> _______________________________________________
> meta-xilinx mailing list
> meta-xilinx at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-xilinx
More information about the meta-xilinx
mailing list