Bug 218813 - Add method to allow switching kernel level PPS signal from DCD to CTS serial pin
Summary: Add method to allow switching kernel level PPS signal from DCD to CTS serial pin
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Serial (show other bugs)
Hardware: All Linux
: P3 enhancement
Assignee: Russell King
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-06 14:26 UTC by Elvis
Modified: 2024-05-14 03:11 UTC (History)
2 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Elvis 2024-05-06 14:26:59 UTC
BACKGROUND

There are appliances that do not have a full DE9 RS-232 port and only RJ45 COM ports, which do not include the DCD pin required for PPS signal detection.  

RJ45 COM port do include the CTS input pin #8, which can be used for PPS signal detection.  This is a feature that has been available in FreeBSD for some time.  

https://man.freebsd.org/cgi/man.cgi?query=uart

FreeBSD allows switching from DCD to CTS pin on the fly using a system tunable in a loader.conf file.  Example: dev.uart.0.pps_mode="1"

This allow one to connect a serial GPS receiver with PPS output to a RJ45 COM port for a Stratum 0 GPS+PPS source.  

https://github.com/elvisimprsntr/pfsense-ntp-gps?tab=readme-ov-file

KERNAL PATCH HACKS

Some kernel patches have demonstrated receiving PPS on the CTS pin, but requires hacking up the kernel and will will not persist on kernel update to new installations.  

https://github.com/not1337/pps-stuff

FEATURE REQUEST

Add a tunable option to allow the end user to switch between PPS on DCD to CTS pin, similar to the way FreeBSD does.
Comment 1 Bagas Sanjaya 2024-05-08 23:09:15 UTC
(In reply to Elvis from comment #0)
> BACKGROUND
> 
> There are appliances that do not have a full DE9 RS-232 port and only RJ45
> COM ports, which do not include the DCD pin required for PPS signal
> detection.  
> 
> RJ45 COM port do include the CTS input pin #8, which can be used for PPS
> signal detection.  This is a feature that has been available in FreeBSD for
> some time.  
> 
> https://man.freebsd.org/cgi/man.cgi?query=uart
> 
> FreeBSD allows switching from DCD to CTS pin on the fly using a system
> tunable in a loader.conf file.  Example: dev.uart.0.pps_mode="1"
> 
> This allow one to connect a serial GPS receiver with PPS output to a RJ45
> COM port for a Stratum 0 GPS+PPS source.  
> 
> https://github.com/elvisimprsntr/pfsense-ntp-gps?tab=readme-ov-file
> 
> KERNAL PATCH HACKS
> 
> Some kernel patches have demonstrated receiving PPS on the CTS pin, but
> requires hacking up the kernel and will will not persist on kernel update to
> new installations.  
> 
> https://github.com/not1337/pps-stuff
> 
> FEATURE REQUEST
> 
> Add a tunable option to allow the end user to switch between PPS on DCD to
> CTS pin, similar to the way FreeBSD does.

Greg on LKML [1] likes to have patches for this feature request. Can you send them?

Hint: see Documentation/process/submitting-patches.rst in the kernel sources
for how to send patches.

[1]: https://lore.kernel.org/linux-serial/2024050853-basin-salsa-32bb@gregkh/
Comment 2 Elvis 2024-05-14 03:11:15 UTC
(In reply to Bagas Sanjaya from comment #1)
> (In reply to Elvis from comment #0)
> > BACKGROUND
> > 
> > There are appliances that do not have a full DE9 RS-232 port and only RJ45
> > COM ports, which do not include the DCD pin required for PPS signal
> > detection.  
> > 
> > RJ45 COM port do include the CTS input pin #8, which can be used for PPS
> > signal detection.  This is a feature that has been available in FreeBSD for
> > some time.  
> > 
> > https://man.freebsd.org/cgi/man.cgi?query=uart
> > 
> > FreeBSD allows switching from DCD to CTS pin on the fly using a system
> > tunable in a loader.conf file.  Example: dev.uart.0.pps_mode="1"
> > 
> > This allow one to connect a serial GPS receiver with PPS output to a RJ45
> > COM port for a Stratum 0 GPS+PPS source.  
> > 
> > https://github.com/elvisimprsntr/pfsense-ntp-gps?tab=readme-ov-file
> > 
> > KERNAL PATCH HACKS
> > 
> > Some kernel patches have demonstrated receiving PPS on the CTS pin, but
> > requires hacking up the kernel and will will not persist on kernel update
> to
> > new installations.  
> > 
> > https://github.com/not1337/pps-stuff
> > 
> > FEATURE REQUEST
> > 
> > Add a tunable option to allow the end user to switch between PPS on DCD to
> > CTS pin, similar to the way FreeBSD does.
> 
> Greg on LKML [1] likes to have patches for this feature request. Can you
> send them?
> 
> Hint: see Documentation/process/submitting-patches.rst in the kernel sources
> for how to send patches.
> 
> [1]: https://lore.kernel.org/linux-serial/2024050853-basin-salsa-32bb@gregkh/

I linked the hacky kernel patches from another user.  I am not a kernel developer

Note You need to log in before you can comment on or make changes to this bug.