Date: Mon, 24 Jun 2019 16:45:12 +0200 From: Milan Obuch <milan@obuch.sk> To: Kaya Saman <kayasaman@optiplex-networks.com> Cc: freebsd-arm@freebsd.org Subject: Re: Pine64-LTS and UART ports Message-ID: <20190624164512.0ea5c4d3@zeta.dino.sk> In-Reply-To: <62ba1a30-25bc-af65-beb2-0e05dfc76c79@optiplex-networks.com> References: <371fe0f0-9f91-e4ba-ff4e-8338fe9d63de@optiplex-networks.com> <20190623235732.4439b707@zeta.dino.sk> <ae92ac02-ce53-18fe-9eab-8b17e8d52cd2@optiplex-networks.com> <20190624133017.5a9689b7@zeta.dino.sk> <62ba1a30-25bc-af65-beb2-0e05dfc76c79@optiplex-networks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 24 Jun 2019 15:34:43 +0100 Kaya Saman <kayasaman@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190624164512.0ea5c4d3>