Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 1 | /* |
Stefan Reinauer | 7e61e45 | 2008-01-18 10:35:56 +0000 | [diff] [blame] | 2 | * This file is part of the coreboot project. |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2007 Advanced Micro Devices, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | /* |
Stefan Reinauer | 38f147e | 2010-02-08 12:20:50 +0000 | [diff] [blame] | 17 | * Generic FAM10 debug code, used by mainboard specific romstage.c |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
stepan | 8301d83 | 2010-12-08 07:07:33 +0000 | [diff] [blame] | 20 | #include "pci.c" |
Myles Watson | 075fbe8 | 2010-04-15 05:19:29 +0000 | [diff] [blame] | 21 | #include <delay.h> |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 22 | |
Stefan Reinauer | 8b547b1 | 2010-03-30 09:56:35 +0000 | [diff] [blame] | 23 | static inline void print_debug_addr(const char *str, void *val) |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 24 | { |
Patrick Georgi | e82618d | 2010-10-01 14:50:12 +0000 | [diff] [blame] | 25 | #if CONFIG_DEBUG_CAR |
Myles Watson | 08e0fb8 | 2010-03-22 16:33:25 +0000 | [diff] [blame] | 26 | printk(BIOS_DEBUG, "------Address debug: %s%p------\n", str, val); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 27 | #endif |
| 28 | } |
| 29 | |
| 30 | static void print_debug_pci_dev(u32 dev) |
| 31 | { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 32 | printk(BIOS_DEBUG, "PCI: %02x:%02x.%02x", (dev>>20) & 0xff, (dev>>15) & 0x1f, (dev>>12) & 0x7); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 33 | } |
| 34 | |
Stefan Reinauer | 8b547b1 | 2010-03-30 09:56:35 +0000 | [diff] [blame] | 35 | static inline void print_pci_devices(void) |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 36 | { |
| 37 | device_t dev; |
| 38 | for(dev = PCI_DEV(0, 0, 0); |
| 39 | dev <= PCI_DEV(0xff, 0x1f, 0x7); |
| 40 | dev += PCI_DEV(0,0,1)) { |
| 41 | u32 id; |
| 42 | id = pci_read_config32(dev, PCI_VENDOR_ID); |
| 43 | if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) || |
| 44 | (((id >> 16) & 0xffff) == 0xffff) || |
| 45 | (((id >> 16) & 0xffff) == 0x0000)) { |
| 46 | continue; |
| 47 | } |
| 48 | print_debug_pci_dev(dev); |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 49 | printk(BIOS_DEBUG, " %04x:%04x\n", (id & 0xffff), (id>>16)); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 50 | if(((dev>>12) & 0x07) == 0) { |
| 51 | u8 hdr_type; |
| 52 | hdr_type = pci_read_config8(dev, PCI_HEADER_TYPE); |
| 53 | if((hdr_type & 0x80) != 0x80) { |
| 54 | dev += PCI_DEV(0,0,7); |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
Stefan Reinauer | 8b547b1 | 2010-03-30 09:56:35 +0000 | [diff] [blame] | 60 | static inline void print_pci_devices_on_bus(u32 busn) |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 61 | { |
| 62 | device_t dev; |
| 63 | for(dev = PCI_DEV(busn, 0, 0); |
| 64 | dev <= PCI_DEV(busn, 0x1f, 0x7); |
| 65 | dev += PCI_DEV(0,0,1)) { |
| 66 | u32 id; |
| 67 | id = pci_read_config32(dev, PCI_VENDOR_ID); |
| 68 | if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) || |
| 69 | (((id >> 16) & 0xffff) == 0xffff) || |
| 70 | (((id >> 16) & 0xffff) == 0x0000)) { |
| 71 | continue; |
| 72 | } |
| 73 | print_debug_pci_dev(dev); |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 74 | printk(BIOS_DEBUG, " %04x:%04x\n", (id & 0xffff), (id>>16)); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 75 | if(((dev>>12) & 0x07) == 0) { |
| 76 | u8 hdr_type; |
| 77 | hdr_type = pci_read_config8(dev, PCI_HEADER_TYPE); |
| 78 | if((hdr_type & 0x80) != 0x80) { |
| 79 | dev += PCI_DEV(0,0,7); |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 85 | static void dump_pci_device_range(u32 dev, u32 start_reg, u32 size) |
| 86 | { |
| 87 | int i; |
| 88 | print_debug_pci_dev(dev); |
| 89 | int j; |
| 90 | int end = start_reg + size; |
| 91 | |
| 92 | for(i = start_reg; i < end; i+=4) { |
| 93 | u32 val; |
| 94 | if ((i & 0x0f) == 0) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 95 | printk(BIOS_DEBUG, "\n%04x:",i); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 96 | } |
| 97 | val = pci_read_config32(dev, i); |
| 98 | for(j=0;j<4;j++) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 99 | printk(BIOS_DEBUG, " %02x", val & 0xff); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 100 | val >>= 8; |
| 101 | } |
| 102 | } |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 103 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 104 | } |
Myles Watson | 075fbe8 | 2010-04-15 05:19:29 +0000 | [diff] [blame] | 105 | |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 106 | static void dump_pci_device(u32 dev) |
| 107 | { |
| 108 | dump_pci_device_range(dev, 0, 4096); |
| 109 | } |
Myles Watson | 075fbe8 | 2010-04-15 05:19:29 +0000 | [diff] [blame] | 110 | |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 111 | static void dump_pci_device_index_wait_range(u32 dev, u32 index_reg, u32 start, |
| 112 | u32 size) |
| 113 | { |
| 114 | int i; |
| 115 | int end = start + size; |
| 116 | print_debug_pci_dev(dev); |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 117 | printk(BIOS_DEBUG, " -- index_reg=%08x", index_reg); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 118 | |
| 119 | for(i = start; i < end; i++) { |
| 120 | u32 val; |
| 121 | int j; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 122 | printk(BIOS_DEBUG, "\n%02x:",i); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 123 | val = pci_read_config32_index_wait(dev, index_reg, i); |
| 124 | for(j=0;j<4;j++) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 125 | printk(BIOS_DEBUG, " %02x", val & 0xff); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 126 | val >>= 8; |
| 127 | } |
| 128 | |
| 129 | } |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 130 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 131 | } |
Myles Watson | 075fbe8 | 2010-04-15 05:19:29 +0000 | [diff] [blame] | 132 | |
Stefan Reinauer | 8b547b1 | 2010-03-30 09:56:35 +0000 | [diff] [blame] | 133 | static inline void dump_pci_device_index_wait(u32 dev, u32 index_reg) |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 134 | { |
| 135 | dump_pci_device_index_wait_range(dev, index_reg, 0, 0x54); |
| 136 | dump_pci_device_index_wait_range(dev, index_reg, 0x100, 0x08); //DIMM1 when memclk > 400Hz |
| 137 | // dump_pci_device_index_wait_range(dev, index_reg, 0x200, 0x08); //DIMM2 |
| 138 | // dump_pci_device_index_wait_range(dev, index_reg, 0x300, 0x08); //DIMM3 |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 139 | } |
| 140 | |
Stefan Reinauer | 8b547b1 | 2010-03-30 09:56:35 +0000 | [diff] [blame] | 141 | static inline void dump_pci_device_index(u32 dev, u32 index_reg, u32 type, u32 length) |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 142 | { |
| 143 | int i; |
| 144 | print_debug_pci_dev(dev); |
| 145 | |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 146 | printk(BIOS_DEBUG, " index reg: %04x type: %02x", index_reg, type); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 147 | |
| 148 | type<<=28; |
| 149 | |
| 150 | for(i = 0; i < length; i++) { |
| 151 | u32 val; |
| 152 | if ((i & 0x0f) == 0) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 153 | printk(BIOS_DEBUG, "\n%02x:",i); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 154 | } |
| 155 | val = pci_read_config32_index(dev, index_reg, i|type); |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 156 | printk(BIOS_DEBUG, " %08x", val); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 157 | } |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 158 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 159 | } |
| 160 | |
Stefan Reinauer | 8b547b1 | 2010-03-30 09:56:35 +0000 | [diff] [blame] | 161 | static inline void dump_pci_devices(void) |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 162 | { |
| 163 | device_t dev; |
| 164 | for(dev = PCI_DEV(0, 0, 0); |
| 165 | dev <= PCI_DEV(0xff, 0x1f, 0x7); |
| 166 | dev += PCI_DEV(0,0,1)) { |
| 167 | u32 id; |
| 168 | id = pci_read_config32(dev, PCI_VENDOR_ID); |
| 169 | if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) || |
| 170 | (((id >> 16) & 0xffff) == 0xffff) || |
| 171 | (((id >> 16) & 0xffff) == 0x0000)) { |
| 172 | continue; |
| 173 | } |
| 174 | dump_pci_device(dev); |
| 175 | |
| 176 | if(((dev>>12) & 0x07) == 0) { |
| 177 | u8 hdr_type; |
| 178 | hdr_type = pci_read_config8(dev, PCI_HEADER_TYPE); |
| 179 | if((hdr_type & 0x80) != 0x80) { |
| 180 | dev += PCI_DEV(0,0,7); |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | |
Stefan Reinauer | 8b547b1 | 2010-03-30 09:56:35 +0000 | [diff] [blame] | 186 | static inline void dump_pci_devices_on_bus(u32 busn) |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 187 | { |
| 188 | device_t dev; |
| 189 | for(dev = PCI_DEV(busn, 0, 0); |
| 190 | dev <= PCI_DEV(busn, 0x1f, 0x7); |
| 191 | dev += PCI_DEV(0,0,1)) { |
| 192 | u32 id; |
| 193 | id = pci_read_config32(dev, PCI_VENDOR_ID); |
| 194 | if (((id & 0xffff) == 0x0000) || ((id & 0xffff) == 0xffff) || |
| 195 | (((id >> 16) & 0xffff) == 0xffff) || |
| 196 | (((id >> 16) & 0xffff) == 0x0000)) { |
| 197 | continue; |
| 198 | } |
| 199 | dump_pci_device(dev); |
| 200 | |
| 201 | if(((dev>>12) & 0x07) == 0) { |
| 202 | u8 hdr_type; |
| 203 | hdr_type = pci_read_config8(dev, PCI_HEADER_TYPE); |
| 204 | if((hdr_type & 0x80) != 0x80) { |
| 205 | dev += PCI_DEV(0,0,7); |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | } |
| 210 | |
Uwe Hermann | 01ce601 | 2010-03-05 10:03:50 +0000 | [diff] [blame] | 211 | #if CONFIG_DEBUG_SMBUS |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 212 | |
| 213 | static void dump_spd_registers(const struct mem_controller *ctrl) |
| 214 | { |
| 215 | int i; |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 216 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 217 | for(i = 0; i < DIMM_SOCKETS; i++) { |
| 218 | u32 device; |
| 219 | device = ctrl->spd_addr[i]; |
| 220 | if (device) { |
| 221 | int j; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 222 | printk(BIOS_DEBUG, "dimm: %02x.0: %02x", i, device); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 223 | for(j = 0; j < 128; j++) { |
| 224 | int status; |
| 225 | u8 byte; |
| 226 | if ((j & 0xf) == 0) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 227 | printk(BIOS_DEBUG, "\n%02x: ", j); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 228 | } |
| 229 | status = smbus_read_byte(device, j); |
| 230 | if (status < 0) { |
| 231 | break; |
| 232 | } |
| 233 | byte = status & 0xff; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 234 | printk(BIOS_DEBUG, "%02x ", byte); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 235 | } |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 236 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 237 | } |
| 238 | device = ctrl->spd_addr[i+DIMM_SOCKETS]; |
| 239 | if (device) { |
| 240 | int j; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 241 | printk(BIOS_DEBUG, "dimm: %02x.1: %02x", i, device); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 242 | for(j = 0; j < 128; j++) { |
| 243 | int status; |
| 244 | u8 byte; |
| 245 | if ((j & 0xf) == 0) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 246 | printk(BIOS_DEBUG, "\n%02x: ", j); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 247 | } |
| 248 | status = smbus_read_byte(device, j); |
| 249 | if (status < 0) { |
| 250 | break; |
| 251 | } |
| 252 | byte = status & 0xff; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 253 | printk(BIOS_DEBUG, "%02x ", byte); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 254 | } |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 255 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 256 | } |
| 257 | } |
| 258 | } |
| 259 | static void dump_smbus_registers(void) |
| 260 | { |
| 261 | u32 device; |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 262 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 263 | for(device = 1; device < 0x80; device++) { |
| 264 | int j; |
| 265 | if( smbus_read_byte(device, 0) < 0 ) continue; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 266 | printk(BIOS_DEBUG, "smbus: %02x", device); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 267 | for(j = 0; j < 256; j++) { |
| 268 | int status; |
| 269 | u8 byte; |
| 270 | status = smbus_read_byte(device, j); |
| 271 | if (status < 0) { |
| 272 | break; |
| 273 | } |
| 274 | if ((j & 0xf) == 0) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 275 | printk(BIOS_DEBUG, "\n%02x: ",j); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 276 | } |
| 277 | byte = status & 0xff; |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 278 | printk(BIOS_DEBUG, "%02x ", byte); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 279 | } |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 280 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 281 | } |
| 282 | } |
| 283 | #endif |
Stefan Reinauer | 8b547b1 | 2010-03-30 09:56:35 +0000 | [diff] [blame] | 284 | static inline void dump_io_resources(u32 port) |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 285 | { |
| 286 | |
| 287 | int i; |
Stefan Reinauer | 2d85fbed | 2010-04-14 15:44:21 +0000 | [diff] [blame] | 288 | udelay(2000); |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 289 | printk(BIOS_DEBUG, "%04x:\n", port); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 290 | for(i=0;i<256;i++) { |
| 291 | u8 val; |
| 292 | if ((i & 0x0f) == 0) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 293 | printk(BIOS_DEBUG, "%02x:", i); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 294 | } |
| 295 | val = inb(port); |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 296 | printk(BIOS_DEBUG, " %02x",val); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 297 | if ((i & 0x0f) == 0x0f) { |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 298 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 299 | } |
| 300 | port++; |
| 301 | } |
| 302 | } |
| 303 | |
Stefan Reinauer | 8b547b1 | 2010-03-30 09:56:35 +0000 | [diff] [blame] | 304 | static inline void dump_mem(u32 start, u32 end) |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 305 | { |
| 306 | u32 i; |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 307 | printk(BIOS_DEBUG, "dump_mem:"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 308 | for(i=start;i<end;i++) { |
| 309 | if((i & 0xf)==0) { |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 310 | printk(BIOS_DEBUG, "\n%08x:", i); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 311 | } |
Stefan Reinauer | c02b4fc | 2010-03-22 11:42:32 +0000 | [diff] [blame] | 312 | printk(BIOS_DEBUG, " %02x", (u8)*((u8 *)i)); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 313 | } |
Stefan Reinauer | 65b72ab | 2015-01-05 12:59:54 -0800 | [diff] [blame] | 314 | printk(BIOS_DEBUG, "\n"); |
Marc Jones | 8ae8c88 | 2007-12-19 01:32:08 +0000 | [diff] [blame] | 315 | } |