0
votes

I am currently writing a device tree node to configure SCISIS752 Dual Channel UART with I2C which is connected to the slave address 0x4d. I am also using a clock of 1.8432MHz. The IRQ pin of SCISIS752 is attached to an IO Expander GPIO which is gpiopin 456 in my case. I am using yocto to create the linux distro. My linux kernel version 4.18.25-yocto-standard My dts configuration:

/dts-v1/;

#include "am33xx.dtsi"
#include "am335x-bone-common.dtsi"
#include "am335x-boneblack-common.dtsi"

/ {
model = "TI AM335x BeagleBone Black";
compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
};

&am33xx_pinmux {
    pinctrl-0 = <&gpio_pins>;
    i2c1_pins_default: i2c1_pins_default {
    pinctrl-single,pins = <
        AM33XX_IOPAD(0x984, PIN_INPUT_PULLUP | MUX_MODE3) /* (D15) uart1_txd.I2C1_SCL */
        AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE3) /* (D16) uart1_rxd.I2C1_SDA */
    >;};

&i2c1 {
    pinctrl-names = "default";
    pinctrl-0 = <&i2c1_pins_default>;
    status = "okay";
    clock-frequency = <400000>;

pcf8574a_38: pcf8574a@38 {
    compatible = "nxp,pcf8574a";
    reg = <0x38>;
    gpio-controller;            
    #gpio-cells = <2>;         
    };
sc16is752@4d {
    compatible = "nxp,sc16is752";
    reg = <0x4d>; 
    clocks = <&sc16is752_clk>;
    interrupt-parent = <&gpio3>;
    interrupts = <7 2>; 
    gpio-controller;
    #gpio-cells = <2>;

    sc16is752_clk: sc16is752_clk {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        clock-frequency = <1843200>;
    };};
};

I am confused on setting the values of interrupt-parent and interrupts to make this configuration work.

1

1 Answers

1
votes

I cannot see your entire device tree, nor do I know what kernel you are running... so I can't point to where your exact problem is. But I can provide some guidance in troubleshooting...

First, it appears you've copied your node from the kernel documentation in Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt. That is a point of reference, but it's simply meant to illustrate.

There is nothing magical about the device tree. It is parsed by drivers in the kernel to describe the electrical configuration. Which means, anytime you're not sure how something works, all you need to do is look at the driver to see how it parses it.

I happen to have the 4.19.0 source code on me. I found your NXP driver in drivers/tty/serial/sc16is7xx.c. I confirmed through the compatible list that it supports nxp,sc16is752.

Start at the probe sc16is7xx_i2c_probe() where the driver is entered and you will immediately see that an IRQ value is being passed in through the i2c_client structure and then setup by the call to devm_request_irq() in sc16is7xx_probe(). This means that the interrupt DT properties aren't processed in this driver. They are passed to it.

You then need to read: https://www.kernel.org/doc/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt to understand how interrupt controllers work. Does your &gpio3 meet the requirements? Is it configured as an interrupt controller? Does the it even exist?