imx8mp encx24j600 interrupts throug pin expansor

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

imx8mp encx24j600 interrupts throug pin expansor

276 Views
Savo
Contributor II

 

https://community.nxp.com/t5/i-MX-Processors/How-to-enable-interrupts-of-EXP-GPIOs-from-PCA6416-in-IMX8M-Mini/m-p/980249#M145707
Taken this as example, what I did:

        gpio-keys {
                compatible = "gpio-keys";
                key_left {
                    debounce-interval = <10>;
                        label = "left";                                                       
                        gpios = <&exp1 10 GPIO_ACTIVE_LOW>;                                   
                        linux,code = <KEY_LEFT>;                                              
                        gpio-key;
                        interrupts = <10 2>;
                        /* autorepeat; */
                };
...
        ethphy2: ethernet@0 {
                compatible = "microchip,encx24j600";
                #address-cells = <1>;
                #size-cells = <1>;
                status="okay";
                reg = <0>;
                spi-max-frequency = <12000000>;
                interrupt-parent = <&exp1>;
                interrupts = <03 2>;
        };

        ethphy3: ethernet@1 {
                compatible = "microchip,encx24j600";
                #address-cells = <1>;
                #size-cells = <1>;
                status="okay";
                reg = <1>;
                spi-max-frequency = <12000000>;
                interrupt-parent = <&exp1>;
                interrupts = <04 2>;
        };
...
        exp1: gpio@74 {
                compatible = "ti,tca9539";
                reg = <0x74>;
                gpio-controller;
                #gpio-cells = <2>;
                interrupt-controller;
                interrupt-parent = <&gpio1>;
                #interrupt-cells = <2>;
                pinctrl-0 = <&pinctrl_i2c2_dev>;
                interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
                status = "okay";
        };
...
        pinctrl_i2c2_dev: mydev_iogrp {
                fsl,pins = <
                        MX8MP_IOMUXC_GPIO1_IO12__GPIO1_IO12        0x140    /*  expend gpio int */
                >;
        };
...
  &gpio1 {
          pinctrl-names = "default";
          pinctrl-0 = <&pinctrl_gpio1>;
          status = "okay";
  };
...
          pinctrl_gpio1: gpio1_grp {
                  fsl,pins = <
                          MX8MP_IOMUXC_GPIO1_IO12__GPIO1_IO12             0x140   /* GPIO0_CSI0_PWR# */
                          MX8MP_IOMUXC_GPIO1_IO14__GPIO1_IO14             0x140   /* GPIO1_CSI1_PWR# */
                          MX8MP_IOMUXC_GPIO1_IO05__GPIO1_IO05             0x140   /* TEST# */
                  >;
          };

But i still can't see the interrupts from the ethernet

 

Tags (2)
0 Kudos
4 Replies

147 Views
Savo
Contributor II

I have this kernel error; I would get a ip address, but no interrupts:

[ 37.859977] ------------[ cut here ]------------
[ 37.864614] NETDEV WATCHDOG: eth2 (encx24j600): transmit queue 0 timed out
[ 37.871556] WARNING: CPU: 2 PID: 0 at net/sched/sch_generic.c:477 dev_watchdog+0x314/0x320
[ 37.879835] Modules linked in: fsl_jr_uio encx24j600 encx24j600_regmap caam_jr caamkeyblob_desc caamhash_desc caamalg_desc crypto_engine rng_core authenc libdes crct10dif_ce imx_sdma caam secvio error fuse
[ 37.898122] CPU: 2 PID: 0 Comm: swapper/2 Not tainted 5.15.32-+g58ed07eb17a0 #1
[ 37.906127] Hardware name: congatec SX8P board (DT)
[ 37.911004] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 37.917969] pc : dev_watchdog+0x314/0x320
[ 37.921981] lr : dev_watchdog+0x314/0x320
[ 37.925990] sp : ffff80000998bd90
[ 37.929301] x29: ffff80000998bd90 x28: ffff000004580480 x27: 0000000000000004
[ 37.936441] x26: ffff000005392480 x25: 0000000000000140 x24: 00000000ffffffff
[ 37.943584] x23: 0000000000000002 x22: ffff0000053923dc x21: ffff800009796000
[ 37.950723] x20: ffff000005392000 x19: 0000000000000000 x18: ffffffffffffffff
[ 37.957866] x17: ffff800074627000 x16: ffff80000998c000 x15: ffff80008998baa7
[ 37.965004] x14: 0000000000000000 x13: ffff8000097b1eb8 x12: 000000000000059d
[ 37.972146] x11: 00000000000001df x10: ffff8000097b1eb8 x9 : ffff8000097b1eb8
[ 37.979286] x8 : 00000000ffffefff x7 : ffff800009809eb8 x6 : ffff800009809eb8
[ 37.986429] x5 : 0000000000000000 x4 : ffff00007dbdc9c0 x3 : ffff00007dbdf948
[ 37.993568] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000004123700
[ 38.000712] Call trace:
[ 38.003159] dev_watchdog+0x314/0x320
[ 38.006822] call_timer_fn.constprop.0+0x24/0x80
[ 38.011445] __run_timers.part.0+0x1f8/0x230
[ 38.015719] run_timer_softirq+0x40/0x7c
[ 38.019645] _stext+0x12c/0x2a8
[ 38.022786] __irq_exit_rcu+0xe0/0x100
[ 38.026538] irq_exit+0x14/0x2c
[ 38.029682] handle_domain_irq+0x68/0x94
[ 38.033606] gic_handle_irq+0xbc/0x140
[ 38.037360] call_on_irq_stack+0x2c/0x60
[ 38.041282] do_interrupt_handler+0x54/0x60
[ 38.045469] el1_interrupt+0x30/0x80
[ 38.049044] el1h_64_irq_handler+0x1c/0x2c
[ 38.053142] el1h_64_irq+0x78/0x7c
[ 38.056544] cpuidle_enter_state+0x134/0x2f4
[ 38.060814] cpuidle_enter+0x3c/0x54
[ 38.064393] do_idle+0x214/0x29c
[ 38.067622] cpu_startup_entry+0x2c/0x80
[ 38.071544] secondary_start_kernel+0x150/0x17c
[ 38.076079] __secondary_switched+0x94/0x98
[ 38.080269] ---[ end trace a3bd5396c1abe563 ]---

0 Kudos

136 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Thank you for sharing more information, unfortunately you are using a different part (tca9539), so you may be missing other device tree bindings or configurations for this part to work as expected.

Best regards/Saludos,
Aldo.

0 Kudos

245 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Are you using the same GPIO expander (PCA6416)?
Which BSP version are you using?
Also, did you try steps 2 & 3 provided in the other thread you used as reference?

Best regards/Saludos,
Aldo.

0 Kudos

219 Views
Savo
Contributor II

I am using a custom board with a tca9539. The setup is as i added above. I have this in /proc/interrupts, but the interrupts are not propagated:

80: 0 0 0 0 gpio-mxc 10 Edge extcon_usb1
82: 0 0 0 0 gpio-mxc 12 Level 1-0074
86: 0 0 0 0 gpio-mxc 16 Edge pca9450-irq
110: 0 0 0 0 gpio-mxc 8 Edge Sleep Button
114: 0 0 0 0 gpio-mxc 12 Edge 30b50000.mmc cd
195: 0 0 0 0 gpio-mxc 29 Edge left
219: 0 0 0 0 gpio-mxc 21 Edge PCIe wakeup

 

0 Kudos