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

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

 



Hello Juan,

----- Original Message -----
From: Juan García Pastor [mailto:jgp@xxxxxxxxxxxxx]
To: 'Maarten Brock' [mailto:m.brock@xxxxxxxxxxxxx]
Cc: linux-serial@xxxxxxxxxxxxxxx
Sent: Mon, 02 May 2016 23:15:28 +0200
Subject: RE: Raspberry compute module does not find ttySC0 and ttySC1 with SC16IS752 


> Dear Marteen,
> 
> Thanks for your support.
> 
> I go over your last proposal:
> > >       interrupts = <255 2>; /* high-to-low edge triggered */
> > You probably used 22 instead of 255 here according to below info.
> 
> I use then:
> interrupts = <22 2>; /* high-to-low edge triggered */
> 
> In config.txt file, I have tried with both:
> dtoverlay=sc16is752-i2c,clkrate=100000,irqpin=22
> # and
> dtoverlay=sc16is752-i2c,clkrate=1843200,irqpin=22

I don't use those clkrate and irqpin parameters. I only have something like
dtoverlay=sc16is740

And depending on the kernel version the binary overlay should be named either
- sc16is740-overlay.dtb or
- sc16is740.dtbo
But since it appears in your runtime device tree, you probably have this right.

> But I am not sure if this clock must match the one from the .dts file. I
> thought 1.8432Mhz is the clock input to the sc16is752, and the clkrate is
> the communication speed between the compute module and the sc16is752, but
> you may know better which is which. I have tested with all combinations with
> no good result.
> 
> We have also removed "fragment@2" section and "__overrides__ " section from
> .dts according to:
> -----------------------------
> > fragment@2 {
> >   target = <&gpio>;
> >   __overlay__ {
> >     sc16is752_pins: sc16is752_pins {
> >       brcm,pins = <255>;
> >       brcm,function = <0>; /* in */
> >       };
> >     };
> >   };
> 
> Why is this fragment here? The raspberry pi doesn't have 255 gpio pins.
> 
> >  __overrides__ {
> >   clkrate = <&sc16is752_clock>,"clock-frequency:0";
> >   irqpin = <&sc16is752>,"interrupts:0",
> >   <&sc16is752_pins>,"brcm,pins:0";
> >   };
> > };
> 
> And what is this supposed to do? I use the SC16IS740 in SPI mode and I don't
> have something like this.
> -----------------------------
> I got these two sections from a previous example found in raspberry.org
> forum. I do not really understand the point on them, but when I delete them
> I get some error messages (see below). I just try to understand the meaning
> of every variable, but I am having a very hard time finding complete
> information, so I basically try to execute already tested configurations. I
> do not find any other better way.
> 
> 
> My .dts file is:
> -----------------------------
> // 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 = <22 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 = <1843200>;
>       };
>     };
>   };
> };
> -----------------------------
> 
> By doing so, I get some error messages related with "__overrides__ node not
> foung"
> -----------------------------
> 012806.864: Loaded overlay 'sc16is752-i2c'
> 012806.883: dtparam: clkrate=100000
> 012807.045: dtdebug: /__overrides__ node not found
> 012808.276: dtdebug: /__overrides__ has no clkrate property
> 012808.289: Unknown dtparam 'clkrate' - ignored
> 012808.304: dtparam: irqpin=22
> 012808.465: dtdebug: /__overrides__ node not found
> 012809.721: dtdebug: /__overrides__ has no irqpin property
> 012809.733: Unknown dtparam 'irqpin' - ignored
> 012809.799: dtdebug: Found fragment 0 (offset 36)
> 012813.194: dtdebug:
> merge_fragment(/soc/i2c@7e804000,/fragment@0/__overlay__)
> 012813.219: dtdebug:   +prop(#address-cells)
> 012813.597: dtdebug:   +prop(#size-cells)
> 012813.977: dtdebug:   +prop(status)
> 012815.764: dtdebug:
> merge_fragment(/soc/i2c@7e804000/sc16is752@4D,/fragment@0/__overlay__/sc16is752@4D)
> 012815.787: dtdebug:   +prop(compatible)
> 012816.142: dtdebug:   +prop(reg)
> 012816.531: dtdebug:   +prop(clocks)
> 012816.926: dtdebug:   +prop(interrupt-parent)
> 012817.302: dtdebug:   +prop(interrupts)
> 012817.724: dtdebug:   +prop(gpio-controller)
> 012818.167: dtdebug:   +prop(#gpio-cells)
> 012818.617: dtdebug:   +prop(linux,phandle)
> 012819.070: dtdebug:   +prop(phandle)
> 012819.531: dtdebug: merge_fragment() end
> 012819.565: dtdebug: merge_fragment() end
> 012819.639: dtdebug: Found fragment 1 (offset 324)
> 012824.176: dtdebug: merge_fragment(/clocks,/fragment@1/__overlay__)
> 012824.201: dtdebug:   +prop(#address-cells)
> 012824.470: dtdebug:   +prop(#size-cells)
> 012824.743: dtdebug:   +prop(status)
> 012827.053: dtdebug:
> merge_fragment(/clocks/sc16is752_clock@10,/fragment@1/__overlay__/sc16is752_clock@10)
> 012827.078: dtdebug:   +prop(compatible)
> 012827.355: dtdebug:   +prop(reg)
> 012827.666: dtdebug:   +prop(#clock-cells)
> 012828.070: dtdebug:   +prop(clock-output-name)
> 012828.548: dtdebug:   +prop(clock-frequency)
> 012828.955: dtdebug:   +prop(linux,phandle)
> 012829.322: dtdebug:   +prop(phandle)
> 012829.693: dtdebug: merge_fragment() end
> 012829.726: dtdebug: merge_fragment() end
> 012829.884: dtparam: cache_line_size=32
> 012831.087: dtdebug: Found override cache_line_size
> 012831.126: dtdebug:   override cache_line_size: cell target cache-line-size
> @ offset 0 (size 4)
> 012834.163: dtdebug: delete_node(/hat)
> -----------------------------

I guess those warnings stem from the config.txt parameters which I don't use.

> > Is the sc16is7xx driver compiled into the kernel? Or as a module? And if
> so, is it in:
> > /lib/modules/4.1.13/kernel/drivers/tty/serial/sc16is7xx.ko
> 
> Sc16is7xx driver is compiled as a module and loaded to file:
> /lib/modules/4.1.13/kernel/drivers/tty/serial/sc16is7xx.ko

Have you tried to use modprobe or insmod to load the kernel module?

> We are still missing ttySC0 and ttySC1.
> 
> Any other suggestion?.
> 
> Thanks so much for your time.
> Juan.
> 
> 
> -----Mensaje original-----
> De: Maarten Brock [mailto:m.brock@xxxxxxxxxxxxx] 
> Enviado el: lunes, 02 de mayo de 2016 10:17
> Para: Juan García Pastor
> CC: linux-serial@xxxxxxxxxxxxxxx
> Asunto: RE: Raspberry compute module does not find ttySC0 and ttySC1 with
> SC16IS752 
> 
> Hello Juan,
> 
> ----- Original Message -----
> From: Juan García Pastor [mailto:jgp@xxxxxxxxxxxxx]
> To: 'Maarten Brock' [mailto:m.brock@xxxxxxxxxxxxx]
> Cc: linux-serial@xxxxxxxxxxxxxxx
> Sent: Mon, 02 May 2016 00:23:14 +0200
> Subject: RE: Raspberry compute module does not find ttySC0 and ttySC1 with
> SC16IS752 
> 
> 
> > 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 */
> 
> You probably used 22 instead of 255 here according to below info.
> 
> >       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>;
> 
> I very much doubt that your fixed clock run at 100 kHz. That is not a very
> baudrate friendly frequency. I would expect something like 1.8432 MHz.
> 
> >       };
> >     };
> >   };
> > 
> > fragment@2 {
> >   target = <&gpio>;
> >   __overlay__ {
> >     sc16is752_pins: sc16is752_pins {
> >       brcm,pins = <255>;
> >       brcm,function = <0>; /* in */
> >       };
> >     };
> >   };
> 
> Why is this fragment here? The raspberry pi doesn't have 255 gpio pins.
> 
> >  __overrides__ {
> >   clkrate = <&sc16is752_clock>,"clock-frequency:0";
> >   irqpin = <&sc16is752>,"interrupts:0",
> >   <&sc16is752_pins>,"brcm,pins:0";
> >   };
> > };
> 
> And what is this supposed to do? I use the SC16IS740 in SPI mode and I don't
> have something like this.
> 
> > ----------------------------------------------------------------------
> > ------------
> > 
> > 
> > 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>;
> >   };
> > };
> 
> Looks ok apart from the fixed clock frequency.
> 
> > -------------------------------------------------------------------
> >                                
> > 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?
> 
> I don't think you have to for I2C, but I have no experience with that
> version.
> Is the sc16is7xx driver compiled into the kernel? Or as a module? And if so,
> is it in:
> /lib/modules/4.1.13/kernel/drivers/tty/serial/sc16is7xx.ko
> 
> > Any other suggestion?.
> > 
> > Thanks for your support.
> > Juan.
> 
> You're welcome,
> Maarten
> 
--
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