Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - Add a module for sc16is752 to the standard configurations #1594

Closed
MasterWuff opened this issue Aug 11, 2016 · 20 comments
Closed

Comments

@MasterWuff
Copy link

Hi,

Recently I had a problem when I was switching from RPi2 to RPi3, because of only one UART interface. Never the less, I decided to buy a SC16IS752 from NXP. It can connected it to the RPi via I2C and SPI. The external interfaces are two UART ports and 8 GPIOs.

But here is the problem, the module isn't in the standard configurations to work with that.
There is the solution to complile the kernel, but I don't feel really confident with that.

Why to add the module?
-The code already exists: https://github.com/raspberrypi/linux/blob/rpi-4.1.y/drivers/tty/serial/sc16is7xx.c
-The overlay already exists (/boot/overlays/sc16is752-spi1.dtbo)
-It is only 24kB
-i'm not the only one who is dealing with one UART interface

Thanks in advance and on spending so much time to keep the system up to date.

@pelwell
Copy link
Contributor

pelwell commented Aug 11, 2016

It's fine with me. @popcornmix?

@popcornmix
Copy link
Collaborator

Okay.

popcornmix added a commit to raspberrypi/firmware that referenced this issue Aug 12, 2016
kernel: config: Enable SENSORS_LM75
See: #508

kernel: config: Enable SERIAL_SC16IS7XX
See: raspberrypi/linux#1594

kernel: snd-bcm2835: Don't allow responses from VC to be interrupted by user signals
See: raspberrypi/linux#1560
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Aug 12, 2016
kernel: config: Enable SENSORS_LM75
See: raspberrypi/firmware#508

kernel: config: Enable SERIAL_SC16IS7XX
See: raspberrypi/linux#1594

kernel: snd-bcm2835: Don't allow responses from VC to be interrupted by user signals
See: raspberrypi/linux#1560
@popcornmix
Copy link
Collaborator

This is now in latest rpi-update kernel.

@MasterWuff
Copy link
Author

MasterWuff commented Aug 13, 2016

Thanks a lot, this is what I call a support. Less then 24 hours.
Short Feedback: it works GREAT

@popcornmix
Copy link
Collaborator

Cool. Feel free to close the issue.

@DimionDR
Copy link

Hello!
Why I2C drivers implementation?!!
Overlay file only for SPI - /boot/overlays/sc16is752-spi1.dtbo

@MasterWuff
Copy link
Author

Hi DimionDR,
the kernel add on is for I2C and SPI. By default there is one overlay for a SPI connection, but you can write your own for I2C. Or have a look here: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=146908&start=25
You can use both

@DimionDR
Copy link

Hello,
I am new in DTS, is it possible to change working interface for the sc16is7xx module without recompiling? My problem is what I want to use the module with SPI...
modinfo output:
pi@raspberrypi:~ $ modinfo sc16is7xx
filename: /lib/modules/4.4.17-v7+/kernel/drivers/tty/serial/sc16is7xx.ko
description: SC16IS7XX serial driver
author: Jon Ringle jringle@gridpoint.com
license: GPL
srcversion: 2021DCD9C98A4797C2CB85D
alias: of:N_T_Cnxp,sc16is762*
alias: of:N_T_Cnxp,sc16is760*
alias: of:N_T_Cnxp,sc16is752*
alias: of:N_T_Cnxp,sc16is750*
alias: of:N_T_Cnxp,sc16is741*
alias: of:N_T_Cnxp,sc16is740*
alias: i2c:sc16is762
alias: i2c:sc16is760
alias: i2c:sc16is752
alias: i2c:sc16is750
alias: i2c:sc16is741
alias: i2c:sc16is740
alias: i2c:sc16is74x
depends: regmap-i2c
intree: Y
vermagic: 4.4.17-v7+ SMP mod_unload modversions ARMv7

@MasterWuff
Copy link
Author

I'm sorry, I didn't get the file working with SPI. With i2c it works, but to be honest, the commends to controll the chip are missing (like setting bau drate or gpios). I know how to write to the registers with I2C or SPI, but the overlay was too much for my knowledge. Perhaps someone else has more experience and will complete the work and thread in the forum. To spend nearly two weeks on such a small issue is too long.

@pelwell
Copy link
Contributor

pelwell commented Aug 18, 2016

What @DimionDR has spotted is that the config change only enables support for the I2C interface, not the SPI mode, which explains the behaviour you are seeing:

$ grep SC16 .config
CONFIG_SERIAL_SC16IS7XX_CORE=m
CONFIG_SERIAL_SC16IS7XX=m
CONFIG_SERIAL_SC16IS7XX_I2C=y
# CONFIG_SERIAL_SC16IS7XX_SPI is not set

I'll reopen this until SERIAL_SC16IS7XX_SPI is also defined.

@pelwell pelwell reopened this Aug 18, 2016
@MasterWuff
Copy link
Author

Okay, my fault. I will edit the thread in the forum

pelwell pushed a commit that referenced this issue Aug 18, 2016
Previously only the I2C mode was supported.

See: #1594
@pelwell
Copy link
Contributor

pelwell commented Aug 18, 2016

With the SERIAL_SC16IS7XX_SPI option specified, modinfo now includes:

alias:          spi:sc16is7xx
...
depends:        regmap-spi,regmap-i2c

I've merged a patch that adds this option to the standard configurations. It will get picked up by the next kernel build.

popcornmix added a commit to raspberrypi/firmware that referenced this issue Aug 19, 2016
kernel: config: Enable SERIAL_SC16IS7XX_SPI
See: raspberrypi/linux#1594

kernel: Added Overlay for Microchip MCP23S08/17 SPI gpio expanders
See: raspberrypi/linux#1566

kernel: BCM270X_DT: Add audio_pins to CM dtb
kernel: BCM270X_DT: Don't enable UART0 in CM3 dtb

kernel: overlays: Add audremap overlay
kernel: overlays: Add swap_lr and enable_jack to audremap
See: raspberrypi/linux#1473

firmware: Raspi[Still|Vid]Yuv: Add option for just saving luma
See: raspberrypi/userland#170

firmware: RaspiVidYuv: Add option of saving RGB data

firmware: Only change I2C/GPIO pin functions when needed

firmware: platform: Redo the audio remapping logic
See: raspberrypi/linux#1473
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Aug 19, 2016
kernel: config: Enable SERIAL_SC16IS7XX_SPI
See: raspberrypi/linux#1594

kernel: Added Overlay for Microchip MCP23S08/17 SPI gpio expanders
See: raspberrypi/linux#1566

kernel: BCM270X_DT: Add audio_pins to CM dtb
kernel: BCM270X_DT: Don't enable UART0 in CM3 dtb

kernel: overlays: Add audremap overlay
kernel: overlays: Add swap_lr and enable_jack to audremap
See: raspberrypi/linux#1473

firmware: Raspi[Still|Vid]Yuv: Add option for just saving luma
See: raspberrypi/userland#170

firmware: RaspiVidYuv: Add option of saving RGB data

firmware: Only change I2C/GPIO pin functions when needed

firmware: platform: Redo the audio remapping logic
See: raspberrypi/linux#1473
@popcornmix
Copy link
Collaborator

latest rpi-update firmware has this in

popcornmix pushed a commit that referenced this issue Aug 23, 2016
Previously only the I2C mode was supported.

See: #1594
@Ruffio
Copy link

Ruffio commented Aug 29, 2016

@MasterWuff have you tried the new firmware? Feel free to close the issue, if the issue has been fixed.

@MasterWuff
Copy link
Author

Just checked it with SPI - it works

popcornmix pushed a commit that referenced this issue Sep 5, 2016
Previously only the I2C mode was supported.

See: #1594
popcornmix pushed a commit that referenced this issue Sep 7, 2016
Previously only the I2C mode was supported.

See: #1594
grgbr pushed a commit to grgbr/linux-iio that referenced this issue Sep 13, 2016
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
popcornmix pushed a commit that referenced this issue Oct 3, 2016
Previously only the I2C mode was supported.

See: #1594
popcornmix pushed a commit that referenced this issue Oct 9, 2016
Previously only the I2C mode was supported.

See: #1594
popcornmix pushed a commit that referenced this issue Oct 17, 2016
Previously only the I2C mode was supported.

See: #1594
popcornmix pushed a commit that referenced this issue Oct 22, 2016
Previously only the I2C mode was supported.

See: #1594
@paulenuta
Copy link

Hi there,
I try to add a sc16is752-i2c but command dtc -@ -I dts –O dtb –o sc16is752-i2c.dtbo sc16is752-i2c.dts give me Error: missing files. If I load sc16is752-spi1 overlay in /boot/config.txt I have no option to put'it on i2c and is not worling. If I put sc16is750-i2c in /boot/config.txt is working but I only get ttySC0 :(.
Also datasheet said 1843200 crystal.
Please advise.
Thanks,
Paul

@pelwell
Copy link
Contributor

pelwell commented Oct 27, 2016

Please start a topic on the Device Tree forum with your problem - please include full details of what you have tried, and post or link to your overlay file(s).

@paulenuta
Copy link

paulenuta commented Oct 28, 2016

OK I created this new topic https://www.raspberrypi.org/forums/viewtopic.php?p=1059608#p1059608 I was hopping i get some help here, my interest and issues are with existing overlays that have been discussed here, why there is available only overlays for single uart sc16is750 on i2c and dual sc16is752 on spi? There is some config where I can tell that the sc16is752-spi1 overlay will be used on i2c?
Thanks a lot!

@paulenuta
Copy link

paulenuta commented Oct 28, 2016

Problem was solved and I got 2 more UARTs, thanks to PhilE, it was caused by copy/paste and "EN Dash" mixed with "Hyphen-Minus"
https://www.raspberrypi.org/forums/viewtopic.php?p=1059652#p1059652.

@pelwell
Copy link
Contributor

pelwell commented Oct 28, 2016

Cool. Yes, that PhilE can be quite helpful. ;-)

ColinIanKing pushed a commit to ColinIanKing/ubuntu-xenial that referenced this issue Oct 28, 2016
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
angyalp pushed a commit to angyalp/kernel_rpi that referenced this issue Dec 19, 2016
Previously only the I2C mode was supported.

See: raspberrypi#1594
tabp0le pushed a commit to tabp0le/ubuntu_xenial_kernel that referenced this issue Dec 22, 2016
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
Captain-DarkO pushed a commit to Captain-DarkO/kernel_ubuntu-yakkety that referenced this issue Jan 20, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
perfecto-devops pushed a commit to perfecto-devops/ubuntu-xenial that referenced this issue Feb 2, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
Noltari pushed a commit to Noltari/linux that referenced this issue Feb 6, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
artynet pushed a commit to artynet/ubuntu-yakkety-kernel that referenced this issue Feb 15, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
neuschaefer pushed a commit to neuschaefer/raspi-binary-firmware that referenced this issue Feb 27, 2017
kernel: config: Enable SERIAL_SC16IS7XX_SPI
See: raspberrypi/linux#1594

kernel: Added Overlay for Microchip MCP23S08/17 SPI gpio expanders
See: raspberrypi/linux#1566

kernel: BCM270X_DT: Add audio_pins to CM dtb
kernel: BCM270X_DT: Don't enable UART0 in CM3 dtb

kernel: overlays: Add audremap overlay
kernel: overlays: Add swap_lr and enable_jack to audremap
See: raspberrypi/linux#1473

firmware: Raspi[Still|Vid]Yuv: Add option for just saving luma
See: raspberrypi/userland#170

firmware: RaspiVidYuv: Add option of saving RGB data

firmware: Only change I2C/GPIO pin functions when needed

firmware: platform: Redo the audio remapping logic
See: raspberrypi/linux#1473
JackieLiu1 pushed a commit to JackieLiu1/kernel that referenced this issue Mar 23, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
woshihuangzhijie pushed a commit to woshihuangzhijie/linuxcode that referenced this issue Sep 20, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
amichelotti pushed a commit to amichelotti/ubuntu-vme-xenial that referenced this issue Oct 19, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
lianhaidong pushed a commit to lianhaidong/ubuntu-xenial that referenced this issue Nov 6, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
liuqun pushed a commit to liuqun/linux-raspi2 that referenced this issue Dec 14, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
liuqun pushed a commit to liuqun/linux-raspi2 that referenced this issue Dec 20, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
liuqun pushed a commit to liuqun/linux-raspi2 that referenced this issue Dec 20, 2017
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
polceanum pushed a commit to polceanum/ubuntu-xenial that referenced this issue Feb 6, 2018
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
APokorny pushed a commit to ubports/ubuntu_kernel_xenial that referenced this issue Oct 11, 2018
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
hisenyiu2015 pushed a commit to hisenyiu2015/msm-4.14 that referenced this issue May 20, 2021
Previously only the I2C mode was supported.

See: raspberrypi/linux#1594
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants