| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <device/mmio.h> |
| 5 |
#include <soc/addressmap.h> |
| 6 |
#include <soc/tracker.h> |
| 7 |
#include <soc/tracker_common.h> |
| 8 |
|
| 9 |
__weak void tracker_setup(void) |
| 10 |
{ |
| 11 |
|
| 12 |
} |
| 13 |
|
| 14 |
static void tracker_dump_data(void) |
| 15 |
{ |
| 16 |
int i, j, k; |
| 17 |
int size; |
| 18 |
uintptr_t reg; |
| 19 |
struct tracker *tra; |
| 20 |
|
| 21 |
for (j = 0; j < TRACKER_NUM; j++) { |
| 22 |
tra = &tracker_data[j]; |
| 23 |
|
| 24 |
if (!(read32p(tra->base_addr) & tra->timeout)) |
| 25 |
continue; |
| 26 |
|
| 27 |
printk(BIOS_INFO, "**Dump %s debug register start**\n", tra->str); |
| 28 |
for (k = 0; k < tra->offsets_size; k++) { |
| 29 |
size = 2 * tra->entry; |
| 30 |
for (i = 0; i < size; i++) { |
| 31 |
reg = tra->base_addr + tra->offsets[k] + i * 4; |
| 32 |
printk(BIOS_INFO, "%#lx:%#x,", reg, read32p(reg)); |
| 33 |
|
| 34 |
if (i % 4 == 3 || i == size - 1) |
| 35 |
printk(BIOS_INFO, "\n"); |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
printk(BIOS_INFO, "**Dump %s debug register end**\n", tra->str); |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
void bustracker_init(void) |
| 44 |
{ |
| 45 |
tracker_dump_data(); |
| 46 |
tracker_setup(); |
| 47 |
} |