Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / arch / sh / boards / renesas / hs7751rvoip / setup.c
1 /*
2  * linux/arch/sh/kernel/setup_hs7751rvoip.c
3  *
4  * Copyright (C) 2000  Kazumoto Kojima
5  *
6  * Renesas Technology Sales HS7751RVoIP Support.
7  *
8  * Modified for HS7751RVoIP by
9  * Atom Create Engineering Co., Ltd. 2002.
10  * Lineo uSolutions, Inc. 2003.
11  */
12
13 #include <linux/init.h>
14 #include <linux/irq.h>
15
16 #include <linux/hdreg.h>
17 #include <linux/ide.h>
18 #include <asm/io.h>
19 #include <asm/hs7751rvoip/hs7751rvoip.h>
20
21 #include <linux/mm.h>
22 #include <linux/vmalloc.h>
23
24 /* defined in mm/ioremap.c */
25 extern void * p3_ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags);
26
27 unsigned int debug_counter;
28
29 const char *get_system_type(void)
30 {
31         return "HS7751RVoIP";
32 }
33
34 /*
35  * Initialize the board
36  */
37 void __init platform_setup(void)
38 {
39         printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n");
40         ctrl_outb(0xf0, PA_OUTPORTR);
41         debug_counter = 0;
42 }
43
44 void *area5_io8_base;
45 void *area6_io8_base;
46 void *area5_io16_base;
47 void *area6_io16_base;
48
49 int __init cf_init(void)
50 {
51         pgprot_t prot;
52         unsigned long paddrbase, psize;
53
54         /* open I/O area window */
55         paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800));
56         psize = PAGE_SIZE;
57         prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16);
58         area5_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot);
59         if (!area5_io16_base) {
60                 printk("allocate_cf_area : can't open CF I/O window!\n");
61                 return -ENOMEM;
62         }
63
64         /* XXX : do we need attribute and common-memory area also? */
65
66         paddrbase = virt_to_phys((void *)PA_AREA6_IO);
67         psize = PAGE_SIZE;
68 #if defined(CONFIG_HS7751RVOIP_CODEC)
69         prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM8);
70 #else
71         prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO8);
72 #endif
73         area6_io8_base = p3_ioremap(paddrbase, psize, prot.pgprot);
74         if (!area6_io8_base) {
75                 printk("allocate_cf_area : can't open CODEC I/O 8bit window!\n");
76                 return -ENOMEM;
77         }
78         prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16);
79         area6_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot);
80         if (!area6_io16_base) {
81                 printk("allocate_cf_area : can't open CODEC I/O 16bit window!\n");
82                 return -ENOMEM;
83         }
84
85         return 0;
86 }
87
88 __initcall (cf_init);