No I²C nor SPI bus visible in Android 11.0.0_1.2.1 imx8mp release

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

No I²C nor SPI bus visible in Android 11.0.0_1.2.1 imx8mp release

1,733 Views
jeremygeslin
NXP Employee
NXP Employee

Hi,

Using Android 11.0.0_1.2.1 release on i.Mx8M Plus EVK I noticed neither I²C bus not SPI bus are visible from the device-tree list on the platform:

evk_8mp:/ $ ls -als proc/device-tree/
ls -als proc/device-tree/
total 0
? -????????? ? ? ? ? ? #address-cells
? -????????? ? ? ? ? ? #size-cells
0 drwxr-xr-x 72 root root 0 1970-01-01 00:00 .
0 drwxr-xr-x 3 root root 0 1970-01-01 00:00 ..
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 aliases
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 bt_sco_codec
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 busfreq
0 drwxr-xr-x 3 root root 0 2021-05-18 13:10 cbtl04gp
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 chosen
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 clock-ext1
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 clock-ext2
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 clock-ext3
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 clock-ext4
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 clock-osc-24m
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 clock-osc-32k
? -????????? ? ? ? ? ? compatible
0 drwxr-xr-x 8 root root 0 2021-05-18 13:10 cpus
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 ddr_pmu@3d800000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 display-subsystem
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 dma-apbh@33000000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 dsp@3b6e8000
0 drwxr-xr-x 4 root root 0 2021-05-18 13:10 etf@28c04000
0 drwxr-xr-x 3 root root 0 2021-05-18 13:10 etm@28440000
0 drwxr-xr-x 3 root root 0 2021-05-18 13:10 etm@28540000
0 drwxr-xr-x 3 root root 0 2021-05-18 13:10 etm@28640000
0 drwxr-xr-x 3 root root 0 2021-05-18 13:10 etm@28740000
0 drwxr-xr-x 3 root root 0 2021-05-18 13:10 etr@28c06000
0 drwxr-xr-x 4 root root 0 1970-01-01 00:00 firmware
0 drwxr-xr-x 4 root root 0 2021-05-18 13:10 funnel
0 drwxr-xr-x 4 root root 0 2021-05-18 13:10 funnel@28c03000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 gpmi-nand@33002000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 gpu2d@38008000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 gpu3d@38000000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 hsio-mix@32f10000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 i2c-rpbus-3
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 imx_ion
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 interrupt-controller@0
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 interrupt-controller@38800000
? -????????? ? ? ? ? ? interrupt-parent
0 drwxr-xr-x 3 root root 0 2021-05-18 13:10 leds
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 lvds_backlight
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 memory-controller@3d400000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 memory@40000000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 mix_gpu_ml
? -????????? ? ? ? ? ? model
? -????????? ? ? ? ? ? name
0 drwxr-xr-x 5 root root 0 2021-05-18 13:10 opp-table
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 pcie-phy@32f00000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 pcie@33800000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 pcie_ep@33800000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 pmem@0x94400000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 pmu
0 drwxr-xr-x 21 root root 0 2021-05-18 13:10 power-domains
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 psci
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 regulator-audio-pwr
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 regulator-can1-stby
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 regulator-can2-stby
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 regulator-usb1-vbus
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 regulator-usdhc2
0 drwxr-xr-x 9 root root 0 2021-05-18 13:10 reserved-memory
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 rpmsg
? -????????? ? ? ? ? ? serial-number
0 drwxr-xr-x 8 root root 0 2021-05-18 13:10 soc@0
0 drwxr-xr-x 4 root root 0 2021-05-18 13:10 sound-bt-sco
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 sound-hdmi
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 sound-micfil
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 sound-wm8960
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 sound-xcvr
0 drwxr-xr-x 4 root root 0 2021-05-18 13:10 thermal-zones
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 timer
0 drwxr-xr-x 5 root root 0 2021-05-18 13:10 trusty
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 usb-phy@381f0040
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 usb-phy@382f0040
0 drwxr-xr-x 3 root root 0 2021-05-18 13:10 usb@32f10100
0 drwxr-xr-x 3 root root 0 2021-05-18 13:10 usb@32f10108
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 vipsi@38500000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 vpu_g1@38300000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 vpu_g2@38310000
0 drwxr-xr-x 2 root root 0 2021-05-18 13:10 vpu_vc8000e@38320000

It seems to prevent me injecting a driver for my device (NFC controller) connected over either I²C or SPI.

Can you tell me why those bus are not seen there ?

Regards,

Jeremy.

0 Kudos
8 Replies

1,514 Views
jeremygeslin
NXP Employee
NXP Employee

Hi @jimmychan,

 

I finaly succeed to load my module manually (using insmod). Unfortunately I'm now facing an issue with the PCA6416 IO expander.

