mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
aspeed/sdmc: Introduce an object class per SoC
Use class handlers and class constants to differentiate the characteristics of the memory controller and remove the 'silicon_rev' property. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Joel Stanley <joel@jms.id.au> Message-id: 20190925143248.10000-9-clg@kaod.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
fadefada4d
commit
8e00d1a97d
3 changed files with 122 additions and 70 deletions
|
@ -13,6 +13,8 @@
|
|||
|
||||
#define TYPE_ASPEED_SDMC "aspeed.sdmc"
|
||||
#define ASPEED_SDMC(obj) OBJECT_CHECK(AspeedSDMCState, (obj), TYPE_ASPEED_SDMC)
|
||||
#define TYPE_ASPEED_2400_SDMC TYPE_ASPEED_SDMC "-ast2400"
|
||||
#define TYPE_ASPEED_2500_SDMC TYPE_ASPEED_SDMC "-ast2500"
|
||||
|
||||
#define ASPEED_SDMC_NR_REGS (0x174 >> 2)
|
||||
|
||||
|
@ -24,12 +26,21 @@ typedef struct AspeedSDMCState {
|
|||
MemoryRegion iomem;
|
||||
|
||||
uint32_t regs[ASPEED_SDMC_NR_REGS];
|
||||
uint32_t silicon_rev;
|
||||
uint32_t ram_bits;
|
||||
uint64_t ram_size;
|
||||
uint64_t max_ram_size;
|
||||
uint32_t fixed_conf;
|
||||
|
||||
} AspeedSDMCState;
|
||||
|
||||
#define ASPEED_SDMC_CLASS(klass) \
|
||||
OBJECT_CLASS_CHECK(AspeedSDMCClass, (klass), TYPE_ASPEED_SDMC)
|
||||
#define ASPEED_SDMC_GET_CLASS(obj) \
|
||||
OBJECT_GET_CLASS(AspeedSDMCClass, (obj), TYPE_ASPEED_SDMC)
|
||||
|
||||
typedef struct AspeedSDMCClass {
|
||||
SysBusDeviceClass parent_class;
|
||||
|
||||
uint64_t max_ram_size;
|
||||
uint32_t (*compute_conf)(AspeedSDMCState *s, uint32_t data);
|
||||
void (*write)(AspeedSDMCState *s, uint32_t reg, uint32_t data);
|
||||
} AspeedSDMCClass;
|
||||
|
||||
#endif /* ASPEED_SDMC_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue