refactor(st-clock): remove unused clk function in API

Remove the unused functions in stm32mp clk API:
- stm32mp_stgen_get_counter (change to static, no more exported)
- stm32mp_stgen_restore_counter

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ib6ca72723eac3e133f1ca0dee504ef344c72e0bf
This commit is contained in:
Patrick Delaunay 2023-10-11 16:41:33 +02:00 committed by Yann Gautier
parent 3b3a9afdeb
commit caa1295779
2 changed files with 13 additions and 34 deletions

View file

@ -334,6 +334,19 @@ static void stgen_set_counter(unsigned long long counter)
#endif
}
/*******************************************************************************
* This function returns the STGEN counter value.
******************************************************************************/
static unsigned long long stm32mp_stgen_get_counter(void)
{
#ifdef __aarch64__
return mmio_read_64(STGEN_BASE + CNTCV_OFF);
#else
return (((unsigned long long)mmio_read_32(STGEN_BASE + CNTCVU_OFF) << 32) |
mmio_read_32(STGEN_BASE + CNTCVL_OFF));
#endif
}
/*******************************************************************************
* This function configures and restores the STGEN counter depending on the
* connected clock.
@ -375,34 +388,3 @@ void stm32mp_stgen_restore_rate(void)
write_cntfrq_el0((u_register_t)rate);
}
/*******************************************************************************
* This function returns the STGEN counter value.
******************************************************************************/
unsigned long long stm32mp_stgen_get_counter(void)
{
#ifdef __aarch64__
return mmio_read_64(STGEN_BASE + CNTCV_OFF);
#else
return (((unsigned long long)mmio_read_32(STGEN_BASE + CNTCVU_OFF) << 32) |
mmio_read_32(STGEN_BASE + CNTCVL_OFF));
#endif
}
/*******************************************************************************
* This function restores the STGEN counter value.
* It takes a first input value as a counter backup value to be restored and a
* offset in ms to be added.
******************************************************************************/
void stm32mp_stgen_restore_counter(unsigned long long value,
unsigned long long offset_in_ms)
{
unsigned long long cnt;
cnt = value + ((offset_in_ms *
mmio_read_32(STGEN_BASE + CNTFID_OFF)) / 1000U);
mmio_clrbits_32(STGEN_BASE + CNTCR_OFF, CNTCR_EN);
stgen_set_counter(cnt);
mmio_setbits_32(STGEN_BASE + CNTCR_OFF, CNTCR_EN);
}

View file

@ -30,8 +30,5 @@ unsigned long fdt_get_uart_clock_freq(uintptr_t instance);
void stm32mp_stgen_config(unsigned long rate);
void stm32mp_stgen_restore_rate(void);
void stm32mp_stgen_restore_counter(unsigned long long value,
unsigned long long offset_in_ms);
unsigned long long stm32mp_stgen_get_counter(void);
#endif /* STM32MP_CLKFUNC_H */