2 * (C) Copyright 2000-2004
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 * Torsten Demke, FORCE Computers GmbH. torsten.demke@fci.com
8 * See file CREDITS for list of people who contributed to this
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 #include <asm/processor.h>
34 #include <timestamp.h>
40 ulong busfreq = get_bus_freq (0);
43 printf ("Board: eXalion MPC824x - CHRP (MAP B)\n");
44 printf ("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);
45 printf ("Local Bus: %s MHz\n", strmhz (buf, busfreq));
52 printf ("checkflash\n");
57 phys_size_t initdram (int board_type)
60 volatile uchar *base = CONFIG_SYS_SDRAM_BASE;
65 for (i = 0, cnt = (CONFIG_SYS_MAX_RAM_SIZE / sizeof (long)) >> 1; cnt > 0;
67 addr = (volatile ulong *) base + cnt;
72 addr = (volatile ulong *) base;
81 for (cnt = 1; cnt <= CONFIG_SYS_MAX_RAM_SIZE / sizeof (long); cnt <<= 1) {
82 addr = (volatile ulong *) base + cnt;
86 ulong new_bank0_end = cnt * sizeof (long) - 1;
87 ulong mear1 = mpc824x_mpc107_getreg (MEAR1);
88 ulong emear1 = mpc824x_mpc107_getreg (EMEAR1);
90 mear1 = (mear1 & 0xFFFFFF00) |
91 ((new_bank0_end & MICR_ADDR_MASK) >>
93 emear1 = (emear1 & 0xFFFFFF00) |
94 ((new_bank0_end & MICR_ADDR_MASK) >>
96 mpc824x_mpc107_setreg (MEAR1, mear1);
97 mpc824x_mpc107_setreg (EMEAR1, emear1);
99 ret = cnt * sizeof (long);
104 ret = CONFIG_SYS_MAX_RAM_SIZE;
109 int misc_init_r (void)
116 bdf = pci_find_device (PIIX4_VENDOR_ID, PIIX4_ISA_DEV_ID, 0);
118 puts ("Unable to find PIIX4 ISA bridge !\n");
122 /* set device for normal ISA instead EIO */
123 pci_read_config_dword (bdf, PCI_CFG_PIIX4_GENCFG, &val32);
125 pci_write_config_dword (bdf, PCI_CFG_PIIX4_GENCFG, val32);
126 printf ("PIIX4 ISA bridge (%d,%d,%d)\n", PCI_BUS (bdf),
127 PCI_DEV (bdf), PCI_FUNC (bdf));
130 bdf = pci_find_device (PIIX4_VENDOR_ID, PIIX4_IDE_DEV_ID, 0);
132 puts ("Unable to find PIIX4 IDE controller !\n");
136 /* Init BMIBA register */
137 /* pci_read_config_dword(bdf, PCI_CFG_PIIX4_BMIBA, &val32); */
138 /* val32 |= 0x1000; */
139 /* pci_write_config_dword(bdf, PCI_CFG_PIIX4_BMIBA, val32); */
141 /* Enable BUS master and IO access */
142 val32 = PCI_COMMAND_MASTER | PCI_COMMAND_IO;
143 pci_write_config_dword (bdf, PCI_COMMAND, val32);
146 pci_read_config_byte (bdf, PCI_LATENCY_TIMER, &val8);
148 pci_write_config_byte (bdf, PCI_LATENCY_TIMER, val8);
150 /* Enable Primary ATA/IDE */
151 pci_read_config_dword (bdf, PCI_CFG_PIIX4_IDETIM, &val32);
152 /* val32 = 0xa307a307; */
154 pci_write_config_dword (bdf, PCI_CFG_PIIX4_IDETIM, val32);
157 printf ("PIIX4 IDE controller (%d,%d,%d)\n", PCI_BUS (bdf),
158 PCI_DEV (bdf), PCI_FUNC (bdf));
160 /* Try to get FAT working... */
161 /* fat_register_read(ide_read); */
168 * Show/Init PCI devices on the specified bus number.
171 void pci_eXalion_fixup_irq (struct pci_controller *hose, pci_dev_t dev)
175 switch (PCI_DEV (dev)) {
188 #if defined (CONFIG_MPC8245)
203 pci_hose_write_config_byte (hose, dev, PCI_INTERRUPT_LINE, line);
208 * Initialize PCI Devices, report devices found.
210 #ifndef CONFIG_PCI_PNP
211 #if defined (CONFIG_MPC8240)
212 static struct pci_config_table pci_eXalion_config_table[] = {
214 /* Intel 82559ER ethernet controller */
215 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 18, 0x00,
216 pci_cfgfunc_config_device, {PCI_ENET0_IOADDR,
219 PCI_COMMAND_MASTER}},
221 /* Intel 82371AB PIIX4 PCI to ISA bridge */
222 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 20, 0x00,
223 pci_cfgfunc_config_device, {0,
225 PCI_COMMAND_IO | PCI_COMMAND_MASTER}},
227 /* Intel 82371AB PIIX4 IDE controller */
228 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 20, 0x01,
229 pci_cfgfunc_config_device, {0,
231 PCI_COMMAND_IO | PCI_COMMAND_MASTER}},
234 #elif defined (CONFIG_MPC8245)
235 static struct pci_config_table pci_eXalion_config_table[] = {
237 /* Intel 82559ER ethernet controller */
238 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 17, 0x00,
239 pci_cfgfunc_config_device, {PCI_ENET0_IOADDR,
242 PCI_COMMAND_MASTER}},
244 /* Intel 82559ER ethernet controller */
245 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 18, 0x00,
246 pci_cfgfunc_config_device, {PCI_ENET1_IOADDR,
249 PCI_COMMAND_MASTER}},
251 /* Broadcom BCM5690 Gigabit switch */
252 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 20, 0x00,
253 pci_cfgfunc_config_device, {PCI_ENET2_IOADDR,
256 PCI_COMMAND_MASTER}},
258 /* Broadcom BCM5690 Gigabit switch */
259 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 21, 0x00,
260 pci_cfgfunc_config_device, {PCI_ENET3_IOADDR,
263 PCI_COMMAND_MASTER}},
265 /* Intel 82371AB PIIX4 PCI to ISA bridge */
266 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 22, 0x00,
267 pci_cfgfunc_config_device, {0,
269 PCI_COMMAND_IO | PCI_COMMAND_MASTER}},
271 /* Intel 82371AB PIIX4 IDE controller */
272 PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0x00, 22, 0x01,
273 pci_cfgfunc_config_device, {0,
275 PCI_COMMAND_IO | PCI_COMMAND_MASTER}},
279 #error Specific type of MPC824x must be defined (i.e. CONFIG_MPC8240)
282 #endif /* #ifndef CONFIG_PCI_PNP */
284 struct pci_controller hose = {
285 #ifndef CONFIG_PCI_PNP
286 config_table:pci_eXalion_config_table,
287 fixup_irq:pci_eXalion_fixup_irq,
291 void pci_init_board (void)
293 pci_mpc824x_init (&hose);
296 int board_eth_init(bd_t *bis)
298 return pci_eth_init(bis);