1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#include <common.h>
24#include <pci.h>
25
26
27void mpc85xx_config_via(struct pci_controller *hose,
28 pci_dev_t dev, struct pci_config_table *tab)
29{
30 pci_dev_t bridge;
31 unsigned int cmdstat;
32
33
34 pci_hose_write_config_byte(hose, dev, 0x48, 0x08);
35
36 pci_hose_read_config_dword(hose, dev, PCI_COMMAND, &cmdstat);
37 cmdstat |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY| PCI_COMMAND_MASTER;
38 pci_hose_write_config_dword(hose, dev, PCI_COMMAND, cmdstat);
39 pci_hose_write_config_byte(hose, dev, PCI_CACHE_LINE_SIZE, 0x08);
40 pci_hose_write_config_byte(hose, dev, PCI_LATENCY_TIMER, 0x80);
41
42
43
44
45
46
47
48 bridge = PCI_BDF(0,BRIDGE_ID,0);
49 pci_hose_write_config_byte(hose, bridge, PCI_IO_BASE, 0);
50 pci_hose_write_config_word(hose, bridge, PCI_IO_BASE_UPPER16, 0);
51 pci_hose_write_config_byte(hose, bridge, PCI_IO_LIMIT, 0x10);
52 pci_hose_write_config_word(hose, bridge, PCI_IO_LIMIT_UPPER16, 0);
53}
54
55
56void mpc85xx_config_via_usbide(struct pci_controller *hose,
57 pci_dev_t dev, struct pci_config_table *tab)
58{
59 pciauto_config_device(hose, dev);
60
61
62
63
64
65
66 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_0, 0x1ff8);
67 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_1, 0x1ff4);
68 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_2, 0x1fe8);
69 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_3, 0x1fe4);
70 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_4, 0x1fd0);
71}
72
73
74void mpc85xx_config_via_usb(struct pci_controller *hose,
75 pci_dev_t dev, struct pci_config_table *tab)
76{
77 pciauto_config_device(hose, dev);
78
79 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_4, 0x1fa0);
80}
81
82
83void mpc85xx_config_via_usb2(struct pci_controller *hose,
84 pci_dev_t dev, struct pci_config_table *tab)
85{
86 pciauto_config_device(hose, dev);
87
88 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_4, 0x1f80);
89}
90
91
92void mpc85xx_config_via_power(struct pci_controller *hose,
93 pci_dev_t dev, struct pci_config_table *tab)
94{
95 pciauto_config_device(hose, dev);
96
97 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_0, 0x1e00);
98 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_1, 0x1dfc);
99 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_2, 0x1df8);
100}
101
102
103void mpc85xx_config_via_ac97(struct pci_controller *hose,
104 pci_dev_t dev, struct pci_config_table *tab)
105{
106 pciauto_config_device(hose, dev);
107
108 pci_hose_write_config_dword(hose, dev, PCI_BASE_ADDRESS_0, 0x1c00);
109}
110