Quantcast
Viewing all articles
Browse latest Browse all 5402

Device Tree • Re: failure to apply dt overlay for a gpio from I2C gpio expander

Thank you for your reply.

Yes, that's the reason. I tried to create a GPIO node in the overlay and it works.

But when I try to export the label, it seems not working.

I tried this way:

Code:

        fragment@0 {                target = <&i2c1>;                __overlay__ {                        #address-cells = <1>;                        #size-cells = <0>;                        status = "okay";                        pcf8575c: pcf8575c@20 {                                pcf8575c;                                reg = <0x20>;                                compatible = "ti,pcf8575c";                                gpio-controller;                                #gpio-cells = <2>;                                ngpios = <16>;                                gpio-base = <200>;                                label = "pcf8575c";                        };                        __exports__ {                                pcf8575c;                        };                 };        };
It just failed to be deployed.
sudo dtoverlay bcm2710-pcf8575c.dtbo
DTOVERLAY[debug]: using platform 'bcm2835'
DTOVERLAY[debug]: overlay map loaded
run_cmd: which dtoverlay-pre >/dev/null 2>&1 && dtoverlay-pre
DTOVERLAY[debug]: loading file 'bcm2710-pcf8575c.dtbo'
DTOVERLAY[debug]: wrote 915 bytes to '/tmp/.dtoverlays/0_bcm2710-pcf8575c.dtbo'
DTOVERLAY[debug]: wrote 915 bytes to '/sys/kernel/config/device-tree/overlays/0_bcm2710-pcf8575c/dtbo'
* Failed to apply overlay '0_bcm2710-pcf8575c' (kernel)
run_cmd: which dtoverlay-post >/dev/null 2>&1 && dtoverlay-post
Then I tried this way to export the lable:

Code:

        fragment@0 {                target = <&i2c1>;                __overlay__ {                        #address-cells = <1>;                        #size-cells = <0>;                        status = "okay";                        pcf8575c: pcf8575c@20 {                                pcf8575c;                                reg = <0x20>;                                compatible = "ti,pcf8575c";                                gpio-controller;                                #gpio-cells = <2>;                                ngpios = <16>;                                gpio-base = <200>;                                label = "pcf8575c";                        };                };                __exports__ {                        pcf8575c;                };         };
Then the i2c expander dt overlay is applied, but it seems not working as the node is still not recognized outside of this node. The gpio overlay which is from pcf8575c still fails to be applied as before.
dtoverlay -v bcm2710-rpi3b-blackbird-gpio.dtbo
DTOVERLAY[debug]: using platform 'bcm2835'
DTOVERLAY[debug]: overlay map loaded
run_cmd: which dtoverlay-pre >/dev/null 2>&1 && dtoverlay-pre
DTOVERLAY[debug]: loading file 'bcm2710-rpi3b-blackbird-gpio.dtbo'
DTOVERLAY[debug]: wrote 404 bytes to '/tmp/.dtoverlays/1_bcm2710-rpi3b-blackbird-gpio.dtbo'
DTOVERLAY[debug]: wrote 404 bytes to '/sys/kernel/config/device-tree/overlays/1_bcm2710-rpi3b-blackbird-gpio/dtbo'
* Failed to apply overlay '1_bcm2710-rpi3b-blackbird-gpio' (kernel)
run_cmd: which dtoverlay-post >/dev/null 2>&1 && dtoverlay-post


So the question becomes, how to export a label effectively?
I couldn't find anything from googling it. It seems that __exports__ is rarely used. I am wondering if this kind of node that might be referred by other nodes is usually put in device tree, instead of device tree overlay.

Thanks!
Crane

Statistics: Posted by crane — Wed Aug 14, 2024 9:30 pm



Viewing all articles
Browse latest Browse all 5402

Trending Articles