diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2010-03-22 11:42:32 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2010-03-22 11:42:32 +0000 |
commit | c02b4fc9db3c3c1e263027382697b566127f66bb (patch) | |
tree | 11bd18488e360e5c1beeb9ccb852ef4489c3689a /src/lib | |
parent | 27852aba6787617ca5656995cbc7e8ef0a3ea22c (diff) | |
download | coreboot-c02b4fc9db3c3c1e263027382697b566127f66bb.tar.xz |
printk_foo -> printk(BIOS_FOO, ...)
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5266 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/cbfs.c | 32 | ||||
-rw-r--r-- | src/lib/cbmem.c | 30 | ||||
-rw-r--r-- | src/lib/clog2.c | 2 | ||||
-rw-r--r-- | src/lib/generic_dump_spd.c | 12 | ||||
-rw-r--r-- | src/lib/generic_sdram.c | 2 | ||||
-rw-r--r-- | src/lib/lzma.c | 6 | ||||
-rw-r--r-- | src/lib/malloc.c | 2 | ||||
-rw-r--r-- | src/lib/ramtest.c | 24 | ||||
-rw-r--r-- | src/lib/usbdebug_direct.c | 6 |
9 files changed, 58 insertions, 58 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index e694952f39..390e7796e8 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -42,13 +42,13 @@ static int cbfs_decompress(int algo, void *src, void *dst, int len) case CBFS_COMPRESS_LZMA: if (!ulzma(src, dst)) { - printk_err("CBFS: LZMA decompression failed!\n"); + printk(BIOS_ERR, "CBFS: LZMA decompression failed!\n"); return -1; } return 0; default: - printk_info( "CBFS: Unknown compression type %d\n", algo); + printk(BIOS_INFO, "CBFS: Unknown compression type %d\n", algo); return -1; } } @@ -63,20 +63,20 @@ static struct cbfs_header *cbfs_master_header(void) struct cbfs_header *header; void *ptr = (void *)*((unsigned long *) CBFS_HEADPTR_ADDR); - printk_spew("Check CBFS header at %p\n", ptr); + printk(BIOS_SPEW, "Check CBFS header at %p\n", ptr); header = (struct cbfs_header *) ptr; - printk_spew("magic is %08x\n", ntohl(header->magic)); + printk(BIOS_SPEW, "magic is %08x\n", ntohl(header->magic)); if (ntohl(header->magic) != CBFS_HEADER_MAGIC) { - printk_err("ERROR: No valid CBFS header found!\n"); + printk(BIOS_ERR, "ERROR: No valid CBFS header found!\n"); if (header->magic == 0xffffffff) { - printk_err("Maybe the ROM isn't entirely mapped yet?\n" + printk(BIOS_ERR, "Maybe the ROM isn't entirely mapped yet?\n" "See (and report to) http://www.coreboot.org/Infrastructure_Projects#CBFS\n"); } return NULL; } - printk_spew("Found CBFS header at %p\n", ptr); + printk(BIOS_SPEW, "Found CBFS header at %p\n", ptr); return header; } @@ -94,17 +94,17 @@ struct cbfs_file *cbfs_find(const char *name) while(1) { struct cbfs_file *file = (struct cbfs_file *) offset; if (!cbfs_check_magic(file)) return NULL; - printk_spew("Check %s\n", CBFS_NAME(file)); + printk(BIOS_SPEW, "Check %s\n", CBFS_NAME(file)); if (!strcmp(CBFS_NAME(file), name)) return file; int flen = ntohl(file->len); int foffset = ntohl(file->offset); - printk_spew("CBFS: follow chain: %p + %x + %x + align -> ", (void *)offset, foffset, flen); + printk(BIOS_SPEW, "CBFS: follow chain: %p + %x + %x + align -> ", (void *)offset, foffset, flen); unsigned long oldoffset = offset; offset = ALIGN(offset + foffset + flen, align); - printk_spew("%p\n", (void *)offset); + printk(BIOS_SPEW, "%p\n", (void *)offset); if (offset <= oldoffset) return NULL; if (offset < 0xFFFFFFFF - ntohl(header->romsize)) @@ -117,13 +117,13 @@ void *cbfs_find_file(const char *name, int type) struct cbfs_file *file = cbfs_find(name); if (file == NULL) { - printk_info( "CBFS: Could not find file %s\n", + printk(BIOS_INFO, "CBFS: Could not find file %s\n", name); return NULL; } if (ntohl(file->type) != type) { - printk_info( "CBFS: File %s is of type %x instead of" + printk(BIOS_INFO, "CBFS: File %s is of type %x instead of" "type %x\n", name, file->type, type); return NULL; @@ -193,7 +193,7 @@ void * cbfs_load_stage(const char *name) if (stage == NULL) return (void *) -1; - printk_info("Stage: loading %s @ 0x%x (%d bytes), entry @ 0x%llx\n", + printk(BIOS_INFO, "Stage: loading %s @ 0x%x (%d bytes), entry @ 0x%llx\n", name, (u32) stage->load, stage->memlen, stage->entry); @@ -206,7 +206,7 @@ void * cbfs_load_stage(const char *name) stage->len)) return (void *) -1; - printk_debug("Stage: done loading.\n"); + printk(BIOS_DEBUG, "Stage: done loading.\n"); entry = stage->entry; // entry = ntohl((u32) stage->entry); @@ -223,13 +223,13 @@ int cbfs_execute_stage(const char *name) return 1; if (ntohl(stage->compression) != CBFS_COMPRESS_NONE) { - printk_info( "CBFS: Unable to run %s: Compressed file" + printk(BIOS_INFO, "CBFS: Unable to run %s: Compressed file" "Not supported for in-place execution\n", name); return 1; } /* FIXME: This isn't right */ - printk_info( "CBFS: run @ %p\n", (void *) ntohl((u32) stage->entry)); + printk(BIOS_INFO, "CBFS: run @ %p\n", (void *) ntohl((u32) stage->entry)); return run_address((void *) ntohl((u32) stage->entry)); } diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c index 92a848497d..c57018231a 100644 --- a/src/lib/cbmem.c +++ b/src/lib/cbmem.c @@ -23,7 +23,7 @@ #include <console/console.h> #if 1 -#define debug(x...) printk_debug(x) +#define debug(x...) printk(BIOS_DEBUG, x) #else #define debug(x...) #endif @@ -110,13 +110,13 @@ void *cbmem_add(u32 id, u64 size) } if (cbmem_toc[0].magic != CBMEM_MAGIC) { - printk_err("ERROR: CBMEM was not initialized yet.\n"); + printk(BIOS_ERR, "ERROR: CBMEM was not initialized yet.\n"); return NULL; } /* Will the entry fit at all? */ if (size > cbmem_toc[0].size) { - printk_err("ERROR: Not enough memory for table %x\n", id); + printk(BIOS_ERR, "ERROR: Not enough memory for table %x\n", id); return NULL; } @@ -132,7 +132,7 @@ void *cbmem_add(u32 id, u64 size) } if (i >= MAX_CBMEM_ENTRIES) { - printk_err("ERROR: No more CBMEM entries available.\n"); + printk(BIOS_ERR, "ERROR: No more CBMEM entries available.\n"); return NULL; } @@ -214,19 +214,19 @@ void cbmem_list(void) if (cbmem_toc[i].magic != CBMEM_MAGIC) continue; - printk_debug("%2d. ", i); + printk(BIOS_DEBUG, "%2d. ", i); switch (cbmem_toc[i].id) { - case CBMEM_ID_FREESPACE: printk_debug("FREE SPACE "); break; - case CBMEM_ID_GDT: printk_debug("GDT "); break; - case CBMEM_ID_ACPI: printk_debug("ACPI "); break; - case CBMEM_ID_CBTABLE: printk_debug("COREBOOT "); break; - case CBMEM_ID_PIRQ: printk_debug("IRQ TABLE "); break; - case CBMEM_ID_MPTABLE: printk_debug("SMP TABLE "); break; - case CBMEM_ID_RESUME: printk_debug("ACPI RESUME"); break; - default: printk_debug("%08x ", cbmem_toc[i].id); + case CBMEM_ID_FREESPACE: printk(BIOS_DEBUG, "FREE SPACE "); break; + case CBMEM_ID_GDT: printk(BIOS_DEBUG, "GDT "); break; + case CBMEM_ID_ACPI: printk(BIOS_DEBUG, "ACPI "); break; + case CBMEM_ID_CBTABLE: printk(BIOS_DEBUG, "COREBOOT "); break; + case CBMEM_ID_PIRQ: printk(BIOS_DEBUG, "IRQ TABLE "); break; + case CBMEM_ID_MPTABLE: printk(BIOS_DEBUG, "SMP TABLE "); break; + case CBMEM_ID_RESUME: printk(BIOS_DEBUG, "ACPI RESUME"); break; + default: printk(BIOS_DEBUG, "%08x ", cbmem_toc[i].id); } - printk_debug("%08llx ", cbmem_toc[i].base); - printk_debug("%08llx\n", cbmem_toc[i].size); + printk(BIOS_DEBUG, "%08llx ", cbmem_toc[i].base); + printk(BIOS_DEBUG, "%08llx\n", cbmem_toc[i].size); } } #endif diff --git a/src/lib/clog2.c b/src/lib/clog2.c index 740b8d9f74..c6fe6f6cc8 100644 --- a/src/lib/clog2.c +++ b/src/lib/clog2.c @@ -17,7 +17,7 @@ unsigned long log2(unsigned long x) if (! x) { #ifdef DEBUG_LOG2 - printk_warning("%s called with invalid parameter of 0\n", + printk(BIOS_WARNING, "%s called with invalid parameter of 0\n", __func__); #endif return -1; diff --git a/src/lib/generic_dump_spd.c b/src/lib/generic_dump_spd.c index 2a71353b60..b4ff598612 100644 --- a/src/lib/generic_dump_spd.c +++ b/src/lib/generic_dump_spd.c @@ -69,25 +69,25 @@ void dump_spd_registers(void) { unsigned device; device = SMBUS_MEM_DEVICE_START; - printk_debug("\n"); + printk(BIOS_DEBUG, "\n"); while(device <= SMBUS_MEM_DEVICE_END) { int status = 0; int i; - printk_debug("dimm %02x", device); + printk(BIOS_DEBUG, "dimm %02x", device); for(i = 0; (i < 256) && (status == 0); i++) { unsigned char byte; if ((i % 20) == 0) { - printk_debug("\n%3d: ", i); + printk(BIOS_DEBUG, "\n%3d: ", i); } status = smbus_read_byte(device, i, &byte); if (status != 0) { - printk_debug("bad device\n"); + printk(BIOS_DEBUG, "bad device\n"); continue; } - printk_debug("%02x ", byte); + printk(BIOS_DEBUG, "%02x ", byte); } device += SMBUS_MEM_DEVICE_INC; - printk_debug("\n"); + printk(BIOS_DEBUG, "\n"); } } #endif diff --git a/src/lib/generic_sdram.c b/src/lib/generic_sdram.c index 7be0537484..9685267c08 100644 --- a/src/lib/generic_sdram.c +++ b/src/lib/generic_sdram.c @@ -7,7 +7,7 @@ static inline void print_debug_sdram_8(const char *strval, uint32_t val) { #if CONFIG_USE_INIT - printk_debug("%s%02x\r\n", strval, val); + printk(BIOS_DEBUG, "%s%02x\r\n", strval, val); #else print_debug(strval); print_debug_hex8(val); print_debug("\r\n"); #endif diff --git a/src/lib/lzma.c b/src/lib/lzma.c index fc533c03f1..532a2b2614 100644 --- a/src/lib/lzma.c +++ b/src/lib/lzma.c @@ -29,19 +29,19 @@ unsigned long ulzma(unsigned char * src, unsigned char * dst) memcpy(properties, src, LZMA_PROPERTIES_SIZE); outSize = *(UInt32 *)(src + LZMA_PROPERTIES_SIZE); if (LzmaDecodeProperties(&state.Properties, properties, LZMA_PROPERTIES_SIZE) != LZMA_RESULT_OK) { - printk_warning("lzma: Incorrect stream properties.\n"); + printk(BIOS_WARNING, "lzma: Incorrect stream properties.\n"); return 0; } mallocneeds = (LzmaGetNumProbs(&state.Properties) * sizeof(CProb)); if (mallocneeds > 15980) { - printk_warning("lzma: Decoder scratchpad too small!\n"); + printk(BIOS_WARNING, "lzma: Decoder scratchpad too small!\n"); return 0; } state.Probs = (CProb *)scratchpad; res = LzmaDecode(&state, src + LZMA_PROPERTIES_SIZE + 8, (SizeT)0xffffffff, &inProcessed, dst, outSize, &outProcessed); if (res != 0) { - printk_warning("lzma: Decoding error = %d\n", res); + printk(BIOS_WARNING, "lzma: Decoding error = %d\n", res); return 0; } return outSize; diff --git a/src/lib/malloc.c b/src/lib/malloc.c index 8c77fd396e..2ed23ad795 100644 --- a/src/lib/malloc.c +++ b/src/lib/malloc.c @@ -4,7 +4,7 @@ #if 0 #define MALLOCDBG(x) #else -#define MALLOCDBG(x...) printk_spew(x) +#define MALLOCDBG(x...) printk(BIOS_SPEW, x) #endif extern unsigned char _heap, _eheap; static void *free_mem_ptr = &_heap; /* Start of heap */ diff --git a/src/lib/ramtest.c b/src/lib/ramtest.c index d707bf2385..5f24bc1c7d 100644 --- a/src/lib/ramtest.c +++ b/src/lib/ramtest.c @@ -34,7 +34,7 @@ static void ram_fill(unsigned long start, unsigned long stop) * Fill. */ #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("DRAM fill: 0x%08lx-0x%08lx\r\n", start, stop); + printk(BIOS_DEBUG, "DRAM fill: 0x%08lx-0x%08lx\r\n", start, stop); #else print_debug("DRAM fill: "); print_debug_hex32(start); @@ -46,7 +46,7 @@ static void ram_fill(unsigned long start, unsigned long stop) /* Display address being filled */ if (!(addr & 0xfffff)) { #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("%08lx \r", addr); + printk(BIOS_DEBUG, "%08lx \r", addr); #else print_debug_hex32(addr); print_debug(" \r"); @@ -60,7 +60,7 @@ static void ram_fill(unsigned long start, unsigned long stop) #endif /* Display final address */ #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("%08lx\r\nDRAM filled\r\n", addr); + printk(BIOS_DEBUG, "%08lx\r\nDRAM filled\r\n", addr); #else print_debug_hex32(addr); print_debug("\r\nDRAM filled\r\n"); @@ -75,7 +75,7 @@ static void ram_verify(unsigned long start, unsigned long stop) * Verify. */ #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("DRAM verify: 0x%08lx-0x%08lx\r\n", start, stop); + printk(BIOS_DEBUG, "DRAM verify: 0x%08lx-0x%08lx\r\n", start, stop); #else print_debug("DRAM verify: "); print_debug_hex32(start); @@ -88,7 +88,7 @@ static void ram_verify(unsigned long start, unsigned long stop) /* Display address being tested */ if (!(addr & 0xfffff)) { #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("%08lx \r", addr); + printk(BIOS_DEBUG, "%08lx \r", addr); #else print_debug_hex32(addr); print_debug(" \r"); @@ -98,7 +98,7 @@ static void ram_verify(unsigned long start, unsigned long stop) if (value != addr) { /* Display address with error */ #if CONFIG_USE_PRINTK_IN_CAR - printk_err("Fail: @0x%08lx Read value=0x%08lx\r\n", addr, value); + printk(BIOS_ERR, "Fail: @0x%08lx Read value=0x%08lx\r\n", addr, value); #else print_err("Fail: @0x"); print_err_hex32(addr); @@ -109,7 +109,7 @@ static void ram_verify(unsigned long start, unsigned long stop) i++; if(i>256) { #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("Aborting.\n\r"); + printk(BIOS_DEBUG, "Aborting.\n\r"); #else print_debug("Aborting.\n\r"); #endif @@ -119,14 +119,14 @@ static void ram_verify(unsigned long start, unsigned long stop) } /* Display final address */ #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("%08lx", addr); + printk(BIOS_DEBUG, "%08lx", addr); #else print_debug_hex32(addr); #endif if (i) { #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("\r\nDRAM did _NOT_ verify!\r\n"); + printk(BIOS_DEBUG, "\r\nDRAM did _NOT_ verify!\r\n"); #else print_debug("\r\nDRAM did _NOT_ verify!\r\n"); #endif @@ -134,7 +134,7 @@ static void ram_verify(unsigned long start, unsigned long stop) } else { #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("\r\nDRAM range verified.\r\n"); + printk(BIOS_DEBUG, "\r\nDRAM range verified.\r\n"); #else print_debug("\r\nDRAM range verified.\r\n"); #endif @@ -150,7 +150,7 @@ void ram_check(unsigned long start, unsigned long stop) * are tested. -Tyson */ #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("Testing DRAM : %08lx - %08lx\r\n", start, stop); + printk(BIOS_DEBUG, "Testing DRAM : %08lx - %08lx\r\n", start, stop); #else print_debug("Testing DRAM : "); print_debug_hex32(start); @@ -161,7 +161,7 @@ void ram_check(unsigned long start, unsigned long stop) ram_fill(start, stop); ram_verify(start, stop); #if CONFIG_USE_PRINTK_IN_CAR - printk_debug("Done.\r\n"); + printk(BIOS_DEBUG, "Done.\r\n"); #else print_debug("Done.\r\n"); #endif diff --git a/src/lib/usbdebug_direct.c b/src/lib/usbdebug_direct.c index c9fe68ecfe..cb70c625e2 100644 --- a/src/lib/usbdebug_direct.c +++ b/src/lib/usbdebug_direct.c @@ -23,7 +23,7 @@ #include <console/console.h> #else #if CONFIG_USE_PRINTK_IN_CAR==0 -#define printk_debug(fmt, arg...) do {} while(0) +#define printk(BIOS_DEBUG, fmt, arg...) do {} while(0) #endif #endif @@ -304,7 +304,7 @@ static int ehci_reset_port(struct ehci_regs *ehci_regs, int port) delay_time += delay; } while ((portsc & PORT_RESET) && (--loop > 0)); if (!loop) { - printk_debug("ehci_reset_port forced done"); + printk(BIOS_DEBUG, "ehci_reset_port forced done"); } } @@ -342,7 +342,7 @@ static int ehci_wait_for_port(struct ehci_regs *ehci_regs, int port) #define DBGP_DEBUG 1 #if DBGP_DEBUG -# define dbgp_printk printk_debug +# define dbgp_printk(fmt, arg...) printk(BIOS_DEBUG, fmt, arg) #else #define dbgp_printk(fmt, arg...) do {} while(0) #endif |