// Set integer & fractional part of baud rate to 2400 Baud fixed. Divider = 3.000.000 / 2400
// Fractional part = 0. In contrary to the documentation, there is no additional divider by 16
// (RASPI 3). May be different at RASPI 1/2 ??
iowrite32(3000000 / 2400, UART_INT_BAUD);
iowrite32(0, UART_FRAC_BAUD);
This baud rate calculation is just working by accident for Raspi Pi 3+ as you wrongly assume that
"there is no additional divider by 16" (which is still there in fact).
For Pi 3 and upwards the default UART frequency is now 48MHz instead of 3MHz,
so while your result is right, your math is wrong (if you don't change the default value in config.txt).
Your calculation of 3000000 / 2400 returns the same result as 48000000 / (16 * 2400) (which is 1250).
See the following commit:
Raspberry Pi Firmware Commit
This baud rate calculation is just working by accident for Raspi Pi 3+ as you wrongly assume that
"there is no additional divider by 16" (which is still there in fact).
For Pi 3 and upwards the default UART frequency is now 48MHz instead of 3MHz,
so while your result is right, your math is wrong (if you don't change the default value in config.txt).
Your calculation of
3000000 / 2400returns the same result as48000000 / (16 * 2400)(which is1250).See the following commit:
Raspberry Pi Firmware Commit