Compare commits

...
2 Commits
Author SHA1 Message Date
snlavaiseandClaude Opus 5.5 c5c1ec7f63 board: qualcomm: rtwo reads the pmOS FIT straight from boot_a
The ABL loads boot.img segments at fixed file offsets and does not fill
/chosen/linux,initrd-start reliably, so trusting $prevbl_initrd_start_addr
failed with "can't get kernel image!". The bootcmd now reads the FIT from
boot_a at offset 0x18c000 over UFS/SCSI (block size derived at runtime),
falling back to the old address and then to the phone menu.

Also sync pmos_bootargs with the device's deviceinfo: quiet splash with
plymouth, cpuidle.off=1, msm.separate_gpu_kms=1, deferred_probe_timeout=30,
no *_ignore_unused and no ath12k debug mask.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnHwDU5yL8L6qgPEN5CV5m
2026-09-26 20:03:48 -03:00
snlavaiseandClaude Opus 5.5 41802fcbd9 rtwo: replace 7-segment debug digits with a boot progress bar
The bring-up instrumentation drew two big 7-segment digits per code zone
from hot paths (board.c, serial_msm_geni.c, clk-uclass.c, clock-qcom.c),
firing dozens of times per second and slowing the boot noticeably. Drop
it and draw a 0-100% progress bar instead: rtwo_boot_progress_step() once
per initcall entry, rtwo_boot_progress_done() at the end of the boot.

The kalama-gcc-v2 GCC compatible fix from the previous commit stays.

