[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/19] hw: aspeed_scu: Introduce clkin_25Mhz attribute
From: |
Cédric Le Goater |
Subject: |
[PULL 02/19] hw: aspeed_scu: Introduce clkin_25Mhz attribute |
Date: |
Tue, 3 May 2022 08:58:31 +0200 |
From: Steven Lee <steven_lee@aspeedtech.com>
AST2600 clkin is always 25MHz, introduce clkin_25Mhz attribute
for aspeed_scu_get_clkin() to return the correct clkin for ast2600.
Signed-off-by: Steven Lee <steven_lee@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220315075753.8591-3-steven_lee@aspeedtech.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/hw/misc/aspeed_scu.h | 1 +
hw/misc/aspeed_scu.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h
index 8c4c8c8d5cbb..6d3f86c1abab 100644
--- a/include/hw/misc/aspeed_scu.h
+++ b/include/hw/misc/aspeed_scu.h
@@ -59,6 +59,7 @@ struct AspeedSCUClass {
uint32_t (*get_apb)(AspeedSCUState *s);
uint32_t apb_divider;
uint32_t nr_regs;
+ bool clkin_25Mhz;
const MemoryRegionOps *ops;
};
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
index d65f86df3d12..150567f98a74 100644
--- a/hw/misc/aspeed_scu.c
+++ b/hw/misc/aspeed_scu.c
@@ -371,7 +371,8 @@ static const MemoryRegionOps aspeed_ast2500_scu_ops = {
static uint32_t aspeed_scu_get_clkin(AspeedSCUState *s)
{
- if (s->hw_strap1 & SCU_HW_STRAP_CLK_25M_IN) {
+ if (s->hw_strap1 & SCU_HW_STRAP_CLK_25M_IN ||
+ ASPEED_SCU_GET_CLASS(s)->clkin_25Mhz) {
return 25000000;
} else if (s->hw_strap1 & SCU_HW_STRAP_CLK_48M_IN) {
return 48000000;
@@ -562,6 +563,7 @@ static void aspeed_2400_scu_class_init(ObjectClass *klass,
void *data)
asc->get_apb = aspeed_2400_scu_get_apb_freq;
asc->apb_divider = 2;
asc->nr_regs = ASPEED_SCU_NR_REGS;
+ asc->clkin_25Mhz = false;
asc->ops = &aspeed_ast2400_scu_ops;
}
@@ -583,6 +585,7 @@ static void aspeed_2500_scu_class_init(ObjectClass *klass,
void *data)
asc->get_apb = aspeed_2400_scu_get_apb_freq;
asc->apb_divider = 4;
asc->nr_regs = ASPEED_SCU_NR_REGS;
+ asc->clkin_25Mhz = false;
asc->ops = &aspeed_ast2500_scu_ops;
}
@@ -756,6 +759,7 @@ static void aspeed_2600_scu_class_init(ObjectClass *klass,
void *data)
asc->get_apb = aspeed_2600_scu_get_apb_freq;
asc->apb_divider = 4;
asc->nr_regs = ASPEED_AST2600_SCU_NR_REGS;
+ asc->clkin_25Mhz = true;
asc->ops = &aspeed_ast2600_scu_ops;
}
--
2.35.1
- [PULL 00/19] aspeed queue, Cédric Le Goater, 2022/05/03
- [PULL 01/19] hw: aspeed_scu: Add AST2600 apb_freq and hpll calculation function, Cédric Le Goater, 2022/05/03
- [PULL 03/19] aspeed: sbc: Correct default reset values, Cédric Le Goater, 2022/05/03
- [PULL 02/19] hw: aspeed_scu: Introduce clkin_25Mhz attribute,
Cédric Le Goater <=
- [PULL 04/19] aspeed: Add eMMC Boot Controller stub, Cédric Le Goater, 2022/05/03
- [PULL 06/19] aspeed/smc: Add AST1030 support, Cédric Le Goater, 2022/05/03
- [PULL 05/19] aspeed/adc: Add AST1030 support, Cédric Le Goater, 2022/05/03
- [PULL 07/19] aspeed/wdt: Fix ast2500/ast2600 default reload value, Cédric Le Goater, 2022/05/03
- [PULL 08/19] aspeed/wdt: Add AST1030 support, Cédric Le Goater, 2022/05/03
- [PULL 11/19] aspeed/soc : Add AST1030 support, Cédric Le Goater, 2022/05/03
- [PULL 09/19] aspeed/timer: Add AST1030 support, Cédric Le Goater, 2022/05/03
- [PULL 12/19] aspeed: Add an AST1030 eval board, Cédric Le Goater, 2022/05/03
- [PULL 10/19] aspeed/scu: Add AST1030 support, Cédric Le Goater, 2022/05/03
- [PULL 13/19] test/avocado/machine_aspeed.py: Add ast1030 test case, Cédric Le Goater, 2022/05/03