LS1043A : GPIO1_30 doesn't generate interruption

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

LS1043A : GPIO1_30 doesn't generate interruption

2,095 Views
sergepayre
Contributor III

Hi,

On my card, the GPIO1_30 input line is connected to the MCP2515's external interrupt.

I configure RCW wort to set GPIO1_30 as an interrupt (IRQ_EXT=0x0, IRQ_BASE, GPIO1[30]=0).

I added the following lines in my device tree:

&dspi0 {
status = "okay";
bus-num = <0>;

   can0: can@1 {

      compatible = "microchip,mcp2515";
      reg = <1>;

      clocks = <&mcp251x_clk>;

      interrupt-parent = <&gpio0>;
      interrupts = <30 0x2>;
      spi-max-frequency = <5000000>;
      fsl,spi-cs-sck-delay = <200>;
      fsl,spi-sck-cs-delay = <200>;
      mcp251x_clk: clock {
         compatible = "fixed-clock";
         #clock-cells = <0>;
         clock-frequency = <20000000>;
      };
   };
};

When I send CAN messages from PC to board, CAN message are correctly acknowledged.

When I send CAN message from board to PC,  these messages are correctly received on PC

On board, If I look at the interruption line, I see what it goes down to level 0 at the first transmit message but never goes back to level 1.

To transfer a new message, I need to close and open device CAN again (ifconfig can0 down / up)

At this point, I think that hardware interrupt isn't notified to GIC Controller

Where is the problem ?

Thanks.

root@bipls1043:~# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3
  1:          0          0          0          0       GIC  29 Edge      arch_timer
  2:       2867       2706       2752       1523       GIC  30 Edge      arch_timer
  3:          0          0          0          0       GIC  27 Edge      kvm guest timer
  9:          0          0          0          0       GIC  25 Edge      vgic
 11:       7191          0          0          0       GIC  75 Level     fsl-ifc
 12:         52          0          0          0       GIC  94 Level     mmc0
 13:          0          0          0          0       GIC  77 Level     bman-err, qman-err, fman-err
 14:          0          0          0          0       GIC  76 Level     fman
 16:         48          0          0          0       GIC  96 Level     2100000.dspi
 17:          2          0          0          0       GIC 131 Level     1550000.quadspi
 18:         96          0          0          0       GIC  88 Level     2180000.i2c
 19:          0          0          0          0       GIC  89 Level     2190000.i2c
 20:          0          0          0          0       GIC  90 Level     21a0000.i2c
 21:          0          0          0          0       GIC  91 Level     21b0000.i2c
 22:       1300          0          0          0       GIC  86 Level     serial
 29:          0          0          0          0       GIC 118 Level     29d0000.ftm0
 32:         28          0          0          0       GIC  92 Level     xhci-hcd:usb1
 33:          0          0          0          0       GIC  93 Level     xhci-hcd:usb3
 34:          0          0          0          0       GIC  95 Level     xhci-hcd:usb5
 35:          0          0          0          0       GIC 101 Level     3200000.sata
 36:          0          0          0          0       GIC 184 Level     qDMA error
 37:          0          0          0          0       GIC  71 Level     qDMA queue
 38:          0          0          0          0       GIC 159 Level     ls-pcie-pme
 39:          0          0          0          0       GIC 160 Level     aerdrv
 45:          0          0          0       4902       GIC 214 Level     QMan portal 3
 46:          0          0       4674          0       GIC 216 Level     QMan portal 2
 47:          0       4903          0          0       GIC 218 Level     QMan portal 1
 48:       4896          0          0          0       GIC 220 Level     QMan portal 0
 54:          0          0          0          0       GIC 215 Level     BMan portal 3
 55:          0          0          0          0       GIC 217 Level     BMan portal 2
 56:          0          0          0          0       GIC 219 Level     BMan portal 1
 57:          0          0          0          0       GIC 221 Level     BMan portal 0
 58:          0          0          0          0       GIC 148 Level     MSI-GROUP
 59:          0          0          0          0       GIC 158 Level     MSI-GROUP
 60:          0          0          0          0       GIC 192 Level     MSI-GROUP
 61:          0          0          0          0       GIC 152 Level     PCIe PME
 62:          0          0          0          0  mpc8xxx-gpio  30 Edge      mcp251x
 63:          2          0          0          0       GIC 103 Level     1710000.jr
 64:          0          0          0          0       GIC 104 Level     1720000.jr
 65:          0          0          0          0       GIC 105 Level     1730000.jr
 66:          0          0          0          0       GIC 106 Level     1740000.jr
IPI0:      2451       2190       2470       1928       Rescheduling interrupts
IPI1:        56         42         72         76       Function call interrupts
IPI2:         0          0          0          0       CPU stop interrupts
IPI3:         0          0          0          0       Timer broadcast interrupts
IPI4:         0          0          0          0       IRQ work interrupts
Err:          0

Labels (1)
3 Replies

1,446 Views
ufedor
NXP Employee
NXP Employee

1) Please provide U-Boot log as text file for inspection

2) Please use a debugger and capture values of all GPIO1 registers before and after the interrupt line state alternation.

What are they?

0 Kudos

1,446 Views
sergepayre
Contributor III

After reading ls1043 user manual, i saw that GPIO1_30 is connected to GIC with internal interruption number 182. So i change my dts file (see below)

&dspi0 {
status = "okay";
bus-num = <0>;

   can0: can@1 {

      compatible = "microchip,mcp2515";
      reg = <1>;

      clocks = <&mcp251x_clk>;

      interrupts = <0 150 0x2>;
      spi-max-frequency = <5000000>;
      fsl,spi-cs-sck-delay = <200>;
      fsl,spi-sck-cs-delay = <200>;
      mcp251x_clk: clock {
         compatible = "fixed-clock";
         #clock-cells = <0>;
         clock-frequency = <20000000>;
      };
   };
};

but when I set up my can device I obtain the following message

root@toto:~# ifconfig can0 up
[ 68.339351] genirq: Setting trigger mode 2 for irq 62 failed (gic_set_type+0x0/0x48)
[ 68.347142] mcp251x spi0.1: failed to acquire irq 62
SIOCSIFFLAGS: Invalid argument

which data must be contained in the interrupt label ?

regards
0 Kudos

1,446 Views
sergepayre
Contributor III

Hi,

I solved my problem. I apply the following modification :

- I replace   "interrupts = <0 150 0x2>;" by "interrupts = <0 150 0x4>;" : GIC-400 driver support only low to high egde or high level

- In "mcp251x_open" function of mcp251x driver, I apply the following patch

/*    
    unsigned long flags = IRQF_ONESHOT | IRQF_TRIGGER_FALLING;
*/
    unsigned long flags = IRQF_ONESHOT ;
/**/

- I set IRQ10INT bit at 1 in Interrupt Polarity Register (SCFG_INTCR) into u-boot

- I fix mcp2515 clock to 20 Mhz in the driver because the definition in device tree not works

Thanks