http://www.hht-eu.com/pls/hht/docs/F3140/bcm963xx_Speedport500V.0.09.04L.300L01.V27_c...
[bcm963xx.git] / kernel / linux / arch / ppc / platforms / tqm8260_setup.c
1 /*
2  * arch/ppc/platforms/tqm8260_setup.c
3  *
4  * TQM8260 platform support
5  *
6  * Author: Allen Curtis <acurtis@onz.com>
7  * Derived from: m8260_setup.c by Dan Malek, MVista
8  *
9  * Copyright 2002 Ones and Zeros, Inc.
10  *
11  * This program is free software; you can redistribute  it and/or modify it
12  * under  the terms of  the GNU General  Public License as published by the
13  * Free Software Foundation;  either version 2 of the  License, or (at your
14  * option) any later version.
15  */
16
17 #include <linux/config.h>
18 #include <linux/seq_file.h>
19
20 #include <asm/immap_cpm2.h>
21 #include <asm/mpc8260.h>
22 #include <asm/machdep.h>
23
24 static void (*callback_setup_arch)(void);
25
26 extern unsigned char __res[sizeof(bd_t)];
27
28 extern void m8260_init(unsigned long r3, unsigned long r4,
29         unsigned long r5, unsigned long r6, unsigned long r7);
30
31 static int
32 tqm8260_show_cpuinfo(struct seq_file *m)
33 {
34         bd_t    *binfo = (bd_t *)__res;
35
36         seq_printf(m, "vendor\t\t: IN2 Systems\n"
37                       "machine\t\t: TQM8260 PowerPC\n"
38                       "mem size\t\t: 0x%08x\n"
39                       "\n",
40                       binfo->bi_memsize);
41         return 0;
42 }
43
44 static int
45 tqm8260_set_rtc_time(unsigned long time)
46 {
47         ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt = time;
48         ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcntsc = 0x3;
49
50         return(0);
51 }
52
53 static unsigned long
54 tqm8260_get_rtc_time(void)
55 {
56         return ((cpm2_map_t *)CPM_MAP_ADDR)->im_sit.sit_tmcnt;
57 }
58
59 static void __init
60 tqm8260_setup_arch(void)
61 {
62         printk("IN2 Systems TQM8260 port\n");
63         callback_setup_arch();
64 }
65
66 void __init
67 platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
68               unsigned long r6, unsigned long r7)
69 {
70         /* Generic 8260 platform initialization */
71         m8260_init(r3, r4, r5, r6, r7);
72
73         /* Anything special for this platform */
74         ppc_md.show_cpuinfo     = tqm8260_show_cpuinfo;
75         ppc_md.set_rtc_time     = tqm8260_set_rtc_time;
76         ppc_md.get_rtc_time     = tqm8260_get_rtc_time;
77
78         callback_setup_arch     = ppc_md.setup_arch;
79         ppc_md.setup_arch       = tqm8260_setup_arch;