RT5639 on TX2

Hi,

I would like to port RT5639/40 driver for TX2.
The I2C uses I2C_GP0_DAT/CLK

In device tree, I set :

i2c@31600000 {
status = “okay”;
b340tx2_rt5640: rt5640.1-001c@1c {
compatible = “realtek, rt5640”;
reg = <0x1c>;
status = “okay”;
};
};

and

i2c@c2400000 {
status = “okay”;
b340tx2_rt5640: rt5640.1-001c@1c {
compatible = “realtek, rt5640”;
reg = <0x1c>;
status = “okay”;
};
};

In these two different settings, the same error I got are :

[ 12.174860] tegra-i2c 3160000.i2c: no acknowledge from address 0x1c
[ 12.175571] rt5640 0-001c: Device with ID register 0xf687bc20 is not rt5640/39

Could you please advise what the wrong is ?

Regards,

Tonie

hi,

Is there any suggestion ?

Regards,

Tonie

@Tonie
The correct i2c bus is i2c@c2400000, the message show the device no ack that could be the device didn’t power up or something with it. You may need help from the vendor to check the device side first.

Hi, ShaneCCC,

Thanks for your reply.
I would like to point out that the design/layout of RT5639 is correct because…
As you know, TX1 and TX2 are pin compatible.

Same PCBA uses TX1 is working well.
But once I exchange TX1 to TX2 and use new OS of TX2, I got the error as shown above.

Regards,

Tonie

@Tonie
Have you check the power control on TX2 for RT5639.

Hi, ShaneCCC,

Could you please explain it in detail ?

Regards,

Tonie

Tonie
I am not sure if your design need GPIO/Regulator to enable the power for RT5639. Probe to those power to make sure them were enabled.

Hi, ShaneCCC,

In terms of enabling rt5639 on TX1, there is one settings :

gpio@6000d000 {
gpio_default: default {
gpio-to-sfio = <8 9 10 11 216 219>;
};
};

I cannot find similar settings on TX2, do you think if this relates to my problem ?

One more question, is the power you mentioned the power apply for rt5639 ?
If your answer is yes, the power apply for rt5639 is already on.

Regards,

Tonie

@Tonie
I think you need to make the i2c working first. The gpio-to-sfio is about the i2s setting.
You could try the i2c-tools to access the device and probe the i2c signal to check.

Hi, ShaneCCC,

First at all, I think all I2C had probed.

[ 1.364100] tegra-i2c 3160000.i2c:
[ 1.364100] Tonie’s Msg : i2c probed !
[ 1.373857] tegra-i2c c240000.i2c:
[ 1.373857] Tonie’s Msg : i2c probed !
[ 1.383084] tegra-i2c 3180000.i2c:
[ 1.383084] Tonie’s Msg : i2c probed !
[ 1.391938] tegra-i2c 3190000.i2c:
[ 1.391938] Tonie’s Msg : i2c probed !
[ 1.400783] tegra-i2c 31b0000.i2c:
[ 1.400783] Tonie’s Msg : i2c probed !
[ 1.409685] tegra-i2c 31c0000.i2c:
[ 1.409685] Tonie’s Msg : i2c probed !
[ 1.418625] tegra-i2c c250000.i2c:
[ 1.418625] Tonie’s Msg : i2c probed !
[ 1.427523] tegra-i2c 31e0000.i2c:
[ 1.427523] Tonie’s Msg : i2c probed !

And I will try to see if i2c-tools is working.

One more question, please.
In DTS,

i2c@c2400000 {
status = “okay”;
b340tx2_rt5640: rt5640.1-001c@1c {
compatible = “realtek, rt5640”;
reg = <0x1c>;
status = “okay”;
};
};

Is reg the slave address of rt5639 ?
Where can I define rt5639’s slave address ?

Regards,

Tonie

Hi,

Here are the log relates to i2c :
[ 1.363876] tegra-i2c 3160000.i2c:
[ 1.363876] Tonie’s Msg : i2c probed !
[ 1.373620] tegra-i2c c240000.i2c:
[ 1.373620] Tonie’s Msg : i2c probed !
[ 1.382854] tegra-i2c 3180000.i2c:
[ 1.382854] Tonie’s Msg : i2c probed !
[ 1.391718] tegra-i2c 3190000.i2c:
[ 1.391718] Tonie’s Msg : i2c probed !
[ 1.400561] tegra-i2c 31b0000.i2c:
[ 1.400561] Tonie’s Msg : i2c probed !
[ 1.409469] tegra-i2c 31c0000.i2c:
[ 1.409469] Tonie’s Msg : i2c probed !
[ 1.418397] tegra-i2c c250000.i2c:
[ 1.418397] Tonie’s Msg : i2c probed !
[ 1.427301] tegra-i2c 31e0000.i2c:
[ 1.427301] Tonie’s Msg : i2c probed !

