Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0a2cea5 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'imx-drivers-4.20-2' of...

Merge tag 'imx-drivers-4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/drivers

i.MX drivers change for 4.20, round 2:
 - A series from Aisheng Dong to add SCU firmware driver for i.MX8
   SoCs.  It implements IPC mechanism based on mailbox for message
   exchange between AP and SCU firmware, and a set of SCU IPC
   service APIs used by clients like i.MX8 power domain and clock
   drivers.

* tag 'imx-drivers-4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux

:
  MAINTAINERS: imx: include drivers/firmware/imx path
  firmware: imx: add misc svc support
  firmware: imx: add SCU firmware driver support
  dt-bindings: arm: fsl: add scu binding doc

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 75bda360 b912de51
Loading
Loading
Loading
Loading
+183 −0
Original line number Diff line number Diff line
NXP i.MX System Controller Firmware (SCFW)
--------------------------------------------------------------------

The System Controller Firmware (SCFW) is a low-level system function
which runs on a dedicated Cortex-M core to provide power, clock, and
resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
(QM, QP), and i.MX8QX (QXP, DX).

The AP communicates with the SC using a multi-ported MU module found
in the LSIO subsystem. The current definition of this MU module provides
5 remote AP connections to the SC to support up to 5 execution environments
(TZ, HV, standard Linux, etc.). The SC side of this MU module interfaces
with the LSIO DSC IP bus. The SC firmware will communicate with this MU
using the MSI bus.

System Controller Device Node:
============================================================

The scu node with the following properties shall be under the /firmware/ node.

Required properties:
-------------------
- compatible:	should be "fsl,imx-scu".
- mbox-names:	should include "tx0", "tx1", "tx2", "tx3",
			       "rx0", "rx1", "rx2", "rx3".
- mboxes:	List of phandle of 4 MU channels for tx and 4 MU channels
		for rx. All 8 MU channels must be in the same MU instance.
		Cross instances are not allowed. The MU instance can only
		be one of LSIO MU0~M4 for imx8qxp and imx8qm. Users need
		to make sure use the one which is not conflict with other
		execution environments. e.g. ATF.
		Note:
		Channel 0 must be "tx0" or "rx0".
		Channel 1 must be "tx1" or "rx1".
		Channel 2 must be "tx2" or "rx2".
		Channel 3 must be "tx3" or "rx3".
		e.g.
		mboxes = <&lsio_mu1 0 0
			  &lsio_mu1 0 1
			  &lsio_mu1 0 2
			  &lsio_mu1 0 3
			  &lsio_mu1 1 0
			  &lsio_mu1 1 1
			  &lsio_mu1 1 2
			  &lsio_mu1 1 3>;
		See Documentation/devicetree/bindings/mailbox/fsl,mu.txt
		for detailed mailbox binding.

i.MX SCU Client Device Node:
============================================================

Client nodes are maintained as children of the relevant IMX-SCU device node.

Power domain bindings based on SCU Message Protocol
------------------------------------------------------------

This binding for the SCU power domain providers uses the generic power
domain binding[2].

Required properties:
- compatible:		Should be "fsl,scu-pd".
- #address-cells:	Should be 1.
- #size-cells:		Should be 0.

Required properties for power domain sub nodes:
- #power-domain-cells:	Must be 0.

Optional Properties:
- reg:			Resource ID of this power domain.
			No exist means uncontrollable by user.
			See detailed Resource ID list from:
			include/dt-bindings/power/imx-rsrc.h
- power-domains:	phandle pointing to the parent power domain.

Clock bindings based on SCU Message Protocol
------------------------------------------------------------

This binding uses the common clock binding[1].

Required properties:
- compatible:		Should be "fsl,imx8qxp-clock".
- #clock-cells:		Should be 1. Contains the Clock ID value.
- clocks:		List of clock specifiers, must contain an entry for
			each required entry in clock-names
- clock-names:		Should include entries "xtal_32KHz", "xtal_24MHz"

The clock consumer should specify the desired clock by having the clock
ID in its "clocks" phandle cell.

See the full list of clock IDs from:
include/dt-bindings/clock/imx8qxp-clock.h

Pinctrl bindings based on SCU Message Protocol
------------------------------------------------------------

This binding uses the i.MX common pinctrl binding[3].

