From patchwork Fri Sep 13 12:11:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gareth Williams X-Patchwork-Id: 11144559 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4950112B for ; Fri, 13 Sep 2019 12:12:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE57D208C0 for ; Fri, 13 Sep 2019 12:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729725AbfIMMMh (ORCPT ); Fri, 13 Sep 2019 08:12:37 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:15933 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726822AbfIMMMh (ORCPT ); Fri, 13 Sep 2019 08:12:37 -0400 X-IronPort-AV: E=Sophos;i="5.64,501,1559487600"; d="scan'208";a="26313260" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 13 Sep 2019 21:12:34 +0900 Received: from renesas-VirtualBox.ree.adwin.renesas.com (unknown [10.226.37.56]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 03D714001DDD; Fri, 13 Sep 2019 21:12:32 +0900 (JST) From: Gareth Williams To: Mark Brown , Rob Herring , Mark Rutland Cc: Phil Edworthy , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Gareth Williams Subject: [PATCH 1/3] dt: spi: Add Renesas RZ/N1 binding documentation Date: Fri, 13 Sep 2019 13:11:58 +0100 Message-Id: <1568376720-7402-2-git-send-email-gareth.williams.jx@renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568376720-7402-1-git-send-email-gareth.williams.jx@renesas.com> References: <1568376720-7402-1-git-send-email-gareth.williams.jx@renesas.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org From: Phil Edworthy The Renesas RZ/N1 SPI Controller is based on the Synopsys DW SSI, but has additional registers for software CS control and DMA. This patch does not address the changes required for DMA support, it simply adds the compatible string. The CS functionality is not very useful and also not needed as Linux can use gpios for the CS signals. Add a compatible string to handle any unforeseen issues that may arise, and pave the way for DMA support. Signed-off-by: Gareth Williams Signed-off-by: Phil Edworthy --- Note: All the other manufacturers detail their compatible strings in snps,dw-apb-ssi.txt. I think it makes sense for rzn1 to be in it's own file due to the changes made to the peripheral for DMA support. --- Documentation/devicetree/bindings/spi/renesas,rzn1-spi.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/renesas,rzn1-spi.txt diff --git a/Documentation/devicetree/bindings/spi/renesas,rzn1-spi.txt b/Documentation/devicetree/bindings/spi/renesas,rzn1-spi.txt new file mode 100644 index 0000000..fb1a672 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/renesas,rzn1-spi.txt @@ -0,0 +1,11 @@ +Renesas RZ/N1 SPI Controller + +This controller is based on the Synopsys DW Synchronous Serial Interface and +inherits all properties defined in snps,dw-apb-ssi.txt except for the +compatible property. + +Required properties: +- compatible : The device specific string followed by the generic RZ/N1 string. + Therefore it must be one of: + "renesas,r9a06g032-spi", "renesas,rzn1-spi" + "renesas,r9a06g033-spi", "renesas,rzn1-spi" From patchwork Fri Sep 13 12:11:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gareth Williams X-Patchwork-Id: 11144561 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7931614E5 for ; Fri, 13 Sep 2019 12:12:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61EA82089F for ; Fri, 13 Sep 2019 12:12:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729763AbfIMMMv (ORCPT ); Fri, 13 Sep 2019 08:12:51 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:36084 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729760AbfIMMMu (ORCPT ); Fri, 13 Sep 2019 08:12:50 -0400 X-IronPort-AV: E=Sophos;i="5.64,500,1559487600"; d="scan'208";a="26532336" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 13 Sep 2019 21:12:48 +0900 Received: from renesas-VirtualBox.ree.adwin.renesas.com (unknown [10.226.37.56]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 870DE4007F39; Fri, 13 Sep 2019 21:12:47 +0900 (JST) From: Gareth Williams To: Mark Brown Cc: Phil Edworthy , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Gareth Williams Subject: [PATCH 2/3] spi: dw: Add basic runtime PM support Date: Fri, 13 Sep 2019 13:11:59 +0100 Message-Id: <1568376720-7402-3-git-send-email-gareth.williams.jx@renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568376720-7402-1-git-send-email-gareth.williams.jx@renesas.com> References: <1568376720-7402-1-git-send-email-gareth.williams.jx@renesas.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org From: Phil Edworthy Enable runtime PM so that the clock used to access the registers in the peripheral is turned on using a clock domain. Signed-off-by: Phil Edworthy Signed-off-by: Gareth Williams --- drivers/spi/spi-dw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 9a49e07..593bbb0 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -497,6 +498,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) if (dws->set_cs) master->set_cs = dws->set_cs; + pm_runtime_enable(dev); + pm_runtime_get_sync(dev); + /* Basic HW init */ spi_hw_init(dev, dws); From patchwork Fri Sep 13 12:12:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gareth Williams X-Patchwork-Id: 11144563 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 69F9914E5 for ; Fri, 13 Sep 2019 12:13:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 529302089F for ; Fri, 13 Sep 2019 12:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729805AbfIMMNE (ORCPT ); Fri, 13 Sep 2019 08:13:04 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:46470 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729760AbfIMMNE (ORCPT ); Fri, 13 Sep 2019 08:13:04 -0400 X-IronPort-AV: E=Sophos;i="5.64,501,1559487600"; d="scan'208";a="26313271" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 13 Sep 2019 21:13:03 +0900 Received: from renesas-VirtualBox.ree.adwin.renesas.com (unknown [10.226.37.56]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 04D1D4001DDD; Fri, 13 Sep 2019 21:13:01 +0900 (JST) From: Gareth Williams To: Mark Brown Cc: Phil Edworthy , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Gareth Williams Subject: [PATCH 3/3] spi: dw: Add compatible string for Renesas RZ/N1 SPI Controller Date: Fri, 13 Sep 2019 13:12:00 +0100 Message-Id: <1568376720-7402-4-git-send-email-gareth.williams.jx@renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568376720-7402-1-git-send-email-gareth.williams.jx@renesas.com> References: <1568376720-7402-1-git-send-email-gareth.williams.jx@renesas.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org From: Phil Edworthy The Renesas RZ/N1 SPI Controller is based on the Synopsys DW SSI, but has additional registers for software CS control and DMA. This patch does not address the changes required for DMA support, it simply adds the compatible string. The CS registers are not needed as Linux can use gpios for the CS signals. Signed-off-by: Gareth Williams Signed-off-by: Phil Edworthy --- drivers/spi/spi-dw-mmio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index edb3cf6..3640b01 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -225,6 +225,7 @@ static const struct of_device_id dw_spi_mmio_of_match[] = { { .compatible = "mscc,ocelot-spi", .data = dw_spi_mscc_ocelot_init}, { .compatible = "mscc,jaguar2-spi", .data = dw_spi_mscc_jaguar2_init}, { .compatible = "amazon,alpine-dw-apb-ssi", .data = dw_spi_alpine_init}, + { .compatible = "renesas,rzn1-spi", }, { /* end of table */} }; MODULE_DEVICE_TABLE(of, dw_spi_mmio_of_match);