diff --git a/Makefile b/Makefile index 67ed2bde..4a9c514a 100644 --- a/Makefile +++ b/Makefile @@ -90,18 +90,20 @@ ccflags-y := -I$(src)/include ifneq (,$(filter 1,$(KERNEL_EQ_6_17) $(KERNEL_EQ_6_18) $(KERNEL_EQ_7_0))) # IPU7 driver configs export CONFIG_VIDEO_INTEL_IPU7=m +export CONFIG_VIDEO_INTEL_IPU7_ISYS_RESET=y export CONFIG_VIDEO_INTEL_IPU6=m export CONFIG_VIDEO_INTEL_IPU6_ISYS_RESET=y -subdir-ccflags-y += -DIPU8_INSYS_NEW_ABI -subdir-ccflags-y += -DCONFIG_VIDEO_INTEL_IPU7 -subdir-ccflags-y += -DCONFIG_VIDEO_INTEL_IPU6 +subdir-ccflags-$(CONFIG_VIDEO_INTEL_IPU7) += -DCONFIG_VIDEO_INTEL_IPU7 -DIPU8_INSYS_NEW_ABI +subdir-ccflags-$(CONFIG_VIDEO_INTEL_IPU7_ISYS_RESET) += -DCONFIG_VIDEO_INTEL_IPU7_ISYS_RESET +subdir-ccflags-$(CONFIG_VIDEO_INTEL_IPU6) += -DCONFIG_VIDEO_INTEL_IPU6 +subdir-ccflags-$(CONFIG_VIDEO_INTEL_IPU6_ISYS_RESET) += -DCONFIG_VIDEO_INTEL_IPU6_ISYS_RESET # Build IPU7 drivers from submodule -obj-m += ipu7-drivers/drivers/media/pci/intel/ipu7/ +obj-$(CONFIG_VIDEO_INTEL_IPU7) += ipu7-drivers/drivers/media/pci/intel/ipu7/ # Build IPU6 drivers from submodule -obj-m += ipu6-drivers/drivers/media/pci/intel/ipu6/ +obj-$(CONFIG_VIDEO_INTEL_IPU6) += ipu6-drivers/drivers/media/pci/intel/ipu6/ # Select extracted kernel tree based on running kernel ifeq ($(KERNEL_EQ_7_0),1) diff --git a/README.md b/README.md index 699e6274..f302b65f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ This repository contains reference drivers and configurations for Intel MIPI CSI |-----------------|-------------|-----------------|----------------------------------| | AR0233+GW5300 | GMSL | Sensing | IPU6EPMTL, IPU75XA | | AR0234 | GMSL | D3 Embedded | IPU6EPMTL | -| AR0234 | MIPI CSI-2 | D3 Embedded | IPU6EPMTL | +| AR0234 | MIPI CSI-2 | D3 Embedded | IPU6EPMTL, IPU75XA, IPU8 | | AR0820+GW5300 | GMSL | Sensing | IPU6EPMTL, IPU75XA | | AR0830+AP1302 | MIPI CSI-2 | Leopard Imaging | IPU6EPMTL, IPU75XA | | ISX031 | GMSL | D3 Embedded | IPU6EP, IPU6EPMTL, IPU75XA, IPU8 | @@ -60,6 +60,7 @@ IPU8 represents NVL platforms. | | 26.04 | 7.0 Canonical | | IPU75XA | 24.04.4 | 6.17 Intel BKC | | | 24.04.4 | 6.17 Canonical | +| | 24.04.4 | 6.18 Intel BKC | | | 26.04 | 7.0 Canonical | | IPU8 | 24.04.4 | 6.18 Intel BKC | | | 24.04.4 | 7.0 IOT Next | @@ -101,7 +102,8 @@ Install these software dependencies in your target system: | IPU Version | ipu-camera-bins | ipu-camera-hal | icamerasrc | |-------------|------------------------------------------|------------------------------------------|------------------------------------------| | IPU6 | d9421fef539f24fc80c27002d5da753e193b0670 | f93eec544a5234bf0b610b3f76d64c8fa711c364 | 867c5b6ab7925c9b69b8374873a832266d97d7e5 | -| IPU7 | d235697c3bb41d56402d4805a7b82fdc938c077a | ea085c325e7a67a811a0baa5ce2d1b8f5641ea02 | 867c5b6ab7925c9b69b8374873a832266d97d7e5 | +| IPU7 | cead7320d84ee9ade4f60d74e935b16b5a760945 | ef30767553685b83034e42325992a2442c5fcb2c | 867c5b6ab7925c9b69b8374873a832266d97d7e5 | +| IPU8 | adf55525ab9d370828723b1ff8bee76ed7a492e8 | fd1efb6f2ef25fd24775a303cc71af6139d797eb | 867c5b6ab7925c9b69b8374873a832266d97d7e5 | ## Setup Procedure @@ -112,6 +114,21 @@ Initialize and update current repository recursively to ensure all dependencies git checkout main git submodule update --init --recursive +> **Note:** Workaround required for IPU7/IPU8 RAW sensor due to tuning dependency. + +By default, `ipu7-drivers` submodule tracks the tip of its `main` branch. +For IPU75XA, + + cd ipu7-drivers + git checkout 44bbc2de71fe5e7a5a7124d4c5e5900e70e13736 + cd .. + +For IPU8, + + cd ipu7-drivers + git checkout bed9b71d5be56d0e24c771c7a6ec83fd0a9db433 + cd .. + Build and install modules using DKMS sudo dkms remove ipu-camera-sensor/0.1 diff --git a/acpi/ipu6/_cam_common_ar0234.asl b/acpi/ipu6/_cam_common_ar0234.asl new file mode 100644 index 00000000..5958452f --- /dev/null +++ b/acpi/ipu6/_cam_common_ar0234.asl @@ -0,0 +1,97 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * CAM-level defines expected by caller: + * DESCH_SER_REF - Path to parent SER (e.g. \_SB.PC00.DESx.CHxx.SERx), used in _DEP + * DESCH_SER_PATH - Path to parent SER (e.g. "\\_SB.PC00.DESx.CHxx.SERx"), used in CSI2Bus and GpioIo + * DESCH_SER_GPIOREF - GPIO controller path for SER (e.g. ^^SERx), used in gpio resources (e.g. reset-gpios) + * CAM_LANES - Number of MIPI data lanes for the camera + */ + Method (_STA, 0, NotSerialized) // _STA: Status + { + Return (0x0F) // bit 0: device is present, bit 1: device is enabled, bit 2: device is shown in UI, bit 3: device is functional + } + + Method (_HID, 0, NotSerialized) // _HID: Hardware ID + { + Return ("INTC10C0") // AR0234 + } + + Name (_DEP, Package (0x01) // _DEP: Dependencies + { + DESCH_SER_REF // Path to parent SER (e.g "\\_SB.PC00.DESx.CHxx.SERx") + }) + + Name(_CRS, ResourceTemplate () // _CRS: Current Resource Settings +{ + /* + * mipi-disco-img.c will use the information in CSI2Bus to create fwnode. + * CAMx Local Port -> SERx Remote Port + * CAMx PRT0 -> SERx PRT0 + */ + CSI2Bus( + DeviceInitiated, // SlaveMode + 1, // PhyType (1 for DPHY) + 0, // LocalPort (AR0234 only 1 PHY) + DESCH_SER_PATH, // ResourceSource (Path to parent SERx, e.g. "\\_SB.PC00.DESx.CHxx.SERx") + 0, // ResourceSourceIndex (e.g. 0 for SERx PRT0) + , // ResourceUsage + , // DescriptorName + ) // VendorData + + I2cSerialBusV2 ( + 0x0010, // SlaveAddress (0x10 based on AR0234 hardware) + ControllerInitiated, // SlaveMode + 0x00061A80, // ConnectionSpeed + AddressingMode7Bit, // AddressingMode + DESCH_SER_PATH, // ResourceSource (Path to parent SER, e.g. "\\_SB.PC00.DESx.CHxx.SERx") + 0x00, // ResourceSourceIndex + ResourceConsumer, // ResourceUsage + , // DescriptorName + Exclusive, // Shared + ) // VendorData +}) + +Name (_DSD, Package () // _DSD: Device-Specific Data +{ + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties for _DSD + Package () + { + Package () { "mipi-img-clock-frequency", 96000000 }, // 96 MHz + + /* + * Sensor specific GPIOs, reset-gpios will be used by ar0234.c + * when devm_gpiod_get_optional is being called with "reset" consumer. + * For details, please refer to ACPI GPIO binding documentation + * https://www.kernel.org/doc/html/latest/firmware-guide/acpi/gpio-properties.html + * + * DESCH_SER_GPIOREF is the GPIO controller from parent SERx + * 0 is the GPIO pin group in parent SERx + * 0 is the index of pin in the GPIO pin group in parent SERx + * 1 is active low for reset + * + */ + Package () { "reset-gpios", Package () { DESCH_SER_GPIOREF, 0, 0, 1 } }, + }, + ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), // Hierarchical Data Extension + Package () + { + /* mipi-img-port here are NOT actual MIPI ports, but is used by mipi-disco-img.c to create fwnode. */ + Package () { "mipi-img-port-0", "PRT0" }, // Connected to SERx PRTx (used by CAMx CSI2Bus LocalPort) + }, +}) + +Name (PRT0, Package() +{ + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties + Package () + { + Package () { "mipi-img-clock-lanes", 0 }, + #if CAM_LANES == 4 + Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, + #else + Package () { "mipi-img-data-lanes", Package() { 1, 2 } }, + #endif + }, +}) \ No newline at end of file diff --git a/acpi/ipu6/_cam_common_d457.asl b/acpi/ipu6/_cam_common_d457.asl index 38930bc0..e17865ce 100644 --- a/acpi/ipu6/_cam_common_d457.asl +++ b/acpi/ipu6/_cam_common_d457.asl @@ -87,7 +87,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if CAM_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, #elif CAM_LANES == 2 diff --git a/acpi/ipu6/_cam_common_isx031.asl b/acpi/ipu6/_cam_common_isx031.asl index b68f6b8b..1ab9c3f7 100644 --- a/acpi/ipu6/_cam_common_isx031.asl +++ b/acpi/ipu6/_cam_common_isx031.asl @@ -101,7 +101,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if CAM_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, #elif CAM_LANES == 2 diff --git a/acpi/ipu6/_des_ch_common_ar0234.asl b/acpi/ipu6/_des_ch_common_ar0234.asl new file mode 100644 index 00000000..e27a3390 --- /dev/null +++ b/acpi/ipu6/_des_ch_common_ar0234.asl @@ -0,0 +1,55 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * Description: Common template for each AR0234 GMSL camera under each deserializer link, + * where each link is represented as an ATR channel device. + * + * DES-level defines expected by caller: + * DES_PATH - DESx ACPI path string (e.g., "\\_SB.PC00.DES0") + * DES_REF - DESx ACPI namespace reference (e.g., \_SB.PC00.DES0) + * + * Channel-level defines expected by caller: + * DESCH_CH - Channel device name (e.g., CH00) + * DESCH_SER - Serializer device name (e.g., SER0) + * DESCH_CAM - Camera device name (e.g., CAM0) + * DESCH_CH_PATH - CHxx ACPI path string (e.g., "\\_SB.PC00.DES0.CH00") + * DESCH_SER_PATH - SERx ACPI path string (e.g., "\\_SB.PC00.DES0.CH00.SER0") + * DESCH_SER_REF - SERx ACPI namespace reference (e.g., \_SB.PC00.DES0.CH00.SER0) + * DESCH_SER_I2C - SERx I2C address (e.g., 0x40) + * DESCH_LINK_NUM - Channel/link number (0, 1, 2, 3) - used for _ADR, reg, and SER remote port + * DESCH_SER_GPIOREF - SERx GPIO controller reference (e.g., ^^SER0, ^^SER1, etc.) + * CAM_LANES - CAMx Number of MIPI data lanes for the camera (e.g., 2, 4) + * Optional defines: + * DESCH_SER_EXTRA_GPIO_PIN - SERx Additional GPIO pin number (e.g., 7 for MFP7 in MAX9295A) + * DESCH_SER_X/Y/Z/U_VC - SERx VC filter for Pipe X/Y/Z/U, specifically for MAX96717 driver + */ + +Device (DESCH_CH) // New CHxx Device under parent DESx device for each DES channel/link +{ + /* + * Channel is the naming convention used by i2c-mux or i2c-atr in ACPI namespace + * In GMSL context, it can directly be translated as Link 0/1/2/3 of the Deserializer + */ + + Name (_ADR, DESCH_LINK_NUM) // _ADR: Address for the channel (e.g. 0 for Link 0, 1 for Link 1) + + Name (_DSD, Package () // _DSD: Device Specific Data + { + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties + Package () + { + Package () { "reg", DESCH_LINK_NUM }, // used by i2c-atr driver. Represents the channel / link number + } + }) + + Device (DESCH_SER) // SERx device under parent DESx.CHxx + { + #include "_ser_common_max9295.asl" + + Device (DESCH_CAM) // CAMx device under parent DESx.CHxx.SERx + { + #include "_cam_common_ar0234.asl" + } + } +} \ No newline at end of file diff --git a/acpi/ipu6/_des_common_max9296.asl b/acpi/ipu6/_des_common_max9296.asl index 19e3109b..c0dc4929 100644 --- a/acpi/ipu6/_des_common_max9296.asl +++ b/acpi/ipu6/_des_common_max9296.asl @@ -90,7 +90,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4} }, }, }) @@ -100,7 +100,7 @@ Name (PRT1, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, }) @@ -110,7 +110,7 @@ Name (PRT2, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 2 Package () { "mipi-img-data-lanes", Package() { 1, 2 } }, #else @@ -125,7 +125,7 @@ Name (PRT3, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 2 Package () { "mipi-img-data-lanes", Package() { 1, 2 } }, #else diff --git a/acpi/ipu6/_des_common_max96724.asl b/acpi/ipu6/_des_common_max96724.asl index 23de1eb1..5868783c 100644 --- a/acpi/ipu6/_des_common_max96724.asl +++ b/acpi/ipu6/_des_common_max96724.asl @@ -105,7 +105,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4} }, }, }) @@ -115,7 +115,7 @@ Name (PRT1, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, @@ -126,7 +126,7 @@ Name (PRT2, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } }, }, }) @@ -136,7 +136,7 @@ Name (PRT3, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, @@ -147,7 +147,7 @@ Name (PRT4, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0}, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else @@ -164,13 +164,13 @@ Name (PRT5, Package() { #if DES_LANES == 4 #if DES_PHY_TYPE == 1 - Package () { "mipi-img-clock-lanes", 5 }, // DPHY uses alternate CKCP PHY0 clock lane + Package () { "mipi-img-clock-lane", 5 }, // DPHY uses alternate CKCP PHY0 clock lane #else - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #endif Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2 } }, // 2 lanes for CPHY/DPHY on Intel MIPI CRD #endif Package () { "mipi-img-link-frequencies", Package() { LINK_FREQ } }, @@ -182,7 +182,7 @@ Name (PRT6, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0}, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else @@ -197,7 +197,7 @@ Name (PRT7, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else diff --git a/acpi/ipu6/_mipi_cam_common_isx031.asl b/acpi/ipu6/_mipi_cam_common_isx031.asl new file mode 100644 index 00000000..0713d180 --- /dev/null +++ b/acpi/ipu6/_mipi_cam_common_isx031.asl @@ -0,0 +1,112 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * Description: Common template for a direct MIPI CSI-2 ISX031 camera device. + * This include provides the body of a CAMx device for native MIPI. + * + * CAM-level defines expected by caller: + * CAM_I2C_BUS - Camera I2C bus path (e.g. "\\_SB.PC00.I2C1") + * CAM_I2C_ADDR - Camera I2C slave address (e.g. 0x001A) + * CAM_TO_MIPI_PORT - Connected IPU MIPI port index (e.g. 0, 1, 2) + * CAM_LANES - Number of MIPI data lanes (e.g. 2, 4) + * CAM_GPIO_CTLR - GPIO controller path (e.g. "\\_SB.GPI1") + * CAM_RESET_PIN - GPIO pin number for RESET + * CAM_IPU_PATH - IPU path string (e.g. "\\_SB.PC00.IPU0") + * CAM_IPU_REF - IPU namespace reference (e.g. \_SB.PC00.IPU0) + * CAM_GPIO_REF - Device self-reference for reset-gpios (e.g. ^CAM0) + */ +Method (_STA, 0, NotSerialized) // _STA: Status +{ + Return (0x0F) +} + +Method (_HID, 0, NotSerialized) // _HID: Hardware ID +{ + Return ("INTC113C") // ISX031 +} + +Name (_DEP, Package (0x01) // _DEP: Dependencies +{ + CAM_IPU_REF +}) + +Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings +{ + /* + * mipi-disco-img.c will use the information in CSI2Bus to create fwnode. + * CAMx Local Port -> IPU Remote Port + * CAMx PRT0 -> IPU PRTx (selected by CAM_TO_MIPI_PORT) + */ + CSI2Bus( + DeviceInitiated, // SlaveMode + 1, // PhyType (1 for DPHY) + 0, // LocalPort (sensor local port) + CAM_IPU_PATH, // ResourceSource (Path to IPU) + CAM_TO_MIPI_PORT, // ResourceSourceIndex (IPU PRTx) + , // ResourceUsage + , // DescriptorName + ) // VendorData + + I2cSerialBusV2 ( + CAM_I2C_ADDR, // SlaveAddress + ControllerInitiated, // SlaveMode + 400000, // I2C ConnectionSpeed + AddressingMode7Bit, // AddressingMode + CAM_I2C_BUS, // ResourceSource + 0x00, // ResourceSourceIndex + ResourceConsumer, // ResourceUsage + , // DescriptorName + Exclusive, // Shared + ) // VendorData + + /* GPIO for sensor RESET (directly from SoC GPIO controller) */ + GpioIo ( + Exclusive, // Shared (Not shared) + PullNone, // PinConfig (No need for pulls) + 0, // DebounceTimeout + 0, // DriveStrength + IoRestrictionOutputOnly,// IoRestriction (Only used as output) + CAM_GPIO_CTLR, // ResourceSource (GPIO controller) + 0) // ResourceSourceIndex (Must be 0) + { + CAM_RESET_PIN // Pin number + } +}) + +Name (_DSD, Package () // _DSD: Device-Specific Data +{ + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties + Package () + { + Package () { "mipi-img-clock-frequency", 96000000 }, // 96 MHz + /* + * reset-gpios: used by isx031.c driver via + * devm_gpiod_get_optional(dev, "reset", ...) + * Format: { , , , } + */ + Package () { "reset-gpios", Package () { CAM_GPIO_REF, 0, 0, 1 } }, + }, + ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), // Hierarchical Data Extension + Package () + { + /* mipi-img-port here is local camera port used by mipi-disco-img.c. */ + Package () { "mipi-img-port-0", "PRT0" }, + }, +}) + +Name (PRT0, Package () +{ + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties + Package () + { + Package () { "mipi-img-clock-lane", 0 }, +#if CAM_LANES == 4 + Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } }, +#elif CAM_LANES == 2 + Package () { "mipi-img-data-lanes", Package () { 1, 2 } }, +#else + Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } }, +#endif + }, +}) diff --git a/acpi/ipu6/_ser_common_max9295.asl b/acpi/ipu6/_ser_common_max9295.asl index 465a9938..6bd3b263 100644 --- a/acpi/ipu6/_ser_common_max9295.asl +++ b/acpi/ipu6/_ser_common_max9295.asl @@ -105,7 +105,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if CAM_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 data lanes #elif CAM_LANES == 2 @@ -121,7 +121,7 @@ Name (PRT1, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, }) diff --git a/acpi/ipu6/max9296_d3_ar0234.asl b/acpi/ipu6/max9296_d3_ar0234.asl new file mode 100644 index 00000000..a71a2d22 --- /dev/null +++ b/acpi/ipu6/max9296_d3_ar0234.asl @@ -0,0 +1,118 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * SSDT overlay: D3 AR0234 GMSL camera configuration with MAX9296A deserializer on IPU6EPMTL platform. + * One MAX9296A deserializer (DES0, two GMSL links) with DPHY connection to IPU6EPMTL platform, + * carrying two AR0234 cameras over GMSL Links 0..1, fronted by MAX9295A serializers. + * + * + * DES-level defines (set per DESx, undef'd at the end of each Device): + * DES_PHY_TYPE - DES PHY type (0 for CPHY, 1 for DPHY) + * DES_I2C_ADDR - DES I2C slave address (e.g. 0x0048 for MAX9296A) + * DES_LANES - Number of MIPI data lanes (e.g. 2, 4) + * DES_INTERNAL_PHY - DES internal PHY index (MAX9296A: 1 or 2) + * DES_TO_MIPI_PORT - DES connected to IPU0 MIPI port (e.g. 0/1/2/3) + * DES_I2C_BUS - DES I2C bus path (e.g. "\\_SB.PC00.I2C1") + * DES_PATH - DES ACPI path string (e.g. "\\_SB.PC00.DES0") + * DES_REF - DES ACPI namespace reference (e.g. \_SB.PC00.DES0) + * + * Channel-level defines (set per CHxx, undef'd by _des_ch_common_ar0234.asl): + * DESCH_LINK_NUM - Channel/link number (0..1 for MAX9296A) - used for _ADR, reg, SER remote port + * DESCH_CH - Channel device name (e.g. CH00) + * DESCH_SER - Serializer device name (e.g. SER0) + * DESCH_CAM - Camera device name (e.g. CAM0) + * DESCH_SER_I2C - SER I2C slave address (e.g. 0x40 for MAX9295A) + * DESCH_CH_PATH - CHxx ACPI path string (e.g. "\\_SB.PC00.DES0.CH00") + * DESCH_SER_PATH - SERx ACPI path string (e.g. "\\_SB.PC00.DES0.CH00.SER0") + * DESCH_SER_REF - SERx ACPI namespace reference (e.g. \_SB.PC00.DES0.CH00.SER0) + * DESCH_SER_GPIOREF - SERx GPIO controller reference (e.g. ^^SER0) + * CAM_ALIAS - Camera alias I2C address used in i2c-alias-pool of the SER + * CAM_LANES - Number of MIPI data lanes for the camera (e.g. 2, 4) + */ + +DefinitionBlock ("", "SSDT", 2, "", "IMG_IPU", 0x20260715) +{ + External (_SB.PC00, DeviceObj) + + Include ("_ipu.asl") + + Scope (\_SB.PC00) + { + Device (DES0) + { + //DES-level defines for DES0 + #define DES_PHY_TYPE 1 + #define DES_I2C_ADDR 0x0048 + #define DES_LANES 4 + #define DES_INTERNAL_PHY 2 + #define DES_TO_MIPI_PORT 0 + #define DES_I2C_BUS "\\_SB.PC00.I2C1" + #define DES_PATH "\\_SB.PC00.DES0" + #define DES_REF \_SB.PC00.DES0 + #define LINK_FREQ 700000000 + #include "_des_common_max9296.asl" + + // Channel 0 + #define DESCH_LINK_NUM 0 + #define DESCH_CH CH00 + #define DESCH_SER SER0 + #define DESCH_CAM CAM0 + #define DESCH_SER_I2C 0x40 + #define DESCH_CH_PATH "\\_SB.PC00.DES0.CH00" + #define DESCH_SER_PATH "\\_SB.PC00.DES0.CH00.SER0" + #define DESCH_SER_REF \_SB.PC00.DES0.CH00.SER0 + #define DESCH_SER_GPIOREF ^^SER0 + #define CAM_ALIAS 0x54 + #define CAM_LANES 2 + #include "_des_ch_common_ar0234.asl" + #undef DESCH_CH + #undef DESCH_SER + #undef DESCH_CAM + #undef DESCH_CH_PATH + #undef DESCH_SER_PATH + #undef DESCH_SER_REF + #undef DESCH_LINK_NUM + #undef DESCH_SER_I2C + #undef DESCH_SER_GPIOREF + #undef CAM_ALIAS + #undef CAM_LANES + + // Channel 1 + #define DESCH_LINK_NUM 1 + #define DESCH_CH CH01 + #define DESCH_SER SER1 + #define DESCH_CAM CAM1 + #define DESCH_SER_I2C 0x40 + #define DESCH_CH_PATH "\\_SB.PC00.DES0.CH01" + #define DESCH_SER_PATH "\\_SB.PC00.DES0.CH01.SER1" + #define DESCH_SER_REF \_SB.PC00.DES0.CH01.SER1 + #define DESCH_SER_GPIOREF ^^SER1 + #define CAM_ALIAS 0x55 + #define CAM_LANES 2 + #include "_des_ch_common_ar0234.asl" + #undef DESCH_CH + #undef DESCH_SER + #undef DESCH_CAM + #undef DESCH_CH_PATH + #undef DESCH_SER_PATH + #undef DESCH_SER_REF + #undef DESCH_LINK_NUM + #undef DESCH_SER_I2C + #undef DESCH_SER_GPIOREF + #undef CAM_ALIAS + #undef CAM_LANES + + // Clean up DES-level defines + #undef DES_PHY_TYPE + #undef DES_I2C_ADDR + #undef DES_LANES + #undef DES_INTERNAL_PHY + #undef DES_TO_MIPI_PORT + #undef DES_I2C_BUS + #undef DES_PATH + #undef DES_REF + #undef LINK_FREQ + } + } +} \ No newline at end of file diff --git a/acpi/ipu6/max96724_dphy_d3_isx031.asl b/acpi/ipu6/max96724_dphy_d3_isx031.asl index bd569a30..3cea8a0a 100644 --- a/acpi/ipu6/max96724_dphy_d3_isx031.asl +++ b/acpi/ipu6/max96724_dphy_d3_isx031.asl @@ -178,7 +178,7 @@ DefinitionBlock ("", "SSDT", 2, "", "IMG_IPU", 0x20260513) // DES-level defines for DES1. #define DES_PHY_TYPE 1 #define DES_I2C_ADDR 0x0027 - #define DES_LANES 2 + #define DES_LANES 4 #define DES_INTERNAL_PHY 6 #define DES_TO_MIPI_PORT 4 #define DES_I2C_BUS "\\_SB.PC00.I2C0" diff --git a/acpi/ipu6/mipi_isx031.asl b/acpi/ipu6/mipi_isx031.asl new file mode 100644 index 00000000..d9df2e9d --- /dev/null +++ b/acpi/ipu6/mipi_isx031.asl @@ -0,0 +1,79 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * SSDT overlay: Direct MIPI CSI-2 ISX031 camera configuration on MTL platform. + * + * This overlay describes a native MIPI-connected ISX031 sensor (no GMSL SERDES). + * Adjust the CAM_* defines below to match your hardware wiring. + * + * CAM-level defines (set per CAMx, see _mipi_cam_common_isx031.asl): + * CAM_I2C_BUS - Camera I2C bus path (e.g. "\\_SB.PC00.I2C1") + * CAM_I2C_ADDR - Camera I2C slave address (e.g. 0x001A for ISX031) + * CAM_TO_MIPI_PORT - Connected IPU0 MIPI port (e.g. 0/1/2/3/4/5) + * CAM_LANES - Number of MIPI data lanes (e.g. 2, 4) + * CAM_GPIO_CTLR - GPIO controller path (e.g. "\\_SB.GPI0") + * CAM_RESET_PIN - GPIO pin number for RESET (community-relative) + * CAM_IPU_PATH - IPU path string (e.g. "\\_SB.PC00.IPU0") + * CAM_IPU_REF - IPU namespace reference (e.g. \_SB.PC00.IPU0) + * CAM_GPIO_REF - Device self-reference for reset-gpios (e.g. ^CAM0) + */ + +DefinitionBlock ("", "SSDT", 2, "", "IMG_IPU", 0x20260807) +{ + External (_SB.PC00, DeviceObj) + External (_SB.PC00.IPU0, DeviceObj) + External (_SB.GPI0, DeviceObj) // GPIO controller COM0 for CAM0 RESET + External (_SB.GPI3, DeviceObj) // GPIO controller COM3 for CAM1 RESET + + Include ("_ipu.asl") + + Scope (\_SB.PC00) + { + Device (CAM0) + { + #define CAM_I2C_BUS "\\_SB.PC00.I2C1" + #define CAM_I2C_ADDR 0x001A + #define CAM_TO_MIPI_PORT 0 + #define CAM_LANES 4 + #define CAM_GPIO_CTLR "\\_SB.GPI0" + #define CAM_RESET_PIN 48 // GPP_D_23 (COM0: vGPIO_3 0-24, GPP_D starts at 25) + #define CAM_IPU_PATH "\\_SB.PC00.IPU0" + #define CAM_IPU_REF \_SB.PC00.IPU0 + #define CAM_GPIO_REF ^CAM0 + #include "_mipi_cam_common_isx031.asl" + #undef CAM_I2C_BUS + #undef CAM_I2C_ADDR + #undef CAM_TO_MIPI_PORT + #undef CAM_LANES + #undef CAM_GPIO_CTLR + #undef CAM_RESET_PIN + #undef CAM_IPU_PATH + #undef CAM_IPU_REF + #undef CAM_GPIO_REF + } + + Device (CAM1) + { + #define CAM_I2C_BUS "\\_SB.PC00.I2C0" + #define CAM_I2C_ADDR 0x001A + #define CAM_TO_MIPI_PORT 4 + #define CAM_LANES 4 + #define CAM_GPIO_CTLR "\\_SB.GPI3" + #define CAM_RESET_PIN 0 // GPP_H_0 (COM3: GPP_H starts at 0) + #define CAM_IPU_PATH "\\_SB.PC00.IPU0" + #define CAM_IPU_REF \_SB.PC00.IPU0 + #define CAM_GPIO_REF ^CAM1 + #include "_mipi_cam_common_isx031.asl" + #undef CAM_I2C_BUS + #undef CAM_I2C_ADDR + #undef CAM_TO_MIPI_PORT + #undef CAM_LANES + #undef CAM_GPIO_CTLR + #undef CAM_RESET_PIN + #undef CAM_IPU_PATH + #undef CAM_IPU_REF + #undef CAM_GPIO_REF + } + } +} diff --git a/acpi/ipu7/_cam_common_d457.asl b/acpi/ipu7/_cam_common_d457.asl index 7fbd05dd..74f93cac 100644 --- a/acpi/ipu7/_cam_common_d457.asl +++ b/acpi/ipu7/_cam_common_d457.asl @@ -91,7 +91,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if CAM_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, #elif CAM_LANES == 2 diff --git a/acpi/ipu7/_cam_common_isx031.asl b/acpi/ipu7/_cam_common_isx031.asl index d4231542..a4e9fc5d 100644 --- a/acpi/ipu7/_cam_common_isx031.asl +++ b/acpi/ipu7/_cam_common_isx031.asl @@ -105,7 +105,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if CAM_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, #elif CAM_LANES == 2 diff --git a/acpi/ipu7/_des_common_max96724.asl b/acpi/ipu7/_des_common_max96724.asl index 2a268f48..d3030cc9 100644 --- a/acpi/ipu7/_des_common_max96724.asl +++ b/acpi/ipu7/_des_common_max96724.asl @@ -104,7 +104,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4} }, }, }) @@ -114,7 +114,7 @@ Name (PRT1, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, @@ -125,7 +125,7 @@ Name (PRT2, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } }, }, }) @@ -135,7 +135,7 @@ Name (PRT3, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, @@ -146,7 +146,7 @@ Name (PRT4, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else @@ -161,7 +161,7 @@ Name (PRT5, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else @@ -176,7 +176,7 @@ Name (PRT6, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else @@ -191,7 +191,7 @@ Name (PRT7, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else diff --git a/acpi/ipu7/_mipi_cam_common_isx031.asl b/acpi/ipu7/_mipi_cam_common_isx031.asl new file mode 100644 index 00000000..0713d180 --- /dev/null +++ b/acpi/ipu7/_mipi_cam_common_isx031.asl @@ -0,0 +1,112 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * Description: Common template for a direct MIPI CSI-2 ISX031 camera device. + * This include provides the body of a CAMx device for native MIPI. + * + * CAM-level defines expected by caller: + * CAM_I2C_BUS - Camera I2C bus path (e.g. "\\_SB.PC00.I2C1") + * CAM_I2C_ADDR - Camera I2C slave address (e.g. 0x001A) + * CAM_TO_MIPI_PORT - Connected IPU MIPI port index (e.g. 0, 1, 2) + * CAM_LANES - Number of MIPI data lanes (e.g. 2, 4) + * CAM_GPIO_CTLR - GPIO controller path (e.g. "\\_SB.GPI1") + * CAM_RESET_PIN - GPIO pin number for RESET + * CAM_IPU_PATH - IPU path string (e.g. "\\_SB.PC00.IPU0") + * CAM_IPU_REF - IPU namespace reference (e.g. \_SB.PC00.IPU0) + * CAM_GPIO_REF - Device self-reference for reset-gpios (e.g. ^CAM0) + */ +Method (_STA, 0, NotSerialized) // _STA: Status +{ + Return (0x0F) +} + +Method (_HID, 0, NotSerialized) // _HID: Hardware ID +{ + Return ("INTC113C") // ISX031 +} + +Name (_DEP, Package (0x01) // _DEP: Dependencies +{ + CAM_IPU_REF +}) + +Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings +{ + /* + * mipi-disco-img.c will use the information in CSI2Bus to create fwnode. + * CAMx Local Port -> IPU Remote Port + * CAMx PRT0 -> IPU PRTx (selected by CAM_TO_MIPI_PORT) + */ + CSI2Bus( + DeviceInitiated, // SlaveMode + 1, // PhyType (1 for DPHY) + 0, // LocalPort (sensor local port) + CAM_IPU_PATH, // ResourceSource (Path to IPU) + CAM_TO_MIPI_PORT, // ResourceSourceIndex (IPU PRTx) + , // ResourceUsage + , // DescriptorName + ) // VendorData + + I2cSerialBusV2 ( + CAM_I2C_ADDR, // SlaveAddress + ControllerInitiated, // SlaveMode + 400000, // I2C ConnectionSpeed + AddressingMode7Bit, // AddressingMode + CAM_I2C_BUS, // ResourceSource + 0x00, // ResourceSourceIndex + ResourceConsumer, // ResourceUsage + , // DescriptorName + Exclusive, // Shared + ) // VendorData + + /* GPIO for sensor RESET (directly from SoC GPIO controller) */ + GpioIo ( + Exclusive, // Shared (Not shared) + PullNone, // PinConfig (No need for pulls) + 0, // DebounceTimeout + 0, // DriveStrength + IoRestrictionOutputOnly,// IoRestriction (Only used as output) + CAM_GPIO_CTLR, // ResourceSource (GPIO controller) + 0) // ResourceSourceIndex (Must be 0) + { + CAM_RESET_PIN // Pin number + } +}) + +Name (_DSD, Package () // _DSD: Device-Specific Data +{ + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties + Package () + { + Package () { "mipi-img-clock-frequency", 96000000 }, // 96 MHz + /* + * reset-gpios: used by isx031.c driver via + * devm_gpiod_get_optional(dev, "reset", ...) + * Format: { , , , } + */ + Package () { "reset-gpios", Package () { CAM_GPIO_REF, 0, 0, 1 } }, + }, + ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), // Hierarchical Data Extension + Package () + { + /* mipi-img-port here is local camera port used by mipi-disco-img.c. */ + Package () { "mipi-img-port-0", "PRT0" }, + }, +}) + +Name (PRT0, Package () +{ + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties + Package () + { + Package () { "mipi-img-clock-lane", 0 }, +#if CAM_LANES == 4 + Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } }, +#elif CAM_LANES == 2 + Package () { "mipi-img-data-lanes", Package () { 1, 2 } }, +#else + Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } }, +#endif + }, +}) diff --git a/acpi/ipu7/_ser_common_max9295.asl b/acpi/ipu7/_ser_common_max9295.asl index e874e863..066ecfea 100644 --- a/acpi/ipu7/_ser_common_max9295.asl +++ b/acpi/ipu7/_ser_common_max9295.asl @@ -109,7 +109,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if CAM_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 data lanes #elif CAM_LANES == 2 @@ -125,7 +125,7 @@ Name (PRT1, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, }) diff --git a/acpi/ipu7/mipi_isx031.asl b/acpi/ipu7/mipi_isx031.asl new file mode 100644 index 00000000..f3582881 --- /dev/null +++ b/acpi/ipu7/mipi_isx031.asl @@ -0,0 +1,78 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * SSDT overlay: Direct MIPI CSI-2 ISX031 camera configuration on PTL platform. + * + * This overlay describes a native MIPI-connected ISX031 sensor (no GMSL SERDES). + * Adjust the CAM_* defines below to match your hardware wiring. + * + * CAM-level defines (set per CAMx, see _mipi_cam_common_isx031.asl): + * CAM_I2C_BUS - Camera I2C bus path (e.g. "\\_SB.PC00.I2C1") + * CAM_I2C_ADDR - Camera I2C slave address (e.g. 0x001A for ISX031) + * CAM_TO_MIPI_PORT - Connected IPU0 MIPI port (e.g. 0/1/2) + * CAM_LANES - Number of MIPI data lanes (e.g. 2, 4) + * CAM_GPIO_CTLR - GPIO controller path (e.g. "\\_SB.GPI1") + * CAM_RESET_PIN - GPIO pin number for RESET (e.g. 27 for GPP_E_1) + * CAM_IPU_PATH - IPU path string (e.g. "\\_SB.PC00.IPU0") + * CAM_IPU_REF - IPU namespace reference (e.g. \_SB.PC00.IPU0) + * CAM_GPIO_REF - Device self-reference for reset-gpios (e.g. ^CAM0) + */ + +DefinitionBlock ("", "SSDT", 2, "", "IMG_IPU", 0x20260807) +{ + External (_SB.PC00, DeviceObj) + External (_SB.PC00.IPU0, DeviceObj) + External (_SB.GPI1, DeviceObj) // GPIO controller for RESET + + Include ("_ipu.asl") + + Scope (\_SB.PC00) + { + Device (CAM0) + { + #define CAM_I2C_BUS "\\_SB.PC00.I2C1" + #define CAM_I2C_ADDR 0x001A + #define CAM_TO_MIPI_PORT 0 + #define CAM_LANES 4 + #define CAM_GPIO_CTLR "\\_SB.GPI1" + #define CAM_RESET_PIN 27 + #define CAM_IPU_PATH "\\_SB.PC00.IPU0" + #define CAM_IPU_REF \_SB.PC00.IPU0 + #define CAM_GPIO_REF ^CAM0 + #include "_mipi_cam_common_isx031.asl" + #undef CAM_I2C_BUS + #undef CAM_I2C_ADDR + #undef CAM_TO_MIPI_PORT + #undef CAM_LANES + #undef CAM_GPIO_CTLR + #undef CAM_RESET_PIN + #undef CAM_IPU_PATH + #undef CAM_IPU_REF + #undef CAM_GPIO_REF + } + + Device (CAM1) + { + #define CAM_I2C_BUS "\\_SB.PC00.I2C2" + #define CAM_I2C_ADDR 0x001A + #define CAM_TO_MIPI_PORT 2 + #define CAM_LANES 2 + #define CAM_GPIO_CTLR "\\_SB.GPI1" + #define CAM_RESET_PIN 36 + #define CAM_IPU_PATH "\\_SB.PC00.IPU0" + #define CAM_IPU_REF \_SB.PC00.IPU0 + #define CAM_GPIO_REF ^CAM1 + #include "_mipi_cam_common_isx031.asl" + #undef CAM_I2C_BUS + #undef CAM_I2C_ADDR + #undef CAM_TO_MIPI_PORT + #undef CAM_LANES + #undef CAM_GPIO_CTLR + #undef CAM_RESET_PIN + #undef CAM_IPU_PATH + #undef CAM_IPU_REF + #undef CAM_GPIO_REF + } + } +} diff --git a/acpi/ipu8/_cam_common_d457.asl b/acpi/ipu8/_cam_common_d457.asl index 38930bc0..e17865ce 100644 --- a/acpi/ipu8/_cam_common_d457.asl +++ b/acpi/ipu8/_cam_common_d457.asl @@ -87,7 +87,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if CAM_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, #elif CAM_LANES == 2 diff --git a/acpi/ipu8/_cam_common_isx031.asl b/acpi/ipu8/_cam_common_isx031.asl index b68f6b8b..1ab9c3f7 100644 --- a/acpi/ipu8/_cam_common_isx031.asl +++ b/acpi/ipu8/_cam_common_isx031.asl @@ -101,7 +101,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if CAM_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, #elif CAM_LANES == 2 diff --git a/acpi/ipu8/_des_common_max96724.asl b/acpi/ipu8/_des_common_max96724.asl index 5535c05b..60450fd7 100644 --- a/acpi/ipu8/_des_common_max96724.asl +++ b/acpi/ipu8/_des_common_max96724.asl @@ -100,7 +100,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4} }, }, }) @@ -110,7 +110,7 @@ Name (PRT1, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, @@ -121,7 +121,7 @@ Name (PRT2, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } }, }, }) @@ -131,7 +131,7 @@ Name (PRT3, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, @@ -142,7 +142,7 @@ Name (PRT4, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else @@ -157,7 +157,7 @@ Name (PRT5, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else @@ -172,7 +172,7 @@ Name (PRT6, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else @@ -187,7 +187,7 @@ Name (PRT7, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if DES_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 lanes for DPHY on Intel MIPI CRD #else diff --git a/acpi/ipu8/_ipu.asl b/acpi/ipu8/_ipu.asl index 55499351..8fa36119 100644 --- a/acpi/ipu8/_ipu.asl +++ b/acpi/ipu8/_ipu.asl @@ -38,7 +38,7 @@ Scope (\_SB.PC00.IPU0) { ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } } + Package () { "mipi-img-data-lanes", Package () { 1, 2 } } }, }) } diff --git a/acpi/ipu8/_mipi_cam_common_isx031.asl b/acpi/ipu8/_mipi_cam_common_isx031.asl new file mode 100644 index 00000000..0713d180 --- /dev/null +++ b/acpi/ipu8/_mipi_cam_common_isx031.asl @@ -0,0 +1,112 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * Description: Common template for a direct MIPI CSI-2 ISX031 camera device. + * This include provides the body of a CAMx device for native MIPI. + * + * CAM-level defines expected by caller: + * CAM_I2C_BUS - Camera I2C bus path (e.g. "\\_SB.PC00.I2C1") + * CAM_I2C_ADDR - Camera I2C slave address (e.g. 0x001A) + * CAM_TO_MIPI_PORT - Connected IPU MIPI port index (e.g. 0, 1, 2) + * CAM_LANES - Number of MIPI data lanes (e.g. 2, 4) + * CAM_GPIO_CTLR - GPIO controller path (e.g. "\\_SB.GPI1") + * CAM_RESET_PIN - GPIO pin number for RESET + * CAM_IPU_PATH - IPU path string (e.g. "\\_SB.PC00.IPU0") + * CAM_IPU_REF - IPU namespace reference (e.g. \_SB.PC00.IPU0) + * CAM_GPIO_REF - Device self-reference for reset-gpios (e.g. ^CAM0) + */ +Method (_STA, 0, NotSerialized) // _STA: Status +{ + Return (0x0F) +} + +Method (_HID, 0, NotSerialized) // _HID: Hardware ID +{ + Return ("INTC113C") // ISX031 +} + +Name (_DEP, Package (0x01) // _DEP: Dependencies +{ + CAM_IPU_REF +}) + +Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings +{ + /* + * mipi-disco-img.c will use the information in CSI2Bus to create fwnode. + * CAMx Local Port -> IPU Remote Port + * CAMx PRT0 -> IPU PRTx (selected by CAM_TO_MIPI_PORT) + */ + CSI2Bus( + DeviceInitiated, // SlaveMode + 1, // PhyType (1 for DPHY) + 0, // LocalPort (sensor local port) + CAM_IPU_PATH, // ResourceSource (Path to IPU) + CAM_TO_MIPI_PORT, // ResourceSourceIndex (IPU PRTx) + , // ResourceUsage + , // DescriptorName + ) // VendorData + + I2cSerialBusV2 ( + CAM_I2C_ADDR, // SlaveAddress + ControllerInitiated, // SlaveMode + 400000, // I2C ConnectionSpeed + AddressingMode7Bit, // AddressingMode + CAM_I2C_BUS, // ResourceSource + 0x00, // ResourceSourceIndex + ResourceConsumer, // ResourceUsage + , // DescriptorName + Exclusive, // Shared + ) // VendorData + + /* GPIO for sensor RESET (directly from SoC GPIO controller) */ + GpioIo ( + Exclusive, // Shared (Not shared) + PullNone, // PinConfig (No need for pulls) + 0, // DebounceTimeout + 0, // DriveStrength + IoRestrictionOutputOnly,// IoRestriction (Only used as output) + CAM_GPIO_CTLR, // ResourceSource (GPIO controller) + 0) // ResourceSourceIndex (Must be 0) + { + CAM_RESET_PIN // Pin number + } +}) + +Name (_DSD, Package () // _DSD: Device-Specific Data +{ + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties + Package () + { + Package () { "mipi-img-clock-frequency", 96000000 }, // 96 MHz + /* + * reset-gpios: used by isx031.c driver via + * devm_gpiod_get_optional(dev, "reset", ...) + * Format: { , , , } + */ + Package () { "reset-gpios", Package () { CAM_GPIO_REF, 0, 0, 1 } }, + }, + ToUUID("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), // Hierarchical Data Extension + Package () + { + /* mipi-img-port here is local camera port used by mipi-disco-img.c. */ + Package () { "mipi-img-port-0", "PRT0" }, + }, +}) + +Name (PRT0, Package () +{ + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties + Package () + { + Package () { "mipi-img-clock-lane", 0 }, +#if CAM_LANES == 4 + Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } }, +#elif CAM_LANES == 2 + Package () { "mipi-img-data-lanes", Package () { 1, 2 } }, +#else + Package () { "mipi-img-data-lanes", Package () { 1, 2, 3, 4 } }, +#endif + }, +}) diff --git a/acpi/ipu8/_ser_common_max9295.asl b/acpi/ipu8/_ser_common_max9295.asl index 465a9938..6bd3b263 100644 --- a/acpi/ipu8/_ser_common_max9295.asl +++ b/acpi/ipu8/_ser_common_max9295.asl @@ -105,7 +105,7 @@ Name (PRT0, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, #if CAM_LANES == 4 Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, // 4 data lanes #elif CAM_LANES == 2 @@ -121,7 +121,7 @@ Name (PRT1, Package() ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), // Device Properties Package () { - Package () { "mipi-img-clock-lanes", 0 }, + Package () { "mipi-img-clock-lane", 0 }, Package () { "mipi-img-data-lanes", Package() { 1, 2, 3, 4 } }, }, }) diff --git a/acpi/ipu8/mipi_isx031.asl b/acpi/ipu8/mipi_isx031.asl new file mode 100644 index 00000000..145447ff --- /dev/null +++ b/acpi/ipu8/mipi_isx031.asl @@ -0,0 +1,82 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * SSDT overlay: Direct MIPI CSI-2 ISX031 camera configuration on NVL platform. + * + * This overlay describes a native MIPI-connected ISX031 sensor (no GMSL SERDES). + * Adjust the CAM_* defines below to match your hardware wiring. + * + * CAM-level defines (set per CAMx, see _mipi_cam_common_isx031.asl): + * CAM_I2C_BUS - Camera I2C bus path (e.g. "\\_SB.PC00.I2C1") + * CAM_I2C_ADDR - Camera I2C slave address (e.g. 0x001A for ISX031) + * CAM_TO_MIPI_PORT - Connected IPU0 MIPI port (e.g. 0/1/2) + * CAM_LANES - Number of MIPI data lanes (e.g. 2, 4) + * CAM_GPIO_CTLR - GPIO controller path (e.g. "\\_SB.GPI1") + * CAM_RESET_PIN - GPIO pin number for RESET (community-relative) + * CAM_IPU_PATH - IPU path string (e.g. "\\_SB.PC00.IPU0") + * CAM_IPU_REF - IPU namespace reference (e.g. \_SB.PC00.IPU0) + * CAM_GPIO_REF - Device self-reference for reset-gpios (e.g. ^CAM0) + * + * Default configuration (from BIOS table, COM1 groups C_E_V): + * CAM0: I2C1, MIPI port 0, 4 lanes, GPP_E_1 (pin 27) + * CAM1: I2C0, MIPI port 2, 2 lanes, GPP_E_10 (pin 36) + */ + +DefinitionBlock ("", "SSDT", 2, "", "IMG_IPU", 0x20260807) +{ + External (_SB.PC00, DeviceObj) + External (_SB.PC00.IPU0, DeviceObj) + External (_SB.GPI1, DeviceObj) // GPIO controller COM1 for RESET + + Include ("_ipu.asl") + + Scope (\_SB.PC00) + { + Device (CAM0) + { + #define CAM_I2C_BUS "\\_SB.PC00.I2C1" + #define CAM_I2C_ADDR 0x001A + #define CAM_TO_MIPI_PORT 0 + #define CAM_LANES 4 + #define CAM_GPIO_CTLR "\\_SB.GPI1" + #define CAM_RESET_PIN 27 // GPP_E_1 (COM1 pin 27) + #define CAM_IPU_PATH "\\_SB.PC00.IPU0" + #define CAM_IPU_REF \_SB.PC00.IPU0 + #define CAM_GPIO_REF ^CAM0 + #include "_mipi_cam_common_isx031.asl" + #undef CAM_I2C_BUS + #undef CAM_I2C_ADDR + #undef CAM_TO_MIPI_PORT + #undef CAM_LANES + #undef CAM_GPIO_CTLR + #undef CAM_RESET_PIN + #undef CAM_IPU_PATH + #undef CAM_IPU_REF + #undef CAM_GPIO_REF + } + + Device (CAM1) + { + #define CAM_I2C_BUS "\\_SB.PC00.I2C0" + #define CAM_I2C_ADDR 0x001A + #define CAM_TO_MIPI_PORT 2 + #define CAM_LANES 2 + #define CAM_GPIO_CTLR "\\_SB.GPI1" + #define CAM_RESET_PIN 36 // GPP_E_10 (COM1 pin 36) + #define CAM_IPU_PATH "\\_SB.PC00.IPU0" + #define CAM_IPU_REF \_SB.PC00.IPU0 + #define CAM_GPIO_REF ^CAM1 + #include "_mipi_cam_common_isx031.asl" + #undef CAM_I2C_BUS + #undef CAM_I2C_ADDR + #undef CAM_TO_MIPI_PORT + #undef CAM_LANES + #undef CAM_GPIO_CTLR + #undef CAM_RESET_PIN + #undef CAM_IPU_PATH + #undef CAM_IPU_REF + #undef CAM_GPIO_REF + } + } +} diff --git a/config/ar0234/ipu6epmtl/sensors/ar0234.xml b/config/ar0234/ipu6epmtl/sensors/ar0234.xml index a8a98e73..06941f10 100644 --- a/config/ar0234/ipu6epmtl/sensors/ar0234.xml +++ b/config/ar0234/ipu6epmtl/sensors/ar0234.xml @@ -154,4 +154,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/ar0234/ipu75xa/AR0234_GRBG_1280_960_PTL.IPU75XA.aiqb b/config/ar0234/ipu75xa/AR0234_GRBG_1280_960_PTL.IPU75XA.aiqb new file mode 100644 index 00000000..eed4e3a6 Binary files /dev/null and b/config/ar0234/ipu75xa/AR0234_GRBG_1280_960_PTL.IPU75XA.aiqb differ diff --git a/config/ar0234/ipu75xa/gcss/AR0234.IPU75XA.bin b/config/ar0234/ipu75xa/gcss/AR0234.IPU75XA.bin new file mode 100644 index 00000000..313fad15 Binary files /dev/null and b/config/ar0234/ipu75xa/gcss/AR0234.IPU75XA.bin differ diff --git a/config/ar0234/ipu75xa/gcss/AR0234.IPU75XA.xml b/config/ar0234/ipu75xa/gcss/AR0234.IPU75XA.xml new file mode 100644 index 00000000..308b7bcd --- /dev/null +++ b/config/ar0234/ipu75xa/gcss/AR0234.IPU75XA.xml @@ -0,0 +1,2301 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/ar0234/ipu75xa/libcamhal_configs.json b/config/ar0234/ipu75xa/libcamhal_configs.json new file mode 100644 index 00000000..ce9b3314 --- /dev/null +++ b/config/ar0234/ipu75xa/libcamhal_configs.json @@ -0,0 +1,26 @@ +// +// Copyright (C) 2026 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "Common" : { + "version": 1.0, + "platform": "IPU7", + // The value format of availableSensors is "sensor name"-wf/uf-"CSI port ID". + // wf is world facing, and uf is user facing. + "availableSensors": ["ar0234-a-0","ar0234-b-2"], + "videoStreamNum" : 2 + } +} diff --git a/config/ar0234/ipu75xa/pipe_scheduler_profiles.json b/config/ar0234/ipu75xa/pipe_scheduler_profiles.json new file mode 100644 index 00000000..c5a2186e --- /dev/null +++ b/config/ar0234/ipu75xa/pipe_scheduler_profiles.json @@ -0,0 +1,104 @@ +// +// Copyright (C) 2026 Intel Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "PipeSchedulerPolicy": { + // Configuration is chosen according to: graphId, usecase, cameraId + "schedulers": [ + { + "id": 1, "graphId": 100000, + "pipe_executors": [ + { + "name": "video_lb", + "nodes": [ + "lbff", + ], + }, + { + "name": "video_bb", + "nodes": [ + "bbps", + "post_1", + "post_2", + ], + }, + { + "name": "still_full", + "nodes": [ + "lbff1", + "bbps1", + "post_0", + ], + }, + ], + }, + { + "id": 2, "graphId": 100200, + "pipe_executors": [ + { + "name": "video_lb", + "nodes": [ + "lbff", + ], + }, + { + "name": "video_bb", + "nodes": [ + "bbps", + "post_1", + "post_2", + ], + }, + { + "name": "still_full", + "nodes": [ + "lbff1", + "bbps1", + "post_0", + ], + }, + ], + }, + { + "id": 2, "graphId": 100002, + "pipe_executors": [ + { + "name": "video_lb", + "nodes": [ + "lbff", + "bbps", + ], + }, + { + "name": "video_bb", + "nodes": [ + "post_1", + "post_2", + ], + }, + { + "name": "still_full", + "nodes": [ + "lbff1", + "bbps1", + "post_0", + ], + }, + ], + }, + ], + } +} diff --git a/config/ar0234/ipu75xa/pnp_profiles.json b/config/ar0234/ipu75xa/pnp_profiles.json new file mode 100644 index 00000000..d6ef965a --- /dev/null +++ b/config/ar0234/ipu75xa/pnp_profiles.json @@ -0,0 +1,37 @@ +// +// Copyright (C) 2026 Intel Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "PnpDebugConfig": { + "Power": { + "useMockAAL": false, + "useMockHal": false, + "pnpMockFps": 30, + // algos + "bypass3A": false, + "bypassPAL": false, + // disable all face features + "disableFace": false, + "disableFaceAe": false, + "bypassFDAlgo": false, + // IPU PSYS + "bypassCB": false, + "useMockPipes": false, + // IPU ISYS + "bypassISys": false, + } + } +} diff --git a/config/ar0234/ipu75xa/sensors/ar0234-a.json b/config/ar0234/ipu75xa/sensors/ar0234-a.json new file mode 100644 index 00000000..4befa2c5 --- /dev/null +++ b/config/ar0234/ipu75xa/sensors/ar0234-a.json @@ -0,0 +1,222 @@ +// +// Copyright (C) 2026 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "CameraSettings": { + "Sensor": [ + { + "name": "ar0234-a", + "description": "AR0234 MIPI CSI-2 Sensor 1", + "MediaCtlConfig": [ + { + "id": 0 , + "configMode": "AUTO", + "output": [1280, 960], + "format": "V4L2_PIX_FMT_SGRBG10", + "formats": [ + {"name": "ar0234 $I2CBUS", "pad": 0, "width": 1280, "height": 960, "format": "V4L2_MBUS_FMT_SGRBG10_1X10"}, + {"name": "Intel IPU7 CSI2 $CSI_PORT", "pad": 0, "width": 1280, "height": 960, "format": "V4L2_MBUS_FMT_SGRBG10_1X10"} + ], + "link": [ + {"srcName": "ar0234 $I2CBUS", "srcPad": 0, "sinkName": "Intel IPU7 CSI2 $CSI_PORT", "sinkPad": 0, "enable": true}, + {"srcName": "Intel IPU7 CSI2 $CSI_PORT", "srcPad": 1, "sinkName": "Intel IPU7 ISYS Capture $CAP_N", "sinkPad": 0, "enable": true} + ], + "videonode": [ + {"name": "Intel IPU7 ISYS Capture $CAP_N", "videoNodeType": "VIDEO_GENERIC"}, + {"name": "Intel IPU7 CSI2 $CSI_PORT", "videoNodeType": "VIDEO_ISYS_RECEIVER"}, + {"name": "ar0234 $I2CBUS", "videoNodeType": "VIDEO_PIXEL_ARRAY"} + ] + } + ], + "StaticMetadata": { + "supportedStreamConfig": [ + { "format": "V4L2_PIX_FMT_NV12", "size": [1280, 960], "field": 0, "mcId": 0} + ], + "supportedFeatures": [ + "MANUAL_EXPOSURE", + "MANUAL_WHITE_BALANCE", + "IMAGE_ENHANCEMENT", + "NOISE_REDUCTION", + "PER_FRAME_CONTROL", + "SCENE_MODE" + ], + "fpsRange": [ 10, 30 ], + "evRange": [ -6, 6 ], + "evStep": [ 1, 3 ], + "supportedAeMode": [ + "AUTO", + "MANUAL" + ], + "supportedVideoStabilizationModes": [ + "OFF" + ], + "supportedSceneMode": [ + "NORMAL" + ], + "supportedAntibandingMode": [ + "AUTO", + "50Hz", + "60Hz", + "OFF" + ], + "supportedAwbMode": [ + "AUTO", + "INCANDESCENT", + "FLUORESCENT", + "DAYLIGHT", + "FULL_OVERCAST", + "PARTLY_OVERCAST", + "SUNSET", + "VIDEO_CONFERENCE", + "MANUAL_CCT_RANGE", + "MANUAL_WHITE_POINT", + "MANUAL_GAIN", + "MANUAL_COLOR_TRANSFORM" + ], + "supportedAfMode": [ + "OFF" + ], + "metadata":{ + "ae.lockAvailable": [1], + "awb.lockAvailable": [1], + // 0: OFF, 1: AUTO, 2: USE_SCENE_MODE, 3: OFF_KEEP_STATE + "control.availableModes" : [ 0, 1 ], + // 0: DISABLE, 1: FACE_PRIORITY + "control.availableSceneModes": [1], + "control.maxRegions" : [ 1, 0, 1 ], + // 0: OFF, 1: SIMPLE, 2: FULL + "statistics.info.availableFaceDetectModes" : [0], + "sensor.orientation" : [0], + // 43*15.9 + "sensor.maxAnalogSensitivity" : [699], + "sensor.info.sensitivityRange" : [44, 1399], + // align with supportedAeExposureTimeRange + "sensor.info.exposureTimeRange": [ 100, 100000 ], + "sensor.info.activeArraySize": [ 0, 0, 1280, 960 ], + "sensor.info.pixelArraySize": [1280, 960], + // 1280x1.12um 960x1.12um + "sensor.info.physicalSize": [ 4.71, 3.49 ], + // 0: off, 1: solid color, 2: color bars + "sensor.availableTestPatternModes": [ 0, 2 ], + // 0:RGGB, 1:GRBG, 2:GBRG, 3:BGGR, 4:RGB + "sensor.info.colorFilterArrangement": [1], + // shading 0:OFF,1:FAST,2:HIGH_QUALITY + "shading.availableModes": [ 0, 1, 2 ], + "lens.facing": [1], + "lens.info.availableApertures": [2.2], + "lens.info.availableFilterDensities": [0.0], + "lens.info.availableFocalLengths": [3.39], + "lens.info.availableOpticalStabilization": [0], + "lens.info.hyperfocalDistance": [1.37], + "lens.info.minimumFocusDistance": [10.0], + "lens.info.shadingMapSize": [ 63, 47 ], + "lens.info.focusDistanceCalibration": [1], + // raw, yuv, jpeg + "request.maxNumOutputStreams": [ 1, 3, 1 ], + // 0: No input, 1: 1 input stream (YUV or RAW), 2: 2 input streams (YUV and RAW) + "request.maxNumInputStreams": [1], + "request.pipelineMaxDepth": [7], + // 0:backward, 1:manual_sensor, 2:manual_pso_processing, 3:raw, 4:zsl, 5:read_sensor_settings, 6:burst_capture, 7: yuv reprocessing + "request.availableCapabilities": [ 0, 1, 2, 4, 5, 6 ], + // input fmt, output fmt number, output fmts; fmt: YCbCr_420_888:0x23 (35), IMPLEMENTATION_DEFINED:0x22 (34), Blob:0x21 (33) + "scaler.availableInputOutputFormatsMap": [ 34, 2, 33, 35 ], + "sensor.opaqueRawSize": [1280, 960, 100], + // available stream configurations: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, type: output(0)|input(1) + "scaler.availableStreamConfigurations": [ + 33, 1280, 960, 0, + 35, 1280, 960, 0, + 34, 1280, 960, 0, + ], + // minimum frame duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) + "scaler.availableMinFrameDurations": [ + 33, 1280, 960, 33333333, + 35, 1280, 960, 33333333, + 34, 1280, 960, 33333333, + ], + // maximum stall duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) + "scaler.availableStallDurations": [ + 33, 1280, 960, 33333333, + ], + // maximum JPEG size: 1920*1200*1.5 + "jpeg.maxSize": [3456000], + // INCREASING ORDER + "jpeg.availableThumbnailSizes": [ 0, 0, 320, 180, 320, 240 ], + // 0:off, 1:fast, 2:high_quality, 3:zero_shutter_lag + "edge.availableEdgeModes": [ 0, 1, 2, 3 ], + // 0:off, 1:fast, 2:high_quality + "hotPixel.availableHotPixelModes": [ 1, 2 ], + // 0:off, 1:fast, 2:high_quality, 3:minimal, 4:zero_shutter_lag + "noiseReduction.availableNoiseReductionModes": [ 0, 1, 2, 4 ], + "tonemap.maxCurvePoints": [1024], + // 0:contrast_curve, 1:fast, 2:high_quality, 3:gamma_value, 4:preset_curve + "tonemap.availableToneMapModes": [ 1, 2, 3, 4 ], + // Number of frames + "reprocess.maxCaptureStall": [4], + // 0:limited, 1:full, 2:legacy, 3:level3 + "info.supportedHardwareLevel": [1], + // 0:per-frame, -1:unknown, other positive number:frame count + "sync.maxLatency": [0] + } + }, + "supportedTuningConfig": [ + ["NORMAL", "VIDEO", "AR0234_GRBG_1280_960_PTL.IPU75XA"], + ["STILL_CAPTURE", "VIDEO", "AR0234_GRBG_1280_960_PTL.IPU75XA"] + ], + // The lard tags configuration. Every tag should be 4-characters. + // TuningMode, cmc tag, aiq tag, isp tag, others tag + "lardTags": [ + ["VIDEO", "DFLT", "DFLT", "DFLT", "DFLT"] + ], + // ascending order request + "supportedISysSizes": [[1280, 960]], + "supportedISysFormat": ["V4L2_PIX_FMT_SGRBG10"], + "enableAIQ": true, + "iSysRawFormat": "V4L2_PIX_FMT_SGRBG10", + "maxRawDataNum": 32, + "initialSkipFrame": 0, + "exposureLag": 2, + "gainLag": 0, + "digitalGainLag": 0, + // Option: full, reduced + "yuvColorRangeMode": "full", + "pipeSwitchDelayFrame": 60, + "graphSettingsFile": "AR0234.IPU75XA.bin", + // Option: coupled, dispersed + "graphSettingsType": "coupled", + "enablePSysProcessor": true, + "dvsType": "IMG_TRANS", + "nvmDeviceInfo": ["NVM", 590], + "lensName": "dw9714", + "lensHwType": "LENS_VCM_HW", + "testPatternMap": { + "Off": 0, + "ColorBars": 1 + }, + "enableAiqd": true, + "useCrlModule": false, + "pslOutputMapForRotation": [ + [[1280, 960], [1280, 960]], + ], + "maxRequestsInflight": 6, + "psysBundleWithAic": false, + "skipFrameV4L2Error": true, + "isISYSCompression": false, + "isPSACompression": false, + "usingMockPSys": false + } + ] + } +} diff --git a/config/ar0234/ipu75xa/sensors/ar0234-b.json b/config/ar0234/ipu75xa/sensors/ar0234-b.json new file mode 100644 index 00000000..5495d951 --- /dev/null +++ b/config/ar0234/ipu75xa/sensors/ar0234-b.json @@ -0,0 +1,220 @@ +// +// Copyright (C) 2026 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "CameraSettings": { + "Sensor": [ + { + "name": "ar0234-b", + "description": "AR0234 MIPI CSI-2 Sensor 2", + "MediaCtlConfig": [ + { + "id": 0 , + "configMode": "AUTO", + "output": [1280, 960], + "format": "V4L2_PIX_FMT_SGRBG10", + "formats": [ + {"name": "ar0234 $I2CBUS", "pad": 0, "width": 1280, "height": 960, "format": "V4L2_MBUS_FMT_SGRBG10_1X10"}, + {"name": "Intel IPU7 CSI2 $CSI_PORT", "pad": 0, "width": 1280, "height": 960, "format": "V4L2_MBUS_FMT_SGRBG10_1X10"} + ], + "link": [ + {"srcName": "ar0234 $I2CBUS", "srcPad": 0, "sinkName": "Intel IPU7 CSI2 $CSI_PORT", "sinkPad": 0, "enable": true}, + {"srcName": "Intel IPU7 CSI2 $CSI_PORT", "srcPad": 1, "sinkName": "Intel IPU7 ISYS Capture $CAP_N", "sinkPad": 0, "enable": true} + ], + "videonode": [ + {"name": "Intel IPU7 ISYS Capture $CAP_N", "videoNodeType": "VIDEO_GENERIC"}, + {"name": "Intel IPU7 CSI2 $CSI_PORT", "videoNodeType": "VIDEO_ISYS_RECEIVER"}, + {"name": "ar0234 $I2CBUS", "videoNodeType": "VIDEO_PIXEL_ARRAY"} + ] + } + ], + "StaticMetadata": { + "supportedStreamConfig": [ + { "format": "V4L2_PIX_FMT_NV12", "size": [1280, 960], "field": 0, "mcId": 0} + ], + "supportedFeatures": [ + "MANUAL_EXPOSURE", + "MANUAL_WHITE_BALANCE", + "IMAGE_ENHANCEMENT", + "NOISE_REDUCTION", + "PER_FRAME_CONTROL", + "SCENE_MODE" + ], + "fpsRange": [ 10, 30 ], + "evRange": [ -6, 6 ], + "evStep": [ 1, 3 ], + "supportedAeMode": [ + "AUTO", + "MANUAL" + ], + "supportedVideoStabilizationModes": [ + "OFF" + ], + "supportedSceneMode": [ + "NORMAL" + ], + "supportedAntibandingMode": [ + "AUTO", + "50Hz", + "60Hz", + "OFF" + ], + "supportedAwbMode": [ + "AUTO", + "INCANDESCENT", + "FLUORESCENT", + "DAYLIGHT", + "FULL_OVERCAST", + "PARTLY_OVERCAST", + "SUNSET", + "VIDEO_CONFERENCE", + "MANUAL_CCT_RANGE", + "MANUAL_WHITE_POINT", + "MANUAL_GAIN", + "MANUAL_COLOR_TRANSFORM" + ], + "supportedAfMode": [ + "OFF" + ], + "metadata":{ + "ae.lockAvailable": [1], + "awb.lockAvailable": [1], + // 0: OFF, 1: AUTO, 2: USE_SCENE_MODE, 3: OFF_KEEP_STATE + "control.availableModes" : [ 0, 1 ], + // 0: DISABLE, 1: FACE_PRIORITY + "control.availableSceneModes": [1], + "control.maxRegions" : [ 1, 0, 1 ], + // 0: OFF, 1: SIMPLE, 2: FULL + "statistics.info.availableFaceDetectModes" : [0], + "sensor.orientation" : [0], + // 43*15.9 + "sensor.maxAnalogSensitivity" : [699], + "sensor.info.sensitivityRange" : [44, 1399], + // align with supportedAeExposureTimeRange + "sensor.info.exposureTimeRange": [ 100, 100000 ], + "sensor.info.activeArraySize": [ 0, 0, 1280, 960 ], + "sensor.info.pixelArraySize": [1280, 960], + // 1280x1.12um 960x1.12um + "sensor.info.physicalSize": [ 4.71, 3.49 ], + // 0: off, 1: solid color, 2: color bars + "sensor.availableTestPatternModes": [ 0, 2 ], + // 0:RGGB, 1:GRBG, 2:GBRG, 3:BGGR, 4:RGB + "sensor.info.colorFilterArrangement": [1], + // shading 0:OFF,1:FAST,2:HIGH_QUALITY + "shading.availableModes": [ 0, 1, 2 ], + "lens.facing": [1], + "lens.info.availableApertures": [2.2], + "lens.info.availableFilterDensities": [0.0], + "lens.info.availableFocalLengths": [3.39], + "lens.info.availableOpticalStabilization": [0], + "lens.info.hyperfocalDistance": [1.37], + "lens.info.minimumFocusDistance": [10.0], + "lens.info.shadingMapSize": [ 63, 47 ], + "lens.info.focusDistanceCalibration": [1], + // raw, yuv, jpeg + "request.maxNumOutputStreams": [ 1, 3, 1 ], + // 0: No input, 1: 1 input stream (YUV or RAW), 2: 2 input streams (YUV and RAW) + "request.maxNumInputStreams": [1], + "request.pipelineMaxDepth": [7], + // 0:backward, 1:manual_sensor, 2:manual_pso_processing, 3:raw, 4:zsl, 5:read_sensor_settings, 6:burst_capture, 7: yuv reprocessing + "request.availableCapabilities": [ 0, 1, 2, 4, 5, 6 ], + // input fmt, output fmt number, output fmts; fmt: YCbCr_420_888:0x23 (35), IMPLEMENTATION_DEFINED:0x22 (34), Blob:0x21 (33) + "scaler.availableInputOutputFormatsMap": [ 34, 2, 33, 35 ], + "sensor.opaqueRawSize": [1280, 960, 100], + // available stream configurations: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, type: output(0)|input(1) + "scaler.availableStreamConfigurations": [ + 33, 1280, 960, 0, + 35, 1280, 960, 0, + 34, 1280, 960, 0, + ], + // minimum frame duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) + "scaler.availableMinFrameDurations": [ + 33, 1280, 960, 33333333, + 35, 1280, 960, 33333333, + 34, 1280, 960, 33333333, + ], + // maximum stall duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) + "scaler.availableStallDurations": [ + 33, 1280, 960, 33333333, + ], + // maximum JPEG size: 1920*1200*1.5 + "jpeg.maxSize": [3456000], + // INCREASING ORDER + "jpeg.availableThumbnailSizes": [ 0, 0, 320, 180, 320, 240 ], + // 0:off, 1:fast, 2:high_quality, 3:zero_shutter_lag + "edge.availableEdgeModes": [ 0, 1, 2, 3 ], + // 0:off, 1:fast, 2:high_quality + "hotPixel.availableHotPixelModes": [ 1, 2 ], + // 0:off, 1:fast, 2:high_quality, 3:minimal, 4:zero_shutter_lag + "noiseReduction.availableNoiseReductionModes": [ 0, 1, 2, 4 ], + "tonemap.maxCurvePoints": [1024], + // 0:contrast_curve, 1:fast, 2:high_quality, 3:gamma_value, 4:preset_curve + "tonemap.availableToneMapModes": [ 1, 2, 3, 4 ], + // Number of frames + "reprocess.maxCaptureStall": [4], + // 0:limited, 1:full, 2:legacy, 3:level3 + "info.supportedHardwareLevel": [1], + // 0:per-frame, -1:unknown, other positive number:frame count + "sync.maxLatency": [0] + } + }, + "supportedTuningConfig": [ + ["NORMAL", "VIDEO", "AR0234_GRBG_1280_960_PTL.IPU75XA"], + ["STILL_CAPTURE", "VIDEO", "AR0234_GRBG_1280_960_PTL.IPU75XA"] + ], + // The lard tags configuration. Every tag should be 4-characters. + // TuningMode, cmc tag, aiq tag, isp tag, others tag + "lardTags": [ + ["VIDEO", "DFLT", "DFLT", "DFLT", "DFLT"] + ], + // ascending order request + "supportedISysSizes": [[1280, 960]], + "supportedISysFormat": ["V4L2_PIX_FMT_SGRBG10"], + "enableAIQ": true, + "iSysRawFormat": "V4L2_PIX_FMT_SGRBG10", + "maxRawDataNum": 32, + "initialSkipFrame": 0, + "exposureLag": 2, + "gainLag": 0, + "digitalGainLag": 0, + "yuvColorRangeMode": "full", + "pipeSwitchDelayFrame": 60, + "graphSettingsFile": "AR0234.IPU75XA.bin", + "graphSettingsType": "coupled", + "enablePSysProcessor": true, + "dvsType": "IMG_TRANS", + "nvmDeviceInfo": ["NVM", 590], + "lensName": "dw9714", + "lensHwType": "LENS_VCM_HW", + "testPatternMap": { + "Off": 0, + "ColorBars": 1 + }, + "enableAiqd": true, + "useCrlModule": false, + "pslOutputMapForRotation": [ + [[1280, 960], [1280, 960]], + ], + "maxRequestsInflight": 6, + "psysBundleWithAic": false, + "skipFrameV4L2Error": true, + "isISYSCompression": false, + "isPSACompression": false, + "usingMockPSys": false + } + ] + } +} diff --git a/config/ar0234/ipu8/AR0234_GRBG_1280_960_NVL.IPU8.aiqb b/config/ar0234/ipu8/AR0234_GRBG_1280_960_NVL.IPU8.aiqb new file mode 100644 index 00000000..b767659a Binary files /dev/null and b/config/ar0234/ipu8/AR0234_GRBG_1280_960_NVL.IPU8.aiqb differ diff --git a/config/ar0234/ipu8/gcss/AR0234.IPU8.bin b/config/ar0234/ipu8/gcss/AR0234.IPU8.bin new file mode 100644 index 00000000..823965c0 Binary files /dev/null and b/config/ar0234/ipu8/gcss/AR0234.IPU8.bin differ diff --git a/config/ar0234/ipu8/gcss/AR0234.IPU8.xml b/config/ar0234/ipu8/gcss/AR0234.IPU8.xml new file mode 100644 index 00000000..2ef439e3 --- /dev/null +++ b/config/ar0234/ipu8/gcss/AR0234.IPU8.xml @@ -0,0 +1,652 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/ar0234/ipu8/libcamhal_configs.json b/config/ar0234/ipu8/libcamhal_configs.json new file mode 100644 index 00000000..ce9b3314 --- /dev/null +++ b/config/ar0234/ipu8/libcamhal_configs.json @@ -0,0 +1,26 @@ +// +// Copyright (C) 2026 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "Common" : { + "version": 1.0, + "platform": "IPU7", + // The value format of availableSensors is "sensor name"-wf/uf-"CSI port ID". + // wf is world facing, and uf is user facing. + "availableSensors": ["ar0234-a-0","ar0234-b-2"], + "videoStreamNum" : 2 + } +} diff --git a/config/ar0234/ipu8/pipe_scheduler_profiles.json b/config/ar0234/ipu8/pipe_scheduler_profiles.json new file mode 100644 index 00000000..3612b689 --- /dev/null +++ b/config/ar0234/ipu8/pipe_scheduler_profiles.json @@ -0,0 +1,48 @@ +// +// Copyright (C) 2026 Intel Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "PipeSchedulerPolicy": { + // Configuration is chosen according to: graphId, usecase, cameraId + "schedulers": [ + { + "id": 1, "graphId": 100002, + "pipe_executors": [ + { + "name": "video_lb", + "nodes": [ + "lbff", + ], + }, + { + "name": "video_po", + "nodes": [ + "post_1", + "post_2", + ], + }, + { + "name": "still_full", + "nodes": [ + "lbff1", + "post_0", + ], + }, + ], + }, + ], + } +} diff --git a/config/ar0234/ipu8/pnp_profiles.json b/config/ar0234/ipu8/pnp_profiles.json new file mode 100644 index 00000000..d6ef965a --- /dev/null +++ b/config/ar0234/ipu8/pnp_profiles.json @@ -0,0 +1,37 @@ +// +// Copyright (C) 2026 Intel Corporation. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "PnpDebugConfig": { + "Power": { + "useMockAAL": false, + "useMockHal": false, + "pnpMockFps": 30, + // algos + "bypass3A": false, + "bypassPAL": false, + // disable all face features + "disableFace": false, + "disableFaceAe": false, + "bypassFDAlgo": false, + // IPU PSYS + "bypassCB": false, + "useMockPipes": false, + // IPU ISYS + "bypassISys": false, + } + } +} diff --git a/config/ar0234/ipu8/sensors/ar0234-a.json b/config/ar0234/ipu8/sensors/ar0234-a.json new file mode 100644 index 00000000..07b05fca --- /dev/null +++ b/config/ar0234/ipu8/sensors/ar0234-a.json @@ -0,0 +1,220 @@ +// +// Copyright (C) 2026 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "CameraSettings": { + "Sensor": [ + { + "name": "ar0234-a", + "description": "AR0234 MIPI CSI-2 Sensor 1", + "MediaCtlConfig": [ + { + "id": 0 , + "configMode": "AUTO", + "output": [1280, 960], + "format": "V4L2_PIX_FMT_SGRBG10", + "formats": [ + {"name": "ar0234 $I2CBUS", "pad": 0, "width": 1280, "height": 960, "format": "V4L2_MBUS_FMT_SGRBG10_1X10"}, + {"name": "Intel IPU7 CSI2 $CSI_PORT", "pad": 0, "width": 1280, "height": 960, "format": "V4L2_MBUS_FMT_SGRBG10_1X10"} + ], + "link": [ + {"srcName": "ar0234 $I2CBUS", "srcPad": 0, "sinkName": "Intel IPU7 CSI2 $CSI_PORT", "sinkPad": 0, "enable": true}, + {"srcName": "Intel IPU7 CSI2 $CSI_PORT", "srcPad": 1, "sinkName": "Intel IPU7 ISYS Capture $CAP_N", "sinkPad": 0, "enable": true} + ], + "videonode": [ + {"name": "Intel IPU7 ISYS Capture $CAP_N", "videoNodeType": "VIDEO_GENERIC"}, + {"name": "Intel IPU7 CSI2 $CSI_PORT", "videoNodeType": "VIDEO_ISYS_RECEIVER"}, + {"name": "ar0234 $I2CBUS", "videoNodeType": "VIDEO_PIXEL_ARRAY"} + ] + } + ], + "StaticMetadata": { + "supportedStreamConfig": [ + { "format": "V4L2_PIX_FMT_NV12", "size": [1280, 960], "field": 0, "mcId": 0} + ], + "supportedFeatures": [ + "MANUAL_EXPOSURE", + "MANUAL_WHITE_BALANCE", + "IMAGE_ENHANCEMENT", + "NOISE_REDUCTION", + "PER_FRAME_CONTROL", + "SCENE_MODE" + ], + "fpsRange": [ 10, 30 ], + "evRange": [ -6, 6 ], + "evStep": [ 1, 3 ], + "supportedAeMode": [ + "AUTO", + "MANUAL" + ], + "supportedVideoStabilizationModes": [ + "OFF" + ], + "supportedSceneMode": [ + "NORMAL" + ], + "supportedAntibandingMode": [ + "AUTO", + "50Hz", + "60Hz", + "OFF" + ], + "supportedAwbMode": [ + "AUTO", + "INCANDESCENT", + "FLUORESCENT", + "DAYLIGHT", + "FULL_OVERCAST", + "PARTLY_OVERCAST", + "SUNSET", + "VIDEO_CONFERENCE", + "MANUAL_CCT_RANGE", + "MANUAL_WHITE_POINT", + "MANUAL_GAIN", + "MANUAL_COLOR_TRANSFORM" + ], + "supportedAfMode": [ + "OFF" + ], + "metadata":{ + "ae.lockAvailable": [1], + "awb.lockAvailable": [1], + // 0: OFF, 1: AUTO, 2: USE_SCENE_MODE, 3: OFF_KEEP_STATE + "control.availableModes" : [ 0, 1 ], + // 0: DISABLE, 1: FACE_PRIORITY + "control.availableSceneModes": [1], + "control.maxRegions" : [ 1, 0, 1 ], + // 0: OFF, 1: SIMPLE, 2: FULL + "statistics.info.availableFaceDetectModes" : [0], + "sensor.orientation" : [0], + // 43*15.9 + "sensor.maxAnalogSensitivity" : [699], + "sensor.info.sensitivityRange" : [44, 1399], + // align with supportedAeExposureTimeRange + "sensor.info.exposureTimeRange": [ 100, 100000 ], + "sensor.info.activeArraySize": [ 0, 0, 1280, 960 ], + "sensor.info.pixelArraySize": [1280, 960], + // 1280x1.12um 960x1.12um + "sensor.info.physicalSize": [ 4.71, 3.49 ], + // 0: off, 1: solid color, 2: color bars + "sensor.availableTestPatternModes": [ 0, 2 ], + // 0:RGGB, 1:GRBG, 2:GBRG, 3:BGGR, 4:RGB + "sensor.info.colorFilterArrangement": [1], + // shading 0:OFF,1:FAST,2:HIGH_QUALITY + "shading.availableModes": [ 0, 1, 2 ], + "lens.facing": [1], + "lens.info.availableApertures": [2.2], + "lens.info.availableFilterDensities": [0.0], + "lens.info.availableFocalLengths": [3.39], + "lens.info.availableOpticalStabilization": [0], + "lens.info.hyperfocalDistance": [1.37], + "lens.info.minimumFocusDistance": [10.0], + "lens.info.shadingMapSize": [ 63, 47 ], + "lens.info.focusDistanceCalibration": [1], + // raw, yuv, jpeg + "request.maxNumOutputStreams": [ 1, 3, 1 ], + // 0: No input, 1: 1 input stream (YUV or RAW), 2: 2 input streams (YUV and RAW) + "request.maxNumInputStreams": [1], + "request.pipelineMaxDepth": [7], + // 0:backward, 1:manual_sensor, 2:manual_pso_processing, 3:raw, 4:zsl, 5:read_sensor_settings, 6:burst_capture, 7: yuv reprocessing + "request.availableCapabilities": [ 0, 1, 2, 4, 5, 6 ], + // input fmt, output fmt number, output fmts; fmt: YCbCr_420_888:0x23 (35), IMPLEMENTATION_DEFINED:0x22 (34), Blob:0x21 (33) + "scaler.availableInputOutputFormatsMap": [ 34, 2, 33, 35 ], + "sensor.opaqueRawSize": [1280, 960, 100], + // available stream configurations: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, type: output(0)|input(1) + "scaler.availableStreamConfigurations": [ + 33, 1280, 960, 0, + 35, 1280, 960, 0, + 34, 1280, 960, 0, + ], + // minimum frame duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) + "scaler.availableMinFrameDurations": [ + 33, 1280, 960, 33333333, + 35, 1280, 960, 33333333, + 34, 1280, 960, 33333333, + ], + // maximum stall duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) + "scaler.availableStallDurations": [ + 33, 1280, 960, 33333333, + ], + // maximum JPEG size: 1920*1200*1.5 + "jpeg.maxSize": [3456000], + // INCREASING ORDER + "jpeg.availableThumbnailSizes": [ 0, 0, 320, 180, 320, 240 ], + // 0:off, 1:fast, 2:high_quality, 3:zero_shutter_lag + "edge.availableEdgeModes": [ 0, 1, 2, 3 ], + // 0:off, 1:fast, 2:high_quality + "hotPixel.availableHotPixelModes": [ 1, 2 ], + // 0:off, 1:fast, 2:high_quality, 3:minimal, 4:zero_shutter_lag + "noiseReduction.availableNoiseReductionModes": [ 0, 1, 2, 4 ], + "tonemap.maxCurvePoints": [1024], + // 0:contrast_curve, 1:fast, 2:high_quality, 3:gamma_value, 4:preset_curve + "tonemap.availableToneMapModes": [ 1, 2, 3, 4 ], + // Number of frames + "reprocess.maxCaptureStall": [4], + // 0:limited, 1:full, 2:legacy, 3:level3 + "info.supportedHardwareLevel": [1], + // 0:per-frame, -1:unknown, other positive number:frame count + "sync.maxLatency": [0] + } + }, + "supportedTuningConfig": [ + ["NORMAL", "VIDEO", "AR0234_GRBG_1280_960_NVL.IPU8"], + ["STILL_CAPTURE", "VIDEO", "AR0234_GRBG_1280_960_NVL.IPU8"] + ], + // The lard tags configuration. Every tag should be 4-characters. + // TuningMode, cmc tag, aiq tag, isp tag, others tag + "lardTags": [ + ["VIDEO", "DFLT", "DFLT", "DFLT", "DFLT"] + ], + // ascending order request + "supportedISysSizes": [[1280, 960]], + "supportedISysFormat": ["V4L2_PIX_FMT_SGRBG10"], + "enableAIQ": true, + "iSysRawFormat": "V4L2_PIX_FMT_SGRBG10", + "maxRawDataNum": 32, + "initialSkipFrame": 0, + "exposureLag": 2, + "gainLag": 0, + "digitalGainLag": 0, + "yuvColorRangeMode": "full", + "pipeSwitchDelayFrame": 60, + "graphSettingsFile": "AR0234.IPU8.bin", + "graphSettingsType": "coupled", + "enablePSysProcessor": true, + "dvsType": "IMG_TRANS", + "nvmDeviceInfo": ["NVM", 590], + "lensName": "dw9714", + "lensHwType": "LENS_VCM_HW", + "testPatternMap": { + "Off": 0, + "ColorBars": 1 + }, + "enableAiqd": true, + "useCrlModule": false, + "pslOutputMapForRotation": [ + [[1280, 960], [1280, 960]], + ], + "maxRequestsInflight": 6, + "psysBundleWithAic": false, + "skipFrameV4L2Error": true, + "isISYSCompression": false, + "isPSACompression": false, + "usingMockPSys": false + } + ] + } +} diff --git a/config/ar0234/ipu8/sensors/ar0234-b.json b/config/ar0234/ipu8/sensors/ar0234-b.json new file mode 100644 index 00000000..ff04325a --- /dev/null +++ b/config/ar0234/ipu8/sensors/ar0234-b.json @@ -0,0 +1,220 @@ +// +// Copyright (C) 2026 Intel Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +{ + "CameraSettings": { + "Sensor": [ + { + "name": "ar0234-b", + "description": "AR0234 MIPI CSI-2 Sensor 2", + "MediaCtlConfig": [ + { + "id": 0 , + "configMode": "AUTO", + "output": [1280, 960], + "format": "V4L2_PIX_FMT_SGRBG10", + "formats": [ + {"name": "ar0234 $I2CBUS", "pad": 0, "width": 1280, "height": 960, "format": "V4L2_MBUS_FMT_SGRBG10_1X10"}, + {"name": "Intel IPU7 CSI2 $CSI_PORT", "pad": 0, "width": 1280, "height": 960, "format": "V4L2_MBUS_FMT_SGRBG10_1X10"} + ], + "link": [ + {"srcName": "ar0234 $I2CBUS", "srcPad": 0, "sinkName": "Intel IPU7 CSI2 $CSI_PORT", "sinkPad": 0, "enable": true}, + {"srcName": "Intel IPU7 CSI2 $CSI_PORT", "srcPad": 1, "sinkName": "Intel IPU7 ISYS Capture $CAP_N", "sinkPad": 0, "enable": true} + ], + "videonode": [ + {"name": "Intel IPU7 ISYS Capture $CAP_N", "videoNodeType": "VIDEO_GENERIC"}, + {"name": "Intel IPU7 CSI2 $CSI_PORT", "videoNodeType": "VIDEO_ISYS_RECEIVER"}, + {"name": "ar0234 $I2CBUS", "videoNodeType": "VIDEO_PIXEL_ARRAY"} + ] + } + ], + "StaticMetadata": { + "supportedStreamConfig": [ + { "format": "V4L2_PIX_FMT_NV12", "size": [1280, 960], "field": 0, "mcId": 0} + ], + "supportedFeatures": [ + "MANUAL_EXPOSURE", + "MANUAL_WHITE_BALANCE", + "IMAGE_ENHANCEMENT", + "NOISE_REDUCTION", + "PER_FRAME_CONTROL", + "SCENE_MODE" + ], + "fpsRange": [ 10, 30 ], + "evRange": [ -6, 6 ], + "evStep": [ 1, 3 ], + "supportedAeMode": [ + "AUTO", + "MANUAL" + ], + "supportedVideoStabilizationModes": [ + "OFF" + ], + "supportedSceneMode": [ + "NORMAL" + ], + "supportedAntibandingMode": [ + "AUTO", + "50Hz", + "60Hz", + "OFF" + ], + "supportedAwbMode": [ + "AUTO", + "INCANDESCENT", + "FLUORESCENT", + "DAYLIGHT", + "FULL_OVERCAST", + "PARTLY_OVERCAST", + "SUNSET", + "VIDEO_CONFERENCE", + "MANUAL_CCT_RANGE", + "MANUAL_WHITE_POINT", + "MANUAL_GAIN", + "MANUAL_COLOR_TRANSFORM" + ], + "supportedAfMode": [ + "OFF" + ], + "metadata":{ + "ae.lockAvailable": [1], + "awb.lockAvailable": [1], + // 0: OFF, 1: AUTO, 2: USE_SCENE_MODE, 3: OFF_KEEP_STATE + "control.availableModes" : [ 0, 1 ], + // 0: DISABLE, 1: FACE_PRIORITY + "control.availableSceneModes": [1], + "control.maxRegions" : [ 1, 0, 1 ], + // 0: OFF, 1: SIMPLE, 2: FULL + "statistics.info.availableFaceDetectModes" : [0], + "sensor.orientation" : [0], + // 43*15.9 + "sensor.maxAnalogSensitivity" : [699], + "sensor.info.sensitivityRange" : [44, 1399], + // align with supportedAeExposureTimeRange + "sensor.info.exposureTimeRange": [ 100, 100000 ], + "sensor.info.activeArraySize": [ 0, 0, 1280, 960 ], + "sensor.info.pixelArraySize": [1280, 960], + // 1280x1.12um 960x1.12um + "sensor.info.physicalSize": [ 4.71, 3.49 ], + // 0: off, 1: solid color, 2: color bars + "sensor.availableTestPatternModes": [ 0, 2 ], + // 0:RGGB, 1:GRBG, 2:GBRG, 3:BGGR, 4:RGB + "sensor.info.colorFilterArrangement": [1], + // shading 0:OFF,1:FAST,2:HIGH_QUALITY + "shading.availableModes": [ 0, 1, 2 ], + "lens.facing": [1], + "lens.info.availableApertures": [2.2], + "lens.info.availableFilterDensities": [0.0], + "lens.info.availableFocalLengths": [3.39], + "lens.info.availableOpticalStabilization": [0], + "lens.info.hyperfocalDistance": [1.37], + "lens.info.minimumFocusDistance": [10.0], + "lens.info.shadingMapSize": [ 63, 47 ], + "lens.info.focusDistanceCalibration": [1], + // raw, yuv, jpeg + "request.maxNumOutputStreams": [ 1, 3, 1 ], + // 0: No input, 1: 1 input stream (YUV or RAW), 2: 2 input streams (YUV and RAW) + "request.maxNumInputStreams": [1], + "request.pipelineMaxDepth": [7], + // 0:backward, 1:manual_sensor, 2:manual_pso_processing, 3:raw, 4:zsl, 5:read_sensor_settings, 6:burst_capture, 7: yuv reprocessing + "request.availableCapabilities": [ 0, 1, 2, 4, 5, 6 ], + // input fmt, output fmt number, output fmts; fmt: YCbCr_420_888:0x23 (35), IMPLEMENTATION_DEFINED:0x22 (34), Blob:0x21 (33) + "scaler.availableInputOutputFormatsMap": [ 34, 2, 33, 35 ], + "sensor.opaqueRawSize": [1280, 960, 100], + // available stream configurations: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, type: output(0)|input(1) + "scaler.availableStreamConfigurations": [ + 33, 1280, 960, 0, + 35, 1280, 960, 0, + 34, 1280, 960, 0, + ], + // minimum frame duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) + "scaler.availableMinFrameDurations": [ + 33, 1280, 960, 33333333, + 35, 1280, 960, 33333333, + 34, 1280, 960, 33333333, + ], + // maximum stall duration: format: IMPLEMENTATION_DEFINED(34)|YCbCr_420_888:0x23(35)|BLOB(33), widthxheight, duration:(ns) + "scaler.availableStallDurations": [ + 33, 1280, 960, 33333333, + ], + // maximum JPEG size: 1920*1200*1.5 + "jpeg.maxSize": [3456000], + // INCREASING ORDER + "jpeg.availableThumbnailSizes": [ 0, 0, 320, 180, 320, 240 ], + // 0:off, 1:fast, 2:high_quality, 3:zero_shutter_lag + "edge.availableEdgeModes": [ 0, 1, 2, 3 ], + // 0:off, 1:fast, 2:high_quality + "hotPixel.availableHotPixelModes": [ 1, 2 ], + // 0:off, 1:fast, 2:high_quality, 3:minimal, 4:zero_shutter_lag + "noiseReduction.availableNoiseReductionModes": [ 0, 1, 2, 4 ], + "tonemap.maxCurvePoints": [1024], + // 0:contrast_curve, 1:fast, 2:high_quality, 3:gamma_value, 4:preset_curve + "tonemap.availableToneMapModes": [ 1, 2, 3, 4 ], + // Number of frames + "reprocess.maxCaptureStall": [4], + // 0:limited, 1:full, 2:legacy, 3:level3 + "info.supportedHardwareLevel": [1], + // 0:per-frame, -1:unknown, other positive number:frame count + "sync.maxLatency": [0] + } + }, + "supportedTuningConfig": [ + ["NORMAL", "VIDEO", "AR0234_GRBG_1280_960_NVL.IPU8"], + ["STILL_CAPTURE", "VIDEO", "AR0234_GRBG_1280_960_NVL.IPU8"] + ], + // The lard tags configuration. Every tag should be 4-characters. + // TuningMode, cmc tag, aiq tag, isp tag, others tag + "lardTags": [ + ["VIDEO", "DFLT", "DFLT", "DFLT", "DFLT"] + ], + // ascending order request + "supportedISysSizes": [[1280, 960]], + "supportedISysFormat": ["V4L2_PIX_FMT_SGRBG10"], + "enableAIQ": true, + "iSysRawFormat": "V4L2_PIX_FMT_SGRBG10", + "maxRawDataNum": 32, + "initialSkipFrame": 0, + "exposureLag": 2, + "gainLag": 0, + "digitalGainLag": 0, + "yuvColorRangeMode": "full", + "pipeSwitchDelayFrame": 60, + "graphSettingsFile": "AR0234.IPU8.bin", + "graphSettingsType": "coupled", + "enablePSysProcessor": true, + "dvsType": "IMG_TRANS", + "nvmDeviceInfo": ["NVM", 590], + "lensName": "dw9714", + "lensHwType": "LENS_VCM_HW", + "testPatternMap": { + "Off": 0, + "ColorBars": 1 + }, + "enableAiqd": true, + "useCrlModule": false, + "pslOutputMapForRotation": [ + [[1280, 960], [1280, 960]], + ], + "maxRequestsInflight": 6, + "psysBundleWithAic": false, + "skipFrameV4L2Error": true, + "isISYSCompression": false, + "isPSACompression": false, + "usingMockPSys": false + } + ] + } +} diff --git a/doc/ar0234/userspace-mipi.md b/doc/ar0234/userspace-mipi.md index abf65c6f..ce2878f5 100644 --- a/doc/ar0234/userspace-mipi.md +++ b/doc/ar0234/userspace-mipi.md @@ -2,11 +2,46 @@ This document details the configuration settings for the AR0234 MIPI CSI-2 sensor, providing essential information for system integration. The table below presents the key parameters and their respective values used during system setup and validation. + +
+ Table of Contents +
    +
  1. BIOS Configuration Table
  2. +
  3. MIPI Camera Configuration + +
  4. +
  5. Camera Configuration File Setup + +
  6. +
  7. Camera Tuning File Setup + +
  8. +
  9. Environment Setup
  10. +
  11. Sensor Verification
  12. +
  13. Sample Userspace Command
  14. +
  15. Streaming Result
  16. +
