diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2015-01-05 13:01:01 -0800 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-01-06 20:15:20 +0100 |
commit | 5ab52ddc3dc289267b603c0a348c461d336aeaf5 (patch) | |
tree | 7ebe9f17e224426ad570028ec12188e165617517 /src/southbridge/via/vt8237r | |
parent | 65b72ab55d7dff1f13cdf495d345e04e634b97ac (diff) | |
download | coreboot-5ab52ddc3dc289267b603c0a348c461d336aeaf5.tar.xz |
southbridge: Drop print_ implementation from non-romcc boards
Because we had no stack on romcc boards, we had a separate, not as
powerful clone of printk: print_*. Back in the day, like more than
half a decade ago, we migrated a lot of boards to printk, but we never
cleaned up the existing code to be consistent. instead, we worked around
the problem with a very messy console.h (nowadays the mess is hidden in
romstage_console.c and early_print.h)
This patch cleans up the southbridge code to use printk() on all non-ROMCC
boards.
Change-Id: I312406257e66bbdc3940e206b5256460559a2c98
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/8110
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/southbridge/via/vt8237r')
-rw-r--r-- | src/southbridge/via/vt8237r/ctrl.c | 4 | ||||
-rw-r--r-- | src/southbridge/via/vt8237r/early_smbus.c | 26 | ||||
-rw-r--r-- | src/southbridge/via/vt8237r/vt8237r.c | 10 | ||||
-rw-r--r-- | src/southbridge/via/vt8237r/vt8237r.h | 4 |
4 files changed, 20 insertions, 24 deletions
diff --git a/src/southbridge/via/vt8237r/ctrl.c b/src/southbridge/via/vt8237r/ctrl.c index 3d856a8228..f951afa719 100644 --- a/src/southbridge/via/vt8237r/ctrl.c +++ b/src/southbridge/via/vt8237r/ctrl.c @@ -130,7 +130,7 @@ static void vt8237s_vlink_init(struct device *dev) /* No pairing NB was found. */ if (!devfun7) { - print_debug("vt8237s_vlink_init: No pairing NB was found.\n"); + printk(BIOS_DEBUG, "vt8237s_vlink_init: No pairing NB was found.\n"); return; } @@ -205,7 +205,7 @@ static void vt8237a_vlink_init(struct device *dev) /* No pairing NB was found. */ if (!devfun7) { - print_debug("vt8237a_vlink_init: No pairing NB was found.\n"); + printk(BIOS_DEBUG, "vt8237a_vlink_init: No pairing NB was found.\n"); return; } diff --git a/src/southbridge/via/vt8237r/early_smbus.c b/src/southbridge/via/vt8237r/early_smbus.c index 747dc5ca77..bb06322849 100644 --- a/src/southbridge/via/vt8237r/early_smbus.c +++ b/src/southbridge/via/vt8237r/early_smbus.c @@ -42,17 +42,17 @@ static void smbus_print_error(u8 host_status, int loops) return; if (loops >= SMBUS_TIMEOUT) - print_err("SMBus timeout\n"); + printk(BIOS_ERR, "SMBus timeout\n"); if (host_status & (1 << 4)) - print_err("Interrupt/SMI# was Failed Bus Transaction\n"); + printk(BIOS_ERR, "Interrupt/SMI# was Failed Bus Transaction\n"); if (host_status & (1 << 3)) - print_err("Bus error\n"); + printk(BIOS_ERR, "Bus error\n"); if (host_status & (1 << 2)) - print_err("Device error\n"); + printk(BIOS_ERR, "Device error\n"); if (host_status & (1 << 1)) - print_debug("Interrupt/SMI# completed successfully\n"); + printk(BIOS_DEBUG, "Interrupt/SMI# completed successfully\n"); if (host_status & (1 << 0)) - print_err("Host busy\n"); + printk(BIOS_ERR, "Host busy\n"); } /** @@ -229,7 +229,7 @@ void smbus_fixup(const struct mem_controller *ctrl) ram_slots = ARRAY_SIZE(ctrl->channel0); if (!ram_slots) { - print_err("smbus_fixup() thinks there are no RAM slots!\n"); + printk(BIOS_ERR, "smbus_fixup() thinks there are no RAM slots!\n"); return; } @@ -253,7 +253,7 @@ void smbus_fixup(const struct mem_controller *ctrl) } if (i >= SMBUS_TIMEOUT) - print_err("SMBus timed out while warming up\n"); + printk(BIOS_ERR, "SMBus timed out while warming up\n"); else PRINT_DEBUG("Done\n"); } @@ -336,7 +336,7 @@ int acpi_is_wakeup_early(void) device_t dev; u16 tmp; - print_debug("IN TEST WAKEUP\n"); + printk(BIOS_DEBUG, "IN TEST WAKEUP\n"); /* Power management controller */ dev = get_vt8237_lpc(); @@ -351,7 +351,7 @@ int acpi_is_wakeup_early(void) tmp = inw(VT8237R_ACPI_IO_BASE + 0x04); - print_debug_hex8(tmp); + printk(BIOS_DEBUG, "%02x", tmp); return ((tmp & (7 << 10)) >> 10) == 1 ? 3 : 0 ; } #endif @@ -426,7 +426,7 @@ int vt8237_early_network_init(struct vt8237_network_rom *rom) dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8233_7), 0); if (dev == PCI_DEV_INVALID) { - print_err("Network is disabled, please enable\n"); + printk(BIOS_ERR, "Network is disabled, please enable\n"); return 0; } @@ -441,7 +441,7 @@ int vt8237_early_network_init(struct vt8237_network_rom *rom) return 0; if (rom == NULL) { - print_err("No config data specified, using default MAC!\n"); + printk(BIOS_ERR, "No config data specified, using default MAC!\n"); n.mac_address[0] = 0x0; n.mac_address[1] = 0x0; n.mac_address[2] = 0xde; @@ -503,7 +503,7 @@ int vt8237_early_network_init(struct vt8237_network_rom *rom) } if (loops >= LAN_TIMEOUT) { - print_err("Timeout - LAN controller didn't accept config\n"); + printk(BIOS_ERR, "Timeout - LAN controller didn't accept config\n"); return 0; } diff --git a/src/southbridge/via/vt8237r/vt8237r.c b/src/southbridge/via/vt8237r/vt8237r.c index 5f2449a615..d392512f09 100644 --- a/src/southbridge/via/vt8237r/vt8237r.c +++ b/src/southbridge/via/vt8237r/vt8237r.c @@ -37,13 +37,9 @@ void writeback(struct device *dev, u16 where, u8 what) pci_write_config8(dev, where, what); regval = pci_read_config8(dev, where); - if (regval != what) { - print_debug("Writeback to "); - print_debug_hex8(where); - print_debug(" failed "); - print_debug_hex8(regval); - print_debug("\n"); - } + if (regval != what) + printk(BIOS_DEBUG, "Writeback to %02x failed %02x\n", + where, regval); } #else void writeback(struct device *dev, u16 where, u8 what) diff --git a/src/southbridge/via/vt8237r/vt8237r.h b/src/southbridge/via/vt8237r/vt8237r.h index ee5cc820cc..8c7ae45e9b 100644 --- a/src/southbridge/via/vt8237r/vt8237r.h +++ b/src/southbridge/via/vt8237r/vt8237r.h @@ -94,8 +94,8 @@ #define CLOCK_SLAVE_ADDRESS 0x69 #if CONFIG_DEBUG_SMBUS -#define PRINT_DEBUG(x) print_debug(x) -#define PRINT_DEBUG_HEX16(x) print_debug_hex16(x) +#define PRINT_DEBUG(x) printk(BIOS_DEBUG, x) +#define PRINT_DEBUG_HEX16(x) printk(BIOS_DEBUG, "%04x", x) #else #define PRINT_DEBUG(x) #define PRINT_DEBUG_HEX16(x) |