Date: Sat, 03 Nov 2018 14:46:30 -0600 From: Ian Lepore <ian@freebsd.org> To: ticso@cicely.de, freebsd-arm@freebsd.org Cc: Bernd Walter <ticso@cicely7.cicely.de> Subject: Re: How to add custom dts entries Message-ID: <1541277990.52306.4.camel@freebsd.org> In-Reply-To: <20181103200709.GB79858@cicely7.cicely.de> References: <20181103200709.GB79858@cicely7.cicely.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2018-11-03 at 21:07 +0100, Bernd Walter wrote: > For a raspberry (1B modell) I have the following patches: > [92]cicely7> cat rpi.ds18b20.dts.patch > Index: boot/fdt/dts/arm/rpi.dts > =================================================================== > --- boot/fdt/dts/arm/rpi.dts (revision 303469) > +++ boot/fdt/dts/arm/rpi.dts (working copy) > @@ -340,6 +348,11 @@ > }; > }; > > + onewire { > + compatible = "w1-gpio"; > + gpios = <&gpio 4 1>; > + }; > + > power: regulator { > compatible = "broadcom,bcm2835-power-mgr", > "broadcom,bcm2708-power-mgr", > [93]cicely7> cat rpi.apa102.dts.patch > Index: boot/fdt/dts/arm/rpi.dts > =================================================================== > --- boot/fdt/dts/arm/rpi.dts (revision 303469) > +++ boot/fdt/dts/arm/rpi.dts (working copy) > @@ -292,6 +292,14 @@ > broadcom,function = "ALT3"; > }; > }; > + > + spi0 { > + apa102led0 { > + compatible = "led,apa102"; > + spi-chipselect = <0>; > + }; > + }; > + > usb { > hub { > compatible = "usb,hub", "usb,device"; > > And to install > cd /usr/src/sys/modules/dtb/rpi > make all install > > Obviously a few things have changed since then. > We don't have overlay support yet, don't we? > > System is: > # uname -a > FreeBSD rpi-b 12.0-BETA3 FreeBSD 12.0-BETA3 r340039 RPI-B arm > /usr/src is populated and my kernel driver itself build fine: > # ls -la /boot/modules/ > total 20 > drwxr-xr-x 2 root wheel 512 Nov 3 20:54 . > drwxr-xr-x 10 root wheel 1024 Nov 3 20:54 .. > -r-xr-xr-x 1 root wheel 7080 Nov 3 20:54 apa102.ko > -rw-r--r-- 1 root wheel 36 Nov 3 20:54 linker.hints > We do have overlay support now. I don't know much about using it, hopefully those who do will reply with details. There have also been updates to the SPI world. Your apa102led0 fdt node now requires a "spi-max-frequency" property, the value is the bus speed to use when communicating with that device, in Hz (different devices on the same bus can now have different speeds, and there is no concept of a default speed). Also, the chipsel number should be in a reg= property, but we still support spi-chipselect= too for backwards compatibility. -- Ian
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1541277990.52306.4.camel>