This is the tree built with ~/pmos/uboot-chainload/build-uboot.sh
(patches/0001-rtwo-fixes-and-boot-progress-bar.patch) that produces the
u-boot-nodtb.bin currently running on the phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnHwDU5yL8L6qgPEN5CV5m
2026-09-26 20:03:48 -03:00
7 changed files with 339 additions and 149 deletions
+77 -70
View File
@@ -519,6 +519,8 @@ void __weak qcom_late_init(void)
#define lmb_alloc(size, addr) lmb_alloc_mem(LMB_MEM_ALLOC_ANY, SZ_2M, addr, size, LMB_NONE) #define lmb_alloc(size, addr) lmb_alloc_mem(LMB_MEM_ALLOC_ANY, SZ_2M, addr, size, LMB_NONE)
void rtwo_boot_progress_done(void);
/* Stolen from arch/arm/mach-apple/board.c */ /* Stolen from arch/arm/mach-apple/board.c */
int board_late_init(void) int board_late_init(void)
{ {
@@ -578,6 +580,8 @@ int board_late_init(void)
/* Configure the dfu_string for capsule updates */ /* Configure the dfu_string for capsule updates */
qcom_configure_capsule_updates(); qcom_configure_capsule_updates();
rtwo_boot_progress_done();
return 0; return 0;
} }
@@ -756,36 +760,42 @@ void enable_caches(void)
} }
/* /*
* Instrumentacion temporal de bring-up (rtwo, SM8550): sin UART, la unica * Barra de progreso de arranque (rtwo, SM8550): dibuja en el framebuffer que
* senal visible que este ABL deja disponible es el framebuffer que deja * el ABL deja prendido en 0xb8000000 (splash_region), la unica senal visible
* prendido en 0xb8000000 (splash_region). Cada zona de codigo (board_init_f * sin UART. Reemplaza la instrumentacion de bring-up anterior (digitos de
* generico, board_init_r generico, probe de serial, camino de clk_enable) * 7 segmentos por zona de codigo en board.c/serial_msm_geni.c/clk-uclass.c/
* llama a rtwo_debug_blink_zone() con su propio numero de zona, que se * clock-qcom.c/clock-sm8550.c, ver historial en memoria rtwo-uboot-chainload)
* dibuja como DOS DIGITOS GRANDES ESTILO 7-SEGMENTOS (blanco sobre negro, * una vez confirmado que el chainload arranca: aquella instrumentacion vivia
* el numero de zona en decimal, directo). Los esquemas anteriores (bandas * dentro de rutas calientes (clk_enable/qcom_gate_clk_en/probe de serial, con
* horizontales para contar, luego un codigo binario de 6 barras) resultaron * un flush de cache de los 10 MiB completos del framebuffer en CADA llamada)
* fragiles con luz/reflejo del vidrio: dos lecturas distintas del mismo * y se disparaba decenas de veces por segundo, alargando bastante el arranque.
* codigo de barras (una por foto, otra mirando el telefono directo) sobre * Esta version solo se engancha una vez por paso de `include/initcall.h`
* la misma pantalla congelada -- ver memoria rtwo-uboot-chainload. Un * (rtwo_boot_progress_step(), UN llamado por entrada de
* numero grande no necesita interpretacion. Cada sitio instrumentado en * init_sequence_f[]/init_sequence_r[], no por operacion de bajo nivel) y solo
* board.c/serial_msm_geni.c/clk-uclass.c/clock-qcom.c/clock-sm8550.c tiene * toca/flushea el rectangulo de la barra, no la pantalla entera.
* su propio numero GLOBAL y UNICO de zona (1, 2 para los INITCALL * Mantenimiento de cache manual porque el framebuffer lo lee el controlador
* genericos de board_init_f/board_init_r; 10-39 para los pasos de probe de * de display directamente de DRAM, sin pasar por la CPU.
* serial y del camino de clk_enable). rtwo_debug_blink() (zona 1/2 segun
* GD_FLG_RELOC) es la que llama include/initcall.h en cada INITCALL de
* board_init_f/board_init_r.
* Mantenimiento de cache manual porque el framebuffer lo lee el
* controlador de display directamente de DRAM, sin pasar por la CPU.
*/ */
#define RTWO_FB_BASE 0xb8000000UL #define RTWO_FB_BASE 0xb8000000UL
#define RTWO_FB_SIZE 0xA00000UL /* 10 MiB: cubre 1080x2400x4 con margen */ #define RTWO_FB_SIZE 0xA00000UL /* 10 MiB: cubre 1080x2400x4 con margen */
#define RTWO_FB_STRIDE_WORDS 1080UL /* ancho en palabras de 32 bits */ #define RTWO_FB_STRIDE_WORDS 1080UL /* ancho en palabras de 32 bits */
#define RTWO_DIGIT_W 360UL #define RTWO_BAR_X0 140UL
#define RTWO_DIGIT_H 700UL #define RTWO_BAR_X1 940UL /* 800 px de ancho, centrada */
#define RTWO_DIGIT_THICK 70UL #define RTWO_BAR_Y0 1150UL
#define RTWO_DIGIT_GAP 60UL #define RTWO_BAR_Y1 1250UL /* 100 px de alto */
#define RTWO_DIGIT_Y0 850UL /* deja libre la zona de la camara punch-hole arriba */ #define RTWO_BAR_BORDER 6UL
/*
* Estimacion aproximada de cuantos pasos de INITCALL hay entre
* board_init_f() y board_init_r() en esta config -- no hace falta que sea
* exacta, solo que la barra avance de forma pareja y no llegue a 100% antes
* de tiempo. rtwo_boot_progress_done() (llamada al final de
* board_late_init(), justo antes de bootcmd) la fuerza a 100% siempre, sin
* depender de haber contado bien.
*/
#define RTWO_BOOT_STEPS_ESTIMATE 40U
#define RTWO_BOOT_PROGRESS_CAP 96U /* tope hasta el 100% explicito */
static void rtwo_fill_rect(volatile unsigned int *fb, unsigned long x0, unsigned long y0, static void rtwo_fill_rect(volatile unsigned int *fb, unsigned long x0, unsigned long y0,
unsigned long x1, unsigned long y1, unsigned int color) unsigned long x1, unsigned long y1, unsigned int color)
@@ -800,59 +810,56 @@ static void rtwo_fill_rect(volatile unsigned int *fb, unsigned long x0, unsigned
} }
} }
/* Mascara de segmentos por digito: bit0=A(arriba) bit1=B(sup-der) static void rtwo_flush_bar_cache(void)
* bit2=C(inf-der) bit3=D(abajo) bit4=E(inf-izq) bit5=F(sup-izq) bit6=G(medio),
* codificacion estandar de un display de 7 segmentos.
*/
static void rtwo_draw_digit(volatile unsigned int *fb, unsigned long x0, unsigned int digit)
{ {
static const unsigned char segs[10] = {
0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F,
};
unsigned char m = digit < 10 ? segs[digit] : 0;
unsigned long y0 = RTWO_DIGIT_Y0;
unsigned long yh = y0 + RTWO_DIGIT_H / 2;
unsigned long y1 = y0 + RTWO_DIGIT_H;
unsigned long t = RTWO_DIGIT_THICK;
unsigned int on = 0xFFFFFFFFu;
if (m & 0x01) /* A */
rtwo_fill_rect(fb, x0 + t, y0, x0 + RTWO_DIGIT_W - t, y0 + t, on);
if (m & 0x40) /* G */
rtwo_fill_rect(fb, x0 + t, yh - t / 2, x0 + RTWO_DIGIT_W - t, yh + t / 2, on);
if (m & 0x08) /* D */
rtwo_fill_rect(fb, x0 + t, y1 - t, x0 + RTWO_DIGIT_W - t, y1, on);
if (m & 0x20) /* F */
rtwo_fill_rect(fb, x0, y0, x0 + t, yh + t / 2, on);
if (m & 0x02) /* B */
rtwo_fill_rect(fb, x0 + RTWO_DIGIT_W - t, y0, x0 + RTWO_DIGIT_W, yh + t / 2, on);
if (m & 0x10) /* E */
rtwo_fill_rect(fb, x0, yh - t / 2, x0 + t, y1, on);
if (m & 0x04) /* C */
rtwo_fill_rect(fb, x0 + RTWO_DIGIT_W - t, yh - t / 2, x0 + RTWO_DIGIT_W, y1, on);
}
void rtwo_debug_blink_zone(unsigned int zone)
{
volatile unsigned int *fb = (volatile unsigned int *)RTWO_FB_BASE;
const unsigned long total_words = RTWO_FB_SIZE / 4;
const unsigned long total_rows = total_words / RTWO_FB_STRIDE_WORDS;
const unsigned long margin_left = (RTWO_FB_STRIDE_WORDS - (2 * RTWO_DIGIT_W + RTWO_DIGIT_GAP)) / 2;
unsigned long addr; unsigned long addr;
unsigned long start = RTWO_FB_BASE + RTWO_BAR_Y0 * RTWO_FB_STRIDE_WORDS * 4;
rtwo_fill_rect(fb, 0, 0, RTWO_FB_STRIDE_WORDS, total_rows, 0u); /* fondo negro */ unsigned long end = RTWO_FB_BASE + RTWO_BAR_Y1 * RTWO_FB_STRIDE_WORDS * 4;
rtwo_draw_digit(fb, margin_left, zone / 10U);
rtwo_draw_digit(fb, margin_left + RTWO_DIGIT_W + RTWO_DIGIT_GAP, zone % 10U);
asm volatile("dsb sy" ::: "memory"); asm volatile("dsb sy" ::: "memory");
for (addr = RTWO_FB_BASE; addr < RTWO_FB_BASE + RTWO_FB_SIZE; addr += 64) for (addr = start & ~63UL; addr < end; addr += 64)
asm volatile("dc civac, %0" :: "r"(addr) : "memory"); asm volatile("dc civac, %0" :: "r"(addr) : "memory");
asm volatile("dsb sy" ::: "memory"); asm volatile("dsb sy" ::: "memory");
asm volatile("isb" ::: "memory"); asm volatile("isb" ::: "memory");
} }
void rtwo_debug_blink(void) static void rtwo_draw_progress_bar(unsigned int percent)
{ {
rtwo_debug_blink_zone((gd->flags & GD_FLG_RELOC) ? 2U : 1U); volatile unsigned int *fb = (volatile unsigned int *)RTWO_FB_BASE;
unsigned long fill_x1;
if (percent > 100U)
percent = 100U;
/* borde blanco */
rtwo_fill_rect(fb, RTWO_BAR_X0, RTWO_BAR_Y0, RTWO_BAR_X1, RTWO_BAR_Y1, 0xFFFFFFFFu);
/* fondo negro, dentro del borde */
rtwo_fill_rect(fb, RTWO_BAR_X0 + RTWO_BAR_BORDER, RTWO_BAR_Y0 + RTWO_BAR_BORDER,
RTWO_BAR_X1 - RTWO_BAR_BORDER, RTWO_BAR_Y1 - RTWO_BAR_BORDER, 0u);
fill_x1 = RTWO_BAR_X0 + RTWO_BAR_BORDER +
(RTWO_BAR_X1 - RTWO_BAR_X0 - 2 * RTWO_BAR_BORDER) * percent / 100U;
if (fill_x1 > RTWO_BAR_X0 + RTWO_BAR_BORDER)
rtwo_fill_rect(fb, RTWO_BAR_X0 + RTWO_BAR_BORDER, RTWO_BAR_Y0 + RTWO_BAR_BORDER,
fill_x1, RTWO_BAR_Y1 - RTWO_BAR_BORDER, 0xFFFFFFFFu);
rtwo_flush_bar_cache();
}
void rtwo_boot_progress_step(void)
{
static unsigned int steps;
unsigned int percent;
steps++;
percent = steps * RTWO_BOOT_PROGRESS_CAP / RTWO_BOOT_STEPS_ESTIMATE;
if (percent > RTWO_BOOT_PROGRESS_CAP)
percent = RTWO_BOOT_PROGRESS_CAP;
rtwo_draw_progress_bar(percent);
}
void rtwo_boot_progress_done(void)
{
rtwo_draw_progress_bar(100U);
} }
+254 -20
View File
@@ -22,14 +22,242 @@ serial_gadget=setenv stdin serial,button-kbd,usbacm; \
# then bail out to the boot menu instead (with a pause to read # then bail out to the boot menu instead (with a pause to read
# the error message) # the error message)
# #
# rtwo (Motorola Edge 40 Pro, SM8550): the ABL loads the FIT image # rtwo (Motorola Edge 40 Pro, SM8550): the FIT image (mainline Image +
# (mainline Image + dtb + initramfs) into the ramdisk slot of the # dtb + initramfs) is packed by pack-fixedoff.py at a FIXED FILE OFFSET
# Android boot.img. The ABL writes that address into # (0x18c000) inside boot_a -- same offset the ABL uses to load kernel/
# /chosen/linux,initrd-start of the fdt it hands us, and U-Boot saves # dtb, discovered via RE because this ABL does NOT follow the standard
# it as $prevbl_initrd_start_addr (CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR). # Android boot.img formula. Confirmed in hardware (2026-09-17): trusting
# Try that first; only fall back to the phone menu if it fails. # $prevbl_initrd_start_addr (CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR,
pmos_bootargs=earlycon console=ttyMSM0,115200n8 panic=5 pmos.debug-shell clk_ignore_unused pd_ignore_unused regulator_ignore_unused allow_mismatched_32bit_el0 pmos_boot_uuid=d4373976-057c-4cf3-a43d-00734001b405 pmos_root_uuid=09804032-85bb-4d57-95a5-00d1965fb10f pmos_rootfsopts=defaults # i.e. what the ABL claims via /chosen/linux,initrd-start) fails with
bootcmd=setenv bootargs $pmos_bootargs; echo pmOS: booting FIT at prevbl_initrd_start_addr=$prevbl_initrd_start_addr; bootm $prevbl_initrd_start_addr; echo pmOS: bootm failed; bootefi bootmgr; pause; run menucmd # "ERROR -91E: can't get kernel image!" (EPROTOTYPE, no FIT magic at
# that address) -- consistent with the ABL's fixed-offset loading not
# populating that property correctly either. So: read the FIT ourselves
# straight from boot_a at the known offset via the UFS/SCSI block layer
# (preboot already did `scsi scan`) into $ramdisk_addr_r (128 MiB
# scratch region board_late_init reserves, arch/arm/mach-snapdragon/
# board.c). Block size is derived at runtime (100663296 / blocks-in-
# partition) instead of assumed, since we don't know if this UFS LU
# reports 512B or 4096B logical blocks. Falls back to the old
# prevbl_initrd_start_addr attempt, then to the phone menu, if this
# fails -- see memoria rtwo-uboot-chainload-fit-raw-read.
pmos_bootargs=earlycon console=tty0 quiet splash panic=5 allow_mismatched_32bit_el0 random.trust_cpu=on printk.devkmsg=on systemd.log_ratelimit_kmsg=false cpufreq.default_governor=performance cpuidle.off=1 module_blacklist=camcc_sm8550 msm.separate_gpu_kms=1 deferred_probe_timeout=30 pmos_boot_uuid=d97fabaa-100c-47f0-960c-6c09b2ff0841 pmos_root_uuid=91b412b8-cdef-4021-babe-a4e50295329c pmos_rootfsopts=defaults
# 2026-09-25: plymouth REHABILITADO y kernel silencioso ('quiet splash'; quitados
# ignore_loglevel, systemd.log_target=kmsg y plymouth.enable=0 del bring-up).
# Sincronizado con deviceinfo. Para depurar: opcion 1 del menu (debug shell) o
# volver a agregar ignore_loglevel.
# 'clk/pd/regulator_ignore_unused' QUITADOS 2026-09-25 (sincronizado con deviceinfo):
# probados desde el menu (opciones de PRUEBA, ya retiradas). El kernel apaga
# relojes (LPASS, rpmh _ao, qdss, ipa) y dominios sin uso; ningun regulador se
# apaga (Linux nunca voto esos rieles rpmh). Panel, WiFi, USB, tactil, bateria,
# ADSP/CDSP verificados OK.
# 'msm.separate_gpu_kms=1 deferred_probe_timeout=30' AGREGADOS 2026-09-25 (sincronizado con
# deviceinfo): bring-up del panel NT37705. separate_gpu_kms evita que el
# display espere al GPU (adreno no llega a probe: su SMMU fallo con -110 en
# r43); el timeout de 30 s cubre modulos que recien cargan al montar rootfs.
# 'ath12k.debug_mask=0x66' QUITADO 2026-09-22 (sincronizado con deviceinfo):
# el WiFi del rtwo ya funciona y el mask inundaba dmesg con el header de
# cada HTC RX + cada mensaje WMI (bits WMI 0x2|HTC 0x4|BOOT 0x20|QMI 0x40,
# solo compilados con CONFIG_ATH12K_DEBUG=y, kernel pkgrel>=40). Si vuelve
# a hacer falta diagnostico, re-agregar exactamente: ath12k.debug_mask=0x66
# 'cpuidle.off=1' AGREGADO 2026-09-21 (sincronizado con deviceinfo, ver
# comentario ahi con el mismo fechado): prueba para aislar el reset random
# de un cuelgue en C-state profundo via PSCI CPU_SUSPEND.
# CONFIRMADO EN HARDWARE 2026-09-22: el reset random no volvio a aparecer
# (junto con videocc_sm8550 reactivado y CONFIG_GUNYAH_WATCHDOG=y) -- FIX
# VIGENTE, no sacar sin bisectar primero.
# UUIDs actualizados 2026-09-18 (de nuevo): cada 'pmbootstrap install' genera
# UUIDs al azar para pmOS_boot/pmOS_root -- hay que resincronizar esto ACA
# despues de CUALQUIER install nuevo (paso 3 de rebuild-full.sh), antes de
# armar rootfs-raw-new.img y reflashear, o el init nunca encuentra el root
# real. Verificar con: fdisk -b 4096 -l rootfs-raw-new.img (offsets de
# particion) + dd+blkid sobre cada una (ver conversacion 2026-09-18).
# 'console=ttyMSM0,115200n8' sacado (2026-09-18), en sincronia con deviceinfo:
# no hay UART real enganchado, la consola real es la de framebuffer (tty0).
# 'random.trust_cpu=on' AGREGADO (2026-09-18): sshdgenkeys.service
# (ExecStart=ssh-keygen -A) se cuelga en getrandom() -- confirmado ping
# responde pero ssh/sshd nunca arranca, y no hay ningun telnetd en el
# rootfs real (ese solo vivia en el initramfs de pmos.debug-shell). Sin
# CONFIG_CRYPTO_DEV_QCOM_RNG matcheando el DT (compatible "qcom,trng" del
# SoC, ese driver es para "qcom,prng" viejo) y sin confirmar que
# ARM_SMCCC_TRNG funcione contra firmware downstream de Motorola (mismo
# patron que QTEE/sleep_clk/cpufreq-hw en este bring-up), el CRNG puede
# no inicializarse nunca solo. Cortex-X3/A715 de este SoC implementan
# RNDR (ARMv8.5 FEAT_RNG); esto le dice al kernel que confie en esa
# instruccion para sembrar el CRNG de una sin esperar entropia de
# interrupciones ni un HWRNG por DT.
# 'printk.devkmsg=on' AGREGADO 2026-09-21, INSUFICIENTE POR SI SOLO: se
# penso que la causa de que la pantalla del framebuffer se "congele" en
# medio del boot (aunque el equipo siga vivo por red) era el rate-limit del
# KERNEL a las escrituras de userspace en /dev/kmsg -- confirmado en
# hardware que NO alcanza: con este flag solo, la linea reveladora
# "systemd[1]: Too many messages being logged to kmsg, ignoring" sigue
# apareciendo exactamente igual. 'systemd.log_ratelimit_kmsg=false'
# AGREGADO 2026-09-21 (segundo intento): el rate-limit real es del propio
# systemd, no del kernel -- write_to_kmsg() en systemd tiene su PROPIO
# limitador interno (RATELIMIT_STATE_DEFINE, independiente de
# printk.devkmsg), documentado como $SYSTEMD_LOG_RATELIMIT_KMSG /
# systemd.log_ratelimit_kmsg= en systemd(1)/kernel-command-line(7)
# (boolean, default true). Se deja printk.devkmsg=on de todos modos (no
# molesta, y sigue siendo necesario para que systemd pueda ESCRIBIR a
# /dev/kmsg sin CAP_SYSLOG restrictions en algunos casos), pero el fix
# real para el freeze es este segundo flag. Ver comentario igual en
# device-motorola-rtwo/deviceinfo. CONFIRMADO EN HARDWARE QUE TAMPOCO
# ALCANZA: el usuario reporto que despues del freeze NO aparece ningun
# mensaje nuevo en pantalla, ni siquiera los timeouts de WMI del kernel que
# se repiten cada ~13s (esos SI se siguen generando en el ring buffer,
# confirmado por SSH). Eso descarta cualquier teoria de "se generan menos
# mensajes" -- el framebuffer literalmente deja de refrescarse, sin
# relacion con el volumen de logging.
#
# 'cpufreq.default_governor=performance' AGREGADO 2026-09-21 (tercer
# intento, DIAGNOSTICO): el .dts del dispositivo
# (sm8550-motorola-rtwo.dts lineas 721-754) ya documenta que dispcc
# habilitado por defecto GLITCHEA disp_cc_mdss_mdp_clk_src (el reloj de
# pixeles del MDP que el ABL/U-Boot deja corriendo para seguir escaneando
# el framebuffer heredado) porque clk_rcg2_shared_init() sincroniza TODOS
# los RCG del controlador al hacer probe -- fix aplicado ahi:
# '&dispcc { status = "disabled"; }', confirmado que sigue vigente. Pero
# el freeze persiste con ese fix ya puesto, asi que algo MAS sigue tocando
# ese mismo reloj heredado por una via distinta a la del propio driver de
# dispcc (que ya esta bloqueada). Hipotesis: GCC (habilitado normalmente)
# comparte una PLL padre con ese reloj de pixeles, y cuando el gobernador
# de cpufreq empieza a escalar la frecuencia de CPU (justo despues de que
# el boot termina y baja la carga -- la misma ventana de tiempo donde
# aparece el freeze en los dumps), toca esa PLL compartida y glitchea
# indirectamente el reloj heredado, sin que dispcc haga probe. Este flag
# fija el governor a 'performance' (sin escalado dinamico) para probar si
# eso evita el glitch. CONFIRMADO EN HARDWARE QUE TAMPOCO ALCANZA: freeze
# identico con el governor fijo en performance -- descarta cpufreq DVFS
# como causa.
#
# Con este punto YA se descartaron 4 hipotesis con evidencia real: rate
# limit del kernel, rate limit de systemd, cpufreq, Y (via dmesg | grep
# WARNING/clk_rcg2/update_config/genpd/regulator_set_voltage, todo vacio
# salvo 'PM: genpd: Not disabling unused power domains') el mecanismo
# exacto de dispcc pero via otro controlador (videocc/camcc) -- no aparece
# ningun warning de esa familia, asi que ese mecanismo especifico tampoco
# es. Tambien confirmado por el usuario que el freeze pasaba INCLUSO ANTES
# de que existieran los nodos de WiFi en el .dts -- descarta PCIe/ath12k
# como causa (la correlacion de ~0.5-0.7s con la deteccion del chip WiFi en
# los dumps es coincidencia de timing, no causal).
#
# 'systemd.mask=systemd-udev-trigger.service' PROBADO 2026-09-21 (cuarto
# intento, BISECCION): confirmado en hardware que CON esto el freeze
# DESAPARECE (pantalla se mantuvo viva, mostro "emergency mode" en vez de
# congelarse) -- prueba definitiva de que es un driver/modulo cargado
# durante el coldplug de udev, no un timeout de hardware. PERO bloquear
# el coldplug entero rompe el boot normal (systemd cae a emergency mode
# sin red -- probablemente porque el propio descubrimiento de
# particiones/interfaz USB de red tambien depende de udev). SACADO por
# eso, reemplazado por el flag de abajo para bisectar sin romper el boot.
#
# 'module_blacklist=gpucc_sm8550,videocc_sm8550,camcc_sm8550' AGREGADO
# 2026-09-21 (quinto intento, BISECCION mas quirurgica) -- CONFIRMADO EN
# HARDWARE QUE ESTE ES EL FIX: con estos 3 modulos bloqueados, boot
# completo normal (SSH/red funcionando) Y la pantalla llega hasta el
# login prompt sin congelarse. NO SE AISLO cual de los tres en particular
# es el culpable real (el usuario no necesita GPU/video-codec/camara en
# este bring-up, asi que no vale la pena bisectar mas por ahora) -- si en
# el futuro hace falta reactivar alguno de los tres (ej. GPU para
# aceleracion grafica), hay que sacarlo de esta lista de a uno, probar en
# hardware con la pantalla, y si alguno individualmente reproduce el
# freeze, ese es el candidato para deshabilitar a nivel .dts (status =
# "disabled", mismo patron que dispcc) en vez de blacklistear el modulo
# via cmdline. FIX VIGENTE.
# 'gpucc_sm8550' SACADO de la lista (2026-09-21) para empezar el bisect
# de a uno (sincronizado con deviceinfo, ver comentario ahi con el mismo
# fechado para el razonamiento completo). videocc_sm8550/camcc_sm8550
# SIGUEN blacklisteados.
# 'videocc_sm8550' SACADO 2026-09-21 mas tarde (sincronizado con
# deviceinfo, ver comentario ahi para el razonamiento completo sobre
# HW_CTRL_TRIGGER en video_cc_mvs0/mvs1_gdsc). camcc_sm8550 SIGUE
# blacklisteado. CONFIRMADO EN HARDWARE 2026-09-22: reset random resuelto,
# ver comentario de cpuidle.off=1 mas arriba.
# (Historial de UUIDs viejos borrado -- cambian en CADA 'pmbootstrap install',
# no vale la pena llevar el registro aca. Ver el comentario de arriba, junto
# a pmos_bootargs, para el procedimiento de resincronizarlos.)
# DEBUG rtwo 2026-09-18: systemd.log_level=debug + log_target=kmsg agregados
# para diagnosticar por que "pmos_continue_boot" se cuelga despues de
# "Reached target Local Encrypted Volumes" (confirmado que NO es cifrado --
# /etc/crypttab no existe en el rootfs, --no-fde). Con esto los mensajes de
# arranque de systemd (que Plymouth normalmente oculta de la consola visible)
# van al kernel printk, que CONFIG_PSTORE_CONSOLE ya captura en la region
# ramoops (0xae000000) -- se puede leer el intento colgado desde CUALQUIER
# boot posterior (incluida la consola de debug) con
# 'cat /sys/fs/pstore/console-ramoops-0', sin UART. Quitar una vez
# encontrada la unidad que cuelga.
# ESTADO 2026-09-17: vuelto a dejar tal cual quedo justo despues del PRIMER
# cambio de la implementacion EFI (antes de corregir el offset del ramdisk
# de imxtract y antes de sacar ignore_loglevel) -- checkpoint pedido para
# retomar la exploracion del camino EFI, esta vez via una particion real
# (userdata) en vez del RAM-only que se probo primero.
#
# DEBUG 2026-09-17 (quinta vuelta): probar el camino EFI en vez de bootm+FIT.
# bootefi usa boot/efi_loader (AllocatePages/LoadFile2) para el initrd, no
# boot_ramdisk_high()/LMB "high address" -- codigo completamente distinto,
# asi que el bug de orden fijo start/loados/ramdisk/fdt de bootm no aplica
# aca. Ademas, en el lado del kernel, el stub EFI arm64 (CONFIG_EFI_STUB=y,
# ya compilado) carga el initrd via efi_load_initrd()/LoadFile2, que NUNCA
# pasa por early_init_dt_check_for_initrd()/reserve_initrd_mem() -- el
# chequeo memblock_is_region_reserved() que sospechabamos ni siquiera se
# ejecuta para este camino. bootargs se sigue pasando igual (bootefi
# convierte $bootargs a UTF-16 como load options).
#
# Mismo FIT de siempre (sin repackaging), pero en vez de bootm lo parseamos
# con imxtract (CONFIG_CMD_XIMG=y, ya compilado) para sacar cada sub-imagen
# a una direccion de RAM aparte:
# - kernel -> $kernel_addr_r (misma que bootm usaba para relocar)
# - fdt -> $fdt_addr_r (la misma que bootmenu_10 ya usa con exito)
# - ramdisk -> $kernel_comp_addr_r (NO un offset inventado desde
# $ramdisk_addr_r -- eso fue el bug original: $ramdisk_addr_r + 0x8000000
# coincidia EXACTO con $kernel_addr_r y piso el kernel ya extraido
# ("No UEFI binary known at <addr>"). Investigado en la lista de U-Boot
# (parche "mach-snapdragon: dynamic load addresses", 2026): board.c
# arma estas variables como bloques LMB DEDICADOS y consecutivos --
# kernel_addr_r=128MiB, ramdisk_addr_r=128MiB (por eso el offset exacto
# de 0x8000000=128MiB), kernel_comp_addr_r=64MiB, fdt_addr_r=2MiB. El
# bug de fondo era usar $ramdisk_addr_r para algo que NO es su proposito
# (nuestro buffer crudo del FIT completo, ~55 MiB) y encima calcular un
# offset a mano dentro de ese mismo bloque de 128 MiB, invadiendo el
# vecino. $kernel_comp_addr_r es un bloque separado, dedicado a
# descomprimir un kernel comprimido -- el nuestro (Image sin comprimir,
# CONFIG_EFI_ZBOOT apagado) no lo usa, asi que esta libre y garantizado
# sin solaparse con ningun otro _addr_r por construccion.
# imxtract fija $filesize despues de cada extraccion (confirmado en
# cmd/ximg.c), por eso el tamano del ramdisk y del kernel se guardan aparte
# antes de que la siguiente llamada los pise.
#
# 2026-09-18: "No UEFI binary known at <addr>" seguia apareciendo incluso
# con las tres direcciones ya sin solaparse (kernel_comp_addr_r confirmado
# en hardware como un bloque separado y limpio). Causa real, en
# cmd/bootefi.c:204-226 (do_bootefi_image): si el PRIMER argumento de
# `bootefi` NO lleva ":tamano", el comando asume que la direccion ya viene
# de un `load`/`tftp` previo (que actualiza un registro interno de "ultima
# imagen cargada" via efi_set_image_parameters()) y compara contra ESE
# registro -- si no matchea (o nunca se seteo, como en nuestro caso porque
# usamos `imxtract`, que NO actualiza ese registro), falla con este mensaje
# sin importar que los bytes en esa direccion sean un kernel EFI valido.
# Fix: pasarle ":tamano" tambien al kernel (no solo al ramdisk, que ya lo
# llevaba) -- eso fuerza la rama que trata la direccion como explicita
# (efi_clear_bootdev()) sin depender de ningun registro previo.
#
# Si bootefi no funciona por algun motivo, cae al `bootm` de siempre como
# red de seguridad (mismo fallback que ya existia).
# Carga el FIT desde boot_a (antes era el bootcmd entero). Lo usan las
# opciones del menu, cada una con sus propios bootargs.
pmos_boot=if part start scsi 3 boot_a boot_a_start && part size scsi 3 boot_a boot_a_size; then setexpr blksz 0x6000000 / $boot_a_size; setexpr fit_blk_off 0x18c000 / $blksz; setexpr fit_lba $boot_a_start + $fit_blk_off; setexpr fit_blk_cnt $boot_a_size - $fit_blk_off; echo pmOS: boot_a start=$boot_a_start size=$boot_a_size blksz=$blksz fit_lba=$fit_lba fit_cnt=$fit_blk_cnt; scsi dev 3; if scsi read $ramdisk_addr_r $fit_lba $fit_blk_cnt; then echo pmOS: FIT read OK, addr=$ramdisk_addr_r; setenv verify no; setenv initrd_stage_addr $kernel_comp_addr_r; if imxtract $ramdisk_addr_r kernel $kernel_addr_r; then setenv kernel_stage_size $filesize; echo pmOS: kernel extracted addr=$kernel_addr_r size=$kernel_stage_size; if imxtract $ramdisk_addr_r fdt $fdt_addr_r; then echo pmOS: fdt extracted addr=$fdt_addr_r size=$filesize; run pmos_fdt_fixup; if imxtract $ramdisk_addr_r ramdisk $initrd_stage_addr; then setenv initrd_stage_size $filesize; echo pmOS: ramdisk extracted addr=$initrd_stage_addr size=$initrd_stage_size; echo pmOS: trying bootefi; bootefi $kernel_addr_r:$kernel_stage_size $initrd_stage_addr:$initrd_stage_size $fdt_addr_r; echo pmOS: bootefi returned, should not happen; else echo pmOS: ramdisk imxtract FAILED; fi; else echo pmOS: fdt imxtract FAILED; fi; else echo pmOS: kernel imxtract FAILED; fi; else echo pmOS: scsi read of FIT failed; fi; else echo pmOS: could not resolve boot_a partition; fi; echo pmOS: bootefi path failed, trying old bootm path via prevbl_initrd_start_addr=$prevbl_initrd_start_addr; bootm $prevbl_initrd_start_addr; echo pmOS: bootm failed; bootefi bootmgr; pause; run menucmd
# 2026-09-25 (DisplayPort): gancho que pmos_boot corre despues de extraer el
# FDT y antes de bootefi. Por defecto no toca nada. La opcion 2 del menu lo
# apunta a pmos_nodp_fixup, que deshabilita mdss_dp0: el DP es componente de
# msm, y si la cadena Type-C (PS5169/FSA4480/QMP/pmic-glink) no hace probe el
# panel interno tampoco arranca -- esta es la salida de emergencia.
pmos_fdt_fixup=echo pmOS: FDT sin cambios
pmos_nodp_fixup=fdt addr $fdt_addr_r; fdt resize; fdt set /soc@0/display-subsystem@ae00000/displayport-controller@ae90000 status disabled; echo pmOS: DisplayPort deshabilitado en el FDT
# 2026-09-25: menu con cuenta regresiva de 3 s. Sin tocar nada arranca
# bootmenu_0 (pmOS normal, SIN debug shell); cualquier boton detiene la
# cuenta (vol arriba/abajo navegan, encendido elige). bootmenu_1 arranca
# con pmos.debug-shell. Vol abajo al encender sigue abriendo el menu.
bootcmd=bootmenu 3
# When entering the menu (either from button press or failed boot) # When entering the menu (either from button press or failed boot)
# remap bootcmd so it will re-open the menu and we won't get stuck # remap bootcmd so it will re-open the menu and we won't get stuck
@@ -37,19 +265,25 @@ bootcmd=setenv bootargs $pmos_bootargs; echo pmOS: booting FIT at prevbl_initrd_
menucmd=setenv bootcmd run menucmd; bootmenu -1 menucmd=setenv bootcmd run menucmd; bootmenu -1
# Pause is used so the output can be read on the display # Pause is used so the output can be read on the display
bootmenu_0=Boot pmOS mainline (FIT)=setenv bootargs $pmos_bootargs; bootm $prevbl_initrd_start_addr; pause bootmenu_0=Arrancar pmOS=setenv bootargs $pmos_bootargs; run pmos_boot
bootmenu_1=Boot=bootefi bootmgr; pause bootmenu_1=Arrancar pmOS con debug shell=setenv bootargs $pmos_bootargs pmos.debug-shell; run pmos_boot
bootmenu_2=Enable serial console gadget=run serial_gadget bootmenu_2=Arrancar pmOS sin DisplayPort=setenv pmos_fdt_fixup run pmos_nodp_fixup; setenv bootargs $pmos_bootargs; run pmos_boot
bootmenu_3=Enable USB mass storage=echo "Press any key to exit UMS mode"; ums 0 scsi 0 bootmenu_3=Boot pmOS mainline (FIT)=setenv bootargs $pmos_bootargs; bootm $prevbl_initrd_start_addr; pause
bootmenu_4=Enable fastboot mode=echo "Press any key to exit fastboot mode"; run fastboot bootmenu_4=Boot=bootefi bootmgr; pause
bootmenu_5=Enable serial console gadget=run serial_gadget
bootmenu_6=Enable USB mass storage=echo "Press any key to exit UMS mode"; ums 0 scsi 0
bootmenu_7=Enable fastboot mode=echo "Press any key to exit fastboot mode"; run fastboot
# Disabling bootretry means we'll just drop the shell # Disabling bootretry means we'll just drop the shell
bootmenu_5=Drop to shell=setenv bootretry -1 bootmenu_8=Drop to shell=setenv bootretry -1
bootmenu_6=Reset device=reset bootmenu_9=Reset device=reset
bootmenu_7=Dump clocks=clk dump; pause bootmenu_10=Dump clocks=clk dump; pause
bootmenu_8=Dump environment=printenv; pause bootmenu_11=Dump environment=printenv; pause
bootmenu_9=Board info=bdinfo; pause bootmenu_12=Board info=bdinfo; pause
bootmenu_10=Dump bootargs=fdt addr $fdt_addr_r; fdt print /chosen bootargs; pause bootmenu_13=Dump bootargs=fdt addr $fdt_addr_r; fdt print /chosen bootargs; pause
bootmenu_11=Power off=poweroff bootmenu_14=Power off=poweroff
bootmenu_15=Diag SCSI boot_a=scsi scan; scsi info; pause; if part number scsi 0 boot_a i; then echo scsi0:part=$i; else echo scsi0:no-boot_a; fi; if part number scsi 1 boot_a i; then echo scsi1:part=$i; else echo scsi1:no-boot_a; fi; if part number scsi 2 boot_a i; then echo scsi2:part=$i; else echo scsi2:no-boot_a; fi; if part number scsi 3 boot_a i; then echo scsi3:part=$i; else echo scsi3:no-boot_a; fi; pause; if part number scsi 4 boot_a i; then echo scsi4:part=$i; else echo scsi4:no-boot_a; fi; if part number scsi 5 boot_a i; then echo scsi5:part=$i; else echo scsi5:no-boot_a; fi; if part number scsi 6 boot_a i; then echo scsi6:part=$i; else echo scsi6:no-boot_a; fi; if part number scsi 7 boot_a i; then echo scsi7:part=$i; else echo scsi7:no-boot_a; fi; pause
bootmenu_16=Diag USB gadget=dm uclass usb_gadget; pause; dm uclass usb; pause; dm uclass phy; pause
bootmenu_17=Diag UFS=dm uclass ufs; pause; dm uclass phy; pause; ufs init 0; echo ufs_init_ret=$?; pause
# Allow holding the volume down button while U-Boot loads to enter # Allow holding the volume down button while U-Boot loads to enter
# the boot menu # the boot menu
+2 -11
View File
@@ -657,21 +657,15 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
return 0; return 0;
} }
void rtwo_debug_blink_zone(unsigned int zone);
int clk_enable(struct clk *clk) int clk_enable(struct clk *clk)
{ {
const struct clk_ops *ops; const struct clk_ops *ops;
struct clk *clkp = NULL; struct clk *clkp = NULL;
int ret; int ret;
rtwo_debug_blink_zone(23); /* CLKEN-1: entrada a clk_enable */
debug("%s(clk=%p name=%s)\n", __func__, clk, clk ? clk->dev->name : "NULL"); debug("%s(clk=%p name=%s)\n", __func__, clk, clk ? clk->dev->name : "NULL");
if (!clk_valid(clk)) { if (!clk_valid(clk))
rtwo_debug_blink_zone(24); /* CLKEN-2a: clk invalido/NULL, return temprano */
return 0; return 0;
}
rtwo_debug_blink_zone(25); /* CLKEN-2b: clk valido, seguimos */
ops = clk_dev_ops(clk->dev); ops = clk_dev_ops(clk->dev);
if (CONFIG_IS_ENABLED(CLK_CCF)) { if (CONFIG_IS_ENABLED(CLK_CCF)) {
@@ -705,10 +699,7 @@ int clk_enable(struct clk *clk)
} else { } else {
if (!ops->enable) if (!ops->enable)
return -ENOSYS; return -ENOSYS;
rtwo_debug_blink_zone(26); /* CLKEN-3: justo antes de ops->enable(clk) */ return ops->enable(clk);
ret = ops->enable(clk);
rtwo_debug_blink_zone(27); /* CLKEN-4: ops->enable(clk) retorno */
return ret;
} }
return 0; return 0;
+2 -18
View File
@@ -28,8 +28,6 @@
#include "clock-qcom.h" #include "clock-qcom.h"
void rtwo_debug_blink_zone(unsigned int zone);
/* CBCR register fields */ /* CBCR register fields */
#define CBCR_BRANCH_ENABLE_BIT BIT(0) #define CBCR_BRANCH_ENABLE_BIT BIT(0)
#define CBCR_BRANCH_OFF_BIT BIT(31) #define CBCR_BRANCH_OFF_BIT BIT(31)
@@ -78,21 +76,17 @@ void clk_enable_vote_clk(phys_addr_t base, const struct vote_clk *vclk)
int qcom_gate_clk_en(const struct msm_clk_priv *priv, unsigned long id) int qcom_gate_clk_en(const struct msm_clk_priv *priv, unsigned long id)
{ {
rtwo_debug_blink_zone(28); /* GATE-1: entrada a qcom_gate_clk_en */
if (id >= priv->data->num_clks || priv->data->clks[id].reg == 0) { if (id >= priv->data->num_clks || priv->data->clks[id].reg == 0) {
log_err("gcc@%#08llx: unknown clock ID %lu!\n", log_err("gcc@%#08llx: unknown clock ID %lu!\n",
priv->base, id); priv->base, id);
return -ENOENT; return -ENOENT;
} }
rtwo_debug_blink_zone(29); /* GATE-2: id valido, antes de setbits_le32 */
setbits_le32(priv->base + priv->data->clks[id].reg, priv->data->clks[id].en_val); setbits_le32(priv->base + priv->data->clks[id].reg, priv->data->clks[id].en_val);
rtwo_debug_blink_zone(30); /* GATE-3: post setbits_le32 (el registro ya se escribio) */
if (priv->data->clks[id].cbcr_reg) { if (priv->data->clks[id].cbcr_reg) {
unsigned int count; unsigned int count;
u32 val; u32 val;
rtwo_debug_blink_zone(31); /* GATE-4: hay cbcr_reg, entrando al poll acotado */
for (count = 0; count < 200; count++) { for (count = 0; count < 200; count++) {
val = readl(priv->base + priv->data->clks[id].cbcr_reg); val = readl(priv->base + priv->data->clks[id].cbcr_reg);
val &= BRANCH_CHECK_MASK; val &= BRANCH_CHECK_MASK;
@@ -100,14 +94,10 @@ int qcom_gate_clk_en(const struct msm_clk_priv *priv, unsigned long id)
break; break;
udelay(1); udelay(1);
} }
rtwo_debug_blink_zone(33); /* GATE-5: poll terminado (por bit ok o por timeout) */
if (WARN(count == 200, "WARNING: Clock @ %#lx [%#010x] stuck at off\n", if (WARN(count == 200, "WARNING: Clock @ %#lx [%#010x] stuck at off\n",
priv->data->clks[id].cbcr_reg, val)) priv->data->clks[id].cbcr_reg, val))
return -EBUSY; return -EBUSY;
} else {
rtwo_debug_blink_zone(32); /* GATE-4b: no hay cbcr_reg, no se espera nada */
} }
rtwo_debug_blink_zone(34); /* GATE-6: fin de qcom_gate_clk_en, return 0 */
return 0; return 0;
} }
@@ -266,14 +256,8 @@ static int msm_clk_enable(struct clk *clk)
{ {
struct msm_clk_data *data = (struct msm_clk_data *)dev_get_driver_data(clk->dev); struct msm_clk_data *data = (struct msm_clk_data *)dev_get_driver_data(clk->dev);
rtwo_debug_blink_zone(35); /* MSMCLK-1: entrada a msm_clk_enable */ if (data->enable)
if (data->enable) { return data->enable(clk);
int ret;
rtwo_debug_blink_zone(36); /* MSMCLK-2: antes de data->enable(clk) */
ret = data->enable(clk);
rtwo_debug_blink_zone(37); /* MSMCLK-3: data->enable(clk) retorno */
return ret;
}
return 0; return 0;
} }
-5
View File
@@ -198,14 +198,10 @@ static const struct gate_clk sm8550_clks[] = {
GATE_CLK(GCC_USB3_PRIM_PHY_PIPE_CLK, 0x39068, BIT(0)), GATE_CLK(GCC_USB3_PRIM_PHY_PIPE_CLK, 0x39068, BIT(0)),
}; };
void rtwo_debug_blink_zone(unsigned int zone);
static int sm8550_enable(struct clk *clk) static int sm8550_enable(struct clk *clk)
{ {
struct msm_clk_priv *priv = dev_get_priv(clk->dev); struct msm_clk_priv *priv = dev_get_priv(clk->dev);
rtwo_debug_blink_zone(38); /* SM8550EN-1: entrada a sm8550_enable, id=%clk->id (sin printf aqui) */
switch (clk->id) { switch (clk->id) {
case GCC_AGGRE_USB3_PRIM_AXI_CLK: case GCC_AGGRE_USB3_PRIM_AXI_CLK:
qcom_gate_clk_en(priv, GCC_USB30_PRIM_MASTER_CLK); qcom_gate_clk_en(priv, GCC_USB30_PRIM_MASTER_CLK);
@@ -224,7 +220,6 @@ static int sm8550_enable(struct clk *clk)
break; break;
} }
rtwo_debug_blink_zone(39); /* SM8550EN-2: post switch, antes de qcom_gate_clk_en final */
return qcom_gate_clk_en(priv, clk->id); return qcom_gate_clk_en(priv, clk->id);
} }
-21
View File
@@ -19,8 +19,6 @@
#include <soc/qcom/qup-fw-load.h> #include <soc/qcom/qup-fw-load.h>
#include <soc/qcom/geni-se.h> #include <soc/qcom/geni-se.h>
void rtwo_debug_blink_zone(unsigned int zone);
#define UART_OVERSAMPLING 32 #define UART_OVERSAMPLING 32
#define STALE_TIMEOUT 160 #define STALE_TIMEOUT 160
@@ -211,15 +209,12 @@ static int msm_serial_setbrg(struct udevice *dev, int baud)
pr_err("%s: Couldn't get clock division rate\n", __func__); pr_err("%s: Couldn't get clock division rate\n", __func__);
return -EINVAL; return -EINVAL;
} }
rtwo_debug_blink_zone(10); /* SETBRG-1: pre clk_set_rate */
ret = clk_set_rate(priv->se, clk_rate); ret = clk_set_rate(priv->se, clk_rate);
rtwo_debug_blink_zone(11); /* SETBRG-2: post clk_set_rate */
if (ret < 0) { if (ret < 0) {
pr_err("%s: Couldn't set clock rate: %d\n", __func__, ret); pr_err("%s: Couldn't set clock rate: %d\n", __func__, ret);
return 0; return 0;
} }
geni_serial_baud(priv->base, clk_div, baud); geni_serial_baud(priv->base, clk_div, baud);
rtwo_debug_blink_zone(12); /* SETBRG-3: post geni_serial_baud */
return 0; return 0;
} }
@@ -522,8 +517,6 @@ static int msm_serial_probe(struct udevice *dev)
u32 proto; u32 proto;
struct clk *clk; struct clk *clk;
rtwo_debug_blink_zone(13); /* PROBE-1: entrada */
clk = devm_clk_get_optional(dev, NULL); clk = devm_clk_get_optional(dev, NULL);
if (IS_ERR(clk)) { if (IS_ERR(clk)) {
/* /*
@@ -539,13 +532,9 @@ static int msm_serial_probe(struct udevice *dev)
priv->se = clk; priv->se = clk;
} }
rtwo_debug_blink_zone(14); /* PROBE-2: post devm_clk_get_optional */
/* Try enable clock */ /* Try enable clock */
clk_enable(clk); clk_enable(clk);
rtwo_debug_blink_zone(15); /* PROBE-3: post clk_enable */
/* Check if firmware loading is needed (BT UART) */ /* Check if firmware loading is needed (BT UART) */
proto = readl(priv->base + GENI_FW_REVISION_RO); proto = readl(priv->base + GENI_FW_REVISION_RO);
proto &= FW_REV_PROTOCOL_MSK; proto &= FW_REV_PROTOCOL_MSK;
@@ -558,8 +547,6 @@ static int msm_serial_probe(struct udevice *dev)
proto >>= FW_REV_PROTOCOL_SHFT; proto >>= FW_REV_PROTOCOL_SHFT;
} }
rtwo_debug_blink_zone(16); /* PROBE-4: post firmware check/load */
if (proto != GENI_SE_UART) { if (proto != GENI_SE_UART) {
dev_err(dev, "Invalid proto %d\n", proto); dev_err(dev, "Invalid proto %d\n", proto);
clk_disable(clk); clk_disable(clk);
@@ -570,26 +557,18 @@ static int msm_serial_probe(struct udevice *dev)
if (ofnode_device_is_compatible(dev_ofnode(dev), "qcom,geni-uart")) if (ofnode_device_is_compatible(dev_ofnode(dev), "qcom,geni-uart"))
return -ENOENT; return -ENOENT;
rtwo_debug_blink_zone(17); /* PROBE-5: es geni-debug-uart, seguimos */
ret = geni_set_oversampling(dev); ret = geni_set_oversampling(dev);
if (ret < 0) if (ret < 0)
return ret; return ret;
rtwo_debug_blink_zone(18); /* PROBE-6: post geni_set_oversampling */
/* No need to reinitialize the UART after relocation */ /* No need to reinitialize the UART after relocation */
if (gd->flags & GD_FLG_RELOC) if (gd->flags & GD_FLG_RELOC)
return 0; return 0;
geni_serial_init(dev); geni_serial_init(dev);
rtwo_debug_blink_zone(19); /* PROBE-7: post geni_serial_init */
msm_geni_serial_setup_rx(dev); msm_geni_serial_setup_rx(dev);
rtwo_debug_blink_zone(20); /* PROBE-8: post msm_geni_serial_setup_rx */
qcom_geni_serial_start_rx(dev); qcom_geni_serial_start_rx(dev);
rtwo_debug_blink_zone(21); /* PROBE-9: post qcom_geni_serial_start_rx */
qcom_geni_serial_start_tx(priv->base); qcom_geni_serial_start_tx(priv->base);
rtwo_debug_blink_zone(22); /* PROBE-10: post qcom_geni_serial_start_tx, fin de probe */
return 0; return 0;
} }
+4 -4
View File
@@ -13,15 +13,15 @@
_Static_assert(EVT_COUNT < 256, "Can only support 256 event types with 8 bits"); _Static_assert(EVT_COUNT < 256, "Can only support 256 event types with 8 bits");
#ifdef CONFIG_ARCH_SNAPDRAGON #ifdef CONFIG_ARCH_SNAPDRAGON
void rtwo_debug_blink(void); void rtwo_boot_progress_step(void);
#define RTWO_DEBUG_BLINK() rtwo_debug_blink() #define RTWO_BOOT_PROGRESS() rtwo_boot_progress_step()
#else #else
#define RTWO_DEBUG_BLINK() #define RTWO_BOOT_PROGRESS()
#endif #endif
#define INITCALL(_call) \ #define INITCALL(_call) \
do { \ do { \
RTWO_DEBUG_BLINK(); \ RTWO_BOOT_PROGRESS(); \
if (_call()) { \ if (_call()) { \
printf("%s(): initcall %s() failed\n", __func__, \ printf("%s(): initcall %s() failed\n", __func__, \
#_call); \ #_call); \