Pine64-LTS and UART ports

Milan Obuch milan at obuch.sk
Mon Jun 24 14:45:17 UTC 2019


On Mon, 24 Jun 2019 15:34:43 +0100
Kaya Saman <kayasaman at optiplex-networks.com> wrote:

> On 6/24/19 12:30 PM, Milan Obuch wrote:

[ snip ]

> > In order to create an overlay, I found simple way to do it using
> > antrastructure already presented in out source tree...
> >
> > First, you need to create overlay source file. Other overlays for
> > arm64 devices are located in /usr/src/sys/dts/arm64/overlays
> > directory, so I put sun50i-a64-uart2.dtso file there too. See
> > attachment - all it does is just enabling uart2. Everything else is
> > already present in dtb.
> >
> > Then you need compile this overlay. You could invoke dtc manually,
> > it is not hard, but easier is using infrastructure - I just did
> >
> > cd /usr/src/sys/dts/arm64/overlays
> > make
> >
> > and all overlays are created. Observe the output messages.
> >
> > Now you need to install overlay for uart2.
> >
> > cp /tmp/sun50i-a64-uart2.dtbo /boot/dtb/overlays/
> >
> > I compared files in /tmp and /boot/dtb/overlays directories just to
> > be sure I am not far off, all corresponding files were the same
> > size.
> >
> > Last step, activate this overlay. In /boot/loader.conf, change line
> >
> > fdt_overlays="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp"
> >
> > to
> >
> > fdt_overlays="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer,sun50i-a64-opp,sun50i-a64-uart2"
> >
> > That's it. Now reboot. You should see
> >
> > applying DTB overlay '/boot/dtb/overlays/sun50i-a64-uart2.dtbo'
> >
> > message on the very start of boot process, and later
> >
> > uart1: <16750 or compatible> mem 0x1c28800-0x1c28bff irq 33 on
> > simplebus0 uart1: fast interrupt
> > uart1: PPS capture mode: DCD
> >

[ snip ]

> 
> The default Makefile has this in it:
> 
> 
> # $FreeBSD: releng/12.0/sys/dts/arm64/overlays/Makefile 338294 
> 2018-08-24 15:00:36Z manu $
> 
> DTSO!=ls *.dtso
> 
> all: test-dtso
> 
> .include <bsd.init.mk>
> 
> 
> If I try compiling it I get an error:
> 
> 
> :/usr/src/sys/dts/arm64/overlays # make
> ls: *.dtso: No such file or directory
> make: "/usr/src/sys/dts/arm64/overlays/Makefile" line 3: warning: "ls 
> *.dtso" returned non-zero status
> make: don't know how to make test-dtso. Stop
> 
> make: stopped in /usr/src/sys/dts/arm64/overlays
> 
> 
> I have tried changing a few things in the Makefile but nothing has 
> helped to be able to compile the Overlays??
> 

Well, I tested it on 13-CURRENT, so there could be some differences...
anyway, there is a helper script you could invoke directly, again,
tested on 13-CURRENT:

/usr/src/sys/tools/fdt/make_dtbo.sh /usr/src/sys /usr/src/sys/dts/arm64/overlays/sun50i-a64-uart2.dtso /tmp

Hope this helps.

Milan


More information about the freebsd-arm mailing list