Skip to content

Commit f2855ee

Browse files
committed
Merge tag 'mailbox-v6.2' of git://git.linaro.org/landing-teams/working/fujitsu/integration
Pull mailbox updates from Jassi Brar: - qcom: enable sc8280xp, sm8550 and sm4250 support - ti: default to ARCH_K3 for msg manager - mediatek: - add mt8188 and mt8186 support - request irq only after got ready - zynq-ipi: fix error handling after device_register - mpfs: check sys-con status - rockchip: simplify by using device_get_match_data * tag 'mailbox-v6.2' of git://git.linaro.org/landing-teams/working/fujitsu/integration: dt-bindings: mailbox: qcom-ipcc: Add compatible for SM8550 mailbox: mtk-cmdq: Do not request irq until we are ready mailbox: zynq-ipi: fix error handling while device_register() fails mailbox: mtk-cmdq-mailbox: Use platform data directly instead of copying mailbox: arm_mhuv2: Fix return value check in mhuv2_probe() dt-bindings: mailbox: mediatek,gce-mailbox: add mt8188 compatible name dt-bindings: mailbox: add GCE header file for mt8188 mailbox: mpfs: read the system controller's status mailbox: mtk-cmdq: add MT8186 support mailbox: mtk-cmdq: add gce ddr enable support flow mailbox: mtk-cmdq: add gce software ddr enable private data mailbox: mtk-cmdq: Use GCE_CTRL_BY_SW definition instead of number mailbox: rockchip: Use device_get_match_data() to simplify the code dt-bindings: mailbox: qcom-ipcc: Add sc8280xp compatible mailbox: config: ti-msgmgr: Default set to ARCH_K3 for TI msg manager mailbox: qcom-apcs-ipc: Add SM4250 APCS IPC support dt-bindings: mailbox: qcom: Add SM4250 APCS compatible
2 parents ec34c2b + 53c60d1 commit f2855ee

File tree

11 files changed

+1090
-58
lines changed

11 files changed

+1090
-58
lines changed

Documentation/devicetree/bindings/mailbox/mediatek,gce-mailbox.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ properties:
2121
- mediatek,mt8173-gce
2222
- mediatek,mt8183-gce
2323
- mediatek,mt8186-gce
24+
- mediatek,mt8188-gce
2425
- mediatek,mt8192-gce
2526
- mediatek,mt8195-gce
2627

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ properties:
2828
- qcom,sc8180x-apss-shared
2929
- qcom,sdm660-apcs-hmss-global
3030
- qcom,sdm845-apss-shared
31+
- qcom,sm4250-apcs-hmss-global
3132
- qcom,sm6125-apcs-hmss-global
3233
- qcom,sm6115-apcs-hmss-global
3334
- qcom,sm8150-apss-shared

Documentation/devicetree/bindings/mailbox/qcom-ipcc.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ properties:
2424
compatible:
2525
items:
2626
- enum:
27+
- qcom,sc7280-ipcc
28+
- qcom,sc8280xp-ipcc
2729
- qcom,sm6350-ipcc
2830
- qcom,sm6375-ipcc
2931
- qcom,sm8250-ipcc
3032
- qcom,sm8350-ipcc
3133
- qcom,sm8450-ipcc
32-
- qcom,sc7280-ipcc
34+
- qcom,sm8550-ipcc
3335
- const: qcom,ipcc
3436

3537
reg:

drivers/mailbox/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ config STI_MBOX
136136
config TI_MESSAGE_MANAGER
137137
tristate "Texas Instruments Message Manager Driver"
138138
depends on ARCH_KEYSTONE || ARCH_K3
139+
default ARCH_K3
139140
help
140141
An implementation of Message Manager slave driver for Keystone
141142
and K3 architecture SoCs from Texas Instruments. Message Manager

drivers/mailbox/arm_mhuv2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,8 @@ static int mhuv2_probe(struct amba_device *adev, const struct amba_id *id)
10621062
int ret = -EINVAL;
10631063

10641064
reg = devm_of_iomap(dev, dev->of_node, 0, NULL);
1065-
if (!reg)
1066-
return -ENOMEM;
1065+
if (IS_ERR(reg))
1066+
return PTR_ERR(reg);
10671067

10681068
mhu = devm_kzalloc(dev, sizeof(*mhu), GFP_KERNEL);
10691069
if (!mhu)

drivers/mailbox/mailbox-mpfs.c

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Microchip PolarFire SoC (MPFS) system controller/mailbox controller driver
44
*
5-
* Copyright (c) 2020 Microchip Corporation. All rights reserved.
5+
* Copyright (c) 2020-2022 Microchip Corporation. All rights reserved.
66
*
77
* Author: Conor Dooley <[email protected]>
88
*
@@ -56,7 +56,7 @@
5656
#define SCB_STATUS_NOTIFY_MASK BIT(SCB_STATUS_NOTIFY)
5757

5858
#define SCB_STATUS_POS (16)
59-
#define SCB_STATUS_MASK GENMASK_ULL(SCB_STATUS_POS + SCB_MASK_WIDTH, SCB_STATUS_POS)
59+
#define SCB_STATUS_MASK GENMASK(SCB_STATUS_POS + SCB_MASK_WIDTH - 1, SCB_STATUS_POS)
6060

6161
struct mpfs_mbox {
6262
struct mbox_controller controller;
@@ -130,13 +130,38 @@ static void mpfs_mbox_rx_data(struct mbox_chan *chan)
130130
struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv;
131131
struct mpfs_mss_response *response = mbox->response;
132132
u16 num_words = ALIGN((response->resp_size), (4)) / 4U;
133-
u32 i;
133+
u32 i, status;
134134

135135
if (!response->resp_msg) {
136136
dev_err(mbox->dev, "failed to assign memory for response %d\n", -ENOMEM);
137137
return;
138138
}
139139

140+
/*
141+
* The status is stored in bits 31:16 of the SERVICES_SR register.
142+
* It is only valid when BUSY == 0.
143+
* We should *never* get an interrupt while the controller is
144+
* still in the busy state. If we do, something has gone badly
145+
* wrong & the content of the mailbox would not be valid.
146+
*/
147+
if (mpfs_mbox_busy(mbox)) {
148+
dev_err(mbox->dev, "got an interrupt but system controller is busy\n");
149+
response->resp_status = 0xDEAD;
150+
return;
151+
}
152+
153+
status = readl_relaxed(mbox->ctrl_base + SERVICES_SR_OFFSET);
154+
155+
/*
156+
* If the status of the individual servers is non-zero, the service has
157+
* failed. The contents of the mailbox at this point are not be valid,
158+
* so don't bother reading them. Set the status so that the driver
159+
* implementing the service can handle the result.
160+
*/
161+
response->resp_status = (status & SCB_STATUS_MASK) >> SCB_STATUS_POS;
162+
if (response->resp_status)
163+
return;
164+
140165
if (!mpfs_mbox_busy(mbox)) {
141166
for (i = 0; i < num_words; i++) {
142167
response->resp_msg[i] =

0 commit comments

Comments
 (0)