This commit was manufactured by cvs2svn to create branch 'vserver'.
[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/config.h>
14 #include <linux/init.h>
15 #include <linux/irq.h>
16
17 #include <linux/hdreg.h>
18 #include <linux/ide.h>
19 #include <asm/io.h>
20 #include <asm/hs7751rvoip/hs7751rvoip.h>
21
22 #include <linux/mm.h>
23 #include <linux/vmalloc.h>
24
25 /* defined in mm/ioremap.c */
26 extern void * p3_ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags);
27
28 unsigned int debug_counter;
29
30 const char *get_system_type(void)
31 {
32         return "HS7751RVoIP";
33 }
34
35 /*
36  * Initialize the board
37  */
38 void __init platform_setup(void)
39 {
40         printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n");
41         ctrl_outb(0xf0, PA_OUTPORTR);
42         debug_counter = 0;
43 }
44
45 void *area5_io8_base;
46 void *area6_io8_base;
47 void *area5_io16_base;
48 void *area6_io16_base;
49
50 int __init cf_init(void)
51 {
52         pgprot_t prot;
53         unsigned long paddrbase, psize;
54
55         /* open I/O area window */
56         paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800));
57         psize = PAGE_SIZE;
58         prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16);
59         area5_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot);
60         if (!area5_io16_base) {
61                 printk("allocate_cf_area : can't open CF I/O window!\n");
62                 return -ENOMEM;
63         }
64
65         /* XXX : do we need attribute and common-memory area also? */
66
67         paddrbase = virt_to_phys((void *)PA_AREA6_IO);
68         psize = PAGE_SIZE;
69 #if defined(CONFIG_HS7751RVOIP_CODEC)
70         prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM8);
71 #else
72         prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO8);
73 #endif
74         area6_io8_base = p3_ioremap(paddrbase, psize, prot.pgprot);
75         if (!area6_io8_base) {
76                 printk("allocate_cf_area : can't open CODEC I/O 8bit window!\n");
77                 return -ENOMEM;
78         }
79         prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16);
80         area6_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot);
81         if (!area6_io16_base) {
82                 printk("allocate_cf_area : can't open CODEC I/O 16bit window!\n");
83                 return -ENOMEM;
84         }
85
86         return 0;
87 }
88
89 __initcall (cf_init);