The rtwo (Motorola Edge 40 Pro, SM8550/kalama) vendor DTB -- used by U-Boot as its own control FDT (see board.c board_fdt_blob_setup(), which sources it from the ABL-supplied vendor DTB rather than a compiled-in one) -- describes the GCC with the downstream binding "qcom,kalama-gcc-v2" instead of mainline's "qcom,sm8550-gcc". Same hardware/register map (confirmed the vendor DT's raw clock IDs, e.g. 0x6b/0x7f/0x80, match GCC_QUPV3_WRAP1_S7_CLK/M_AHB_CLK/S_AHB_CLK from dt-bindings/clock/qcom,sm8550-gcc.h 1:1), so reusing sm8550_gcc_data for the new compatible is correct. Without this alias the GCC driver never binds to that node, so any clk_get() depending on it (e.g. the debug UART's "se" clock) returns an error that is not -ENOENT/-ENODATA. serial: msm_geni: don't clk_enable() an unfiltered error pointer devm_clk_get_optional() only converts -ENOENT/-ENODATA to NULL; any other error (such as the unbound-GCC case above) is returned as-is. msm_serial_probe() passed that error pointer straight to clk_enable(), which dereferences it in clk_valid() -> hard hang with no console, no panic message, nothing (CONFIG_PANIC_HANG masks it further). Clamp any IS_ERR(clk) to NULL so it degrades to "no clock" like the two error codes that were already handled. Debug: add 7-segment digit instrumentation for UART-less bring-up Isolating the hang above required visual output on a device with no serial console, no fastboot response while hung, and no crash log. INITCALL() and a handful of clk/serial entry points now draw a large two-digit 7-segment style zone number straight onto the ABL's framebuffer at 0xb8000000 so the exact call site can be read directly off the screen instead of inferred from blink/bar-count/binary-stripe patterns, which gave contradictory readings across multiple attempts. Zone 23 (entry to clk_enable()) is what pinpointed the hang above. Harmless to leave in; candidate for removal once the rtwo port is past active UART-less bring-up. Confirmed on hardware: `fastboot boot` of this build reaches a live U-Boot console (banner + prompt) on the rtwo. See project notes rtwo-uboot-clk-compat-fix / rtwo-bring-up-estado for the full debugging trail. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ADQrjdgE8awSA7TSaGgfr
50 lines
1.0 KiB
C
50 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Copyright (c) 2011 The Chromium OS Authors.
|
|
*/
|
|
|
|
#ifndef __INITCALL_H
|
|
#define __INITCALL_H
|
|
|
|
#include <asm/types.h>
|
|
#include <event.h>
|
|
#include <hang.h>
|
|
|
|
_Static_assert(EVT_COUNT < 256, "Can only support 256 event types with 8 bits");
|
|
|
|
#ifdef CONFIG_ARCH_SNAPDRAGON
|
|
void rtwo_debug_blink(void);
|
|
#define RTWO_DEBUG_BLINK() rtwo_debug_blink()
|
|
#else
|
|
#define RTWO_DEBUG_BLINK()
|
|
#endif
|
|
|
|
#define INITCALL(_call) \
|
|
do { \
|
|
RTWO_DEBUG_BLINK(); \
|
|
if (_call()) { \
|
|
printf("%s(): initcall %s() failed\n", __func__, \
|
|
#_call); \
|
|
hang(); \
|
|
} \
|
|
} while (0)
|
|
|
|
#define INITCALL_EVT(_evt) \
|
|
do { \
|
|
if (event_notify_null(_evt)) { \
|
|
printf("%s(): event %d/%s failed\n", __func__, _evt, \
|
|
event_type_name(_evt)) ; \
|
|
hang(); \
|
|
} \
|
|
} while (0)
|
|
|
|
#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG)
|
|
#define WATCHDOG_INIT() INITCALL(init_func_watchdog_init)
|
|
#define WATCHDOG_RESET() INITCALL(init_func_watchdog_reset)
|
|
#else
|
|
#define WATCHDOG_INIT()
|
|
#define WATCHDOG_RESET()
|
|
#endif
|
|
|
|
#endif
|