Git Product home page Git Product logo

pps-gen-gpio's Introduction

pps-gen-gpio

Linux kernel PPS generator using GPIO pins.

In kernel 5.4 there is no support for using a GPIO pin as a PPS generator, only a GPIO PPS client is available. This driver is derived from the current parallel port PPS generator and provides a PPS signal through a GPIO pin specified in the device tree. The PPS signal is synchronized to the tv_sec increment of the wall clock.

We have tested the driver with kernel 5.4.152 on a Beaglebone Black where P9 pin 16 (GPIO1_19) is used as PPS output. The corresponding modified device tree file is here shown.

Usage

If you use a Beaglebone Black and want to change the PPS output pin, you have to modify your device tree file (am335x-boneblack.dts) accordingly:

  • Make sure you have the right pin multiplexing setting:

      pps_gen_pins: pinmux_pps_gen_pins {
      	pinctrl-single,pins = <
      		0x4C (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a3.gpio1_19 */
    

Check the BBB System Reference Manual and the am335x Technical Reference Manual to find out the correct pinmux table offset of the chosen pin.

  • The pps-gen-gpios property defines the pin you want to use as a PPS output:

      pps-gen {
      		pinctrl-names = "default";
      		pinctrl-0 = <&pps_gen_pins>;
      		compatible = "pps-gen-gpio";
      		pps-gen-gpio = <&gpio1 19 GPIO_ACTIVE_HIGH>;
      		default-state = "off";
    

Please note that in order to use the module with any other board using the device tree infrastructure, the following matching definitions are required in the device tree:

	pps-gen               node defined for the PPS GPIO
	pps-gen-gpio          value of ".compatible" property in pps-gen node
	pps-gen-gpio          property in pps-gen node that defines which GPIO pin is used

After modifying the device tree, add the files into drivers/pps/generators and configure the driver to be built as a module. You need to enable PPS support in the kernel.

pps-gen-gpio's People

Contributors

damon-kwok avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

nohpei notagnelf

pps-gen-gpio's Issues

Installation Guidance

Could you help with more verbose installation guidance for this module, as i have attempted this and gotten various different errors. I am stuck at "There should be exactly one pps-gen GPIO defined in DT" error when loading my kernel module (This is from dmesg, no pps is generated").

What version of the kernel are you using on your bbb?
What edits do you do to the uEnv.txt file?
Are you using bb.org-overlays for your DTS / DTBO file.
On your beagle, do you have the command "show-pins?, what does it say for your p9_16 pin?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.