On Tue, Aug 19, 2025 at 5:44 PM Peter Maydell <[email protected]> wrote:
> On Fri, 15 Aug 2025 at 10:01, Corvin Köhne <[email protected]> > wrote: > > > > From: YannickV <[email protected]> > > > > A dummy DDR controller for ZYNQ has been added. While all registers are > present, > > not all are functional. Read and write access is validated, and the user > mode > > can be set. This provides a basic DDR controller initialization, > preventing > > system hangs due to endless polling or similar issues. > > > > Signed-off-by: Yannick Voßen <[email protected]> > > --- > > hw/misc/Kconfig | 3 + > > hw/misc/meson.build | 1 + > > hw/misc/xlnx-zynq-ddrc.c | 393 +++++++++++++++++++++++++++++++ > > include/hw/misc/xlnx-zynq-ddrc.h | 140 +++++++++++ > > 4 files changed, 537 insertions(+) > > create mode 100644 hw/misc/xlnx-zynq-ddrc.c > > create mode 100644 include/hw/misc/xlnx-zynq-ddrc.h > > > > diff --git a/hw/misc/Kconfig b/hw/misc/Kconfig > > index 8f9ce2f68c..99548e146f 100644 > > --- a/hw/misc/Kconfig > > +++ b/hw/misc/Kconfig > > @@ -220,4 +220,7 @@ config IOSB > > config XLNX_VERSAL_TRNG > > bool > > > > +config XLNX_ZYNQ_DDRC > > + bool > > + > > source macio/Kconfig > > diff --git a/hw/misc/meson.build b/hw/misc/meson.build > > index 55f493521b..6ee7b6c71d 100644 > > --- a/hw/misc/meson.build > > +++ b/hw/misc/meson.build > > @@ -89,6 +89,7 @@ system_ss.add(when: 'CONFIG_RASPI', if_true: files( > > )) > > system_ss.add(when: 'CONFIG_SLAVIO', if_true: files('slavio_misc.c')) > > system_ss.add(when: 'CONFIG_ZYNQ', if_true: files('zynq_slcr.c')) > > +system_ss.add(when: 'CONFIG_ZYNQ', if_true: files('xlnx-zynq-ddrc.c')) > > system_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: > files('xlnx-zynqmp-crf.c')) > > system_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: > files('xlnx-zynqmp-apu-ctrl.c')) > > system_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files( > > diff --git a/hw/misc/xlnx-zynq-ddrc.c b/hw/misc/xlnx-zynq-ddrc.c > > new file mode 100644 > > index 0000000000..8151a0e3ee > > --- /dev/null > > +++ b/hw/misc/xlnx-zynq-ddrc.c > > All new files must start with a comment which at least > (a) says what the file is for and (b) has the SPDX > license indicator. You can optionally also add an authorship > or copyright line here if you/your employer need that. > > Same applies to the .h file. > > > +static void zynq_ddrctrl_class_init(ObjectClass *klass, void *data) > > +{ > > + DeviceClass *dc = DEVICE_CLASS(klass); > > + > > + device_class_set_legacy_reset(dc, zynq_ddrctrl_reset); > > +} > > This looks like it's missing registration of a vmstate > struct for state save/load. > > thanks > -- PMM > Except for the stuff that Peter mentions, the rest looks good to me! Cheers, Edgar
