From patchwork Tue Jul 24 11:27:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Sverdlin X-Patchwork-Id: 10541899 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 2E5AF184F for ; Tue, 24 Jul 2018 11:28:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C95E28747 for ; Tue, 24 Jul 2018 11:28:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E94A2874E; Tue, 24 Jul 2018 11:28:36 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD68E28747 for ; Tue, 24 Jul 2018 11:28:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388360AbeGXMee (ORCPT ); Tue, 24 Jul 2018 08:34:34 -0400 Received: from mail-db5eur01on0124.outbound.protection.outlook.com ([104.47.2.124]:17248 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388236AbeGXMee (ORCPT ); Tue, 24 Jul 2018 08:34:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qxGv6DXt3VkbvRmuCmk+vN6teds7a4z+OiaewhJGWOU=; b=cXEQp+/lbtasyBdoZAMGwCAXRyhQE7JXwcgfU1otYzIuhQvpplyUO29KXlTCKtxje0XtyGXQAgQVeGJT1I9dJFuTh0czMaXyM0C9B1usrghrBHSVghVzOqUJF3IrcmMyucsPebbPleOhs7ilHimx8JN2JxmC/ETCgq+wZaJwPbo= Received: from ulegcpsvdell.emea.nsn-net.net (131.228.2.20) by VI1PR07MB3983.eurprd07.prod.outlook.com (2603:10a6:803:39::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.4; Tue, 24 Jul 2018 11:28:13 +0000 From: Alexander Sverdlin To: linux-spi@vger.kernel.org, devicetree@vger.kernel.org Cc: Alexander Sverdlin , Mark Brown , Rob Herring , Mark Rutland Subject: [PATCH] spi: pl022: Add OF binding to disable DMA usage Date: Tue, 24 Jul 2018 13:27:53 +0200 Message-Id: <20180724112753.6020-1-alexander.sverdlin@nokia.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [131.228.2.20] X-ClientProxiedBy: AM4PR0101CA0075.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::43) To VI1PR07MB3983.eurprd07.prod.outlook.com (2603:10a6:803:39::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 862b6272-b3ad-489d-8ada-08d5f1588b90 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7193020);SRVR:VI1PR07MB3983; X-Microsoft-Exchange-Diagnostics: 1;VI1PR07MB3983;3:g+xtreUPotDStfRjR1/NT5QI4LQ42RWADo2TS6v+xIVzrEhGBxUtWEMryUhuN0l7BZ4O9ZXvfFImFg7gcqkkJsCugU+mdcK395O0E6pIOvYMyX2H595L/4oe2aAOe2JKtrIAnevJvTeXTUp1X9/irWoN+4O/8xu494ao0BiA2MgQPzoi3S41ohbEK9g84dMGcUNsVLt1lksr3Y101MIIIaxyg8j/gLXyEDeYMiOk5TVQ6yEtHP7kSxTQuLPWYccu;25:p9MXnlh4Fp5E7YY4KsYp+FtCIj+fDPKjbfcCZxtdn7MYtbRxN4Z1XjxWKwS5Su2U2IYSqnfj8vg45OzxfZjzdrixjXj9TumwqAKLdnkJ1Fx7NJJd/dBVdwFMmcEBSmtaEtHuVjAC9iQPV3mYWZMHZkEHCWyKxjUrGfbikpsGHCkiLwJwijYLrbW00UXDRKkO5rdrSozEndpBIhcwzh4UWcVEL3kc6baYP4M295fY/q8XcnOSy8g8hCEUfjfZjofsgPhmDOntWlaMzoDtdO2xVvgUtBB0cO5OM18/knONN0eEJrX/nojMhAqqSEX5AMYvZaCp59QKYHmxCHQpgCsK/w==;31:jDlbOMHKr6aGtuuj+BuIQqj64oQJtgLvtwgHlqGBvOH8hiLKR7+VqlNtjLAmbcRwrvY+qPMC81d5S1+BsjsrOci3XkncEsJZOyZPJFsUFMildFnUE10pyJxAPWwwVv3cJQg+fCNpCZlY4MzLISsfLngCyQIBi/rR0Ed3vRYH/XxeG8iCebv2TSXL3QEm3uMxHSUJitm8DydbkknZHyR15rKcQaWSyIqfYta49GGh4EY= X-MS-TrafficTypeDiagnostic: VI1PR07MB3983: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=alexander.sverdlin@nokia.com; X-Microsoft-Exchange-Diagnostics: 1;VI1PR07MB3983;20:MfV7Du9mOVYRfD4vRj0AB5Y+Il09shE2Q/UhW4z/pSOqgsaIvOkgZcrMttUWUudvoIUgFuDoX0+nknOjEB7VzxEPfD+PpkFWHt7oy0mjEizKuBrRwxeqR1wPrCVWPOzMbpiP7485WEJj+0NG6xgjitQ7WFmEwyO2Aajk31t+/+VaOrX60KaDCZ+q+jLSQyLuzLaoC7lSxxKmc15B4TRFlkwkGMNry9eHid+7pF0NlcbNLSPh3tT1i9tIOz814c+Hi/NyZtLpMbVnycyG7wha4OHQMAaviZtOIQsc9XGofXbCRlOCk68TMWvkMrMEYAfiSPsXRYFzzsXUkHFneV1ZIpgQq2tr7YRfKFhaZD/Otj2yAx67HZbT/dmg7tUx3139RTlODfq86EA0urNGABd0rktM32ccwQH6Iiu1QhR3wThOpCGJ0TY8u9HJb0EpSfoVh5WHMoKH0ALP5ed1qVIlwr2Z5psObQ0/b9YEMADnRoJNO8/UsEgtDo1Mjyt4JVjoS0jepE9DrqHpra5CW5rmaYwQPR75j2HOtLUoZATqO9sOkRzi/u99lZsgelg7mfj9dVRD1Cg3/c8K+NzA8Czh8Gf6L7fzDBlejqy34Hopg6w= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597)(109105607167333)(195916259791689); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231311)(11241501184)(806099)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:VI1PR07MB3983;BCL:0;PCL:0;RULEID:;SRVR:VI1PR07MB3983; X-Microsoft-Exchange-Diagnostics: 1;VI1PR07MB3983;4:RMwSMXOOkNRmGCg5eZ6cOtAEG0IWTOv2yH8fTeqNKC7ZEbEx2ZNBi/iiSTo8XRANSE7xvkSEw2RqB7iig4PXsLWDn4yoCkjvwVths5oJfMX2UfJ8YgeHIb4qqZ+uthmB9UQjqZQc4iOLPl7qonIi8qjmsuHqL1bHEmu7oyZsqwauIuR71uf7h46O2FyhXHKIeyFO3VSS5/Uqlgy1968WNnHRo7c4FkLVvBgaATH8BryqTQxe5JkYo7lS87eci5eECgpc+7KMUZBowd/jgXrKu/v5rwaHEHaeT8XrNbEnAAGqekjjhSikMTf7/OUb4JUtijOVjD+Kyvg21/BRnvbv7s7/8MK56Fqlpcm21v8uTFq5FvOp+f3d2cRRPxt5jtBl X-Forefront-PRVS: 0743E8D0A6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(376002)(39860400002)(346002)(396003)(136003)(366004)(199004)(189003)(50226002)(86362001)(26005)(36756003)(386003)(6506007)(66066001)(47776003)(54906003)(4326008)(51416003)(52116002)(25786009)(1857600001)(16526019)(186003)(316002)(68736007)(6486002)(8676002)(48376002)(1076002)(5660300001)(476003)(2906002)(2616005)(6666003)(97736004)(956004)(14444005)(3846002)(8936002)(6116002)(44832011)(81166006)(16586007)(81156014)(486006)(50466002)(305945005)(7736002)(478600001)(6512007)(106356001)(105586002)(53936002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR07MB3983;H:ulegcpsvdell.emea.nsn-net.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nokia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;VI1PR07MB3983;23:9DlfBu7zLxTAAZyoXHT790wL7wy2srAhbRJn57WY2WZZsml91tuHoJPQPg2s+3OmgiAByf6+w6SaPMHzZfC//g45a6zxcaKcSXX1354+DtjepqHdQsYoipyNALFwleX+Ya3LqRn8aYLwZOtiHPUTmloXJvFJCnvHIymRjF4ZlLzCJg7DzyE1rNN9/jBoFNeSnNwNQY6wTj8gA1igcctpTwb9PJowyEbs47B95ocNts3mqdAEnyGHxPtTFDIOItvr9mwfWIMafWFgytQhd1WWKWDzH2nzGnVDzeoSVs1sdOKN2t+lJeli/cmDGWxLtoPjQMGKhzU3/qhy1KGvbNQl6gJXiF6+3n+ssx+GaPIzsjF0pEaTRYdoC0hs0BcARf16Qoo/vELaoXoJHYL19poPpiJ2bYEn4bpi4NYDGef+kzn6j15b5MofOL69Lp7IHX6/ehZyhJX8fbmAjmnEbRwlkxRZwjxMWNb9LMt2n9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com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2018 11:28:13.6930 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 862b6272-b3ad-489d-8ada-08d5f1588b90 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB3983 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Legacy platform instantiation of PL022 had an ability to configure DMA usage on controller level. If PL022 is being instantiated from DT it still claims couple of DMA channels capable of DMA_SLAVE unconditionally even if there are no DMA channels specified in the DT. Depending on the slave devices' configuration this might be waste of DMA channels or this might even claim some precious DMA channels if there are only few of them in the system. Add a new boolean property to disable DMA usage on the controller level: "pl022,dma-disable" Signed-off-by: Alexander Sverdlin --- Documentation/devicetree/bindings/spi/spi_pl022.txt | 1 + drivers/spi/spi-pl022.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/spi/spi_pl022.txt b/Documentation/devicetree/bindings/spi/spi_pl022.txt index 7638b4968ddb..d877a0871a11 100644 --- a/Documentation/devicetree/bindings/spi/spi_pl022.txt +++ b/Documentation/devicetree/bindings/spi/spi_pl022.txt @@ -21,6 +21,7 @@ Optional properties: - dma-names: Names for the dma channels, if present. There must be at least one channel named "tx" for transmit and named "rx" for receive. +- pl022,dma-disable : disable DMA usage SPI slave nodes must be children of the SPI master node and can diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 1af8c96b940e..43039c7428fe 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2086,7 +2086,7 @@ pl022_platform_data_dt_get(struct device *dev) return NULL; pd->bus_id = -1; - pd->enable_dma = 1; + pd->enable_dma = !of_property_read_bool(np, "pl022,dma-disable"); of_property_read_u32(np, "num-cs", &tmp); pd->num_chipselect = tmp; of_property_read_u32(np, "pl022,autosuspend-delay",