WIP (temporary): krane bring-up init checkpoints painting scanout bands
Diagnostic only, to be reverted before upstreaming: board_early_init_f (orange), dram_init_banksize (blue), board_early_init_r (red) paint bands into the depthcharge scanout to localize the early crash.
This commit is contained in:
@@ -4,6 +4,64 @@
|
||||
* Author: Fabien Parent <fparent@baylibre.com>
|
||||
*/
|
||||
|
||||
/*
|
||||
* TEMPORARY bring-up diagnostics (krane Round 13) — do not upstream.
|
||||
* Paint colored bands into the live depthcharge scanout as early-init
|
||||
* checkpoints: full green = wrapper (before U-Boot), orange top band =
|
||||
* board_early_init_f, blue bottom band = dram_init_banksize, red top
|
||||
* band = board_early_init_r. The last one reached localizes the crash;
|
||||
* a successful video probe clears the screen for the banner.
|
||||
*/
|
||||
#include <cpu_func.h>
|
||||
#include <fdtdec.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/system.h>
|
||||
|
||||
#define DIAG_OVL_L0_ADDR 0x14008f40
|
||||
#define DIAG_FB_WIDTH 1200
|
||||
#define DIAG_FB_BPL 4800
|
||||
#define DIAG_FB_SIZE 0x8ca000
|
||||
|
||||
static void diag_paint(u32 y0, u32 rows, u32 color)
|
||||
{
|
||||
u32 base = readl((void __iomem *)DIAG_OVL_L0_ADDR);
|
||||
u32 *p, n = rows * DIAG_FB_WIDTH, i;
|
||||
|
||||
if (base < 0x40000000)
|
||||
return;
|
||||
|
||||
if (dcache_status())
|
||||
mmu_map_region(base, DIAG_FB_SIZE, false);
|
||||
|
||||
p = (u32 *)(uintptr_t)(base + (u64)y0 * DIAG_FB_BPL);
|
||||
for (i = 0; i < n; i++)
|
||||
p[i] = color;
|
||||
|
||||
if (dcache_status())
|
||||
flush_dcache_range((uintptr_t)p,
|
||||
(uintptr_t)(p + n));
|
||||
}
|
||||
|
||||
int board_early_init_f(void)
|
||||
{
|
||||
diag_paint(0, 100, 0x00ff8000); /* orange */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dram_init_banksize(void)
|
||||
{
|
||||
fdtdec_setup_memory_banksize();
|
||||
diag_paint(1820, 100, 0x000000ff); /* blue */
|
||||
}
|
||||
|
||||
int board_early_init_r(void)
|
||||
{
|
||||
diag_paint(0, 100, 0x00ff0000); /* red */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* end TEMPORARY diagnostics */
|
||||
|
||||
#include <dm.h>
|
||||
#include <net.h>
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ CONFIG_HUSH_PARSER=y
|
||||
# CONFIG_CMD_GO is not set
|
||||
# CONFIG_CMD_IMI is not set
|
||||
CONFIG_BOOTDELAY=-1
|
||||
CONFIG_BOARD_EARLY_INIT_F=y
|
||||
CONFIG_BOARD_EARLY_INIT_R=y
|
||||
# CONFIG_CMD_XIMG is not set
|
||||
# CONFIG_CMD_EXPORTENV is not set
|
||||
# CONFIG_CMD_IMPORTENV is not set
|
||||
|
||||
Reference in New Issue
Block a user