From patchwork Tue Dec 1 11:02:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 11942685 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=-15.4 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, UNWANTED_LANGUAGE_BODY,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 540A6C64E7B for ; Tue, 1 Dec 2020 11:02:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 940EA206CB for ; Tue, 1 Dec 2020 11:02:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="L255gSgN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="wXbWtrHW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 940EA206CB 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=Vm7XbxnbAF3rrrSwRLJ5Lax37cov0IyQvdn5Hea4EEQ=; b=L255gSgNjh95I+jN0nzarf2ZJA UxyP/IpjnjMk1GTJoa055qofkVaNzGiSZ/ktFZikaKoinHW2AYb8qAx1vpV47g9ogVQ/WAfU5coF4 yPH6DJFhSp1zSL3O+2PD1u6QrKh5yL+JD4jsO+eKipEOXgAE2hWnjCvG2RJ6zPFXpHb/A17UmVGbv A7u9AgQcXOF45zkmnQtUSzdKHNluLv8U2x5iRhL9Jm+cuMbl6d2LKfFx1WQS7zP40bwn9e9YNaJBF W3luzhWCIO6iUHa23TtUgUy7fbR3edxEONRQ79h+WUwF3aqysnhuKnkgcX65idv5NdaASnLD+Sn47 c0xYwK2A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3Qp-0004HD-6d; Tue, 01 Dec 2020 11:02:51 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3Qn-0004GF-5h for linux-riscv@lists.infradead.org; Tue, 01 Dec 2020 11:02:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1606820569; x=1638356569; h=from:to:cc:subject:date:message-id:mime-version; bh=TzoHd8I4u2+/+v0zhzlXi6LqlLClLcqizItaKVCOV6g=; b=wXbWtrHW5IZF1PcMkBdc6+gYn6lfCuiVbaqm9PAyT7LsCdoetY3wCSpN 89qpdLOR2VvfjcdMFyR6Nk6s77U41UI3esYhGUmZ46YxF+tf2bOtMSdYv THrm6OyJFLvB2qsPwyhAXBB4kW9r+AH0FXcH7JtIUrNo7kGxI0tS4l5K8 LSeP/wRsrCR5P0MdFtDpu6uXbmIPSsFURmjIEnzu6y5bgSlBiKlPt0Z5Z W311xVrCFsGHvvvMJykUAm3D1GiTFBg53Xh6G3CTh8Tu9zi5A3LdAaUrA kSQ0T0LqPwoHYMDLPi8SCN3Q0Tm7wl0ek2QrQig8zauIMhjalQxAtUPx+ w==; IronPort-SDR: 4lYMsp5ZGQwZhaWzu1SVPUIaHHLw9UfPq+rgOR5+kfcQs6OWawiTAp3UO++86S7j4EYU6Vt+iG /Kg9DUEtmPLM5t+XimNhvVI2xhYe/jGWK/Ecuf26PvL9+WrZRz8VSv4z2LuoYwsMheNvqBlcBw YtfWFl3Qed0n0AMOqqbI3XKXb1tRdDDlWVv8LCoDCtagz00eFCs9Mp3aL6O0qNJ/2+GTl/KM4t /qV2gcj86XdR3kC/3w/H406hEm7LF3M61Q5V1YgTM7qRgy73YSgCT4lL+0M/JvoGHP/RHtRZnL 640= X-IronPort-AV: E=Sophos;i="5.78,384,1599548400"; d="scan'208";a="100384360" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Dec 2020 04:02:47 -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.1979.3; Tue, 1 Dec 2020 04:02:45 -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.1979.3 via Frontend Transport; Tue, 1 Dec 2020 04:02:43 -0700 From: To: , , , , , , , Subject: [PATCH v2 1/5] mbox: add polarfire soc system controller mailbox Date: Tue, 1 Dec 2020 11:02:42 +0000 Message-ID: <20201201110242.28369-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-20201201_060249_387588_4D57002A X-CRM114-Status: GOOD ( 24.30 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cyril.jean@microchip.com, david.abdurachmanov@gmail.com, daire.mcnamara@microchip.com, anup.patel@wdc.com, atish.patra@wdc.com, Conor Dooley , lewis.hanly@microchip.com 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 | 285 +++++++++++++++++++++++++++++++++ include/soc/microchip/mpfs.h | 51 ++++++ 4 files changed, 350 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 05b1009e2820..fbf6902c3541 100644 --- a/drivers/mailbox/Kconfig +++ b/drivers/mailbox/Kconfig @@ -153,6 +153,18 @@ config MAILBOX_TEST Test client to help with testing new Controller driver implementations. +config MPFS_MBOX + tristate "MPFS Mailbox" + depends on HAS_IOMEM + depends on SOC_MICROCHIP_POLARFIRE || COMPILE_TEST + help + This driver adds support for the Polarfire SoC 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 2e06e02b2e03..63f49b5bcc43 100644 --- a/drivers/mailbox/Makefile +++ b/drivers/mailbox/Makefile @@ -39,6 +39,8 @@ obj-$(CONFIG_BCM_PDC_MBOX) += bcm-pdc-mailbox.o obj-$(CONFIG_BCM_FLEXRM_MBOX) += bcm-flexrm-mailbox.o +obj-$(CONFIG_MPFS_MBOX) += 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..e1ecf3081312 --- /dev/null +++ b/drivers/mailbox/mailbox-mpfs.c @@ -0,0 +1,285 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Microchip 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_BUSY -EBUSY +#define MSS_SYS_PARAM_ERR -EINVAL +#define MSS_SYS_MAILBOX_DATA_OFFSET 0u +#define SCB_MASK_WIDTH 16u +/* SCBCTRL service control register */ + +#define SCB_CTRL_REQ (0u) +#define SCB_CTRL_REQ_MASK BIT(SCB_CTRL_REQ) + +#define SCB_CTRL_BUSY (1u) +#define SCB_CTRL_BUSY_MASK BIT(SCB_CTRL_BUSY) + +#define SCB_CTRL_ABORT (2u) +#define SCB_CTRL_ABORT_MASK BIT(SCB_CTRL_ABORT) + +#define SCB_CTRL_NOTIFY (3u) +#define SCB_CTRL_NOTIFY_MASK BIT(SCB_CTRL_NOTIFY) + +#define SCB_CTRL_POS (16u) +#define SCB_CTRL_MASK GENMASK(SCB_CTRL_POS+SCB_MASK_WIDTH, SCB_CTRL_POS) + +/* SCBCTRL service status registers */ + +#define SCB_STATUS_REQ (0u) +#define SCB_STATUS_REQ_MASK BIT(SCB_STATUS_REQ) + +#define SCB_STATUS_BUSY (1u) +#define SCB_STATUS_BUSY_MASK BIT(SCB_STATUS_BUSY) + +#define SCB_STATUS_ABORT (2u) +#define SCB_STATUS_ABORT_MASK BIT(SCB_STATUS_ABORT) + +#define SCB_STATUS_NOTIFY (3u) +#define SCB_STATUS_NOTIFY_MASK BIT(SCB_STATUS_NOTIFY) + +#define SCB_STATUS_POS (16u) +#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 || !chan->con_priv) + return NULL; + + return (struct mpfs_mbox *)chan->con_priv; +} + +static int mpfs_mbox_send_data(struct mbox_chan *chan, void *data) +{ + u32 index; + u32 *word_buf; + u8 *byte_buf; + u8 byte_off; + u8 i; + u32 mailbox_val = 0u; + u16 mb_offset; + u16 mbox_options_select; + u32 mbox_tx_trigger; + struct mpfs_mss_msg *msg = data; + struct mpfs_mbox *mbox = mbox_chan_to_mpfs_mbox(chan); + mb_offset = msg->mailbox_offset; + mbox->response_size = msg->response_size; + mbox->response_offset = msg->response_offset; + + if (mpfs_mbox_busy(mbox)) + return MSS_SYS_BUSY; + + mbox_options_select = ((mb_offset << 7u) | (msg->cmd_opcode & 0x7fu)); + mbox_tx_trigger = (((mbox_options_select << SCB_CTRL_POS) & + SCB_CTRL_MASK) | SCB_CTRL_REQ_MASK | SCB_STATUS_NOTIFY_MASK); + + /* Code for MSS_SYS_PARAM_ERR is not implemented with this version of driver. */ + + writel_relaxed(0x0u, mbox->int_reg); + + if (msg->cmd_data_size) { + byte_buf = (u8 *)(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); + } + + if ((msg->cmd_data_size % 4) > 0) { + byte_off = (((msg->cmd_data_size / 4) * 4)); + byte_buf = (u8 *)(msg->cmd_data + byte_off); + + mailbox_val = readl_relaxed(mbox->mailbox_base + + MAILBOX_REG_OFFSET + index); + + for (i = 0u; i < (msg->cmd_data_size % 4u); i++) { + mailbox_val &= ~(0xffu << (i * 8u)); + mailbox_val |= (byte_buf[i] << (i * 8u)); + } + + writel_relaxed(mailbox_val, mbox->mailbox_base + MAILBOX_REG_OFFSET + index); + } + } + + writel_relaxed(mbox_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 *data; + u32 i; + u32 response_limit; + + data = devm_kzalloc(mbox->dev, sizeof(*data) * mbox->response_size, GFP_ATOMIC); + if (!data) + dev_err(mbox->dev, "failed to register mailbox interrupt:%d\n", -ENOMEM); + + response_limit = (mbox->response_size) + (mbox->response_offset); + if (mpfs_mbox_pending(mbox) && mbox->response_size > 0U) { + for (i = (mbox->response_offset); i < response_limit; i++) { + data[i - (mbox->response_offset)] = + readl_relaxed(mbox->mailbox_base + MAILBOX_REG_OFFSET + i * 0x4); + } + } + + mbox_chan_received_data(chan, (void *)data); + devm_kfree(mbox->dev, data); +} + +static irqreturn_t mpfs_mbox_inbox_isr(int irq, void *data) +{ + struct mbox_chan *chan = (struct mbox_chan *)data; + struct mpfs_mbox *mbox = mbox_chan_to_mpfs_mbox(chan); + + writel_relaxed(0x0U, 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..b231f39f32eb --- /dev/null +++ b/include/soc/microchip/mpfs.h @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * + * Microchip MPFS mailbox + * + * 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; +}; + +#if IS_ENABLED(CONFIG_MPFS_SYS_CONTROLLER) + +int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg, + void *response, u16 response_size_bytes); + +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, + void *response, u16 response_size_bytes) +{ + return -ENOSYS; +}; + +struct mpfs_sys_controller *mpfs_sys_controller_get(struct device_node *mailbox_node) +{ + return NULL; +} + +#endif /* IS_ENABLED(CONFIG_MPFS_SYS_CONTROLLER) */ + +#endif /* __SOC_MPFS_H__ */ From patchwork Tue Dec 1 11:02:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 11942687 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=-18.2 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 55F62C64E7B for ; Tue, 1 Dec 2020 11:03:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 C77D320809 for ; Tue, 1 Dec 2020 11:03:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MW0Tg0ip"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="zJjBKH5S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C77D320809 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=FEx3aPqp4ZfIBjzOP8t8uxDYGeufnRObHpvjRZ7ovI4=; b=MW0Tg0ipSGQaETrOLADAQEr//s dq7+4i0qH3f/24Z2bwSSIlRbAva8YzqnhD4r8ilWKRzZVm5UPjIZ4n/LAtLQjHiO7fEhn5QqpInrp OEIy4OFHCD1z4keSopTbjVc0MPip1peIFSnSZ3g8G+XtnpbE73luy73bhsFke7bQ6/7QZx1/v3zYS vRUdbXbo52cCdmySb3Hg+Ljva1CHeAjNQdQJZ6+C2TRYVKMj5UNh8QIEDDJVVJa2o7np+99dgeSFY 80vR8jNzzO+0K+ij/ND+nSOjUAQVPz9iyRsj+5RbkERegGmkMUeY1QnRB0vqOJpa0PoSZOR8bHv4M qyh6KGHQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3Qw-0004JI-2s; Tue, 01 Dec 2020 11:02:58 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3Qt-0004GF-0Y for linux-riscv@lists.infradead.org; Tue, 01 Dec 2020 11:02:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1606820575; x=1638356575; h=from:to:cc:subject:date:message-id:mime-version; bh=jauox//ePXwP8SQPPfgfnZWRrEQXHbn0G2vtEiP850Q=; b=zJjBKH5SzoJQNVF6CTiWxXKUUrleDco1zzmR1mriGnwhchtL3s5RMojW 8ofve6MKQl39o/oYL1BOqkuiVicbEqOLpvSqdLwc64s+oQaCtPITrl27O z+cTJB22HvlNsZWKyvMjhbgrZmK5O0U/xcvmB8TtqJt0y9Ba7TRbAhfWV myXls06MqaGHTOA7ojImBeGSm6M6TBjHieAf9mrNVmj7S9oIiBbfrISe0 QXKkzX2e9scKdKMo364aYgZO8ZUU5rpjsfAl0pdtNA7Z+EQeL04ipQg7i 4KZ8SmIwxy5eRpTviXMQjrKnpQ8l2qd89RHMgfq2HHvfgFrhioXc0uBvy w==; IronPort-SDR: g7ol6B/HiOtIXty1iGzh01UtKvV2emKXDEs83RkaHo7bz43lfncXmP9GQlXcqriQuNgGrx+7cD EvvuJVWwr6QBw2Bi548AvMvl3erZgBvMcCdGMSDkxRpNUY57txYURhgG6hriS/3DBiLFhx7wUx b8+TvhT/SbnkGmczohjoRl9osVOckAEOP2ecCt5xz8XxvfBDr+oAtUmGGQoCe79/za/zNHmt6Y htnsLyCjcqp2VsNBiPKi1E18QxoHvQhEkrNoW9B8MLxoJq0PKZacUmN7BteaST2DPoN2O9sSUd J28= X-IronPort-AV: E=Sophos;i="5.78,384,1599548400"; d="scan'208";a="100384391" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Dec 2020 04:02:54 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 1 Dec 2020 04:02:53 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Tue, 1 Dec 2020 04:02:51 -0700 From: To: , , , , , , , Subject: [PATCH v2 2/5] dt-bindings: add bindings for polarfire soc mailbox Date: Tue, 1 Dec 2020 11:02:50 +0000 Message-ID: <20201201110250.28437-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-20201201_060255_270818_128CB04A X-CRM114-Status: GOOD ( 10.51 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cyril.jean@microchip.com, david.abdurachmanov@gmail.com, daire.mcnamara@microchip.com, anup.patel@wdc.com, atish.patra@wdc.com, Conor Dooley , lewis.hanly@microchip.com 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 Reviewed-by: Rob Herring --- .../mailbox/microchip,mpfs-mailbox.yaml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/microchip,mpfs-mailbox.yaml diff --git a/Documentation/devicetree/bindings/mailbox/microchip,mpfs-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/microchip,mpfs-mailbox.yaml new file mode 100644 index 000000000000..9c522a088d55 --- /dev/null +++ b/Documentation/devicetree/bindings/mailbox/microchip,mpfs-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,mpfs-mailbox.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Microchip MPFS mss mailbox controller + +maintainers: + - Conor Dooley + +properties: + compatible: + const: microchip,polarfire-soc-mailbox + + reg: + items: + - description: mailbox data registers + - description: mailbox int 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 Tue Dec 1 11:02:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 11942689 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=-18.2 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 36CACC64E7B for ; Tue, 1 Dec 2020 11:03:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 A26AA206CB for ; Tue, 1 Dec 2020 11:03:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kBDq0c6w"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="bjKBu2Mg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A26AA206CB 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=nCG8op2SsvnhTw33+UJnWvY6Hw/G08qjvl2oZuhRe0k=; b=kBDq0c6woq36NgX01qT9IQoP8M nHacsXNRzKcfCb9UEDHG5p3kK56lui8Yc+naGbZykH9EUY2MG7q+RVtHg1WOyTIFSkLGmSwODqzbk zi3YQRfVfJieHJkotQwYnF4+7+ywuLNfOPERzcDaTZtun+DHE3AaEqaIrvXf4DJFmgDf1Dfw+wq9W vrHzYJZb40oIfgM/U7oZSdTYGIVjgnASIAKyNqWZCwdIel+3cnEntMK45coSDmrOLE8uGhxmRNKyh zweOfVVT4jRGboVly+6ly8BNAqVV+YTLkhX2LFeYj4dItNxDu6PM7b3VCjkuX3gfpzYdxeS9dRCYS eFdpkxAA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3R5-0004Lj-NA; Tue, 01 Dec 2020 11:03:07 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3R2-0004KT-K7 for linux-riscv@lists.infradead.org; Tue, 01 Dec 2020 11:03:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1606820584; x=1638356584; h=from:to:cc:subject:date:message-id:mime-version; bh=BoS/sUtRsDsVazptW1C9NuUYpvVb7rt+lBZV6YSjOrE=; b=bjKBu2Mg3o6Y8vVdVbiqOpJBN3AnpoIAxUZg976ORIdCeQvjqAtimiDt ZjoAgmiZcQMBU8Pxeqw5xh5mRtxK16bUWiNEKhYVtnM1vZIk/ic3YC5wI NsOCKWUN7ui2dC8e0l++Zg5nQvIuEiKkX7pkGsaw21S8L9r8P/TPrHCyT T88OedycOTno0a5tDIYCqvcbkCv/7IUlEKs4S9xru2fBFzjyLaaz2dih9 2QXd5bDvC0a5vIXiReVftwgSZI3VqIHUzgQptsYLz6016fPSh0Ed+0lfn FoEtSiZXBS+l6aeXKbWfn+vwDCGR7/quSyms4fVNFD+7pWieO1hEek600 w==; IronPort-SDR: oVAAE7anvCS35EzR01DXkPS00NWEu92aX56+jdTITM8WVhfkwYvj+jG1XURFbPgpNW+ZD7UkIt NXRxpdBxdKR9490KVsZVJbxzee4xlY3YEJzUugoPbnmSnTiKJ3WoHGjS72C4x4DMmA2qNTwymf XnyS9sIvoCYbXXHO/2/vymeGNtfpkdmJy46JwrPUQIlrT+7ERa79NpYc/oFmOEjRo9ucJn+8ap +EiHLEEhx+0gsPdHbBfayN6aOzZwLYo3oOoOA+TfldU7RqA1+a9vNORfl+TOov8b1audeOzuqj KqE= X-IronPort-AV: E=Sophos;i="5.78,384,1599548400"; d="scan'208";a="98113697" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Dec 2020 04:03:01 -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.1979.3; Tue, 1 Dec 2020 04:03:00 -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.1979.3 via Frontend Transport; Tue, 1 Dec 2020 04:02:58 -0700 From: To: , , , , , , , Subject: [PATCH v2 3/5] soc: add polarfire soc system controller Date: Tue, 1 Dec 2020 11:02:57 +0000 Message-ID: <20201201110257.28507-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-20201201_060304_829349_061424CC X-CRM114-Status: GOOD ( 21.09 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cyril.jean@microchip.com, david.abdurachmanov@gmail.com, daire.mcnamara@microchip.com, anup.patel@wdc.com, atish.patra@wdc.com, Conor Dooley , lewis.hanly@microchip.com 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 | 135 ++++++++++++++++++++ 5 files changed, 148 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 425ab6f7e375..22cb097bcbdc 100644 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig @@ -9,6 +9,7 @@ source "drivers/soc/bcm/Kconfig" source "drivers/soc/fsl/Kconfig" source "drivers/soc/imx/Kconfig" source "drivers/soc/ixp4xx/Kconfig" +source "drivers/soc/microchip/Kconfig" source "drivers/soc/mediatek/Kconfig" source "drivers/soc/qcom/Kconfig" source "drivers/soc/renesas/Kconfig" diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile index 36452bed86ef..fb084cf2d12e 100644 --- a/drivers/soc/Makefile +++ b/drivers/soc/Makefile @@ -14,6 +14,7 @@ obj-$(CONFIG_ARCH_GEMINI) += gemini/ obj-y += imx/ obj-$(CONFIG_ARCH_IXP4XX) += ixp4xx/ obj-$(CONFIG_SOC_XWAY) += lantiq/ +obj-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += microchip/ obj-y += mediatek/ obj-y += amlogic/ obj-y += qcom/ diff --git a/drivers/soc/microchip/Kconfig b/drivers/soc/microchip/Kconfig new file mode 100644 index 000000000000..40e5203c8ba0 --- /dev/null +++ b/drivers/soc/microchip/Kconfig @@ -0,0 +1,10 @@ +config MPFS_SYS_CONTROLLER + tristate "MPFS_SYS_CONTROLLER" + depends on MPFS_MBOX + help + This driver adds support for the Polarfire SoC 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..23b1f42a37db --- /dev/null +++ b/drivers/soc/microchip/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_MPFS_SYS_CONTROLLER) += 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..875a0671e196 --- /dev/null +++ b/drivers/soc/microchip/mpfs_sys_controller.c @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Microchip 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; + void *response; + u16 response_size_bytes; +}; + +int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg, + void *response, u16 response_size_bytes) +{ + int ret; + + mpfs_client->response = response; + mpfs_client->response_size_bytes = response_size_bytes; + + 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"); + } + } else { + dev_err(mpfs_client->client.dev, + "mpfs sys controller transaction returned %d\r\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); + + memcpy(mpfs_client->response, (u8 *)msg, + mpfs_client->response_size_bytes); + + 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_byname(&mpfs_client->client, + "mbox-mpfs"); + if (IS_ERR(mpfs_client->chan)) { + int ret = PTR_ERR(mpfs_client->chan); + + if (ret != -EPROBE_DEFER) + dev_err(dev, "Failed to get mbox channel: %d\n", ret); + return ret; + } + + 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 Tue Dec 1 11:03:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 11942691 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=-18.2 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 66F7AC64E7B for ; Tue, 1 Dec 2020 11:03:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 DAEA6206CB for ; Tue, 1 Dec 2020 11:03:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ijaRFbJ5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="xtczivcN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAEA6206CB 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=LbbH985Z9UkZgl2RlwFzCc5ytNup2pzwIvdg4UMTIOk=; b=ijaRFbJ5C9xvheISR+3xf78CUB aDwzOANVUBD4uHJoRampJ7+0kd/33kXRF/skQQkb6czUoWF3BeCITwTX9+0zn9Xb8JlSEOkLmuRbU JgvdYLOqqKPaqwm/sr4fZx9E4MhNdJopXBRX6FYgTonWXFekELOlrh0b1RcImjGQSXB5pmuSwM2y2 KNqcO8AkIqU5/vW8Xvv2TCodDvcnM7IHI2X/TpqacUbMzwEu1A7UzX5H4x3fBC2XmIS1l+RIqlKCD vydmZ9McinONj41qZtIczGNouaxSJpnO60OP3Cb7GS9MjZE1WnLFV0eWdFp48NiFD3RxOSF5Y4ety FjJxhk2A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3RH-0004Of-H4; Tue, 01 Dec 2020 11:03:19 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3RF-0004O0-NZ for linux-riscv@lists.infradead.org; Tue, 01 Dec 2020 11:03:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1606820597; x=1638356597; h=from:to:cc:subject:date:message-id:mime-version; bh=zk6cCCU/8Jv26b10IZeTDqLo8b7LPtw6jb4oI3S6LZI=; b=xtczivcN0qMyxvUUGdkMB63ahpygx3HE4u2Y5XDzwf590l3zHuBCN4mq ViT7rpOgfUfZJLOA2qax7cXE1ohwPuuH4dM1oC61VwQSovwrsQVuDaLsB ul9BFhwHe7onqneQry0vSt+ZQz5iqLILz1Yx3bDOPWPFXszAEwTrbdw2P 4gaYSHVwIk+toj7ewEskT0X4BRd4oFcq2G0VTUptktcuEbBx0MbmpTDu3 +AnYeZBh35so0Y5CinVDPY9tCJww3jwNSGWg4TUNsvUstDD/8cSZ9Bh0u UX3WlZQCzZdLP7ETzS+t8IXD3Lzbdwl6fvI+DIT+qWSRiqHP3m+Lngk7o w==; IronPort-SDR: JwDo0qO8c99jbTxsf4lX33LeU4TSjCrnKpqFI99uYXOfoFeY+Tx0u5Zl6RZke/aGm5rAuNnQkh lQ9sWbQ15Uq1llGtmp9qV/6xumrC8pWrA4TfPzz4zDmFC2PPQofTu+XAftDlAoI93//Sakdxda Ce9//DI9jVxesrlkqUSwWs8WMkz9m7S/zFl6vC2kiqCtXwmheC2TO236fUKU/9I+mNYzf+bqJi OImrMyjCEjqOnW1kYRzUhVltssDTFTBIUyKwpW5c/V1wY67EKsTzYC2w4mkrkxfFi8W0ORSciL v7k= X-IronPort-AV: E=Sophos;i="5.78,384,1599548400"; d="scan'208";a="100945431" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Dec 2020 04:03:14 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 1 Dec 2020 04:03:14 -0700 Received: from wendy.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Tue, 1 Dec 2020 04:03:12 -0700 From: To: , , , , , , , Subject: [PATCH v2 4/5] dt-bindings: add bindings for polarfire soc system controller Date: Tue, 1 Dec 2020 11:03:11 +0000 Message-ID: <20201201110311.28593-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-20201201_060317_910654_FBE4ED2B X-CRM114-Status: GOOD ( 11.23 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cyril.jean@microchip.com, david.abdurachmanov@gmail.com, daire.mcnamara@microchip.com, anup.patel@wdc.com, atish.patra@wdc.com, Conor Dooley , lewis.hanly@microchip.com 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 --- .../microchip,mpfs_sys_controller.yaml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/microchip/microchip,mpfs_sys_controller.yaml diff --git a/Documentation/devicetree/bindings/soc/microchip/microchip,mpfs_sys_controller.yaml b/Documentation/devicetree/bindings/soc/microchip/microchip,mpfs_sys_controller.yaml new file mode 100644 index 000000000000..c22fc203b95c --- /dev/null +++ b/Documentation/devicetree/bindings/soc/microchip/microchip,mpfs_sys_controller.yaml @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/soc/microchip/microchip,mpfs_sys_controller.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Microchip MPFS system controller + +maintainers: + - Conor Dooley + +properties: + compatible: + const: microchip,polarfire-soc-sys-controller + + mbox-names: + maxItems: 1 + description: name of the mailbox controller device node + + mboxes: + maxItems: 1 + description: | + phandle and index of the mailbox controller device node. It must be 0 (hardware supports only one channel). + + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + +required: + - compatible + - mbox-names + - "#address-cells" + - "#size-cells" + - "mboxes" + +additionalProperties: false + +examples: + - | + syscontroller: syscontroller { + compatible = "microchip,polarfire-soc-sys-controller"; + #address-cells = <1>; + #size-cells = <1>; + mbox-names = "mbox-mpfs"; + mboxes = <&mbox 0>; + }; From patchwork Tue Dec 1 11:03:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 11942693 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=-18.2 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 4C947C83017 for ; Tue, 1 Dec 2020 11:03:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 9FA802080A for ; Tue, 1 Dec 2020 11:03:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bW8mKNCk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="PPcmCu/c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FA802080A 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=QwrxA246aqCM8/I/nBm98O5CtlS8u2eJXaNatGujeE8=; b=bW8mKNCkhABiRVwy6wgl2DChfS wBnPMeUr6S4In/nX7n66lSpahNep1jqVmqZcq9aDveR9QIShISM8bdX9/vx+vmwK9jMn/laGWJAUe Jl8Jla7k9fCpKnvaygWCRooWormZfCYTIzqgpkA3rV3SkFZgaetn1FFgAgsxVX9ARvWMSbhGzDMH0 sQQBXqqewScmW2YcC2b0RcMw1mJE7ADUJ4ckyJN0wHQJpIL19IeT+WAfAQoiBKmdX+KfF0b7HFW2V 9YfgbEVVCYl5H5NdC4MFbHW1zym5yJsd77V0i9m3TKwiGqojkfqpLScgfQri0y15OLFWQTqmGt4fo UiRchHbg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3RR-0004SI-23; Tue, 01 Dec 2020 11:03:29 +0000 Received: from esa3.microchip.iphmx.com ([68.232.153.233]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kk3RN-0004Qi-Mi for linux-riscv@lists.infradead.org; Tue, 01 Dec 2020 11:03:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1606820605; x=1638356605; h=from:to:cc:subject:date:message-id:mime-version; bh=21fm/s2a10024hJyayAnBeJLM14GpJpHzPwsgaQUW9U=; b=PPcmCu/c6aHYkFqH/dA0AzNokPsOJaqBmnvZSBQQ5TflpHfg6xC7kp78 bvj1aNz6gvv9RTNZwvIyqftNfJG6G8zaJFm25AbiYIXK3EUvfltcQMiGz xOdfqmfSzQrgzvAt+3LzpCkg96IBHRkP+XRTgEv88sJUMqMsGYjZaB22Z EDmjYfaATE5szuTwhXmB9zkNghNkExHMpejIj5J23omZ6NcLa/FwhNxSx +QwV19qPSlnJppBv7e5vOiBT2Mw5BM+MFBuklh4aT+fBuRuclp8VGpy7k t6oOliA0oGeKwgx9VoQl81wot9XtcfMUZ7TIGSsnbK06uWSQz092I/25E A==; IronPort-SDR: 1OYou1MdYQAQHhN+oytf220YFG6dvyBEvttP9dqsGqe5oVAbCJfhX/uQCq8LzHyVUdhh9jlZjP bOkBdSOA6B3Q2wWgGOeKk8YijdBVben2dKp+Fy2crxFjx/EultzKIJBbwJ0j/WaY7hhRfkm8DT ei1A8tvR++zYwZ/+FXbUKyr1wJ+yteCaT31dC0TXZxpIL5qWJJAsD5DbXC902glflUDlWcG6Yu RVrC+0DOnbFPJ4C2hzWQVeDkfoBDvdTk8ByiBGQAnWCrAaE198GrU8W5Owt0S0JO9+mYpYYqBF bPc= X-IronPort-AV: E=Sophos;i="5.78,384,1599548400"; d="scan'208";a="100945453" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 01 Dec 2020 04:03:21 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 1 Dec 2020 04:03:19 -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.1979.3 via Frontend Transport; Tue, 1 Dec 2020 04:03:17 -0700 From: To: , , , , , , , Subject: [PATCH v2 5/5] MAINTAINERS: add microchip polarfire soc support Date: Tue, 1 Dec 2020 11:03:16 +0000 Message-ID: <20201201110316.28656-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-20201201_060325_969931_6B7AFAAD X-CRM114-Status: UNSURE ( 7.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: cyril.jean@microchip.com, david.abdurachmanov@gmail.com, daire.mcnamara@microchip.com, anup.patel@wdc.com, atish.patra@wdc.com, Conor Dooley , lewis.hanly@microchip.com Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Conor Dooley Add Cyril Jean and Lewis Hanly as maintainers for the Microchip SoC directory Signed-off-by: Conor Dooley --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2daa6ee673f7..2241bdac4816 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14989,6 +14989,15 @@ F: arch/riscv/ N: riscv K: riscv +RISC-V/MICROCHIP POLARFIRE SOC SUPPORT +M: Lewis Hanly +M: Cyril Jean +L: linux-riscv@lists.infradead.org +S: Supported +F: drivers/mailbox/mailbox-mpfs.c +F: drivers/soc/microchip/ +F: include/soc/microchip/mpfs.h + RNBD BLOCK DRIVERS M: Danil Kipnis M: Jack Wang