1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/mmio.h>
4 #include <soc/addressmap.h>
6 #define PLL_REF_CLK 50000000 /* 50 MHz */
35 * Returns the reference clock speed in Hz
37 u64
thunderx_get_ref_clock(void)
43 * Returns the I/O clock speed in Hz
45 u64
thunderx_get_io_clock(void)
47 union cavm_rst_boot rst_boot
;
49 rst_boot
.u
= read64p(RST_PF_BAR0
);
51 return ((u64
)rst_boot
.s
.pnr_mul
) * PLL_REF_CLK
;
55 * Returns the core clock speed in Hz
57 u64
thunderx_get_core_clock(void)
59 union cavm_rst_boot rst_boot
;
61 rst_boot
.u
= read64p(RST_PF_BAR0
);
63 return ((u64
)rst_boot
.s
.c_mul
) * PLL_REF_CLK
;