-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added support to reserve/enable a GPIO pin to be used from pps-gpio module #717
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
Conversation
I think GPIO18 is a bad choice for a B+ board (it collides with I2S used by audio cards). Can you remove pps_gpio_enable, initialise pps_gpio_pin to -1, and use bcm2708.pps_gpio_pin= as the way of enabling this (for any non-negative pin number). |
That's a good idea, no really need for two kernel options. Can I also include change to enable PPS modules in bcmrpi_defconfig? PPS modules add only about 52KB to /lib/modules |
Patch has now been cleaned up, and uses just single new kernel/module option: It shouldn't really change anything until user manually enables desired GPIO pin to be used as PPS source with pps-gpio kernel module. I added info message when this option is used (nothing is printed if option is not specified), so its easier for users to confirm that the option they passed actually took effect (and that the option is supported in kernel that they use):
Also the device ID in the device tree gets populated with the GPIO pin number, making it bit clearer which /dev/ppsX device maps to which PPS source... |
It would be good! |
Can you squash first two commits (git rebase -i HEAD~3 and following instructions, then git push -f). |
…odule (LinuxPPS). Enable PPS modules in default config for RPi.
Everything is now in as single commit. This should make using GPS as PPS source with Raspberry Pi rather easy, when it comes to kernel... |
Added support to reserve/enable a GPIO pin to be used from pps-gpio module
…s-gpio module See: raspberrypi/linux#717 firmware: arm_loader: Add lock to rotated frame updates to avoid an unsafe update from mailbox channel See: #327 firmware: hdmi: Fix for attached flag in hdmi status when booting with cable disconnected See: #326
…s-gpio module See: raspberrypi/linux#717 firmware: arm_loader: Add lock to rotated frame updates to avoid an unsafe update from mailbox channel See: raspberrypi/firmware#327 firmware: hdmi: Fix for attached flag in hdmi status when booting with cable disconnected See: raspberrypi/firmware#326
I am getting a timeout when using ppstest on /dev/pps0 |
It seems gpsd / ntpd can sometimes auto-load pps_ldisc module (that can
If that happens then likely pps_gpio was loaded after pps_ldisc If thats not it, then you may want to check that kernel got the command line parameter (bcm2708.pps_gpio_pin) specifying which GPIO pin to use:
If you don't see message similar to one above, then loading pps_gpio wont work.
Note which ppsX device was assigned, since it might not always be "pps0"... (above assumes that you set pin 18 using command line option to Btw, have you checked the instructions at: http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html#easy |
Oh god... the ribbon cable was dodgy. facepalm |
…s-gpio module See: raspberrypi/linux#717 firmware: arm_loader: Add lock to rotated frame updates to avoid an unsafe update from mailbox channel See: raspberrypi#327 firmware: hdmi: Fix for attached flag in hdmi status when booting with cable disconnected See: raspberrypi#326
rust: add a simple Rust mutex implementation
This change enables use of existing pps-gpio module with Raspberry Pi. This change should be "no-op", as it is disabled by default. It adds two kernel cmdline options:
bcm2708.pps_gpio_enable
bcm2708.pps_gpio_pin
When user wants to use pps-gpio module they need to add "bcm2708.pps_gpio_enable=1" into cmdline.txt, this will enable PPS on GPIO 18. If any other GPIO pin is desired it can be selected using the second option...
After system is booted with this option, pps-gpio module can simply be loaded and it will find the designated GPIO pin as a PPS source:
This change is based on the patch by Hauke Lampe: https://github.com/lampeh/rpi-misc/blob/master/linux-pps/linux-rpi-pps-gpio-bcm2708.diff