From patchwork Tue May 11 15:38:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Conor Dooley X-Patchwork-Id: 12251411 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=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 DF951C433ED for ; Tue, 11 May 2021 15:38:41 +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 BD161616EB for ; Tue, 11 May 2021 15:38:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD161616EB 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=48zkZhO934fdF/v0HUTam5VPEGOdTpAsUJ+hD6VH/SE=; b=bfzp7laDEmT+orP+aSYR9xtjyO l1DsAjHDatAMY0yeoivfGud22ElklI2Xs7H3ob648mzUgudHVbzz9CQL5UAYoMKg2oMyOAi1AH5Kg R3a4YuBIW+YvM0Vao4q8KlxrXe0m+nCMF6IgZ+wpwXIQ8sMb7T/LsWJ7pjkar62VpHOoPjA3CZHQz b/t7l54aZynrZgUO7CyYXc4UoyYXac9Kzm1544VADdPCBvN1cPgJvDNg7+mfAx76khB/B6kw1F29X Pa+ydoStykgKuEIOPEMVy7D+A4btpluoDdQyorjvBzYaRpg4ZN24LXoTJIA/OR223Ax9X00468wIY fkijraEw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgUSg-000cpt-J7; Tue, 11 May 2021 15:38:18 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgUSf-000cpZ-6n for linux-riscv@desiato.infradead.org; Tue, 11 May 2021 15:38:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=KaWDJcmf0akmgDM4xkDbgfWR/MHkDDuIHvhuIJq81co=; b=EWKvw0XcSjQEgQ1M4ToNvdSzoo OiSzoz6AV0t0Jqe0Nxtn9tJoNmgF6gJ5ZXc8wgy7M0ZIxblAeNRewdjBCW2A2mfX4lzk/Lt40C7Vr USCp91wQX21+C6CKSyT5ngV0Zat6CoV4zDzDwgECTIi3UmehtiKNcX6FTgJMWeXAUAj65McNF3FUU YKxmGJvj87WQZch9vxLzKtXuY/d7suvDtmQ9rU2mtlr9WyHdBlMe2xGw2UyLxPihiADfCt5H2IMBD 4Jnsrayt3Sm+YWu7iF/AA+cJ6i7sR2U6cXvDAVhbt6299z/uCw+UodH82Bbdwp/rOAK7Dgg1cAQu4 BLayUuAA==; Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgUSc-009ivQ-Ct for linux-riscv@lists.infradead.org; Tue, 11 May 2021 15:38:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1620747494; x=1652283494; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XOB1CwGDTbBnyoCClAe5S5eJtfPOnOb+M6/jGa4fYXc=; b=z22ff8TZWw/MaeKJ13/U45AjFr8BUGZuV0am9KU8P7JkWWzxdXuwW1JN vsUGWX6Vh5WlE60qVL1EWlj4dGxdE9I2CFrMDTbi+uPh7B+Ge6kAUSUwe czgRyOpjsNgcfRdNfBrqlkO0FAyxYxxJJr02+ehUiofjjZOdsSVmlTR/J AaWbVcF9gGHCzzji+J7WUbWV3YocY5HPP5plGvQyLpVk1xcUx7AZjCzF7 pUHdnmEtiZw+QW3NXIR7KBPfJqnfrvw8GgPyvi5VOhm0RJ0UuF2iQ/zPv gRTgNZhqQw6ywdsxAMuofYCRLKEslARx7nvvPofsvRTZE7B+uBqB0ghhz Q==; IronPort-SDR: KaQgM2P0FsZgAgXNspFkNpN6ghIYODJTqUu8jTXYLf10Z9X6W86WGq59c0HVzep0tVryCEBwB9 EX7xWKlnaJ2YOlLjryKOMQfgGbfDyPfbdjlCXwhpeNx0YpFX7JsPnpPKLna6hkf/boRpXrSsVu eJdk1a4oUqL/TO4owbUGKpVj9xKD5GwwIu4V4ujJaFv/s4j+hNXdNS7tfCHm5uQC65bVHeaiwI K+j9gvNTgOVKxUbGqPJ4PY8Xp6D0HCzwcoOiqh8uWd3U+BuIRZ1KEqsnNwB/ESNgQ0uw0M1Z9W TCM= X-IronPort-AV: E=Sophos;i="5.82,291,1613458800"; d="scan'208";a="120686633" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 May 2021 08:38:13 -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; Tue, 11 May 2021 08:38:12 -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; Tue, 11 May 2021 08:38:09 -0700 From: To: , , , , , , , , CC: , , , , , , Conor Dooley Subject: [PATCH v7 0/5] Add support for the PolarFire SoC system controller Date: Tue, 11 May 2021 16:38:09 +0100 Message-ID: <20210511153809.24760-1-conor.dooley@microchip.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210511_083814_506055_EADAD132 X-CRM114-Status: GOOD ( 14.05 ) 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 patch series adds support for the system controller on the PolarFire SoC, using the mailbox framework. A Microchip directory in the SoC subsystem has been created to hold the mailbox client driver and will be used for future service drivers. These drivers are gated by the kconfig option: CONFIG_SOC_MICROCHIP_POLARFIRE, so this patch series depends on Atish Patra's PolarFire SoC support patches which introduce it (this series is now in 5.13-rc1). The following link, which is a direct download of a pdf, contains documentation for the system controller: https://www.microsemi.com/document-portal/doc_download/1244853-ug0905-polarfire-soc-fpga-system-services-user-guide Changes from v6: * Re-add the maintainers section that was removed from base pfsoc support patch series * Removed Cyril Jean from maintainers entry. Changes from v5: * Removed excess functions, cleanup in mailbox-mpfs.c Changes from v4: * Changed dt binding from Rob Herring's feedback * Shortened some verbose variable names * Reordered binding patches * Write directly into response array, rather than allocate in controller isr and memcpy in client Changes from v3: * Fixed mboxes reference in dt binding for mailbox client * Bug fixes and cleanup from Jonathan Neuschäfer's feedback on mailbox-mpfs.c & mpfs-sys-controller.c * Renamed dt binding files to match compatible strings * Removed PFSoC gating condition on drivers/soc/microchip subdirectory * Converted all size based operations to bytes for consistency * Converted response array to a structure, enabling support for more complex services that return a status instead of/alongside a payload. Changes from v2: * Further reworked dt bindings to satisfy errors and feedback (hopefully phandle array is the correct type for the mboxes) * Full maintainers entry moved to Atish's PFSoC support series, this series now only adds mailbox driver * Converted config options from MPFS to POLARFIRE_SOC so they are more recognisable * Further simplified driver code from feedback Changes from v1: * Squashed header into first patch * Fixed DT binding warnings & small fixes * Cleaned up drivers from feedback Conor Dooley (5): dt-bindings: add bindings for polarfire soc mailbox mbox: add polarfire soc system controller mailbox dt-bindings: add bindings for polarfire soc system controller soc: add polarfire soc system controller MAINTAINERS: add entry for polarfire soc mailbox .../microchip,polarfire-soc-mailbox.yaml | 47 ++++ ...icrochip,polarfire-soc-sys-controller.yaml | 35 +++ MAINTAINERS | 8 + drivers/mailbox/Kconfig | 12 + drivers/mailbox/Makefile | 2 + drivers/mailbox/mailbox-mpfs.c | 251 ++++++++++++++++++ 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 | 119 +++++++++ include/soc/microchip/mpfs.h | 56 ++++ 12 files changed, 543 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/microchip,polarfire-soc-mailbox.yaml create mode 100644 Documentation/devicetree/bindings/soc/microchip/microchip,polarfire-soc-sys-controller.yaml create mode 100644 drivers/mailbox/mailbox-mpfs.c create mode 100644 drivers/soc/microchip/Kconfig create mode 100644 drivers/soc/microchip/Makefile create mode 100644 drivers/soc/microchip/mpfs-sys-controller.c create mode 100644 include/soc/microchip/mpfs.h