RE: Raspberry compute module does not find ttySC0 and ttySC1 with SC16IS752

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Maarten,

According to you last answer I have changed in config.txt:
dtparam=i2c_arm=on

In addition to:
# Debug active
dtdebug=1
# Additional overlays and parameters are documented /boot/overlays/README
dtoverlay=sc16is752-i2c,clkrate=100000,irqpin=22

I have changed interrupt configuration to <&gpio>. The sc16is752-i2c-overlay.dts file is (If you cannot read it properly due to email agent - it is supposed to be plain text-, I can send it some other way): 
----------------------------------------------------------------------------------
// Overlay for the SC16IS752 I2C-connected UART
/dts-v1/;
/plugin/;

/ {
compatible = "brcm,bcm2708";
fragment@0 {
  target = <&i2c_arm>;
  __overlay__ {
    #address-cells = <1>;
    #size-cells = <0>;
    status = "okay";

    sc16is752: sc16is752@4D {
      compatible = "nxp,sc16is752";
      reg = <0x4D>;
      clocks = <&sc16is752_clock>;
      interrupt-parent = <&gpio>;
      interrupts = <255 2>; /* high-to-low edge triggered */
      gpio-controller;
      #gpio-cells = <2>;
      };
    };
  };

fragment@1 {
  target = <&clocks>;
  __overlay__ {
    #address-cells = <1>;
    #size-cells = <0>;
    status = "okay";

    sc16is752_clock: sc16is752_clock@10 {
      compatible = "fixed-clock";
      reg = <10>;
      #clock-cells = <0>;
      clock-output-name = "sc16is752";
      clock-frequency = <100000>;
      };
    };
  };

fragment@2 {
  target = <&gpio>;
  __overlay__ {
    sc16is752_pins: sc16is752_pins {
      brcm,pins = <255>;
      brcm,function = <0>; /* in */
      };
    };
  };

 __overrides__ {
  clkrate = <&sc16is752_clock>,"clock-frequency:0";
  irqpin = <&sc16is752>,"interrupts:0",
  <&sc16is752_pins>,"brcm,pins:0";
  };
};
----------------------------------------------------------------------------------


I use Device Tree. When executing: 

"dtc -I fs /proc/device-tree"

I get following output (I only include lines related with sc16is752):
------------------------------------------------------------------------------------
soc {
  compatible = "simple-bus";
  ranges = <0x7e000000 0x20000000 0x1000000>;
  #address-cells = <0x1>;
  phandle = <0x1d>;
  #size-cells = <0x1>;
  linux,phandle = <0x1d>;
 ...
i2c@7e804000 {
  reg = <0x7e804000 0x1000>;
  interrupts = <0x2 0x15>;
  pinctrl-0 = <0xd>;
  compatible = "brcm,bcm2708-i2c";
  clock-frequency = <0x186a0>;
  clocks = <0x4>;
  status = "okay";
  #address-cells = <0x1>;
  phandle = <0x1a>;
  #size-cells = <0x0>;
  pinctrl-names = "default";
  linux,phandle = <0x1a>;

sc16is752@4D {
  reg = <0x4d>;
  interrupts = <0x16 0x2>;
  #gpio-cells = <0x2>;
  compatible = "nxp,sc16is752";
  clocks = <0x28>;
  phandle = <0x29>;
  gpio-controller;
  linux,phandle = <0x29>;
  interrupt-parent = <0xf>;
  };
}; 
....                        
gpio@7e200000 {
  reg = <0x7e200000 0xb4>;
  interrupts = <0x2 0x11 0x2 0x12>;
  #gpio-cells = <0x2>;
  compatible = "brcm,bcm2835-gpio";
  #interrupt-cells = <0x2>;
  phandle = <0xf>;
  interrupt-controller;
  gpio-controller;
  linux,phandle = <0xf>; 
....
sc16is752_pins {
  phandle = <0x2a>;
  brcm,function = <0x0>;
  brcm,pins = <0x16>;
  linux,phandle = <0x2a>;
  };
};
};

clocks {
  compatible = "simple-bus";
  status = "okay";
  #address-cells = <0x1>;
  phandle = <0x27>;
  #size-cells = <0x0>;
  linux,phandle = <0x27>;
 .... 
sc16is752_clock@10 {
  reg = <0xa>;
  #clock-cells = <0x0>;
  clock-output-name = "sc16is752";
  compatible = "fixed-clock";
  clock-frequency = <0x186a0>;
  phandle = <0x28>;
  linux,phandle = <0x28>;
  };
};
-------------------------------------------------------------------
                               
