07-10-2021, 02:20 AM
(07-07-2021, 07:25 PM)dsimic Wrote: I've created a semi-throwaway utility that converts the autofocus firmware image "dumps" contained in C header files into binary images expected by the Linux kernel's firmware loading subsystem. I've already included a few image "dumps" (i.e., C header files) that are available in various source repositories on the Internet, and I've already converted those header files into binary images that are available as .bin files in the "firmware" directory in the repository.Thank you for that tool and all the work, greatly appreciated! I've tried all the firmware images you provided (by replacing the original af firmware in /lib/firmware), but unfortunately all of them failed to start. I haven't set any of the extra registers though because I don't know how to do that except for modifying the driver and rebuilding the kernel which I haven't had the time for (is there another way?). I will look for more firmware dumps too.
Please note that the "firmware" directory also contains human-readable .regs files, which contain additional values for the registers that, according to the original C header files, should be configured at the same time when the autofocus firmware is loaded, before and/or after the actual loading. Just have a look at the .regs files and all this will make much more sense.
As a side note, loading the firmware image into the OV5640 MCU should be performed using the i2c_transfer() function directly, instead of poking individual registers, but we can get back to that once we discover which firmware image needs to be used.