Re: [PATCH v3 0/9] MIPS: Unify low-level debugging functionalities

From: Maciej W. Rozycki
Date: Sun May 26 2024 - 08:44:36 EST


On Wed, 22 May 2024, Jiaxun Yang wrote:

> That being said, have you noticed that prom_putchar and early_printk is
> a non-extant on generic mach, ingenic, ralink etc? That's because we
> really don't want to introduce any platform specific UART code for
> early debugging on new platforms. With DEBUG_LL introduced by Arm it's
> only a Kconfig option to do the trick.

IMHO that is however the logical thing to do. And then you need no magic
options to fiddle with and say a distribution kernel will dump whatever it
has to say if something wrong has happened early on.

IOW just wire `prom_putchar' as required, using C code preferably. NB
YAMON does have a `print' entry point for console output, so for the Malta
platform you can trivially use just that, no need for messy ad hoc 8250
code.

As to intercepting exceptions, it depends. Again YAMON does handle that
and dumps the register state, so with the Malta you get the information
required. For less capable ones it might make sense, but it ISTM like a
candidate for an independent change, and then again I fail to see why the
handler has to be written in the assembly language rather than C.

Maciej