Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2017 22:27:30 -0800
From:      "Tony Hain" <tony@tndh.net>
To:        "'Ian Lepore'" <ian@freebsd.org>, <freebsd-arm@freebsd.org>
Subject:   RE: BBB uarts & pps dts definitions
Message-ID:  <03bb01d2779d$45d6edd0$d184c970$@tndh.net>
In-Reply-To: <1485400906.30533.54.camel@freebsd.org>
References:  <03a801d2776e$cae997e0$60bcc7a0$@tndh.net> <1485400906.30533.54.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Ian Lepore wrote:

Thanks for the quick reply. Sorry I should have been clear about which
build.
FreeBSD 11.0-STABLE #0 r310359: Wed Dec 21 16:47:56 UTC 2016

I commented out the phandle lines, and uart1 is working.

>=20
> When I first read this I figured some change over the past few months =
must
> have broken the driver. =A0But I just built a fresh world and kernel =
for
> beaglebone and fired up my BB and hooked a PPS signal to P8-7 and it =
all
still
> works fine.
>=20
> You don't need to do anything with the dts, the dmtpps driver will
> reconfigure the pin to be a PPS input, overriding whatever the FDT =
data
> might have set up. =A0All you need to do is set a couple lines in
> /boot/loader.conf:
>=20
> =A0 hw.am335x_dmtpps.input=3D"P8-7"
> =A0 am335x_dmtpps_load=3DYES

I had done that:
# cat /boot/loader.conf
am335x_dmtpps_load=3D"YES"
hw.am335x_dmtpps.input=3D"P8-7"

does order matter? The device showed up:
# ls -l /dev|grep dmtpps
crw-------  1 root  wheel     0x35 Jan 25 20:13 dmtpps
lrwxr-xr-x  1 root  wheel        6 Jan 25 20:13 pps0 -> dmtpps

# dmesg|grep pps
am335x_dmtpps0: <AM335x PPS-Capture DMTimer4> mem 0x48044000-0x480443ff =
irq
30 on simplebus0
=20
>=20
> You can even do it all interactively without any config, even just =
booting
from
> a downloaded weekly snapshot, then do this:
>=20
> =A0=A0kenv hw.am335x_dmtpps.input=3D"p8-7"
> =A0 kldload am335x_dmtpps
>=20
> You should see something like this (some of this is extra bootverbose
output,
> so you may not see all these lines)...
>=20
> =A0=A0root@bb:~ # kldload am335x_dmtpps
> =A0 ti_pinmux0: setting internal 2a for timer4
> =A0 am335x_dmtpps: configured pin p8-7 as input for timer4
> =A0 am335x_dmtpps0: <AM335x PPS-Capture DMTimer4> mem 0x48044000-
>        0x480443ff irq 30 on simplebus0
> =A0 Timecounter "DMTimer4" frequency 24000000 Hz quality 1000
> =A0 am335x_dmtpps0: Using DMTimer4 for PPS device /dev/dmtpps
>=20
> If you have full source code on the BB, do:

Didn't really want to put full source on the BBB.=20

>=20
> =A0=A0cd /usr/src/tools/test/ppsapi
> =A0 make ppsapitest

I had full source on a 10.1 system, so I copied the files in that =
directory
and tried to make, but it is complaining about the last line needing an
operator.

make: "src/ppsapitest/Makefile" line 13: Need an operator
make: Fatal errors encountered -- cannot continue
make: stopped in src/ppsapitest


# $FreeBSD: releng/10.1/tools/test/ppsapi/Makefile 264485 2014-04-15
02:17:46Z gnn $

PROG=3D   ppsapitest
MK_MAN=3Dno

WARNS?=3D 5

.include <bsd.prog.mk>

CFLAGS+=3D-Wno-format-security

test:   ${PROG}
        ./${PROG} /dev/cuau0



Even when it gets built though, the scope shows that the signal is being
pulled to ground as soon as the wire is connected to P8-7, so I don't =
expect
it to work. Is there a way to check the state of the gpio? I would =
expect
something like
# gpioctl -N gpio_66
Can't find pin named "gpio_66"

# gpioctl -l
pin 00: 0       gpio_0<>
pin 01: 0       gpio_1<>
...
pin 30: 1       gpio_30<IN,PU>
pin 31: 1       gpio_31<IN,PU>
#

How do the 3 additional pinmux controllers get enabled?


> =A0 ./ppsapitest /dev/dmtpps
>=20
> You should get something like:
>=20
> =A0 1485400775 .009578536 204 0 .000000000 0
> =A0 1485400776 .009621995 205 0 .000000000 0
> =A0 1485400777 .009665453 206 0 .000000000 0
> =A0 1485400778 .009708869 207 0 .000000000 0
>=20
> -- Ian






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?03bb01d2779d$45d6edd0$d184c970$>