18 Commits
Author SHA1 Message Date
vhaudiquet 055563bd92 krane: restore CONFIG_USB dropped by the R35 defconfig edit; rotate 270
The R35 rotation edit used PUT 77.=77 against a stale line number and
overwrote CONFIG_USB=y with a duplicate VIDEO block, leaving the USB
menuconfig unset: no USB controller, no usb command, no keyboard.
Restore CONFIG_USB=y (deduplicate VIDEO) and verify the full USB set
in .config after the defconfig re-run.

Also flip the console rotation from 1 (90 degrees clockwise) to 3
(270 degrees clockwise): rot=1 read upside down on the device with
the keyboard attached.
2026-08-30 20:46:36 +02:00
vhaudiquet 69787732b4 krane: rotate the console 90 degrees clockwise for landscape use
The BOE TV101WUM-NL6 panel is mounted rotated 270 degrees in the
krane chassis (rotation property on the panel node in the upstream
DT). With the keyboard attached the tablet is used in landscape, so
set video rot=1 and enable CONFIG_CONSOLE_ROTATION: the uclass then
binds the rotated vidconsole1 driver, which writes glyphs rotated by
90 degrees clockwise into the native 1200x1920 portrait scanout and
uses the swapped console geometry (240 columns x 75 rows).

The framebuffer geometry and the depthcharge scanout path are
unchanged; only the console text placement rotates.
2026-08-30 20:07:22 +02:00
vhaudiquet 75fe5bc9de krane: bind the mtu3 SSUSB container so its xhci child is scanned
DM scans only the immediate subnodes of a bound node; recursion into
children happens when a bound bus driver runs dm_scan_fdt_dev. Nothing
in U-Boot binds the "mediatek,mtu3" ssusb@11201000 node, so its xhci
child (usb@11200000) was never bound, no UCLASS_USB device existed and
usb start() reported "No USB controllers found".

Add "simple-mfd" to the ssusb compatible in the -u-boot.dtsi overlay
so the generic simple-bus driver binds the node and scans its children.
2026-08-30 19:46:21 +02:00
vhaudiquet 9aca824a0a krane: enable USB xHCI, T-PHY and USB keyboard for the pogo keyboard
The pogo keyboard is a USB HID device behind the GL610 hub on
usb@11200000. Enable the USB stack (USB, DM_USB, USB_XHCI_HCD,
USB_XHCI_MTK, USB_STORAGE, CMD_USB), the MTK T-PHY (PHY_MTK_TPHY),
USB_KEYBOARD and CONFIG_USE_PREBOOT (preboot defaults to "usb start"
with USB_KEYBOARD) so the bus is enumerated before the prompt.

The upstream mt8183.dtsi models the SSUSB block for the Linux mtu3
dual-role driver: the IPPC register space and the phys live on the
parent mtu3 node while the xhci child has only its "mac" register.
U-Boot binds the "mediatek,mtk-xhci" child directly and expects
mac+ippc and a phys list on that node, so add a board
-u-boot.dtsi overlay (auto-included after the upstream dts) that
supplies them. No upstream DT files are modified.

stdin=serial,usbkbd routes the prompt through the USB keyboard once
the usb_kbd stdio device is registered.
2026-08-30 19:29:35 +02:00
vhaudiquet 709cff2d80 krane: override get_page_table_size for dynamic scanout mappings 2026-08-30 18:00:02 +02:00
vhaudiquet 8cda58518b WIP (temporary): framebuffer text logger and abort dump for bring-up 2026-08-30 17:50:00 +02:00
vhaudiquet 0de89a3ebc WIP (temporary): probe step checkpoints in scanout driver 2026-08-30 17:37:24 +02:00
vhaudiquet bd46ab0095 WIP (temporary): PANIC_HANG for bring-up abort visibility 2026-08-30 17:20:30 +02:00
vhaudiquet 20a21b5c9b WIP (temporary): board_late_init pink band checkpoint 2026-08-30 17:00:22 +02:00
vhaudiquet b5de7c4a97 WIP (temporary): main_loop entry band; disable WDT autostart for bring-up 2026-08-30 16:42:07 +02:00
vhaudiquet 5e3516ce64 krane: default env routes stdout through vidconsole; env nowhere for payload stage 2026-08-30 16:28:28 +02:00
vhaudiquet e66ab84fa7 WIP (temporary): bind/probe checkpoints in scanout driver and video uclass 2026-08-30 16:10:36 +02:00
vhaudiquet 21c66cf72e krane: CONFIG_TEXT_BASE=0x4C001000 (8-aligned, keeps _start at image base) 2026-08-30 15:46:49 +02:00
vhaudiquet a85281a550 WIP (temporary): green band at board_init_f entry for bring-up 2026-08-30 15:26:47 +02:00
vhaudiquet 46283a7722 WIP (temporary): cyan band after video_clear in video_post_probe 2026-08-30 14:47:16 +02:00
vhaudiquet 1fb1f5f95e WIP (temporary): post-clear white-band checkpoint in video_post_probe 2026-08-30 13:26:41 +02:00
vhaudiquet 08305fd8a0 WIP (temporary): add misc_init_r checkpoint band + backlight re-assert 2026-08-30 11:18:57 +02:00
vhaudiquet e00e4f172b 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.
2026-08-30 10:04:48 +02:00
9 changed files with 408 additions and 11 deletions
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
/*
* U-Boot-only additions for the MT8183 Kukui (krane) boards.
*
* The upstream mt8183.dtsi models the SSUSB block for the Linux mtu3
* dual-role driver: the IPPC register space and the phys are declared
* on the parent "mediatek,mtu3" node (ssusb@11201000), and the host
* child (usb@11200000) carries only its "mac" register.
*
* U-Boot has no mtu3 driver; it binds the "mediatek,mtk-xhci" child
* directly with drivers/usb/host/xhci-mtk.c, which expects the "mac"
* and "ippc" register names and a phys list on the xHCI node itself.
* Add the missing ippc address (taken from the ssusb node's "ippc"
* reg entry) and the port phys there.
*
* DM only scans the subnodes of nodes that a driver binds (bus drivers
* recurse via dm_scan_fdt_dev). Nothing binds "mediatek,mtu3", so the
* xHCI child would never be bound and usb_start() would report "No USB
* controllers found". Adding "simple-mfd" makes the generic simple-bus
* driver bind the ssusb node and scan its children.
*/
&ssusb {
compatible = "mediatek,mt8183-mtu3", "mediatek,mtu3", "simple-mfd";
};
&usb_host {
reg = <0x0 0x11200000 0x0 0x1000>,
<0x0 0x11203e00 0x0 0x0100>;
reg-names = "mac", "ippc";
phys = <&u2port0 PHY_TYPE_USB2>,
<&u3port0 PHY_TYPE_USB3>;
};
+6
View File
@@ -194,6 +194,12 @@ void do_bad_error(struct pt_regs *pt_regs)
*/
void do_sync(struct pt_regs *pt_regs)
{
extern void krane_fb_log_abort(unsigned long esr, unsigned long elr);
/* TEMPORARY bring-up diagnostics (krane Round 30) — do not
* upstream: draw the abort registers on the panel. */
krane_fb_log_abort(pt_regs->esr, pt_regs->elr);
if (CONFIG_IS_ENABLED(SEMIHOSTING_FALLBACK) &&
smh_emulate_trap(pt_regs))
return;
+3
View File
@@ -0,0 +1,3 @@
stdin=serial,usbkbd
stdout=serial,vidconsole
stderr=serial,vidconsole
+84
View File
@@ -4,6 +4,90 @@
* Author: Fabien Parent <fparent@baylibre.com>
*/
/*
* TEMPORARY bring-up diagnostics (krane Round 15) — do not upstream.
* Paint colored bands into the live depthcharge scanout as early-init
* checkpoints: magenta full screen = wrapper (before U-Boot), orange
* top band = board_early_init_f, blue bottom band = dram_init_banksize,
* red top band = board_early_init_r, yellow band = misc_init_r (after
* the banner stage). 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;
}
int misc_init_r(void)
{
diag_paint(300, 60, 0x00ffff00); /* yellow */
/* re-assert the backlight in case a probed driver cleared it */
writel(0x800, (void __iomem *)0x10005114);
writel(0x10000, (void __iomem *)0x10005154);
return 0;
}
int board_late_init(void)
{
diag_paint(860, 40, 0x00ff80ff); /* pink: board_late_init done */
return 0;
}
/* end TEMPORARY diagnostics */
/*
* The krane scanout driver maps the coreboot table and the live
* framebuffer dynamically after relocation (mmu_map_region), which the
* default page-table budget (sized for the static memory map only)
* does not account for. Reserve enough for those mappings.
*/
u64 get_page_table_size(void)
{
return 0x40000;
}
#include <dm.h>
#include <net.h>
+20
View File
@@ -1074,6 +1074,26 @@ void board_init_f(ulong boot_flags)
{
struct board_f boardf;
/* TEMPORARY bring-up diagnostics (krane Round 22) — do not
* upstream: green band = board_init_f entered (start.S/crt0 and
* the PIE fixup all completed). */
{
u32 base = readl((void __iomem *)0x14008f40);
if (base >= 0x40000000) {
u32 *p = (u32 *)(uintptr_t)(base + 400ULL * 4800);
int i;
if (dcache_status())
mmu_map_region(base, 0x8ca000, false);
for (i = 0; i < 60 * 1200; i++)
p[i] = 0x0000ff00;
if (dcache_status())
flush_dcache_range((uintptr_t)p,
(uintptr_t)(p + 60 * 1200));
}
}
/* end TEMPORARY diagnostics */
gd->flags = boot_flags;
gd->flags &= ~GD_FLG_HAVE_CONSOLE;
gd->boardf = &boardf;
+22 -1
View File
@@ -5,7 +5,8 @@
*/
/* #define DEBUG */
#include <asm/io.h>
#include <asm/system.h>
#include <autoboot.h>
#include <button.h>
#include <bootstage.h>
@@ -44,6 +45,26 @@ void main_loop(void)
{
const char *s;
/* TEMPORARY bring-up diagnostics (krane Round 26) — do not upstream:
* light-gray band = main_loop entered; U-Boot init fully done. */
{
u32 base = readl((void __iomem *)0x14008f40);
if (base >= 0x40000000) {
u32 *p = (u32 *)(uintptr_t)(base + 900ULL * 4800);
int i;
if (dcache_status())
mmu_map_region(base, 0x8ca000, false);
for (i = 0; i < 40 * 1200; i++)
p[i] = 0x00c0c0c0;
if (dcache_status())
flush_dcache_range((uintptr_t)p,
(uintptr_t)(p + 40 * 1200));
}
}
/* end TEMPORARY diagnostics */
bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
if (IS_ENABLED(CONFIG_VERSION_VARIABLE))
+20 -3
View File
@@ -2,7 +2,7 @@ CONFIG_ARM=y
CONFIG_COUNTER_FREQUENCY=13000000
CONFIG_POSITION_INDEPENDENT=y
CONFIG_ARCH_MEDIATEK=y
CONFIG_TEXT_BASE=0x4c000000
CONFIG_TEXT_BASE=0x4C001000
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
CONFIG_ENV_SIZE=0x1000
@@ -35,6 +35,12 @@ CONFIG_HUSH_PARSER=y
# CONFIG_CMD_GO is not set
# CONFIG_CMD_IMI is not set
CONFIG_BOOTDELAY=-1
CONFIG_USE_PREBOOT=y
CONFIG_BOARD_EARLY_INIT_F=y
CONFIG_BOARD_EARLY_INIT_R=y
CONFIG_MISC_INIT_R=y
CONFIG_BOARD_LATE_INIT=y
CONFIG_PANIC_HANG=y
# CONFIG_CMD_XIMG is not set
# CONFIG_CMD_EXPORTENV is not set
# CONFIG_CMD_IMPORTENV is not set
@@ -55,9 +61,10 @@ CONFIG_CMD_SYSBOOT=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
CONFIG_CMD_USB=y
# CONFIG_DOS_PARTITION is not set
CONFIG_ENV_IS_IN_MMC=y
CONFIG_ENV_MMC_EMMC_HW_PARTITION=2
CONFIG_ENV_IS_NOWHERE=y
CONFIG_ENV_SOURCE_FILE="krane"
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_CLK=y
CONFIG_VIDEO=y
@@ -65,12 +72,22 @@ CONFIG_VIDEO_MT8183_SCANOUT=y
# CONFIG_INPUT is not set
# CONFIG_MMC_QUIRKS is not set
CONFIG_MMC_MTK=y
CONFIG_PHY=y
CONFIG_PHY_MTK_TPHY=y
CONFIG_CONSOLE_ROTATION=y
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_MTK=y
CONFIG_USB_KEYBOARD=y
CONFIG_USB_STORAGE=y
# CONFIG_POWER is not set
CONFIG_BAUDRATE=921600
CONFIG_DM_SERIAL=y
CONFIG_DEBUG_UART_ANNOUNCE=y
CONFIG_MTK_SERIAL=y
CONFIG_WDT=y
# CONFIG_WATCHDOG_AUTOSTART is not set
CONFIG_WDT_MTK=y
# CONFIG_RANDOM_UUID is not set
# CONFIG_REGEX is not set
+160 -6
View File
@@ -21,6 +21,7 @@
#include <dm.h>
#include <video.h>
#include <video_font.h> /* Get font data, width and height */
#include <asm/io.h>
#include <asm/system.h>
#include <asm/unaligned.h>
@@ -33,18 +34,137 @@
* src/drivers/video/mtk_ddp.c (ChromeOS R93, the generation shipped on
* kukui); both agree on 0x000c for OVL_EN. The 2L sub-engine enable
* (DISP_REG_OVL0_2L_EN) lives in the same register block on MT8183.
* The layer-0 source address register (DISP_REG_OVL_L0_ADDR) is not reset
* by depthcharge's stop() and holds the live scanout address.
*/
#define DISP_REG_OVL_L0_ADDR 0x0f40
#define DISP_REG_OVL_EN 0x000c
#define DISP_REG_OVL0_2L_EN 0x100c
/* TEMPORARY bring-up diagnostics (krane Round 24) — do not upstream:
* paint a band into the live depthcharge scanout. */
/* TEMPORARY bring-up diagnostics (krane Round 30) — do not upstream:
* minimal framebuffer text logger using the built-in 8x16 font, so
* abort dumps and probe logs are readable on the panel even before
* the console exists. */
static void krane_fb_log_char(const struct video_fontdata *f,
u32 base, u32 x0, u32 y0, char c, u32 color)
{
const u8 *glyph = &f->video_fontdata[(u8)c * f->height];
u32 r, b;
if (c < 32 || c > 126)
c = '?';
glyph = &f->video_fontdata[(u8)c * f->height];
for (r = 0; r < (u32)f->height; r++) {
u32 *row = (u32 *)(uintptr_t)(base +
(u64)(y0 + r) * 4800 + (u64)x0 * 4);
u8 bits = glyph[r];
for (b = 0; b < (u32)f->width; b++)
if (bits & (0x80 >> b))
row[b] = color;
}
}
static void krane_fb_log(const char *s)
{
const struct video_fontdata *f = &fonts[0];
static u32 line, col;
u32 base = readl((void __iomem *)0x14008f40);
if (base < 0x40000000)
return;
if (dcache_status())
mmu_map_region(base, 0x8ca000, false);
for (; *s; s++) {
if (*s == '\n' || col + f->width > 1200) {
line++;
col = 0;
if (*s == '\n')
continue;
}
krane_fb_log_char(f, base, col, 1700 + line * f->height,
*s, 0x00ffffff);
col += f->width;
}
if (dcache_status())
flush_dcache_range((uintptr_t)(base + 1690ULL * 4800),
(uintptr_t)(base + 1920ULL * 4800));
}
static void krane_fb_log_hex(const char *prefix, unsigned long v)
{
char buf[32], *p = buf;
int i;
const char hexdigits[] = "0123456789abcdef";
for (i = 0; prefix[i] && i < 15; i++)
*p++ = prefix[i];
*p++ = '0';
*p++ = 'x';
for (i = (sizeof(v) * 8) - 4; i >= 0; i -= 4)
*p++ = hexdigits[(v >> i) & 0xf];
*p = 0;
krane_fb_log(buf);
krane_fb_log("\n");
}
/* Called from the arm64 abort handlers (temporary wiring in
* arch/arm/lib/interrupts_64.c): draw ESR/ELR/FAR on the panel. */
void krane_fb_log_abort(unsigned long esr, unsigned long elr)
{
unsigned long far, cvel;
asm volatile("mrs %0, CurrentEL" : "=r"(cvel));
switch (cvel >> 2) {
case 1:
asm volatile("mrs %0, far_el1" : "=r"(far));
break;
case 3:
asm volatile("mrs %0, far_el3" : "=r"(far));
break;
default:
asm volatile("mrs %0, far_el2" : "=r"(far));
}
krane_fb_log("\nABORT!\n");
krane_fb_log_hex("ESR=", esr);
krane_fb_log_hex("ELR=", elr);
krane_fb_log_hex("FAR=", far);
}
/*
* Backlight GPIOs. The MT8183 GPIO controller is at 0x10005000; the dout
* block starts at +0x100 with 16 bytes per 32-pin group and set@+4 (layout
* of GpioRegs/GpioValRegs in device-era depthcharge src/drivers/gpio/
* mt8183.h). On kukui the backlight is driven by two dedicated GPIOs:
*
* TEMPORARY bring-up diagnostics (krane Round 24) — do not upstream:
* paint a band into the live depthcharge scanout. */
static void krane_diag_band(u32 y0, u32 rows, u32 color)
{
u32 base = readl((void __iomem *)0x14008f40);
u32 *p, n = rows * 1200, i;
if (base < 0x40000000)
return;
if (dcache_status())
mmu_map_region(base, 0x8ca000, false);
p = (u32 *)(uintptr_t)(base + (u64)y0 * 4800);
for (i = 0; i < n; i++)
p[i] = color;
if (dcache_status())
flush_dcache_range((uintptr_t)p, (uintptr_t)(p + n));
}
/*
* DISP_PWM (pin 43) and EN_LCD_BL (PERIPHERAL_EN13, pin 176); depthcharge's
* kukui_backlight_update() drives both high to turn the backlight on.
*/
@@ -147,9 +267,14 @@ static int mt8183_scanout_probe(struct udevice *dev)
u64 addr;
int ret;
krane_diag_band(500, 40, 0x00ff00ff); /* magenta: probe entered */
krane_fb_log("PROBE");
ovl = dev_read_addr(dev);
if (ovl == FDT_ADDR_T_NONE)
if (ovl == FDT_ADDR_T_NONE) {
krane_diag_band(780, 40, 0x00ff0000); /* red: ovl read failed */
return log_msg_ret("ovl", -EINVAL);
}
/*
* Revive the pipeline: undo depthcharge's display_cleanup() by
@@ -163,21 +288,33 @@ static int mt8183_scanout_probe(struct udevice *dev)
(void __iomem *)MTK_GPIO_DOUT_SET(PAD_DISP_PWM));
writel(MTK_GPIO_DOUT_BIT(PAD_EN_LCD_BL),
(void __iomem *)MTK_GPIO_DOUT_SET(PAD_EN_LCD_BL));
krane_diag_band(520, 20, 0x0000ff80); /* mint: revival writes done */
krane_fb_log(" REVIVE");
/*
* The coreboot table sits above the DRAM window described by the
* control DTB; map it before parsing.
*/
mmu_map_region(COREBOOT_TABLE_ADDR, SZ_4K, false);
krane_diag_band(540, 20, 0x008000ff); /* violet: table mapped */
krane_fb_log(" MAPTBL");
ret = find_framebuffer(COREBOOT_TABLE_ADDR, &fb);
if (ret)
if (ret) {
krane_diag_band(800, 40, 0x00ff0000); /* red: lbio failed */
return log_msg_ret("lbio", ret);
}
krane_diag_band(560, 20, 0x00ffff80); /* pale yellow: LBIO found */
krane_fb_log(" LBIO");
if (fb.bits_per_pixel != 32 || fb.red_pos != 16 || fb.red_size != 8 ||
fb.green_pos != 8 || fb.green_size != 8 ||
fb.blue_pos != 0 || fb.blue_size != 8)
fb.blue_pos != 0 || fb.blue_size != 8) {
krane_diag_band(820, 40, 0x00ff0000); /* red: fmt mismatch */
return log_msg_ret("fmt", -ENOTSUPP);
}
krane_diag_band(580, 20, 0x0080ffff); /* pale cyan: fmt OK */
krane_fb_log(" FMT");
/*
* Use the address from the coreboot table when it is a plausible
@@ -189,8 +326,12 @@ static int mt8183_scanout_probe(struct udevice *dev)
if (addr < SZ_1G)
addr = readl(ovl + DISP_REG_OVL_L0_ADDR);
if (addr < SZ_1G)
if (addr < SZ_1G) {
krane_diag_band(840, 40, 0x00ff0000); /* red: no scanout addr */
return log_msg_ret("scanout", -ENODEV);
}
krane_diag_band(620, 40, 0x00aaaaaa); /* gray: geometry resolved */
krane_fb_log(" GEO");
plat->base = addr;
plat->size = fb.bytes_per_line * fb.y_resolution;
@@ -204,6 +345,19 @@ static int mt8183_scanout_probe(struct udevice *dev)
uc_priv->ysize = fb.y_resolution;
uc_priv->line_length = fb.bytes_per_line;
/*
* The BOE TV101WUM-NL6 panel is mounted rotated 270 degrees in
* the krane chassis (see the panel node's "rotation" property in
* the upstream DT). The keyboard-covered landscape orientation
* therefore needs the console rotated; the uclass then binds the
* rotated vidconsole3 text driver, which writes glyphs rotated
* by 270 degrees clockwise into the native 1200x1920 portrait
* scanout and swaps the console geometry (240x75 columns/rows
* on this panel). rot=1 (90 degrees) was tried first and read
* upside down on the device (R35).
*/
uc_priv->rot = 3;
printf("Video: MT8183 scanout %dx%d@32bpp at %llx\n",
uc_priv->xsize, uc_priv->ysize, (unsigned long long)plat->base);
+60 -1
View File
@@ -18,6 +18,8 @@
#include <video.h>
#include <video_console.h>
#include <asm/cache.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/global_data.h>
#include <dm/lists.h>
#include <dm/device_compat.h>
@@ -630,12 +632,35 @@ void video_set_white_on_black(struct udevice *dev, bool white_on_black)
}
}
/* TEMPORARY bring-up diagnostics (krane Round 20) — do not upstream:
* paint a band into the live depthcharge scanout. */
static void krane_diag_band(u32 y0, u32 rows, u32 color)
{
u32 base = readl((void __iomem *)0x14008f40);
u32 *p, n = rows * 1200, i;
if (base < 0x40000000)
return;
if (dcache_status())
mmu_map_region(base, 0x8ca000, false);
p = (u32 *)(uintptr_t)(base + (u64)y0 * 4800);
for (i = 0; i < n; i++)
p[i] = color;
if (dcache_status())
flush_dcache_range((uintptr_t)p, (uintptr_t)(p + n));
}
/* end TEMPORARY diagnostics */
/* Set up the display ready for use */
static int video_post_probe(struct udevice *dev)
{
struct video_uc_plat *plat = dev_get_uclass_plat(dev);
struct video_uc_priv *uc_priv = uclass_get_priv(dev->uclass);
struct video_priv *priv = dev_get_uclass_priv(dev);
char name[30], drv[15], *str;
const char *drv_name = drv;
struct udevice *cons;
@@ -674,7 +699,14 @@ static int video_post_probe(struct udevice *dev)
priv->white_on_black = CONFIG_IS_ENABLED(SYS_WHITE_ON_BLACK);
/* Set up colors */
if (!CONFIG_IS_ENABLED(NO_FB_CLEAR))
video_clear(dev);
/* TEMPORARY bring-up diagnostics (krane Round 20) — do not upstream:
* cyan band right after the clear: if visible, the clear and the
* fb mapping work and death happened later in this function. */
krane_diag_band(260, 60, 0x00ffff00);
/* end TEMPORARY diagnostics */
video_set_default_colors(dev, false);
if (!CONFIG_IS_ENABLED(NO_FB_CLEAR))
@@ -738,12 +770,39 @@ static int video_post_probe(struct udevice *dev)
uc_priv->cyc_active = true;
}
/* TEMPORARY bring-up diagnostics (krane Round 20) — do not upstream:
* paint a white band once the vidconsole is up, so a death between
* the framebuffer clear and the banner can be localized. */
krane_diag_band(200, 60, 0x00ffffff);
/* end TEMPORARY diagnostics */
return 0;
};
/* Post-relocation, allocate memory for the frame buffer */
static int video_post_bind(struct udevice *dev)
{
/* TEMPORARY bring-up diagnostics (krane Round 24) — do not upstream:
* purple band = a video device got bound (driver matched the DT
* node); runs before any probe. */
{
u32 base = readl((void __iomem *)0x14008f40);
if (base >= 0x40000000) {
u32 *p = (u32 *)(uintptr_t)(base + 470ULL * 4800);
int i;
if (dcache_status())
mmu_map_region(base, 0x8ca000, false);
for (i = 0; i < 30 * 1200; i++)
p[i] = 0x008000ff;
if (dcache_status())
flush_dcache_range((uintptr_t)p,
(uintptr_t)(p + 30 * 1200));
}
}
/* end TEMPORARY diagnostics */
struct video_uc_priv *uc_priv;
ulong addr;
ulong size;