Hi Lee and selsinork, I have gotten PPS working on a BBW A3 with 3.8.13
kernel following your guidance.

I am using the Adafruit Ultimate GPS
breakout<http://www.adafruit.com/products/746>.
I had used UART4 for serial connection to GPS and gpio1_31 (P8#20) for PPS.
This pin is actually not a good choice now (I think it conflicts with emmc
on BBB), but I had made the PCB this before BBB was released. Lee's choice
of 1_29 should be better.

The gpio1_31 should be coded as gpio2_31 in the overlay as selsinork
pointed out. Very confusing indeed.

I had removed assert-rising-edge after seeing
here<https://lkml.org/lkml/2013/6/1/105>that the default is already
for rising edge. Below is my BB-PPSGPIO overlay
source:

/dts-v1/;

/plugin/;

/ {
    compatible = "ti,beaglebone", "ti,beaglebone-black";
    part-number = "BB-PPSGPIO";
    version = "00A0";


    /* state the resources this cape uses */
    exclusive-use =
            /* the pin header uses */
            "P8.20",        /* gpio1_31   */
            /* the hardware ip uses */
            "gpio2_31";


    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            gps_pps_pins: pinmux_gps_pps_pins {
    pinctrl-single,pins = <
    0x84 0x27 /* P8.20 gpio1_31 (63) */
 >;
};
        };
    };

fragment@2 {
 target = <&ocp>;
        __overlay__ {
pps {
 compatible = "pps-gpio";
                status = "okay";
                pinctrl-names = "default";
                pinctrl-0 = <&gps_pps_pins>;
                gpios = <&gpio2 31 0 >;
};
};
};
};


root@beaglebone:/home/debian# cat /sys/devices/bone_capemgr.8/slots
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART4
 6: ff:P-O-L Override Board Name,00A0,Override Manuf,cape-bone-proto
root@beaglebone:/home/debian# echo BB-PPSGPIO >
/sys/devices/bone_capemgr.8/slots
root@beaglebone:/home/debian# cat /sys/devices/bone_capemgr.8/slots
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART4
 6: ff:P-O-L Override Board Name,00A0,Override Manuf,cape-bone-proto
 7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-PPSGPIO

dmsg shows:
[ 1270.098465] bone-capemgr bone_capemgr.8: part_number 'BB-PPSGPIO',
version 'N/A'
[ 1270.098571] bone-capemgr bone_capemgr.8: slot #7: generic override
[ 1270.098596] bone-capemgr bone_capemgr.8: bone: Using override eeprom
data at slot 7
[ 1270.098619] bone-capemgr bone_capemgr.8: slot #7: 'Override Board
Name,00A0,Override Manuf,BB-PPSGPIO'
[ 1270.098760] bone-capemgr bone_capemgr.8: slot #7: Requesting part
number/version based 'BB-PPSGPIO-00A0.dtbo
[ 1270.098784] bone-capemgr bone_capemgr.8: slot #7: Requesting firmware
'BB-PPSGPIO-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 1270.113904] bone-capemgr bone_capemgr.8: slot #7: dtbo
'BB-PPSGPIO-00A0.dtbo' loaded; converting to live tree
[ 1270.114270] bone-capemgr bone_capemgr.8: slot #7: #2 overlays
[ 1270.115369] of_get_named_gpio_flags exited with status 63
[ 1270.118823] pps pps0: new PPS source pps.14.-1
[ 1270.118993] pps pps0: Registered IRQ 207 as PPS source
[ 1270.119105] bone-capemgr bone_capemgr.8: slot #7: Applied #2 overlays.

And now we have the captured PPS assert events, showing the count changes
by one every second:

debian@beaglebone:~$ date; cat /sys/class/pps/pps0/assert
Fri Jan 31 18:31:40 UTC 2014
1391193100.002460136#133
debian@beaglebone:~$ date; cat /sys/class/pps/pps0/assert
Fri Jan 31 18:31:41 UTC 2014
1391193101.002453270#134
debian@beaglebone:~$ date; cat /sys/class/pps/pps0/assert
Fri Jan 31 18:31:42 UTC 2014
1391193102.002467910#135

Robert Nelson's 3.8.13 kernels in the recent test images already have
pps-gpio client enabled. It works just fine with this overlay. I could not
read the NMEA sentences on UART4 using BB-UART4 overlay though. I will try
Lee's overlay for UART4.

Thanks!

George



On Fri, Jan 31, 2014 at 6:57 AM, Lee Armstrong <[email protected]> wrote:

> You were right the first time, thank you!
>
> It is very confusing isn't it!
>
>
>
> On 30 January 2014 at 14:34:07, [email protected] 
> ([email protected]<//[email protected]>)
> wrote:
>
> On 29/01/14 21:29, Lee Armstrong wrote:
> > However isn't it actually pin 31?
> >
> > pin 31 (44e1087c) 00000027 pinctrl-single
>
> that's pin 31 in the pinmux table, it's not a simple relationship from
> pinmux number to gpio number
>
> on my kernel there's 141 items in that list, but there are only 118 gpios.
> gpios0,1&2 have 32 pins, gpio 3 only has 22... according to the datasheet
> anyway...
>
> If you look in the kernel source.. arch/arm/mach-omap2/mux34xx.c seems to
> contain the mapping, although I can't say I understand how to read it
>
> > I'm still not getting a PPS input there but am wondering now if the GPS
> needs a fix before it even outputs one at all.
>
> Probably, most gps modules I've encountered only output pps after you get
> a fix, the EM406A I'm using is like that. Depends on the module, but you
> may be able to check with an LED attached to the pps output. My EM406A has
> a 1uS pps pulse width, so you need a scope to see that.
>
>  --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to