Skip to content

Commit

Permalink
ARL platform PV release candidate on 2024-09-27
Browse files Browse the repository at this point in the history
Signed-off-by: Hao Yao <[email protected]>
  • Loading branch information
hao-yao committed Sep 29, 2024
1 parent 3be335e commit 22b792f
Show file tree
Hide file tree
Showing 36 changed files with 3,521 additions and 227 deletions.
76 changes: 62 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,64 @@ jobs:
exit 1
fi
echo "#### Successful builds for kernels: ${succeeded}";
Ubuntu-2404-dkms:
runs-on: ubuntu-latest
container: ubuntu:24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare environment
shell: bash
run: |
sed -i 's/noble noble-updates noble-backports/noble noble-updates noble-backports noble-proposed/' /etc/apt/sources.list.d/ubuntu.sources
apt-get update --quiet;
apt-get install --yes --no-install-recommends dkms gpg-agent kmod software-properties-common sudo
- name: Download header files
shell: bash
run: |
# latest generic kernel headers
apt-get install --yes linux-headers-generic linux-headers-generic-hwe-24.04-edge
# latest oem kernel
apt-get install --yes linux-headers-oem-24.04 linux-headers-oem-24.04a linux-headers-oem-24.04b
- name: Register with dkms
shell: bash
run: |
dkms add .
- name: Compile driver
shell: bash
run: |
# run dkms build and all available kernel headers
failed=""
succeeded=""
for kver in /lib/modules/*/build; do
# skip the kernel headers from the azure kernel. These kernel headers
# are preinstalled and of no interest
if [[ "$kver" == *"azure"* ]]; then
echo "Skipping $kver - This is the kernel of the github runner.";
continue;
fi;
test -d $kver || continue
kver=${kver%/build}
kver=${kver##*/}
echo "=== Testing ${kver} ===";
echo "running: dkms build -m ipu6-drivers/0.0.0 -k ${kver}";
ret=$(sudo dkms build -m ipu6-drivers/0.0.0 -k ${kver} >&2; echo $?);
if [ ${ret} -eq 0 ]; then
succeeded="${succeeded} ${kver}"
else
echo "#### Skipped unexpected failure ${kver}";
failed="${failed} ${kver}";
fi;
done
if [ "x${failed}" != "x" ]; then
echo "#### Failed kernels: ${failed}";
exit 1
fi
echo "#### Successful builds for kernels: ${succeeded}";
Ubuntu-rolling-dkms:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -112,8 +170,8 @@ jobs:
# Add unstable kernel ppa
add-apt-repository ppa:canonical-kernel-team/unstable
apt-get update --quiet;
# latest and wip generic kernel headers
apt-get install --yes linux-headers-generic linux-headers-generic-wip
# latest generic kernel headers
apt-get install --yes linux-headers-generic
# latest oem kernel
apt-get install --yes linux-headers-oem-22.04
Expand Down Expand Up @@ -160,18 +218,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Checkout ivsc-driver repo
uses: actions/checkout@v4
with:
repository: intel/ivsc-driver
path: ivsc-driver

- name: Merge with ivsc-driver
shell: bash
run: |
cp -r ivsc-driver/backport-include ivsc-driver/drivers ivsc-driver/include .
rm -rf ivsc-driver
- name: Prepare environment
shell: bash
run: |
Expand Down Expand Up @@ -211,6 +257,8 @@ jobs:
ret=$(sudo dkms build -m ipu6-drivers/0.0.0 -k ${kver} >&2; echo $?);
if [ ${ret} -eq 0 ]; then
succeeded="${succeeded} ${kver}"
elif [ ${ret} -eq 77 ]; then
echo "#### Config of ${kver} doesn't support";
else
echo "#### Skipped unexpected failure ${kver}";
failed="${failed} ${kver}";
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ KV_IVSC := 6.6.0
KV_IPU_BRIDGE := 6.6.0
KV_OV2740 := 6.8.0
KV_OV05C10 := 6.8.0
KV_IPU6_ISYS := 6.10.0

KERNEL_SRC ?= /lib/modules/$(KERNELRELEASE)/build
MODSRC := $(shell pwd)
Expand Down Expand Up @@ -74,7 +75,11 @@ export CONFIG_IPU_ISYS_BRIDGE = y
export CONFIG_IPU_BRIDGE = n
endif
export EXTERNAL_BUILD = 1
obj-y += drivers/media/pci/intel/
ifeq ($(call version_lt,$(KERNEL_VERSION),$(KV_IPU6_ISYS)),true)
obj-y += drivers/media/pci/intel/ipu6/
else
obj-y += drivers/media/pci/intel/ipu6/psys/
endif

export CONFIG_VIDEO_HM11B1 = m
export CONFIG_VIDEO_OV01A1S = m
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Three ways are available:
3. and build with dkms

### 1. Build with kernel source tree
- Tested with kernel v6.8
- Tested with kernel v6.10
- Check out kernel
- Apply patches:
```sh
Expand All @@ -47,10 +47,23 @@ Three ways are available:

# For kernel version v6.8
patch/v6.8/*.patch

# For kernel version v6.10
patch/v6.10/in-tree-build/*.patch
patch/v6.10/*.patch
```
- For kernel v6.8. patch/v6.8/0002-media-Add-IPU6-and-supported-sensors-config.patch will change the related Kconfig & Makefile.
- 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.
- For latest linux-firmware repo, apply patch/linux-firmware/0001-Add-symbolic-link-for-Intel-IPU6-firmwares.patch to it to make driver work.
- 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.)**.
- For kernel v6.10 and above, copy only drivers you need to kernel source:
```sh
# Out-Of-Tree IPU6 PSYS driver
cp -r drivers/media/pci/intel/ipu6/psys <your-kernel>/drivers/media/pci/intel/ipu6/
cp include/uapi/linux/ipu-psys.h <your-kernel>/include/uapi/linux/
# Out-Of-Tree I2C sensor drivers
cp -r drivers/media/i2c <your-kernel>/drivers/media/i2c
```
- 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.)**.

