Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / ppc / boot / simple / misc-katana.c
1 /*
2  * Set up MPSC values to bootwrapper can prompt user.
3  *
4  * Author: Mark A. Greer <source@mvista.com>
5  *
6  * 2004 (c) MontaVista Software, Inc. This file is licensed under
7  * the terms of the GNU General Public License version 2. This program
8  * is licensed "as is" without any warranty of any kind, whether express
9  * or implied.
10  */
11
12 #include <linux/config.h>
13 #include <linux/types.h>
14 #include <asm/io.h>
15 #include <asm/mv64x60_defs.h>
16 #include <platforms/katana.h>
17
18 extern u32 mv64x60_console_baud;
19 extern u32 mv64x60_mpsc_clk_src;
20 extern u32 mv64x60_mpsc_clk_freq;
21
22 /* Not in the kernel so won't include kernel.h to get its 'min' definition */
23 #ifndef min
24 #define min(a,b)        (((a) < (b)) ? (a) : (b))
25 #endif
26
27 unsigned long mv64360_get_mem_size(void);
28
29 void
30 mv64x60_board_init(void __iomem *old_base, void __iomem *new_base)
31 {
32         mv64x60_console_baud = KATANA_DEFAULT_BAUD;
33         mv64x60_mpsc_clk_src = KATANA_MPSC_CLK_SRC;
34         mv64x60_mpsc_clk_freq =
35                 min(katana_bus_freq((void __iomem *)KATANA_CPLD_BASE),
36                         MV64x60_TCLK_FREQ_MAX);
37 }
38
39 unsigned long
40 get_mem_size(void)
41 {
42         return mv64360_get_mem_size();
43 }