3 * Rob Taylor, Flying Pig Systems. robt@flyingpig.com.
6 * Gregory E. Allen, gallen@arlut.utexas.edu
7 * Matthew E. Karger, karger@arlut.utexas.edu
8 * Applied Research Laboratories, The University of Texas at Austin
10 * SPDX-License-Identifier: GPL-2.0+
15 #include <asm/processor.h>
26 ulong busfreq
= get_bus_freq(0);
29 printf("Board: UTX8245 Local Bus at %s MHz\n", strmhz(buf
, busfreq
));
34 phys_size_t
initdram(int board_type
)
42 size
= get_ram_size(CONFIG_SYS_SDRAM_BASE
, CONFIG_SYS_MAX_RAM_SIZE
);
44 new_bank0_end
= size
/2 - 1;
45 new_bank1_end
= size
- 1;
46 mear1
= mpc824x_mpc107_getreg(MEAR1
);
47 emear1
= mpc824x_mpc107_getreg(EMEAR1
);
49 mear1
= (mear1
& 0xFFFF0000) |
50 ((new_bank0_end
& MICR_ADDR_MASK
) >> MICR_ADDR_SHIFT
) |
51 ((new_bank1_end
& MICR_ADDR_MASK
) >> MICR_ADDR_SHIFT
<< 8);
52 emear1
= (emear1
& 0xFFFF0000) |
53 ((new_bank0_end
& MICR_EADDR_MASK
) >> MICR_EADDR_SHIFT
) |
54 ((new_bank1_end
& MICR_EADDR_MASK
) >> MICR_EADDR_SHIFT
<< 8);
56 mpc824x_mpc107_setreg(MEAR1
, mear1
);
57 mpc824x_mpc107_setreg(EMEAR1
, emear1
);
64 * Initialize PCI Devices, report devices found.
67 static struct pci_config_table pci_utx8245_config_table
[] = {
68 #ifndef CONFIG_PCI_PNP
69 { PCI_ANY_ID
, PCI_ANY_ID
, PCI_ANY_ID
, PCI_ANY_ID
, 0x0C, PCI_ANY_ID
,
70 pci_cfgfunc_config_device
, { PCI_ENET0_IOADDR
,
72 PCI_COMMAND_MEMORY
| PCI_COMMAND_MASTER
}},
73 { PCI_ANY_ID
, PCI_ANY_ID
, PCI_ANY_ID
, PCI_ANY_ID
, 0x0B, PCI_ANY_ID
,
74 pci_cfgfunc_config_device
, { PCI_FIREWIRE_IOADDR
,
76 PCI_COMMAND_MEMORY
| PCI_COMMAND_MASTER
}},
77 #endif /*CONFIG_PCI_PNP*/
82 static void pci_utx8245_fixup_irq(struct pci_controller
*hose
, pci_dev_t dev
)
84 if (PCI_DEV(dev
) == 11)
85 /* assign serial interrupt line 9 (int25) to FireWire */
86 pci_hose_write_config_byte(hose
, dev
, PCI_INTERRUPT_LINE
, 25);
88 else if (PCI_DEV(dev
) == 12)
89 /* assign serial interrupt line 8 (int24) to Ethernet */
90 pci_hose_write_config_byte(hose
, dev
, PCI_INTERRUPT_LINE
, 24);
92 else if (PCI_DEV(dev
) == 14)
93 /* assign serial interrupt line 0 (int16) to PMC slot 0 */
94 pci_hose_write_config_byte(hose
, dev
, PCI_INTERRUPT_LINE
, 16);
96 else if (PCI_DEV(dev
) == 15)
97 /* assign serial interrupt line 1 (int17) to PMC slot 1 */
98 pci_hose_write_config_byte(hose
, dev
, PCI_INTERRUPT_LINE
, 17);
101 static struct pci_controller utx8245_hose
= {
102 #ifndef CONFIG_PCI_PNP
103 config_table
: pci_utx8245_config_table
,
104 fixup_irq
: pci_utx8245_fixup_irq
,
105 write_byte
: pci_hose_write_config_byte
106 #endif /*CONFIG_PCI_PNP*/
109 void pci_init_board (void)
111 pci_mpc824x_init(&utx8245_hose
);
116 int board_eth_init(bd_t
*bis
)
118 return pci_eth_init(bis
);