NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NetBSD as an NTP stratum 1 server



joelp%sdf.org@localhost writes:

>>> Greg Troxel <gdt%lexort.com@localhost> writes:
>>>
>>>> Brad Spencer <brad%anduin.eldar.org@localhost> writes:
>>>>
>>>> (The advice about "use gpio" is good - I am just trying to clarify USB
>>>> PPS.)
>>>
>>> It has worked very well for me, assuming that the GPS module is stable.
>>> I had one that would have a tendency to crash in its firmware after
>>> being up for a while and totally lose its mind.
>>>
>>
>> Thanks for the detailed information and discussion.
>>
>> I built a kernel for my Rock64 on its bigger sibling RockPro64 (has a PCIe
>> SSD card) -- sorry, okay, that was me just saying how much I enjoy these 2
>> devices! Anyway...I ran into a problem initializing gpiopps. Here is the
>> Rock64 output when initializing with gpio.conf:
>>     [1.000004] gpiopps0 at gpio1 pins 28
>>     [1.000004] gpiopps0: autoconfiguration error: positive edge interrupt
>> not supported for ASSERT
>> I also booted single user and it fails using gpioctl. Taking a peek at
>> src/sys/dev/gpio/gpiopps.c this would be in the second if-block (1 pin) in
>> gpiopps_attach:
>>         if (!gpio_intr_str(sc->sc_gpio, &sc->sc_map, 0,
>>                    sc->sc_intrs[0].sc_irqmode,
>>                    sc->sc_intrs[0].sc_intrstr,
>>                    sizeof(sc->sc_intrs[0].sc_intrstr))) {
>>             aprint_error_dev(self,
>>                 "failed to decode interrupt\n");
>>             gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
>>             return;
>> Here's what I added to evbarm/conf/GENERIC64:
>>     gpiopps* at gpio1 offset 28 mask 0x1 flag 0x2
>> This is for physical pin 7 which per pine64 wiki is GPIO1_D4. So gpio1 and
>> D=3, so 3*8 + 4 = port 28.
>>
>> I tried also modifying the RockPro64 kernel -- similar issue.
>>
>> Any idea what am I doing wrong?
>>
>> Thanks - Joel
>>
>>
> And sorry, wrong code block from gpiopps.c:
>         } else {
>             aprint_error_dev(sc->sc_dev,
>                 "%s edge interrupt not supported for ASSERT\n",
>                 assert_edge == GPIO_INTR_POS_EDGE ? "positive"
>                                       : "negative");
>             gpio_pin_unmap(sc->sc_gpio, &sc->sc_map);
>             return;
>         }

A followup to myself....

Looking at rk_gpio.c it appears that interrupts are not supported for
the Rock64 systems in the NetBSD driver for the Rockchip.  However, the
technical reference manual for the RK3328 and RK3399 suggest that those
two variants support interrupts on the GPIO pins, so it might just be a
matter of software.  The rest of the variants might also have support I
just didn't look.  I don't have this particular SOC system, so will be
of little help, but a quick read of the TRM suggests that it isn't
largely different from how the Broadcom (RPI family) GPIO interrupts
work and it wasn't that hard to add GPIO interrupt support for Broadcom
when I did that years ago.

So for right now, it looks like you may be out of luck for ntpd PPS use
on a Rock64 system (except for the USB DCD support which would work if
the GPS chip supports it).






-- 
Brad Spencer - brad%anduin.eldar.org@localhost - KC8VKS - http://anduin.eldar.org



Home | Main Index | Thread Index | Old Index