Fix RPI5 uart clock when loading kernel with non-boot DT
cover Fix RPI5 uart clock when loading kernel with non-boot DT
From: Bruno Leite <[email protected]>
When loading the kernel with a DT that was not used to boot the rpi (e.g. when using a FIT image), the uart-clk property that should have been patched by the firmware will be passed as is to the driver and thus cause the divisor to be set incorrectly, hence the uart will not work properly. Fix that by copying the correct uart-clk set by the firmware to the new DT loaded to be passed to the kernel.
Bruno Leite (1):
rpi: copy over uart clock-frequency in DT
board/raspberrypi/rpi/rpi.c | 3 +++ 1 file changed, 3 insertions(+)
Signature · 1 line
2.45.2
PATCH 1/1 rpi: copy over uart clock-frequency in DT
From: Bruno Leite <[email protected]>
rpi5 firmware sets uart_clk clock-frequency in
the firmware and patches it to the DT, copy it
over when loading a new DT.
---
board/raspberrypi/rpi/rpi.c | 3 +++ 1 file changed, 3 insertions(+)
board/raspberrypi/rpi/rpi.c +3 -0
@@ -602,6 +602,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt)/* Bluetooth device address as provided by the firmware */ copy_property (fdt, fw_fdt,"/soc/serial@7e201000/bluetooth" ,"local-bd-address" ); + +/* copy uart clk as provided by the firmware */ +copy_property (fdt, fw_fdt,"/clocks/clk-uart" ,"clock-frequency" ); }int ft_board_setup (void *blob,struct bd_info *bd)
Signature · 1 line
2.45.2
Re: [PATCH 1/1] rpi: copy over uart clock-frequency in DT
Quoted 8 lines · Bruno Leite
From: Bruno Leite <[email protected]>
rpi5 firmware sets
uart_clkclock-frequency in
the firmware and patches it to the DT, copy it
over when loading a new DT.Signed-off-by Bruno Leite <[email protected]>
Quoted 25 lines
---
board/raspberrypi/rpi/rpi.c | 3 +++ 1 file changed, 3 insertions(+)board/raspberrypi/rpi/rpi.c +3
-0@@ -602,6 +602,9 @@ void update_fdt_from_fw(void *fdt, void *fw_fdt)/* Bluetooth device address as provided by the firmware */ copy_property (fdt, fw_fdt,"/soc/serial@7e201000/bluetooth" ,"local-bd-address" ); + +/* copy uart clk as provided by the firmware */ +copy_property (fdt, fw_fdt,"/clocks/clk-uart" ,"clock-frequency" ); }int
ft_board_setup(void *blob, struct bd_info *bd)
--
2.45.2