e31c3327ae0b90a584361ccdbe7dc84d813bdf05
[oweals/u-boot_mod.git] / u-boot / drivers / pci.c
1 /*\r
2  * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH <www.elinos.com>\r
3  * Andreas Heppel <aheppel@sysgo.de>\r
4  *\r
5  * (C) Copyright 2002, 2003\r
6  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.\r
7  *\r
8  * See file CREDITS for list of people who contributed to this\r
9  * project.\r
10  *\r
11  * This program is free software; you can redistribute it and/or\r
12  * modify it under the terms of the GNU General Public License as\r
13  * published by the Free Software Foundation; either version 2 of\r
14  * the License, or (at your option) any later version.\r
15  *\r
16  * This program is distributed in the hope that it will be useful,\r
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
19  * GNU General Public License for more details.\r
20  *\r
21  * You should have received a copy of the GNU General Public License\r
22  * along with this program; if not, write to the Free Software\r
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,\r
24  * MA 02111-1307 USA\r
25  */\r
26 \r
27 /*\r
28  * PCI routines\r
29  */\r
30 #include <common.h>\r
31 \r
32 #ifdef CONFIG_PCI\r
33 \r
34 #include <command.h>\r
35 #include <asm/processor.h>\r
36 #include <asm/io.h>\r
37 #include <pci.h>\r
38 \r
39 void pci_init(void) {\r
40 #if defined(CONFIG_PCI_BOOTDELAY)\r
41         char *s;\r
42         int i;\r
43 \r
44         /* wait "pcidelay" ms (if defined)... */\r
45         s = getenv ("pcidelay");\r
46         \r
47         if (s) {\r
48                 int val = simple_strtoul(s, NULL, 10);\r
49                 \r
50                 for (i = 0; i < val; i++){\r
51                         udelay (1000);\r
52                 }\r
53         }\r
54 #endif /* CONFIG_PCI_BOOTDELAY */\r
55 \r
56         /* now call board specific pci_init()... */\r
57         pci_init_board();\r
58 }\r
59 \r
60 #endif /* CONFIG_PCI */\r