aboutsummaryrefslogtreecommitdiff
path: root/include/hw/misc
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2019-09-04 09:05:05 +0200
committerPeter Maydell <peter.maydell@linaro.org>2019-09-13 16:05:01 +0100
commit9a937f6cc4c18a335e813882d15c83252d611042 (patch)
tree1f74f5b1b863010fd3f2f85b05163cfd3ce7e673 /include/hw/misc
parentae275f71338ad4e567c7f2683bf28e66847eabe4 (diff)
downloadqemu-9a937f6cc4c18a335e813882d15c83252d611042.zip
qemu-9a937f6cc4c18a335e813882d15c83252d611042.tar.gz
qemu-9a937f6cc4c18a335e813882d15c83252d611042.tar.bz2
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>
Diffstat (limited to 'include/hw/misc')
-rw-r--r--include/hw/misc/aspeed_scu.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h
index 38996ad..90dd4da 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)
@@ -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
/*