mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210930' into staging
target-arm queue: * allwinner-h3: Switch to SMC as PSCI conduit * arm: tcg: Adhere to SMCCC 1.3 section 5.2 * xlnx-zcu102, xlnx-versal-virt: Support BBRAM and eFUSE devices * gdbstub related code cleanups * Don't put FPEXC and FPSID in org.gnu.gdb.arm.vfp XML * Use _init vs _new convention in bus creation function names * sabrelite: Connect SPI flash CS line to GPIO3_19 # gpg: Signature made Thu 30 Sep 2021 16:11:20 BST # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "peter.maydell@linaro.org" # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@gmail.com>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20210930: (22 commits) hw/arm: sabrelite: Connect SPI flash CS line to GPIO3_19 ide: Rename ide_bus_new() to ide_bus_init() qbus: Rename qbus_create() to qbus_new() qbus: Rename qbus_create_inplace() to qbus_init() pci: Rename pci_root_bus_new_inplace() to pci_root_bus_init() ipack: Rename ipack_bus_new_inplace() to ipack_bus_init() scsi: Replace scsi_bus_new() with scsi_bus_init(), scsi_bus_init_named() target/arm: Don't put FPEXC and FPSID in org.gnu.gdb.arm.vfp XML target/arm: Move gdbstub related code out of helper.c target/arm: Fix coding style issues in gdbstub code in helper.c configs: Don't include 32-bit-only GDB XML in aarch64 linux configs docs/system/arm: xlnx-versal-virt: BBRAM and eFUSE Usage hw/arm: xlnx-zcu102: Add Xilinx eFUSE device hw/arm: xlnx-zcu102: Add Xilinx BBRAM device hw/arm: xlnx-versal-virt: Add Xilinx eFUSE device hw/arm: xlnx-versal-virt: Add Xilinx BBRAM device hw/nvram: Introduce Xilinx battery-backed ram hw/nvram: Introduce Xilinx ZynqMP eFuse device hw/nvram: Introduce Xilinx Versal eFuse device hw/nvram: Introduce Xilinx eFuse QOM ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
TARGET_ARCH=aarch64
|
||||
TARGET_BASE_ARCH=arm
|
||||
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml
|
||||
TARGET_HAS_BFLT=y
|
||||
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
TARGET_ARCH=aarch64
|
||||
TARGET_BASE_ARCH=arm
|
||||
TARGET_SUPPORTS_MTTCG=y
|
||||
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_NEED_FDT=y
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
TARGET_ARCH=aarch64
|
||||
TARGET_BASE_ARCH=arm
|
||||
TARGET_WORDS_BIGENDIAN=y
|
||||
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_XML_FILES= gdb-xml/aarch64-core.xml gdb-xml/aarch64-fpu.xml
|
||||
TARGET_HAS_BFLT=y
|
||||
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
TARGET_ARCH=arm
|
||||
TARGET_SYSTBL_ABI=common,oabi
|
||||
TARGET_SYSTBL=syscall.tbl
|
||||
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_HAS_BFLT=y
|
||||
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
TARGET_ARCH=arm
|
||||
TARGET_SUPPORTS_MTTCG=y
|
||||
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_NEED_FDT=y
|
||||
|
||||
@@ -2,6 +2,6 @@ TARGET_ARCH=arm
|
||||
TARGET_SYSTBL_ABI=common,oabi
|
||||
TARGET_SYSTBL=syscall.tbl
|
||||
TARGET_WORDS_BIGENDIAN=y
|
||||
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_XML_FILES= gdb-xml/arm-core.xml gdb-xml/arm-vfp.xml gdb-xml/arm-vfp3.xml gdb-xml/arm-vfp-sysregs.xml gdb-xml/arm-neon.xml gdb-xml/arm-m-profile.xml
|
||||
TARGET_HAS_BFLT=y
|
||||
CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y
|
||||
|
||||
@@ -32,6 +32,8 @@ Implemented devices:
|
||||
- OCM (256KB of On Chip Memory)
|
||||
- XRAM (4MB of on chip Accelerator RAM)
|
||||
- DDR memory
|
||||
- BBRAM (36 bytes of Battery-backed RAM)
|
||||
- eFUSE (3072 bytes of one-time field-programmable bit array)
|
||||
|
||||
QEMU does not yet model any other devices, including the PL and the AI Engine.
|
||||
|
||||
@@ -175,3 +177,50 @@ Run the following at the U-Boot prompt:
|
||||
fdt set /chosen/dom0 reg <0x00000000 0x40000000 0x0 0x03100000>
|
||||
booti 30000000 - 20000000
|
||||
|
||||
BBRAM File Backend
|
||||
""""""""""""""""""
|
||||
BBRAM can have an optional file backend, which must be a seekable
|
||||
binary file with a size of 36 bytes or larger. A file with all
|
||||
binary 0s is a 'blank'.
|
||||
|
||||
To add a file-backend for the BBRAM:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-drive if=pflash,index=0,file=versal-bbram.bin,format=raw
|
||||
|
||||
To use a different index value, N, from default of 0, add:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-global xlnx,bbram-ctrl.drive-index=N
|
||||
|
||||
eFUSE File Backend
|
||||
""""""""""""""""""
|
||||
eFUSE can have an optional file backend, which must be a seekable
|
||||
binary file with a size of 3072 bytes or larger. A file with all
|
||||
binary 0s is a 'blank'.
|
||||
|
||||
To add a file-backend for the eFUSE:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-drive if=pflash,index=1,file=versal-efuse.bin,format=raw
|
||||
|
||||
To use a different index value, N, from default of 1, add:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-global xlnx,efuse.drive-index=N
|
||||
|
||||
.. warning::
|
||||
In actual physical Versal, BBRAM and eFUSE contain sensitive data.
|
||||
The QEMU device models do **not** encrypt nor obfuscate any data
|
||||
when holding them in models' memory or when writing them to their
|
||||
file backends.
|
||||
|
||||
Thus, a file backend should be used with caution, and 'format=luks'
|
||||
is highly recommended (albeit with usage complexity).
|
||||
|
||||
Better yet, do not use actual product data when running guest image
|
||||
on this Xilinx Versal Virt board.
|
||||
|
||||
@@ -82,7 +82,5 @@
|
||||
<reg name="q14" bitsize="128" type="neon_q"/>
|
||||
<reg name="q15" bitsize="128" type="neon_q"/>
|
||||
|
||||
<reg name="fpsid" bitsize="32" type="int" group="float"/>
|
||||
<reg name="fpscr" bitsize="32" type="int" group="float"/>
|
||||
<reg name="fpexc" bitsize="32" type="int" group="float"/>
|
||||
</feature>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Copyright (C) 2021 Linaro Ltd.
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved.
|
||||
|
||||
These are A/R profile VFP system registers. Debugger users probably
|
||||
don't really care about these, but because we used to (incorrectly)
|
||||
provide them to gdb in the org.gnu.gdb.arm.vfp XML we continue
|
||||
to do so via this separate XML.
|
||||
-->
|
||||
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
|
||||
<feature name="org.qemu.gdb.arm.vfp-sysregs">
|
||||
<reg name="fpsid" bitsize="32" type="int" group="float"/>
|
||||
<reg name="fpexc" bitsize="32" type="int" group="float"/>
|
||||
</feature>
|
||||
@@ -23,7 +23,5 @@
|
||||
<reg name="d14" bitsize="64" type="float"/>
|
||||
<reg name="d15" bitsize="64" type="float"/>
|
||||
|
||||
<reg name="fpsid" bitsize="32" type="int" group="float"/>
|
||||
<reg name="fpscr" bitsize="32" type="int" group="float"/>
|
||||
<reg name="fpexc" bitsize="32" type="int" group="float"/>
|
||||
</feature>
|
||||
|
||||
@@ -39,7 +39,5 @@
|
||||
<reg name="d30" bitsize="64" type="float"/>
|
||||
<reg name="d31" bitsize="64" type="float"/>
|
||||
|
||||
<reg name="fpsid" bitsize="32" type="int" group="float"/>
|
||||
<reg name="fpscr" bitsize="32" type="int" group="float"/>
|
||||
<reg name="fpexc" bitsize="32" type="int" group="float"/>
|
||||
</feature>
|
||||
|
||||
@@ -81,3 +81,5 @@ config XLNX_ZYNQMP
|
||||
select REGISTER
|
||||
select CAN_BUS
|
||||
select PTIMER
|
||||
select XLNX_BBRAM
|
||||
select XLNX_EFUSE_ZYNQMP
|
||||
|
||||
@@ -381,6 +381,8 @@ config XLNX_VERSAL
|
||||
select XLNX_ZDMA
|
||||
select XLNX_ZYNQMP
|
||||
select OR_IRQ
|
||||
select XLNX_BBRAM
|
||||
select XLNX_EFUSE_VERSAL
|
||||
|
||||
config NPCM7XX
|
||||
bool
|
||||
|
||||
@@ -237,7 +237,7 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
|
||||
|
||||
/* Provide Power State Coordination Interface */
|
||||
qdev_prop_set_int32(DEVICE(&s->cpus[i]), "psci-conduit",
|
||||
QEMU_PSCI_CONDUIT_HVC);
|
||||
QEMU_PSCI_CONDUIT_SMC);
|
||||
|
||||
/* Disable secondary CPUs */
|
||||
qdev_prop_set_bit(DEVICE(&s->cpus[i]), "start-powered-off",
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ static void sabrelite_init(MachineState *machine)
|
||||
qdev_realize_and_unref(flash_dev, BUS(spi_bus), &error_fatal);
|
||||
|
||||
cs_line = qdev_get_gpio_in_named(flash_dev, SSI_GPIO_CS, 0);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(spi_dev), 1, cs_line);
|
||||
qdev_connect_gpio_out(DEVICE(&s->gpio[2]), 19, cs_line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -356,6 +356,61 @@ static void fdt_add_rtc_node(VersalVirt *s)
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
static void fdt_add_bbram_node(VersalVirt *s)
|
||||
{
|
||||
const char compat[] = TYPE_XLNX_BBRAM;
|
||||
const char interrupt_names[] = "bbram-error";
|
||||
char *name = g_strdup_printf("/bbram@%x", MM_PMC_BBRAM_CTRL);
|
||||
|
||||
qemu_fdt_add_subnode(s->fdt, name);
|
||||
|
||||
qemu_fdt_setprop_cells(s->fdt, name, "interrupts",
|
||||
GIC_FDT_IRQ_TYPE_SPI, VERSAL_BBRAM_APB_IRQ_0,
|
||||
GIC_FDT_IRQ_FLAGS_LEVEL_HI);
|
||||
qemu_fdt_setprop(s->fdt, name, "interrupt-names",
|
||||
interrupt_names, sizeof(interrupt_names));
|
||||
qemu_fdt_setprop_sized_cells(s->fdt, name, "reg",
|
||||
2, MM_PMC_BBRAM_CTRL,
|
||||
2, MM_PMC_BBRAM_CTRL_SIZE);
|
||||
qemu_fdt_setprop(s->fdt, name, "compatible", compat, sizeof(compat));
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
static void fdt_add_efuse_ctrl_node(VersalVirt *s)
|
||||
{
|
||||
const char compat[] = TYPE_XLNX_VERSAL_EFUSE_CTRL;
|
||||
const char interrupt_names[] = "pmc_efuse";
|
||||
char *name = g_strdup_printf("/pmc_efuse@%x", MM_PMC_EFUSE_CTRL);
|
||||
|
||||
qemu_fdt_add_subnode(s->fdt, name);
|
||||
|
||||
qemu_fdt_setprop_cells(s->fdt, name, "interrupts",
|
||||
GIC_FDT_IRQ_TYPE_SPI, VERSAL_EFUSE_IRQ,
|
||||
GIC_FDT_IRQ_FLAGS_LEVEL_HI);
|
||||
qemu_fdt_setprop(s->fdt, name, "interrupt-names",
|
||||
interrupt_names, sizeof(interrupt_names));
|
||||
qemu_fdt_setprop_sized_cells(s->fdt, name, "reg",
|
||||
2, MM_PMC_EFUSE_CTRL,
|
||||
2, MM_PMC_EFUSE_CTRL_SIZE);
|
||||
qemu_fdt_setprop(s->fdt, name, "compatible", compat, sizeof(compat));
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
static void fdt_add_efuse_cache_node(VersalVirt *s)
|
||||
{
|
||||
const char compat[] = TYPE_XLNX_VERSAL_EFUSE_CACHE;
|
||||
char *name = g_strdup_printf("/xlnx_pmc_efuse_cache@%x",
|
||||
MM_PMC_EFUSE_CACHE);
|
||||
|
||||
qemu_fdt_add_subnode(s->fdt, name);
|
||||
|
||||
qemu_fdt_setprop_sized_cells(s->fdt, name, "reg",
|
||||
2, MM_PMC_EFUSE_CACHE,
|
||||
2, MM_PMC_EFUSE_CACHE_SIZE);
|
||||
qemu_fdt_setprop(s->fdt, name, "compatible", compat, sizeof(compat));
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
static void fdt_nop_memory_nodes(void *fdt, Error **errp)
|
||||
{
|
||||
Error *err = NULL;
|
||||
@@ -510,6 +565,30 @@ static void create_virtio_regions(VersalVirt *s)
|
||||
}
|
||||
}
|
||||
|
||||
static void bbram_attach_drive(XlnxBBRam *dev)
|
||||
{
|
||||
DriveInfo *dinfo;
|
||||
BlockBackend *blk;
|
||||
|
||||
dinfo = drive_get_by_index(IF_PFLASH, 0);
|
||||
blk = dinfo ? blk_by_legacy_dinfo(dinfo) : NULL;
|
||||
if (blk) {
|
||||
qdev_prop_set_drive(DEVICE(dev), "drive", blk);
|
||||
}
|
||||
}
|
||||
|
||||
static void efuse_attach_drive(XlnxEFuse *dev)
|
||||
{
|
||||
DriveInfo *dinfo;
|
||||
BlockBackend *blk;
|
||||
|
||||
dinfo = drive_get_by_index(IF_PFLASH, 1);
|
||||
blk = dinfo ? blk_by_legacy_dinfo(dinfo) : NULL;
|
||||
if (blk) {
|
||||
qdev_prop_set_drive(DEVICE(dev), "drive", blk);
|
||||
}
|
||||
}
|
||||
|
||||
static void sd_plugin_card(SDHCIState *sd, DriveInfo *di)
|
||||
{
|
||||
BlockBackend *blk = di ? blk_by_legacy_dinfo(di) : NULL;
|
||||
@@ -570,6 +649,9 @@ static void versal_virt_init(MachineState *machine)
|
||||
fdt_add_usb_xhci_nodes(s);
|
||||
fdt_add_sd_nodes(s);
|
||||
fdt_add_rtc_node(s);
|
||||
fdt_add_bbram_node(s);
|
||||
fdt_add_efuse_ctrl_node(s);
|
||||
fdt_add_efuse_cache_node(s);
|
||||
fdt_add_cpu_nodes(s, psci_conduit);
|
||||
fdt_add_clk_node(s, "/clk125", 125000000, s->phandle.clk_125Mhz);
|
||||
fdt_add_clk_node(s, "/clk25", 25000000, s->phandle.clk_25Mhz);
|
||||
@@ -579,6 +661,12 @@ static void versal_virt_init(MachineState *machine)
|
||||
memory_region_add_subregion_overlap(get_system_memory(),
|
||||
0, &s->soc.fpd.apu.mr, 0);
|
||||
|
||||
/* Attach bbram backend, if given */
|
||||
bbram_attach_drive(&s->soc.pmc.bbram);
|
||||
|
||||
/* Attach efuse backend, if given */
|
||||
efuse_attach_drive(&s->soc.pmc.efuse);
|
||||
|
||||
/* Plugin SD cards. */
|
||||
for (i = 0; i < ARRAY_SIZE(s->soc.pmc.iou.sd); i++) {
|
||||
sd_plugin_card(&s->soc.pmc.iou.sd[i], drive_get_next(IF_SD));
|
||||
|
||||
@@ -314,6 +314,61 @@ static void versal_create_xrams(Versal *s, qemu_irq *pic)
|
||||
}
|
||||
}
|
||||
|
||||
static void versal_create_bbram(Versal *s, qemu_irq *pic)
|
||||
{
|
||||
SysBusDevice *sbd;
|
||||
|
||||
object_initialize_child_with_props(OBJECT(s), "bbram", &s->pmc.bbram,
|
||||
sizeof(s->pmc.bbram), TYPE_XLNX_BBRAM,
|
||||
&error_fatal,
|
||||
"crc-zpads", "0",
|
||||
NULL);
|
||||
sbd = SYS_BUS_DEVICE(&s->pmc.bbram);
|
||||
|
||||
sysbus_realize(sbd, &error_fatal);
|
||||
memory_region_add_subregion(&s->mr_ps, MM_PMC_BBRAM_CTRL,
|
||||
sysbus_mmio_get_region(sbd, 0));
|
||||
sysbus_connect_irq(sbd, 0, pic[VERSAL_BBRAM_APB_IRQ_0]);
|
||||
}
|
||||
|
||||
static void versal_realize_efuse_part(Versal *s, Object *dev, hwaddr base)
|
||||
{
|
||||
SysBusDevice *part = SYS_BUS_DEVICE(dev);
|
||||
|
||||
object_property_set_link(OBJECT(part), "efuse",
|
||||
OBJECT(&s->pmc.efuse), &error_abort);
|
||||
|
||||
sysbus_realize(part, &error_abort);
|
||||
memory_region_add_subregion(&s->mr_ps, base,
|
||||
sysbus_mmio_get_region(part, 0));
|
||||
}
|
||||
|
||||
static void versal_create_efuse(Versal *s, qemu_irq *pic)
|
||||
{
|
||||
Object *bits = OBJECT(&s->pmc.efuse);
|
||||
Object *ctrl = OBJECT(&s->pmc.efuse_ctrl);
|
||||
Object *cache = OBJECT(&s->pmc.efuse_cache);
|
||||
|
||||
object_initialize_child(OBJECT(s), "efuse-ctrl", &s->pmc.efuse_ctrl,
|
||||
TYPE_XLNX_VERSAL_EFUSE_CTRL);
|
||||
|
||||
object_initialize_child(OBJECT(s), "efuse-cache", &s->pmc.efuse_cache,
|
||||
TYPE_XLNX_VERSAL_EFUSE_CACHE);
|
||||
|
||||
object_initialize_child_with_props(ctrl, "xlnx-efuse@0", bits,
|
||||
sizeof(s->pmc.efuse),
|
||||
TYPE_XLNX_EFUSE, &error_abort,
|
||||
"efuse-nr", "3",
|
||||
"efuse-size", "8192",
|
||||
NULL);
|
||||
|
||||
qdev_realize(DEVICE(bits), NULL, &error_abort);
|
||||
versal_realize_efuse_part(s, ctrl, MM_PMC_EFUSE_CTRL);
|
||||
versal_realize_efuse_part(s, cache, MM_PMC_EFUSE_CACHE);
|
||||
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(ctrl), 0, pic[VERSAL_EFUSE_IRQ]);
|
||||
}
|
||||
|
||||
/* This takes the board allocated linear DDR memory and creates aliases
|
||||
* for each split DDR range/aperture on the Versal address map.
|
||||
*/
|
||||
@@ -402,6 +457,8 @@ static void versal_realize(DeviceState *dev, Error **errp)
|
||||
versal_create_sds(s, pic);
|
||||
versal_create_rtc(s, pic);
|
||||
versal_create_xrams(s, pic);
|
||||
versal_create_bbram(s, pic);
|
||||
versal_create_efuse(s, pic);
|
||||
versal_map_ddr(s);
|
||||
versal_unimp(s);
|
||||
|
||||
|
||||
@@ -98,6 +98,30 @@ static void zcu102_modify_dtb(const struct arm_boot_info *binfo, void *fdt)
|
||||
}
|
||||
}
|
||||
|
||||
static void bbram_attach_drive(XlnxBBRam *dev)
|
||||
{
|
||||
DriveInfo *dinfo;
|
||||
BlockBackend *blk;
|
||||
|
||||
dinfo = drive_get_by_index(IF_PFLASH, 2);
|
||||
blk = dinfo ? blk_by_legacy_dinfo(dinfo) : NULL;
|
||||
if (blk) {
|
||||
qdev_prop_set_drive(DEVICE(dev), "drive", blk);
|
||||
}
|
||||
}
|
||||
|
||||
static void efuse_attach_drive(XlnxEFuse *dev)
|
||||
{
|
||||
DriveInfo *dinfo;
|
||||
BlockBackend *blk;
|
||||
|
||||
dinfo = drive_get_by_index(IF_PFLASH, 3);
|
||||
blk = dinfo ? blk_by_legacy_dinfo(dinfo) : NULL;
|
||||
if (blk) {
|
||||
qdev_prop_set_drive(DEVICE(dev), "drive", blk);
|
||||
}
|
||||
}
|
||||
|
||||
static void xlnx_zcu102_init(MachineState *machine)
|
||||
{
|
||||
XlnxZCU102 *s = ZCU102_MACHINE(machine);
|
||||
@@ -136,6 +160,12 @@ static void xlnx_zcu102_init(MachineState *machine)
|
||||
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
|
||||
|
||||
/* Attach bbram backend, if given */
|
||||
bbram_attach_drive(&s->soc.bbram);
|
||||
|
||||
/* Attach efuse backend, if given */
|
||||
efuse_attach_drive(&s->soc.efuse);
|
||||
|
||||
/* Create and plug in the SD cards */
|
||||
for (i = 0; i < XLNX_ZYNQMP_NUM_SDHCI; i++) {
|
||||
BusState *bus;
|
||||
|
||||
@@ -66,6 +66,12 @@
|
||||
#define RTC_ADDR 0xffa60000
|
||||
#define RTC_IRQ 26
|
||||
|
||||
#define BBRAM_ADDR 0xffcd0000
|
||||
#define BBRAM_IRQ 11
|
||||
|
||||
#define EFUSE_ADDR 0xffcc0000
|
||||
#define EFUSE_IRQ 87
|
||||
|
||||
#define SDHCI_CAPABILITIES 0x280737ec6481 /* Datasheet: UG1085 (v1.7) */
|
||||
|
||||
static const uint64_t gem_addr[XLNX_ZYNQMP_NUM_GEMS] = {
|
||||
@@ -226,6 +232,47 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
|
||||
qdev_realize(DEVICE(&s->rpu_cluster), NULL, &error_fatal);
|
||||
}
|
||||
|
||||
static void xlnx_zynqmp_create_bbram(XlnxZynqMPState *s, qemu_irq *gic)
|
||||
{
|
||||
SysBusDevice *sbd;
|
||||
|
||||
object_initialize_child_with_props(OBJECT(s), "bbram", &s->bbram,
|
||||
sizeof(s->bbram), TYPE_XLNX_BBRAM,
|
||||
&error_fatal,
|
||||
"crc-zpads", "1",
|
||||
NULL);
|
||||
sbd = SYS_BUS_DEVICE(&s->bbram);
|
||||
|
||||
sysbus_realize(sbd, &error_fatal);
|
||||
sysbus_mmio_map(sbd, 0, BBRAM_ADDR);
|
||||
sysbus_connect_irq(sbd, 0, gic[BBRAM_IRQ]);
|
||||
}
|
||||
|
||||
static void xlnx_zynqmp_create_efuse(XlnxZynqMPState *s, qemu_irq *gic)
|
||||
{
|
||||
Object *bits = OBJECT(&s->efuse);
|
||||
Object *ctrl = OBJECT(&s->efuse_ctrl);
|
||||
SysBusDevice *sbd;
|
||||
|
||||
object_initialize_child(OBJECT(s), "efuse-ctrl", &s->efuse_ctrl,
|
||||
TYPE_XLNX_ZYNQMP_EFUSE);
|
||||
|
||||
object_initialize_child_with_props(ctrl, "xlnx-efuse@0", bits,
|
||||
sizeof(s->efuse),
|
||||
TYPE_XLNX_EFUSE, &error_abort,
|
||||
"efuse-nr", "3",
|
||||
"efuse-size", "2048",
|
||||
NULL);
|
||||
|
||||
qdev_realize(DEVICE(bits), NULL, &error_abort);
|
||||
object_property_set_link(ctrl, "efuse", bits, &error_abort);
|
||||
|
||||
sbd = SYS_BUS_DEVICE(ctrl);
|
||||
sysbus_realize(sbd, &error_abort);
|
||||
sysbus_mmio_map(sbd, 0, EFUSE_ADDR);
|
||||
sysbus_connect_irq(sbd, 0, gic[EFUSE_IRQ]);
|
||||
}
|
||||
|
||||
static void xlnx_zynqmp_create_unimp_mmio(XlnxZynqMPState *s)
|
||||
{
|
||||
static const struct UnimpInfo {
|
||||
@@ -626,6 +673,8 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, RTC_ADDR);
|
||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->rtc), 0, gic_spi[RTC_IRQ]);
|
||||
|
||||
xlnx_zynqmp_create_bbram(s, gic_spi);
|
||||
xlnx_zynqmp_create_efuse(s, gic_spi);
|
||||
xlnx_zynqmp_create_unimp_mmio(s);
|
||||
|
||||
for (i = 0; i < XLNX_ZYNQMP_NUM_GDMA_CH; i++) {
|
||||
|
||||
@@ -52,7 +52,7 @@ void hda_codec_bus_init(DeviceState *dev, HDACodecBus *bus, size_t bus_size,
|
||||
hda_codec_response_func response,
|
||||
hda_codec_xfer_func xfer)
|
||||
{
|
||||
qbus_create_inplace(bus, bus_size, TYPE_HDA_BUS, dev, NULL);
|
||||
qbus_init(bus, bus_size, TYPE_HDA_BUS, dev, NULL);
|
||||
bus->response = response;
|
||||
bus->xfer = xfer;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user