1 /*
2  *  setup.c, Setup for the TANBAC TB0226.
3  *
4  *  Copyright (C) 2002-2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20 #include <linux/config.h>
21 #include <linux/console.h>
22 #include <linux/init.h>
23 #include <linux/ioport.h>
24 
25 #include <asm/pci_channel.h>
26 #include <asm/time.h>
27 #include <asm/vr41xx/tb0226.h>
28 
29 #ifdef CONFIG_PCI
30 static struct resource vr41xx_pci_io_resource = {
31 	"PCI I/O space",
32 	VR41XX_PCI_IO_START,
33 	VR41XX_PCI_IO_END,
34 	IORESOURCE_IO
35 };
36 
37 static struct resource vr41xx_pci_mem_resource = {
38 	"PCI memory space",
39 	VR41XX_PCI_MEM_START,
40 	VR41XX_PCI_MEM_END,
41 	IORESOURCE_MEM
42 };
43 
44 struct pci_channel mips_pci_channels[] = {
45 	{&vr41xx_pci_ops, &vr41xx_pci_io_resource, &vr41xx_pci_mem_resource, 0, 256},
46 	{NULL, NULL, NULL, 0, 0}
47 };
48 
49 struct vr41xx_pci_address_space vr41xx_pci_mem1 = {
50 	VR41XX_PCI_MEM1_BASE,
51 	VR41XX_PCI_MEM1_MASK,
52 	IO_MEM1_RESOURCE_START
53 };
54 
55 struct vr41xx_pci_address_space vr41xx_pci_mem2 = {
56 	VR41XX_PCI_MEM2_BASE,
57 	VR41XX_PCI_MEM2_MASK,
58 	IO_MEM2_RESOURCE_START
59 };
60 
61 struct vr41xx_pci_address_space vr41xx_pci_io = {
62 	VR41XX_PCI_IO_BASE,
63 	VR41XX_PCI_IO_MASK,
64 	IO_PORT_RESOURCE_START
65 };
66 
67 static struct vr41xx_pci_address_map pci_address_map = {
68 	&vr41xx_pci_mem1,
69 	&vr41xx_pci_mem2,
70 	&vr41xx_pci_io
71 };
72 #endif
73 
tanbac_tb0226_setup(void)74 void __init tanbac_tb0226_setup(void)
75 {
76 	set_io_port_base(IO_PORT_BASE);
77 	ioport_resource.start = IO_PORT_RESOURCE_START;
78 	ioport_resource.end = IO_PORT_RESOURCE_END;
79 	iomem_resource.start = IO_MEM1_RESOURCE_START;
80 	iomem_resource.end = IO_MEM2_RESOURCE_END;
81 
82 	board_time_init = vr41xx_time_init;
83 	board_timer_setup = vr41xx_timer_setup;
84 
85 #ifdef CONFIG_FB
86 	conswitchp = &dummy_con;
87 #endif
88 
89 	vr41xx_bcu_init();
90 	vr41xx_cmu_init();
91 	vr41xx_pmu_init();
92 
93 #ifdef CONFIG_SERIAL
94 	vr41xx_siu_init(SIU_RS232C, 0);
95 #endif
96 
97 #ifdef CONFIG_PCI
98 	vr41xx_pciu_init(&pci_address_map);
99 #endif
100 }
101