mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
hw/arm: xlnx-versal-virt: Add Xilinx eFUSE device
Connect the support for Versal eFUSE one-time field-programmable bit array. The command argument: -drive if=pflash,index=1,... Can be used to optionally connect the bit array to a backend storage, such that field-programmed values in one invocation can be made available to next invocation. The backend storage must be a seekable binary file, and its size must be 3072 bytes or larger. A file with all binary 0's is a 'blank'. Signed-off-by: Tong Ho <tong.ho@xilinx.com> Message-id: 20210917052400.1249094-7-tong.ho@xilinx.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
393185bc9d
commit
5f4910ff12
4 changed files with 102 additions and 0 deletions
|
@ -331,6 +331,44 @@ static void versal_create_bbram(Versal *s, qemu_irq *pic)
|
|||
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.
|
||||
*/
|
||||
|
@ -420,6 +458,7 @@ static void versal_realize(DeviceState *dev, Error **errp)
|
|||
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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue