Date: Wed, 21 Nov 2018 13:09:09 -0800 From: Oleksandr Tymoshenko <gonzo@bluezbox.com> To: Stefan Parvu <sparvu@kronometrix.org> Cc: Ian Lepore <ian@freebsd.org>, freebsd-arm@freebsd.org Subject: Re: FreeBSD 12.0 RBPI3B+ and hardware clock support Message-ID: <20181121210909.GA1580@bluezbox.com> In-Reply-To: <370FE06A-C2F8-4294-8DD1-F2EF76E63B94@kronometrix.org> References: <70D1E906-D92A-4413-9327-DE1779E479E8@kronometrix.org> <1542825813.56571.77.camel@freebsd.org> <88AEE740-A64E-4F54-9A43-02DB605CFA2D@kronometrix.org> <1542832617.56571.81.camel@freebsd.org> <FF758714-F388-46FB-96C7-22FE58D1BE86@kronometrix.org> <1542833504.56571.87.camel@freebsd.org> <370FE06A-C2F8-4294-8DD1-F2EF76E63B94@kronometrix.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Stefan Parvu (sparvu@kronometrix.org) wrote: > > > > On 21 Nov 2018, at 22.51, Ian Lepore <ian@freebsd.org> wrote: > > > > On Wed, 2018-11-21 at 22:42 +0200, Stefan Parvu wrote: > >>> > >>> Oddly enough, the ds1307 driver supports that chip. I think it's > >>> because the register set on the two chips is identical (or close > >>> enough > >>> to work right). > >> uauu. nice one. > >> > >> how on earth i can enable ds1307 - no need to rebuild anything > >> right ? Can I load the driver , if yes how ? > >> > >> > >> Stefan > > > > You can load it interactively with "kldload ds1307". Add > > ds1307_load=YES to /boot/loader.conf to load it every time you boot. > > done. cheers. > > root@k50:~ # kldstat > Id Refs Address Size Name > 1 17 0xffff000000000000 13ca6f0 kernel > 2 1 0xffff0000013cb000 41730 mac_portacl.ko > 3 1 0xffff000053600000 41000 tmpfs.ko > 4 1 0xffff000053641000 41000 uftdi.ko > 5 1 0xffff000053682000 41000 ucom.ko > 6 1 0xffff0000536c3000 31000 mac_ntpd.ko > 7 1 0xffff0000536f4000 41000 ds1307.ko > > > But without modified FDT data, just loading the driver won't make it > > attach to the hardware. > > The new way to do all that is to code an overlay that enables the bus > > and adds the device, then set a loader.conf variable to make that > > overlay get loaded. But I don't know the details of how to do that, > > hopefully one of the folks who does know more about overlays can reply > > with that info. > > okay, I see. Lets hope somebody which can help on this might answer. With Raspberry Pi there are two ways to apply overlays: at the frimware stage or at FreeBSD's loader stage. There seems to be official overlay for i2c RTC clocks [1] that can be used with the firmware stage To enalbe it try following steps: - Download i2c-rtc.dtbo and copy it to "overlays/" directory on FAT partition - Edit config.txt on FAT partition and add following line: dtoverlay=i2c-rtc,mcp7941x - Reboot RPi and check whether overlay is applied: sysctl -b hw.fdt.dtb | dtc -I dtb -O dts | grep mcp7941x If this doesn't work I'll write up on how to build and enable dtbo for the loader. [1] https://github.com/raspberrypi/firmware/blob/master/boot/overlays/i2c-rtc.dtbo -- gonzo
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181121210909.GA1580>