ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / ppc / platforms / 4xx / redwood5.c
1 /*
2  * arch/ppc/platforms/4xx/redwood5.c
3  *
4  * Support for the IBM redwood5 eval board file
5  *
6  * Author: Armin Kuster <akuster@mvista.com>
7  *
8  * 2000-2001 (c) MontaVista, Software, Inc.  This file is licensed under
9  * the terms of the GNU General Public License version 2.  This program
10  * is licensed "as is" without any warranty of any kind, whether express
11  * or implied.
12  */
13
14 #include <linux/config.h>
15 #include <linux/init.h>
16 #include <linux/pagemap.h>
17 #include <asm/io.h>
18 #include <asm/machdep.h>
19
20 void __init
21 redwood5_setup_arch(void)
22 {
23         bd_t *bip = &__res;
24
25         ppc4xx_setup_arch();
26
27 #ifdef CONFIG_DEBUG_BRINGUP
28         printk("\n");
29         printk("machine\t: %s\n", PPC4xx_MACHINE_NAME);
30         printk("\n");
31         printk("bi_s_version\t %s\n",      bip->bi_s_version);
32         printk("bi_r_version\t %s\n",      bip->bi_r_version);
33         printk("bi_memsize\t 0x%8.8x\t %dMBytes\n", bip->bi_memsize,bip->bi_memsize/(1024*1000));
34         printk("bi_enetaddr %d\t %2.2x%2.2x%2.2x-%2.2x%2.2x%2.2x\n", 0,
35         bip->bi_enetaddr[0], bip->bi_enetaddr[1],
36         bip->bi_enetaddr[2], bip->bi_enetaddr[3],
37         bip->bi_enetaddr[4], bip->bi_enetaddr[5]);
38
39         printk("bi_intfreq\t 0x%8.8x\t clock:\t %dMhz\n",
40                bip->bi_intfreq, bip->bi_intfreq/ 1000000);
41
42         printk("bi_busfreq\t 0x%8.8x\t plb bus clock:\t %dMHz\n",
43                 bip->bi_busfreq, bip->bi_busfreq / 1000000 );
44         printk("bi_tbfreq\t 0x%8.8x\t TB freq:\t %dMHz\n",
45                bip->bi_tbfreq, bip->bi_tbfreq/1000000);
46
47         printk("\n");
48 #endif
49
50 }
51
52 void __init
53 redwood5_map_io(void)
54 {
55         int i;
56
57         ppc4xx_map_io();
58         for (i = 0; i < 16; i++) {
59          unsigned long v, p;
60
61         /* 0x400x0000 -> 0xe00x0000 */
62         p = 0x40000000 | (i << 16);
63         v = STB04xxx_IO_BASE | (i << 16);
64
65         io_block_mapping(v, p, PAGE_SIZE,
66                  _PAGE_NO_CACHE | pgprot_val(PAGE_KERNEL) | _PAGE_GUARDED);
67         }
68
69
70 }
71
72 void __init
73 platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
74               unsigned long r6, unsigned long r7)
75 {
76         ppc4xx_init(r3, r4, r5, r6, r7);
77
78         ppc_md.setup_arch = redwood5_setup_arch;
79         ppc_md.setup_io_mappings = redwood5_map_io;
80 }