PINE64

Full Version: PPS-GPIO
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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.)
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
(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
(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?
Nope, not yet. :/
I have no idea what i need to do with the dts file(s).
(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
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?
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)
(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.
(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.
Pages: 1 2