util/cbfstool: eliminate late sign of life event
[coreboot2.git] / src / northbridge / intel / i440bx / debug.c
blobce808cf4211b4709ea92157484319aec8b3bb041
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <device/pci_ops.h>
5 #include <device/smbus_host.h>
6 #include <spd.h>
7 #include "raminit.h"
9 void dump_spd_registers(void)
11 int i;
12 printk(BIOS_DEBUG, "\n");
13 for (i = 0; i < DIMM_SOCKETS; i++) {
14 unsigned int device;
15 device = DIMM0 + i;
16 if (device) {
17 int j;
18 printk(BIOS_DEBUG, "DIMM %d: %02x", i, device);
19 for (j = 0; j < 256; j++) {
20 int status;
21 unsigned char byte;
22 if ((j & 0xf) == 0) {
23 printk(BIOS_DEBUG, "\n%02x: ", j);
25 status = smbus_read_byte(device, j);
26 if (status < 0) {
27 printk(BIOS_DEBUG, "bad device\n");
28 break;
30 byte = status & 0xff;
31 printk(BIOS_DEBUG, "%02x ", byte);
33 printk(BIOS_DEBUG, "\n");
38 void dump_pci_device(unsigned int dev)
40 int i;
41 printk(BIOS_DEBUG, "PCI: %02x:%02x.%02x", (dev >> 20) & 0xff, (dev >> 15) & 0x1f,
42 (dev >> 12) & 7);
44 for (i = 0; i <= 255; i++) {
45 if ((i & 0x0f) == 0)
46 printk(BIOS_DEBUG, "\n%02x:", i);
47 printk(BIOS_DEBUG, " %02x", pci_read_config8(dev, i));
49 printk(BIOS_DEBUG, "\n");