- Enable the following settings in .config
```conf
Expand Down Expand Up @@ -87,6 +100,8 @@ Three ways are available:
```
### 2. Build outside kernel source tree
- Requires kernel header installed on build machine
- For kernel >= v6.10, need to patch this repo by ipu6-drivers/patches/*.patch (which can be automatically applied if you use DKMS build).
- For kernel >= v6.10, need to patch your kernel by patch/v6.10/*.patch.
- 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.
- To prepare out-of-tree iVSC driver under kernel <= v6.6:
```sh
Expand Down
64 changes: 36 additions & 28 deletions dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PACKAGE_VERSION=0.0.0
MAKE="make KERNELRELEASE=$kernelver KERNEL_SRC=$kernel_source_dir"
CLEAN="make KERNELRELEASE=$kernelver KERNEL_SRC=$kernel_source_dir clean"
AUTOINSTALL="yes"
BUILD_EXCLUSIVE_CONFIG="CONFIG_VIDEO_V4L2_I2C"

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

BUILT_MODULE_NAME[0]="intel-ipu6"
BUILT_MODULE_LOCATION[0]="drivers/media/pci/intel/ipu6"
BUILT_MODULE_NAME[0]="hm11b1"
BUILT_MODULE_LOCATION[0]="drivers/media/i2c"
DEST_MODULE_LOCATION[0]="/updates"

BUILT_MODULE_NAME[1]="intel-ipu6-isys"
BUILT_MODULE_LOCATION[1]="drivers/media/pci/intel/ipu6"
BUILT_MODULE_NAME[1]="ov01a1s"
BUILT_MODULE_LOCATION[1]="drivers/media/i2c"
DEST_MODULE_LOCATION[1]="/updates"

BUILT_MODULE_NAME[2]="intel-ipu6-psys"
BUILT_MODULE_LOCATION[2]="drivers/media/pci/intel/ipu6"
BUILT_MODULE_NAME[2]="ov01a10"
BUILT_MODULE_LOCATION[2]="drivers/media/i2c"
DEST_MODULE_LOCATION[2]="/updates"

BUILT_MODULE_NAME[3]="hm11b1"
BUILT_MODULE_NAME[3]="ov02c10"
BUILT_MODULE_LOCATION[3]="drivers/media/i2c"
DEST_MODULE_LOCATION[3]="/updates"

BUILT_MODULE_NAME[4]="ov01a1s"
BUILT_MODULE_NAME[4]="ov02e10"
BUILT_MODULE_LOCATION[4]="drivers/media/i2c"
DEST_MODULE_LOCATION[4]="/updates"

BUILT_MODULE_NAME[5]="ov01a10"
BUILT_MODULE_NAME[5]="hm2170"
BUILT_MODULE_LOCATION[5]="drivers/media/i2c"
DEST_MODULE_LOCATION[5]="/updates"

BUILT_MODULE_NAME[6]="ov02c10"
BUILT_MODULE_NAME[6]="hm2172"
BUILT_MODULE_LOCATION[6]="drivers/media/i2c"
DEST_MODULE_LOCATION[6]="/updates"

BUILT_MODULE_NAME[7]="ov02e10"
BUILT_MODULE_NAME[7]="hi556"
BUILT_MODULE_LOCATION[7]="drivers/media/i2c"
DEST_MODULE_LOCATION[7]="/updates"

BUILT_MODULE_NAME[8]="hm2170"
BUILT_MODULE_LOCATION[8]="drivers/media/i2c"
DEST_MODULE_LOCATION[8]="/updates"
if ! version_lt ${KERNEL_VERSION} ${KV_OV05C10}; then
BUILD_EXCLUSIVE_CONFIG="CONFIG_VIDEO_V4L2_I2C CONFIG_V4L2_CCI_I2C"
BUILT_MODULE_NAME[8]="ov05c10"
BUILT_MODULE_LOCATION[8]="drivers/media/i2c"
DEST_MODULE_LOCATION[8]="/updates"
fi

BUILT_MODULE_NAME[9]="hm2172"
BUILT_MODULE_LOCATION[9]="drivers/media/i2c"
DEST_MODULE_LOCATION[9]="/updates"
if version_lt ${KERNEL_VERSION} ${KV_OV2740}; then
BUILT_MODULE_NAME[8]="ov2740"
BUILT_MODULE_LOCATION[8]="drivers/media/i2c"
DEST_MODULE_LOCATION[8]="/updates"
fi

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

BUILT_MODULE_NAME[9]="intel-ipu6-psys"
BUILT_MODULE_LOCATION[9]="drivers/media/pci/intel/ipu6/psys"
DEST_MODULE_LOCATION[9]="/updates"

if ! version_lt ${KERNEL_VERSION} ${KV_OV05C10}; then
BUILT_MODULE_NAME[11]="ov05c10"
BUILT_MODULE_LOCATION[11]="drivers/media/i2c"
DEST_MODULE_LOCATION[11]="/updates"
fi
if version_lt ${KERNEL_VERSION} ${KV_IPU6_ISYS}; then
BUILT_MODULE_NAME[10]="intel-ipu6"
BUILT_MODULE_LOCATION[10]="drivers/media/pci/intel/ipu6"
DEST_MODULE_LOCATION[10]="/updates"

if version_lt ${KERNEL_VERSION} ${KV_OV2740}; then
BUILT_MODULE_NAME[11]="ov2740"
BUILT_MODULE_LOCATION[11]="drivers/media/i2c"
BUILT_MODULE_NAME[11]="intel-ipu6-isys"
BUILT_MODULE_LOCATION[11]="drivers/media/pci/intel/ipu6"
DEST_MODULE_LOCATION[11]="/updates"
fi

Expand Down
Loading

0 comments on commit 22b792f

Please sign in to comment.