This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: What is the mapping order of i2c instance in Linux?

Part Number: TDA4VM

Dear experts,

As we all know, we can use i2cdetect/i2cset in Linux on TDA4VM. The question is what is the mapping order of the i2c bus to the hardware instance?

i2c0 -> wakup_i2c0?

i2c1 -> mcu_i2c0?

Could you please point out the code which configures this order? Is it in dts? I can find it in AM65x dts, but not found in j721e.

Thanks & Best Regards!

ZM

  • Hi Zhong Ming,

    I believe you are referring to this: arch/arm64/boot/dts/ti/k3-am65.dtsi

    aliases {
    serial0 = &wkup_uart0;
    serial1 = &mcu_uart0;
    serial2 = &main_uart0;
    serial3 = &main_uart1;
    serial4 = &main_uart2;
    i2c0 = &wkup_i2c0;
    i2c1 = &mcu_i2c0;
    i2c2 = &main_i2c0;
    i2c3 = &main_i2c1;
    i2c4 = &main_i2c2;
    i2c5 = &main_i2c3;
    ethernet0 = &cpsw_port1;
    rproc0 = &mcu_r5fss0_core0;
    rproc1 = &mcu_r5fss0_core1;
    };

    On the j721e there is no aliasing in dt. From the boot log:

    [ 0.892810] omap_i2c 40b00000.i2c: bus 0 rev0.12 at 100 kHz
    [ 0.898762] omap_i2c 40b10000.i2c: bus 1 rev0.12 at 100 kHz
    [ 0.904727] omap_i2c 42120000.i2c: bus 2 rev0.12 at 100 kHz
    [ 0.910748] pca953x 3-0020: 3-0020 supply vcc not found, using dummy regulator
    [ 0.940374] GPIO line 509 (VINOUT_MUX_SEL1) hogged as output/high
    [ 0.946794] GPIO line 508 (VINOUT_MUX_SEL0) hogged as output/low
    [ 0.953182] pca953x 3-0022: 3-0022 supply vcc not found, using dummy regulator
    [ 0.961199] GPIO line 481 (MCASP/TRACE_MUX_S0) hogged as output/low
    [ 0.967794] GPIO line 482 (MCASP/TRACE_MUX_S1) hogged as output/high
    [ 0.974623] omap_i2c 2000000.i2c: bus 3 rev0.12 at 400 kHz
    [ 0.980709] omap_i2c 2010000.i2c: bus 4 rev0.12 at 100 kHz
    [ 0.986586] omap_i2c 2020000.i2c: bus 5 rev0.12 at 100 kHz
    [ 0.992770] pca953x 6-0020: 6-0020 supply vcc not found, using dummy regulator
    [ 1.024165] omap_i2c 2030000.i2c: bus 6 rev0.12 at 400 kHz
    [ 1.030040] omap_i2c 2040000.i2c: bus 7 rev0.12 at 100 kHz
    [ 1.035908] omap_i2c 2050000.i2c: bus 8 rev0.12 at 100 kHz
    [ 1.041821] pca953x 9-0020: 9-0020 supply vcc not found, using dummy regulator
    [ 1.072090] omap_i2c 2060000.i2c: bus 9 rev0.12 at 400 kHz

    We can map back checking the device tree node addresses:

    Ex: main_i2c0--> omap_i2c 2000000-->i2c: bus 3

     mcu_i2c0: i2c@40b00000 --> omap_i2c 40b00000.i2c: bus 0


    And so on. Hope this answers your question.

    Best Regards,
    Keerthy