here are the result of using i2ctools :

root@tegra-ubuntu:/home/nvidia# i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b [ 381.089237] tegra-i2c c240000.i2c: no acknowledge from address 0x3
c d e f
00: – [ 381.099327] tegra-i2c c240000.i2c: no acknowledge from address 0x4
– [ 381.107974] tegra-i2c c240000.i2c: no acknowledge from address 0x5
– [ 381.114833] tegra-i2c c240000.i2c: no acknowledge from address 0x6
– [ 381.121685] tegra-i2c c240000.i2c: no acknowledge from address 0x7
– [ 381.128488] tegra-i2c c240000.i2c: no acknowledge from address 0x8
– [ 381.135361] tegra-i2c c240000.i2c: no acknowledge from address 0x9
– [ 381.142195] tegra-i2c c240000.i2c: no acknowledge from address 0xa
– [ 381.149024] tegra-i2c c240000.i2c: no acknowledge from address 0xb
– [ 381.155881] tegra-i2c c240000.i2c: no acknowledge from address 0xc
– [ 381.162716] tegra-i2c c240000.i2c: no acknowledge from address 0xd
– [ 381.169542] tegra-i2c c240000.i2c: no acknowledge from address 0xe
– [ 381.176349] tegra-i2c c240000.i2c: no acknowledge from address 0xf

10: [ 381.183197] tegra-i2c c240000.i2c: no acknowledge from address 0x10
– [ 381.190663] tegra-i2c c240000.i2c: no acknowledge from address 0x11
– [ 381.197557] tegra-i2c c240000.i2c: no acknowledge from address 0x12
– [ 381.204482] tegra-i2c c240000.i2c: no acknowledge from address 0x13
– [ 381.211388] tegra-i2c c240000.i2c: no acknowledge from address 0x14
– [ 381.218297] tegra-i2c c240000.i2c: no acknowledge from address 0x15
– [ 381.225170] tegra-i2c c240000.i2c: no acknowledge from address 0x16
– [ 381.232124] tegra-i2c c240000.i2c: no acknowledge from address 0x17
– [ 381.239042] tegra-i2c c240000.i2c: no acknowledge from address 0x18
– [ 381.245952] tegra-i2c c240000.i2c: no acknowledge from address 0x19
– [ 381.252902] tegra-i2c c240000.i2c: no acknowledge from address 0x1a
– [ 381.259828] tegra-i2c c240000.i2c: no acknowledge from address 0x1b
– [ 381.266719] tegra-i2c c240000.i2c: no acknowledge from address 0x1c
– [ 381.273710] tegra-i2c c240000.i2c: no acknowledge from address 0x1d
– [ 381.280637] tegra-i2c c240000.i2c: no acknowledge from address 0x1e
– [ 381.287597] tegra-i2c c240000.i2c: no acknowledge from address 0x1f

20: [ 381.294529] tegra-i2c c240000.i2c: no acknowledge from address 0x20
– [ 381.301907] tegra-i2c c240000.i2c: no acknowledge from address 0x21
– [ 381.308849] tegra-i2c c240000.i2c: no acknowledge from address 0x22
– [ 381.315739] tegra-i2c c240000.i2c: no acknowledge from address 0x23
– [ 381.322694] tegra-i2c c240000.i2c: no acknowledge from address 0x24
– [ 381.329602] tegra-i2c c240000.i2c: no acknowledge from address 0x25
– [ 381.336519] tegra-i2c c240000.i2c: no acknowledge from address 0x26
– [ 381.343418] tegra-i2c c240000.i2c: no acknowledge from address 0x27
– [ 381.350315] tegra-i2c c240000.i2c: no acknowledge from address 0x28
– [ 381.357237] tegra-i2c c240000.i2c: no acknowledge from address 0x29
– [ 381.364146] tegra-i2c c240000.i2c: no acknowledge from address 0x2a
– [ 381.371072] tegra-i2c c240000.i2c: no acknowledge from address 0x2b
– [ 381.377965] tegra-i2c c240000.i2c: no acknowledge from address 0x2c
– [ 381.384909] tegra-i2c c240000.i2c: no acknowledge from address 0x2d
– [ 381.391803] tegra-i2c c240000.i2c: no acknowledge from address 0x2e
– [ 381.398705] tegra-i2c c240000.i2c: no acknowledge from address 0x2f

