Forums

Rockchip RK3399。是否可以在16 MHz运行SPI?

开始了 WOJCIECH ZABOLOTNY. 9月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: //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: [email protected] {
                assigned-clock-rates =
                         <594000000>,  <800000000>,
                        <1000000000>,
-                        <150000000>,   <75000000>,
-                         <37500000>,
+                        <150000000>,   <96000000>,
+                         <48000000>,
                         <100000000>,  <100000000>,
                          <50000000>, <600000000>,
                         <100000000>,   <50000000>,

(please see //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 //github.com/newracom/nrc7292_sw_pkg/issues/5#issuecomment-702410880 和 next messages.
However, the question how to allow 16 MHz SPI clock in RK3399 remains valid...

Best regards,
Wojtek