__ssp_update_baud_rate(9)
β¨ NAME β¨
__ssp_update_baud_rate β bestie, this is the one that sets the UART "baud rate" π
So like, quick context: this little icon lives in the Kernel API Manual (manual name: __ssp_update_baud_rate(9), section 9 obviously π), and she's here to help you dial in exactly how fast your SiFive UART talks. Let's get into it π«Ά
πΈ SYNOPSIS πΈ
void __ssp_update_baud_rate (struct sifive_serial_port *ssp , unsigned
int rate );
That's it. Two args. No drama. She takes a pointer and a number and slays β¨
π¦ ARGUMENTS π¦
sspβ pointer to astruct sifive_serial_portπ like, this is your UART's whole personality, okay? You're handing her the actual port struct so she knows what she's working with.rateβ new target bit rate π the speed you want your UART to hit, ngl.
π DESCRIPTION π
Okay so here's the vibe: __ssp_update_baud_rate calculates the UART divisor value for the target bit rate rate β specifically for the SiFive UART described by ssp β and then programs it into the UART π₯ like, does the math, writes the value, done. Iconic behavior, fr fr.
Now, real talk π β there may be some error between the target bit rate and the actual bit rate the UART ends up implementing. Why? clock ratio granularity, bestie. It's giving "we did our best with the numbers we had" π. So don't come for her if the actual speed is a tiny bit off from what you asked for β that's just how the clock ratios divide, periodt. π
No cap: the divisor is computed from granularity-limited clock ratios, so a small mismatch between rate and reality is expected and baked into the deal β¨
π SEE ALSO π
Like, go read these next, they're all part of the same friend group π«Ά:
- Kernel file
./drivers/tty/serial/sifive.c struct sifive_serial_port(9)__ssp_early_writel(9)__ssp_early_readl(9)__ssp_writel(9)__ssp_readl(9)sifive_serial_is_txfifo_full(9)__ssp_transmit_char(9)__ssp_transmit_chars(9)__ssp_enable_txwm(9)__ssp_enable_rxwm(9)__ssp_disable_txwm(9)__ssp_disable_rxwm(9)__ssp_receive_char(9)__ssp_receive_chars(9)__ssp_update_div(9)__ssp_set_stop_bits(9)__ssp_wait_for_xmitr(9)sifive_serial_clk_notifier(9)
And that's the whole page, bestie π one last thing β this lil doc comes from ./drivers/tty/serial and it's dated October 2026 π
π¦ so you know it's fresh. Go forth and configure your UARTs, you gorgeous nerd πβ¨π
π¦ 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