/*
* Copyright (c) 2022,Sony Electronics, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include
#include
#include "/home/mr/Ayyan/source/Linux_for_Tegra/source/public/hardware/nvidia/soc/t210/kernel-include/dt-bindings/clock/tegra194-clock.h"
#include
#define CAM0_RST_L TEGRA_GPIO(H, 6)
#define CAMERA_I2C_MUX_BUS(x) (0x1E + x)
/ {
host1x {
status = "okay";
// vi@15c10000 {
vi_base: vi {
status = "okay";
// compatible = "nvidia,tegra194-vi";
num-channels = <1>;
ports {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
vi_port0: port@0 {
status = "okay";
reg = <0>;
ev9500m_vi_in0: endpoint {
status = "okay";
port-index = <0>; /* CSI-A */
bus-width = <4>; /* Use CSI-A */
remote-endpoint = <&ev9500m_csi_out0>;
};
};
};
};
// nvcsi@15a00000 {
csi_base: nvcsi {
status = "okay";
// compatible = "nvidia,tegra194-nvcsi";
num-channels = <1>;
// num-ports = <2>;
#address-cells = <1>;
#size-cells = <0>;
csi_chan0: channel@0 {
status = "okay";
reg = <0>;
ports {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
csi_chan0_port0: port@0 {
status = "okay";
reg = <0>;
ev9500m_csi_in0: endpoint@0 {
status = "okay";
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ev9500m_out0>;
};
};
csi_chan0_port1: port@1 {
status = "okay";
reg = <1>;
ev9500m_csi_out0: endpoint@1 {
status = "okay";
remote-endpoint = <&ev9500m_vi_in0>;
};
};
};
};
};
};
// gpio@2200000 { // Changed to below according to t210
gpio@6000d000 {
status = "okay";
camera-control-output-low {
status = "okay";
gpio-hog;
output-low;
gpios = ;
label = "cam0-rst";
};
};
//i2c@546c0000 {
host1x {
i2c@546c0000 { /* TODO -- address Done by analysing the code of imx219 and found mostly used for camera also */
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
ev9500m_cam0: ev9500m_a@10 {
status = "okay";
compatible = "ev9500m";
/* I2C device address */
reg = <0x10>;
/* V4L2 device node location */
devnode = "video0";
/* Physical dimensions of sensor */
physical_w = "3.674";
physical_h = "2.738";
sensor_model = "ev9500m";
/* Define any required hw resources needed by driver */
/* ie. clocks, io pins, power sources */
/* mclk-index indicates the index of the */
/* mclk-name with in the clock-names array */
avdd-reg = "vana";
iovdd-reg = "vif";
dvdd-reg = "vdig";
//vana-supply = <&p3509_avdd_cam_2v8>;
// vif-supply = <&p3509_vdd_1v8_cvb>;
//vana-supply = <&p3509_vdd_3v3_cvb>;
//vdig-supply = <&p3509_vdd_sys_en>;
/*clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>,
<&bpmp_clks TEGRA194_CLK_EXTPERIPH1>;
clock-names = "extperiph1", "pllp_grtba";
mclk = "extperiph1";*/
reset-gpios = <&gpio CAM0_RST_L GPIO_ACTIVE_LOW>;
camera_mipi_lanes = <0x4>;
mode0{ //1920x1080_60Fps
mclk_khz = "24000";
set_mode_delay_ms = "5000";
num_lanes = "4";
tegra_sinterface = "serial_a";
vc_id = "0";
phy_mode = "DPHY";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
active_w = "1920";
active_h = "1080";
//mode_type = "rgb";
//pixel_phase = "rgb888";
//csi_pixel_bit_depth = "24";
mode_type = "yuv";
pixel_phase = "uyvy";
csi_pixel_bit_depth = "16";
readout_orientation = "0";
line_length = "2000";//"1920";
inherent_gain = "1";
mclk_multiplier = "18";//"24";//"6.67";
pix_clk_hz = "576000000";//"160000000";
gain_factor = "16";
framerate_factor = "1000000";
exposure_factor = "1000000";
min_gain_val = "16"; /* 1.00x */
max_gain_val = "170"; /* 10.66x */
step_gain_val = "1";
default_gain = "16"; /* 1.00x */
min_hdr_ratio = "1";
max_hdr_ratio = "1";
min_framerate = "2000000"; /* 2.0 fps */
max_framerate = "60000000"; /* 60.0 fps */
step_framerate = "1";
default_framerate = "60000000"; /* 60.0 fps */
min_exp_time = "13"; /* us */
max_exp_time = "683709"; /* us */
step_exp_time = "1";
default_exp_time = "16667"; /* us */
};
ports {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
port@0 {
status = "okay";
reg = <0>;
ev9500m_out0: endpoint {
status = "okay";
port-index = <0>;
bus-width = <4>;
remote-endpoint = <&ev9500m_csi_in0>;
};
};
};
};
};
};
};
/ {
tcp: tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
/**
* Physical settings to calculate max ISO BW
*
* num_csi_lanes = <>;
* Total number of CSI lanes when all cameras are active
*
* max_lane_speed = <>;
* Max lane speed in Kbit/s
*
* min_bits_per_pixel = <>;
* Min bits per pixel
*
* vi_peak_byte_per_pixel = <>;
* Max byte per pixel for the VI ISO case
*
* vi_bw_margin_pct = <>;
* Vi bandwidth margin in percentage
*
* max_pixel_rate = <>;
* Max pixel rate in Kpixel/s for the ISP ISO case
*
* isp_peak_byte_per_pixel = <>;
* Max byte per pixel for the ISP ISO case
*
* isp_bw_margin_pct = <>;
* Isp bandwidth margin in percentage
*/
status = "okay";
num_csi_lanes = <4>;
max_lane_speed = <1500000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
max_pixel_rate = <750000>;
//max_pixel_rate = <160000>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
/**
* The general guideline for naming badge_info contains 3 parts, and is as follows,
* The first part is the camera_board_id for the module; if the module is in a FFD
* platform, then use the platform name for this part.
* The second part contains the position of the module, ex. "rear" or "front".
* The third part contains the last 6 characters of a part number which is found
* in the module's specsheet from the vendor.
*/
modules {
status = "okay";
cam_module0: module0 {
status = "okay";
badge = "ev9500m_front";
position = "front";
orientation = "1";
cam_module0_drivernode0: drivernode0 {
status = "okay";
/* Declare PCL support driver (classically known as guid) */
pcl_id = "v4l2_sensor";
/* Driver v4l2 device name */
devname = "ev9500m 2-0010";
/* Declare the device-tree hierarchy to driver instance */
proc-device-tree = "/proc/device-tree/i2c@546c0000/ev9500m_a@10"; /* TODO:Changed accordingly */
};
};
};
};
};