From bd01d2d08c0a01669489f3e7a489a4bc308653ce Mon Sep 17 00:00:00 2001 From: dchvs Date: Fri, 19 Mar 2021 18:22:08 -0600 Subject: [PATCH 1/4] Add mode1 with resolution 1280x960 to DTB --- .../tegra186-tx2-spiri-camera.dtsi | 81 ++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/hardware/nvidia-spiri/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-tx2-spiri-camera.dtsi b/hardware/nvidia-spiri/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-tx2-spiri-camera.dtsi index 1734d40..2ccbe00 100644 --- a/hardware/nvidia-spiri/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-tx2-spiri-camera.dtsi +++ b/hardware/nvidia-spiri/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-tx2-spiri-camera.dtsi @@ -109,7 +109,7 @@ i2c8 = "/i2c@31e0000"; max_hdr_ratio = "1"; min_framerate = "2000000"; - max_framerate = "60000000"; + max_framerate = "60000000"; step_framerate = "1"; default_framerate = "60000000"; // 60.0 fps @@ -118,6 +118,46 @@ i2c8 = "/i2c@31e0000"; step_exp_time = "1"; default_exp_time = "50000"; // us }; + mode1 { + mclk_khz = "24000"; + num_lanes = "1"; + tegra_sinterface = "serial_b"; + discontinuous_clk = "no"; + dpcm_enable = "false"; + cil_settletime = "26"; + + active_w = "1280"; + active_h = "960"; + dynamic_pixel_bit_depth = "12"; + csi_pixel_bit_depth = "12"; + mode_type = "bayer"; + pixel_phase = "rggb"; + readout_orientation = "0"; + line_length = "1650"; + inherent_gain = "1"; + pix_clk_hz = "74250000"; + + gain_factor = "3"; + framerate_factor = "1000000"; + exposure_factor = "1000000"; + min_gain_val = "102"; + max_gain_val = "160" ; + step_gain_val = "1"; + default_gain = "102"; + min_hdr_ratio = "1"; + max_hdr_ratio = "1"; + + min_framerate = "2000000"; + max_framerate = "45000000"; + step_framerate = "1"; + default_framerate = "45000000"; // 45.0 fps + + min_exp_time = "24000"; // us + max_exp_time = "74000"; // us + step_exp_time = "1"; + default_exp_time = "50000"; // us + }; + ports { #address-cells = <0x1>; #size-cells = <0x0>; @@ -205,6 +245,45 @@ i2c8 = "/i2c@31e0000"; step_exp_time = "1"; default_exp_time = "50000"; // us }; + mode1 { + mclk_khz = "24000"; + num_lanes = "1"; + tegra_sinterface = "serial_a"; + discontinuous_clk = "no"; + dpcm_enable = "false"; + cil_settletime = "26"; + + active_w = "1280"; + active_h = "960"; + dynamic_pixel_bit_depth = "12"; + csi_pixel_bit_depth = "12"; + mode_type = "bayer"; + pixel_phase = "rggb"; + readout_orientation = "0"; + line_length = "1650"; + inherent_gain = "1"; + pix_clk_hz = "74250000"; + + gain_factor = "3"; + framerate_factor = "1000000"; + exposure_factor = "1000000"; + min_gain_val = "102"; + max_gain_val = "160" ; + step_gain_val = "1"; + default_gain = "102"; + min_hdr_ratio = "1"; + max_hdr_ratio = "1"; + + min_framerate = "2000000"; + max_framerate = "45000000"; + step_framerate = "1"; + default_framerate = "45000000"; // 45.0 fps + + min_exp_time = "24000"; // us + max_exp_time = "74000"; // us + step_exp_time = "1"; + default_exp_time = "50000"; // us + }; ports { #address-cells = <0x1>; #size-cells = <0x0>; -- 2.40.1 From 8faeddf611a4263f1b76cf20101006ef9f5e68a0 Mon Sep 17 00:00:00 2001 From: dchvs Date: Fri, 19 Mar 2021 18:23:49 -0600 Subject: [PATCH 2/4] Add mode1 table with resolution 1280x960 to Driver --- .../drivers/media/i2c/mt9m021_mode_tbls.h | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/kernel/nvidia-spiri/drivers/media/i2c/mt9m021_mode_tbls.h b/kernel/nvidia-spiri/drivers/media/i2c/mt9m021_mode_tbls.h index 6bd8277..88e2a97 100644 --- a/kernel/nvidia-spiri/drivers/media/i2c/mt9m021_mode_tbls.h +++ b/kernel/nvidia-spiri/drivers/media/i2c/mt9m021_mode_tbls.h @@ -102,8 +102,42 @@ static const mt9m021_reg mt9m021_mode_1280x720_60fps[] = { {MT9M021_TABLE_END, 0x00} }; +static const mt9m021_reg mt9m021_mode_1280x960_45fps[] = { + /* Rev2 Settings */ + {0x307A, 0x0000}, + {0x30EA, 0x0C00}, + {0x3044, 0x0404}, + {0x301E, 0x012C}, + {0x3180, 0x8000}, + {0x3014, 0x0000}, + + /* Analog Settings */ + {0x3ED6, 0x00FD}, + {0x3ED8, 0x0FFF}, + {0x3EDA, 0x0003}, + {0x3EDC, 0xF87A}, + {0x3EDE, 0xE075}, + {0x3EE0, 0x077C}, + {0x3EE2, 0xA4EB}, + {0x3EE4, 0xD208}, + + /* Size Settings */ + {0x3064, 0x1802}, /* EMBEDDED_DATA_CTRL */ + {0x3032, 0x0020}, /* DIGITAL_BINNING */ + {0x3002, 0x0004}, /* Y ADDR START */ + {0x3004, 0x0001}, /* X ADDR START */ + {0x3006, 0x03C3}, /* Y ADDR END */ + {0x3008, 0x0500}, /* X ADDR END */ + {0x300A, 0x03DE}, /* FRAME_LENGTH_LINES */ + {0x300C, 0x0672}, /* LINE_LENGTH_PCK */ + {0x30A2, 0x0001}, /* X_ODD_INC */ + {0x30A6, 0x0001}, /* Y_ODD_INC */ + {MT9M021_TABLE_END, 0x00} +}; + enum { MT9M021_MODE_1280x720_60FPS, + MT9M021_MODE_1280x960_45FPS, MT9M021_MODE_PLL_SETUP, @@ -113,6 +147,7 @@ enum { static const mt9m021_reg *mode_table[] = { [MT9M021_MODE_1280x720_60FPS] = mt9m021_mode_1280x720_60fps, + [MT9M021_MODE_1280x960_45FPS] = mt9m021_mode_1280x960_45fps, [MT9M021_MODE_PLL_SETUP] = mt9m021_pll_setup, @@ -120,17 +155,26 @@ static const mt9m021_reg *mode_table[] = { [MT9M021_MODE_STOP_STREAM] = mt9m021_stop, }; -static const int mt9m021_framerates[] = { +static const int mt9m021_framerates_1280x720[] = { 10, 20, 30, - 40, + 40, 50, 60, }; +static const int mt9m021_framerates_1280x960[] = { + 10, + 20, + 30, + 40, + 45, +}; + static const struct camera_common_frmfmt mt9m021_frmfmt[] = { - {{1280, 720}, mt9m021_framerates, 1, 0, MT9M021_MODE_1280x720_60FPS}, + {{1280, 720}, mt9m021_framerates_1280x720, 1, 0, MT9M021_MODE_1280x720_60FPS}, + {{1280, 960}, mt9m021_framerates_1280x960, 1, 0, MT9M021_MODE_1280x960_45FPS}, }; #endif /* __MT9M021_I2C_TABLES__ */ -- 2.40.1 From aff1e4672953d4531c97ce9f404d840d5fc009c3 Mon Sep 17 00:00:00 2001 From: dchvs Date: Fri, 19 Mar 2021 18:50:20 -0600 Subject: [PATCH 3/4] documentation: Add 1920x960 resolution support on README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e63c457..bd1a7da 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ The camera sensors should be conencted to a ConnectTech's Elroy board. * vertical/horizontal flip * flash control * LibArgus and nvarguscamerasrc -* Resolution supported: 1280x720 @ 60fps +* Resolutions supported: + * 1280x720 @ 60fps + * 1280x960 @ 45fps * Gain, exposure, and framerate controls * Camera synchronization -- 2.40.1 From a8d215aed834f4278b3235ed6361113f98a3cf5b Mon Sep 17 00:00:00 2001 From: dchvs Date: Fri, 19 Mar 2021 18:53:57 -0600 Subject: [PATCH 4/4] documentation: Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd1a7da..6f529a6 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The camera sensors should be conencted to a ConnectTech's Elroy board. ## Features -* V4L2 Kernel Driver Version 2.0 supported on L4T32.2.1 +* V4L2 Kernel Driver Version 2.0 supported on L4T32.4.4 * V4l2 controls * test pattern * individual gains -- 2.40.1