Device Tree overlay to run OV7251 camera on CAM0 port of Compute Module 4
This will work on Raspberry Pi OS 2021-01-12 (related DT files were changed in later release).
Copy the binary device tree overlay file to
sudo cp ov7251cam0.dtbo /boot/overlays/ov7251cam0.dtbo
Enable the overlay in
Reboot the RPi with
sudo reboot. The camera driver should run.
To compile the device tree from source use
dtc -I dts -O dtb -o ov7251cam0.dtbo ov7251cam0-overlay.dts
Link to base overlay file: ov7251-overlay.dts.