Indeed, I use the expanded pin (P1_3, P1_4 and P1_7) in my device tree definition:

    nxpnfc: nxpnfc@28 {
        compatible = "nxp,nxpnfc";
        reg = <0x28>;
        nxp,nxpnfc-irq = <&pca6416 11 0>;
        nxp,nxpnfc-ven = <&pca6416 12 0>;
        nxp,nxpnfc-fw-dwnld = <&pca6416 14 0>;
    };

But when the module is loaded I get the following error 517 indicating EPROBE_DEFER.

Do you have any example of PCA6416 IO expander usage from device tree definition ?

 

Regards,

Jeremy.

 

0 Kudos

1,507 Views
jimmychan
NXP TechSupport
NXP TechSupport

Please try this patch

 

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 1dfe513f8fcf..52b5799040b3 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -892,7 +892,7 @@ static int __init gpio_mxc_init(void)

return platform_driver_register(&mxc_gpio_driver);
}
-subsys_initcall(gpio_mxc_init);
+device_initcall(gpio_mxc_init);

0 Kudos

1,715 Views
jeremygeslin
NXP Employee
NXP Employee

It didn't help, I'm still getting the same behavior after applying this new setting.

0 Kudos

1,711 Views
jimmychan
NXP TechSupport
NXP TechSupport

I tried this on my side. I can reproduce the issue. And the new setting can solve the problem.

 

My steps are:

1. I download the demo image from the web and use the UUU on my Windows PC

->  uuu_imx_android_flash -f imx8mp -a -e

 

2. Boot up the board and I can get the same issue as you. I press the reset button and then enter to the u-boot to change the setting.

 

U-Boot > setenv append_bootargs androidboot.selinux=permissive

U-Boot > saveenv

U-Boot > boot

 

3. The board boot up again and the issue solved.

 

 

0 Kudos

1,705 Views
jeremygeslin
NXP Employee
NXP Employee

I replicated the exact same procedure than suggested and it didn't help.

I still can't see any I²C nor SPI bus under the device tree:

evk_8mp:/ $ ls proc/device-tree

#address-cells     funnel                         regulator-audio-pwr
#size-cells        funnel@28c03000                regulator-can1-stby
aliases            gpmi-nand@33002000             regulator-can2-stby
bt_sco_codec       gpu2d@38008000                 regulator-usb1-vbus
busfreq            gpu3d@38000000                 regulator-usdhc2
cbtl04gp           hsio-mix@32f10000              reserved-memory
chosen             i2c-rpbus-3                    rpmsg
clock-ext1         imx_ion                        serial-number
clock-ext2         interrupt-controller@0         soc@0
clock-ext3         interrupt-controller@38800000  sound-bt-sco
clock-ext4         interrupt-parent               sound-hdmi
clock-osc-24m      leds                           sound-micfil
clock-osc-32k      lvds_backlight                 sound-wm8960
compatible         memory-controller@3d400000     sound-xcvr
cpus               memory@40000000                thermal-zones
ddr_pmu@3d800000   mix_gpu_ml                     timer
display-subsystem  model                          trusty
dma-apbh@33000000  name                           usb-phy@381f0040
dsp@3b6e8000       opp-table                      usb-phy@382f0040
etf@28c04000       pcie-phy@32f00000              usb@32f10100
etm@28440000       pcie@33800000                  usb@32f10108
etm@28540000       pcie_ep@33800000               vipsi@38500000
etm@28640000       pmem@0x94400000                vpu_g1@38300000
etm@28740000       pmu                            vpu_g2@38310000
etr@28c06000       power-domains                  vpu_vc8000e@38320000
firmware           psci
0 Kudos

1,700 Views
jimmychan
NXP TechSupport
NXP TechSupport

How about this path:

sys/bus/i2c/devices

 

0 Kudos

1,695 Views
jeremygeslin
NXP Employee
NXP Employee

Indeed I can see the I²C bus instances listed under sys/bus/i2c/devices.

However, rebuilding the kernel and device tree, I can't succeed to include my own kernel driver attached to I2C_3 bus and defined as such within device-tree.

The module is not loaded during kernel boot as expected and I cannot verify that the device-tree is included my definition then.

To include my driver I'm using the exact same procedure than previously on i.MX8M mini running android 10. Is there any change expected with respect to i.MX8M Plus or android 11 ?

0 Kudos

1,721 Views
jimmychan
NXP TechSupport
NXP TechSupport

Hello @jeremygeslin ,

 

Please try to disable selinux for userdebug/eng build mode images for debug purpose. Put androidboot.selinux=permissive to the U-Boot's bootargs.

 

Boot environment variables are as follow:

U-Boot > setenv append_bootargs androidboot.selinux=permissive

U-Boot > saveenv

0 Kudos