Skip to content

Commit 5c06097

Browse files
authored
Merge pull request intel#270 from hao-yao/master
ARL platform PV release candidate on 2024-09-27
2 parents 3be335e + 22b792f commit 5c06097

36 files changed

+3521
-227
lines changed

.github/workflows/test.yml

+62-14
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,64 @@ jobs:
8080
exit 1
8181
fi
8282
echo "#### Successful builds for kernels: ${succeeded}";
83+
Ubuntu-2404-dkms:
84+
runs-on: ubuntu-latest
85+
container: ubuntu:24.04
86+
steps:
87+
- name: Checkout
88+
uses: actions/checkout@v4
89+
90+
- name: Prepare environment
91+
shell: bash
92+
run: |
93+
sed -i 's/noble noble-updates noble-backports/noble noble-updates noble-backports noble-proposed/' /etc/apt/sources.list.d/ubuntu.sources
94+
apt-get update --quiet;
95+
apt-get install --yes --no-install-recommends dkms gpg-agent kmod software-properties-common sudo
96+
97+
- name: Download header files
98+
shell: bash
99+
run: |
100+
# latest generic kernel headers
101+
apt-get install --yes linux-headers-generic linux-headers-generic-hwe-24.04-edge
102+
# latest oem kernel
103+
apt-get install --yes linux-headers-oem-24.04 linux-headers-oem-24.04a linux-headers-oem-24.04b
104+
105+
- name: Register with dkms
106+
shell: bash
107+
run: |
108+
dkms add .
109+
110+
- name: Compile driver
111+
shell: bash
112+
run: |
113+
# run dkms build and all available kernel headers
114+
failed=""
115+
succeeded=""
116+
for kver in /lib/modules/*/build; do
117+
# skip the kernel headers from the azure kernel. These kernel headers
118+
# are preinstalled and of no interest
119+
if [[ "$kver" == *"azure"* ]]; then
120+
echo "Skipping $kver - This is the kernel of the github runner.";
121+
continue;
122+
fi;
123+
test -d $kver || continue
124+
kver=${kver%/build}
125+
kver=${kver##*/}
126+
echo "=== Testing ${kver} ===";
127+
echo "running: dkms build -m ipu6-drivers/0.0.0 -k ${kver}";
128+
ret=$(sudo dkms build -m ipu6-drivers/0.0.0 -k ${kver} >&2; echo $?);
129+
if [ ${ret} -eq 0 ]; then
130+
succeeded="${succeeded} ${kver}"
131+
else
132+
echo "#### Skipped unexpected failure ${kver}";
133+
failed="${failed} ${kver}";
134+
fi;
135+
done
136+
if [ "x${failed}" != "x" ]; then
137+
echo "#### Failed kernels: ${failed}";
138+
exit 1
139+
fi
140+
echo "#### Successful builds for kernels: ${succeeded}";
83141
84142
Ubuntu-rolling-dkms:
85143
runs-on: ubuntu-latest
@@ -112,8 +170,8 @@ jobs:
112170
# Add unstable kernel ppa
113171
add-apt-repository ppa:canonical-kernel-team/unstable
114172
apt-get update --quiet;
115-
# latest and wip generic kernel headers
116-
apt-get install --yes linux-headers-generic linux-headers-generic-wip
173+
# latest generic kernel headers
174+
apt-get install --yes linux-headers-generic
117175
# latest oem kernel
118176
apt-get install --yes linux-headers-oem-22.04
119177
@@ -160,18 +218,6 @@ jobs:
160218
- name: Checkout
161219
uses: actions/checkout@v4
162220

163-
- name: Checkout ivsc-driver repo
164-
uses: actions/checkout@v4
165-
with:
166-
repository: intel/ivsc-driver
167-
path: ivsc-driver
168-
169-
- name: Merge with ivsc-driver
170-
shell: bash
171-
run: |
172-
cp -r ivsc-driver/backport-include ivsc-driver/drivers ivsc-driver/include .
173-
rm -rf ivsc-driver
174-
175221
- name: Prepare environment
176222
shell: bash
177223
run: |
@@ -211,6 +257,8 @@ jobs:
211257
ret=$(sudo dkms build -m ipu6-drivers/0.0.0 -k ${kver} >&2; echo $?);
212258
if [ ${ret} -eq 0 ]; then
213259
succeeded="${succeeded} ${kver}"
260+
elif [ ${ret} -eq 77 ]; then
261+
echo "#### Config of ${kver} doesn't support";
214262
else
215263
echo "#### Skipped unexpected failure ${kver}";
216264
failed="${failed} ${kver}";

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ KV_IVSC := 6.6.0
2424
KV_IPU_BRIDGE := 6.6.0
2525
KV_OV2740 := 6.8.0
2626
KV_OV05C10 := 6.8.0
27+
KV_IPU6_ISYS := 6.10.0
2728

