xref: /freebsd/sys/contrib/device-tree/Bindings/spi/spi-samsung.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Samsung SPI Controller
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotThe Samsung SPI controller is used to interface with various devices such as flash
4*c66ec88fSEmmanuel Vadotand display controllers using the SPI communication interface.
5*c66ec88fSEmmanuel Vadot
6*c66ec88fSEmmanuel VadotRequired SoC Specific Properties:
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel Vadot- compatible: should be one of the following.
9*c66ec88fSEmmanuel Vadot    - samsung,s3c2443-spi: for s3c2443, s3c2416 and s3c2450 platforms
10*c66ec88fSEmmanuel Vadot    - samsung,s3c6410-spi: for s3c6410 platforms
11*c66ec88fSEmmanuel Vadot    - samsung,s5pv210-spi: for s5pv210 and s5pc110 platforms
12*c66ec88fSEmmanuel Vadot    - samsung,exynos5433-spi: for exynos5433 compatible controllers
13*c66ec88fSEmmanuel Vadot    - samsung,exynos7-spi: for exynos7 platforms <DEPRECATED>
14*c66ec88fSEmmanuel Vadot
15*c66ec88fSEmmanuel Vadot- reg: physical base address of the controller and length of memory mapped
16*c66ec88fSEmmanuel Vadot  region.
17*c66ec88fSEmmanuel Vadot
18*c66ec88fSEmmanuel Vadot- interrupts: The interrupt number to the cpu. The interrupt specifier format
19*c66ec88fSEmmanuel Vadot  depends on the interrupt controller.
20*c66ec88fSEmmanuel Vadot
21*c66ec88fSEmmanuel Vadot- dmas : Two or more DMA channel specifiers following the convention outlined
22*c66ec88fSEmmanuel Vadot  in bindings/dma/dma.txt
23*c66ec88fSEmmanuel Vadot
24*c66ec88fSEmmanuel Vadot- dma-names: Names for the dma channels. There must be at least one channel
25*c66ec88fSEmmanuel Vadot  named "tx" for transmit and named "rx" for receive.
26*c66ec88fSEmmanuel Vadot
27*c66ec88fSEmmanuel Vadot- clocks: specifies the clock IDs provided to the SPI controller; they are
28*c66ec88fSEmmanuel Vadot  required for interacting with the controller itself, for synchronizing the bus
29*c66ec88fSEmmanuel Vadot  and as I/O clock (the latter is required by exynos5433 and exynos7).
30*c66ec88fSEmmanuel Vadot
31*c66ec88fSEmmanuel Vadot- clock-names: string names of the clocks in the 'clocks' property; for all the
32*c66ec88fSEmmanuel Vadot  the devices the names must be "spi", "spi_busclkN" (where N is determined by
33*c66ec88fSEmmanuel Vadot  "samsung,spi-src-clk"), while Exynos5433 should specify a third clock
34*c66ec88fSEmmanuel Vadot  "spi_ioclk" for the I/O clock.
35*c66ec88fSEmmanuel Vadot
36*c66ec88fSEmmanuel VadotRequired Board Specific Properties:
37*c66ec88fSEmmanuel Vadot
38*c66ec88fSEmmanuel Vadot- #address-cells: should be 1.
39*c66ec88fSEmmanuel Vadot- #size-cells: should be 0.
40*c66ec88fSEmmanuel Vadot
41*c66ec88fSEmmanuel VadotOptional Board Specific Properties:
42*c66ec88fSEmmanuel Vadot
43*c66ec88fSEmmanuel Vadot- samsung,spi-src-clk: If the spi controller includes a internal clock mux to
44*c66ec88fSEmmanuel Vadot  select the clock source for the spi bus clock, this property can be used to
45*c66ec88fSEmmanuel Vadot  indicate the clock to be used for driving the spi bus clock. If not specified,
46*c66ec88fSEmmanuel Vadot  the clock number 0 is used as default.
47*c66ec88fSEmmanuel Vadot
48*c66ec88fSEmmanuel Vadot- num-cs: Specifies the number of chip select lines supported. If
49*c66ec88fSEmmanuel Vadot  not specified, the default number of chip select lines is set to 1.
50*c66ec88fSEmmanuel Vadot
51*c66ec88fSEmmanuel Vadot- cs-gpios: should specify GPIOs used for chipselects (see spi-bus.txt)
52*c66ec88fSEmmanuel Vadot
53*c66ec88fSEmmanuel Vadot- no-cs-readback: the CS line is disconnected, therefore the device should not
54*c66ec88fSEmmanuel Vadot  operate based on CS signalling.
55*c66ec88fSEmmanuel Vadot
56*c66ec88fSEmmanuel VadotSPI Controller specific data in SPI slave nodes:
57*c66ec88fSEmmanuel Vadot
58*c66ec88fSEmmanuel Vadot- The spi slave nodes should provide the following information which is required
59*c66ec88fSEmmanuel Vadot  by the spi controller.
60*c66ec88fSEmmanuel Vadot
61*c66ec88fSEmmanuel Vadot  - samsung,spi-feedback-delay: The sampling phase shift to be applied on the
62*c66ec88fSEmmanuel Vadot    miso line (to account for any lag in the miso line). The following are the
63*c66ec88fSEmmanuel Vadot    valid values.
64*c66ec88fSEmmanuel Vadot
65*c66ec88fSEmmanuel Vadot      - 0: No phase shift.
66*c66ec88fSEmmanuel Vadot      - 1: 90 degree phase shift sampling.
67*c66ec88fSEmmanuel Vadot      - 2: 180 degree phase shift sampling.
68*c66ec88fSEmmanuel Vadot      - 3: 270 degree phase shift sampling.
69*c66ec88fSEmmanuel Vadot
70*c66ec88fSEmmanuel VadotAliases:
71*c66ec88fSEmmanuel Vadot
72*c66ec88fSEmmanuel Vadot- All the SPI controller nodes should be represented in the aliases node using
73*c66ec88fSEmmanuel Vadot  the following format 'spi{n}' where n is a unique number for the alias.
74*c66ec88fSEmmanuel Vadot
75*c66ec88fSEmmanuel Vadot
76*c66ec88fSEmmanuel VadotExample:
77*c66ec88fSEmmanuel Vadot
78*c66ec88fSEmmanuel Vadot- SoC Specific Portion:
79*c66ec88fSEmmanuel Vadot
80*c66ec88fSEmmanuel Vadot	spi_0: spi@12d20000 {
81*c66ec88fSEmmanuel Vadot		compatible = "samsung,exynos4210-spi";
82*c66ec88fSEmmanuel Vadot		reg = <0x12d20000 0x100>;
83*c66ec88fSEmmanuel Vadot		interrupts = <0 66 0>;
84*c66ec88fSEmmanuel Vadot		dmas = <&pdma0 5
85*c66ec88fSEmmanuel Vadot			&pdma0 4>;
86*c66ec88fSEmmanuel Vadot		dma-names = "tx", "rx";
87*c66ec88fSEmmanuel Vadot		#address-cells = <1>;
88*c66ec88fSEmmanuel Vadot		#size-cells = <0>;
89*c66ec88fSEmmanuel Vadot	};
90*c66ec88fSEmmanuel Vadot
91*c66ec88fSEmmanuel Vadot- Board Specific Portion:
92*c66ec88fSEmmanuel Vadot
93*c66ec88fSEmmanuel Vadot	spi_0: spi@12d20000 {
94*c66ec88fSEmmanuel Vadot		#address-cells = <1>;
95*c66ec88fSEmmanuel Vadot		#size-cells = <0>;
96*c66ec88fSEmmanuel Vadot		pinctrl-names = "default";
97*c66ec88fSEmmanuel Vadot		pinctrl-0 = <&spi0_bus>;
98*c66ec88fSEmmanuel Vadot		cs-gpios = <&gpa2 5 0>;
99*c66ec88fSEmmanuel Vadot
100*c66ec88fSEmmanuel Vadot		w25q80bw@0 {
101*c66ec88fSEmmanuel Vadot			#address-cells = <1>;
102*c66ec88fSEmmanuel Vadot			#size-cells = <1>;
103*c66ec88fSEmmanuel Vadot			compatible = "w25x80";
104*c66ec88fSEmmanuel Vadot			reg = <0>;
105*c66ec88fSEmmanuel Vadot			spi-max-frequency = <10000>;
106*c66ec88fSEmmanuel Vadot
107*c66ec88fSEmmanuel Vadot			controller-data {
108*c66ec88fSEmmanuel Vadot				samsung,spi-feedback-delay = <0>;
109*c66ec88fSEmmanuel Vadot			};
110*c66ec88fSEmmanuel Vadot
111*c66ec88fSEmmanuel Vadot			partition@0 {
112*c66ec88fSEmmanuel Vadot				label = "U-Boot";
113*c66ec88fSEmmanuel Vadot				reg = <0x0 0x40000>;
114*c66ec88fSEmmanuel Vadot				read-only;
115*c66ec88fSEmmanuel Vadot			};
116*c66ec88fSEmmanuel Vadot
117*c66ec88fSEmmanuel Vadot			partition@40000 {
118*c66ec88fSEmmanuel Vadot				label = "Kernel";
119*c66ec88fSEmmanuel Vadot				reg = <0x40000 0xc0000>;
120*c66ec88fSEmmanuel Vadot			};
121*c66ec88fSEmmanuel Vadot		};
122*c66ec88fSEmmanuel Vadot	};
123