Commit f2855eec authored by Linus Torvalds's avatar Linus Torvalds

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
parents ec34c2b4 53c60d10
...@@ -21,6 +21,7 @@ properties: ...@@ -21,6 +21,7 @@ properties:
- mediatek,mt8173-gce - mediatek,mt8173-gce
- mediatek,mt8183-gce - mediatek,mt8183-gce
- mediatek,mt8186-gce - mediatek,mt8186-gce
- mediatek,mt8188-gce
- mediatek,mt8192-gce - mediatek,mt8192-gce
- mediatek,mt8195-gce - mediatek,mt8195-gce
......
...@@ -28,6 +28,7 @@ properties: ...@@ -28,6 +28,7 @@ properties:
- qcom,sc8180x-apss-shared - qcom,sc8180x-apss-shared
- qcom,sdm660-apcs-hmss-global - qcom,sdm660-apcs-hmss-global
- qcom,sdm845-apss-shared - qcom,sdm845-apss-shared
- qcom,sm4250-apcs-hmss-global
- qcom,sm6125-apcs-hmss-global - qcom,sm6125-apcs-hmss-global
- qcom,sm6115-apcs-hmss-global - qcom,sm6115-apcs-hmss-global
- qcom,sm8150-apss-shared - qcom,sm8150-apss-shared
......
...@@ -24,12 +24,14 @@ properties: ...@@ -24,12 +24,14 @@ properties:
compatible: compatible:
items: items:
- enum: - enum:
- qcom,sc7280-ipcc
- qcom,sc8280xp-ipcc
- qcom,sm6350-ipcc - qcom,sm6350-ipcc
- qcom,sm6375-ipcc - qcom,sm6375-ipcc
- qcom,sm8250-ipcc - qcom,sm8250-ipcc
- qcom,sm8350-ipcc - qcom,sm8350-ipcc
- qcom,sm8450-ipcc - qcom,sm8450-ipcc
- qcom,sc7280-ipcc - qcom,sm8550-ipcc
- const: qcom,ipcc - const: qcom,ipcc
reg: reg:
......
...@@ -136,6 +136,7 @@ config STI_MBOX ...@@ -136,6 +136,7 @@ config STI_MBOX
config TI_MESSAGE_MANAGER config TI_MESSAGE_MANAGER
tristate "Texas Instruments Message Manager Driver" tristate "Texas Instruments Message Manager Driver"
depends on ARCH_KEYSTONE || ARCH_K3 depends on ARCH_KEYSTONE || ARCH_K3
default ARCH_K3
help help
An implementation of Message Manager slave driver for Keystone An implementation of Message Manager slave driver for Keystone
and K3 architecture SoCs from Texas Instruments. Message Manager and K3 architecture SoCs from Texas Instruments. Message Manager
......
...@@ -1062,8 +1062,8 @@ static int mhuv2_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -1062,8 +1062,8 @@ static int mhuv2_probe(struct amba_device *adev, const struct amba_id *id)
int ret = -EINVAL; int ret = -EINVAL;
reg = devm_of_iomap(dev, dev->of_node, 0, NULL); reg = devm_of_iomap(dev, dev->of_node, 0, NULL);
if (!reg) if (IS_ERR(reg))
return -ENOMEM; return PTR_ERR(reg);
mhu = devm_kzalloc(dev, sizeof(*mhu), GFP_KERNEL); mhu = devm_kzalloc(dev, sizeof(*mhu), GFP_KERNEL);
if (!mhu) if (!mhu)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Microchip PolarFire SoC (MPFS) system controller/mailbox controller driver * 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 <conor.dooley@microchip.com> * Author: Conor Dooley <conor.dooley@microchip.com>
* *
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#define SCB_STATUS_NOTIFY_MASK BIT(SCB_STATUS_NOTIFY) #define SCB_STATUS_NOTIFY_MASK BIT(SCB_STATUS_NOTIFY)
#define SCB_STATUS_POS (16) #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 mpfs_mbox {
struct mbox_controller controller; struct mbox_controller controller;
...@@ -130,13 +130,38 @@ static void mpfs_mbox_rx_data(struct mbox_chan *chan) ...@@ -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_mbox *mbox = (struct mpfs_mbox *)chan->con_priv;
struct mpfs_mss_response *response = mbox->response; struct mpfs_mss_response *response = mbox->response;
u16 num_words = ALIGN((response->resp_size), (4)) / 4U; u16 num_words = ALIGN((response->resp_size), (4)) / 4U;
u32 i; u32 i, status;
if (!response->resp_msg) { if (!response->resp_msg) {
dev_err(mbox->dev, "failed to assign memory for response %d\n", -ENOMEM); dev_err(mbox->dev, "failed to assign memory for response %d\n", -ENOMEM);
return; 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)) { if (!mpfs_mbox_busy(mbox)) {
for (i = 0; i < num_words; i++) { for (i = 0; i < num_words; i++) {
response->resp_msg[i] = response->resp_msg[i] =
......
This diff is collapsed.
...@@ -156,6 +156,7 @@ static const struct of_device_id qcom_apcs_ipc_of_match[] = { ...@@ -156,6 +156,7 @@ static const struct of_device_id qcom_apcs_ipc_of_match[] = {
{ .compatible = "qcom,sc8180x-apss-shared", .data = &apps_shared_apcs_data }, { .compatible = "qcom,sc8180x-apss-shared", .data = &apps_shared_apcs_data },
{ .compatible = "qcom,sdm660-apcs-hmss-global", .data = &msm8994_apcs_data }, { .compatible = "qcom,sdm660-apcs-hmss-global", .data = &msm8994_apcs_data },
{ .compatible = "qcom,sdm845-apss-shared", .data = &apps_shared_apcs_data }, { .compatible = "qcom,sdm845-apss-shared", .data = &apps_shared_apcs_data },
{ .compatible = "qcom,sm4250-apcs-hmss-global", .data = &msm8994_apcs_data },
{ .compatible = "qcom,sm6125-apcs-hmss-global", .data = &msm8994_apcs_data }, { .compatible = "qcom,sm6125-apcs-hmss-global", .data = &msm8994_apcs_data },
{ .compatible = "qcom,sm8150-apss-shared", .data = &apps_shared_apcs_data }, { .compatible = "qcom,sm8150-apss-shared", .data = &apps_shared_apcs_data },
{ .compatible = "qcom,sm6115-apcs-hmss-global", .data = &msm8994_apcs_data }, { .compatible = "qcom,sm6115-apcs-hmss-global", .data = &msm8994_apcs_data },
......
...@@ -164,7 +164,6 @@ MODULE_DEVICE_TABLE(of, rockchp_mbox_of_match); ...@@ -164,7 +164,6 @@ MODULE_DEVICE_TABLE(of, rockchp_mbox_of_match);
static int rockchip_mbox_probe(struct platform_device *pdev) static int rockchip_mbox_probe(struct platform_device *pdev)
{ {
struct rockchip_mbox *mb; struct rockchip_mbox *mb;
const struct of_device_id *match;
const struct rockchip_mbox_data *drv_data; const struct rockchip_mbox_data *drv_data;
struct resource *res; struct resource *res;
int ret, irq, i; int ret, irq, i;
...@@ -172,8 +171,7 @@ static int rockchip_mbox_probe(struct platform_device *pdev) ...@@ -172,8 +171,7 @@ static int rockchip_mbox_probe(struct platform_device *pdev)
if (!pdev->dev.of_node) if (!pdev->dev.of_node)
return -ENODEV; return -ENODEV;
match = of_match_node(rockchip_mbox_of_match, pdev->dev.of_node); drv_data = (const struct rockchip_mbox_data *) device_get_match_data(&pdev->dev);
drv_data = (const struct rockchip_mbox_data *)match->data;
mb = devm_kzalloc(&pdev->dev, sizeof(*mb), GFP_KERNEL); mb = devm_kzalloc(&pdev->dev, sizeof(*mb), GFP_KERNEL);
if (!mb) if (!mb)
......
...@@ -493,6 +493,7 @@ static int zynqmp_ipi_mbox_probe(struct zynqmp_ipi_mbox *ipi_mbox, ...@@ -493,6 +493,7 @@ static int zynqmp_ipi_mbox_probe(struct zynqmp_ipi_mbox *ipi_mbox,
ret = device_register(&ipi_mbox->dev); ret = device_register(&ipi_mbox->dev);
if (ret) { if (ret) {
dev_err(dev, "Failed to register ipi mbox dev.\n"); dev_err(dev, "Failed to register ipi mbox dev.\n");
put_device(&ipi_mbox->dev);
return ret; return ret;
} }
mdev = &ipi_mbox->dev; mdev = &ipi_mbox->dev;
...@@ -619,6 +620,7 @@ static void zynqmp_ipi_free_mboxes(struct zynqmp_ipi_pdata *pdata) ...@@ -619,6 +620,7 @@ static void zynqmp_ipi_free_mboxes(struct zynqmp_ipi_pdata *pdata)
ipi_mbox = &pdata->ipi_mboxes[i]; ipi_mbox = &pdata->ipi_mboxes[i];
if (ipi_mbox->dev.parent) { if (ipi_mbox->dev.parent) {
mbox_controller_unregister(&ipi_mbox->mbox); mbox_controller_unregister(&ipi_mbox->mbox);
if (device_is_registered(&ipi_mbox->dev))
device_unregister(&ipi_mbox->dev); device_unregister(&ipi_mbox->dev);
} }
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment