Device Tree Compilation warning on interrupts_property

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Device Tree Compilation warning on interrupts_property

跳至解决方案
2,662 次查看
JohnKlug
Senior Contributor I

I am using the i.MX6ULL with the PCA953X driver. 

My 1st question is how do I pick an interrupt? I picked 31 (decimal) because it does not occur elsewhere in device tree.

My 2nd question is on the cause of a warning.

When I try to compile my tree I get a warning:

/home/jklug/mlinux-iotr/build/tmp/work-shared/iotr/kernel-source/arch/arm/boot/dts/imx6ul.dtsi:547.5-28: Warning (interrupts_property): /soc/aips-bus@2100000/i2c@21a8000/pca9538@71:#interrupt-cells: size is (12), expected multiple of 8



Since #interrupt-cells is used frequently without any warnings, I am assuming something is wrong with my device tree.

Here is a segment of the input.  I am using the i.MX6ULL processor:

   gpio6:pca9538@71 {  // GPIO Expander
        pinctrl-0 = <&pinctrl_gpio6_int>;
        compatible = "nxp,pca9538";
        reg = <0x71>;
        gpio-controller;
        #gpio-cells = <2>;
        vcc-supply = <&dummy_reg_33>;  // Driver wants a regulator?
        #interrupt-cells = <2>;
        interrupt-parent = <&gpio3>;
        interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_LOW>;
        gpio-line-names = "g6_0", "g6_1", "RS232_RS485_UART3_EN",
                      "RS232_UART2_EN", "RS485_TERM_EN",
                      "g6_5", "USER_DIO_IN", "USER_DIO_OUT";
    };

 
I derived this from examples here:
PCA9555 

and here:
PCA9538 

0 项奖励
回复
1 解答
2,621 次查看
JohnKlug
Senior Contributor I

I think I now understand this.  interrupt-cells is the number of 32 bit words that is used to describe a single interrupt specified by the "interrupts" property in children.

Some interrupt parents require 3 parameters, and some require 2 from the imx6ul.dtsi portion of device tree.

Example:

                     gpc: gpc@20dc000 {
                                compatible = "fsl,imx6ul-gpc", "fsl,imx6q-gpc";
                                reg = <0x020dc000 0x4000>;
                                interrupt-controller;
                                #interrupt-cells = <3>;
                                interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
                                interrupt-parent = <&intc>;
                                fsl,mf-mix-wakeup-irq = <0x7c00000 0x7d00 0x0 0x1400640>;
                        };


When this interrupt controller is used, we need 3 parameters to the interrupt:

        tempmon: tempmon {
                compatible = "fsl,imx6ul-tempmon", "fsl,imx6sx-tempmon";
                interrupt-parent = <&gpc>;
                interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
                fsl,tempmon = <&anatop>;
                nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
                nvmem-cell-names = "calib", "temp_grade";
                clocks = <&clks IMX6UL_CLK_PLL3_USB_OTG>;
        };


So because the gic controller requires 3 parameters in the interrupts property, three thirty-two bit words are specified.

In my case, the parent is the GPIO controller built into the i.MX6:

                       gpio3: gpio@20a4000 {
                                compatible = "fsl,imx6ul-gpio", "fsl,imx35-gpio";
                                reg = <0x020a4000 0x4000>;
                                interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&clks IMX6UL_CLK_GPIO3>;
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                gpio-ranges = <&iomuxc 0 65 29>;
                        };


It specified gpio-cells of 2, so my gpio6 interrupt controller, which has a parent interrupt controller of gpio3 must only use 2 words per "interrupts" interrupt.

在原帖中查看解决方案

0 项奖励
回复
1 回复
2,622 次查看
JohnKlug
Senior Contributor I

I think I now understand this.  interrupt-cells is the number of 32 bit words that is used to describe a single interrupt specified by the "interrupts" property in children.

Some interrupt parents require 3 parameters, and some require 2 from the imx6ul.dtsi portion of device tree.

Example:

                     gpc: gpc@20dc000 {
                                compatible = "fsl,imx6ul-gpc", "fsl,imx6q-gpc";
                                reg = <0x020dc000 0x4000>;
                                interrupt-controller;
                                #interrupt-cells = <3>;
                                interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
                                interrupt-parent = <&intc>;
                                fsl,mf-mix-wakeup-irq = <0x7c00000 0x7d00 0x0 0x1400640>;
                        };


When this interrupt controller is used, we need 3 parameters to the interrupt:

        tempmon: tempmon {
                compatible = "fsl,imx6ul-tempmon", "fsl,imx6sx-tempmon";
                interrupt-parent = <&gpc>;
                interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
                fsl,tempmon = <&anatop>;
                nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
                nvmem-cell-names = "calib", "temp_grade";
                clocks = <&clks IMX6UL_CLK_PLL3_USB_OTG>;
        };


So because the gic controller requires 3 parameters in the interrupts property, three thirty-two bit words are specified.

In my case, the parent is the GPIO controller built into the i.MX6:

                       gpio3: gpio@20a4000 {
                                compatible = "fsl,imx6ul-gpio", "fsl,imx35-gpio";
                                reg = <0x020a4000 0x4000>;
                                interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&clks IMX6UL_CLK_GPIO3>;
                                gpio-controller;
                                #gpio-cells = <2>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                gpio-ranges = <&iomuxc 0 65 29>;
                        };


It specified gpio-cells of 2, so my gpio6 interrupt controller, which has a parent interrupt controller of gpio3 must only use 2 words per "interrupts" interrupt.

0 项奖励
回复