Required properties:
- compatible:		Should be "fsl,imx8qxp-iomuxc".

Required properties for Pinctrl sub nodes:
- fsl,pins:		Each entry consists of 3 integers which represents
			the mux and config setting for one pin. The first 2
			integers <pin_id mux_mode> are specified using a
			PIN_FUNC_ID macro, which can be found in
			<dt-bindings/pinctrl/pads-imx8qxp.h>.
			The last integer CONFIG is the pad setting value like
			pull-up on this pin.

			Please refer to i.MX8QXP Reference Manual for detailed
			CONFIG settings.

[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
[2] Documentation/devicetree/bindings/power/power_domain.txt
[3] Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt

Example (imx8qxp):
-------------
lsio_mu1: mailbox@5d1c0000 {
	...
	#mbox-cells = <2>;
};

firmware {
	scu {
		compatible = "fsl,imx-scu";
		mbox-names = "tx0", "tx1", "tx2", "tx3",
			     "rx0", "rx1", "rx2", "rx3";
		mboxes = <&lsio_mu1 0 0
			  &lsio_mu1 0 1
			  &lsio_mu1 0 2
			  &lsio_mu1 0 3
			  &lsio_mu1 1 0
			  &lsio_mu1 1 1
			  &lsio_mu1 1 2
			  &lsio_mu1 1 3>;

		clk: clk {
			compatible = "fsl,imx8qxp-clk";
			#clock-cells = <1>;
		};

		iomuxc {
			compatible = "fsl,imx8qxp-iomuxc";

			pinctrl_lpuart0: lpuart0grp {
				fsl,pins = <
					SC_P_UART0_RX_ADMA_UART0_RX	0x06000020
					SC_P_UART0_TX_ADMA_UART0_TX	0x06000020
				>;
			};
			...
		};

		imx8qx-pm {
			compatible = "fsl,scu-pd";
			#address-cells = <1>;
			#size-cells = <0>;

			pd_dma: dma-power-domain {
				#power-domain-cells = <0>;

				pd_dma_lpuart0: dma-lpuart0@57 {
					reg = <SC_R_UART_0>;
					#power-domain-cells = <0>;
					power-domains = <&pd_dma>;
				};
				...
			};
			...
		};
	};
};

serial@5a060000 {
	...
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_lpuart0>;
	clocks = <&clk IMX8QXP_UART0_CLK>,
		 <&clk IMX8QXP_UART0_IPG_CLK>;
	clock-names = "per", "ipg";
	power-domains = <&pd_dma_lpuart0>;
};
+2 −0
Original line number Diff line number Diff line
@@ -1462,7 +1462,9 @@ F: arch/arm/mach-mxs/
F:	arch/arm/boot/dts/imx*
F:	arch/arm/configs/imx*_defconfig
F:	drivers/clk/imx/
F:	drivers/firmware/imx/
F:	drivers/soc/imx/
F:	include/linux/firmware/imx/
F:	include/soc/imx/

ARM/FREESCALE VYBRID ARM ARCHITECTURE
+1 −0
Original line number Diff line number Diff line
@@ -289,6 +289,7 @@ config HAVE_ARM_SMCCC
source "drivers/firmware/broadcom/Kconfig"
source "drivers/firmware/google/Kconfig"
source "drivers/firmware/efi/Kconfig"
source "drivers/firmware/imx/Kconfig"
source "drivers/firmware/meson/Kconfig"
source "drivers/firmware/tegra/Kconfig"
source "drivers/firmware/xilinx/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -31,5 +31,6 @@ obj-y += meson/
obj-$(CONFIG_GOOGLE_FIRMWARE)	+= google/
obj-$(CONFIG_EFI)		+= efi/
obj-$(CONFIG_UEFI_CPER)		+= efi/
obj-y				+= imx/
obj-y				+= tegra/
obj-y				+= xilinx/
+11 −0
Original line number Diff line number Diff line
config IMX_SCU
	bool "IMX SCU Protocol driver"
	depends on IMX_MBOX
	help
	  The System Controller Firmware (SCFW) is a low-level system function
	  which runs on a dedicated Cortex-M core to provide power, clock, and
	  resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
	  (QM, QP), and i.MX8QX (QXP, DX).

	  This driver manages the IPC interface between host CPU and the
	  SCU firmware running on M4.
Loading