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

Commit d880e5ad authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'rproc-v4.9' of git://github.com/andersson/remoteproc

Pull remoteproc updates from Bjorn Andersson:
 "In addition to a slew of minor fixes and cleanups these patches
  refactor how we deal with remoteprocs that will be auto-booting
  themselves.

  That does clean up the remote resource handling but makes for
  additional work to clarify responsibilities and life cycles of
  resources. We also revise how module locking of remoteproc drivers
  work, so that they are locked as we hand out references to them to
  third parties, rather than only when booted by anyone.

  In addition to that we also introduce the Qualcomm Wireless Subsystem
  remoteproc driver"

* tag 'rproc-v4.9' of git://github.com/andersson/remoteproc: (26 commits)
  remoteproc: Refactor rproc module locking
  remoteproc: Split driver and consumer dereferencing
  remoteproc: Correct resource handling upon boot failure
  remoteproc: Drop unnecessary NULL check
  remoteproc: core: transform struct fw_rsc_vdev_vring reserved field in pa
  remoteproc: Modify FW_RSC_ADDR_ANY definition
  remoteproc: qcom: wcnss: Fix return value check in wcnss_probe()
  remoteproc: qcom: Introduce WCNSS peripheral image loader
  dt-binding: remoteproc: Introduce Qualcomm WCNSS loader binding
  remoteproc: Only update table_ptr if we have a loaded table
  remoteproc: Move handling of cached table to boot/shutdown
  remoteproc: Move vdev handling to boot/shutdown
  remoteproc: Calculate max_notifyid during load
  remoteproc: Introduce auto-boot flag
  remoteproc/omap: revise a minor error trace message
  remoteproc/omap: fix various code formatting issues
  remoteproc: print hex numbers with a leading 0x format
  remoteproc: align code with open parenthesis
  remoteproc: fix bare unsigned type usage
  remoteproc: use variable names for sizeof() operator
  ...
parents 4c1fad64 fbb6aacb
Loading
Loading
Loading
Loading
+132 −0
Original line number Diff line number Diff line
Qualcomm WCNSS Peripheral Image Loader

This document defines the binding for a component that loads and boots firmware
on the Qualcomm WCNSS core.

- compatible:
	Usage: required
	Value type: <string>
	Definition: must be one of:
		    "qcom,riva-pil",
		    "qcom,pronto-v1-pil",
		    "qcom,pronto-v2-pil"

- reg:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: must specify the base address and size of the CCU, DXE and
		    PMU register blocks

- reg-names:
	Usage: required
	Value type: <stringlist>
	Definition: must be "ccu", "dxe", "pmu"

- interrupts-extended:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: must list the watchdog and fatal IRQs and may specify the
		    ready, handover and stop-ack IRQs

- interrupt-names:
	Usage: required
	Value type: <stringlist>
	Definition: should be "wdog", "fatal", optionally followed by "ready",
		    "handover", "stop-ack"

- vddmx-supply:
- vddcx-supply:
- vddpx-supply:
	Usage: required
	Value type: <phandle>
	Definition: reference to the regulators to be held on behalf of the
		    booting of the WCNSS core

- qcom,smem-states:
	Usage: optional
	Value type: <prop-encoded-array>
	Definition: reference to the SMEM state used to indicate to WCNSS that
		    it should shut down

- qcom,smem-state-names:
	Usage: optional
	Value type: <stringlist>
	Definition: should be "stop"

- memory-region:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: reference to reserved-memory node for the remote processor
		    see ../reserved-memory/reserved-memory.txt

= SUBNODES
A single subnode of the WCNSS PIL describes the attached rf module and its
resource dependencies.

- compatible:
	Usage: required
	Value type: <string>
	Definition: must be one of:
		    "qcom,wcn3620",
		    "qcom,wcn3660",
		    "qcom,wcn3680"

- clocks:
	Usage: required
	Value type: <prop-encoded-array>
	Definition: should specify the xo clock and optionally the rf clock

- clock-names:
	Usage: required
	Value type: <stringlist>
	Definition: should be "xo", optionally followed by "rf"

- vddxo-supply:
- vddrfa-supply:
- vddpa-supply:
- vdddig-supply:
	Usage: required
	Value type: <phandle>
	Definition: reference to the regulators to be held on behalf of the
		    booting of the WCNSS core

= EXAMPLE
The following example describes the resources needed to boot control the WCNSS,
with attached WCN3680, as it is commonly found on MSM8974 boards.

