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

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

Merge tag 'qcom-drivers-for-4.15-2' of...

Merge tag 'qcom-drivers-for-4.15-2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/drivers

Pull "Qualcomm ARM Based Driver Updates for v4.15 Part 2" from Andy Gross:

* Add Qualcomm Remote Filesystem Memory driver
* Add OF linkage for RMTFS

* tag 'qcom-drivers-for-4.15-2' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/agross/linux:
  soc: qcom: Remote filesystem memory driver
  dt-binding: soc: qcom: Add binding for rmtfs memory
  of: reserved_mem: Accessor for acquiring reserved_mem
  of/platform: Generalize /reserved-memory handling
parents 5e9b41ff d1de6d6c
Loading
Loading
Loading
Loading
+51 −0
Original line number Diff line number Diff line
Qualcomm Remote File System Memory binding

This binding describes the Qualcomm remote filesystem memory, which serves the
purpose of describing the shared memory region used for remote processors to
access block device data using the Remote Filesystem protocol.

- compatible:
	Usage: required
	Value type: <stringlist>
	Definition: must be:
		    "qcom,rmtfs-mem"

- reg:
	Usage: required for static allocation
	Value type: <prop-encoded-array>
	Definition: must specify base address and size of the memory region,
		    as described in reserved-memory.txt

- size:
	Usage: required for dynamic allocation
	Value type: <prop-encoded-array>
	Definition: must specify a size of the memory region, as described in
		    reserved-memory.txt

- qcom,client-id:
	Usage: required
	Value type: <u32>
	Definition: identifier of the client to use this region for buffers.

- qcom,vmid:
	Usage: optional
	Value type: <u32>
	Definition: vmid of the remote processor, to set up memory protection.

= EXAMPLE
The following example shows the remote filesystem memory setup for APQ8016,
with the rmtfs region for the Hexagon DSP (id #1) located at 0x86700000.

	reserved-memory {
		#address-cells = <2>;
		#size-cells = <2>;
		ranges;

		rmtfs@86700000 {
			compatible = "qcom,rmtfs-mem";
			reg = <0x0 0x86700000 0x0 0xe0000>;
			no-map;

			qcom,client-id = <1>;
		};
	};
+26 −0
Original line number Diff line number Diff line
@@ -397,3 +397,29 @@ void of_reserved_mem_device_release(struct device *dev)
	rmem->ops->device_release(rmem, dev);
}
EXPORT_SYMBOL_GPL(of_reserved_mem_device_release);

/**
 * of_reserved_mem_lookup() - acquire reserved_mem from a device node
 * @np:		node pointer of the desired reserved-memory region
 *
 * This function allows drivers to acquire a reference to the reserved_mem
 * struct based on a device node handle.
 *
 * Returns a reserved_mem reference, or NULL on error.
 */
struct reserved_mem *of_reserved_mem_lookup(struct device_node *np)
{
	const char *name;
	int i;

	if (!np->full_name)
		return NULL;

	name = kbasename(np->full_name);
	for (i = 0; i < reserved_mem_count; i++)
		if (!strcmp(reserved_mem[i].name, name))
			return &reserved_mem[i];

	return NULL;
}
EXPORT_SYMBOL_GPL(of_reserved_mem_lookup);
+11 −8
Original line number Diff line number Diff line
@@ -497,6 +497,12 @@ int of_platform_default_populate(struct device_node *root,
EXPORT_SYMBOL_GPL(of_platform_default_populate);

#ifndef CONFIG_PPC
static const struct of_device_id reserved_mem_matches[] = {
	{ .compatible = "qcom,rmtfs-mem" },
	{ .compatible = "ramoops" },
	{}
};

static int __init of_platform_default_populate_init(void)
{
	struct device_node *node;
@@ -505,15 +511,12 @@ static int __init of_platform_default_populate_init(void)
		return -ENODEV;

	/*
	 * Handle ramoops explicitly, since it is inside /reserved-memory,
	 * which lacks a "compatible" property.
	 * Handle certain compatibles explicitly, since we don't want to create
	 * platform_devices for every node in /reserved-memory with a
	 * "compatible",
	 */
	node = of_find_node_by_path("/reserved-memory");
	if (node) {
		node = of_find_compatible_node(node, NULL, "ramoops");
		if (node)
	for_each_matching_node(node, reserved_mem_matches)
		of_platform_device_create(node, NULL, NULL);
	}

	/* Populate everything else. */
	of_platform_default_populate(NULL, NULL, NULL);
+11 −0
Original line number Diff line number Diff line
@@ -35,6 +35,17 @@ config QCOM_PM
	  modes. It interface with various system drivers to put the cores in
	  low power modes.

config QCOM_RMTFS_MEM
	tristate "Qualcomm Remote Filesystem memory driver"
	depends on ARCH_QCOM
	help
	  The Qualcomm remote filesystem memory driver is used for allocating
	  and exposing regions of shared memory with remote processors for the
	  purpose of exchanging sector-data between the remote filesystem
	  service and its clients.

	  Say y here if you intend to boot the modem remoteproc.

config QCOM_SMEM
	tristate "Qualcomm Shared Memory Manager (SMEM)"
	depends on ARCH_QCOM
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ obj-$(CONFIG_QCOM_GLINK_SSR) += glink_ssr.o
obj-$(CONFIG_QCOM_GSBI)	+=	qcom_gsbi.o
obj-$(CONFIG_QCOM_MDT_LOADER)	+= mdt_loader.o
obj-$(CONFIG_QCOM_PM)	+=	spm.o
obj-$(CONFIG_QCOM_RMTFS_MEM)	+= rmtfs_mem.o
obj-$(CONFIG_QCOM_SMD_RPM)	+= smd-rpm.o
obj-$(CONFIG_QCOM_SMEM) +=	smem.o
obj-$(CONFIG_QCOM_SMEM_STATE) += smem_state.o
Loading