2829
KERNEL_SRC ?= /lib/modules/$(KERNELRELEASE)/build
2930
MODSRC := $(shell pwd)
@@ -74,7 +75,11 @@ export CONFIG_IPU_ISYS_BRIDGE = y
7475
export CONFIG_IPU_BRIDGE = n
7576
endif
7677
export EXTERNAL_BUILD = 1
77-
obj-y += drivers/media/pci/intel/
78+
ifeq ($(call version_lt,$(KERNEL_VERSION),$(KV_IPU6_ISYS)),true)
79+
obj-y += drivers/media/pci/intel/ipu6/
80+
else
81+
obj-y += drivers/media/pci/intel/ipu6/psys/
82+
endif
7883

7984
export CONFIG_VIDEO_HM11B1 = m
8085
export CONFIG_VIDEO_OV01A1S = m

README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Three ways are available:
2626
3. and build with dkms
2727

2828
### 1. Build with kernel source tree
29-
- Tested with kernel v6.8
29+
- Tested with kernel v6.10
3030
- Check out kernel
3131
- Apply patches:
3232
```sh
@@ -47,10 +47,23 @@ Three ways are available:
4747

4848
# For kernel version v6.8
4949
patch/v6.8/*.patch
50+
51+
# For kernel version v6.10
52+
patch/v6.10/in-tree-build/*.patch
53+
patch/v6.10/*.patch
5054
```
5155
- For kernel v6.8. patch/v6.8/0002-media-Add-IPU6-and-supported-sensors-config.patch will change the related Kconfig & Makefile.
56+
- For kernel v6.10. patch/v6.10/in-tree-build/0001-workaround-patch-to-build-psys.patch will change the Makefile to build IPU6 PSYS driver.
5257
- For latest linux-firmware repo, apply patch/linux-firmware/0001-Add-symbolic-link-for-Intel-IPU6-firmwares.patch to it to make driver work.
53-
- Copy `drivers` and `include` folders to kernel source **(except Kconfig & Makefile at drivers/media/pci/intel and drivers/media/i2c as they are modified by patches in previous step. You can delete them before you copy folders.)**.
58+
- For kernel v6.10 and above, copy only drivers you need to kernel source:
59+
```sh
60+
# Out-Of-Tree IPU6 PSYS driver
61+
cp -r drivers/media/pci/intel/ipu6/psys <your-kernel>/drivers/media/pci/intel/ipu6/
62+
cp include/uapi/linux/ipu-psys.h <your-kernel>/include/uapi/linux/
63+
# Out-Of-Tree I2C sensor drivers
64+
cp -r drivers/media/i2c <your-kernel>/drivers/media/i2c
65+
```
66+
- For kernel version less than v6.10, copy `drivers` and `include` folders to kernel source **(except Kconfig & Makefile at drivers/media/pci/intel and drivers/media/i2c as they are modified by patches in previous step. You can delete them before you copy folders.)**.
5467

