John Crispin | 8ec6d93 | 2011-03-30 09:27:48 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or modify it |
| 3 | * under the terms of the GNU General Public License version 2 as published |
| 4 | * by the Free Software Foundation. |
| 5 | * |
| 6 | * Copyright (C) 2011 John Crispin <blogic@openwrt.org> |
| 7 | */ |
| 8 | |
| 9 | #include <linux/io.h> |
| 10 | #include <linux/module.h> |
| 11 | #include <linux/init.h> |
| 12 | #include <linux/clk.h> |
| 13 | |
| 14 | #include <asm/time.h> |
| 15 | #include <asm/irq.h> |
| 16 | #include <asm/div64.h> |
| 17 | |
| 18 | #include <lantiq_soc.h> |
| 19 | |
| 20 | /* cgu registers */ |
| 21 | #define LTQ_CGU_SYS 0x0010 |
| 22 | |
| 23 | unsigned int ltq_get_io_region_clock(void) |
| 24 | { |
| 25 | return CLOCK_133M; |
| 26 | } |
| 27 | EXPORT_SYMBOL(ltq_get_io_region_clock); |
| 28 | |
| 29 | unsigned int ltq_get_fpi_bus_clock(int fpi) |
| 30 | { |
| 31 | return CLOCK_133M; |
| 32 | } |
| 33 | EXPORT_SYMBOL(ltq_get_fpi_bus_clock); |
| 34 | |
| 35 | unsigned int ltq_get_cpu_hz(void) |
| 36 | { |
| 37 | if (ltq_cgu_r32(LTQ_CGU_SYS) & (1 << 5)) |
| 38 | return CLOCK_266M; |
| 39 | else |
| 40 | return CLOCK_133M; |
| 41 | } |
| 42 | EXPORT_SYMBOL(ltq_get_cpu_hz); |
| 43 | |
| 44 | unsigned int ltq_get_fpi_hz(void) |
| 45 | { |
| 46 | return CLOCK_133M; |
| 47 | } |
| 48 | EXPORT_SYMBOL(ltq_get_fpi_hz); |