Skip to content

Commit 99bdeae

Browse files
committed
Merge tag 'mailbox-v6.5' of git://git.linaro.org/landing-teams/working/fujitsu/integration
Pull mailbox updates from Jassi Brar: - tegra: support for Tegra264 - broadcom: convert bcm2835 bindings from txt to yaml bcm2835 - qcom: support for IPQ5018 - ti: always zero TX data fields * tag 'mailbox-v6.5' of git://git.linaro.org/landing-teams/working/fujitsu/integration: mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 mailbox: tegra: add support for Tegra264 dt-bindings: mailbox: tegra: Document Tegra264 HSP dt-bindings: mailbox: convert bcm2835-mbox bindings to YAML dt-bindings: mailbox: qcom: Add IPQ5018 APCS compatible
2 parents b349de4 + 1b712f1 commit 99bdeae

6 files changed

Lines changed: 65 additions & 31 deletions

File tree

Documentation/devicetree/bindings/mailbox/brcm,bcm2835-mbox.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mailbox/brcm,bcm2835-mbox.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Broadcom BCM2835 VideoCore mailbox IPC
8+
9+
maintainers:
10+
- Stefan Wahren <stefan.wahren@i2se.com>
11+
12+
properties:
13+
compatible:
14+
const: brcm,bcm2835-mbox
15+
16+
reg:
17+
maxItems: 1
18+
19+
interrupts:
20+
maxItems: 1
21+
22+
"#mbox-cells":
23+
const: 0
24+
25+
required:
26+
- compatible
27+
- reg
28+
- interrupts
29+
- "#mbox-cells"
30+
31+
additionalProperties: false
32+
33+
examples:
34+
- |
35+
mailbox@7e00b880 {
36+
compatible = "brcm,bcm2835-mbox";
37+
reg = <0x7e00b880 0x40>;
38+
interrupts = <0 1>;
39+
#mbox-cells = <0>;
40+
};

Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ properties:
6666
oneOf:
6767
- const: nvidia,tegra186-hsp
6868
- const: nvidia,tegra194-hsp
69+
- const: nvidia,tegra264-hsp
6970
- items:
7071
- const: nvidia,tegra234-hsp
7172
- const: nvidia,tegra194-hsp

Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ properties:
1818
oneOf:
1919
- items:
2020
- enum:
21+
- qcom,ipq5018-apcs-apps-global
2122
- qcom,ipq5332-apcs-apps-global
2223
- qcom,ipq8074-apcs-apps-global
2324
- qcom,ipq9574-apcs-apps-global

drivers/mailbox/tegra-hsp.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
3+
* Copyright (c) 2016-2023, NVIDIA CORPORATION. All rights reserved.
44
*/
55

66
#include <linux/delay.h>
@@ -97,6 +97,7 @@ struct tegra_hsp_soc {
9797
const struct tegra_hsp_db_map *map;
9898
bool has_per_mb_ie;
9999
bool has_128_bit_mb;
100+
unsigned int reg_stride;
100101
};
101102

102103
struct tegra_hsp {
@@ -279,7 +280,7 @@ tegra_hsp_doorbell_create(struct tegra_hsp *hsp, const char *name,
279280
return ERR_PTR(-ENOMEM);
280281

281282
offset = (1 + (hsp->num_sm / 2) + hsp->num_ss + hsp->num_as) * SZ_64K;
282-
offset += index * 0x100;
283+
offset += index * hsp->soc->reg_stride;
283284

284285
db->channel.regs = hsp->regs + offset;
285286
db->channel.hsp = hsp;
@@ -916,24 +917,35 @@ static const struct tegra_hsp_soc tegra186_hsp_soc = {
916917
.map = tegra186_hsp_db_map,
917918
.has_per_mb_ie = false,
918919
.has_128_bit_mb = false,
920+
.reg_stride = 0x100,
919921
};
920922

921923
static const struct tegra_hsp_soc tegra194_hsp_soc = {
922924
.map = tegra186_hsp_db_map,
923925
.has_per_mb_ie = true,
924926
.has_128_bit_mb = false,
927+
.reg_stride = 0x100,
925928
};
926929

927930
static const struct tegra_hsp_soc tegra234_hsp_soc = {
928931
.map = tegra186_hsp_db_map,
929932
.has_per_mb_ie = false,
930933
.has_128_bit_mb = true,
934+
.reg_stride = 0x100,
935+
};
936+
937+
static const struct tegra_hsp_soc tegra264_hsp_soc = {
938+
.map = tegra186_hsp_db_map,
939+
.has_per_mb_ie = false,
940+
.has_128_bit_mb = true,
941+
.reg_stride = 0x1000,
931942
};
932943

933944
static const struct of_device_id tegra_hsp_match[] = {
934945
{ .compatible = "nvidia,tegra186-hsp", .data = &tegra186_hsp_soc },
935946
{ .compatible = "nvidia,tegra194-hsp", .data = &tegra194_hsp_soc },
936947
{ .compatible = "nvidia,tegra234-hsp", .data = &tegra234_hsp_soc },
948+
{ .compatible = "nvidia,tegra264-hsp", .data = &tegra264_hsp_soc },
937949
{ }
938950
};
939951

drivers/mailbox/ti-msgmgr.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,20 @@ static int ti_msgmgr_send_data(struct mbox_chan *chan, void *data)
430430
/* Ensure all unused data is 0 */
431431
data_trail &= 0xFFFFFFFF >> (8 * (sizeof(u32) - trail_bytes));
432432
writel(data_trail, data_reg);
433-
data_reg++;
433+
data_reg += sizeof(u32);
434434
}
435+
435436
/*
436437
* 'data_reg' indicates next register to write. If we did not already
437438
* write on tx complete reg(last reg), we must do so for transmit
439+
* In addition, we also need to make sure all intermediate data
440+
* registers(if any required), are reset to 0 for TISCI backward
441+
* compatibility to be maintained.
438442
*/
439-
if (data_reg <= qinst->queue_buff_end)
440-
writel(0, qinst->queue_buff_end);
443+
while (data_reg <= qinst->queue_buff_end) {
444+
writel(0, data_reg);
445+
data_reg += sizeof(u32);
446+
}
441447

442448
/* If we are in polled mode, wait for a response before proceeding */
443449
if (ti_msgmgr_chan_has_polled_queue_rx(message->chan_rx))

0 commit comments

Comments
 (0)