blob: a7c5ab3d90116088d381f48b567d7cec191233f4 [file] [log] [blame]
Uwe Kleine-König9918cda2007-02-16 15:36:55 +01001/*
2 * include/asm-arm/arch-ns9xxx/clock.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_CLOCK_H
12#define __ASM_ARCH_CLOCK_H
13
Uwe Kleine-König9d5cf5a2007-02-23 20:52:19 +010014static inline u32 ns9xxx_systemclock(void) __attribute__((const));
Uwe Kleine-König9918cda2007-02-16 15:36:55 +010015static inline u32 ns9xxx_systemclock(void)
16{
17 /*
18 * This should be a multiple of HZ * TIMERCLOCKSELECT (in time.c)
19 */
20 return 353894400;
21}
22
Uwe Kleine-König9d5cf5a2007-02-23 20:52:19 +010023static inline u32 ns9xxx_cpuclock(void) __attribute__((const));
24static inline u32 ns9xxx_cpuclock(void)
Uwe Kleine-König9918cda2007-02-16 15:36:55 +010025{
26 return ns9xxx_systemclock() / 2;
27}
28
Uwe Kleine-König9d5cf5a2007-02-23 20:52:19 +010029static inline u32 ns9xxx_ahbclock(void) __attribute__((const));
30static inline u32 ns9xxx_ahbclock(void)
Uwe Kleine-König9918cda2007-02-16 15:36:55 +010031{
32 return ns9xxx_systemclock() / 4;
33}
34
Uwe Kleine-König9d5cf5a2007-02-23 20:52:19 +010035static inline u32 ns9xxx_bbusclock(void) __attribute__((const));
36static inline u32 ns9xxx_bbusclock(void)
Uwe Kleine-König9918cda2007-02-16 15:36:55 +010037{
38 return ns9xxx_systemclock() / 8;
39}
40
41#endif /* ifndef __ASM_ARCH_CLOCK_H */