[beagleboard] NTP PPS Support

I have done this in kernel 3.2 (using Robert Nelson’s ubuntu). I have not ventured into 3.8 yet. Depending on the specific GPS you use, you may need level converter from 5V to 3.3V, and/or invert the logic on GPS’s TX output so that you could read the NMEA sentences correctly through one of the uart ports on beaglebone.

The key to PPS is to register a GPIO pin for the PPS-GPIO kernel driver. in 3.2 kernel menuconfig, enable drivers > PPS and PPS-GPIO. Then edit the board support package (for beaglebone it is /arch/arm/mach-omap2/board-am335xevm.c) to register the gpio pin that will be used for PPS. I only capture the rising edge of PPS. If you want the falling edge as well, you need to indicate that in pps_gpio_info declaration. I had used gpio1_31 for PPS input.

add around line 40:
#include <linux/pps-gpio.h>

add
/* PPS-GPIO platform data */
static struct pinmux_config pps_pin_mux[] = {
    {"gpmc_csn2.gpio1_31", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
    {NULL, 0},
};

static struct pps_gpio_platform_data pps_gpio_info = {
        .assert_falling_edge = false,
        .capture_clear= false,
        .gpio_pin=63,
        .gpio_label="PPS",
};

static struct platform_device pps_gpio_device = {
        .name = "pps-gpio",
        .id = -1,
        .dev = {
                .platform_data = &pps_gpio_info
        },
};

static void pps_init(int evm_id, int profile)
{
        int err;
        setup_pin_mux(pps_pin_mux);
        err = platform_device_register(&pps_gpio_device);
        if (err) {
                pr_warning("Could not register PPS_GPIO device");
        }
}

add the pps_init line
/* Beaglebone Rev A3 and after */
static struct evm_dev_cfg beaglebone_dev_cfg[] = {
        {tps65217_init, DEV_ON_BASEBOARD, PROFILE_NONE},
        {mii1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
        {usb0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
        {usb1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
        {i2c2_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
        {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
        {pps_init,      DEV_ON_BASEBOARD, PROFILE_NONE},
        {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
        {NULL, 0, 0},
};

You are very welcome.

I think it will work fine with Debian on beaglebone with the right pinmux for the uart port you use.

You could consider the GPS breakout from Adafruit which is already on 3.3V logic and the NMEA output does not need inversion. You won’t even need the MAX232. Its power consumption is lower than 18LVC, and the PPS is 10ns (vs 1us) jitter.