Dear Community,
I would like to have a question purely Yocto for the NXP BSP : Currently, I develop the ISP based driver of some custom sensors, and I can integrate them into the Yocto bitbaking system as following :
$ <path-to>/meta-<company>/recipes-kernel
├── kernel-modules
│ ├── kernel-module-isp-vvcam
│ │ ├── 0001-vvcam-isp-Force-disable-WDR3.patch
│ │ └── 0002-vvcam-v4l2-sensor-Add-support-for-TOTO.patch
│ └── kernel-module-isp-vvcam_%.bbappend
In order to get the custom sensor driver (0002-vvcam-v4l2-sensor-Add-support-for-TOTO.patch) built, I need to modify it a little bit by updating the path of the relevant resources (replace /vvcam/v4l2/sensor by /sensor
Original version:
diff --git a/vvcam/v4l2/sensor/Makefile b/vvcam/v4l2/sensor/Makefile
index d98ecda..bb8f6fa 100755
--- a/vvcam/v4l2/sensor/Makefile
+++ b/vvcam/v4l2/sensor/Makefile
@@ -1,4 +1,5 @@
+obj-m += toto/
obj-m += ov2775/
obj-m += os08a20/
obj-m += camera-proxy-driver/
diff --git a/vvcam/v4l2/sensor/toto/Makefile b/vvcam/v4l2/sensor/toto/Makefile
new file mode 100644
index 0000000..c9fe9b8
--- /dev/null
+++ b/vvcam/v4l2/sensor/toto/Makefile
@@ -0,0 +1,4 @@
+EXTRA_CFLAGS += -I$(PWD)/../common/ -O2 -Werror
+toto-objs += toto_mipi_v3.o
+obj-m += toto.o
diff --git a/vvcam/v4l2/sensor/toto/toto_mipi_v3.c b/vvcam/v4l2/sensor/toto/toto_mipi_v3.c
new file mode 100644
index 0000000..50bf080
--- /dev/null
+++ b/vvcam/v4l2/sensor/toto/toto_mipi_v3.c
Modified version :
diff --git a/sensor/Makefile b/sensor/Makefile
index d98ecda..bb8f6fa 100755
--- a/sensor/Makefile
+++ b/sensor/Makefile
@@ -1,4 +1,5 @@
+obj-m += toto/
obj-m += ov2775/
obj-m += os08a20/
obj-m += camera-proxy-driver/
diff --git a/sensor/toto/Makefile b/sensor/toto/Makefile
new file mode 100644
index 0000000..c9fe9b8
--- /dev/null
+++ b/sensor/toto/Makefile
@@ -0,0 +1,4 @@
+EXTRA_CFLAGS += -I$(PWD)/../common/ -O2 -Werror
+toto-objs += toto_mipi_v3.o
+obj-m += toto.o
diff --git a/sensor/toto/toto_mipi_v3.c b/sensor/toto/toto_mipi_v3.c
new file mode 100644
index 0000000..50bf080
--- /dev/null
+++ b/sensor/toto/toto_mipi_v3.c
...
The above modification works well. However, when it comes to the resource/file out side of /vvcam/v4l2/, such as in the first patch 0001-vvcam-isp-Force-disable-WDR3.patch, I have not known how to modify it:
diff --git a/vvcam/isp/isp_wdr3.c b/vvcam/isp/isp_wdr3.c
index 487a42e..9fbd3de 100644
--- a/vvcam/isp/isp_wdr3.c
+++ b/vvcam/isp/isp_wdr3.c
@@ -406,7 +406,8 @@ void wdr3_hw_init(struct isp_ic_dev *dev)
{
uint32_t isp_wdr3_ctrl = isp_read_reg(dev, REG_ADDR(isp_wdr3_ctrl));
- REG_SET_SLICE(isp_wdr3_ctrl, WDR3_ENABLE, 1);
+ pr_warn("[TOTO] %s: Force WDR3 disabled by default\n", __func__);
+ REG_SET_SLICE(isp_wdr3_ctrl, WDR3_ENABLE, 0);
isp_write_reg(dev, REG_ADDR(isp_wdr3_ctrl), isp_wdr3_ctrl);
}
}
@@ -419,8 +420,9 @@ int isp_enable_wdr3(struct isp_ic_dev *dev)
#else
struct isp_wdr3_context *wdr3 = &dev->wdr3;
int32_t isp_wdr3_ctrl = isp_read_reg(dev, REG_ADDR(isp_wdr3_ctrl));
- wdr3->enable = true;
- REG_SET_SLICE(isp_wdr3_ctrl, WDR3_ENABLE, 1);
+ pr_warn("[TOTO] %s: Force WDR3 disabled in all cases\n", __func__);
+ wdr3->enable = false;
+ REG_SET_SLICE(isp_wdr3_ctrl, WDR3_ENABLE, 0);
isp_write_reg(dev, REG_ADDR(isp_wdr3_ctrl), isp_wdr3_ctrl);
{
If I let it bitbaked as-is, there will be following error:
ERROR: kernel-module-isp-vvcam-4.2.2.15.0-r0 do_patch: Command Error: 'quilt --quiltrc /data/Khang/imx-yocto-bsp-hardknott-5_10_52-2_1_0/build-xwayland-imx_imx8mp/tmp/work/imx_imx8mp-poky-linux/kernel-module-isp-vvcam/4.2.2.15.0-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
stdout: Applying patch 0001-vvcam-isp-Force-disable-WDR3.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/vvcam/isp/isp_wdr3.c b/vvcam/isp/isp_wdr3.c
|index 487a42e..9fbd3de 100644
|--- a/vvcam/isp/isp_wdr3.c
|+++ b/vvcam/isp/isp_wdr3.c
--------------------------
No file to patch. Skipping patch.
2 out of 2 hunks ignored
Patch 0001-vvcam-isp-Force-disable-WDR3.patch does not apply (enforce with -f)
stderr:
ERROR: Logfile of failure stored in: /data/Khang/imx-yocto-bsp-hardknott-5_10_52-2_1_0/build-xwayland-imx_imx8mp/tmp/work/imx_imx8mp-poky-linux/kernel-module-isp-vvcam/4.2.2.15.0-r0/temp/log.do_patch.888472
ERROR: Task (/data/Khang/imx-yocto-bsp-hardknott-5_10_52-2_1_0/sources/meta-imx/meta-bsp/recipes-kernel/kernel-modules/kernel-module-isp-vvcam_4.2.2.15.0.bb:do_patch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 518 tasks of which 514 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/data/Khang/imx-yocto-bsp-hardknott-5_10_52-2_1_0/sources/meta-imx/meta-bsp/recipes-kernel/kernel-modules/kernel-module-isp-vvcam_4.2.2.15.0.bb:do_patch
Effectively, the file being patched could not be found.
Could you help to suggest a solution, please ?
Thanks in advance and best regards,
Khang