From patchwork Mon Mar 11 22:18:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thor Thayer X-Patchwork-Id: 10848331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C8971515 for ; Mon, 11 Mar 2019 22:16:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51E36292C7 for ; Mon, 11 Mar 2019 22:16:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4546729371; Mon, 11 Mar 2019 22:16:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C8C84292C7 for ; Mon, 11 Mar 2019 22:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=XMz6ZzcSFULNaSRbPA9vMTugp7m1bCUBTtN6l+M1rgc=; b=uet i0eu4kHSDrVpUK+pJpustz2hWjTCtpX0NCgspEbM9lfoMJyTTPSC8RsAPnRmJmZpvIcSE0ps3uqnH ovYQSSymI+FwpbOkAojxjymY+yHmWFqhXID0FOVZWeyBQSMl3ziPbuvnSQq0dRKBpfKNIVfmfZhOx lEOX8tVjnsP9/vjavnL6E3nRQU80ggwYfcralZL+T/BlAPjSXaG8/eVetdE9vyjW5cByIk1rPWHS0 plZ0/FHliHVfBDEb3CAxxOMnciCNEkZss09fG9toieywZkJOIzR1RUNctBjGbmqgpyLqL43YmKjV3 7I5i3q4mSvTNkwRivqKdvLBuneBOV+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3TDB-0007U5-Se; Mon, 11 Mar 2019 22:15:57 +0000 Received: from mga05.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3TD9-0007TI-2x for linux-arm-kernel@lists.infradead.org; Mon, 11 Mar 2019 22:15:56 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2019 15:15:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,468,1544515200"; d="scan'208";a="141133769" Received: from tthayer-hp-z620.an.intel.com ([10.122.105.146]) by orsmga002.jf.intel.com with ESMTP; 11 Mar 2019 15:15:52 -0700 From: thor.thayer@linux.intel.com To: lee.jones@linaro.org, arnd@arndb.de, dinguyen@kernel.org, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com, olof@lixom.net Subject: [RESEND PATCHv4 0/6] Add SOCFPGA System Manager Date: Mon, 11 Mar 2019 17:18:02 -0500 Message-Id: <1552342688-6663-1-git-send-email-thor.thayer@linux.intel.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190311_151555_137151_E4EB8BF4 X-CRM114-Status: GOOD ( 11.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, Thor Thayer , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, mcoquelin.stm32@gmail.com, mchehab+samsung@kernel.org, davem@davemloft.net, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thor Thayer Add MFD driver for SOCFPGA System Manager to handle System Manager calls differently for ARM32 vs ARM64. The SOCFPGA System Manager includes registers from several SOC peripherals. On ARM32, syscon handles this aggregated register grouping. Implement System Manager calls as regmap_mmio similar to syscon for ARM32 SOCFPGA systems. The ARM64 System Manager can only be accessed from priority level EL3 so this new MFD driver handles the calls to EL3. v2 Changes: Change socfpga_is_s10() to check compatible string. Add new compatible string for Stratix10 in bindings and add proper detection method. Replace base cast with resource_size_t member. Change s10_sysmgr_regmap_cfg to altr_sysmgr_regmap_cfg to be generic. Always use 4 byte width. Initialize the .reg_read and .reg_write in S10 case only. Remove call to syscon in 32bit ARM case and handle both ARM32 and ARM64 in of_sysmgr_register(). Replace IS_ERR_OR_NULL() with IS_ERR(). Remove compatible check functions except phandle function. v3 Changes: Create and register regmap in probe(). Lookup functions find registered regmap. Cleanup of header file. Fix copyright dates. Replace global pointer with traditional probe() methodology. v4 Changes: Add missing of_node_put(). Add Reviewed-by from v2 for devicetree patch Add Acked-by for net patch Thor Thayer (6): mfd: altera-sysmgr: Add SOCFPGA System Manager Documentation: dt: socfpga: Add S10 System Manager binding ARM: socfpga_defconfig: Enable CONFIG_MTD_ALTERA_SYSMGR arm64: defconfig: Enable CONFIG_MTD_ALTERA_SYSMGR net: stmmac: socfpga: Use shared System Manager driver arm64: dts: stratix10: New System Manager compatible .../bindings/arm/altera/socfpga-system.txt | 12 ++ MAINTAINERS | 6 + arch/arm/configs/socfpga_defconfig | 1 + arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 2 +- arch/arm64/configs/defconfig | 1 + drivers/mfd/Kconfig | 10 + drivers/mfd/Makefile | 1 + drivers/mfd/altera-sysmgr.c | 211 +++++++++++++++++++++ .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 5 +- include/linux/mfd/altera-sysmgr.h | 29 +++ 10 files changed, 275 insertions(+), 3 deletions(-) create mode 100644 drivers/mfd/altera-sysmgr.c create mode 100644 include/linux/mfd/altera-sysmgr.h Reviewed-by: Arnd Bergmann