net: qrtr: haven: Read peer name from device tree

Add support for the primary vm to read the vm peer name from device
tree. This information is needed to share memory to the peer vm.

Change-Id: Ied71d254975e08dcf6c1c51f49687aceced141a9
Signed-off-by: Chris Lew <clew@codeaurora.org>
This commit is contained in:
Chris Lew 2020-06-12 14:52:29 -07:00
commit 026bc864e7

View file

@ -40,6 +40,7 @@ struct haven_pipe {
* @base: Base of the shared fifo.
* @size: fifo size.
* @master: primary vm indicator.
* @peer_name: name of vm peer.
* @label: label for haven resources
* @tx_dbl: doorbell for tx notifications.
* @rx_dbl: doorbell for rx notifications.
@ -54,6 +55,7 @@ struct qrtr_haven_dev {
void *base;
size_t size;
bool master;
u32 peer_name;
u32 label;
void *tx_dbl;
@ -336,12 +338,19 @@ static int qrtr_haven_probe(struct platform_device *pdev)
return ret;
}
qdev->master = of_property_read_bool(node, "qcom,master");
ret = qrtr_haven_map_memory(qdev);
if (ret)
return ret;
qrtr_haven_fifo_init(qdev);
if (qdev->master) {
ret = of_property_read_u32(node, "peer-name", &qdev->peer_name);
if (ret)
qdev->peer_name = HH_SELF_VM;
}
dbl_label = qdev->label;
qdev->tx_dbl = hh_dbl_tx_register(dbl_label);
if (IS_ERR_OR_NULL(qdev->tx_dbl)) {