Jump to content
Sebastian

How to use self created device tree overlays for component deactivation

Recommended Posts

Good morning,

I am working with the Tinker Board S for a customer project and need to deactivate components for production as a security and perfomance measure. 

For example, I want to deactivate the GPU and and WiFi via device tree overlays as a low level approach to accomplish this goal. I saw that you shiped several overlays and found a couple of entries in this forum about overlays making me believe that this is the approach to go. Unfortunately, I was not able to succeed so far. 

What I did:

1. tested to compile the three attached overlays.

compilation with 
dtc -O dtb -o disable-gpu.dtbo -b 0 -@ disable-gpu-overlay.dts 
worked fine.


I move the file disable-gpu.dtbo to /boot/overlays and added them at the end of /boot/config.txt (overlay=disable-gpu)

but the overlay seems not to be loaded, because GPU and Desktop still booting and: 
dmesg | grep -i overlay 
returns nothing -> no overlays loaded

2. Next approach was to load it manually, but "dtoverlay" is not installed (should be included into device-tree-compiler package)

3. As an alternative I wanted to decompile the dtb and change the activation status directly there or apply the overlays manually to the dtb. But I do not find any *.dtb file in the filesystem. 

Could you please point me to the best way to accomplish my overall goal and walk me through the process?

Thank you in advance!

disable-gpu-overlay_approach1.dts disable-gpu-overlay_approach2.dts disable-gpu-overlay_approach3.dts deviceTreeOutput.txt config.txt

Share this post


Link to post
Share on other sites

hello @Sebastian

to compile the dtbo: 

dtc -@ -O dtb -o disable-gpu-wifi.dtbo disable-gpu-wifi.dts

(or, you can download the dts & dtbo from this link )

once you have the dts and dtbo, move them to the /boot/overlays and modify the config.txt

cp disable-gpu-wifi.dtbo /boot/overlays/
sudo vim /boot/config.txt
overlay=disable-gpu-wifi
sudo reboot

to verify that gpu is disabled: 

check if the directory /sys/devices/platform/ffa30000.gpu/ exists; if it's non existent = gpu is disabled 

 this is what in the disable-gpu-wifi.dts: 

/dts-v1/;

/plugin/;

 

/ {

    compatible = "rockchip,rk3288";

 

    fragment@0 {

        target = <&gpu>;

        __overlay__ {

            status = "disabled";

        };

    };

   

    fragment@1 {

        target-path = "/wireless-wlan";

        __overlay__ {

            status = "disabled";

        };

    };

};

 

Share this post


Link to post
Share on other sites

Hello @tooz

Thank you very much for your support. I was able to build the dtbo file and apply the overlay successfully. Actually, what really helped me was to understand how I validate the deactivation by evaluating the existance of /sys/devices/platform/ffa30000.gpu. (and /sys/devices/platform/wireless-wlan resp.)

dmesg | grep -i overlay 

still returns nothing, even when the overlay is successfully applied. With this knowledge I re-evaluated my former dts files - the first one already worked.

Once again: Thanks. This helped me to solve my issue.

Edited by Sebastian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...