30: [ 381.405644] tegra-i2c c240000.i2c: no acknowledge from address 0x30
– [ 381.413047] tegra-i2c c240000.i2c: no acknowledge from address 0x31
– [ 381.419943] tegra-i2c c240000.i2c: no acknowledge from address 0x32
– [ 381.426834] tegra-i2c c240000.i2c: no acknowledge from address 0x33
– [ 381.433747] tegra-i2c c240000.i2c: no acknowledge from address 0x34
– [ 381.440664] tegra-i2c c240000.i2c: no acknowledge from address 0x35
– [ 381.447558] tegra-i2c c240000.i2c: no acknowledge from address 0x36
– [ 381.454471] tegra-i2c c240000.i2c: no acknowledge from address 0x37
– [ 381.461388] tegra-i2c c240000.i2c: no acknowledge from address 0x38
– [ 381.468268] tegra-i2c c240000.i2c: no acknowledge from address 0x39
– [ 381.475174] tegra-i2c c240000.i2c: no acknowledge from address 0x3a
– [ 381.482078] tegra-i2c c240000.i2c: no acknowledge from address 0x3b
– [ 381.489046] tegra-i2c c240000.i2c: no acknowledge from address 0x3c
– [ 381.495971] tegra-i2c c240000.i2c: no acknowledge from address 0x3d
– [ 381.502878] tegra-i2c c240000.i2c: no acknowledge from address 0x3e
– [ 381.509821] tegra-i2c c240000.i2c: no acknowledge from address 0x3f

40: [ 381.516754] tegra-i2c c240000.i2c: no acknowledge from address 0x40
– [ 381.524182] tegra-i2c c240000.i2c: no acknowledge from address 0x41
– [ 381.531095] tegra-i2c c240000.i2c: no acknowledge from address 0x42
– [ 381.538021] tegra-i2c c240000.i2c: no acknowledge from address 0x43
– [ 381.544919] tegra-i2c c240000.i2c: no acknowledge from address 0x44
– [ 381.551810] tegra-i2c c240000.i2c: no acknowledge from address 0x45
– [ 381.558716] tegra-i2c c240000.i2c: no acknowledge from address 0x46
– [ 381.565628] tegra-i2c c240000.i2c: no acknowledge from address 0x47
– [ 381.572531] tegra-i2c c240000.i2c: no acknowledge from address 0x48
– [ 381.579431] tegra-i2c c240000.i2c: no acknowledge from address 0x49
– [ 381.586366] tegra-i2c c240000.i2c: no acknowledge from address 0x4a
– [ 381.593262] tegra-i2c c240000.i2c: no acknowledge from address 0x4b
– [ 381.600170] tegra-i2c c240000.i2c: no acknowledge from address 0x4c
– [ 381.607095] tegra-i2c c240000.i2c: no acknowledge from address 0x4d
– [ 381.614004] tegra-i2c c240000.i2c: no acknowledge from address 0x4e
– [ 381.620921] tegra-i2c c240000.i2c: no acknowledge from address 0x4f

50: [ 381.627823] tegra-i2c c240000.i2c: no acknowledge from address 0x50
– [ 381.635257] tegra-i2c c240000.i2c: no acknowledge from address 0x51
– [ 381.642157] tegra-i2c c240000.i2c: no acknowledge from address 0x52
– [ 381.649051] tegra-i2c c240000.i2c: no acknowledge from address 0x53
– [ 381.655994] tegra-i2c c240000.i2c: no acknowledge from address 0x54
– [ 381.662943] tegra-i2c c240000.i2c: no acknowledge from address 0x55
– [ 381.669897] tegra-i2c c240000.i2c: no acknowledge from address 0x56
– [ 381.676767] tegra-i2c c240000.i2c: no acknowledge from address 0x57
– [ 381.683744] tegra-i2c c240000.i2c: no acknowledge from address 0x58
– [ 381.690704] tegra-i2c c240000.i2c: no acknowledge from address 0x59
– [ 381.697637] tegra-i2c c240000.i2c: no acknowledge from address 0x5a
– [ 381.704533] tegra-i2c c240000.i2c: no acknowledge from address 0x5b
– [ 381.711439] tegra-i2c c240000.i2c: no acknowledge from address 0x5c
– [ 381.718344] tegra-i2c c240000.i2c: no acknowledge from address 0x5d
– [ 381.725243] tegra-i2c c240000.i2c: no acknowledge from address 0x5e
– [ 381.732154] tegra-i2c c240000.i2c: no acknowledge from address 0x5f

