How to add custom dts entries

Bernd Walter ticso at cicely7.cicely.de
Sun Nov 4 18:33:01 UTC 2018


On Sat, Nov 03, 2018 at 03:25:38PM -0600, Ian Lepore wrote:
> Add a status = "okay" to the spi node in your patch/overlay.

Makes sense.

So the spigen overlay works fine, once I set fdt_overlays in loader.conf
to use the overlay file.

spi0: <BCM2708/2835 SPI controller> mem 0x7e204000-0x7e204fff irq 25 on simplebus0
spibus0: <OFW SPI bus> on spi0
spibus0: <unknown card> at cs 1 mode 0
spibus0: <unknown card> at cs 0 mode 0
spibus0: <unknown card> at cs 0 mode 0
spibus0: <unknown card> at cs 1 mode 0

With my own overlay I do this to install it:
dtc -I dts -O dtb -o rpi-apa102-matrix.dtbo rpi-apa102-matrix.dts
cp rpi-apa102-matrix.dtbo /boot/dtb/overlays

[77]cicely1> cat rpi-apa102-matrix.dts
/dts-v1/;
/plugin/;

/ {
        compatible = "brcm,bcm2835";
};

/* &spi0 { */
&{/soc/spi at 7e204000} {
        status = "okay";

        apa102led0 {
                compatible = "led,apa102";
                reg = <0>;
                spi-max-frequency = <20000000>;
                status = "okay";
        };
};

&onewire {
        compatible = "w1-gpio";
        gpios = <&gpio 4 1>;
};

Still puzzled with the format.
With &spi0 it didn't work, neither with the current format, which is
copied from the spigen.dts.
Neither spi0 attaches, nor the onewire bus.

Some other, mostly beaglebone related examples use a more complex
setup with overlay_ entries and everything inside the compatible block.

Can I have a device.hints please ;-)

ofwdump shows:
...
    Node 0x20fc: spi at 7e204000
      compatible:
        62 72 63 6d 2c 62 63 6d 32 38 33 35 2d 73 70 69 00 
        'brcm,bcm2835-spi'
...
      status:
        64 69 73 61 62 6c 65 64 00 
        'disabled'
...

Havn't checked ofwdump with the spigen overlay.

-- 
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.


More information about the freebsd-arm mailing list