msm8916-mainline / linux-mdss-dsi-panel-driver-generator

Generate Linux DRM panel kernel driver based on QCOM MDSS DSI device tree
GNU General Public License v2.0
53 stars 33 forks source link

libfdt.FdtException: pylibfdt error -9: FDT_ERR_BADMAGIC #22

Closed dieselnutjob closed 1 year ago

dieselnutjob commented 1 year ago

Hi I tried to use lmdpdg.py on both a binary dtb and the decompiled version (I think that's what you mean by dtbs). I installed pylibfdt first by using this https://github.com/devicetree-org/pylibfdt This is the output I get:- $ ./lmdpdg.py rk3566_tablet2.dts Parsing: rk3566_tablet2.dts Traceback (most recent call last): File "./lmdpdg.py", line 72, in <module> fdt = Fdt2(f.read()) File "/usr/local/lib/python3.8/dist-packages/pylibfdt-1.6.1-py3.8-linux-x86_64.egg/libfdt.py", line 174, in __init__ check_err(fdt_check_header(self._fdt)); File "/usr/local/lib/python3.8/dist-packages/pylibfdt-1.6.1-py3.8-linux-x86_64.egg/libfdt.py", line 132, in check_err raise FdtException(val) libfdt.FdtException: pylibfdt error -9: FDT_ERR_BADMAGIC

what did I get wrong please?

stephan-gh commented 1 year ago

You need to give it the binary dtb, not the source one. Also note that this generator only supports Qualcomm platforms. It won't work for a Rockchip device, sorry :(

dieselnutjob commented 1 year ago

Yep I think I have realised that in the last few minutes. There is an article here https://chowdera.com/2022/03/202203242230208988.html that describes the rockchip mangling process. Maybe someone could make something like your code but make it work for Rockchip.... hint, hint....