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

Commit 1220f2ac authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: Add QTI Mailbox Protocol driver" into msm-4.9

parents 2551dbca 38722588
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
Qualcomm Technologies, Inc. QTI Mailbox Protocol

QMP Driver
===================

Required properties:
- compatible : should be "qcom,qmp-mbox".
- label : the name of the remote proc this link connects to.
- reg : The location and size of shared memory.
	The irq register base address for triggering interrupts.
- reg-names : "msgram" - string to identify the shared memory region.
	"irq-reg-base" - string to identify the irq register region.
- qcom,irq-mask : the bitmask to trigger an interrupt.
- interrupt : the receiving interrupt line.
- mbox-desc-offset : offset of mailbox descriptor from start of the msgram.
- #mbox-cells: Common mailbox binding property to identify the number of cells
		required for the mailbox specifier, should be 1.

Optional properties:
- mbox-offset : offset of the mcore mailbox from the offset of msgram. If this
			property is not used, qmp will use the configuration
			provided by the ucore.
- mbox-size : size of the mcore mailbox. If this property is not used, qmp will
			use the configuration provided by the ucore.

Example:
	qmp_aop: qcom,qmp-aop {
		compatible = "qcom,qmp-mbox";
		label = "aop";
		reg = <0xc300000 0x100000>,
			<0x1799000C 0x4>;
		reg-names = "msgram", "irq-reg-base";
		qcom,irq-mask = <0x1>;
		interrupt = <0 389 1>;
		mbox-desc-offset = <0x100>;
		mbox-offset = <0x500>;
		mbox-size = <0x400>;
		#mbox-cells = <1>;
	};

Mailbox Client
==============
"mboxes" and the optional "mbox-names" (please see
Documentation/devicetree/bindings/mailbox/mailbox.txt for details). Each value
of the mboxes property should contain a phandle to the mailbox controller
device node and second argument is the channel index. It must be 0 (qmp
supports only one channel).The equivalent "mbox-names" property value can be
used to give a name to the communication channel to be used by the client user.

Example:
	qmp-client {
		compatible = "qcom,qmp-client";
		mbox-names = "aop";
		mboxes = <&qmp_aop 0>,
	};
+7 −0
Original line number Diff line number Diff line
@@ -151,4 +151,11 @@ config QTI_RPMH_MBOX
	  Support for communication with the hardened-RPM blocks in
	  Qualcomm Technologies Inc (QTI) SoCs using TCS hardware mailbox.

config MSM_QMP
	bool "QTI Mailbox Protocol(QMP)"
	depends on MSM_SMEM
	help
	  QMP is a lightweight communication protocol for sending messages to
	  a remote processor. This protocol fits into the Generic Mailbox
	  Framework. QMP uses a mailbox located in shared memory.
endif
+2 −0
Original line number Diff line number Diff line
@@ -31,3 +31,5 @@ obj-$(CONFIG_HI6220_MBOX) += hi6220-mailbox.o
obj-$(CONFIG_BCM_PDC_MBOX)	+= bcm-pdc-mailbox.o

obj-$(CONFIG_QTI_RPMH_MBOX)	+= qti-tcs.o

obj-$(CONFIG_MSM_QMP)	+= msm_qmp.o
+811 −0

File added.

Preview size limit exceeded, changes collapsed.

+28 −0
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef _QMP_H_
#define _QMP_H_

#include <linux/types.h>

/**
 * struct qmp_pkt - Packet structure to be used for TX and RX with QMP
 * @size	size of data
 * @data	Buffer holding data of this packet
 */
struct qmp_pkt {
	u32 size;
	void *data;
};

#endif /* _QMP_H_ */