2 * generic K8 debug code, used by mainboard specific auto.c
6 static void print_debug_pci_dev(unsigned dev)
9 print_debug_hex8((dev >> 16) & 0xff);
10 print_debug_char(':');
11 print_debug_hex8((dev >> 11) & 0x1f);
12 print_debug_char('.');
13 print_debug_hex8((dev >> 8) & 7);
16 static void print_pci_devices(void)
19 for(dev = PCI_DEV(0, 0, 0);
20 dev <= PCI_DEV(0xff, 0x1f, 0x7);
21 dev += PCI_DEV(0,0,1)) {
23 id = pci_read_config32(dev, PCI_VENDOR_ID);
24 if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
25 (((id >> 16) & 0xffff) == 0xffff) ||
26 (((id >> 16) & 0xffff) == 0x0000)) {
29 print_debug_pci_dev(dev);
31 print_debug_hex16(id & 0xffff);
33 print_debug_hex16((id>>16) & 0xffff);
38 static void dump_pci_device(unsigned dev)
41 print_debug_pci_dev(dev);
44 for(i = 0; i <= 255; i++) {
46 if ((i & 0x0f) == 0) {
48 print_debug_char(':');
50 val = pci_read_config8(dev, i);
51 print_debug_char(' ');
52 print_debug_hex8(val);
53 if ((i & 0x0f) == 0x0f) {
59 static void dump_pci_devices(void)
62 for(dev = PCI_DEV(0, 0, 0);
63 dev <= PCI_DEV(0xff, 0x1f, 0x7);
64 dev += PCI_DEV(0,0,1)) {
66 id = pci_read_config32(dev, PCI_VENDOR_ID);
67 if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
68 (((id >> 16) & 0xffff) == 0xffff) ||
69 (((id >> 16) & 0xffff) == 0x0000)) {
76 static void dump_pci_devices_on_bus(unsigned busn)
79 for(dev = PCI_DEV(busn, 0, 0);
80 dev <= PCI_DEV(busn, 0x1f, 0x7);
81 dev += PCI_DEV(0,0,1)) {
83 id = pci_read_config32(dev, PCI_VENDOR_ID);
84 if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) ||
85 (((id >> 16) & 0xffff) == 0xffff) ||
86 (((id >> 16) & 0xffff) == 0x0000)) {
93 static void dump_spd_registers(const struct mem_controller *ctrl)
97 for(i = 0; i < 4; i++) {
99 device = ctrl->channel0[i];
102 print_debug("dimm: ");
105 print_debug_hex8(device);
106 for(j = 0; j < 128; j++) {
109 if ((j & 0xf) == 0) {
114 status = smbus_read_byte(device, j);
116 print_debug("bad device\r\n");
119 byte = status & 0xff;
120 print_debug_hex8(byte);
121 print_debug_char(' ');
125 device = ctrl->channel1[i];
128 print_debug("dimm: ");
131 print_debug_hex8(device);
132 for(j = 0; j < 128; j++) {
135 if ((j & 0xf) == 0) {
140 status = smbus_read_byte(device, j);
142 print_debug("bad device\r\n");
145 byte = status & 0xff;
146 print_debug_hex8(byte);
147 print_debug_char(' ');
153 static void dump_smbus_registers(void)
157 for(i = 1; i < 0x80; i++) {
161 print_debug("smbus: ");
162 print_debug_hex8(device);
163 for(j = 0; j < 256; j++) {
166 if ((j & 0xf) == 0) {
171 status = smbus_read_byte(device, j);
173 print_debug("bad device status=");
174 print_debug_hex32(status);
178 byte = status & 0xff;
179 print_debug_hex8(byte);
180 print_debug_char(' ');
186 static void dump_io_resources(unsigned port)
191 print_debug_hex16(port);
192 print_debug(":\r\n");
195 if ((i & 0x0f) == 0) {
197 print_debug_char(':');
200 print_debug_char(' ');
201 print_debug_hex8(val);
202 if ((i & 0x0f) == 0x0f) {