jgauthier Posted October 25, 2020 Posted October 25, 2020 So, some time ago I made some custom changes to DTB to get the OV5640 camera working on a Banana Pi M2 Zero. I was successful, and made notes on the files that I changed. Now, I'm working with the same source tree, but cleaned out. So I wanted to make my changes again because I did not know about CREATE_PATCHES then. So, i built my new image, and made the changes to the dts files. But now, /dev/media0 does not show up. I have 2 boards. One with my prior image that is fully functioning (Board A), a new one that is missing /dev/media0 (Board B). First thing I did was compare the kernel configs. They are identical. For fun, I copied the kernel from A to B. That did not resolve the missing /dev/media0 from B. Then, I copied the board specific DTB file over from A to B. (sun8i-h2-plus-bananapi-m2-zero.dtb). Upon rebooting Board B, /dev/media0 shows up. Ah Ha. So, there is some change I made on the original build that does not show up in the new build. So, I reversed the DTB on both boards to DTS files and compared them. Sadly, the changes are minimal. Most of the difference are dynamic addresses defined during the build. I'm just really not sure what else could be going on here. If anyone has any experience, I would really appreciate it. I attached the 2 DTS files, and diff output is just this: diff sun8i-h2-plus-bananapi-m2-zero.dts sun8i-h2-plus-bananapi-m2-zero.dts.good 241d240 < broken-cd; 248c247 < cd-gpios = < 0x0c 0x05 0x06 0x00 >; --- > broken-cd; 255c254 < pinctrl-0 = < 0x0d >; --- > pinctrl-0 = < 0x0c >; 267c266 < mmc-pwrseq = < 0x0e >; --- > mmc-pwrseq = < 0x0d >; 275c274 < interrupt-parent = < 0x0c >; --- > interrupt-parent = < 0x0e >; 453c452 < phandle = < 0x0c >; --- > phandle = < 0x0e >; 518c517 < phandle = < 0x0d >; --- > phandle = < 0x0c >; 818,820c817,819 < device-wakeup-gpios = < 0x0c 0x06 0x0d 0x00 >; < host-wakeup-gpios = < 0x0c 0x06 0x0b 0x00 >; < shutdown-gpios = < 0x0c 0x06 0x0c 0x00 >; --- > device-wakeup-gpios = < 0x0e 0x06 0x0d 0x00 >; > host-wakeup-gpios = < 0x0e 0x06 0x0b 0x00 >; > shutdown-gpios = < 0x0e 0x06 0x0c 0x00 >; 903,904c902,903 < reset-gpios = < 0x0c 0x04 0x0e 0x01 >; < powerdown-gpios = < 0x0c 0x04 0x0f 0x00 >; --- > reset-gpios = < 0x0e 0x04 0x0e 0x01 >; > powerdown-gpios = < 0x0e 0x04 0x0f 0x00 >; 1305c1304 < gpio = < 0x0c 0x01 0x08 0x00 >; --- > gpio = < 0x0e 0x01 0x08 0x00 >; 1316c1315 < gpio = < 0x0c 0x01 0x09 0x00 >; --- > gpio = < 0x0e 0x01 0x09 0x00 >; 1328c1327 < gpio = < 0x0c 0x07 0x06 0x00 >; --- > gpio = < 0x0e 0x07 0x06 0x00 >; 1340c1339 < gpio = < 0x0c 0x07 0x03 0x00 >; --- > gpio = < 0x0e 0x07 0x03 0x00 >; 1402c1401 < reset-gpios = < 0x0c 0x06 0x0c 0x00 >; --- > reset-gpios = < 0x0e 0x06 0x0c 0x00 >; 1441c1440 < phandle = < 0x0e >; --- > phandle = < 0x0d >; 1449c1448 < gpio = < 0x0c 0x00 0x08 0x00 >; --- > gpio = < 0x0e 0x03 0x0e 0x00 >; 1461c1460 < gpio = < 0x0c 0x00 0x08 0x00 >; --- > gpio = < 0x0e 0x03 0x0e 0x00 >; 1473c1472 < gpio = < 0x0c 0x00 0x07 0x00 >; --- > gpio = < 0x0e 0x00 0x07 0x00 >; Each of these address is referenced in the file, like this: reset-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ So I've reached the conclusion that it's most likely dynamically creating the address that it points to (&pio) at build time. The only other real difference is is cd-gpios = < 0x0c 0x05 0x06 0x00 >; This exists only on my good image, and it's attached to the MMC device for card detection. sun8i-h2-plus-bananapi-m2-zero.dts.good sun8i-h2-plus-bananapi-m2-zero.dts
Recommended Posts