mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
aspeed/sdmc: Add AST2700 support
The SDRAM memory controller(DRAMC) controls the access to external DDR4 and DDR5 SDRAM and power up to DDR4 and DDR5 PHY. The DRAM memory controller of AST2700 is not backward compatible to previous chips such AST2600, AST2500 and AST2400. Max memory is now 8GiB on the AST2700. Introduce new aspeed_2700_sdmc and class with read/write operation and reset handlers. Define DRAMC necessary protected registers and unprotected registers for AST2700 and increase the register set to 0x1000. Add unlocked property to change controller protected status. Incrementing the version of vmstate to 2. Signed-off-by: Troy Lee <troy_lee@aspeedtech.com> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Reviewed-by: Cédric Le Goater <clg@kaod.org>
This commit is contained in:
parent
39e6dc52a8
commit
3347b9a1f7
2 changed files with 195 additions and 4 deletions
|
@ -17,6 +17,7 @@ OBJECT_DECLARE_TYPE(AspeedSDMCState, AspeedSDMCClass, ASPEED_SDMC)
|
|||
#define TYPE_ASPEED_2400_SDMC TYPE_ASPEED_SDMC "-ast2400"
|
||||
#define TYPE_ASPEED_2500_SDMC TYPE_ASPEED_SDMC "-ast2500"
|
||||
#define TYPE_ASPEED_2600_SDMC TYPE_ASPEED_SDMC "-ast2600"
|
||||
#define TYPE_ASPEED_2700_SDMC TYPE_ASPEED_SDMC "-ast2700"
|
||||
|
||||
/*
|
||||
* SDMC has 174 documented registers. In addition the u-boot device tree
|
||||
|
@ -29,7 +30,7 @@ OBJECT_DECLARE_TYPE(AspeedSDMCState, AspeedSDMCClass, ASPEED_SDMC)
|
|||
* time, and the other is in the DDR-PHY IP which is used during DDR-PHY
|
||||
* training.
|
||||
*/
|
||||
#define ASPEED_SDMC_NR_REGS (0x500 >> 2)
|
||||
#define ASPEED_SDMC_NR_REGS (0x1000 >> 2)
|
||||
|
||||
struct AspeedSDMCState {
|
||||
/*< private >*/
|
||||
|
@ -41,6 +42,7 @@ struct AspeedSDMCState {
|
|||
uint32_t regs[ASPEED_SDMC_NR_REGS];
|
||||
uint64_t ram_size;
|
||||
uint64_t max_ram_size;
|
||||
bool unlocked;
|
||||
};
|
||||
|
||||
|
||||
|
@ -51,6 +53,7 @@ struct AspeedSDMCClass {
|
|||
const uint64_t *valid_ram_sizes;
|
||||
uint32_t (*compute_conf)(AspeedSDMCState *s, uint32_t data);
|
||||
void (*write)(AspeedSDMCState *s, uint32_t reg, uint32_t data);
|
||||
bool is_bus64bit;
|
||||
};
|
||||
|
||||
#endif /* ASPEED_SDMC_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue