Linux-2.6.12-rc2
[linux-2.6/kvm.git] / arch / sh / boards / renesas / hs7751rvoip / setup.c
blobf1a78b6c714c6e863531842e8b09530a5b244f07
1 /*
2 * linux/arch/sh/kernel/setup_hs7751rvoip.c
4 * Copyright (C) 2000 Kazumoto Kojima
6 * Renesas Technology Sales HS7751RVoIP Support.
8 * Modified for HS7751RVoIP by
9 * Atom Create Engineering Co., Ltd. 2002.
10 * Lineo uSolutions, Inc. 2003.
13 #include <linux/config.h>
14 #include <linux/init.h>
15 #include <linux/irq.h>
17 #include <linux/hdreg.h>
18 #include <linux/ide.h>
19 #include <asm/io.h>
20 #include <asm/hs7751rvoip/hs7751rvoip.h>
22 #include <linux/mm.h>
23 #include <linux/vmalloc.h>
25 /* defined in mm/ioremap.c */
26 extern void * p3_ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags);
28 unsigned int debug_counter;
30 const char *get_system_type(void)
32 return "HS7751RVoIP";
36 * Initialize the board
38 void __init platform_setup(void)
40 printk(KERN_INFO "Renesas Technology Sales HS7751RVoIP-2 support.\n");
41 ctrl_outb(0xf0, PA_OUTPORTR);
42 debug_counter = 0;
45 void *area5_io8_base;
46 void *area6_io8_base;
47 void *area5_io16_base;
48 void *area6_io16_base;
50 int __init cf_init(void)
52 pgprot_t prot;
53 unsigned long paddrbase, psize;
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;
65 /* XXX : do we need attribute and common-memory area also? */
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;
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;
86 return 0;
89 __initcall (cf_init);