diff --git a/README.md b/README.md index f302b65f..fcbcc168 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This repository contains reference drivers and configurations for Intel MIPI CSI | Sensor | Sensor Type | Vendor | IPU Version | |-----------------|-------------|-----------------|----------------------------------| | AR0233+GW5300 | GMSL | Sensing | IPU6EPMTL, IPU75XA | -| AR0234 | GMSL | D3 Embedded | IPU6EPMTL | +| AR0234 | GMSL | D3 Embedded | IPU6EPMTL, IPU75XA | | AR0234 | MIPI CSI-2 | D3 Embedded | IPU6EPMTL, IPU75XA, IPU8 | | AR0820+GW5300 | GMSL | Sensing | IPU6EPMTL, IPU75XA | | AR0830+AP1302 | MIPI CSI-2 | Leopard Imaging | IPU6EPMTL, IPU75XA | diff --git a/acpi/ipu7/_cam_common_ar0234.asl b/acpi/ipu7/_cam_common_ar0234.asl new file mode 100644 index 00000000..2406bdf6 --- /dev/null +++ b/acpi/ipu7/_cam_common_ar0234.asl @@ -0,0 +1,99 @@ +/* + * 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 + 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-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 } }, + #endif + }, +}) \ No newline at end of file diff --git a/acpi/ipu7/_des_ch_common_ar0234.asl b/acpi/ipu7/_des_ch_common_ar0234.asl new file mode 100644 index 00000000..078cdd9c --- /dev/null +++ b/acpi/ipu7/_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" + } + } +} diff --git a/acpi/ipu7/max96724_d3_ar0234.asl b/acpi/ipu7/max96724_d3_ar0234.asl new file mode 100644 index 00000000..923a9ad4 --- /dev/null +++ b/acpi/ipu7/max96724_d3_ar0234.asl @@ -0,0 +1,120 @@ +/* + * SPDX-License-Identifier: GPL-2.0 + * Copyright (c) 2026 Intel Corporation. + * + * SSDT overlay: D3 AR0234 GMSL camera configuration on PTL platform + * One MAX96724 deserializers (DES0) with CPHY connection to PTL platform, + * each carrying two D3 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. 0x0027 for MAX96724) + * DES_LANES - Number of MIPI data lanes (e.g. 2, 4) + * DES_INTERNAL_PHY - DES internal PHY (PHY0 = 4, PHY1 = 5, PHY2 = 6, PHY3 = 7) + * 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..3) - 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", 0x20260819) +{ + External (_SB.PC00, DeviceObj) // Root device + + Include ("_ipu.asl") + + Scope (\_SB.PC00) + { + Device (DES0) + { + /* + * For detailed explanation of each define, + * please refer to the comment block at the top of this file. + */ + + // DES-level defines for DES0. + #define DES_PHY_TYPE 0 + #define DES_I2C_ADDR 0x0027 + #define DES_LANES 2 + #define DES_INTERNAL_PHY 6 + #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 + #include "_des_common_max96724.asl" + + // Channel-level defines for Channel 0 (CH00) + #define DESCH_CH CH00 + #define DESCH_SER SER0 + #define DESCH_CAM CAM0 + #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_LINK_NUM 0 + #define DESCH_SER_I2C 0x40 + #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_CH CH01 + #define DESCH_SER SER1 + #define DESCH_CAM CAM1 + #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_LINK_NUM 1 + #define DESCH_SER_I2C 0x40 + #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 DES0-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 + } + } +} diff --git a/config/ar0234/ipu75xa/libcamhal_configs.json b/config/ar0234/ipu75xa/libcamhal_configs.json index ce9b3314..4a8a7245 100644 --- a/config/ar0234/ipu75xa/libcamhal_configs.json +++ b/config/ar0234/ipu75xa/libcamhal_configs.json @@ -18,9 +18,11 @@ "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"], + // Supported sensors list: + // ar0234-a-0 - for mipi setup, where sensor connected on crd1 (port 0) + // ar0234-b-2 - for mipi setup, where sensor connected on crd2 (port 2) + // ar0234 - for gmsl setup with x2 sensors, where sensors detected as sensor 1 - sensor 2 + "availableSensors": ["ar0234-a-0","ar0234-b-2","ar0234"], "videoStreamNum" : 2 } } diff --git a/config/ar0234/ipu75xa/sensors/ar0234.json b/config/ar0234/ipu75xa/sensors/ar0234.json new file mode 100644 index 00000000..383bcc92 --- /dev/null +++ b/config/ar0234/ipu75xa/sensors/ar0234.json @@ -0,0 +1,406 @@ +// +// 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_acpi-1", + "description": "AR0234 GMSL Sensor 1", + "vcCount": 2, + "vcId": 0, + "vcGroupId": 0, + "MediaCtlConfig": [ + { + "id": 0 , + "configMode": "AUTO", + "output": [1280, 960], + "videonode": [ + { "name": "Intel IPU7 ISYS Capture 0", "videoNodeType": "VIDEO_GENERIC" }, + { "name": "Intel IPU7 CSI2 0", "videoNodeType": "VIDEO_ISYS_RECEIVER" }, + { "name": "ar0234 22-0010", "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 + }, + { + "name": "ar0234_acpi-2", + "description": "AR0234 GMSL Sensor 2", + "vcCount": 2, + "vcId": 1, + "vcGroupId": 0, + "MediaCtlConfig": [ + { + "id": 0, + "configMode": "AUTO", + "output": [1280, 960], + "videonode": [ + { "name": "Intel IPU7 ISYS Capture 1", "videoNodeType": "VIDEO_GENERIC" }, + { "name": "Intel IPU7 CSI2 0", "videoNodeType": "VIDEO_ISYS_RECEIVER" }, + { "name": "ar0234 23-0010", "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/doc/ar0234/max9296-link-port.png b/doc/ar0234/max9296-link-port.png deleted file mode 100644 index 065fbf29..00000000 Binary files a/doc/ar0234/max9296-link-port.png and /dev/null differ diff --git a/doc/ar0234/max96724-link-port.png b/doc/ar0234/max96724-link-port.png deleted file mode 100644 index 5b337dfe..00000000 Binary files a/doc/ar0234/max96724-link-port.png and /dev/null differ diff --git a/doc/ar0234/max96724-link-port2.png b/doc/ar0234/max96724-link-port2.png deleted file mode 100644 index f32faf73..00000000 Binary files a/doc/ar0234/max96724-link-port2.png and /dev/null differ diff --git a/doc/ar0234/userspace-gmsl.md b/doc/ar0234/userspace-gmsl.md index 4a5e0221..5fb571c3 100644 --- a/doc/ar0234/userspace-gmsl.md +++ b/doc/ar0234/userspace-gmsl.md @@ -2,14 +2,113 @@ This document details the configuration settings for the AR0234 GMSL 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. Hardware Connection + +
  2. +
  3. BIOS Configuration Table + +
  4. +
  5. MIPI Camera Configuration + +
  6. +
  7. Camera Configuration File Setup + +
  8. +
  9. Camera Tuning File Setup + +
  10. +
  11. Environment Setup
  12. +
  13. Sensor Verification
  14. +
  15. Sample Userspace Command
  16. +
  17. Streaming Result
  18. +
