mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
aspeed/scu: Introduce per-SoC SCU types
and use a class AspeedSCUClass to define each SoC characteristics. Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-id: 20190904070506.1052-10-clg@kaod.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
ae275f7133
commit
9a937f6cc4
3 changed files with 64 additions and 37 deletions
|
@ -15,6 +15,8 @@
|
|||
|
||||
#define TYPE_ASPEED_SCU "aspeed.scu"
|
||||
#define ASPEED_SCU(obj) OBJECT_CHECK(AspeedSCUState, (obj), TYPE_ASPEED_SCU)
|
||||
#define TYPE_ASPEED_2400_SCU TYPE_ASPEED_SCU "-ast2400"
|
||||
#define TYPE_ASPEED_2500_SCU TYPE_ASPEED_SCU "-ast2500"
|
||||
|
||||
#define ASPEED_SCU_NR_REGS (0x1A8 >> 2)
|
||||
|
||||
|
@ -45,6 +47,19 @@ typedef struct AspeedSCUState {
|
|||
|
||||
extern bool is_supported_silicon_rev(uint32_t silicon_rev);
|
||||
|
||||
#define ASPEED_SCU_CLASS(klass) \
|
||||
OBJECT_CLASS_CHECK(AspeedSCUClass, (klass), TYPE_ASPEED_SCU)
|
||||
#define ASPEED_SCU_GET_CLASS(obj) \
|
||||
OBJECT_GET_CLASS(AspeedSCUClass, (obj), TYPE_ASPEED_SCU)
|
||||
|
||||
typedef struct AspeedSCUClass {
|
||||
SysBusDeviceClass parent_class;
|
||||
|
||||
const uint32_t *resets;
|
||||
uint32_t (*calc_hpll)(AspeedSCUState *s);
|
||||
uint32_t apb_divider;
|
||||
} AspeedSCUClass;
|
||||
|
||||
#define ASPEED_SCU_PROT_KEY 0x1688A8A8
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue