]>
git.ipfire.org Git - people/ms/u-boot.git/blob - arch/arm/include/asm/arch-at91/clk.h
d4852a38c19c3eb25b960626f03eaad9d55fc39f
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 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 #ifndef __ASM_ARM_ARCH_CLK_H__
26 #define __ASM_ARM_ARCH_CLK_H__
28 #include <asm/arch/hardware.h>
29 #include <asm/global_data.h>
31 static inline unsigned long get_cpu_clk_rate(void)
33 DECLARE_GLOBAL_DATA_PTR
;
34 return gd
->arch
.cpu_clk_rate_hz
;
37 static inline unsigned long get_main_clk_rate(void)
39 DECLARE_GLOBAL_DATA_PTR
;
40 return gd
->arch
.main_clk_rate_hz
;
43 static inline unsigned long get_mck_clk_rate(void)
45 DECLARE_GLOBAL_DATA_PTR
;
46 return gd
->arch
.mck_rate_hz
;
49 static inline unsigned long get_plla_clk_rate(void)
51 DECLARE_GLOBAL_DATA_PTR
;
52 return gd
->arch
.plla_rate_hz
;
55 static inline unsigned long get_pllb_clk_rate(void)
57 DECLARE_GLOBAL_DATA_PTR
;
58 return gd
->arch
.pllb_rate_hz
;
61 static inline u32
get_pllb_init(void)
63 DECLARE_GLOBAL_DATA_PTR
;
64 return gd
->arch
.at91_pllb_usb_init
;
67 static inline unsigned long get_macb_pclk_rate(unsigned int dev_id
)
69 return get_mck_clk_rate();
72 static inline unsigned long get_usart_clk_rate(unsigned int dev_id
)
74 return get_mck_clk_rate();
77 static inline unsigned long get_lcdc_clk_rate(unsigned int dev_id
)
79 return get_mck_clk_rate();
82 static inline unsigned long get_spi_clk_rate(unsigned int dev_id
)
84 return get_mck_clk_rate();
87 static inline unsigned long get_twi_clk_rate(unsigned int dev_id
)
89 return get_mck_clk_rate();
92 static inline unsigned long get_mci_clk_rate(void)
94 return get_mck_clk_rate();
97 int at91_clock_init(unsigned long main_clock
);
98 #endif /* __ASM_ARM_ARCH_CLK_H__ */