nuttx/arch/mips
Daniel P. Carvalho e26d467fab
Some checks are pending
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
arch/mips/pic32mz: do not exceed the requested SPI frequency.
spi_setfrequency() in pic32mz_spi.c rounded the baud rate divisor down,
so the SCK frequency could be higher than the one requested by the
device driver (e.g. 20 MHz requested with a 100 MHz PBCLK2 gave 25 MHz).
A request above PBCLK/2 gave a zero divisor and a division by zero when
computing the actual frequency; the SST26 driver's default of 64 MHz
does that with any peripheral bus clock below 128 MHz.

Round the divisor up instead, so the actual frequency never exceeds the
requested one and the divisor is never zero.  Boards whose requested
frequency is not an exact divisor of PBCLK/2 now run SPI at a lower
clock than before.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com>
2026-10-05 12:30:56 -03:00
..
include arch/mips/jz4780: Add HDMI EDID parsing and dynamic display modes 2026-08-29 11:08:25 -03:00
src arch/mips/pic32mz: do not exceed the requested SPI frequency. 2026-10-05 12:30:56 -03:00
Kconfig !sched/arch/libc: Give fork() and vfork() their real, separate semantics. 2026-08-10 08:57:30 -03:00