1*4882a593SmuzhiyunSamsung S5P/Exynos SoC Camera Subsystem (FIMC) 2*4882a593Smuzhiyun---------------------------------------------- 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunThe S5P/Exynos SoC Camera subsystem comprises of multiple sub-devices 5*4882a593Smuzhiyunrepresented by separate device tree nodes. Currently this includes: FIMC (in 6*4882a593Smuzhiyunthe S5P SoCs series known as CAMIF), MIPI CSIS, FIMC-LITE and FIMC-IS (ISP). 7*4882a593Smuzhiyun 8*4882a593SmuzhiyunThe sub-subdevices are defined as child nodes of the common 'camera' node which 9*4882a593Smuzhiyunalso includes common properties of the whole subsystem not really specific to 10*4882a593Smuzhiyunany single sub-device, like common camera port pins or the CAMCLK clock outputs 11*4882a593Smuzhiyunfor external image sensors attached to an SoC. 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunCommon 'camera' node 14*4882a593Smuzhiyun-------------------- 15*4882a593Smuzhiyun 16*4882a593SmuzhiyunRequired properties: 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun- compatible: must be "samsung,fimc", "simple-bus" 19*4882a593Smuzhiyun- clocks: list of clock specifiers, corresponding to entries in 20*4882a593Smuzhiyun the clock-names property; 21*4882a593Smuzhiyun- clock-names : must contain "sclk_cam0", "sclk_cam1", "pxl_async0", 22*4882a593Smuzhiyun "pxl_async1" entries, matching entries in the clocks property. 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun- #clock-cells: from the common clock bindings (../clock/clock-bindings.txt), 25*4882a593Smuzhiyun must be 1. A clock provider is associated with the 'camera' node and it should 26*4882a593Smuzhiyun be referenced by external sensors that use clocks provided by the SoC on 27*4882a593Smuzhiyun CAM_*_CLKOUT pins. The clock specifier cell stores an index of a clock. 28*4882a593Smuzhiyun The indices are 0, 1 for CAM_A_CLKOUT, CAM_B_CLKOUT clocks respectively. 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun- clock-output-names: from the common clock bindings, should contain names of 31*4882a593Smuzhiyun clocks registered by the camera subsystem corresponding to CAM_A_CLKOUT, 32*4882a593Smuzhiyun CAM_B_CLKOUT output clocks respectively. 33*4882a593Smuzhiyun 34*4882a593SmuzhiyunThe pinctrl bindings defined in ../pinctrl/pinctrl-bindings.txt must be used 35*4882a593Smuzhiyunto define a required pinctrl state named "default" and optional pinctrl states: 36*4882a593Smuzhiyun"idle", "active-a", active-b". These optional states can be used to switch the 37*4882a593Smuzhiyuncamera port pinmux at runtime. The "idle" state should configure both the camera 38*4882a593Smuzhiyunports A and B into high impedance state, especially the CAMCLK clock output 39*4882a593Smuzhiyunshould be inactive. For the "active-a" state the camera port A must be activated 40*4882a593Smuzhiyunand the port B deactivated and for the state "active-b" it should be the other 41*4882a593Smuzhiyunway around. 42*4882a593Smuzhiyun 43*4882a593SmuzhiyunThe 'camera' node must include at least one 'fimc' child node. 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun'fimc' device nodes 47*4882a593Smuzhiyun------------------- 48*4882a593Smuzhiyun 49*4882a593SmuzhiyunRequired properties: 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun- compatible: "samsung,s5pv210-fimc" for S5PV210, "samsung,exynos4210-fimc" 52*4882a593Smuzhiyun for Exynos4210 and "samsung,exynos4212-fimc" for Exynos4x12 SoCs; 53*4882a593Smuzhiyun- reg: physical base address and length of the registers set for the device; 54*4882a593Smuzhiyun- interrupts: should contain FIMC interrupt; 55*4882a593Smuzhiyun- clocks: list of clock specifiers, must contain an entry for each required 56*4882a593Smuzhiyun entry in clock-names; 57*4882a593Smuzhiyun- clock-names: must contain "fimc", "sclk_fimc" entries. 58*4882a593Smuzhiyun- samsung,pix-limits: an array of maximum supported image sizes in pixels, for 59*4882a593Smuzhiyun details refer to Table 2-1 in the S5PV210 SoC User Manual; The meaning of 60*4882a593Smuzhiyun each cell is as follows: 61*4882a593Smuzhiyun 0 - scaler input horizontal size, 62*4882a593Smuzhiyun 1 - input horizontal size for the scaler bypassed, 63*4882a593Smuzhiyun 2 - REAL_WIDTH without input rotation, 64*4882a593Smuzhiyun 3 - REAL_HEIGHT with input rotation, 65*4882a593Smuzhiyun- samsung,sysreg: a phandle to the SYSREG node. 66*4882a593Smuzhiyun 67*4882a593SmuzhiyunEach FIMC device should have an alias in the aliases node, in the form of 68*4882a593Smuzhiyunfimc<n>, where <n> is an integer specifying the IP block instance. 69*4882a593Smuzhiyun 70*4882a593SmuzhiyunOptional properties: 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun- clock-frequency: maximum FIMC local clock (LCLK) frequency; 73*4882a593Smuzhiyun- samsung,min-pix-sizes: an array specyfing minimum image size in pixels at 74*4882a593Smuzhiyun the FIMC input and output DMA, in the first and second cell respectively. 75*4882a593Smuzhiyun Default value when this property is not present is <16 16>; 76*4882a593Smuzhiyun- samsung,min-pix-alignment: minimum supported image height alignment (first 77*4882a593Smuzhiyun cell) and the horizontal image offset (second cell). The values are in pixels 78*4882a593Smuzhiyun and default to <2 1> when this property is not present; 79*4882a593Smuzhiyun- samsung,mainscaler-ext: a boolean property indicating whether the FIMC IP 80*4882a593Smuzhiyun supports extended image size and has CIEXTEN register; 81*4882a593Smuzhiyun- samsung,rotators: a bitmask specifying whether this IP has the input and 82*4882a593Smuzhiyun the output rotator. Bits 4 and 0 correspond to input and output rotator 83*4882a593Smuzhiyun respectively. If a rotator is present its corresponding bit should be set. 84*4882a593Smuzhiyun Default value when this property is not specified is 0x11. 85*4882a593Smuzhiyun- samsung,cam-if: a bolean property indicating whether the IP block includes 86*4882a593Smuzhiyun the camera input interface. 87*4882a593Smuzhiyun- samsung,isp-wb: this property must be present if the IP block has the ISP 88*4882a593Smuzhiyun writeback input. 89*4882a593Smuzhiyun- samsung,lcd-wb: this property must be present if the IP block has the LCD 90*4882a593Smuzhiyun writeback input. 91*4882a593Smuzhiyun 92*4882a593Smuzhiyun 93*4882a593Smuzhiyun'parallel-ports' node 94*4882a593Smuzhiyun--------------------- 95*4882a593Smuzhiyun 96*4882a593SmuzhiyunThis node should contain child 'port' nodes specifying active parallel video 97*4882a593Smuzhiyuninput ports. It includes camera A and camera B inputs. 'reg' property in the 98*4882a593Smuzhiyunport nodes specifies data input - 1, 2 indicates input A, B respectively. 99*4882a593Smuzhiyun 100*4882a593SmuzhiyunOptional properties 101*4882a593Smuzhiyun 102*4882a593Smuzhiyun- samsung,camclk-out (deprecated) : specifies clock output for remote sensor, 103*4882a593Smuzhiyun 0 - CAM_A_CLKOUT, 1 - CAM_B_CLKOUT; 104*4882a593Smuzhiyun 105*4882a593SmuzhiyunImage sensor nodes 106*4882a593Smuzhiyun------------------ 107*4882a593Smuzhiyun 108*4882a593SmuzhiyunThe sensor device nodes should be added to their control bus controller (e.g. 109*4882a593SmuzhiyunI2C0) nodes and linked to a port node in the csis or the parallel-ports node, 110*4882a593Smuzhiyunusing the common video interfaces bindings, defined in video-interfaces.txt. 111*4882a593Smuzhiyun 112*4882a593SmuzhiyunExample: 113*4882a593Smuzhiyun 114*4882a593Smuzhiyun aliases { 115*4882a593Smuzhiyun fimc0 = &fimc_0; 116*4882a593Smuzhiyun }; 117*4882a593Smuzhiyun 118*4882a593Smuzhiyun /* Parallel bus IF sensor */ 119*4882a593Smuzhiyun i2c_0: i2c@13860000 { 120*4882a593Smuzhiyun s5k6aa: sensor@3c { 121*4882a593Smuzhiyun compatible = "samsung,s5k6aafx"; 122*4882a593Smuzhiyun reg = <0x3c>; 123*4882a593Smuzhiyun vddio-supply = <...>; 124*4882a593Smuzhiyun 125*4882a593Smuzhiyun clock-frequency = <24000000>; 126*4882a593Smuzhiyun clocks = <&camera 1>; 127*4882a593Smuzhiyun clock-names = "mclk"; 128*4882a593Smuzhiyun 129*4882a593Smuzhiyun port { 130*4882a593Smuzhiyun s5k6aa_ep: endpoint { 131*4882a593Smuzhiyun remote-endpoint = <&fimc0_ep>; 132*4882a593Smuzhiyun bus-width = <8>; 133*4882a593Smuzhiyun hsync-active = <0>; 134*4882a593Smuzhiyun vsync-active = <1>; 135*4882a593Smuzhiyun pclk-sample = <1>; 136*4882a593Smuzhiyun }; 137*4882a593Smuzhiyun }; 138*4882a593Smuzhiyun }; 139*4882a593Smuzhiyun 140*4882a593Smuzhiyun /* MIPI CSI-2 bus IF sensor */ 141*4882a593Smuzhiyun s5c73m3: sensor@1a { 142*4882a593Smuzhiyun compatible = "samsung,s5c73m3"; 143*4882a593Smuzhiyun reg = <0x1a>; 144*4882a593Smuzhiyun vddio-supply = <...>; 145*4882a593Smuzhiyun 146*4882a593Smuzhiyun clock-frequency = <24000000>; 147*4882a593Smuzhiyun clocks = <&camera 0>; 148*4882a593Smuzhiyun clock-names = "mclk"; 149*4882a593Smuzhiyun 150*4882a593Smuzhiyun port { 151*4882a593Smuzhiyun s5c73m3_1: endpoint { 152*4882a593Smuzhiyun data-lanes = <1 2 3 4>; 153*4882a593Smuzhiyun remote-endpoint = <&csis0_ep>; 154*4882a593Smuzhiyun }; 155*4882a593Smuzhiyun }; 156*4882a593Smuzhiyun }; 157*4882a593Smuzhiyun }; 158*4882a593Smuzhiyun 159*4882a593Smuzhiyun camera { 160*4882a593Smuzhiyun compatible = "samsung,fimc", "simple-bus"; 161*4882a593Smuzhiyun clocks = <&clock 132>, <&clock 133>, <&clock 351>, 162*4882a593Smuzhiyun <&clock 352>; 163*4882a593Smuzhiyun clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", 164*4882a593Smuzhiyun "pxl_async1"; 165*4882a593Smuzhiyun #clock-cells = <1>; 166*4882a593Smuzhiyun clock-output-names = "cam_a_clkout", "cam_b_clkout"; 167*4882a593Smuzhiyun pinctrl-names = "default"; 168*4882a593Smuzhiyun pinctrl-0 = <&cam_port_a_clk_active>; 169*4882a593Smuzhiyun #address-cells = <1>; 170*4882a593Smuzhiyun #size-cells = <1>; 171*4882a593Smuzhiyun 172*4882a593Smuzhiyun /* parallel camera ports */ 173*4882a593Smuzhiyun parallel-ports { 174*4882a593Smuzhiyun /* camera A input */ 175*4882a593Smuzhiyun port@1 { 176*4882a593Smuzhiyun reg = <1>; 177*4882a593Smuzhiyun fimc0_ep: endpoint { 178*4882a593Smuzhiyun remote-endpoint = <&s5k6aa_ep>; 179*4882a593Smuzhiyun bus-width = <8>; 180*4882a593Smuzhiyun hsync-active = <0>; 181*4882a593Smuzhiyun vsync-active = <1>; 182*4882a593Smuzhiyun pclk-sample = <1>; 183*4882a593Smuzhiyun }; 184*4882a593Smuzhiyun }; 185*4882a593Smuzhiyun }; 186*4882a593Smuzhiyun 187*4882a593Smuzhiyun fimc_0: fimc@11800000 { 188*4882a593Smuzhiyun compatible = "samsung,exynos4210-fimc"; 189*4882a593Smuzhiyun reg = <0x11800000 0x1000>; 190*4882a593Smuzhiyun interrupts = <0 85 0>; 191*4882a593Smuzhiyun }; 192*4882a593Smuzhiyun 193*4882a593Smuzhiyun csis_0: csis@11880000 { 194*4882a593Smuzhiyun compatible = "samsung,exynos4210-csis"; 195*4882a593Smuzhiyun reg = <0x11880000 0x1000>; 196*4882a593Smuzhiyun interrupts = <0 78 0>; 197*4882a593Smuzhiyun /* camera C input */ 198*4882a593Smuzhiyun port@3 { 199*4882a593Smuzhiyun reg = <3>; 200*4882a593Smuzhiyun csis0_ep: endpoint { 201*4882a593Smuzhiyun remote-endpoint = <&s5c73m3_ep>; 202*4882a593Smuzhiyun data-lanes = <1 2 3 4>; 203*4882a593Smuzhiyun samsung,csis-hs-settle = <12>; 204*4882a593Smuzhiyun }; 205*4882a593Smuzhiyun }; 206*4882a593Smuzhiyun }; 207*4882a593Smuzhiyun }; 208*4882a593Smuzhiyun 209*4882a593SmuzhiyunThe MIPI-CSIS device binding is defined in samsung-mipi-csis.txt. 210