Forums

Rockchip RK3399. Is it possible to run SPI at 16 MHz?

Started by Wojciech Zabolotny September 27, 2020
Hi,
I need to control a board (WiFi HaLow based on NRC7292 chipset) from an RK3399-based system (currently Rockpi N10)
After tests it appeared that this board requires the SPI clock frequency to be 16 MHz. Other frequencies result in communication errors.
Details of my tests are available here: https://github.com/newracom/nrc7292_sw_pkg/issues/5 
Unfortunately, it seems that RK3399 is able to generate the SPI clock frequencies only equal to 37.5MHz/N
So I can't produce 16MHz. I have tried to adjust the appropriate clock frequencies in the device tree: 

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 89d2cc0..13a974e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -1365,8 +1365,8 @@ cru: clock-controller@ff760000 {
                assigned-clock-rates =
                         <594000000>,  <800000000>,
                        <1000000000>,
-                        <150000000>,   <75000000>,
-                         <37500000>,
+                        <150000000>,   <96000000>,
+                         <48000000>,
                         <100000000>,  <100000000>,
                          <50000000>, <600000000>,
                         <100000000>,   <50000000>,

(please see https://github.com/wzab/nrc7292-buildroot/commit/3ff4356607ceaf6109d1ba2eeecbad0931bbcb81 )
However,  it seems that the above modification does not change the real clock frequency.
Has anybody here experience in adjusting clock frequencies in RK3399?

Thank you very much in advance,
Best regards,
Wojtek
The problem I have described was caused by the hardware issue - two voltage level translator with auto direction sensing were connected in series. One was in the SBC and the another in the HaLow module.
Please see https://github.com/newracom/nrc7292_sw_pkg/issues/5#issuecomment-702410880 and next messages.
However, the question how to allow 16 MHz SPI clock in RK3399 remains valid...

Best regards,
Wojtek