+
+ +## Hardware Connection + +This section describes the physical AIC (Add-In Card) hardware setup, including link port layout and jumper configurations for MIPI PHY selection. + +#### MAX9296 AIC (REV B) Connection + +> **Note:** Samtec cables and an external power supply are required to connect the MAX9296 AIC to the baseboard. + +![link-port](../isx031/max9296-link-port.png ) + +#### MAX96724 AIC (C-PHY) (REV A) Connection + +> **Note:** The MAX96724 AIC (REV A) supports only C-PHY connections, selectable via the J14 jumper highlighted in the image below. + +![link-port](../isx031/max96724-faba-cphy.png) + +#### MAX96724 AIC (C-PHY) (REV B) Connection + +> **Note:** The MAX96724 AIC (REV B) supports both C-PHY and D-PHY connections, selectable via the J14 jumper. + +Image below shows the C-PHY setup. + + +![link-port](../isx031/max96724-fabb-cphy.png) + +#### MAX96724 AIC (D-PHY) (REV B) Connection + +> **Note:** Ensure the J14 jumper pins are oriented toward the D-PHY connector, as shown in the image below. + +Image below shows the D-PHY setup. + +![link-port](../isx031/max96724-fabb-dphy.png) + + +#### MAX96724 AIC (C-PHY to D-PHY Adapter) (REV B) Connection + +Image below shows the C-PHY to D-PHY adapter setup. + +![link-port](../isx031/max96724-fabb-cphy-dphy.png) + + ## BIOS Configuration Table > **Note:** No External Clock required. -### MIPI Camera Configuration for IPU6EPMTL +#### Disable C States + +Config path: `Intel Advanced Menu`->`Power & Performance`->`CPU - Power Management Control` + +| | Options | +|--- |--- | +| C states | Disabled | + +> **Note:** This option is only applicable for IPU6EP platforms (ADL, TWL, ASL and RPL). + +## MIPI Camera Configuration + +#### Setup for IPU6EPMTL Config path: `Intel Advanced Menu`->`System Agent (SA) Configuration`->`MIPI Camera Configuration` +
+Click to expand BIOS camera link options + | | Camera1 Link options | |--- |--- | | Sensor Model | User Custom | @@ -46,6 +145,15 @@ Config path: `Intel Advanced Menu`->`System Agent (SA) Configuration`->`MIPI Cam | Customize Device ID Number | 19 | | Flash Driver Selection | Disabled | +
+ +#### Setup for IPU75XA + +> **Note:** Configuration is performed using SSDT ACPI method based on [MAX96724 AIC (C-PHY) (REV A) Connection](#max96724-aic-c-phy-rev-a-connection). Please visit 'Compile and Load ACPI ASL source' in [acpi](../acpi/kernelspace.md) for setup guideline. + + cd ../../acpi/ipu7 + ../../script/gen_ssdt.sh max96724_d3_ar0234.asl + ## Camera Configuration File Setup #### Setup for IPU6EPMTL @@ -57,12 +165,23 @@ 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 + + sudo cp -r ../../config/ar0234/ipu75xa /etc/camera + ../../script/acpi/mc-setup.sh + ## 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). + ## Environment Setup > **Note:** PSYS library requires superuser access, please login as root to run the sample commands given below. @@ -97,38 +216,32 @@ Upon setup completion, verify sensor with: > **Note:** PSYS library requires superuser access, please login as root to run the sample commands given below. +> **Attention:** If target is setup using BIOS MIPI Camera Configuration, please replace 'device-name' format in sample commands below from 'ar0234_acpi-' to 'ar0234-'. For example, 'ar0234_acpi-1' become 'ar0234-1'. + #### Sensor Device Selection | Sensor Number | Command Pipeline | |---|---| -| 1 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | -| 2 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234-2 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | +| 1 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234_acpi-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | +| 2 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234_acpi-2 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | > **Note**: Refer to icamerasrc device-name property for more sensor details. ##### How to relate Sensor Number with AIC Link Port +Refer to MAX9296 or MAX96724 AIC under [Hardware Connection](#hardware-connection), select the correct sensor number based on the physical AIC link port layout. + | AIC Link Port | Sensor Number | |--- |--- | | A | 1 | | B | 2 | -For AIC MAX9296 - -![link-port](max9296-link-port.png) - -For AIC MAX96724 - -![link-port](max96724-link-port.png) - -![link-port](max96724-link-port2.png) - #### Frame Buffer Memory Type (IO Mode) Selection | IO Mode | Command Pipeline | |---|---| -| USERPTR | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234-1 printfps=true io-mode=userptr ! 'video/x-raw,format=NV12,width=1280,height=960' ! glimagesink sync=false | -| DMA MODE | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | +| USERPTR | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234_acpi-1 printfps=true io-mode=userptr ! 'video/x-raw,format=NV12,width=1280,height=960' ! glimagesink sync=false | +| DMA MODE | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234_acpi-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | > **Note**: Refer to icamerasrc io-mode property for more sensor details. @@ -136,20 +249,20 @@ For AIC MAX96724 | Resolution | Command Pipeline | |---|---| -| 1280x960 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | +| 1280x960 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234_acpi-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | #### Sensor Format Selection | Format | Command Pipeline | |---|---| -| NV12 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | +| NV12 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234_acpi-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | #### Number of Stream (Single Stream / Multi Stream) Selection | Number of Stream | Command Pipeline | |---|---| -| x1 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | -| x2 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=2 scene-mode=normal device-name=ar0234-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false icamerasrc num-buffers=-1 num-vc=2 scene-mode=normal device-name=ar0234-2 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | +| x1 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=1 scene-mode=normal device-name=ar0234_acpi-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | +| x2 | gst-launch-1.0 icamerasrc num-buffers=-1 num-vc=2 scene-mode=normal device-name=ar0234_acpi-1 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false icamerasrc num-buffers=-1 num-vc=2 scene-mode=normal device-name=ar0234_acpi-2 printfps=true io-mode=dma_mode ! 'video/x-raw(memory:DMABuf),drm-format=NV12,width=1280,height=960' ! glimagesink sync=false | ## Streaming Result @@ -161,3 +274,7 @@ For AIC MAX96724 | x2 | DMA MODE | 30 | > **Note:** Please ensure your system enable support for specified number of stream before test. + +--- + +[↑ Back to Top](#description) diff --git a/drivers/media/i2c/isx031.c b/drivers/media/i2c/isx031.c index 66d6ce8c..2d2dcfd5 100644 --- a/drivers/media/i2c/isx031.c +++ b/drivers/media/i2c/isx031.c @@ -553,7 +553,7 @@ static void isx031_update_pad_format(const struct isx031_mode *mode, fmt->width = mode->width; fmt->height = mode->height; fmt->code = mode->code; - fmt->field = V4L2_FIELD_ANY; + fmt->field = V4L2_FIELD_NONE; } static int isx031_get_num_lane(struct isx031 *isx031, struct device *dev) diff --git a/drivers/media/i2c/maxim-serdes/max_des.c b/drivers/media/i2c/maxim-serdes/max_des.c index cfd8f168..523bf1fb 100644 --- a/drivers/media/i2c/maxim-serdes/max_des.c +++ b/drivers/media/i2c/maxim-serdes/max_des.c @@ -2097,6 +2097,8 @@ static int max_des_set_fmt(struct v4l2_subdev *sd, if (!fmt) return -EINVAL; + format->format.field = V4L2_FIELD_NONE; + *fmt = format->format; fmt = v4l2_subdev_state_get_opposite_stream_format(state, format->pad, diff --git a/drivers/media/i2c/maxim-serdes/max_ser.c b/drivers/media/i2c/maxim-serdes/max_ser.c index 8b1f2260..35d98760 100644 --- a/drivers/media/i2c/maxim-serdes/max_ser.c +++ b/drivers/media/i2c/maxim-serdes/max_ser.c @@ -543,6 +543,8 @@ static int max_ser_set_fmt(struct v4l2_subdev *sd, if (!fmt) return -EINVAL; + format->format.field = V4L2_FIELD_NONE; + *fmt = format->format; fmt = v4l2_subdev_state_get_opposite_stream_format(state, format->pad,