PPS-GPIO
#1
Question 
Hello Forum,

i want to set up a stratum 1 server on the pine, with the Adafruit GPS-Board. On the Pi it's no problem, because i don't need to make big changes.

What I have done so far on pine:
Code:
$ git clone --depth 1 --single-branch -b pine64-hacks-1.2 https://github.com/longsleep/linux-pine64
$ curl -sSL https://github.com/longsleep/build-pine64-image/raw/master/blobs/pine64.dts > linux-pine64/arch/arm64/boot/dts/sun50i-a64-pine64-plus.dts
$ make menuconfig

The pps-part in the config looks like this:
Code:
#
# PPS support
#
CONFIG_PPS=m
CONFIG_PPS_DEBUG=y

#
# PPS clients support
#
CONFIG_PPS_CLIENT_KTIMER=m
CONFIG_PPS_CLIENT_LDISC=m
CONFIG_PPS_CLIENT_PARPORT=m
CONFIG_PPS_CLIENT_GPIO=m

#
# PPS generators support
#
After build dmesg shows:

Code:
# dmesg | grep pps
[   14.067625] pps_core: LinuxPPS API ver. 1 registered
[   14.092242] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>

But where the pin is defined?
The pps-source is connected to Pin 18 on the board.
That's all what I have found:
https://www.kernel.org/doc/Documentation...s-gpio.txt
https://dev.openwrt.org/browser/trunk/ta...?rev=44392

For me that sounds like rocket science. :/

Could somebody "take me by the hand" please, and tell me what is the next step?



(And please, excuse my bad english.)
  Reply
#2
Sebastian,
To make it work I believe there are changes needed to the DTS.
If you look at the procedure for Raspberry Pi you have to used so called "overlays". As far as I know current U-Boot does not support such mechanism, so it will require the changes to main DT file.
I was looking into using Pine as ntp server (better time resolution on 64bit system), unfortunately work is getting in the way Smile
  Reply
#3
(06-30-2016, 10:43 AM)janjwerner Wrote: As far as I know current U-Boot does not support such mechanism, so it will require the changes to main DT file.
I was looking into using Pine as ntp server (better time resolution on 64bit system), unfortunately work is getting in the way Smile
A NTP-Server was my Idea too. Smile
And i read about the DT-Files but i have no Idea where to start.
I opened the pine64.dts but as i said, it looks like rocket science for me. Maybe someone could take care of our little Problem. Smile
  Reply
#4
(06-30-2016, 11:50 AM)Sebastian Wrote:
(06-30-2016, 10:43 AM)janjwerner Wrote: As far as I know current U-Boot does not support such mechanism, so it will require the changes to main DT file.
I was looking into using Pine as ntp server (better time resolution on 64bit system), unfortunately work is getting in the way Smile
A NTP-Server was my Idea too. Smile
And i read about the DT-Files but i have no Idea where to start.
I opened the pine64.dts but as i said, it looks like rocket science for me. Maybe someone could take care of our little Problem. Smile

Any progress with this project?
  Reply
#5
Nope, not yet. :/
I have no idea what i need to do with the dts file(s).
  Reply
#6
(07-06-2016, 11:29 PM)Sebastian Wrote: Nope, not yet. :/
I have no idea what i need to do with the dts file(s).

Are we discussing device tree ?

There should be stuff on-line about it... between the on-line stuff, and a cross with the Raspberry PI, we ought to be able to figure this out...

marcus
  Reply
#7
Hi Marcus,

i have read a lot about it but i don't understand the half...
I know how to enable pps in the Kernel, but i have no idea how to define the Pin PC8 as the pps source in the device-tree.
For the Odroid C1+ its

pps {
compatible = "pps-gpio";
gpios = "GPIOY_3";
};

Any tips?
  Reply
#8
You first need to define the pin in pinctrl section, probably after [email protected] :


Code:
                       [email protected] {
                               linux,phandle = <0xba>;
                               phandle = <0xba>;
                               allwinner,pins = "PC8";
                               allwinner,function = "gpio_in";
                               allwinner,pname = "pps_gpio";
                               allwinner,muxsel = <0x0>;
                               allwinner,pull = <0x1>;
                               allwinner,drive = <0x0>;
                               allwinner,data = <0xffffffff>;
                       };

Then, you declare the device (again after [email protected]) :

Code:
               [email protected] {
                       compatible = "pps-gpio";
                       gpios = <0x30 0x2 0x8 0x0 0x0 0x0 0x0>;
                       pinctrl-names = "default";
                       pinctrl-0 = <0xba>;
                       status = "okay";
               };

Then, recompile the dtb (always keep a backup of the original)
  Reply
#9
(07-07-2016, 03:25 PM)martinayotte Wrote: You first need to define the pin in pinctrl section, probably after [email protected] :


Code:
                       [email protected] {
                               linux,phandle = <0xba>;
                               phandle = <0xba>;
                               allwinner,pins = "PC8";
                               allwinner,function = "gpio_in";
                               allwinner,pname = "pps_gpio";
                               allwinner,muxsel = <0x0>;
                               allwinner,pull = <0x1>;
                               allwinner,drive = <0x0>;
                               allwinner,data = <0xffffffff>;
                       };

Then, you declare the device (again after [email protected]) :

Code:
               [email protected] {
                       compatible = "pps-gpio";
                       gpio = <0x30 0x2 0x8 0x0>;
                       pinctrl-names = "default";
                       pinctrl-0 = <0xba>;
                       status = "okay";
               };

Then, recompile the dtb (always keep a backup of the original)

thx. Smile  i'll give it a try after the wedding... maybe tomorrow.
  Reply
#10
(07-07-2016, 10:46 PM)Sebastian Wrote:
(07-07-2016, 03:25 PM)martinayotte Wrote: You first need to define the pin in pinctrl section, probably after [email protected] :


Code:
                       [email protected] {
                               linux,phandle = <0xba>;
                               phandle = <0xba>;
                               allwinner,pins = "PC8";
                               allwinner,function = "gpio_in";
                               allwinner,pname = "pps_gpio";
                               allwinner,muxsel = <0x0>;
                               allwinner,pull = <0x1>;
                               allwinner,drive = <0x0>;
                               allwinner,data = <0xffffffff>;
                       };

Then, you declare the device (again after [email protected]) :

Code:
               [email protected] {
                       compatible = "pps-gpio";
                       gpio = <0x30 0x2 0x8 0x0>;
                       pinctrl-names = "default";
                       pinctrl-0 = <0xba>;
                       status = "okay";
               };

Then, recompile the dtb (always keep a backup of the original)

thx. Smile  i'll give it a try after the wedding... maybe tomorrow.

Congratulation on the wedding.
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  GPIO specifications in device tree ramstadt 1 210 01-16-2019, 03:17 PM
Last Post: ramstadt
  Low-Level-GPIO-Access Thoams131 2 598 01-11-2017, 02:54 PM
Last Post: Thoams131
  C#.NET / Mono GPIO library? abutler77 0 1,057 06-12-2016, 10:34 PM
Last Post: abutler77
  Lazarus and GPIO gbestwick 0 546 05-22-2016, 08:51 PM
Last Post: gbestwick
  GPIO javascript library. neeeds 1 796 02-19-2016, 11:31 PM
Last Post: limitlesscodes
  Questions about GPIO igna09 11 3,521 02-17-2016, 03:51 PM
Last Post: limitlesscodes

Forum Jump:


Users browsing this thread: 1 Guest(s)