| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <device/mmio.h> |
| 5 |
#include <soc/addressmap.h> |
| 6 |
#include <soc/lastbus_v1.h> |
| 7 |
|
| 8 |
static unsigned long preisys_dump_offset[] = { |
| 9 |
0x500, |
| 10 |
0x504, |
| 11 |
0x508, |
| 12 |
0x50C, |
| 13 |
0x510, |
| 14 |
0x514, |
| 15 |
0x518, |
| 16 |
0x51C, |
| 17 |
0x520, |
| 18 |
0x524, |
| 19 |
0x528, |
| 20 |
0x52C, |
| 21 |
0x530, |
| 22 |
0x534, |
| 23 |
0x538, |
| 24 |
0x53C, |
| 25 |
0x580, |
| 26 |
0x584, |
| 27 |
}; |
| 28 |
|
| 29 |
static void lastbus_setup(void) |
| 30 |
{ |
| 31 |
|
| 32 |
write32p(PERICFG_BASE + BUS_PERI_R0, PERISYS_TIMEOUT); |
| 33 |
write32p(PERICFG_BASE + BUS_PERI_R1, PERISYS_ENABLE); |
| 34 |
|
| 35 |
|
| 36 |
write32p(INFRACFG_AO_BASE + BUS_INFRA_CTRL, INFRASYS_CONFIG); |
| 37 |
} |
| 38 |
|
| 39 |
static void lastbus_dump(void) |
| 40 |
{ |
| 41 |
unsigned int i; |
| 42 |
uintptr_t reg; |
| 43 |
|
| 44 |
if (read32p(INFRACFG_AO_BASE + BUS_INFRA_CTRL) & 0x1) { |
| 45 |
printk(BIOS_DEBUG, "** Dump lastbus infra debug registers start **\n"); |
| 46 |
for (i = 0; i < INFRA_NUM; i++) { |
| 47 |
reg = INFRACFG_AO_BASE + BUS_INFRA_SNAPSHOT + 4 * i; |
| 48 |
printk(BIOS_DEBUG, "%08x\n", read32p(reg)); |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
if (read32p(PERICFG_BASE + BUS_PERI_R1) & 0x1) { |
| 53 |
printk(BIOS_DEBUG, "** Dump lastbus peri debug registers start **\n"); |
| 54 |
for (i = 0; i < PERI_NUM; i++) { |
| 55 |
reg = PERICFG_BASE + preisys_dump_offset[i]; |
| 56 |
printk(BIOS_DEBUG, "%08x\n", read32p(reg)); |
| 57 |
} |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
void lastbus_init(void) |
| 62 |
{ |
| 63 |
lastbus_dump(); |
| 64 |
lastbus_setup(); |
| 65 |
} |