uart_parse_earlycon(9)
π uart_parse_earlycon(9) β the Kernel API Manual, bestie edition π
okay so this is a page from the Kernel API Manual and it's literally about one tiny little function called uart_parse_earlycon that does the world's most important admin job: it reads the earlycon options off the kernel command line and tells you what they mean. she's giving parser energy, she's giving decoder ring, she ate π
β¨
β¨ NAME β¨
uart_parse_earlycon β parse earlycon options π§
like, that's it, that's the whole job, and she does it flawlessly no cap.
π¦ SYNOPSIS π¦
int uart_parse_earlycon (char *p , enum uart_iotype *iotype ,
resource_size_t *addr , char **options );
literally copy that exactly, do not @ me, the spacing is canon π
πΈ ARGUMENTS πΈ
pβ ptr to 2nd field (ie., just beyond<name>,). so you already walked past the name and the comma, bestie, this is where you hand her the rest of the string π«Άiotypeβ ptr for decoded iotype (out). she writes the answer here, you just gotta give her somewhere to put it β¨addrβ ptr for decoded mapbase/iobase (out). same deal, output pointer, she fills it in πoptionsβ ptr for<options>field;NULLif not present (out). note the NULL β if there's no options field she'll tell you so, don't panic π
ngl the (out) on all of these is the vibe check you need to pass β these are outputs, she's writing to them, you're just holding the bowl π
π₯ DESCRIPTION π₯
okay so the whole thing: she decodes the earlycon kernel command line parameters, and they look like this π
earlycon=<name>,io|mmio|mmio16|mmio32|mmio32be|mmio32native,<addr>,<options>console=<name>,io|mmio|mmio16|mmio32|mmio32be|mmio32native,<addr>,<options>
so it's <name>, then one of those six iotype words β io, mmio, mmio16, mmio32, mmio32be, mmio32native β then <addr>, then <options>. iconic. no notes. π₯
and there's also the optional form, which is highkey the chill version π¦
earlycon=<name>,0x<addr>,<options>console=<name>,0x<addr>,<options>
this one is also accepted β like, she's not gonna throw it out β and when you use it, the returned iotype will be UPIO_MEM. that's the little secret twist at the end of the movie πβ¨
π RETURN π
0on success π-EINVALon failure π
that's it. binary mood. she either slayed or she didn't.
π SEE ALSO π
bestie the guest list is LONG, grab a snack π this is all from the Kernel file ./drivers/tty/serial/serial_core.c:
uart_write_wakeup(9)uart_update_timeout(9)uart_get_baud_rate(9)uart_get_divisor(9)uart_get_lsr_info(9)uart_console_write(9)uart_parse_options(9)uart_set_options(9)uart_change_pm(9)uart_register_driver(9)uart_unregister_driver(9)serial_core_add_one_port(9)serial_core_remove_one_port(9)uart_match_port(9)uart_handle_dcd_change(9)uart_handle_cts_change(9)uart_insert_char(9)uart_try_toggle_sysrq(9)uart_get_rs485_mode(9)
twenty entries. twenty. she's popular, she's connected, she has friends π π
respect the source path ./drivers/tty/serial β that's where she lives π‘ and this page is dated October 2026 (yes, the future, she's ahead of her time β). that's the whole page, mwah, bye bestie π«Άππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms