Hello everyone,
We are currently developing a product using your G2L SoC.
When measuring the I2C2 (LCD) clock, we are measuring 227.3 kHz (with an oscilloscope) instead of the expected 100kHz.
Here is the relevant device tree block: i2c2: i2c@10058800 { #address-cells = <1>; #size-cells = <0>; compatible = "renesas,riic-r9a07g044l", "renesas,riic-rz"; reg = <0 0x10058800 0 0x44>; interrupts = <GIC_SPI 366 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 364 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 365 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 368 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 369 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 367 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cpg CPG_MOD R9A07G044L_CLK_I2C2>; clock-frequency = <100000>; resets = <&cpg R9A07G044L_CLK_I2C2>; status = "disabled"; };
In U-boot, we can see:
=> i2c dev 2Setting bus to 2=> i2c speedCurrent bus speed=100000We've traced this issue back to drivers/i2c/rzg2l_riic.c, specifically to this:
For the 100000 case, changing CKS from 3 to 4, BRH from 23 to 27 and BRL from 23 to 28, we are able to measure the expected 100kHz.
Why are we measuring these 227,3 kHz with the default values of your BSP?
Thank you and kind regards,
Andrei
Hi Andrei,Thank you for sharing your inputs.That's correct.It is already noted by our Product Team and will be fixed in a future release.Kind Regards.
Thanks for the feedback.
When could we expect this future release? We would also very much appreciate a description of the issue and fix.
Furthermore, is there any workaround that we could consider? Would changing CKS, BRL and BRH solve this issue *without* influencing the other internal buses? We have found appropriate values for CKS, BRL and BRH that yield the expected 100 kHz, 400 kHz and 1 MHz frequencies, but are unsure if changing these would have unwanted side effects.