From patchwork Thu Mar 11 11:34:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12130997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F399DC433DB for ; Thu, 11 Mar 2021 11:35:12 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 46E5964F35 for ; Thu, 11 Mar 2021 11:35:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46E5964F35 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=YQn2WrqO5vErg9WTn29KiSRz4VxVPSEk9kpucaBpWsw=; b=lq0jlBecKMSzkN3n+TI0hegzLe 8yJ+W1yMLoUOI2L6IFm2Ww4pB2icoSQgq2nC/rdFoSs/sYD+Vx2Fj03QMt2YFLOdMBChS6EGSZf/n lcDZTFEXomvNrNoXnh3SzLCaY5fXp2lBEMWGNf7wNb6GWA61GKtUOW4i31o4760QDEb7z+leX94eN JBR8n1HNulmXXsQdh6+clhWtMusqT+hg4R4ec5Ck8X7mgrM0q5GhQzrCxNKd5oJ4Hc/TrGDqfi3vt yiWSJGlQ1qHA5SJTgIrG86FSRVCXXZiAf6xqs9mUq+KM2LvolJpYXF1DC6d2hB1pMsUYMjVT2D9Qv B7y6VCYw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKJal-008wNX-91; Thu, 11 Mar 2021 11:34:59 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKJag-008wLx-8l for linux-riscv@lists.infradead.org; Thu, 11 Mar 2021 11:34:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1615462494; x=1646998494; h=from:to:cc:subject:date:message-id:mime-version; bh=HvPfcYFj4XPoYWep6Zg20oC/5mPkWzP11vi0Y2318jU=; b=A96bV8+DNZVEt4O1gamfhgyKWf4TpTk41xZRRpRjdFSfxIvigUhw0j0v becKcp1yjFkawQR1Dvs6OIsFMDuKzEQKLgkhcu8LzIrrONCPEKNTufTvq xB5ZcpiJH/B0HImd77ctRjhynRy7rmnqDgoMy+aS9sS79J0ZlihSabkye /tAAcT9gXf9KVqIO4AicpEwHTEn7yZ84TAqw9bO3jx9Hf2KzgCRSUlhBz Yw64p8qkf8SkFpLJI9CAjiuUHPzRqRASWPqF/lzGAqYCD/5Cz2iKsFHwP A81pnnOtDsdAjRZdl+10Ia3CzasQoljj4F4WGEjtMdSUBjzlIfJmrtT5i w==; IronPort-SDR: iiv06V3/D9GRRIafY9qH66ZUqEw5UbAvWUzf9ayEjuDuFBumj72FDvalulgPbedehJYjKs5yA/ nxet7efZ9Ehl0sDCYUEzxiR28klhNHUHuhvEQE8ycgLRlhAsxvEBVIfsJB/PXa70vfZL3nHbmV w4NIRrUJgGXcJ//iqYSF0+yXA/6Js+A+n2ACUMXkP8VfW9fvQ5mwicH0s4D1pVAAK4N5Qm0sOT 4IOWkRMaIQxEl1cZj+aAf18iuRkHNcdDpDnMSH5gf1wTBoYZZi+VRFkJUQpMXT5QtjAIzQ5rdw nyg= X-IronPort-AV: E=Sophos;i="5.81,240,1610434800"; d="scan'208";a="109596673" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Mar 2021 04:34:52 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 11 Mar 2021 04:34:42 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 11 Mar 2021 04:34:39 -0700 From: To: , , , , , , , , CC: , , , , , , Conor Dooley Subject: [PATCH v4 1/5] mbox: add polarfire soc system controller mailbox Date: Thu, 11 Mar 2021 11:34:39 +0000 Message-ID: <20210311113439.15458-1-conor.dooley@microchip.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_113454_773679_60454477 X-CRM114-Status: GOOD ( 23.42 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley This driver adds support for the single mailbox channel of the MSS system controller on the Microchip PolarFire SoC. Signed-off-by: Conor Dooley --- drivers/mailbox/Kconfig | 12 ++ drivers/mailbox/Makefile | 2 + drivers/mailbox/mailbox-mpfs.c | 277 +++++++++++++++++++++++++++++++++ include/soc/microchip/mpfs.h | 57 +++++++ 4 files changed, 348 insertions(+) create mode 100644 drivers/mailbox/mailbox-mpfs.c create mode 100644 include/soc/microchip/mpfs.h diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig index f4abe3529acd..b37268bd5004 100644 --- a/drivers/mailbox/Kconfig +++ b/drivers/mailbox/Kconfig @@ -160,6 +160,18 @@ config MAILBOX_TEST Test client to help with testing new Controller driver implementations. +config POLARFIRE_SOC_MAILBOX + tristate "PolarFire SoC (MPFS) Mailbox" + depends on HAS_IOMEM + depends on SOC_MICROCHIP_POLARFIRE || COMPILE_TEST + help + This driver adds support for the PolarFire SoC (MPFS) mailbox controller. + + To compile this driver as a module, choose M here. the + module will be called mailbox-mpfs. + + If unsure, say N. + config QCOM_APCS_IPC tristate "Qualcomm APCS IPC driver" depends on ARCH_QCOM || COMPILE_TEST diff --git a/drivers/mailbox/Makefile b/drivers/mailbox/Makefile index 7194fa92c787..c2089f04887e 100644 --- a/drivers/mailbox/Makefile +++ b/drivers/mailbox/Makefile @@ -41,6 +41,8 @@ obj-$(CONFIG_BCM_PDC_MBOX) += bcm-pdc-mailbox.o obj-$(CONFIG_BCM_FLEXRM_MBOX) += bcm-flexrm-mailbox.o +obj-$(CONFIG_POLARFIRE_SOC_MAILBOX) += mailbox-mpfs.o + obj-$(CONFIG_QCOM_APCS_IPC) += qcom-apcs-ipc-mailbox.o obj-$(CONFIG_TEGRA_HSP_MBOX) += tegra-hsp.o diff --git a/drivers/mailbox/mailbox-mpfs.c b/drivers/mailbox/mailbox-mpfs.c new file mode 100644 index 000000000000..7aa6c8c87ea0 --- /dev/null +++ b/drivers/mailbox/mailbox-mpfs.c @@ -0,0 +1,277 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Microchip PolarFire SoC (MPFS) system controller/mailbox controller driver + * + * Copyright (c) 2020 Microchip Corporation. All rights reserved. + * + * Author: Conor Dooley + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SERVICES_CR_OFFSET 0x50u +#define SERVICES_SR_OFFSET 0x54u +#define MAILBOX_REG_OFFSET 0x800u +#define MSS_SYS_MAILBOX_DATA_OFFSET 0u +#define SCB_MASK_WIDTH 16u + +/* SCBCTRL service control register */ + +#define SCB_CTRL_REQ (0) +#define SCB_CTRL_REQ_MASK BIT(SCB_CTRL_REQ) + +#define SCB_CTRL_BUSY (1) +#define SCB_CTRL_BUSY_MASK BIT(SCB_CTRL_BUSY) + +#define SCB_CTRL_ABORT (2) +#define SCB_CTRL_ABORT_MASK BIT(SCB_CTRL_ABORT) + +#define SCB_CTRL_NOTIFY (3) +#define SCB_CTRL_NOTIFY_MASK BIT(SCB_CTRL_NOTIFY) + +#define SCB_CTRL_POS (16) +#define SCB_CTRL_MASK GENMASK(SCB_CTRL_POS + SCB_MASK_WIDTH, SCB_CTRL_POS) + +/* SCBCTRL service status register */ + +#define SCB_STATUS_REQ (0) +#define SCB_STATUS_REQ_MASK BIT(SCB_STATUS_REQ) + +#define SCB_STATUS_BUSY (1) +#define SCB_STATUS_BUSY_MASK BIT(SCB_STATUS_BUSY) + +#define SCB_STATUS_ABORT (2) +#define SCB_STATUS_ABORT_MASK BIT(SCB_STATUS_ABORT) + +#define SCB_STATUS_NOTIFY (3) +#define SCB_STATUS_NOTIFY_MASK BIT(SCB_STATUS_NOTIFY) + +#define SCB_STATUS_POS (16) +#define SCB_STATUS_MASK GENMASK(SCB_STATUS_POS + SCB_MASK_WIDTH, SCB_STATUS_POS) + +struct mpfs_mbox { + struct mbox_controller controller; + struct device *dev; + int irq; + void __iomem *mailbox_base; + void __iomem *int_reg; + struct mbox_chan *chan; + u16 response_size; + u16 response_offset; +}; + +static bool mpfs_mbox_busy(struct mpfs_mbox *mbox) +{ + u32 status; + + status = readl_relaxed(mbox->mailbox_base + SERVICES_SR_OFFSET); + + return status & SCB_STATUS_BUSY_MASK; +} + +static struct mpfs_mbox *mbox_chan_to_mpfs_mbox(struct mbox_chan *chan) +{ + if (!chan) + return NULL; + + return (struct mpfs_mbox *)chan->con_priv; +} + +static int mpfs_mbox_send_data(struct mbox_chan *chan, void *data) +{ + u32 mailbox_val = 0u; + u16 options_select; + u32 tx_trigger; + struct mpfs_mss_msg *msg = data; + struct mpfs_mbox *mbox = mbox_chan_to_mpfs_mbox(chan); + + mbox->response_size = msg->response_size; + mbox->response_offset = msg->response_offset; + + if (mpfs_mbox_busy(mbox)) + return -EBUSY; + + if (msg->cmd_data_size) { + u32 index; + u8 extra_bits = msg->cmd_data_size & 3; + u32 *word_buf = (u32 *)msg->cmd_data; + + for (index = 0; index < (msg->cmd_data_size / 4); index++) + writel_relaxed(word_buf[index], + mbox->mailbox_base + MAILBOX_REG_OFFSET + index * 0x4); + if (extra_bits) { + u8 i; + u8 byte_off = ALIGN_DOWN(msg->cmd_data_size, 4); + u8 *byte_buf = msg->cmd_data + byte_off; + + mailbox_val = readl_relaxed(mbox->mailbox_base + + MAILBOX_REG_OFFSET + index * 0x4); + + for (i = 0u; i < extra_bits; i++) { + mailbox_val &= ~(0xffu << (i * 8u)); + mailbox_val |= (byte_buf[i] << (i * 8u)); + } + + writel_relaxed(mailbox_val, + mbox->mailbox_base + MAILBOX_REG_OFFSET + index * 0x4); + } + } + + options_select = ((msg->mailbox_offset << 7u) | (msg->cmd_opcode & 0x7fu)); + tx_trigger = (options_select << SCB_CTRL_POS) & SCB_CTRL_MASK; + tx_trigger |= SCB_CTRL_REQ_MASK | SCB_STATUS_NOTIFY_MASK; + writel_relaxed(tx_trigger, mbox->mailbox_base + SERVICES_CR_OFFSET); + + return 0; +} + +static inline bool mpfs_mbox_pending(struct mpfs_mbox *mbox) +{ + u32 status; + + status = readl_relaxed(mbox->mailbox_base + SERVICES_SR_OFFSET); + + return !(status & SCB_STATUS_BUSY_MASK); +} + +static void mpfs_mbox_rx_data(struct mbox_chan *chan) +{ + struct mpfs_mbox *mbox = mbox_chan_to_mpfs_mbox(chan); + u32 i; + u16 num_words = ALIGN((mbox->response_size), (4)) / 4U; //TODO better way? + struct mpfs_mss_response *response; + + response = kmalloc(sizeof(*response), GFP_ATOMIC); + response->response_size = mbox->response_size; + response->response_msg = kcalloc(num_words, sizeof(response->response_msg), GFP_ATOMIC); + + if (!response->response_msg) { + dev_err(mbox->dev, "failed to assign memory for response %d\n", -ENOMEM); + return; + } + + if (mpfs_mbox_pending(mbox)) { + for (i = 0; i < num_words; i++) { + response->response_msg[i] = readl_relaxed( + mbox->mailbox_base + MAILBOX_REG_OFFSET + + mbox->response_offset + i * 0x4); + } + } + + mbox_chan_received_data(chan, response); + kfree(response); +} + +static irqreturn_t mpfs_mbox_inbox_isr(int irq, void *data) +{ + struct mbox_chan *chan = data; + struct mpfs_mbox *mbox = mbox_chan_to_mpfs_mbox(chan); + + writel_relaxed(0, mbox->int_reg); + + mpfs_mbox_rx_data(chan); + + mbox_chan_txdone(chan, 0); + return IRQ_HANDLED; +} + +static int mpfs_mbox_startup(struct mbox_chan *chan) +{ + struct mpfs_mbox *mbox = mbox_chan_to_mpfs_mbox(chan); + int ret = 0; + + if (!mbox) + return -EINVAL; + ret = devm_request_irq(mbox->dev, mbox->irq, mpfs_mbox_inbox_isr, 0, "mpfs-mailbox", chan); + if (ret) + dev_err(mbox->dev, "failed to register mailbox interrupt:%d\n", ret); + + return ret; +} + +static void mpfs_mbox_shutdown(struct mbox_chan *chan) +{ + struct mpfs_mbox *mbox = mbox_chan_to_mpfs_mbox(chan); + + devm_free_irq(mbox->dev, mbox->irq, chan); +} + +static const struct mbox_chan_ops mpfs_mbox_ops = { + .send_data = mpfs_mbox_send_data, + .startup = mpfs_mbox_startup, + .shutdown = mpfs_mbox_shutdown, +}; + +static int mpfs_mbox_probe(struct platform_device *pdev) +{ + struct mpfs_mbox *mbox; + struct resource *regs; + struct mbox_chan *chans; + int ret; + + mbox = devm_kzalloc(&pdev->dev, sizeof(*mbox), GFP_KERNEL); + if (!mbox) + return -ENOMEM; + + chans = devm_kzalloc(&pdev->dev, sizeof(*chans), GFP_KERNEL); + if (!chans) + return -ENOMEM; + + mbox->mailbox_base = devm_platform_get_and_ioremap_resource(pdev, 0, ®s); + if (IS_ERR(mbox->mailbox_base)) + return PTR_ERR(mbox->mailbox_base); + + mbox->int_reg = devm_platform_get_and_ioremap_resource(pdev, 1, ®s); + if (IS_ERR(mbox->int_reg)) + return PTR_ERR(mbox->int_reg); + + mbox->irq = platform_get_irq(pdev, 0); + if (mbox->irq < 0) + return mbox->irq; + + mbox->dev = &pdev->dev; + + chans[0].con_priv = mbox; + mbox->controller.dev = mbox->dev; + mbox->controller.num_chans = 1; + mbox->controller.chans = chans; + mbox->controller.ops = &mpfs_mbox_ops; + mbox->controller.txdone_irq = true; + + ret = devm_mbox_controller_register(&pdev->dev, &mbox->controller); + if (ret) { + dev_err(&pdev->dev, "Registering MPFS mailbox controller failed\n"); + return ret; + } + dev_info(&pdev->dev, "Registered MPFS mailbox controller driver\n"); + + return 0; +} + +static const struct of_device_id mpfs_mbox_of_match[] = { + {.compatible = "microchip,polarfire-soc-mailbox", }, + {}, +}; +MODULE_DEVICE_TABLE(of, mpfs_mbox_of_match); + +static struct platform_driver mpfs_mbox_driver = { + .driver = { + .name = "mpfs-mailbox", + .of_match_table = mpfs_mbox_of_match, + }, + .probe = mpfs_mbox_probe, +}; +module_platform_driver(mpfs_mbox_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Conor Dooley "); +MODULE_DESCRIPTION("MPFS mailbox controller driver"); diff --git a/include/soc/microchip/mpfs.h b/include/soc/microchip/mpfs.h new file mode 100644 index 000000000000..b37258afb3f8 --- /dev/null +++ b/include/soc/microchip/mpfs.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * + * Microchip PolarFire SoC (MPFS) + * + * Copyright (c) 2020 Microchip Corporation. All rights reserved. + * + * Author: Conor Dooley + * + */ + +#ifndef __SOC_MPFS_H__ +#define __SOC_MPFS_H__ + +#include +#include + +struct mpfs_sys_controller; + +struct mpfs_mss_msg { + u8 cmd_opcode; + u16 cmd_data_size; + u16 response_size; + u8 *cmd_data; + u16 mailbox_offset; + u16 response_offset; +}; + +struct mpfs_mss_response { + u32 response_status; + u32 *response_msg; + u16 response_size; +}; + +#if IS_ENABLED(CONFIG_POLARFIRE_SOC_SYS_CTRL) + +int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg, + struct mpfs_mss_response *response); + +struct mpfs_sys_controller *mpfs_sys_controller_get(struct device_node *mailbox_node); + +#else + +static int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg, + struct mpfs_mss_response *response) +{ + return -ENOSYS; +} + +struct mpfs_sys_controller *mpfs_sys_controller_get(struct device_node *mailbox_node) +{ + return NULL; +} + +#endif /* if IS_ENABLED(CONFIG_POLARFIRE_SOC_SYS_CTRL) */ + +#endif /* __SOC_MPFS_H__ */ From patchwork Thu Mar 11 11:34:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12130995 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2C57C433E0 for ; Thu, 11 Mar 2021 11:35:12 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 46E8364FAB for ; Thu, 11 Mar 2021 11:35:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46E8364FAB Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=0brEAIzz9IK6pL4EgO8VPXzntAMypl1ue1FP7I6gdzE=; b=TKeBqWnjEyM/XxPOLpQ9cG/FB4 YtkSHBQo28HCwipvszJXTg5sNz2LKFJO6uqyKRqvNtg1tSiTdEbsjCvrF1W+ox1RZ3OeyNHG8d8lR ARDsL30odZrU5kC1BYW0Zx3NOF7jtU6dNON2aoacNk2Le0vqLuBtOkwz/Q3mCj0T3Nh0VsKpXlIFS 0nOVnHFM7y/fLLft4kONS32RKtYMchyhjnT3iS218+W8WlEJDMgBpZJi/SIG1ckDX8S/8+xpsyP55 /8WT55lDlBDpAXYqEP/8j8IpfT/sg87YGRx2OYodupfFjqst90BfyUDsfFDTPRKis0TAfnuya6QCN utb9cKUw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKJam-008wO4-RI; Thu, 11 Mar 2021 11:35:00 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKJag-008wLE-Le for linux-riscv@lists.infradead.org; Thu, 11 Mar 2021 11:34:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1615462494; x=1646998494; h=from:to:cc:subject:date:message-id:mime-version; bh=3k11c8YeXus+tK7ok2phregAe7K4Jc0rVhyjpz+zfN4=; b=1gXKDXJoOP6nrx/R5d5pNMOJoNR6OrK1kM2oL0VHiVImxAHdsF155XhT kiKBsT6+N7pQdcwKfLTo2B/WASh0RezH3CdgAiyXMHx4tvhaXl4I1BFpE ZqrllbpUkh6aFNt7NC3sMUXdbl/E/OOfxBD8QHMNPZDub8P8LUfOv4AqN LWvNuo9pBDL1eWFEeqd7QySjxrC2xRHK2xoIwmg3hidvFsyCeVGpwq2pj Qj7NnyC+4kIN1h2ZHK0c/hwJ7JlZYiEZ52fehJoS0bSGKiGDkoq8bCLWA WSZy4Np203btU++W/PZeO53pGWTlh78tkmZca7mbljF3o7gfoy9GkTMN7 Q==; IronPort-SDR: sor/3bO5PtGp5aHNyPP4xNQvxXLOqdcxkMbHKsuSwVKnUqmTdjf/a5hmxOlIroqddhQJmP2Pkw dIpsJH63Dite+xAcAWtHRX/TCtstfj2suLnaPixZTEjf2MPurSIE5Ff7XQJ2STJVcM1Hm03zuP 2+hY0MpFXnf1brymnGYXoQyyAf5ja236DVsN6SoDDVysXqKv3lO5lUKzsXnTiXaya7u8FdCKC6 UJRJ/4Cpquqs2rIuY9PxC0+CLUBjSe7gyI6dbhCWQBCJvurkx4wLALa+UfRDxkDQ/+U1p3wAmz m/0= X-IronPort-AV: E=Sophos;i="5.81,240,1610434800"; d="scan'208";a="109596674" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Mar 2021 04:34:53 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 11 Mar 2021 04:34:47 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 11 Mar 2021 04:34:44 -0700 From: To: , , , , , , , , CC: , , , , , , Conor Dooley Subject: [PATCH v4 2/5] dt-bindings: add bindings for polarfire soc mailbox Date: Thu, 11 Mar 2021 11:34:44 +0000 Message-ID: <20210311113444.15520-1-conor.dooley@microchip.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_113455_117472_F3C2B2EE X-CRM114-Status: UNSURE ( 9.12 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley Add device tree bindings for the MSS system controller mailbox on the Microchip PolarFire SoC. Signed-off-by: Conor Dooley --- .../microchip,polarfire-soc-mailbox.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/microchip,polarfire-soc-mailbox.yaml diff --git a/Documentation/devicetree/bindings/mailbox/microchip,polarfire-soc-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/microchip,polarfire-soc-mailbox.yaml new file mode 100644 index 000000000000..3df4595ad58a --- /dev/null +++ b/Documentation/devicetree/bindings/mailbox/microchip,polarfire-soc-mailbox.yaml @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/mailbox/microchip,mailbox-mpfs.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) mailbox controller + +maintainers: + - Conor Dooley + +properties: + compatible: + const: microchip,polarfire-soc-mailbox + + reg: + items: + - description: mailbox data registers + - description: mailbox interrupt registers + + interrupts: + maxItems: 1 + + "#mbox-cells": + const: 1 + +required: + - compatible + - reg + - interrupts + - "#mbox-cells" + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + mbox: mailbox@37020000 { + compatible = "microchip,polarfire-soc-mailbox"; + reg = <0x0 0x37020000 0x0 0x1000>, <0x0 0x2000318c 0x0 0x40>; + interrupt-parent = <&L1>; + interrupts = <96>; + #mbox-cells = <1>; + }; + }; From patchwork Thu Mar 11 11:34:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12130999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C387CC433E9 for ; Thu, 11 Mar 2021 11:35:14 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27E8364FAB for ; Thu, 11 Mar 2021 11:35:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27E8364FAB Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=MFl4Qh7pLqj9KOYntzPVWKIi3CRB4yduJv6WYsuLF2w=; b=fbN2HCjvk3U4WHM4fYTzeUBuyV M6XFdv21Yw6toqYsxKFLS8y7alULnyk3DknsVyLzp2nFCGhO6Lj7K6EIiFCtt1wEn5cCEap18muCX 7m3YKHEic62wud2IayFGNDeZhxZyEZxODcHv6Id/2NelVZMEgBF+0uQ/q+zQurqoXicPFQFqzATRH gHz2hGTZWBpA8QCLVr29xrXpCFHBLSWh7ejugLpOLBSE8TdycV1o9TpZplIH7RkCma9DoYAMoaFH1 6F8yqQ1GKDBzyBucpl/zj3ZqeAD+mSwGOT0a4e7Ej8d4CxunmwaEd9G07mWZk2se7SFJZ+3gCOcQR VyyrTqzQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKJap-008wOS-2w; Thu, 11 Mar 2021 11:35:03 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKJah-008wM8-Nq for linux-riscv@lists.infradead.org; Thu, 11 Mar 2021 11:34:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1615462496; x=1646998496; h=from:to:cc:subject:date:message-id:mime-version; bh=y7l8G1+5HbIBT2hDfIBapXv+QC26EzTlQD3nPWXvO/Q=; b=0OzdkVWCIjk1V0bGzpOsoEwGMv17WJjOvWkwcJX+gSFTyzVWlsiMBlMh awuX4LtJLYokT3sHF2Dgvt8+7cE++zKdLyoAoXU4iGf2LOGYOyigvnkcJ NButxzME4ymeen7nHyUUEVOB/nxGeKV+fWdAJXJMzpBuxbWBbD5P4gzGu Iv0DhF/zjxzeeCm9oUaEXs8yJhxKfwTwtlUVNWK2P14iTz5ZYgs3zLDeY zh8UU9+GKgzP1sYavAjby56nrqdY5VH+ym8i42kfAAAKTL4z1Z+jJbNvW B93XPEetmG//tdo41OjJqq373PpdPjPX0c366yAnID+mxZm1cH+dyZqEg A==; IronPort-SDR: YCHrjmjZDj0H/ShfcpSIH4NQKe2yV8EiV0tvnUU8BEzxwwwl3lyHHR6K/3v2ZC7RcUh089A3Lj mJ0FL3RnYu9XDY73s+yMC717YpQnNAK0/cKK0K2kIraKbyYuVQMb+gzSuiY7LBER+GLWdF1tde RaTmTVo5qOoB3Eb1FEQUKE+wuODsA/CNAT+K1Vl/MUBomOlqGaIYMqPm/WOySyi4EaS3wNsL5z XmtAZ78vOTwG+XPgAJIgSlNCo8eiK85Co7FbpHh7MuQBX3R21xqJYvhUU84Mh0HHus/UCM51Cu vHg= X-IronPort-AV: E=Sophos;i="5.81,240,1610434800"; d="scan'208";a="109596677" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Mar 2021 04:34:53 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 11 Mar 2021 04:34:52 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 11 Mar 2021 04:34:49 -0700 From: To: , , , , , , , , CC: , , , , , , Conor Dooley Subject: [PATCH v4 3/5] soc: add polarfire soc system controller Date: Thu, 11 Mar 2021 11:34:49 +0000 Message-ID: <20210311113449.15623-1-conor.dooley@microchip.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_113456_274299_39CAB578 X-CRM114-Status: GOOD ( 20.39 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley This driver provides an interface for other drivers to access the functions of the system controller on the Microchip PolarFire SoC. Signed-off-by: Conor Dooley --- drivers/soc/Kconfig | 1 + drivers/soc/Makefile | 1 + drivers/soc/microchip/Kconfig | 10 ++ drivers/soc/microchip/Makefile | 1 + drivers/soc/microchip/mpfs-sys-controller.c | 127 ++++++++++++++++++++ 5 files changed, 140 insertions(+) create mode 100644 drivers/soc/microchip/Kconfig create mode 100644 drivers/soc/microchip/Makefile create mode 100644 drivers/soc/microchip/mpfs-sys-controller.c diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig index e8a30c4c5aec..b33142e020e0 100644 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig @@ -12,6 +12,7 @@ source "drivers/soc/imx/Kconfig" source "drivers/soc/ixp4xx/Kconfig" source "drivers/soc/litex/Kconfig" source "drivers/soc/mediatek/Kconfig" +source "drivers/soc/microchip/Kconfig" source "drivers/soc/qcom/Kconfig" source "drivers/soc/renesas/Kconfig" source "drivers/soc/rockchip/Kconfig" diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile index f678e4d9e585..10cfdcd972c7 100644 --- a/drivers/soc/Makefile +++ b/drivers/soc/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_ARCH_IXP4XX) += ixp4xx/ obj-$(CONFIG_SOC_XWAY) += lantiq/ obj-$(CONFIG_LITEX_SOC_CONTROLLER) += litex/ obj-y += mediatek/ +obj-y += microchip/ obj-y += amlogic/ obj-y += qcom/ obj-y += renesas/ diff --git a/drivers/soc/microchip/Kconfig b/drivers/soc/microchip/Kconfig new file mode 100644 index 000000000000..eb656b33156b --- /dev/null +++ b/drivers/soc/microchip/Kconfig @@ -0,0 +1,10 @@ +config POLARFIRE_SOC_SYS_CTRL + tristate "POLARFIRE_SOC_SYS_CTRL" + depends on POLARFIRE_SOC_MAILBOX + help + This driver adds support for the PolarFire SoC (MPFS) system controller. + + To compile this driver as a module, choose M here. the + module will be called mpfs_system_controller. + + If unsure, say N. diff --git a/drivers/soc/microchip/Makefile b/drivers/soc/microchip/Makefile new file mode 100644 index 000000000000..14489919fe4b --- /dev/null +++ b/drivers/soc/microchip/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_POLARFIRE_SOC_SYS_CTRL) += mpfs-sys-controller.o diff --git a/drivers/soc/microchip/mpfs-sys-controller.c b/drivers/soc/microchip/mpfs-sys-controller.c new file mode 100644 index 000000000000..21a1e213d2bd --- /dev/null +++ b/drivers/soc/microchip/mpfs-sys-controller.c @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Microchip PolarFire SoC (MPFS) system controller driver + * + * Copyright (c) 2020 Microchip Corporation. All rights reserved. + * + * Author: Conor Dooley + * + */ + +#include +#include +#include +#include +#include +#include +#include + +static DEFINE_MUTEX(transaction_lock); + +struct mpfs_sys_controller { + struct mbox_client client; + struct mbox_chan *chan; + struct completion c; + u32 enabled; + struct mpfs_mss_response *response; +}; + +int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg, + struct mpfs_mss_response *response) +{ + int ret; + + mpfs_client->response = response; + + mutex_lock_interruptible(&transaction_lock); + + reinit_completion(&mpfs_client->c); + + ret = mbox_send_message(mpfs_client->chan, msg); + if (ret >= 0) { + if (wait_for_completion_timeout(&mpfs_client->c, HZ)) { + ret = 0; + } else { + ret = -ETIMEDOUT; + dev_warn(mpfs_client->client.dev, "MPFS sys controller transaction timeout\n"); + } + } else { + dev_err(mpfs_client->client.dev, + "mpfs sys controller transaction returned %d\n", ret); + } + + mutex_unlock(&transaction_lock); + + return ret; +} +EXPORT_SYMBOL(mpfs_blocking_transaction); + +static void rx_callback(struct mbox_client *client, void *msg) +{ + struct mpfs_sys_controller *mpfs_client = + container_of(client, struct mpfs_sys_controller, client); + struct mpfs_mss_response *response = (struct mpfs_mss_response *)msg; + + memcpy(mpfs_client->response->response_msg, response->response_msg, + mpfs_client->response->response_size); + mpfs_client->response = response->response_status; + complete(&mpfs_client->c); +} + +static int mpfs_sys_controller_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct mpfs_sys_controller *mpfs_client; + + mpfs_client = devm_kzalloc(dev, sizeof(*mpfs_client), GFP_KERNEL); + if (!mpfs_client) + return -ENOMEM; + + mpfs_client->client.dev = dev; + mpfs_client->client.rx_callback = rx_callback; + mpfs_client->client.tx_block = 1U; + + mpfs_client->chan = mbox_request_channel(&mpfs_client->client, 0); + if (IS_ERR(mpfs_client->chan)) + return dev_err_probe(dev, PTR_ERR(mpfs_client->chan), + "Failed to get mbox channel\n"); + + init_completion(&mpfs_client->c); + + platform_set_drvdata(pdev, mpfs_client); + + dev_info(&pdev->dev, "Registered MPFS system controller driver\n"); + + return 0; +} + +struct mpfs_sys_controller * +mpfs_sys_controller_get(struct device_node *mss_node) +{ + struct platform_device *pdev = of_find_device_by_node(mss_node); + + if (!pdev) + return NULL; + + return platform_get_drvdata(pdev); +} +EXPORT_SYMBOL(mpfs_sys_controller_get); + +static const struct of_device_id mpfs_sys_controller_of_match[] = { + {.compatible = "microchip,polarfire-soc-sys-controller", }, + {}, +}; +MODULE_DEVICE_TABLE(of, mpfs_sys_controller_of_match); + +static struct platform_driver mpfs_sys_controller_driver = { + .driver = { + .name = "mpfs-sys-controller", + .of_match_table = mpfs_sys_controller_of_match, + }, + .probe = mpfs_sys_controller_probe, +}; +module_platform_driver(mpfs_sys_controller_driver); + +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Conor Dooley "); +MODULE_DESCRIPTION("MPFS system controller driver"); From patchwork Thu Mar 11 11:34:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12131001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8EB0C433DB for ; Thu, 11 Mar 2021 11:35:18 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52A6C64FAF for ; Thu, 11 Mar 2021 11:35:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52A6C64FAF Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=zFrhoXjfhgXF1pl4HubYrJe2Jvg+deK7FiTA8aZ7nWM=; b=rhLjBml/JL2CccNDIB0zh5fBnN V4+4BwO7qm+Mrgkf3CgDiC8wYDmyy+blMvCKsl809HlSQ3k5yyR5AxBy/b/U6UtIEn+KaejuwIn5j iUuTO8tw8WgW/jHieO8a9R6Khxv7HTe5D+2/56N+95FOzFBjreg5C2nvEMCAcECq+05RGAGrKr6+l cFUO4Wxm+JaLYDpGT/a2vVjJLCAcG1yHSmxkGXvKH9QT/RNrDJCUW3Eb1PlvWXek7htRfxRbSM0qg RoyYXqvJT/mNpGw+3ANE3VDeqMZarM4RZYWg/766kTZoDRVW/9eGMjI8+n5GUAYkWKl7PC6b3kb4x V0Ycqb+Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKJat-008wQL-4t; Thu, 11 Mar 2021 11:35:07 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKJao-008wOI-OW for linux-riscv@lists.infradead.org; Thu, 11 Mar 2021 11:35:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1615462502; x=1646998502; h=from:to:cc:subject:date:message-id:mime-version; bh=/Q3CbZMigNRMc8Ni/1jEWfGJuPFmb81SMKV+Zu5whXw=; b=DEi18DK4w6ULZriZwTtDF21Vx6hGAdchwhLUErpnX/qPAyyEDZnUKGan GvUlKHjwmwaIOT3dIYa8fb0Sie3tJAtP1S5PZQmJENeikiPSkwbArlsp3 zq8EmigAqgI04bFx+s7DQ1InHdyRXR0ZODj9kqWT4HmCgA42DmdRKCj6i nEj6RKdaSD2vhl5PglrRRdag3f1Otl36PQtaoDbKyoobsrVz3ldjLXM+M rhJ+g99fo2fJr5haOiAn336rv/8ewGlMp0XsoRLvk4a5wmRwrI9U3CoEv TBVv1hsfADuBcTEg/oJxWYnx5GoSoLdh8bDm18iKk4FxBKT7lzt1Zwarf g==; IronPort-SDR: adx3ckL3oGtWsAKJEBInA2tt5qwlr1dTcMs/Oi+Yqu9HG7tcTk+/DP2Cf1IMhlhbkdhPHt1d1q xPNL1eP6k1kLyem7l05ZNmiF2Dd9VPVyjS66O5hzhxOWj93tNJlUZUCimqxBu08yTv5TUCI8Iw ieSyU+KYXDzHDPrqgTZfSLC9hk4/yg1IxJMT/vNnUKU3rlWO4ZqoBH71LfcBbkQyiM1xazmcWR ic98Kwt5k5wgnSAMlQwEnd6Gb3zfZMWERyBzpfeMCAZt4PTiyBkYtO7i3piRTRY/deZiL48kWr izc= X-IronPort-AV: E=Sophos;i="5.81,240,1610434800"; d="scan'208";a="47116550" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Mar 2021 04:35:00 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 11 Mar 2021 04:34:59 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 11 Mar 2021 04:34:57 -0700 From: To: , , , , , , , , CC: , , , , , , Conor Dooley Subject: [PATCH v4 4/5] dt-bindings: add bindings for polarfire soc system controller Date: Thu, 11 Mar 2021 11:34:56 +0000 Message-ID: <20210311113456.15686-1-conor.dooley@microchip.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_113503_138167_3406971F X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley Add device tree bindings for the MSS system controller on the Microchip PolarFire SoC. Signed-off-by: Conor Dooley --- ...icrochip,polarfire-soc-sys-controller.yaml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/microchip/microchip,polarfire-soc-sys-controller.yaml diff --git a/Documentation/devicetree/bindings/soc/microchip/microchip,polarfire-soc-sys-controller.yaml b/Documentation/devicetree/bindings/soc/microchip/microchip,polarfire-soc-sys-controller.yaml new file mode 100644 index 000000000000..222557f96a13 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/microchip/microchip,polarfire-soc-sys-controller.yaml @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/soc/microchip/microchip,polarfire-soc-sys-controller.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) system controller + +maintainers: + - Conor Dooley + +description: | + The PolarFire SoC system controller can be accessed as a mailbox device. + This document describes the bindings for that device. + + +properties: + + allOf: + - $ref: /schemas/mbox/mbox-consumer.yaml#properties + + compatible: + const: microchip,polarfire-soc-sys-controller + +required: + - compatible + - mboxes + +additionalProperties: false + +examples: + - | + syscontroller: syscontroller { + compatible = "microchip,polarfire-soc-sys-controller"; + mboxes = <&mbox 0>; + }; From patchwork Thu Mar 11 11:35:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12131003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37147C433DB for ; Thu, 11 Mar 2021 11:35:46 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3FCA64FAF for ; Thu, 11 Mar 2021 11:35:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3FCA64FAF Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=i2rOctJBDUhnVbKh+CMN2I2TAaL32IHHNCQ4nxTMYaI=; b=ETLt/rQxT7JibY6gnsGVAyrmF5 IS1c27Wc5KTkSax6+ZzuXbpTxpAM0D+cp9wWnM5wPRYj3AP52Dxd0ONUGsZVW4UvIt8vkddKaNK8+ CSiSAQkEwIwWAVlbu+QimzeAbfqEFTmNl4d1jsNWa2RpCYQBhHjnPP9RLLOJoQkYPbZsPcyJDvwQR sjZA7y58sbA8/YI9b0iNFMPpxVJ66ZxJe2yRo5+8K1J5rWWFLRoQ9VUV9aqBjl8k3EDJiZ4SS6pu4 dVDhtE662mEwdveTaSfwQXbqeAViNliJaYW50hAlVvkB1AbN928Od4CZfhPh4tnd5T6iP85QTNE9c U/IRUqFA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKJbI-008wYS-BA; Thu, 11 Mar 2021 11:35:32 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKJbE-008wXH-JR for linux-riscv@lists.infradead.org; Thu, 11 Mar 2021 11:35:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1615462528; x=1646998528; h=from:to:cc:subject:date:message-id:mime-version; bh=0SiAXxZU9xTZalFZ8LLDzB+0PPRiu5p6gIrxTDHRm1M=; b=eA3DkwFNzdBuuemXqDuACNUFGe2HiJGNDO9ynYzEOkb74VEw6I9IV0Xe vXNxSncPi9xqC52NAHZOh8y4SSSfZfUbIhcn0NtbN+SL0EMKNUHWwBMrn 2ibuqpd+LdtCc1C5J7u1XywECLXsh1k7AA6s61xHUqqVM1g9akjs06M/+ tc6huC5xDYFyo2Ta8JLHqbnVf8kX0h3S64cRSTLpQHkjgMtzwu56S6B03 vv/RsDHHWmyyVPSrZ4y/LwmTSUozRyLYpBiT6hRfVDCGfULdZk/ES9rWp xQ0+T6RfeCGC+qcWYGWs68qJYhyhz9ve5wm/6uMVc5kbCD5BLkbESR6ly g==; IronPort-SDR: bZV3bhP16BqEqeySiF0SRfMpRSH9/C260M5QPO1Ov2ytY6MZNVM6HOpR9vaNUr72m64oXzggua BMGqgy23VsiaumpmWjfuketMhWwMlngz/ljJuDTSMrxPNrz4qRILPlfWqTIIBj/lYcEF2VFMnp tEObe/cM/KI67STDcV84PjoOu4R8fDUeRDWhkr02sL71/NhUeIYqK6li2hVJV+V246jM+QIUhW 1IzxVA1SCF6mhXSc5wOUut8s60zfp2jGyjrgqgY0UtXp/4qsdVJdKXwH/2nEpsN6xts7lI/grz ir8= X-IronPort-AV: E=Sophos;i="5.81,240,1610434800"; d="scan'208";a="112819487" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Mar 2021 04:35:26 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 11 Mar 2021 04:35:04 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Thu, 11 Mar 2021 04:35:02 -0700 From: To: , , , , , , , , CC: , , , , , , Conor Dooley Subject: [PATCH v4 5/5] MAINTAINERS: add entry for polarfire soc mailbox driver Date: Thu, 11 Mar 2021 11:35:01 +0000 Message-ID: <20210311113501.15745-1-conor.dooley@microchip.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_113528_978195_93A16F21 X-CRM114-Status: UNSURE ( 6.61 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley Add the mailbox driver to the existing MAINTAINERS entry for the polarfire soc Signed-off-by: Conor Dooley --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 04590ba30340..a7d9e6f720ad 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15363,6 +15363,7 @@ M: Lewis Hanly M: Cyril Jean L: linux-riscv at lists.infradead.org S: Supported +F: drivers/mailbox/mailbox-mpfs.c F: drivers/soc/microchip/ F: include/soc/microchip/mpfs.h