xref: /freebsd-src/sys/contrib/device-tree/Bindings/i2c/i2c-mux-reg.txt (revision 5956d97f4b3204318ceb6aa9c77bd0bc6ea87a41)
1c66ec88fSEmmanuel VadotRegister-based I2C Bus Mux
2c66ec88fSEmmanuel Vadot
3c66ec88fSEmmanuel VadotThis binding describes an I2C bus multiplexer that uses a single register
4c66ec88fSEmmanuel Vadotto route the I2C signals.
5c66ec88fSEmmanuel Vadot
6c66ec88fSEmmanuel VadotRequired properties:
7c66ec88fSEmmanuel Vadot- compatible: i2c-mux-reg
8c66ec88fSEmmanuel Vadot- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
9c66ec88fSEmmanuel Vadot  port is connected to.
10*5956d97fSEmmanuel Vadot* Standard I2C mux properties. See i2c-mux.yaml in this directory.
11*5956d97fSEmmanuel Vadot* I2C child bus nodes. See i2c-mux.yaml in this directory.
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel VadotOptional properties:
14c66ec88fSEmmanuel Vadot- reg: this pair of <offset size> specifies the register to control the mux.
15c66ec88fSEmmanuel Vadot  The <offset size> depends on its parent node. It can be any memory-mapped
16c66ec88fSEmmanuel Vadot  address. The size must be either 1, 2, or 4 bytes. If reg is omitted, the
17c66ec88fSEmmanuel Vadot  resource of this device will be used.
18c66ec88fSEmmanuel Vadot- little-endian: The existence indicates the register is in little endian.
19c66ec88fSEmmanuel Vadot- big-endian: The existence indicates the register is in big endian.
20c66ec88fSEmmanuel Vadot  If both little-endian and big-endian are omitted, the endianness of the
21c66ec88fSEmmanuel Vadot  CPU will be used.
22c66ec88fSEmmanuel Vadot- write-only: The existence indicates the register is write-only.
23c66ec88fSEmmanuel Vadot- idle-state: value to set the muxer to when idle. When no value is
24c66ec88fSEmmanuel Vadot  given, it defaults to the last value used.
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel VadotWhenever an access is made to a device on a child bus, the value set
27c66ec88fSEmmanuel Vadotin the relevant node's reg property will be output to the register.
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel VadotIf an idle state is defined, using the idle-state (optional) property,
30c66ec88fSEmmanuel Vadotwhenever an access is not being made to a device on a child bus, the
31c66ec88fSEmmanuel Vadotregister will be set according to the idle value.
32c66ec88fSEmmanuel Vadot
33c66ec88fSEmmanuel VadotIf an idle state is not defined, the most recently used value will be
34c66ec88fSEmmanuel Vadotleft programmed into the register.
35c66ec88fSEmmanuel Vadot
36c66ec88fSEmmanuel VadotExample of a mux on PCIe card, the host is a powerpc SoC (big endian):
37c66ec88fSEmmanuel Vadot
38c66ec88fSEmmanuel Vadot	i2c-mux {
39c66ec88fSEmmanuel Vadot		/* the <offset size> depends on the address translation
40c66ec88fSEmmanuel Vadot		 * of the parent device. If omitted, device resource
41c66ec88fSEmmanuel Vadot		 * will be used instead. The size is to determine
42c66ec88fSEmmanuel Vadot		 * whether iowrite32, iowrite16, or iowrite8 will be used.
43c66ec88fSEmmanuel Vadot		 */
44c66ec88fSEmmanuel Vadot		reg = <0x6028 0x4>;
45c66ec88fSEmmanuel Vadot		little-endian;		/* little endian register on PCIe */
46c66ec88fSEmmanuel Vadot		compatible = "i2c-mux-reg";
47c66ec88fSEmmanuel Vadot		#address-cells = <1>;
48c66ec88fSEmmanuel Vadot		#size-cells = <0>;
49c66ec88fSEmmanuel Vadot		i2c-parent = <&i2c1>;
50c66ec88fSEmmanuel Vadot		i2c@0 {
51c66ec88fSEmmanuel Vadot			reg = <0>;
52c66ec88fSEmmanuel Vadot			#address-cells = <1>;
53c66ec88fSEmmanuel Vadot			#size-cells = <0>;
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadot			si5338: clock-generator@70 {
56c66ec88fSEmmanuel Vadot				compatible = "silabs,si5338";
57c66ec88fSEmmanuel Vadot				reg = <0x70>;
58c66ec88fSEmmanuel Vadot				/* other stuff */
59c66ec88fSEmmanuel Vadot			};
60c66ec88fSEmmanuel Vadot		};
61c66ec88fSEmmanuel Vadot
62c66ec88fSEmmanuel Vadot		i2c@1 {
63c66ec88fSEmmanuel Vadot			/* data is written using iowrite32 */
64c66ec88fSEmmanuel Vadot			reg = <1>;
65c66ec88fSEmmanuel Vadot			#address-cells = <1>;
66c66ec88fSEmmanuel Vadot			#size-cells = <0>;
67c66ec88fSEmmanuel Vadot
68c66ec88fSEmmanuel Vadot			si5338: clock-generator@70 {
69c66ec88fSEmmanuel Vadot				compatible = "silabs,si5338";
70c66ec88fSEmmanuel Vadot				reg = <0x70>;
71c66ec88fSEmmanuel Vadot				/* other stuff */
72c66ec88fSEmmanuel Vadot			};
73c66ec88fSEmmanuel Vadot		};
74c66ec88fSEmmanuel Vadot	};
75