5568
- Enable the following settings in .config
5669
```conf
@@ -87,6 +100,8 @@ Three ways are available:
87100
```
88101
### 2. Build outside kernel source tree
89102
- Requires kernel header installed on build machine
103+
- For kernel >= v6.10, need to patch this repo by ipu6-drivers/patches/*.patch (which can be automatically applied if you use DKMS build).
104+
- For kernel >= v6.10, need to patch your kernel by patch/v6.10/*.patch.
90105
- For kernel >= v6.8, still need to patch kernel by patch/v6.8/0004 & 0005 to make upstream iVSC driver work correctly. For kernel <= v6.6, requires iVSC out-of-tree driver be built together.
91106
- To prepare out-of-tree iVSC driver under kernel <= v6.6:
92107
```sh

dkms.conf

+36-28
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PACKAGE_VERSION=0.0.0
44
MAKE="make KERNELRELEASE=$kernelver KERNEL_SRC=$kernel_source_dir"
55
CLEAN="make KERNELRELEASE=$kernelver KERNEL_SRC=$kernel_source_dir clean"
66
AUTOINSTALL="yes"
7+
BUILD_EXCLUSIVE_CONFIG="CONFIG_VIDEO_V4L2_I2C"
78

89
version_lt() {
910
IFS='.' read -r i j k <<< "$1"
@@ -33,61 +34,68 @@ KERNEL_VERSION=$(echo ${kernelver} | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
3334
KV_IVSC=6.6.0
3435
KV_OV2740=6.8.0
3536
KV_OV05C10=6.8.0
37+
KV_IPU6_ISYS=6.10.0
3638

37-
BUILT_MODULE_NAME[0]="intel-ipu6"
38-
BUILT_MODULE_LOCATION[0]="drivers/media/pci/intel/ipu6"
39+
BUILT_MODULE_NAME[0]="hm11b1"
40+
BUILT_MODULE_LOCATION[0]="drivers/media/i2c"
3941
DEST_MODULE_LOCATION[0]="/updates"
4042

41-
BUILT_MODULE_NAME[1]="intel-ipu6-isys"
42-
BUILT_MODULE_LOCATION[1]="drivers/media/pci/intel/ipu6"
43+
BUILT_MODULE_NAME[1]="ov01a1s"
44+
BUILT_MODULE_LOCATION[1]="drivers/media/i2c"
4345
DEST_MODULE_LOCATION[1]="/updates"
4446

45-
BUILT_MODULE_NAME[2]="intel-ipu6-psys"
46-
BUILT_MODULE_LOCATION[2]="drivers/media/pci/intel/ipu6"
47+
BUILT_MODULE_NAME[2]="ov01a10"
48+
BUILT_MODULE_LOCATION[2]="drivers/media/i2c"
4749
DEST_MODULE_LOCATION[2]="/updates"
4850

49-
BUILT_MODULE_NAME[3]="hm11b1"
51+
BUILT_MODULE_NAME[3]="ov02c10"
5052
BUILT_MODULE_LOCATION[3]="drivers/media/i2c"
5153
DEST_MODULE_LOCATION[3]="/updates"
5254

53-
BUILT_MODULE_NAME[4]="ov01a1s"
55+
BUILT_MODULE_NAME[4]="ov02e10"
5456
BUILT_MODULE_LOCATION[4]="drivers/media/i2c"
5557
DEST_MODULE_LOCATION[4]="/updates"
5658

57-
BUILT_MODULE_NAME[5]="ov01a10"
59+
BUILT_MODULE_NAME[5]="hm2170"
5860
BUILT_MODULE_LOCATION[5]="drivers/media/i2c"
5961
DEST_MODULE_LOCATION[5]="/updates"
6062

61-
BUILT_MODULE_NAME[6]="ov02c10"
63+
BUILT_MODULE_NAME[6]="hm2172"
6264
BUILT_MODULE_LOCATION[6]="drivers/media/i2c"
6365
DEST_MODULE_LOCATION[6]="/updates"
6466

65-
BUILT_MODULE_NAME[7]="ov02e10"
67+
BUILT_MODULE_NAME[7]="hi556"
6668
BUILT_MODULE_LOCATION[7]="drivers/media/i2c"
6769
DEST_MODULE_LOCATION[7]="/updates"
6870

69-
BUILT_MODULE_NAME[8]="hm2170"
70-
BUILT_MODULE_LOCATION[8]="drivers/media/i2c"
71-
DEST_MODULE_LOCATION[8]="/updates"
71+
if ! version_lt ${KERNEL_VERSION} ${KV_OV05C10}; then
72+
BUILD_EXCLUSIVE_CONFIG="CONFIG_VIDEO_V4L2_I2C CONFIG_V4L2_CCI_I2C"
73+
BUILT_MODULE_NAME[8]="ov05c10"
74+
BUILT_MODULE_LOCATION[8]="drivers/media/i2c"
75+
DEST_MODULE_LOCATION[8]="/updates"
76+
fi
7277

73-
BUILT_MODULE_NAME[9]="hm2172"
74-
BUILT_MODULE_LOCATION[9]="drivers/media/i2c"
75-
DEST_MODULE_LOCATION[9]="/updates"
78+
if version_lt ${KERNEL_VERSION} ${KV_OV2740}; then
79+
BUILT_MODULE_NAME[8]="ov2740"
80+
BUILT_MODULE_LOCATION[8]="drivers/media/i2c"
81+
DEST_MODULE_LOCATION[8]="/updates"
82+
fi
7683

77-
BUILT_MODULE_NAME[10]="hi556"
78-
BUILT_MODULE_LOCATION[10]="drivers/media/i2c"
79-
DEST_MODULE_LOCATION[10]="/updates"
84+
if ! version_lt ${KERNEL_VERSION} ${KV_IPU6_ISYS}; then
85+
PATCH[0]="0001-v6.10-IPU6-headers-used-by-PSYS.patch"
86+
fi
8087

88+
BUILT_MODULE_NAME[9]="intel-ipu6-psys"
89+
BUILT_MODULE_LOCATION[9]="drivers/media/pci/intel/ipu6/psys"
90+
DEST_MODULE_LOCATION[9]="/updates"
8191

82-
if ! version_lt ${KERNEL_VERSION} ${KV_OV05C10}; then
83-
BUILT_MODULE_NAME[11]="ov05c10"
84-
BUILT_MODULE_LOCATION[11]="drivers/media/i2c"
85-
DEST_MODULE_LOCATION[11]="/updates"
86-
fi
92+
if version_lt ${KERNEL_VERSION} ${KV_IPU6_ISYS}; then
93+
BUILT_MODULE_NAME[10]="intel-ipu6"
94+
BUILT_MODULE_LOCATION[10]="drivers/media/pci/intel/ipu6"
95+
DEST_MODULE_LOCATION[10]="/updates"
8796

88-
if version_lt ${KERNEL_VERSION} ${KV_OV2740}; then
89-
BUILT_MODULE_NAME[11]="ov2740"
90-
BUILT_MODULE_LOCATION[11]="drivers/media/i2c"
97+
BUILT_MODULE_NAME[11]="intel-ipu6-isys"
98+
BUILT_MODULE_LOCATION[11]="drivers/media/pci/intel/ipu6"
9199
DEST_MODULE_LOCATION[11]="/updates"
92100
fi
93101

0 commit comments

Comments
 (0)