Skip to content

Commit

Permalink
aspeed: dump scu state
Browse files Browse the repository at this point in the history
Print the SCU registers before and after we run aspeed_init_early, as
well as after the drivers have been initalised (just before userspace is
started).

This is temporary code and should not be submitted upstream.

Signed-off-by: Joel Stanley <[email protected]>
  • Loading branch information
shenki committed Nov 18, 2015
1 parent 611d0d2 commit 052ab67
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions arch/arm/mach-aspeed/aspeed.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,35 @@ static void udbg_uart_putc(char c)
udbg_uart_out(UART_THR, c);
}

void aspeed_dump_scu(void)
{
int i;

for (i = 0; i <= 0xE4; i+=4) {
if (i == 0x78 || i == 0xE0 || i == 0xE4)
continue;
printk("SCU %03x %08x\n", i,
readl(AST_IO(AST_BASE_SCU | i)));
}

printk("SCU %02x %08x\n", 0x160, readl(AST_IO(AST_BASE_SCU | 0x160)));

for (i = 0x180; i <= 0x19C; i+=4)
printk("SCU %02x %08x\n", i,
readl(AST_IO(AST_BASE_SCU | i)));

printk("SCU %02x %08x\n", 0x1a4, readl(AST_IO(AST_BASE_SCU | 0x1a4)));
}
EXPORT_SYMBOL_GPL(aspeed_dump_scu);

#define SCU_PASSWORD 0x1688A8A8

static void __init aspeed_init_early(void)
{
u32 reg;

aspeed_dump_scu();

// XXX UART stuff to fix to pinmux & co
printk("UART IO MUX...\n");
writel(0x02010023, AST_IO(AST_BASE_LPC | 0x9c));
Expand Down Expand Up @@ -159,6 +182,8 @@ static void __init aspeed_init_early(void)
udbg_uart_putc('O');
udbg_uart_putc('O');
udbg_uart_putc('\n');

aspeed_dump_scu();
}

static void __init aspeed_map_io(void)
Expand Down
4 changes: 4 additions & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
#include <asm/sections.h>
#include <asm/cacheflush.h>

extern void aspeed_dump_scu(void);

static int kernel_init(void *);

extern void init_IRQ(void);
Expand Down Expand Up @@ -679,6 +681,8 @@ asmlinkage __visible void __init start_kernel(void)

ftrace_init();

aspeed_dump_scu();

/* Do the rest non-__init'ed, we're now alive */
rest_init();
}
Expand Down

0 comments on commit 052ab67

Please sign in to comment.