Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cvitek] fix when using rt_smart CLK_EN_0 have no ioremap #9664

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bsp/cvitek/drivers/drv_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading