From f5eb90e90ae90220f943c90330d825d7f55c1d87 Mon Sep 17 00:00:00 2001 From: zhujiale <945386260@qq.com> Date: Mon, 18 Nov 2024 17:20:54 +0800 Subject: [PATCH] fix when using rt_smart CLK_EN_0 have no ioremap --- bsp/cvitek/drivers/drv_rtc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bsp/cvitek/drivers/drv_rtc.c b/bsp/cvitek/drivers/drv_rtc.c index a3388afc556..b0ac3419bbd 100644 --- a/bsp/cvitek/drivers/drv_rtc.c +++ b/bsp/cvitek/drivers/drv_rtc.c @@ -90,16 +90,18 @@ static int rtc_month_days(unsigned int month, unsigned int year) static void hal_cvi_rtc_clk_set(int enable) { + rt_ubase_t clk = (rt_ubase_t)DRV_IOREMAP((void *)CLK_EN_0,0x1000); + uint32_t clk_state; - clk_state = mmio_read_32((long unsigned int)CLK_EN_0); + clk_state = mmio_read_32(clk); if(enable) clk_state |= CLK_RTC_25M_BIT; else clk_state &= ~(CLK_RTC_25M_BIT); - mmio_write_32((long unsigned int)CLK_EN_0, clk_state); + mmio_write_32(clk, clk_state); } static void hal_cvi_rtc_enable_sec_counter(uintptr_t rtc_base)