diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2019-09-16 10:15:15 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2019-09-16 10:15:15 +0100 |
| commit | dd25f97c66a75d1508f1d4c6478ed2c95bec428f (patch) | |
| tree | 8ee113ea80fbae31c8b9d3edbe2500cb5486f5d2 /include/hw/misc/aspeed_scu.h | |
| parent | 138985c1ef8b66e4e5b383354e133e05d01d0b5f (diff) | |
| parent | 27a296fce9821e3608d537756cffa6e43a46df3b (diff) | |
| download | focaccia-qemu-dd25f97c66a75d1508f1d4c6478ed2c95bec428f.tar.gz focaccia-qemu-dd25f97c66a75d1508f1d4c6478ed2c95bec428f.zip | |
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190913' into staging
target-arm queue: * aspeed: add a GPIO controller to the SoC * aspeed: Various refactorings * aspeed: Improve DMA controller modelling * atomic_template: fix indentation in GEN_ATOMIC_HELPER * qemu-ga: Convert invocation documentation to rST # gpg: Signature made Fri 13 Sep 2019 16:49:05 BST # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "peter.maydell@linaro.org" # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@gmail.com>" [ultimate] # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20190913: qemu-ga: Convert invocation documentation to rST atomic_template: fix indentation in GEN_ATOMIC_HELPER aspeed/scu: Introduce a aspeed_scu_get_apb_freq() routine aspeed/scu: Introduce per-SoC SCU types aspeed/smc: Calculate checksum on normal DMA aspeed/smc: Inject errors in DMA checksum aspeed/smc: Add DMA calibration settings aspeed/smc: Add support for DMAs aspeed: Use consistent typenames aspeed: Remove unused SoC definitions aspeed: add a GPIO controller to the SoC hw/gpio: Add basic Aspeed GPIO model for AST2400 and AST2500 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw/misc/aspeed_scu.h')
| -rw-r--r-- | include/hw/misc/aspeed_scu.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h index 38996adc59..239e94fe2c 100644 --- a/include/hw/misc/aspeed_scu.h +++ b/include/hw/misc/aspeed_scu.h @@ -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) @@ -30,10 +32,6 @@ typedef struct AspeedSCUState { uint32_t hw_strap1; uint32_t hw_strap2; uint32_t hw_prot_key; - - uint32_t clkin; - uint32_t hpll; - uint32_t apb_freq; } AspeedSCUState; #define AST2400_A0_SILICON_REV 0x02000303U @@ -45,8 +43,23 @@ 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 hpll_reg); + uint32_t apb_divider; +} AspeedSCUClass; + #define ASPEED_SCU_PROT_KEY 0x1688A8A8 +uint32_t aspeed_scu_get_apb_freq(AspeedSCUState *s); + /* * Extracted from Aspeed SDK v00.03.21. Fixes and extra definitions * were added. |