18c2ecf20Sopenharmony_ci======================================================================
28c2ecf20Sopenharmony_ciDevice tree bindings for the Aspeed Low Pin Count (LPC) Bus Controller
38c2ecf20Sopenharmony_ci======================================================================
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciThe LPC bus is a means to bridge a host CPU to a number of low-bandwidth
68c2ecf20Sopenharmony_ciperipheral devices, replacing the use of the ISA bus in the age of PCI[0]. The
78c2ecf20Sopenharmony_ciprimary use case of the Aspeed LPC controller is as a slave on the bus
88c2ecf20Sopenharmony_ci(typically in a Baseboard Management Controller SoC), but under certain
98c2ecf20Sopenharmony_ciconditions it can also take the role of bus master.
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciThe LPC controller is represented as a multi-function device to account for the
128c2ecf20Sopenharmony_cimix of functionality it provides. The principle split is between the register
138c2ecf20Sopenharmony_cilayout at the start of the I/O space which is, to quote the Aspeed datasheet,
148c2ecf20Sopenharmony_ci"basically compatible with the [LPC registers from the] popular BMC controller
158c2ecf20Sopenharmony_ciH8S/2168[1]", and everything else, where everything else is an eclectic
168c2ecf20Sopenharmony_cicollection of functions with a esoteric register layout. "Everything else",
178c2ecf20Sopenharmony_cihere labeled the "host" portion of the controller, includes, but is not limited
188c2ecf20Sopenharmony_cito:
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci* An IPMI Block Transfer[2] Controller
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci* An LPC Host Controller: Manages LPC functions such as host vs slave mode, the
238c2ecf20Sopenharmony_ci  physical properties of some LPC pins, configuration of serial IRQs, and
248c2ecf20Sopenharmony_ci  APB-to-LPC bridging amonst other functions.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci* An LPC Host Interface Controller: Manages functions exposed to the host such
278c2ecf20Sopenharmony_ci  as LPC firmware hub cycles, configuration of the LPC-to-AHB mapping, UART
288c2ecf20Sopenharmony_ci  management and bus snoop configuration.
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci* A set of SuperIO[3] scratch registers: Enables implementation of e.g. custom
318c2ecf20Sopenharmony_ci  hardware management protocols for handover between the host and baseboard
328c2ecf20Sopenharmony_ci  management controller.
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ciAdditionally the state of the LPC controller influences the pinmux
358c2ecf20Sopenharmony_ciconfiguration, therefore the host portion of the controller is exposed as a
368c2ecf20Sopenharmony_cisyscon as a means to arbitrate access.
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci[0] http://www.intel.com/design/chipsets/industry/25128901.pdf
398c2ecf20Sopenharmony_ci[1] https://www.renesas.com/en-sg/doc/products/mpumcu/001/rej09b0078_h8s2168.pdf?key=7c88837454702128622bee53acbda8f4
408c2ecf20Sopenharmony_ci[2] https://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/ipmi-second-gen-interface-spec-v2-rev1-1.pdf
418c2ecf20Sopenharmony_ci[3] https://en.wikipedia.org/wiki/Super_I/O
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciRequired properties
448c2ecf20Sopenharmony_ci===================
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci- compatible:	One of:
478c2ecf20Sopenharmony_ci		"aspeed,ast2400-lpc", "simple-mfd"
488c2ecf20Sopenharmony_ci		"aspeed,ast2500-lpc", "simple-mfd"
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci- reg:		contains the physical address and length values of the Aspeed
518c2ecf20Sopenharmony_ci                LPC memory region.
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci- #address-cells: <1>
548c2ecf20Sopenharmony_ci- #size-cells:	<1>
558c2ecf20Sopenharmony_ci- ranges: 	Maps 0 to the physical address and length of the LPC memory
568c2ecf20Sopenharmony_ci                region
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ciRequired LPC Child nodes
598c2ecf20Sopenharmony_ci========================
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciBMC Node
628c2ecf20Sopenharmony_ci--------
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci- compatible:	One of:
658c2ecf20Sopenharmony_ci		"aspeed,ast2400-lpc-bmc"
668c2ecf20Sopenharmony_ci		"aspeed,ast2500-lpc-bmc"
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci- reg:		contains the physical address and length values of the
698c2ecf20Sopenharmony_ci                H8S/2168-compatible LPC controller memory region
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ciHost Node
728c2ecf20Sopenharmony_ci---------
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci- compatible:   One of:
758c2ecf20Sopenharmony_ci		"aspeed,ast2400-lpc-host", "simple-mfd", "syscon"
768c2ecf20Sopenharmony_ci		"aspeed,ast2500-lpc-host", "simple-mfd", "syscon"
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci- reg:		contains the address and length values of the host-related
798c2ecf20Sopenharmony_ci                register space for the Aspeed LPC controller
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci- #address-cells: <1>
828c2ecf20Sopenharmony_ci- #size-cells:	<1>
838c2ecf20Sopenharmony_ci- ranges: 	Maps 0 to the address and length of the host-related LPC memory
848c2ecf20Sopenharmony_ci                region
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ciExample:
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_cilpc: lpc@1e789000 {
898c2ecf20Sopenharmony_ci	compatible = "aspeed,ast2500-lpc", "simple-mfd";
908c2ecf20Sopenharmony_ci	reg = <0x1e789000 0x1000>;
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci	#address-cells = <1>;
938c2ecf20Sopenharmony_ci	#size-cells = <1>;
948c2ecf20Sopenharmony_ci	ranges = <0x0 0x1e789000 0x1000>;
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci	lpc_bmc: lpc-bmc@0 {
978c2ecf20Sopenharmony_ci		compatible = "aspeed,ast2500-lpc-bmc";
988c2ecf20Sopenharmony_ci		reg = <0x0 0x80>;
998c2ecf20Sopenharmony_ci	};
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci	lpc_host: lpc-host@80 {
1028c2ecf20Sopenharmony_ci		compatible = "aspeed,ast2500-lpc-host", "simple-mfd", "syscon";
1038c2ecf20Sopenharmony_ci		reg = <0x80 0x1e0>;
1048c2ecf20Sopenharmony_ci		reg-io-width = <4>;
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci		#address-cells = <1>;
1078c2ecf20Sopenharmony_ci		#size-cells = <1>;
1088c2ecf20Sopenharmony_ci		ranges = <0x0 0x80 0x1e0>;
1098c2ecf20Sopenharmony_ci	};
1108c2ecf20Sopenharmony_ci};
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ciBMC Node Children
1138c2ecf20Sopenharmony_ci==================
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ciHost Node Children
1178c2ecf20Sopenharmony_ci==================
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ciLPC Host Interface Controller
1208c2ecf20Sopenharmony_ci-------------------
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ciThe LPC Host Interface Controller manages functions exposed to the host such as
1238c2ecf20Sopenharmony_ciLPC firmware hub cycles, configuration of the LPC-to-AHB mapping, UART
1248c2ecf20Sopenharmony_cimanagement and bus snoop configuration.
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ciRequired properties:
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci- compatible:	One of:
1298c2ecf20Sopenharmony_ci		"aspeed,ast2400-lpc-ctrl";
1308c2ecf20Sopenharmony_ci		"aspeed,ast2500-lpc-ctrl";
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci- reg:		contains offset/length values of the host interface controller
1338c2ecf20Sopenharmony_ci		memory regions
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci- clocks:	contains a phandle to the syscon node describing the clocks.
1368c2ecf20Sopenharmony_ci		There should then be one cell representing the clock to use
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ciOptional properties:
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci- memory-region: A phandle to a reserved_memory region to be used for the LPC
1418c2ecf20Sopenharmony_ci		to AHB mapping
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci- flash:	A phandle to the SPI flash controller containing the flash to
1448c2ecf20Sopenharmony_ci		be exposed over the LPC to AHB mapping
1458c2ecf20Sopenharmony_ci
1468c2ecf20Sopenharmony_ciExample:
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_cilpc-host@80 {
1498c2ecf20Sopenharmony_ci	lpc_ctrl: lpc-ctrl@0 {
1508c2ecf20Sopenharmony_ci		compatible = "aspeed,ast2500-lpc-ctrl";
1518c2ecf20Sopenharmony_ci		reg = <0x0 0x80>;
1528c2ecf20Sopenharmony_ci		clocks = <&syscon ASPEED_CLK_GATE_LCLK>;
1538c2ecf20Sopenharmony_ci		memory-region = <&flash_memory>;
1548c2ecf20Sopenharmony_ci		flash = <&spi>;
1558c2ecf20Sopenharmony_ci	};
1568c2ecf20Sopenharmony_ci};
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ciLPC Host Controller
1598c2ecf20Sopenharmony_ci-------------------
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ciThe Aspeed LPC Host Controller configures the Low Pin Count (LPC) bus behaviour
1628c2ecf20Sopenharmony_cibetween the host and the baseboard management controller. The registers exist
1638c2ecf20Sopenharmony_ciin the "host" portion of the Aspeed LPC controller, which must be the parent of
1648c2ecf20Sopenharmony_cithe LPC host controller node.
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ciRequired properties:
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci- compatible:	One of:
1698c2ecf20Sopenharmony_ci		"aspeed,ast2400-lhc";
1708c2ecf20Sopenharmony_ci		"aspeed,ast2500-lhc";
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci- reg:		contains offset/length values of the LHC memory regions. In the
1738c2ecf20Sopenharmony_ci		AST2400 and AST2500 there are two regions.
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ciExample:
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_cilhc: lhc@20 {
1788c2ecf20Sopenharmony_ci	compatible = "aspeed,ast2500-lhc";
1798c2ecf20Sopenharmony_ci	reg = <0x20 0x24 0x48 0x8>;
1808c2ecf20Sopenharmony_ci};
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ciLPC reset control
1838c2ecf20Sopenharmony_ci-----------------
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ciThe UARTs present in the ASPEED SoC can have their resets tied to the reset
1868c2ecf20Sopenharmony_cistate of the LPC bus. Some systems may chose to modify this configuration.
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ciRequired properties:
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci - compatible:		"aspeed,ast2500-lpc-reset" or
1918c2ecf20Sopenharmony_ci			"aspeed,ast2400-lpc-reset"
1928c2ecf20Sopenharmony_ci - reg:			offset and length of the IP in the LHC memory region
1938c2ecf20Sopenharmony_ci - #reset-controller	indicates the number of reset cells expected
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ciExample:
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_cilpc_reset: reset-controller@18 {
1988c2ecf20Sopenharmony_ci        compatible = "aspeed,ast2500-lpc-reset";
1998c2ecf20Sopenharmony_ci        reg = <0x18 0x4>;
2008c2ecf20Sopenharmony_ci        #reset-cells = <1>;
2018c2ecf20Sopenharmony_ci};
202