forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'mailbox-v6.2' of git://git.linaro.org/landing-teams/workin…
…g/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
- Loading branch information
Showing
11 changed files
with
1,090 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/* | ||
* Microchip PolarFire SoC (MPFS) system controller/mailbox controller driver | ||
* | ||
* Copyright (c) 2020 Microchip Corporation. All rights reserved. | ||
* Copyright (c) 2020-2022 Microchip Corporation. All rights reserved. | ||
* | ||
* Author: Conor Dooley <[email protected]> | ||
* | ||
|
@@ -56,7 +56,7 @@ | |
#define SCB_STATUS_NOTIFY_MASK BIT(SCB_STATUS_NOTIFY) | ||
|
||
#define SCB_STATUS_POS (16) | ||
#define SCB_STATUS_MASK GENMASK_ULL(SCB_STATUS_POS + SCB_MASK_WIDTH, SCB_STATUS_POS) | ||
#define SCB_STATUS_MASK GENMASK(SCB_STATUS_POS + SCB_MASK_WIDTH - 1, SCB_STATUS_POS) | ||
|
||
struct mpfs_mbox { | ||
struct mbox_controller controller; | ||
|
@@ -130,13 +130,38 @@ static void mpfs_mbox_rx_data(struct mbox_chan *chan) | |
struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; | ||
struct mpfs_mss_response *response = mbox->response; | ||
u16 num_words = ALIGN((response->resp_size), (4)) / 4U; | ||
u32 i; | ||
u32 i, status; | ||
|
||
if (!response->resp_msg) { | ||
dev_err(mbox->dev, "failed to assign memory for response %d\n", -ENOMEM); | ||
return; | ||
} | ||
|
||
/* | ||
* The status is stored in bits 31:16 of the SERVICES_SR register. | ||
* It is only valid when BUSY == 0. | ||
* We should *never* get an interrupt while the controller is | ||
* still in the busy state. If we do, something has gone badly | ||
* wrong & the content of the mailbox would not be valid. | ||
*/ | ||
if (mpfs_mbox_busy(mbox)) { | ||
dev_err(mbox->dev, "got an interrupt but system controller is busy\n"); | ||
response->resp_status = 0xDEAD; | ||
return; | ||
} | ||
|
||
status = readl_relaxed(mbox->ctrl_base + SERVICES_SR_OFFSET); | ||
|
||
/* | ||
* If the status of the individual servers is non-zero, the service has | ||
* failed. The contents of the mailbox at this point are not be valid, | ||
* so don't bother reading them. Set the status so that the driver | ||
* implementing the service can handle the result. | ||
*/ | ||
response->resp_status = (status & SCB_STATUS_MASK) >> SCB_STATUS_POS; | ||
if (response->resp_status) | ||
return; | ||
|
||
if (!mpfs_mbox_busy(mbox)) { | ||
for (i = 0; i < num_words; i++) { | ||
response->resp_msg[i] = | ||
|
Oops, something went wrong.