+
+ ## BIOS Configuration Table > **Note:** No External Clock required. -### MIPI Camera Configuration for IPU6EPMTL +## MIPI Camera Configuration + +#### Setup for IPU6EPMTL Config path: `Intel Advanced Menu`->`System Agent (SA) Configuration`->`MIPI Camera Configuration` @@ -51,6 +86,108 @@ Config path: `Intel Advanced Menu`->`System Agent (SA) Configuration`->`MIPI Cam | Customize Device ID Number | 19 | 19 | | Flash Driver Selection | Disabled | Disabled | +#### Setup for IPU75XA + +Config path: `Intel Advanced Menu`->`System Agent (SA) Configuration`->`MIPI Camera Configuration` + +| | Control Logic 1 | Control Logic 2 | +|--- |--- |--- | +| Control Logic Type | Discrete | Discrete | +| CRD Version | CRD-D | CRD-D | +| Input Clock | 19.2MHz | 19.2MHz | +| PCH Clock | IMGCLKOUT_0 | IMGCLKOUT_1 | +| Number of GPIOs | 1 | 1 | +| GPIO Pin 0 | | | +| Group Pad Number | 10 | 1 | +| Group Number | C_E_V | C_E_V | +| Com Number | COM1 | COM1 | +| Function | RESET | RESET | +| Active Value | 1 | 1 | +| Initial Value | 0 | 0 | +| Interrupt GPIO | Disabled | Disabled | + +| | Camera1 Link options | Camera2 Link options | +|--- |--- | --- | +| Sensor Model | User Custom | User Custom | +| Custom HID | INTC10C0 | INTC10C0 | +| Lanes Clock division | 4 4 2 2 | 4 4 2 2 | +| CRD Version | CRD-D | CRD-D | +| GPIO control | Control Logic 1 | Control Logic 2 | +| Camera position | Front | Back | +| Flash Support | Disabled | Disabled | +| Privacy LED | Driver default | Driver default | +| Rotation | 0 | 0 | +| PPR Value | 2 | 2 | +| PPR Unit | 2 | 2 | +| PhyConfiguration | DPHY | DPHY | +| Camera module name | _ | _ | +| MIPI port | 0 | 2 | +| LaneUsed | x2 | x2 | +| MCLK | 19200000 | 19200000 | +| EEPROM Type | ROM_NONE | ROM_NONE | +| VCM Type | VCM_NONE | VCM_NONE | +| Number of I2C Components | 1 | 1 | +| I2C Channel | I2C1 | I2C2 | +| Device 0 | | | +| I2C Address | 10 | 10 | +| Device Type | Sensor | Sensor | +| Customize Device ID List | | | +| Customize Device ID Number | 17 | 17 | +| Customize Device ID Number | 18 | 18 | +| Customize Device ID Number | 19 | 19 | +| Flash Driver Selection | Disabled | Disabled | + +#### Setup for IPU8 + +Config path: `Intel Advanced Menu`->`System Agent (SA) Configuration`->`MIPI Camera Configuration` + +| | Control Logic 1 | Control Logic 2 | +|--- |--- |--- | +| Control Logic Type | Discrete | Discrete | +| CRD Version | CRD-D | CRD-D | +| Input Clock | 19.2MHz | 19.2MHz | +| PCH Clock | IMGCLKOUT_0 | IMGCLKOUT_1 | +| Number of GPIOs | 1 | 1 | +| GPIO Pin 0 | | | +| Group Pad Number | 10 | 1 | +| Group Number | C_E_V | C_E_V | +| Com Number | COM1 | COM1 | +| Function | RESET | RESET | +| Active Value | 1 | 1 | +| Initial Value | 0 | 0 | +| Interrupt GPIO | Disabled | Disabled | + +| | Camera1 Link options | Camera2 Link options | +|--- |--- | --- | +| Sensor Model | User Custom | User Custom | +| Custom HID | INTC10C0 | INTC10C0 | +| Lanes Clock division | 4 4 2 2 | 4 4 2 2 | +| CRD Version | CRD-D | CRD-D | +| GPIO control | Control Logic 1 | Control Logic 2 | +| Camera position | Front | Back | +| Flash Support | Disabled | Disabled | +| Privacy LED | Driver default | Driver default | +| Rotation | 0 | 0 | +| PPR Value | 2 | 2 | +| PPR Unit | 2 | 2 | +| PhyConfiguration | DPHY | DPHY | +| Camera module name | _ | _ | +| MIPI port | 0 | 2 | +| LaneUsed | x2 | x2 | +| MCLK | 19200000 | 19200000 | +| EEPROM Type | ROM_NONE | ROM_NONE | +| VCM Type | VCM_NONE | VCM_NONE | +| Number of I2C Components | 1 | 1 | +| I2C Channel | I2C1 | I2C0 | +| Device 0 | | | +| I2C Address | 10 | 10 | +| Device Type | Sensor | Sensor | +| Customize Device ID List | | | +| Customize Device ID Number | 17 | 17 | +| Customize Device ID Number | 18 | 18 | +| Customize Device ID Number | 19 | 19 | +| Flash Driver Selection | Disabled | Disabled | + ## Camera Configuration File Setup #### Setup for IPU6EPMTL @@ -62,12 +199,36 @@ Replace target system with recommended [ipu6epmtl](../../config/ar0234/ipu6epmtl sudo cp -r ../../config/ar0234/ipu6epmtl /etc/camera sudo sed -i '/availableSensors/c\ ' /etc/camera/ipu6epmtl/libcamhal_profile.xml +#### Setup for IPU75XA + +Replace target system with recommended [ipu75xa](../../config/ar0234/ipu75xa) setting + +> **Note:** Add config below only if using x2 MIPI sensors. + + sudo cp -r ../../config/ar0234/ipu75xa /etc/camera + +#### Setup for IPU8 + +Replace target system with recommended [ipu8](../../config/ar0234/ipu8) setting + +> **Note:** Add config below only if using x2 MIPI sensors. + + sudo cp -r ../../config/ar0234/ipu8 /etc/camera + ## Camera Tuning File Setup #### Setup for IPU6EPMTL Import [AR0234_TGL_10bits.aiqb](https://github.com/intel/ipu6-camera-hal/blob/iotg_ipu6/config/linux/ipu6epmtl/AR0234_TGL_10bits.aiqb) into target system `/etc/camera/ipu6epmtl` +#### Setup for IPU75XA + +> **TODO:** No action needed for now, will revisit once AIQB config available in [ipu7-camera-hal](https://github.com/intel/ipu7-camera-hal/tree/main/config/linux/ipu75xa). + +#### Setup for IPU8 + +> **TODO:** No action needed for now, will revisit once AIQB config available in [ipu7-camera-hal](https://github.com/intel/ipu7-camera-hal/tree/main/config/linux/ipu8). + ## Environment Setup > **Note:** PSYS library requires superuser access, please login as root to run the sample commands given below. @@ -147,3 +308,9 @@ Upon setup completion, verify sensor with: | x1 | DMA MODE | 30 | | x2 | USERPTR | 30 | | x2 | DMA MODE | 30 | + +> **Note**: Refer to [README.md](https://github.com/intel-innersource/drivers.camera.scaling.sensor) for system setup prerequisite. + +--- + +[↑ Back to Top](#description) diff --git a/drivers/media/i2c/maxim-serdes/max96717.c b/drivers/media/i2c/maxim-serdes/max96717.c index 9fc72fd2..6107e18a 100644 --- a/drivers/media/i2c/maxim-serdes/max96717.c +++ b/drivers/media/i2c/maxim-serdes/max96717.c @@ -820,6 +820,30 @@ static int max96717_gpio_set(struct gpio_chip *gc, unsigned int offset, int valu return max96717_conf_pin_config_set_one(priv, offset, config); } +static int max96717_gpio_set_config(struct gpio_chip *gc, unsigned int offset, + unsigned long config) +{ + struct max96717_priv *priv = gpiochip_get_data(gc); + unsigned int mask, val; + + switch (pinconf_to_config_param(config)) { + case PIN_CONFIG_DRIVE_OPEN_DRAIN: + /* OUT_TYPE = 0 -> open-drain; leave pull resistor config unchanged */ + mask = MAX96717_GPIO_B_OUT_TYPE; + val = 0; + break; + case PIN_CONFIG_DRIVE_PUSH_PULL: + /* OUT_TYPE = 1 -> push-pull */ + mask = MAX96717_GPIO_B_OUT_TYPE; + val = field_prep(MAX96717_GPIO_B_OUT_TYPE, 1); + break; + default: + return max96717_conf_pin_config_set_one(priv, offset, config); + } + + return regmap_update_bits(priv->regmap, MAX96717_GPIO_B(offset), mask, val); +} + static unsigned int max96717_pipe_id(struct max96717_priv *priv, struct max_ser_pipe *pipe) { @@ -1728,7 +1752,7 @@ static int max96717_gpiochip_probe(struct max96717_priv *priv) .can_sleep = true, .request = gpiochip_generic_request, .free = gpiochip_generic_free, - .set_config = gpiochip_generic_config, + .set_config = max96717_gpio_set_config, .get_direction = max96717_gpio_get_direction, .direction_input = max96717_gpio_direction_input, .direction_output = max96717_gpio_direction_output, diff --git a/drivers/media/i2c/maxim-serdes/max96724.c b/drivers/media/i2c/maxim-serdes/max96724.c index 3d70e95e..faeb30cd 100644 --- a/drivers/media/i2c/maxim-serdes/max96724.c +++ b/drivers/media/i2c/maxim-serdes/max96724.c @@ -80,7 +80,7 @@ #define MAX96724_BACKTOP32_BPP10DBL1_MODE BIT(7) #define MAX96724_MIPI_PHY0 0x8a0 -#define MAX96724_MIPI_PHY0_PHY_CONFIG GENMASK(4, 0) +#define MAX96724_MIPI_PHY0_PHY_CONFIG GENMASK(6, 0) #define MAX96724_MIPI_PHY0_PHY_4X2 BIT(0) #define MAX96724_MIPI_PHY0_PHY_2X4 BIT(2) #define MAX96724_MIPI_PHY0_PHY_1X4A_2X2 BIT(3) @@ -124,11 +124,12 @@ #define MAX96724_MIPI_PHY27_PHY_PKT_CNT(x) (GENMASK(3, 0) << (4 * ((x) % 2))) #define MAX96724_MIPI_TX3(x) (0x903 + (x) * 0x40) -#define MAX96724_MIPI_TX3_DESKEW_INIT_8X32K FIELD_PREP(GENMASK(2, 0), 0b001) +#define MAX96724_MIPI_TX3_DESKEW_INIT_8X32K FIELD_PREP(GENMASK(2, 0), 0b111) #define MAX96724_MIPI_TX3_DESKEW_INIT_AUTO BIT(7) #define MAX96724_MIPI_TX4(x) (0x904 + (x) * 0x40) -#define MAX96724_MIPI_TX4_DESKEW_PER_2K FIELD_PREP(GENMASK(2, 0), 0b001) +#define MAX96724_MIPI_TX4_DESKEW_PER_8 FIELD_PREP(GENMASK(2, 0), 0b111) +#define MAX96724_MIPI_TX4_DESKEW_PER_INT_1FRAME FIELD_PREP(GENMASK(5, 3), 0b000) #define MAX96724_MIPI_TX4_DESKEW_PER_AUTO BIT(7) #define MAX96724_MIPI_TX10(x) (0x90a + (x) * 0x40) @@ -403,6 +404,7 @@ static const unsigned int max96724_phys_configs_reg_val[] = { MAX96724_MIPI_PHY0_PHY_1X4A_2X2, MAX96724_MIPI_PHY0_PHY_1X4B_2X2, MAX96724_MIPI_PHY0_PHY_2X4, + MAX96724_MIPI_PHY0_PHY_1X4A_2X2 | MAX96724_MIPI_PHY0_CLK_PHY0, }; static const struct max_serdes_phys_config max96724_phys_configs[] = { @@ -424,6 +426,7 @@ static const struct max_serdes_phys_config max96724_phys_configs[] = { { { 4, 0, 2, 2 } }, { { 2, 2, 4, 0 } }, { { 4, 0, 4, 0 } }, + { { 0, 4, 2, 2 }, { 0, MAX96724_PHY1_ALT_CLOCK, 0, 0 } }, }; static int max96724_init_tpg(struct max_des *des) @@ -512,25 +515,6 @@ static int max96724_init_phy(struct max_des *des, struct max_des_phy *phy) MAX96724_MIPI_TX10_CSI2_CPHY_EN, is_cphy); if (ret) return ret; - - switch (phy->mipi.clock_lane) { - case 0: - val = MAX96724_MIPI_PHY0_CLK_PHY3; - break; - case 5: - val = MAX96724_MIPI_PHY0_CLK_PHY0; - break; - default: - dev_err(priv->dev, "Invalid clock lane %u for PHY %u\n", - phy->mipi.clock_lane, phy->index); - return -EINVAL; - } - - ret = regmap_assign_bits(priv->regmap, MAX96724_MIPI_PHY0, - MAX96724_MIPI_PHY0_CLK_PHY0 | MAX96724_MIPI_PHY0_CLK_PHY3, val); - if (ret) - return ret; - /* Configure lane mapping. */ val = 0; for (i = 0; i < num_hw_data_lanes ; i++) { @@ -591,17 +575,18 @@ static int max96724_init_phy(struct max_des *des, struct max_des_phy *phy) } if (!is_cphy && dpll_freq > 1500000000ull) { - /* Enable initial deskew with 2 x 32k UI. */ + /* Enable initial deskew with 8 x 32k UI. */ ret = regmap_write(priv->regmap, MAX96724_MIPI_TX3(index), MAX96724_MIPI_TX3_DESKEW_INIT_AUTO | MAX96724_MIPI_TX3_DESKEW_INIT_8X32K); if (ret) return ret; - /* Enable periodic deskew with 2 x 1k UI.. */ + /* Enable periodic deskew with 8 x 1k UI. */ ret = regmap_write(priv->regmap, MAX96724_MIPI_TX4(index), MAX96724_MIPI_TX4_DESKEW_PER_AUTO | - MAX96724_MIPI_TX4_DESKEW_PER_2K); + MAX96724_MIPI_TX4_DESKEW_PER_INT_1FRAME | + MAX96724_MIPI_TX4_DESKEW_PER_8); if (ret) return ret; } else { @@ -712,11 +697,48 @@ static int max96724_set_pipe_remap(struct max_des *des, struct max_des_remap *remap) { struct max96724_priv *priv = des_to_priv(des); - struct max_des_phy *phy = &des->phys[remap->phy]; - unsigned int phy_id = max96724_phy_id(des, phy); + struct max_des_phy *phy = NULL; + unsigned int phy_id; unsigned int index = pipe->index; + unsigned int j; int ret; + /* + * Route MAP_DPHY_DEST to the output PHY selected by the core for this + * route (remap->phy), but only when that PHY is a valid active output + * (enabled and with non-zero hw data lanes). This keeps multiple + * simultaneous output PHYs (e.g. 2x4/4x2) routed correctly. + */ + if (remap->phy < des->ops->num_phys && + des->phys[remap->phy].enabled && + max_des_phy_hw_data_lanes(des, &des->phys[remap->phy])) + phy = &des->phys[remap->phy]; + + /* + * Otherwise fall back to the first enabled PHY with non-zero hw data + * lanes. In 1x4A mode this is PHY1 (the master that carries the clock + * lane); the routing-context PHY can point at an inactive PHY (e.g. + * PHY0 with 0 lanes), which must not be programmed as the destination. + */ + if (!phy) { + for (j = 0; j < des->ops->num_phys; j++) { + if (des->phys[j].enabled && + max_des_phy_hw_data_lanes(des, &des->phys[j])) { + phy = &des->phys[j]; + break; + } + } + } + + if (!phy) { + dev_err(priv->dev, + "No active output PHY for pipe %u remap %u\n", index, i); + return -EINVAL; + } + + /* Translate logical PHY index to the physical MIPI controller id. */ + phy_id = max96724_phy_id(des, phy); + /* Set source Data Type and Virtual Channel. */ /* TODO: implement extended Virtual Channel. */ ret = regmap_write(priv->regmap, MAX96724_MIPI_TX13(index, i), diff --git a/ipu7-drivers b/ipu7-drivers index 22ce0dda..bed9b71d 160000 --- a/ipu7-drivers +++ b/ipu7-drivers @@ -1 +1 @@ -Subproject commit 22ce0dda426bd0c84695e6245139bc30fb554e54 +Subproject commit bed9b71d5be56d0e24c771c7a6ec83fd0a9db433 diff --git a/patches/6.18/0006-media-pci-ipu7-Add-D4XX-support-to-IPU7.patch b/patches/6.18/0006-media-pci-ipu7-Add-D4XX-support-to-IPU7.patch index 8e36a03f..c0742f43 100644 --- a/patches/6.18/0006-media-pci-ipu7-Add-D4XX-support-to-IPU7.patch +++ b/patches/6.18/0006-media-pci-ipu7-Add-D4XX-support-to-IPU7.patch @@ -41,7 +41,7 @@ WARN_ON(1); --- a/ipu7-drivers/drivers/media/pci/intel/ipu7/ipu7-isys-video.c +++ b/ipu7-drivers/drivers/media/pci/intel/ipu7/ipu7-isys-video.c -@@ -84,11 +84,20 @@ const struct ipu7_isys_pixelformat ipu7_isys_pfmts[] = { +@@ -84,12 +84,21 @@ const struct ipu7_isys_pixelformat ipu7_isys_pfmts[] = { {V4L2_PIX_FMT_UYVY, 16, 16, MEDIA_BUS_FMT_UYVY8_1X16, IPU_INSYS_FRAME_FORMAT_UYVY}, {V4L2_PIX_FMT_YUYV, 16, 16, MEDIA_BUS_FMT_YUYV8_1X16, @@ -62,7 +62,8 @@ + IPU_INSYS_FRAME_FORMAT_RAW8}, }; - static int video_open(struct file *file) + #ifdef CONFIG_VIDEO_INTEL_IPU7_ISYS_RESET + static int video_release(struct file *file) --- a/ipu7-drivers/drivers/media/pci/intel/ipu7/ipu7-isys.h +++ b/ipu7-drivers/drivers/media/pci/intel/ipu7/ipu7-isys.h @@ -45,7 +45,7 @@ struct ipu7_isys_stream; diff --git a/script/acpi/mc-setup.sh b/script/acpi/mc-setup.sh index e8719386..35ef715a 100755 --- a/script/acpi/mc-setup.sh +++ b/script/acpi/mc-setup.sh @@ -100,10 +100,17 @@ declare -A SENSOR_MODEL=( [INTC10CD]=d4xx [INTC113C]=isx031 + [INTC10C0]=ar0234 ) declare -A SENSOR_PREFIX=( [INTC10CD]="DS5 mux" [INTC113C]="isx031" + [INTC10C0]="ar0234" +) + +# ---- Direct MIPI sensor HIDs (no GMSL deserializer) ------------------------ +declare -A MIPI_SENSOR_HID=( + [INTC113C]=isx031 ) # ---- Serializer / Deserializer HID -> v4l entity prefix --------------------- @@ -128,10 +135,12 @@ declare -A MAX_LINKS_BY_PREFIX=( declare -A MODEL_STREAMS=( [d4xx]="depth rgb ir imu" [isx031]="yuv" + [ar0234]="raw" ) declare -A MODEL_DEFAULT_STREAMS=( [d4xx]="depth rgb" [isx031]="yuv" + [ar0234]="raw" ) # STREAM_NODE: per-stream capture-node index (also used as the v4l2 @@ -143,6 +152,7 @@ declare -A STREAM_NODE=( [ir]=2 [imu]=3 [yuv]=0 + [raw]=0 ) # Keep capture-node groups consistent across 2-link and 4-link deserializers: @@ -171,6 +181,7 @@ declare -A STREAM_FMT=( [ir]=${STREAM_FMT_ir:-VYUY8_1X16} [imu]=${STREAM_FMT_imu:-Y8_1X8} [yuv]=${STREAM_FMT_yuv:-UYVY8_1X16} + [raw]=${STREAM_FMT_raw:-SGRBG10_1X10} ) declare -A STREAM_SIZE=( [depth]=${STREAM_SIZE_depth:-$D4XX_SIZE} @@ -178,6 +189,7 @@ declare -A STREAM_SIZE=( [ir]=${STREAM_SIZE_ir:-$D4XX_SIZE} [imu]=${STREAM_SIZE_imu:-38x1} [yuv]=${STREAM_SIZE_yuv:-1920x1536} + [raw]=${STREAM_SIZE_raw:-1280x960} ) # ---- Media-bus -> V4L2 pixelformat fourcc (used on capture nodes) ----------- @@ -186,7 +198,9 @@ declare -A MBUS_TO_PIXFMT=( [YUYV8_1X16]="YUYV" [VYUY8_1X16]="Y8I " # IR -> interleaved 8-bit greyscale [Y8_1X8]="GREY" + [SGRBG10_1X10]="BA10" # AR0234 RAW Bayer SGRBG 10-bit ) +mbus_to_pixfmt() { echo "${MBUS_TO_PIXFMT[$1]:-}"; } # ============================================================================= # end of USER CONFIGURATION @@ -194,6 +208,25 @@ declare -A MBUS_TO_PIXFMT=( # -------- low-level helpers --------------------------------------------------- +# Find the lowest "ISYS Capture N" index linked from a given CSI2 entity. +# Reads media-ctl topology from stdin. +capture_base_of_csi2() { + awk -v csi="$1" ' + /^- entity / { + n = "" + if (match($0, /Intel IPU[0-9]+ ISYS Capture [0-9]+/)) { + s = substr($0, RSTART, RLENGTH) + sub(/.*Capture /, "", s) + n = s + 0 + } + } + n != "" && index($0, "<- \"" csi "\":") { + if (m == "" || n < m) m = n + } + END { if (m != "") print m } + ' +} + # Read "bus-addr" (e.g. 18-0010) from any v4l-subdev whose name starts with # the given prefix, under any physical_node* of an ACPI sysfs dir. acpi_busaddr() { @@ -329,7 +362,7 @@ discover_one_des() { DES_PATH[$d]=$des_path DES_BA[$d]=$des_ba DES_PREFIX_NAME[$d]=$des_prefix - # DES_SRC_PAD[$d] is filled in later by detect_csi2_entities() based on the + # DES_SRC_PAD[$d] is filled in later by detect_gmsl_csi2() based on the # live media topology (which reflects the DES_CSI_LOCAL_PORT value the # SSDT/_CRS published in the CSI2Bus resource). DES_MAX_LINKS[$d]=${MAX_LINKS_BY_PREFIX[$des_prefix]:-4} @@ -422,19 +455,107 @@ discover_one_des() { discover() { local des_dirs=() mapfile -t des_dirs < <(find_all_deserializers) - [ "${#des_dirs[@]}" -gt 0 ] || { - echo "ERROR: no known deserializer ACPI device present" >&2 + if [ "${#des_dirs[@]}" -gt 0 ]; then + local d=0 dir + for dir in "${des_dirs[@]}"; do + if discover_one_des "$d" "$dir"; then + d=$((d + 1)) + fi + done + NUM_DES=$d + fi + if [ "$NUM_DES" -eq 0 ] && [ "${#des_dirs[@]}" -gt 0 ]; then + echo "WARN: ${#des_dirs[@]} deserializer ACPI device(s) found" \ + "but none are usable (driver loaded?)" >&2 + fi + # Discover direct MIPI cameras (skips sensors already behind a DES). + discover_mipi_cameras + [ "$NUM_DES" -gt 0 ] || [ "$NUM_MIPI" -gt 0 ] || { + echo "ERROR: no deserializer or direct MIPI camera found" >&2 return 1 } - local d=0 dir - for dir in "${des_dirs[@]}"; do - if discover_one_des "$d" "$dir"; then - d=$((d + 1)) + return 0 +} + +# ---- Direct MIPI camera support --------------------------------------------- +declare -a MIPI_BA=() MIPI_PREFIX=() MIPI_MODEL=() MIPI_CSI2=() MIPI_CAP=() +NUM_MIPI=0 + +discover_mipi_cameras() { + local hid model prefix d ba path idx=0 + for hid in "${!MIPI_SENSOR_HID[@]}"; do + model=${MIPI_SENSOR_HID[$hid]} + prefix=${SENSOR_PREFIX[$hid]} + for d in /sys/bus/acpi/devices/${hid}:*; do + [ -d "$d" ] || continue + # Skip sensors already discovered behind a deserializer. + path=$(cat "$d/path" 2>/dev/null) || continue + local skip=0 di + for ((di = 0; di < NUM_DES; di++)); do + case "$path" in "${DES_PATH[$di]}."*) skip=1; break ;; esac + done + [ "$skip" -eq 1 ] && continue + ba=$(acpi_busaddr "$d" "$prefix") || continue + MIPI_BA[$idx]=$ba; MIPI_PREFIX[$idx]=$prefix; MIPI_MODEL[$idx]=$model + idx=$((idx + 1)) + done + done + NUM_MIPI=$idx + [ "$NUM_MIPI" -gt 0 ] && echo "Discovered $NUM_MIPI direct MIPI camera(s)" +} + +detect_mipi_csi2() { + [ "$NUM_MIPI" -eq 0 ] && return 0 + local topo i cam csi2 base + topo=$(media-ctl -p 2>/dev/null) || return 1 + for ((i = 0; i < NUM_MIPI; i++)); do + cam="${MIPI_PREFIX[$i]} ${MIPI_BA[$i]}" + csi2=$(awk -v c="$cam" ' + /- entity.*: / { f = index($0, ": " c " (") ? 1 : 0 } + f && /-> "Intel IPU[0-9]+ CSI2 [0-9]+"/ { + gsub(/.*-> "|":.*/, "") + print + exit + } + ' <<<"$topo") + [ -z "$csi2" ] && { echo "ERROR: no CSI2 link for $cam" >&2; return 1; } + MIPI_CSI2[$i]=$csi2 + MIPI_CAP[$i]=$(capture_base_of_csi2 "$csi2" <<<"$topo") + if [ -z "${MIPI_CAP[$i]}" ]; then + echo "ERROR: MIPI${i}: could not find any 'ISYS Capture' entity linked from '$csi2'" >&2 + return 1 fi done - NUM_DES=$d - [ "$NUM_DES" -gt 0 ] || { echo "ERROR: no usable deserializer found" >&2; return 1; } - return 0 +} + +setup_mipi_cameras() { + [ "$NUM_MIPI" -eq 0 ] && return 0 + echo -e "\nConfiguring direct MIPI cameras..." + local i model cam csi2 node fmt size s pixfmt w h ipu + for ((i = 0; i < NUM_MIPI; i++)); do + model=${MIPI_MODEL[$i]} + cam=${MIPI_BA[$i]} + csi2=${MIPI_CSI2[$i]} + node=${MIPI_CAP[$i]} + for s in ${MODEL_DEFAULT_STREAMS[$model]}; do + fmt=${STREAM_FMT[$s]} + size=${STREAM_SIZE[$s]} + break + done + echo " ${MIPI_PREFIX[$i]} $cam -> $csi2 -> /dev/video$node ($fmt/$size)" + mc_v "\"${MIPI_PREFIX[$i]} ${cam}\":0 [fmt:${fmt}/${size} field:none]" + mc_v "\"${csi2}\":0 [fmt:${fmt}/${size} field:none]" + mc_v "\"${csi2}\":1 [fmt:${fmt}/${size} field:none]" + ipu=${csi2% CSI2 *} + mc_l "\"${csi2}\":1 -> \"${ipu} ISYS Capture ${node}\":0[1]" + pixfmt=$(mbus_to_pixfmt "$fmt") + w=${size%x*} + h=${size#*x} + [ -n "$pixfmt" ] && + v4l2-ctl -d "/dev/video${node}" \ + --set-fmt-video="width=${w},height=${h},pixelformat=${pixfmt}" \ + >/dev/null + done } # For each DES, locate the "Intel IPUx CSI2 N" entity wired to its source @@ -442,7 +563,7 @@ discover() { # the SSDT CSI2Bus resource), and the absolute capture-node base (lowest # "ISYS Capture " index linked to that CSI2). The DES->CSI2 link is # IMMUTABLE so the live media topology is the source of truth. -detect_csi2_entities() { +detect_gmsl_csi2() { local topo topo=$(media-ctl -p 2>/dev/null) || { echo "ERROR: failed to read media topology via 'media-ctl -p'" >&2 @@ -475,25 +596,11 @@ detect_csi2_entities() { IPU_CSI2_ENTITY[$d]=$csi2 IPU_BASE[$d]=${csi2% CSI2 *} - # Capture base = lowest "ISYS Capture N" entity that links from this CSI2. - base=$(awk -v csi="$csi2" ' - /^- entity / { - cap_num = "" - if (match($0, /Intel IPU[0-9]+ ISYS Capture [0-9]+/)) { - s = substr($0, RSTART, RLENGTH) - sub(/.*Capture /, "", s) - cap_num = s + 0 - } - } - cap_num != "" && index($0, "<- \"" csi "\":") { - if (min == "" || cap_num < min) min = cap_num - } - END { if (min != "") print min }' <<<"$topo") - if [ -z "$base" ]; then + CAPTURE_BASE[$d]=$(capture_base_of_csi2 "$csi2" <<<"$topo") + if [ -z "${CAPTURE_BASE[$d]}" ]; then echo "ERROR: DES${d}: could not find any 'ISYS Capture' entity linked from '$csi2'" >&2 return 1 fi - CAPTURE_BASE[$d]=$base done return 0 } @@ -516,6 +623,11 @@ print_topology() { "${CAM_MODEL[$key]}" "${CAM_HID[$key]}" done done + for ((i = 0; i < NUM_MIPI; i++)); do + printf " MIPI%d %s %s -> %s (capture /dev/video%s)\n" \ + "$i" "${MIPI_PREFIX[$i]}" "${MIPI_BA[$i]}" \ + "${MIPI_CSI2[$i]}" "${MIPI_CAP[$i]}" + done } # -------- per-sensor media-ctl programming ----------------------------------- @@ -600,9 +712,16 @@ check_media_ctl_version() { check_media_ctl_version discover || exit 1 -detect_csi2_entities || exit 1 + +[ "$NUM_DES" -gt 0 ] && { detect_gmsl_csi2 || exit 1; } +[ "$NUM_MIPI" -gt 0 ] && { detect_mipi_csi2 || exit 1; } print_topology +# ---- GMSL programming (DES-based cameras) ----------------------------------- +# Steps below (argument parsing, pad computation, route setup, format +# propagation, capture-node format) apply only to GMSL deserializer cameras. +# Direct MIPI cameras are handled separately by setup_mipi_cameras() at the end. + # ---- argument parsing ------------------------------------------------------ # Each CFG entry is identified by (des_idx, link_idx) and carries a streams list. @@ -781,7 +900,7 @@ for k in "${!CFG_LINKS[@]}"; do unset is_selected ;; - isx031) + isx031|ar0234) ser_route_parts=() for s in "${sel_streams[@]}"; do sid=${STREAM_NODE[$s]} @@ -844,6 +963,9 @@ for k in "${!CFG_LINKS[@]}"; do isx031) mc_v "\"isx031 ${cam}\":0/${sid} [fmt:${fmt}/${size} field:none]" ;; + ar0234) + mc_v "\"ar0234 ${cam}\":0/${sid} [fmt:${fmt}/${size} field:none]" + ;; esac mc_v "\"${ser_pfx} ${ser}\":0/${sid} [fmt:${fmt}/${size} field:none]" mc_v "\"${ser_pfx} ${ser}\":1/${sid} [fmt:${fmt}/${size} field:none]" @@ -856,8 +978,6 @@ done # ---- v4l2-ctl: capture-node format ----------------------------------------- -mbus_to_pixfmt() { echo "${MBUS_TO_PIXFMT[$1]:-}"; } - for k in "${!CFG_LINKS[@]}"; do d=${CFG_DES[$k]} for s in ${CFG_STREAMS[$k]}; do @@ -872,3 +992,6 @@ for k in "${!CFG_LINKS[@]}"; do >/dev/null done done + +# ---- direct MIPI cameras (non-GMSL) ----------------------------------------- +setup_mipi_cameras