[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/34] hw/timer/imx_epit: cleanup CR defines
From: |
Peter Maydell |
Subject: |
[PULL 11/34] hw/timer/imx_epit: cleanup CR defines |
Date: |
Thu, 5 Jan 2023 16:43:54 +0000 |
From: Axel Heider <axel.heider@hensoldt.net>
remove unused defines, add needed defines
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
include/hw/timer/imx_epit.h | 4 ++--
hw/timer/imx_epit.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/hw/timer/imx_epit.h b/include/hw/timer/imx_epit.h
index 2acc41e9822..e2cb96229be 100644
--- a/include/hw/timer/imx_epit.h
+++ b/include/hw/timer/imx_epit.h
@@ -43,7 +43,7 @@
#define CR_OCIEN (1 << 2)
#define CR_RLD (1 << 3)
#define CR_PRESCALE_SHIFT (4)
-#define CR_PRESCALE_MASK (0xfff)
+#define CR_PRESCALE_BITS (12)
#define CR_SWR (1 << 16)
#define CR_IOVW (1 << 17)
#define CR_DBGEN (1 << 18)
@@ -51,7 +51,7 @@
#define CR_DOZEN (1 << 20)
#define CR_STOPEN (1 << 21)
#define CR_CLKSRC_SHIFT (24)
-#define CR_CLKSRC_MASK (0x3 << CR_CLKSRC_SHIFT)
+#define CR_CLKSRC_BITS (2)
#define EPIT_TIMER_MAX 0XFFFFFFFFUL
diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c
index 2841fbaa1c8..661e9158e3b 100644
--- a/hw/timer/imx_epit.c
+++ b/hw/timer/imx_epit.c
@@ -82,8 +82,8 @@ static void imx_epit_set_freq(IMXEPITState *s)
uint32_t clksrc;
uint32_t prescaler;
- clksrc = extract32(s->cr, CR_CLKSRC_SHIFT, 2);
- prescaler = 1 + extract32(s->cr, CR_PRESCALE_SHIFT, 12);
+ clksrc = extract32(s->cr, CR_CLKSRC_SHIFT, CR_CLKSRC_BITS);
+ prescaler = 1 + extract32(s->cr, CR_PRESCALE_SHIFT, CR_PRESCALE_BITS);
s->freq = imx_ccm_get_clock_frequency(s->ccm,
imx_epit_clocks[clksrc]) / prescaler;
--
2.25.1
- [PULL 25/34] hw/arm/nseries: Constify various read-only arrays, (continued)
- [PULL 25/34] hw/arm/nseries: Constify various read-only arrays, Peter Maydell, 2023/01/05
- [PULL 23/34] target/arm: cleanup cpu includes, Peter Maydell, 2023/01/05
- [PULL 15/34] hw/timer/imx_epit: factor out register write handlers, Peter Maydell, 2023/01/05
- [PULL 21/34] target/arm: Remove unused includes from m_helper.c, Peter Maydell, 2023/01/05
- [PULL 22/34] target/arm: Remove unused includes from helper.c, Peter Maydell, 2023/01/05
- [PULL 20/34] target/arm: Fix checkpatch brace errors in helper.c, Peter Maydell, 2023/01/05
- [PULL 27/34] target/arm: align exposed ID registers with Linux, Peter Maydell, 2023/01/05
- [PULL 26/34] hw/arm/nseries: Silent -Wmissing-field-initializers warning, Peter Maydell, 2023/01/05
- [PULL 30/34] i.MX7D: Connect GPT timers to IRQ, Peter Maydell, 2023/01/05
- [PULL 33/34] i.MX7D: Connect IRQs to GPIO devices., Peter Maydell, 2023/01/05
- [PULL 11/34] hw/timer/imx_epit: cleanup CR defines,
Peter Maydell <=
- [PULL 34/34] hw/net: Fix read of uninitialized memory in imx_fec., Peter Maydell, 2023/01/05
- [PULL 18/34] target/arm: Fix checkpatch comment style warnings in helper.c, Peter Maydell, 2023/01/05
- [PULL 29/34] hw/arm/smmu-common: Avoid using inlined functions with external linkage, Peter Maydell, 2023/01/05
- [PULL 31/34] i.MX7D: Compute clock frequency for the fixed frequency clocks., Peter Maydell, 2023/01/05
- [PULL 28/34] hw/arm/smmu-common: Reduce smmu_inv_notifiers_mr() scope, Peter Maydell, 2023/01/05
- [PULL 32/34] i.MX6UL: Add a specific GPT timer instance for the i.MX6UL, Peter Maydell, 2023/01/05
- Re: [PULL 00/34] target-arm queue, Peter Maydell, 2023/01/06