60: [ 381.739070] tegra-i2c c240000.i2c: no acknowledge from address 0x60
– [ 381.746479] tegra-i2c c240000.i2c: no acknowledge from address 0x61
– [ 381.753403] tegra-i2c c240000.i2c: no acknowledge from address 0x62
– [ 381.760315] tegra-i2c c240000.i2c: no acknowledge from address 0x63
– [ 381.767243] tegra-i2c c240000.i2c: no acknowledge from address 0x64
– [ 381.774190] tegra-i2c c240000.i2c: no acknowledge from address 0x65
– [ 381.781077] tegra-i2c c240000.i2c: no acknowledge from address 0x66
– [ 381.788018] tegra-i2c c240000.i2c: no acknowledge from address 0x67
– [ 381.794925] tegra-i2c c240000.i2c: no acknowledge from address 0x68
– [ 381.801847] tegra-i2c c240000.i2c: no acknowledge from address 0x69
– [ 381.808783] tegra-i2c c240000.i2c: no acknowledge from address 0x6a
– [ 381.815738] tegra-i2c c240000.i2c: no acknowledge from address 0x6b
– [ 381.822672] tegra-i2c c240000.i2c: no acknowledge from address 0x6c
– [ 381.829523] tegra-i2c c240000.i2c: no acknowledge from address 0x6d
– [ 381.836423] tegra-i2c c240000.i2c: no acknowledge from address 0x6e
– [ 381.843330] tegra-i2c c240000.i2c: no acknowledge from address 0x6f

70: [ 381.850297] tegra-i2c c240000.i2c: no acknowledge from address 0x70
– [ 381.857713] tegra-i2c c240000.i2c: no acknowledge from address 0x71
– [ 381.864623] tegra-i2c c240000.i2c: no acknowledge from address 0x72
– [ 381.871610] tegra-i2c c240000.i2c: no acknowledge from address 0x73
– [ 381.878520] tegra-i2c c240000.i2c: no acknowledge from address 0x74
– [ 381.885432] tegra-i2c c240000.i2c: no acknowledge from address 0x75
– [ 381.892333] tegra-i2c c240000.i2c: no acknowledge from address 0x76
– [ 381.899259] tegra-i2c c240000.i2c: no acknowledge from address 0x77

It looks like i2c doesn’t work.
Please help to advise what I can do more ?

Regards,

Tonie

@Tonie
It’s predictable due to there is no any device devices connect to this bus. However I can tell there’s no problem for this bus, we have an internal camera board is connected to this bus and working well.
What you need to do is use i2cget to access your device and probe the signal to debug why no ack from your device.

Hi, ShaneCCC,

I would like to confirm what I2C you are using ?
I2C_GP0_XX or I2C_PM_XX for connector J22 ?

The slave address of rt5639 is 0x38.
Here are the testing result I did :

root@tegra-ubuntu:/home/nvidia# i2cget -y 2 0x38 0
[ 3237.178092] tegra-i2c 3180000.i2c: no acknowledge from address 0x38
Error: Read failed
root@tegra-ubuntu:/home/nvidia# i2cget -y 2 0x1c 0
[ 3654.378984] tegra-i2c 3180000.i2c: no acknowledge from address 0x1c
Error: Read failed

I am sure the rt5639 is on the path of I2C_GP0

Tonie

@Tonie
Yes, the camera sensor ov23850 is connect to the j22 i2c@c2400000.
Did you probe the i2c signal while access the device by i2cget?

Hi,

I also probed the I2C signal… nothing shown…

Regards,

Tonie

Add more testing result

root@tegra-ubuntu:/home/nvidia# i2cget -y 1 0x38 0x0
[ 4857.683685] tegra-i2c c240000.i2c: no acknowledge from address 0x38
Error: Read failed

Same error.
P.S.: the OS I used is default OS from R27.1.0.

Regards,

Tonie

Hi, ShaneCCC,

I just re-test :

  1. Remove TX2 module.

  2. Put on TX1 module.

  3. Test Audio on RT5639. It works fine.

  4. I use I2Ctools and all are working on TX1.

  5. Put TX2 module back to the same board.

  6. All I2C are failed. (No ack)

Please provide your suggest if there is anything I can do more.

Regards,

Tonie

@Tonie
That’s interesting, What I can promise is this bus is no problem. And I see the CLK/DATA of this i2c bus is working to send command while I scan this bus from the waveform. BTW I am use the JetPack 3.1 but I believe there’s should be no different for this.

@Tonie
So you are using customize carrier board instead of Jetson CVM? I guess it’s could be the pin miss match.
Could you try to scan all bus and check the waveform to make sure this pin is connect to which bus.

Hi, ShaneCCC,

I would like to know if I can use the EVB of jetson-tx1 to test TX2 ?
As you know, just exchange TX1 module to TX2.

Please advise.

Tonie