On Thu, 26 Dec 2024 at 08:28, Hao Wu <wuhao...@google.com> wrote: > > These 2 values are different between NPCM7XX and NPCM8XX > CLKs. So we add them to the class and assign different values > to them. > > Signed-off-by: Hao Wu <wuhao...@google.com> > --- > hw/misc/npcm_clk.c | 17 +++++++++++------ > include/hw/misc/npcm_clk.h | 9 ++++++++- > 2 files changed, 19 insertions(+), 7 deletions(-) >
> @@ -870,10 +872,9 @@ static const struct MemoryRegionOps npcm_clk_ops = { > static void npcm_clk_enter_reset(Object *obj, ResetType type) > { > NPCMCLKState *s = NPCM_CLK(obj); > + NPCMCLKClass *c = NPCM_CLK_GET_CLASS(s); > > - QEMU_BUILD_BUG_ON(sizeof(s->regs) != sizeof(cold_reset_values)); > - > - memcpy(s->regs, cold_reset_values, sizeof(cold_reset_values)); > + memcpy(s->regs, c->cold_reset_values, sizeof(s->regs)); Same remark about an assert as in the other patch. Otherwise Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM