Skip to contentSkip to conversation

Ingenic X1000-class I2C is a Synopsys DW_apb_i2c; i2c-designware runs it on the X1600

DISCUSSION Hunter Laux 1 participant 1 message Nov 25 MIPS

lore
Share & tools
lore
#0 lore raw

Hi,

For information, in case anyone wants to consolidate the two drivers one day: based on my testing on a HiBy R1 (X1600E), the I2C controller on Ingenic's X1000-class SoCs is a Synopsys DesignWare DW_apb_i2c.

I noticed it while looking at Olivier's spike filter patch [1]: 0xa0 is DesignWare's IC_FS_SPKLEN. Both of the R1's controllers identify themselves:

  0xf4 IC_COMP_PARAM_1  0x003f3fee
  0xf8 IC_COMP_VERSION  0x3132302a  ("120*", 1.20a)
  0xfc IC_COMP_TYPE     0x44570140  ("DW")

The registers i2c-jz4780 uses for the X1000 and later are at the DesignWare offsets (SCL counts 0x14-0x20, enable 0x6c, SDA hold 0x7c, SDA setup 0x94, enable status 0x9c, spike length 0xa0).

Test: Letux 7.4-rc3 on the R1, with both controllers' compatible changed to "snps,designware-i2c" and nothing else:

- I2C0 at 400 kHz: AXP2101 PMIC and CW2015 fuel gauge. axp20x and cw2015 probe as with i2c-jz4780 (regulators, battery and USB power supply as before); 200/200 reads of each chip.
- I2C1 at 100 kHz: CST816 touch controller; probes, 200/200 reads.
- IC_CON reads back as with i2c-jz4780. The SCL counts follow i2c-designware's own timing rules (FS high/low 123/223 at a 140 MHz APB clock, against 102/239 from i2c-jz4780).

Neither driver programs IC_FS_SPKLEN today, so Olivier's patch [1] still applies whichever driver is used.

[1] https://lore.kernel.org/linux-mips/[email protected]/

Thanks,
Hunter