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