SC16IS7xx driver

I am trying to configure an SC16IS752 device but my unfamiliarity with linux is getting in the way.

In the /boot/config-4.19.94-ti-r73 file I see SC16IS7XX is not set
I also cannot find any related driver using find /lib/modules | grep sc16

How do I enable this device?

Hi @Ndziura feel free to re-enable that config:

CONFIG_SERIAL_SC16IS7XX_CORE
CONFIG_SERIAL_SC16IS7XX
CONFIG_SERIAL_SC16IS7XX_I2C
CONFIG_SERIAL_SC16IS7XX_SPI

I had to disable it for us, as the breaks SERIAL_DEV_CTRL_TTYPORT, which breaks Bluetooth on wl18xx… which breaks the Black Wireless, Green Wireless, Gateway etc…

Regards,

@RobertCNelson Im not familiar with linux, so I dont know how to re enable the config. Do I just add those lines to boot/config-4.19.94-ti-r73?

Hi @Ndziura you get to rebuild the kernel:

Do this on an x86 desktop running Debian or Ubuntu…

git clone -b ti-linux-4.19.y https://github.com/RobertCNelson/ti-linux-kernel-dev
cd ti-linux-kernel-dev/

Then edit patches/defconfig to match these changes:

diff --git a/patches/defconfig b/patches/defconfig
index 7d51d5f5..1076dfd2 100644
--- a/patches/defconfig
+++ b/patches/defconfig
@@ -2818,7 +2818,10 @@ CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_SERIAL_OMAP is not set
 # CONFIG_SERIAL_SCCNXP is not set
-# CONFIG_SERIAL_SC16IS7XX is not set
+CONFIG_SERIAL_SC16IS7XX_CORE=m
+CONFIG_SERIAL_SC16IS7XX=m
+CONFIG_SERIAL_SC16IS7XX_I2C=y
+CONFIG_SERIAL_SC16IS7XX_SPI=y
 # CONFIG_SERIAL_BCM63XX is not set
 # CONFIG_SERIAL_ALTERA_JTAGUART is not set
 # CONFIG_SERIAL_ALTERA_UART is not set
@@ -2830,7 +2833,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 # CONFIG_SERIAL_ST_ASC is not set
 # CONFIG_SERIAL_PRU_SUART is not set
 CONFIG_SERIAL_DEV_BUS=y
-CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
+# CONFIG_SERIAL_DEV_CTRL_TTYPORT is not set
 CONFIG_TTY_PRINTK=m
 CONFIG_HVC_DRIVER=y
 # CONFIG_HVC_DCC is not set

Then run ./build_deb.sh

Wait till build finishes, then copy ./deploy/linux-image*.deb to beagle and install…

sudo dpkg -i linux-image*.deb

Regards,

The CONFIG_SERIAL_SC16IS7XX lines in the config are now set and I see kernel/drivers/tty/serialsc16is7xx.ko.xz, but no SC16IS .dtbo files in /lib/firmware and no ttySC* in /dev.

Should they be there or should I be looking for something else?

Did you write an SC16IS*.dtbo overlay? or did you customize the device tree for a SC16IS node? Then no, unless you write something for the SC16IS and load it, it won’t show up… Which pins are you thinking of using?

Regards,

I need to use the SPI1 pins, with chip select 0. So I need to write and compile a device tree overlay for those pins?

Thanks, Nick

Here’s one example, change the spi1 section:

Regards,

I have modified the file, however when I try to compile it I get the error

FATAL ERROR: Unable to parse input tree

on the line:

#include <dt-bindings/board/am335x-bbw-bbb-base.h

According to this tutorial: Using Device Tree Overlays, example on BeagleBone boards

I need to remake the linux kernel, however the command

make dtbs

returns

no rule to make target dtbs

Is the tutorial accurate in what I need to do? If so what could be the cause of the error?

you did it this way right?

git clone https://github.com/beagleboard/bb.org-overlays.git
cd ./bb.org-overlays/
#make changes
make
sudo make install

Regards,

That compilation method works but I assume the changes I made to the .dts file aren’t right.
The changes I made from the LTC2947 file were changing the labels as well as changing the max frequency to that specified in the datasheet for the SC16IS752.

BB-SPI1-SC16IS752-00A0.dts (2.2 KB)

You’ll need to define the clock speed or clock input: a long with the interrupt:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt?h=v5.19

Required properties:

  • compatible: Should be one of the following:
    • “nxp,sc16is740” for NXP SC16IS740,
    • “nxp,sc16is741” for NXP SC16IS741,
    • “nxp,sc16is750” for NXP SC16IS750,
    • “nxp,sc16is752” for NXP SC16IS752,
    • “nxp,sc16is760” for NXP SC16IS760,
    • “nxp,sc16is762” for NXP SC16IS762.
  • reg: SPI chip select number.
  • interrupts: Specifies the interrupt source of the parent interrupt
    controller. The format of the interrupt specifier depends on the
    parent interrupt controller.
  • clocks: phandle to the IC source clock.
Example:
	sc16is750: sc16is750@0 {
		compatible = "nxp,sc16is750";
		reg = <0>;
		clocks = <&clk20m>;
		interrupt-parent = <&gpio3>;
		interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
		gpio-controller;
		#gpio-cells = <2>;
	};

Here’s an in-kernel example on how you could define the clock for this:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/boot/dts/ingenic/cu1000-neo.dts#n68

Regards,