SC16IS752 driver linux

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

SC16IS752 driver linux

3,166 Views
aneesnorthwales
Contributor I

I am using SC16is752 UART driver in i2c mode. The part is interfaced to microcontroller running linux yocto build and uses i2c. I have dts updated as per the linux documentation. I have them connected under i2c dts node as follows.I see all SC0  to SC7 ports under /dev and I can send message thru the serial port and can receive it on PC. But from PC to the device will not work.In short rx wont work at all.

After debugging the linux kernel driver, I see rxISR is not called. Infact its not even called during SC16is7xx driver probe. In my hardware the messages are polled via i2c., then what is the significance of the interrupt parent and interrupts in the dts? My hardware has the IRQ(pin 15) tied to 3V. pin 13/14 has i2c clock and data. pls see dts below

 

sc16is752_0: sc16is752@4d {
        compatible = "nxp,sc16is752";
        reg = <0x4d>; // i2c address
        clocks = <&sc16is752_clk_0>;
        interrupt-parent = <&gpio2>;  
        interrupts = <7 0x2>;

    };
  
	sc16is752_1: sc16is752@48 {
        compatible = "nxp,sc16is752";
        reg = <0x48>; // i2c address
        clocks = <&sc16is752_clk_1>;
        interrupt-parent = <&gpio3>;
        interrupts = <7 0x2>; //GPIO and falling edge

    };
	sc16is752_2: sc16is752@49 {
        compatible = "nxp,sc16is752";
        reg = <0x49>; // i2c address
        clocks = <&sc16is752_clk_2>;
        interrupt-parent = <&gpio1>;
        interrupts = <7 0x2>; //GPIO and falling edge
    };
    
	sc16is752_3: sc16is752@4c {
        compatible = "nxp,sc16is752";
        reg = <0x4c>; // i2c address
        clocks = <&sc16is752_clk_3>;
        interrupt-parent = <&gpio0>;
        interrupts = <7 0x2>; //GPIO and falling edge
    };

    sc16is752_clk_0: sc16is752_clk_0 {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        reg = <0>;
        clock-frequency = <14745600>;
    };
    sc16is752_clk_1: sc16is752_clk_1 {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        reg = <0>;
        clock-frequency = <14745600>;
    };
    sc16is752_clk_2: sc16is752_clk_2 {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        reg = <0>;
        clock-frequency = <14745600>;
    };
    sc16is752_clk_3: sc16is752_clk_3 {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        reg = <0>;
        clock-frequency = <14745600>;
    };

. I  dont think in the linux 

kthread_init_worker(&s->kworker);
	kthread_init_work(&s->irq_work, sc16is7xx_ist);

 sc16is7xx_ist call back is setup, guessing probably the dts parsing for interrupt node is wrong.

And never see any calls from ISR

infact the transmission is happening from kthread_init_work(&s->p[i].tx_work, sc16is7xx_tx_proc);

The call to sc16is7xx_handle_tx  is only happening from the sc16is7xx_tx_proc. Never see it called from

static bool sc16is7xx_port_irq(struct sc16is7xx_port *s, int portno)

Had been spending a good amount of time trouble shooting this!!! Any help appreciated

0 Kudos
4 Replies

3,165 Views
aneesnorthwales
Contributor I

Also i have checked the hardware, i can see messages correctly rxed at the SC16is752 rx pin

0 Kudos

3,149 Views
reyes
NXP TechSupport
NXP TechSupport

Hi,

 

My first recommendation would be to check if the Software flow control is configured as your system requirements. Different combinations of software flow control can be enabled by setting different combinations of EFR[3:0]. Section 7.3 of the datasheet explains how to configure the device: https://www.nxp.com/docs/en/data-sheet/SC16IS752_SC16IS762.pdf

0 Kudos

3,115 Views
aneesnorthwales
Contributor I

No it didnt help. I have the flow control set correctly.While debuggin open source linux kernel what i find is that ISR services do not get called for either Tx or Rx. There is a separate Tx worker thread that keeps running and it enabled to send message from device to PC. But Rx always comes via interrupt and havent seen it happening. There is correct message coming to rx pin of chip for sure. I scoped it and verified.

0 Kudos

3,108 Views
reyes
NXP TechSupport
NXP TechSupport

Hi,

 

the microcontroller can select one of the two methods for communicating to the Bridge IC. The first method is polling the Bridge IC status register regularly. The second method is using an interrupt handler in the interrupt service routine until the Bridge IC generates an interrupt. If using the interrupt handler, the interrupt pins of the Bridge IC must be connected to the microcontroller and the interrupt bits register must be enabled.

Make sure the interrupt bits register are properly enabled in the Interrupt Enable Register (IER).

 

Table 3 on page 8 of the AN10587 (https://www.nxp.com/docs/en/application-note/AN10587.pdf) shows the interrupt handler read the interrupt identity register to check the interrupt sources such as receiver interrupt. If the receiver interrupt is detected, the interrupt handler will read data from the receiver FIFO of the Bridge IC and store the data.

0 Kudos