pronto@fb204000 {
	compatible = "qcom,pronto-v2-pil";
	reg = <0xfb204000 0x2000>, <0xfb202000 0x1000>, <0xfb21b000 0x3000>;
	reg-names = "ccu", "dxe", "pmu";

	interrupts-extended = <&intc 0 149 1>,
			      <&wcnss_smp2p_slave 0 0>,
			      <&wcnss_smp2p_slave 1 0>,
			      <&wcnss_smp2p_slave 2 0>,
			      <&wcnss_smp2p_slave 3 0>;
	interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack";

	vddmx-supply = <&pm8841_s1>;
	vddcx-supply = <&pm8841_s2>;
	vddpx-supply = <&pm8941_s3>;

	qcom,smem-states = <&wcnss_smp2p_out 0>;
	qcom,smem-state-names = "stop";

	memory-region = <&wcnss_region>;

	pinctrl-names = "default";
	pinctrl-0 = <&wcnss_pin_a>;

	iris {
		compatible = "qcom,wcn3680";

		clocks = <&rpmcc RPM_CXO_CLK_SRC>, <&rpmcc RPM_CXO_A2>;
		clock-names = "xo", "rf";

		vddxo-supply = <&pm8941_l6>;
		vddrfa-supply = <&pm8941_l11>;
		vddpa-supply = <&pm8941_l19>;
		vdddig-supply = <&pm8941_s3>;
	};
};
+3 −3
Original line number Diff line number Diff line
@@ -101,9 +101,9 @@ int dummy_rproc_example(struct rproc *my_rproc)
      On success, the new rproc is returned, and on failure, NULL.

      Note: _never_ directly deallocate @rproc, even if it was not registered
      yet. Instead, when you need to unroll rproc_alloc(), use rproc_put().
      yet. Instead, when you need to unroll rproc_alloc(), use rproc_free().

  void rproc_put(struct rproc *rproc)
  void rproc_free(struct rproc *rproc)
    - Free an rproc handle that was allocated by rproc_alloc.
      This function essentially unrolls rproc_alloc(), by decrementing the
      rproc's refcount. It doesn't directly free rproc; that would happen
@@ -131,7 +131,7 @@ int dummy_rproc_example(struct rproc *my_rproc)
      has completed successfully.

      After rproc_del() returns, @rproc is still valid, and its
      last refcount should be decremented by calling rproc_put().
      last refcount should be decremented by calling rproc_free().

      Returns 0 on success and -EINVAL if @rproc isn't valid.

+16 −0
Original line number Diff line number Diff line
@@ -91,6 +91,22 @@ config QCOM_Q6V5_PIL
	  Say y here to support the Qualcomm Peripherial Image Loader for the
	  Hexagon V5 based remote processors.

config QCOM_WCNSS_IRIS
	tristate
	depends on OF && ARCH_QCOM

config QCOM_WCNSS_PIL
	tristate "Qualcomm WCNSS Peripheral Image Loader"
	depends on OF && ARCH_QCOM
	depends on QCOM_SMEM
	select QCOM_MDT_LOADER
	select QCOM_SCM
	select QCOM_WCNSS_IRIS
	select REMOTEPROC
	help
	  Say y here to support the Peripheral Image Loader for the Qualcomm
	  Wireless Connectivity Subsystem.

config ST_REMOTEPROC
	tristate "ST remoteproc support"
	depends on ARCH_STI
+2 −0
Original line number Diff line number Diff line
@@ -13,4 +13,6 @@ obj-$(CONFIG_WKUP_M3_RPROC) += wkup_m3_rproc.o
obj-$(CONFIG_DA8XX_REMOTEPROC)		+= da8xx_remoteproc.o
obj-$(CONFIG_QCOM_MDT_LOADER)		+= qcom_mdt_loader.o
obj-$(CONFIG_QCOM_Q6V5_PIL)		+= qcom_q6v5_pil.o
obj-$(CONFIG_QCOM_WCNSS_IRIS)		+= qcom_wcnss_iris.o
obj-$(CONFIG_QCOM_WCNSS_PIL)		+= qcom_wcnss.o
obj-$(CONFIG_ST_REMOTEPROC)		+= st_remoteproc.o
+3 −3
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ static void da8xx_rproc_kick(struct rproc *rproc, int vqid)
{
	struct da8xx_rproc *drproc = (struct da8xx_rproc *)rproc->priv;

	/* Interupt remote proc */
	/* Interrupt remote proc */
	writel(SYSCFG_CHIPSIG2, drproc->chipsig);
}

@@ -261,7 +261,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev)
	return 0;

free_rproc:
	rproc_put(rproc);
	rproc_free(rproc);

	return ret;
}
@@ -290,7 +290,7 @@ static int da8xx_rproc_remove(struct platform_device *pdev)
	disable_irq(drproc->irq);

	rproc_del(rproc);
	rproc_put(rproc);
	rproc_free(rproc);

	return 0;
}
Loading