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/sis/sis966 | |
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/sis/sis966')
-rw-r--r-- | src/southbridge/sis/sis966/aza.c | 17 | ||||
-rw-r--r-- | src/southbridge/sis/sis966/early_smbus.c | 22 | ||||
-rw-r--r-- | src/southbridge/sis/sis966/ide.c | 20 | ||||
-rw-r--r-- | src/southbridge/sis/sis966/nic.c | 20 | ||||
-rw-r--r-- | src/southbridge/sis/sis966/sata.c | 20 | ||||
-rw-r--r-- | src/southbridge/sis/sis966/usb.c | 20 | ||||
-rw-r--r-- | src/southbridge/sis/sis966/usb2.c | 20 |
7 files changed, 58 insertions, 81 deletions
diff --git a/src/southbridge/sis/sis966/aza.c b/src/southbridge/sis/sis966/aza.c index 7e148cf332..1a9462bb4c 100644 --- a/src/southbridge/sis/sis966/aza.c +++ b/src/southbridge/sis/sis966/aza.c @@ -244,7 +244,7 @@ static void aza_init(struct device *dev) struct resource *res; u32 codec_mask; - print_debug("AZALIA_INIT:---------->\n"); + printk(BIOS_DEBUG, "AZALIA_INIT:---------->\n"); //-------------- enable AZA (SiS7502) ------------------------- { @@ -269,19 +269,16 @@ static void aza_init(struct device *dev) { int i; - print_debug("****** Azalia PCI config ******"); - print_debug("\n 03020100 07060504 0B0A0908 0F0E0D0C"); + printk(BIOS_DEBUG, "****** Azalia PCI config ******"); + printk(BIOS_DEBUG, "\n 03020100 07060504 0B0A0908 0F0E0D0C"); for(i=0;i<0xff;i+=4){ if((i%16)==0){ - print_debug("\n"); - print_debug_hex8(i); - print_debug(": "); + printk(BIOS_DEBUG, "\n%02x: ", i); } - print_debug_hex32(pci_read_config32(dev,i)); - print_debug(" "); + printk(BIOS_DEBUG, "%08x ", pci_read_config32(dev,i)); } - print_debug("\n"); + printk(BIOS_DEBUG, "\n"); } #endif @@ -299,7 +296,7 @@ static void aza_init(struct device *dev) codecs_init(base, codec_mask); } - print_debug("AZALIA_INIT:<----------\n"); + printk(BIOS_DEBUG, "AZALIA_INIT:<----------\n"); } static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) diff --git a/src/southbridge/sis/sis966/early_smbus.c b/src/southbridge/sis/sis966/early_smbus.c index 06130dbbd1..079e4b0222 100644 --- a/src/southbridge/sis/sis966/early_smbus.c +++ b/src/southbridge/sis/sis966/early_smbus.c @@ -138,23 +138,23 @@ static inline int do_smbus_read_byte(unsigned smbus_io_base, unsigned device, un outb(0x12, smbus_io_base + 0x03); smbus_delay(); -int i,j; -for(i=0;i<0x1000;i++) -{ - if (inb(smbus_io_base + 0x00) != 0x08) - { smbus_delay(); - for(j=0;j<0xFFFF;j++); + int i, j; + for(i = 0;i < 0x1000; i++) + { + if (inb(smbus_io_base + 0x00) != 0x08) + { smbus_delay(); + for(j=0;j<0xFFFF;j++); + } } -}; global_status_register = inb(smbus_io_base + 0x00); byte = inb(smbus_io_base + 0x08); if (global_status_register != 0x08) { // lose check, otherwise it should be 0 - print_debug("Fail");print_debug("\r\t"); - return -1; + printk(BIOS_DEBUG, "Fail\r\t"); + return -1; } - print_debug("Success");print_debug("\r\t"); + printk(BIOS_DEBUG, "Success\r\t"); return byte; } @@ -706,7 +706,7 @@ static void sis_init_stage2(void) dev = pci_locate_device(PCI_ID(PCI_VENDOR_ID_SIS, PCI_DEVICE_ID_SIS_SIS966_SATA), 0); if (!dev) - print_debug("SiS 1183 does not exist !!"); + printk(BIOS_DEBUG, "SiS 1183 does not exist !!"); // SATA Set Mode pci_write_config8(dev, 0x90, (pci_read_config8(dev, 0x90)&0x3F) | 0x40); diff --git a/src/southbridge/sis/sis966/ide.c b/src/southbridge/sis/sis966/ide.c index ddfcead17f..5300b7e3a4 100644 --- a/src/southbridge/sis/sis966/ide.c +++ b/src/southbridge/sis/sis966/ide.c @@ -100,7 +100,7 @@ static void ide_init(struct device *dev) -print_debug("IDE_INIT:---------->\n"); +printk(BIOS_DEBUG, "IDE_INIT:---------->\n"); //-------------- enable IDE (SiS5513) ------------------------- @@ -149,22 +149,18 @@ print_debug("IDE_INIT:---------->\n"); { int i; - print_debug("****** IDE PCI config ******"); - print_debug("\n 03020100 07060504 0B0A0908 0F0E0D0C"); + printk(BIOS_DEBUG, "****** IDE PCI config ******"); + printk(BIOS_DEBUG, "\n 03020100 07060504 0B0A0908 0F0E0D0C"); for(i=0;i<0xff;i+=4){ - if((i%16)==0){ - print_debug("\n"); - print_debug_hex8(i); - print_debug(": "); - } - print_debug_hex32(pci_read_config32(dev,i)); - print_debug(" "); + if((i%16)==0) + printk(BIOS_DEBUG, "\n%02x: ", i); + printk(BIOS_DEBUG, "%08x ", pci_read_config32(dev,i)); } - print_debug("\n"); + printk(BIOS_DEBUG, "\n"); } #endif -print_debug("IDE_INIT:<----------\n"); +printk(BIOS_DEBUG, "IDE_INIT:<----------\n"); } static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) diff --git a/src/southbridge/sis/sis966/nic.c b/src/southbridge/sis/sis966/nic.c index 18ed75ecb3..b12c8314da 100644 --- a/src/southbridge/sis/sis966/nic.c +++ b/src/southbridge/sis/sis966/nic.c @@ -241,7 +241,7 @@ static void nic_init(struct device *dev) u32 base; struct resource *res; - print_debug("NIC_INIT:---------->\n"); + printk(BIOS_DEBUG, "NIC_INIT:---------->\n"); //-------------- enable NIC (SiS19x) ------------------------- { @@ -312,19 +312,15 @@ static void nic_init(struct device *dev) { int i; - print_debug("****** NIC PCI config ******"); - print_debug("\n 03020100 07060504 0B0A0908 0F0E0D0C"); + printk(BIOS_DEBUG, "****** NIC PCI config ******"); + printk(BIOS_DEBUG, "\n 03020100 07060504 0B0A0908 0F0E0D0C"); for(i=0;i<0xff;i+=4){ - if((i%16)==0){ - print_debug("\n"); - print_debug_hex8(i); - print_debug(": "); - } - print_debug_hex32(pci_read_config32(dev,i)); - print_debug(" "); + if((i%16)==0) + printk(BIOS_DEBUG, "\n%02x: ", i); + printk(BIOS_DEBUG, "%08x ", pci_read_config32(dev,i)); } - print_debug("\n"); + printk(BIOS_DEBUG, "\n"); } @@ -332,7 +328,7 @@ static void nic_init(struct device *dev) } -print_debug("NIC_INIT:<----------\n"); +printk(BIOS_DEBUG, "NIC_INIT:<----------\n"); return; diff --git a/src/southbridge/sis/sis966/sata.c b/src/southbridge/sis/sis966/sata.c index 3f8c28f40a..ade8c1c9b3 100644 --- a/src/southbridge/sis/sis966/sata.c +++ b/src/southbridge/sis/sis966/sata.c @@ -116,7 +116,7 @@ static void sata_init(struct device *dev) conf = dev->chip_info; - print_debug("SATA_INIT:---------->\n"); + printk(BIOS_DEBUG, "SATA_INIT:---------->\n"); //-------------- enable IDE (SiS1183) ------------------------- { @@ -151,23 +151,19 @@ for (i=0;i<10;i++){ { int i; - print_debug("****** SATA PCI config ******"); - print_debug("\n 03020100 07060504 0B0A0908 0F0E0D0C"); + printk(BIOS_DEBUG, "****** SATA PCI config ******"); + printk(BIOS_DEBUG, "\n 03020100 07060504 0B0A0908 0F0E0D0C"); for(i=0;i<0xff;i+=4){ - if((i%16)==0){ - print_debug("\n"); - print_debug_hex8(i); - print_debug(": "); - } - print_debug_hex32(pci_read_config32(dev,i)); - print_debug(" "); + if((i%16)==0) + printk(BIOS_DEBUG, "\n%02x: ", i); + printk(BIOS_DEBUG, "%08x ", pci_read_config32(dev,i)); } - print_debug("\n"); + printk(BIOS_DEBUG, "\n"); } #endif - print_debug("SATA_INIT:<----------\n"); + printk(BIOS_DEBUG, "SATA_INIT:<----------\n"); } diff --git a/src/southbridge/sis/sis966/usb.c b/src/southbridge/sis/sis966/usb.c index c33f0fcceb..5aedefbcdd 100644 --- a/src/southbridge/sis/sis966/usb.c +++ b/src/southbridge/sis/sis966/usb.c @@ -55,7 +55,7 @@ uint8_t SiS_SiS7001_init[16][3]={ static void usb_init(struct device *dev) { - print_debug("USB 1.1 INIT:---------->\n"); + printk(BIOS_DEBUG, "USB 1.1 INIT:---------->\n"); //-------------- enable USB1.1 (SiS7001) ------------------------- { @@ -76,22 +76,18 @@ static void usb_init(struct device *dev) { int i; - print_debug("****** USB 1.1 PCI config ******"); - print_debug("\n 03020100 07060504 0B0A0908 0F0E0D0C"); + printk(BIOS_DEBUG, "****** USB 1.1 PCI config ******"); + printk(BIOS_DEBUG, "\n 03020100 07060504 0B0A0908 0F0E0D0C"); for(i=0;i<0xff;i+=4){ - if((i%16)==0){ - print_debug("\n"); - print_debug_hex8(i); - print_debug(": "); - } - print_debug_hex32(pci_read_config32(dev,i)); - print_debug(" "); + if((i%16)==0) + printk(BIOS_DEBUG, "\n%02x: ", i); + printk(BIOS_DEBUG, "%08x ", pci_read_config32(dev,i)); } - print_debug("\n"); + printk(BIOS_DEBUG, "\n"); } #endif - print_debug("USB 1.1 INIT:<----------\n"); + printk(BIOS_DEBUG, "USB 1.1 INIT:<----------\n"); } static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) diff --git a/src/southbridge/sis/sis966/usb2.c b/src/southbridge/sis/sis966/usb2.c index e2112ebb0e..c6f40271e5 100644 --- a/src/southbridge/sis/sis966/usb2.c +++ b/src/southbridge/sis/sis966/usb2.c @@ -71,7 +71,7 @@ static void usb2_init(struct device *dev) int i; u8 temp8; - print_debug("USB 2.0 INIT:---------->\n"); + printk(BIOS_DEBUG, "USB 2.0 INIT:---------->\n"); //-------------- enable USB2.0 (SiS7002) ---------------------- @@ -95,21 +95,17 @@ static void usb2_init(struct device *dev) //------------------------------------------------------------- #if DEBUG_USB2 - print_debug("****** USB 2.0 PCI config ******"); - print_debug("\n 03020100 07060504 0B0A0908 0F0E0D0C"); + printk(BIOS_DEBUG, "****** USB 2.0 PCI config ******"); + printk(BIOS_DEBUG, "\n 03020100 07060504 0B0A0908 0F0E0D0C"); for(i=0;i<0xff;i+=4){ - if((i%16)==0){ - print_debug("\n"); - print_debug_hex8(i); - print_debug(": "); - } - print_debug_hex32(pci_read_config32(dev,i)); - print_debug(" "); + if((i%16)==0) + printk(BIOS_DEBUG, "\n%02x: ", i); + printk(BIOS_DEBUG, "%08x ", pci_read_config32(dev,i)); } - print_debug("\n"); + printk(BIOS_DEBUG, "\n"); #endif - print_debug("USB 2.0 INIT:<----------\n"); + printk(BIOS_DEBUG, "USB 2.0 INIT:<----------\n"); } static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) |