[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 15/25] hw/arm/musca: Create and connect ARMSSE Clocks
From: |
Peter Maydell |
Subject: |
[PATCH v2 15/25] hw/arm/musca: Create and connect ARMSSE Clocks |
Date: |
Thu, 28 Jan 2021 11:41:35 +0000 |
Create and connect the two clocks needed by the ARMSSE.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Luc Michel <luc@lmichel.fr>
Message-id: 20210121190622.22000-16-peter.maydell@linaro.org
---
hw/arm/musca.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/arm/musca.c b/hw/arm/musca.c
index d82bef11cf2..a9292482a06 100644
--- a/hw/arm/musca.c
+++ b/hw/arm/musca.c
@@ -33,6 +33,7 @@
#include "hw/misc/tz-ppc.h"
#include "hw/misc/unimp.h"
#include "hw/rtc/pl031.h"
+#include "hw/qdev-clock.h"
#include "qom/object.h"
#define MUSCA_NUMIRQ_MAX 96
@@ -82,6 +83,8 @@ struct MuscaMachineState {
UnimplementedDeviceState sdio;
UnimplementedDeviceState gpio;
UnimplementedDeviceState cryptoisland;
+ Clock *sysclk;
+ Clock *s32kclk;
};
#define TYPE_MUSCA_MACHINE "musca"
@@ -96,6 +99,8 @@ OBJECT_DECLARE_TYPE(MuscaMachineState, MuscaMachineClass,
MUSCA_MACHINE)
* don't model that in our SSE-200 model yet.
*/
#define SYSCLK_FRQ 40000000
+/* Slow 32Khz S32KCLK frequency in Hz */
+#define S32KCLK_FRQ (32 * 1000)
static qemu_irq get_sse_irq_in(MuscaMachineState *mms, int irqno)
{
@@ -367,6 +372,11 @@ static void musca_init(MachineState *machine)
exit(1);
}
+ mms->sysclk = clock_new(OBJECT(machine), "SYSCLK");
+ clock_set_hz(mms->sysclk, SYSCLK_FRQ);
+ mms->s32kclk = clock_new(OBJECT(machine), "S32KCLK");
+ clock_set_hz(mms->s32kclk, S32KCLK_FRQ);
+
object_initialize_child(OBJECT(machine), "sse-200", &mms->sse,
TYPE_SSE200);
ssedev = DEVICE(&mms->sse);
@@ -376,6 +386,8 @@ static void musca_init(MachineState *machine)
qdev_prop_set_uint32(ssedev, "init-svtor", mmc->init_svtor);
qdev_prop_set_uint32(ssedev, "SRAM_ADDR_WIDTH", mmc->sram_addr_width);
qdev_prop_set_uint32(ssedev, "MAINCLK_FRQ", SYSCLK_FRQ);
+ qdev_connect_clock_in(ssedev, "MAINCLK", mms->sysclk);
+ qdev_connect_clock_in(ssedev, "S32KCLK", mms->s32kclk);
/*
* Musca-A takes the default SSE-200 FPU/DSP settings (ie no for
* CPU0 and yes for CPU1); Musca-B1 explicitly enables them for CPU0.
--
2.20.1
- [PATCH v2 06/25] hw/timer/cmsdk-apb-timer: Rename CMSDKAPBTIMER struct to CMSDKAPBTimer, (continued)
- [PATCH v2 06/25] hw/timer/cmsdk-apb-timer: Rename CMSDKAPBTIMER struct to CMSDKAPBTimer, Peter Maydell, 2021/01/28
- [PATCH v2 08/25] hw/timer/cmsdk-apb-dualtimer: Add Clock input, Peter Maydell, 2021/01/28
- [PATCH v2 10/25] hw/arm/armsse: Rename "MAINCLK" property to "MAINCLK_FRQ", Peter Maydell, 2021/01/28
- [PATCH v2 09/25] hw/watchdog/cmsdk-apb-watchdog: Add Clock input, Peter Maydell, 2021/01/28
- [PATCH v2 11/25] hw/arm/armsse: Wire up clocks, Peter Maydell, 2021/01/28
- [PATCH v2 13/25] hw/arm/mps2: Create and connect SYSCLK Clock, Peter Maydell, 2021/01/28
- [PATCH v2 12/25] hw/arm/mps2: Inline CMSDK_APB_TIMER creation, Peter Maydell, 2021/01/28
- [PATCH v2 16/25] hw/arm/stellaris: Convert SSYS to QOM device, Peter Maydell, 2021/01/28
- [PATCH v2 18/25] hw/timer/cmsdk-apb-timer: Convert to use Clock input, Peter Maydell, 2021/01/28
- [PATCH v2 19/25] hw/timer/cmsdk-apb-dualtimer: Convert to use Clock input, Peter Maydell, 2021/01/28
- [PATCH v2 15/25] hw/arm/musca: Create and connect ARMSSE Clocks,
Peter Maydell <=
- [PATCH v2 14/25] hw/arm/mps2-tz: Create and connect ARMSSE Clocks, Peter Maydell, 2021/01/28
- [PATCH v2 17/25] hw/arm/stellaris: Create Clock input for watchdog, Peter Maydell, 2021/01/28
- [PATCH v2 20/25] hw/watchdog/cmsdk-apb-watchdog: Convert to use Clock input, Peter Maydell, 2021/01/28
- [PATCH v2 22/25] hw/arm/armsse: Use Clock to set system_clock_scale, Peter Maydell, 2021/01/28
- [PATCH v2 21/25] tests/qtest/cmsdk-apb-watchdog-test: Test clock changes, Peter Maydell, 2021/01/28
- [PATCH v2 23/25] arm: Don't set freq properties on CMSDK timer, dualtimer, watchdog, ARMSSE, Peter Maydell, 2021/01/28
- [PATCH v2 24/25] arm: Remove frq properties on CMSDK timer, dualtimer, watchdog, ARMSSE, Peter Maydell, 2021/01/28
- [PATCH v2 25/25] hw/arm/stellaris: Remove board-creation reset of STELLARIS_SYS, Peter Maydell, 2021/01/28
- Re: [PATCH v2 00/25] Convert CMSDK timer, watchdog, dualtimer to Clock framework, Philippe Mathieu-Daudé, 2021/01/28