I also include the log generated by command: 
"sudo vcdbg log msg" ( without dtdebug=1 ): 
----------------------------------------------------------------------------------
012803.616: Loaded overlay 'sc16is752-i2c'
012803.633: dtparam: clkrate=100000
012804.198: dtparam: irqpin=22
012805.091: dtparam: i2c_arm=on
----------------------------------------------------------------------------------

And by command: 
"sudo vcdbg log msg" ( with dtdebug=1 ): 
----------------------------------------------------------------------------------
012808.179: Loaded overlay 'sc16is752-i2c'
012808.198: dtparam: clkrate=100000
012808.371: dtdebug: Found override clkrate
012808.408: dtdebug:   override clkrate: cell target clock-frequency @ offset 0 (size 4)
012808.827: dtparam: irqpin=22
012809.004: dtdebug: Found override irqpin
012809.040: dtdebug:   override irqpin: cell target interrupts @ offset 0 (size 4)
012809.289: dtdebug:   override irqpin: cell target brcm,pins @ offset 0 (size 4)
012809.851: dtdebug: Found fragment 0 (offset 36)
012813.252: dtdebug: merge_fragment(/soc/i2c@7e804000,/fragment@0/__overlay__)
012813.278: dtdebug:   +prop(#address-cells)
012813.656: dtdebug:   +prop(#size-cells)
012814.036: dtdebug:   +prop(status)
012815.823: dtdebug: merge_fragment(/soc/i2c@7e804000/sc16is752@4D,/fragment@0/__overlay__/sc16is752@4D)
012815.848: dtdebug:   +prop(compatible)
012816.204: dtdebug:   +prop(reg)
012816.594: dtdebug:   +prop(clocks)
012816.989: dtdebug:   +prop(interrupt-parent)
012817.366: dtdebug:   +prop(interrupts)
012817.787: dtdebug:   +prop(gpio-controller)
012818.230: dtdebug:   +prop(#gpio-cells)
012818.681: dtdebug:   +prop(linux,phandle)
012819.134: dtdebug:   +prop(phandle)
012819.597: dtdebug: merge_fragment() end
012819.631: dtdebug: merge_fragment() end
012819.705: dtdebug: Found fragment 1 (offset 324)
012824.304: dtdebug: merge_fragment(/clocks,/fragment@1/__overlay__)
012824.329: dtdebug:   +prop(#address-cells)
012824.598: dtdebug:   +prop(#size-cells)
012824.872: dtdebug:   +prop(status)
012827.205: dtdebug: merge_fragment(/clocks/sc16is752_clock@10,/fragment@1/__overlay__/sc16is752_clock@10)
012827.230: dtdebug:   +prop(compatible)
012827.508: dtdebug:   +prop(reg)
012827.820: dtdebug:   +prop(#clock-cells)
012828.225: dtdebug:   +prop(clock-output-name)
012828.703: dtdebug:   +prop(clock-frequency)
012829.110: dtdebug:   +prop(linux,phandle)
012829.478: dtdebug:   +prop(phandle)
012829.847: dtdebug: merge_fragment() end
012829.881: dtdebug: merge_fragment() end
012829.957: dtdebug: Found fragment 2 (offset 588)
012831.658: dtdebug: merge_fragment(/soc/gpio@7e200000,/fragment@2/__overlay__)
012833.036: dtdebug: merge_fragment(/soc/gpio@7e200000/sc16is752_pins,/fragment@2/__overlay__/sc16is752_pins)
012833.060: dtdebug:   +prop(brcm,pins)
012833.651: dtdebug:   +prop(brcm,function)
012834.249: dtdebug:   +prop(linux,phandle)
012834.832: dtdebug:   +prop(phandle)
012835.429: dtdebug: merge_fragment() end
012835.458: dtdebug: merge_fragment() end
012835.626: dtparam: cache_line_size=32
012836.835: dtdebug: Found override cache_line_size
012836.874: dtdebug:   override cache_line_size: cell target cache-line-size @ offset 0 (size 4)
012839.921: dtdebug: delete_node(/hat) 
----------------------------------------------------------------------------------


We are still missing the ttySC0 and ttySC1 in /dev folder. Somehow the sc16is752 is not correctly recognized.

I am using kernel version 4.1.13. Should I use 4.4?

Any other suggestion?.

Thanks for your support.
Juan.


--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux