Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2C device name mismatch #20

Open
QuickJack opened this issue Jan 21, 2016 · 5 comments
Open

I2C device name mismatch #20

QuickJack opened this issue Jan 21, 2016 · 5 comments

Comments

@QuickJack
Copy link

I am testing branch am33x-rt-v4.1 (4.1.3-bone-rt-r15). After booting the kernel on a BeagleBone Black I did "ls -l /dev/i2c*" to list the available i2c devices. The result was:

/dev/i2c-0 /dev/i2c-2

Doing the same thing with kernel 3.8.13 the result is:

/dev/i2c-0 /dev/i2c-1

This will cause trouble for all capes that using /dev/i2c-1.

What is currently the best kernel to use to have PREEMPT_RT as well as Cape Manager?

@RobertCNelson
Copy link
Owner

This is a bug in 3.8.13, 4.1.x is showing the proper behavior..

For 4.1.x:

linux-image-4.1.15-ti-rt-r42
or
linux-image-4.1.15-bone-rt-r18

Got 4.4.x + RT booting yesterday, not 100% ready..
Regards,

@QuickJack
Copy link
Author

Can you explain it in a bit more detail as to why it is a bug to number devices 0,1,2... compared to 0,2,4...? This effect will force all i2c based applications to have a configuration option to change the i2c master device if they want to support both kernel architectures.

Why exactly do you prefer the ti kernel over the bb-kernel? I always thought the bb-kernel would be the better choice.

@RobertCNelson
Copy link
Owner

You need to load an overlay that needs i2c-1 to see what's really going on.. (and thus there is no bug.. ;) )

dmesg | grep omap_i2c
[    2.969573] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[    2.969631] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe
[    3.867737] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    3.871669] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz

ls /dev/i2c-*
/dev/i2c-0  /dev/i2c-2

Then load an i2c-1 overlay (doesn't matter if you don't have this cape installed on the board)

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-I2C1-PCA9685-00A0.dts

sudo sh -c "echo 'BB-I2C1-PCA9685' > /sys/devices/platform/bone_capemgr/slots"

Then recheck:

dmesg | grep omap_i2c
[    2.969573] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[    2.969631] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe
[    3.867737] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    3.871669] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[  414.833998] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz

ls /dev/i2c-*
/dev/i2c-0  /dev/i2c-1  /dev/i2c-2

ti vs bone..

For the am335x (4.1.x branch)

bone = uio_pruss, sgx with 5.01.01.02
ti = remote_proc, edma re-write, sgx with ti's new stack (not working yet)

(everything else i keep in sync with bone vs ti that i can..)

Regards,

@QuickJack
Copy link
Author

I am currently trying to rewrite to gpmc driver for the Logibone cape to support Kernel 4.1.x+. This driver is using the EDMA as well. The EDMA rewrite sounds interesting. I will test this kernel soon.

I did this QuickJack/logi-kernel@be0e98a to compensate for the I2C device name change. Every cape that uses I2C has to implement similar changes to support newer kernels.

@QuickJack
Copy link
Author

/dev/i2c-2 is working fine. I have created issue #21 to discuss the GPMC related problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants