3 * Stelian Pop <stelian@popies.net>
4 * Lead Tech Design <www.leadtechdesign.com>
5 * Copyright (C) 2009 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
7 * SPDX-License-Identifier: GPL-2.0+
9 #ifndef __ASM_ARM_ARCH_CLK_H__
10 #define __ASM_ARM_ARCH_CLK_H__
12 #include <asm/arch/hardware.h>
13 #include <asm/global_data.h>
15 static inline unsigned long get_cpu_clk_rate(void)
17 DECLARE_GLOBAL_DATA_PTR;
18 return gd->arch.cpu_clk_rate_hz;
21 static inline unsigned long get_main_clk_rate(void)
23 DECLARE_GLOBAL_DATA_PTR;
24 return gd->arch.main_clk_rate_hz;
27 static inline unsigned long get_mck_clk_rate(void)
29 DECLARE_GLOBAL_DATA_PTR;
30 return gd->arch.mck_rate_hz;
33 static inline unsigned long get_plla_clk_rate(void)
35 DECLARE_GLOBAL_DATA_PTR;
36 return gd->arch.plla_rate_hz;
39 static inline unsigned long get_pllb_clk_rate(void)
41 DECLARE_GLOBAL_DATA_PTR;
42 return gd->arch.pllb_rate_hz;
45 static inline u32 get_pllb_init(void)
47 DECLARE_GLOBAL_DATA_PTR;
48 return gd->arch.at91_pllb_usb_init;
51 static inline unsigned long get_macb_pclk_rate(unsigned int dev_id)
53 return get_mck_clk_rate();
56 static inline unsigned long get_usart_clk_rate(unsigned int dev_id)
58 return get_mck_clk_rate();
61 static inline unsigned long get_lcdc_clk_rate(unsigned int dev_id)
63 return get_mck_clk_rate();
66 static inline unsigned long get_spi_clk_rate(unsigned int dev_id)
68 return get_mck_clk_rate();
71 static inline unsigned long get_twi_clk_rate(unsigned int dev_id)
73 return get_mck_clk_rate();
76 static inline unsigned long get_mci_clk_rate(void)
78 return get_mck_clk_rate();
81 int at91_clock_init(unsigned long main_clock);
82 void at91_periph_clk_enable(int id);
83 void at91_periph_clk_disable(int id);
84 #endif /* __ASM_ARM_ARCH_CLK_H__ */