Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: DS1307 on NetBSD 9 RPI2 and RPI3



mlelstv%serpens.de@localhost (Michael van Elst) writes:

> brad%anduin.eldar.org@localhost (Brad Spencer) writes:
>
>>In the past, I would put the following in a config file and build a
>>kernel:
>
>>dsrtc* at iic2 addr 0x68 flags 1307
>
> Platforms that switched to FDT don't probe such hardware anymore or
> use the addr or flags attributes. Instead, they require such
> things to be configured in the DTB.
>
> -- 


Yes, I have kind of gathered that this is the case at this point... but
how does one do that.  I followed a mail thread on port-arm back in 2018
with Jason T. and others on this topic and tried the following:

// #include <dt-bindings/pinctrl/bcm2835.h>
// #include <dt-bindings/gpio/gpio.h>
// #include <dt-bindings/input/linux-event-codes.h>

/dts-v1/;
/plugin/;
/ {
        compatible = "raspberrypi,2-model-b", "brcm,bcm2836";

        fragment@0 {
                target-path = "/soc/i2c@7e805000";

                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;

                        rtc@68 {
                                compatible = "dallas,ds1307";
                                reg = <0x68>;
                        };
                };
        };
};


I also tried "target = <&i2c2>" .. compiled it up with "dtc -I dts -O
dtb -o ds1307.dtbo ds1307.dts" and placed it in /boot/overlays.  The
config.txt file was adjusted to add "dtoverlay=ds1307.dtbo" ..  with
this, a device node is created:

(outout of ofctl)
[Caching 117 nodes and 822 properties]
.
.
.
00002e2c:     /i2c@7e804000
00002f28:     /i2c@7e805000
00002fec:       /rtc@68
.
.

However, on boot, no matter how the target or target-path is specified
the rtc device is probed on the wrong i2c bus:

[     1.000003] bsciic0 at simplebus1: Broadcom Serial Controller
[     1.000003] iic0 at bsciic0: I2C bus
[     1.000003] rtc at iic0 addr 0x68 not configured
The above is not where the ds1307 is... it should be iic2

[     1.000003] bsciic2 at simplebus1: Broadcom Serial Controller
[     1.000003] iic2 at bsciic2: I2C bus
Probably should be here...

[     1.000003] /soc/vec@7e806000 at simplebus1 not configured
[     1.000003] /soc/hdmi@7e902000 at simplebus1 not configured




Any ideas ???  I am using the stock dtb files from NetBSD 9 for the
RPI.




-- 
Brad Spencer - brad%anduin.eldar.org@localhost - KC8VKS - http://anduin.eldar.org


Home | Main Index | Thread Index | Old Index