pl011_console_match(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pl011_console_match(9) πŸ’–

okay so bestie, welcome to the pl011_console_match page from the Kernel API Manual β€” yes that's the manual name, we're fancy here β€” and honestly? this one is a lil niche but it's lowkey iconic once you get it. it's the non-standard console matching function. non-standard!! she's literally not like other matchers πŸ’…


✨ SYNOPSIS ✨

int pl011_console_match (struct console *co , char *name , int idx ,
       char *options );

that's the whole signature, no cap. four args, one int coming back at you 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • co β€” the registering console, aka the console object doing the registering. main character of this call tbh πŸ‘‘
  • name β€” the name, straight off the console command line 🏷️
  • idx β€” the index, also from the console command line. yes it's a number, yes it matters πŸ”’
  • options β€” pointer to the option string from the console command line. a ptr, so like, be normal about it πŸ™ˆ

🌸 DESCRIPTION 🌸

so here's the vibe: this function only attempts to match console command lines of this exact form:

console=pl011,mmio|mmio32,<addr>[,<options>]
console=pl011,0x<addr>[,<options>]

like, that's it. that's the shape. mmio or mmio32, then <addr>, then an optional [,<options>] β€” or the 0x<addr> flex, also with optional options. it's giving very specific ✨

and what is this form even for? bestie I'm so glad you asked β€” it's used to register an initial earlycon boot console and then replace it with the amba_console at pl011 driver init. glow-up arc fr fr πŸ¦‹

then it performs console setup for a match (as required by interface, we don't make the rules). and here's the lil detail that matters: if no <options> are specified, then assume the h/w is already setup. no options = hardware's already good to go, don't touch it πŸ’€

returns 0 if the console matches; otherwise non-zero to use default matching. so like, non-zero is the "nope, you handle it" signal 🫑

🧚 SEE ALSO 🧚

  • Kernel file ./drivers/tty/serial/amba-pl011.c β€” go read the source, it's right there, iykyk πŸ“–

and that's the page!! slay 🌈 this was the pl011_console_match(9) page, coming at you from ./drivers/tty/serial, dated October 2026 β€” mwah, go touch some registers bestie πŸ’œπŸŽ€

πŸ“¦ where this page comes from