Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix camera drivers for imx219 and ov5647 #313

Merged

Conversation

bmx666
Copy link
Contributor

@bmx666 bmx666 commented Jan 2, 2025

No description provided.

bmx666 added 2 commits January 2, 2025 18:28
Cherry-pick a patch of imx219 driver only from original source
Joshua-Riek@1b4e0ed
Cherry-pick a patch of ov5647 driver only from original source
Joshua-Riek@1b4e0ed
@amazingfate
Copy link
Collaborator

This seems to be an override from other driver code, is the source available?

@bmx666
Copy link
Contributor Author

bmx666 commented Jan 3, 2025

@amazingfate not sure, I found it randomly in @Joshua-Riek repo and I mentioned that in commits. Customer tested both camera on RK3568 and they works fine with patched drivers.
For imx219 - I found the similar commit in ChromiumOS - https://chromium.googlesource.com/chromiumos/third_party/kernel/+/factory-ryu-6486.14.B-chromeos-3.14/drivers/media/i2c/soc_camera/imx219.c
And kernel thread about imx219 - https://lore.kernel.org/all/09ab897e-79a9-ae44-4caa-93d8d1fa1c51@synopsys.com/T/

@bmx666
Copy link
Contributor Author

bmx666 commented Jan 3, 2025

When I tried to find the issue why upstream imx219 and ov5647 drivers don't work on Rockchip, it's because they seems only compatible with Raspberry PI Broadcom CSI. I also could confirm that these upstream drivers don't work with imx6/imx8 boards and need to be patched as well - https://github.com/nxp-imx-support/meta-imx8mp-isp-imx219/blob/LF6.6.3_P24.1/recipes-kernel/kernel-modules/imx219/0001-isp-vvcam-add-imx219.patch

Copy link
Collaborator

@amazingfate amazingfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge it since the original drivers do not work.

@amazingfate amazingfate merged commit 4eefecc into armbian:rk-6.1-rkr4.1 Jan 5, 2025
1 check passed
@bmx666
Copy link
Contributor Author

bmx666 commented Jan 5, 2025

I found extra info about how to adopt camera drivers for Rockchip
https://hackaday.io/project/192267-open360camera/log/222791-drivers

RockChip extends base driver requirements with couple vendor-specific requirements.

  • private ioctl calls RKMODULE_GET_MODULE_INFO, RKMODULE_SET_QUICK_STREAM
  • bunch of specific v4l2 callbacks, such as enum_bus_code, enum_frame_size, s_stream

And from Rockchip documentation minimal steps to adopt CIS driver
https://docs.google.com/document/d/1QwTW4pzR1_6AQCFrgQtbIl26qkizEArC/edit#bookmark=id.3o7alnk

@bmx666 bmx666 deleted the rk-6.1-rkr4.1-rpi-camera-update branch January 7, 2025 20:58
@bmx666
Copy link
Contributor Author

bmx666 commented Jan 9, 2025

@amazingfate found another critical issue - all defined camera drivers (in overlays/dtb) must be defined as build-in in kernel config. If camera driver defined as module it will not work correctly. idk, seems Rockchip initialize MIPI-CSI2 / CIF / ISP much early that modules and that affects boot sequence.
I'm currently working on another camera ov5460 for customers.

@amazingfate
Copy link
Collaborator

@amazingfate found another critical issue - all defined camera drivers (in overlays/dtb) must be defined as build-in in kernel config. If camera driver defined as module it will not work correctly. idk, seems Rockchip initialize MIPI-CSI2 / CIF / ISP much early that modules and that affects boot sequence.
I'm currently working on another camera ov5460 for customers.

What about adding driver module to initramfs?

@bmx666
Copy link
Contributor Author

bmx666 commented Jan 9, 2025

@amazingfate found another critical issue - all defined camera drivers (in overlays/dtb) must be defined as build-in in kernel config. If camera driver defined as module it will not work correctly. idk, seems Rockchip initialize MIPI-CSI2 / CIF / ISP much early that modules and that affects boot sequence.
I'm currently working on another camera ov5460 for customers.

What about adding driver module to initramfs?

OV5647 and IMX219 already defined as build-in in kernel config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants