hw/misc: Add nr_regs and cold_reset_values to NPCM CLK

These 2 values are different between NPCM7XX and NPCM8XX
CLKs. So we add them to the class and assign different values
to them.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Hao Wu <wuhaotsh@google.com>
Message-id: 20250219184609.1839281-13-wuhaotsh@google.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Hao Wu 2025-02-19 10:46:03 -08:00 committed by Peter Maydell
parent ca6d6a94f4
commit cf76c4e174
3 changed files with 22 additions and 7 deletions

View file

@ -175,8 +175,15 @@ struct NPCMCLKState {
Clock *clkref;
};
typedef struct NPCMCLKClass {
SysBusDeviceClass parent;
size_t nr_regs;
const uint32_t *cold_reset_values;
} NPCMCLKClass;
#define TYPE_NPCM_CLK "npcm-clk"
OBJECT_DECLARE_SIMPLE_TYPE(NPCMCLKState, NPCM_CLK)
OBJECT_DECLARE_TYPE(NPCMCLKState, NPCMCLKClass, NPCM_CLK)
#define TYPE_NPCM7XX_CLK "npcm7xx-clk"
#endif /* NPCM_CLK_H */