From patchwork Wed Jan 30 15:08:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10788793 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 8083D6C2 for ; Wed, 30 Jan 2019 15:09:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E1A128DB2 for ; Wed, 30 Jan 2019 15:09:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C29B2F6B0; Wed, 30 Jan 2019 15:09:26 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 F13472F6A4 for ; Wed, 30 Jan 2019 15:09:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727506AbfA3PIe (ORCPT ); Wed, 30 Jan 2019 10:08:34 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:7120 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfA3PId (ORCPT ); Wed, 30 Jan 2019 10:08:33 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="26094008" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Jan 2019 08:08:32 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.107) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 30 Jan 2019 08:08:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xSLozwod+1M6y77B+xgZBns+IaC0DyuikaO7LfLkkc8=; b=sLODAXn5BDRn8R4FrYxW8afptrrADi59M7WoZMg6OW6vSJXQUCw+Men8xfxcLBy875qQBsUSqUEtxr780FzUGoWI0hevWX82z6t0p5S7B39wuqIEnIsRIfi7xDYzGMrhx+EfCYcbc9Nfz2Jy3x62Ufq12CbgruVXr9ZQuWobeVM= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1796.namprd11.prod.outlook.com (10.175.99.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.17; Wed, 30 Jan 2019 15:08:29 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Wed, 30 Jan 2019 15:08:29 +0000 From: To: , , , CC: , , , , Subject: [PATCH 1/9] spi: atmel-quadspi: optimize qspi init Thread-Topic: [PATCH 1/9] spi: atmel-quadspi: optimize qspi init Thread-Index: AQHUuK2oYIgYi2Phc0CCu9Nb5y7hkQ== Date: Wed, 30 Jan 2019 15:08:29 +0000 Message-ID: <20190130150818.24902-2-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> In-Reply-To: <20190130150818.24902-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P189CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::32) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1796;6:mSa7GGHJSNVKZ8jQuUdIkUR6oHTTyvVuPPJAchjF6wYYFU/sZzXbckUdI65WJPkFb6Ig/HlxJP8iV0/bb4v9PbfKkCJXf/LDu+vVMRyR0SHWKOvvSeGv74AtVQtwgVYCy7yuQXdj0MLqDESu+fE/7frx6aWpBQcaoL7SNO6BbXbUpK2KDaOJv3TkmUoUd+LPyx20qARVnGhntGC4gp8RhN2Z1AvvzycLei6mW1S4gXumFJFoylPILLzqjSCsZPaA3zeAaS2qvu+DEPrvpbXOhR/LbHDpA//uQpq2wcaN1n7iNbLqF7Xh/v32Mz1t8jQzdFcbjhX4EasDggg9paCbYB7KvvnVSR6D6khgdPp30QZVUA/+YWEjqDe65feY5izQzpa1xg5Txdlm710E/U8K/4YiPdsF309SVJJT5u/NsWHbkXmqJCcOgiwxMVYpNzlDYaOe5zHsKGTCP0sO1nIGcg==;5:76PCBtuXDo7ErjEdW4SeKVSGbQV72biDV+vCMAHsPtDCknUm5HT0eKF6EhMGv79A6DbCwJDZgoxFHwuDGwpLBK/Xoj54w7GlwrBAth8aOfRnJn1QHeGVBrlCtOpMarfh9dNz8nb2nfBjA+q5QGPDdIN2bd4kIFzaK1/7p0YcxlCFEkjIgAtvZNjoaz36REzebBCv2TLt80qnTwiqMN8QcQ==;7:dPVIzvcyrzXnlkpHfIidIvIDU6fwTKT9eFKB8RcArA/NMt09S9XU3NNKAo6Po8FCyisBKEoiIWPHLVjvdZCizVzN6G8a/l0XZkkcUx+tXQKEYjYwjz24XemGm+HWE8sUtMiUtNcc1GsekYiHkZJ95A== x-ms-office365-filtering-correlation-id: a805563f-899b-4bf9-4e7f-08d686c4cac0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1796; x-ms-traffictypediagnostic: BN6PR11MB1796: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(366004)(346002)(136003)(396003)(199004)(189003)(386003)(316002)(81156014)(2501003)(72206003)(81166006)(4744005)(486006)(14454004)(476003)(110136005)(1076003)(8936002)(6116002)(4326008)(11346002)(50226002)(52116002)(6506007)(2616005)(36756003)(3846002)(68736007)(6486002)(6436002)(53936002)(8676002)(54906003)(66066001)(6512007)(478600001)(99286004)(186003)(71200400001)(97736004)(86362001)(2906002)(256004)(71190400001)(305945005)(446003)(6636002)(102836004)(105586002)(25786009)(7736002)(26005)(106356001)(107886003)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1796;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 9h5KM1DZiUGJ2ISVGtqq0e1p9e76+DLf6HBr2/dJQpcVqoyeU3y/AQrCoqyQWLbyLW2nmhLU1gEnFVq8dr+GHKRbol2J3f4/CTMLUW5Rea7jB7H6wombZXdJ5muVm4tFy0TO7g1xAjSc4taHFATZ/f78EwS5kV7QEw+815vpytbNA4qaVxxHTvOUhlQk2aU281T4TpiLbMHKTA9qzhOOii0zpC8NZt/ICmU2auJLkubf1dRvC8s3RTCB4TA6IrDutmleZe8uzN2Aq4DHVDQltQeMGFoyreJecla1A36AM1zV7PUEEcF02G3SdfQNHDxD0YYied/Z0FlM1XCvXzTTse0BIglYWCdp7gc7l2syX2lWXKUEoxKOApyYw58i0gKglMvgGUeEU0762kVLtXMS0cusbJxQ1J92pupW12xdLM8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a805563f-899b-4bf9-4e7f-08d686c4cac0 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 15:08:27.6563 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1796 X-OriginatorOrg: microchip.com 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 From: Tudor Ambarus Set the QSPI controller in Serial Memory Mode at init and not at each exec_op() call. Signed-off-by: Tudor Ambarus --- drivers/spi/atmel-quadspi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index ddc712410812..f79b17792a11 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -238,8 +238,6 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) icr = QSPI_ICR_INST(op->cmd.opcode); ifr = QSPI_IFR_INSTEN; - qspi_writel(aq, QSPI_MR, QSPI_MR_SMM); - mode = find_mode(op); if (mode < 0) return -ENOTSUPP; @@ -381,6 +379,9 @@ static int atmel_qspi_init(struct atmel_qspi *aq) /* Reset the QSPI controller */ qspi_writel(aq, QSPI_CR, QSPI_CR_SWRST); + /* Set the QSPI controller in Serial Memory Mode */ + qspi_writel(aq, QSPI_MR, QSPI_MR_SMM); + /* Enable the QSPI controller */ qspi_writel(aq, QSPI_CR, QSPI_CR_QSPIEN); From patchwork Wed Jan 30 15:08:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10788791 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 1DFD813BF for ; Wed, 30 Jan 2019 15:09:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B5FE2F6A8 for ; Wed, 30 Jan 2019 15:09:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3FEF2F6B4; Wed, 30 Jan 2019 15:09:24 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 A062B2F580 for ; Wed, 30 Jan 2019 15:09:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731480AbfA3PJS (ORCPT ); Wed, 30 Jan 2019 10:09:18 -0500 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:13626 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729164AbfA3PIf (ORCPT ); Wed, 30 Jan 2019 10:08:35 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="27058551" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Jan 2019 08:08:34 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.107) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 30 Jan 2019 08:08:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C7Keb5XM0YwP+J1+nSKhb0zOxAuAd2DRuVWY9PteKmo=; b=R8Pjid+2mGYIPgJDvcHO8Pw9NXxpMOJHSFrCTEHPamNmQgbuVi38ZpDNI1IsRyMPd41kaMDJ5Aqqcf4cpxb4k5XdFnxQuoinGhWNFponms5aQFobPLzUPQRxKf50eX1L0apYonDFcvjaCaMQxcI1ntnTLdWQVEAMFiwaH/3bsSY= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1796.namprd11.prod.outlook.com (10.175.99.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.17; Wed, 30 Jan 2019 15:08:31 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Wed, 30 Jan 2019 15:08:31 +0000 From: To: , , , CC: , , , , Subject: [PATCH 2/9] spi: atmel-quadspi: order header files inclusion alphabetically Thread-Topic: [PATCH 2/9] spi: atmel-quadspi: order header files inclusion alphabetically Thread-Index: AQHUuK2pIHfKRE2XhEm6S4eXsvSP5Q== Date: Wed, 30 Jan 2019 15:08:31 +0000 Message-ID: <20190130150818.24902-3-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> In-Reply-To: <20190130150818.24902-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P189CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::32) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1796;6:AD8+FnLymURF/ILr6d0bqhz/a7e3478ZLBEDAil8Gr1j0CTGzaiLwxuBFg8zFevdJWELGouqlQC7nrGv++S5pmcvEim5obhRCJrjVa9oepTvuR1LopzyO8QmH4R9goKPy2F8WGDfh8p82VQDHQkYGV7B2VRF61aHttT5v1ZEQb2lKNepLq9MK/ax2mzztV0o3sOJOrYml/BplIG3Ip9F+eyXgNAH6QlqcO45OmMtycqZEl8ejg7iAtCVNGO9MbRa1E85bNBqWYG+8sHWKuQFTOQc60ddTtb67uUF5PF3WEcLwbtPU4het2Gc/ekZM1g3FsgI8+Te6SXN3aup6m3TIEWh7OWJnq/5Jr7V/fAmb3SVw9cfTkuXg84yMxMKTqKpnAcJZ6C3EOrnN7poC+k0rSPvLSGuNxpSENQ1XBKraWipVy3rcVcPjJvrNXkMyY3uN8WXvL7PiSXzjqj/qX6knw==;5:i3588m+DafUo7sP0QZn9ugfRZJXdHnGj+UHDEF02LfdGKFj4TmmnFO7L/mRiBSuMNOQAaDCXJyUG8eGyJutBhXxEtZMhIRvIvhZGUzDLjS2NcZ3JTrsWCl5MIF0Yr2DaVIv5wWBbCn1DExU1OiNTy+Ln+Zh4VchD0C4BnldN6FgnmfFSTB5kSgrDneG7kCzJ09jAwYqTCjwDbvOR1/p5TQ==;7:o5GSZipg9iH3xQN3+8vb0xg7OlFjOaqQSEJ0fp0aA8NysXg73x8BVXK6+KtF3hqZKzYwOAgapripfwL1CJhu+jwrE3I9a8P/7DJd/grZlTsEZERI7aaD3f6Q0bqV3BgyqrTs4zf/htDyQL8/h6y0Ig== x-ms-office365-filtering-correlation-id: 28717ec4-e49e-4dc6-6247-08d686c4cc0b x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1796; x-ms-traffictypediagnostic: BN6PR11MB1796: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(39860400002)(376002)(366004)(346002)(136003)(396003)(199004)(189003)(386003)(316002)(81156014)(2501003)(72206003)(81166006)(4744005)(486006)(14454004)(476003)(110136005)(1076003)(8936002)(6116002)(4326008)(11346002)(50226002)(52116002)(6506007)(2616005)(36756003)(3846002)(68736007)(6486002)(6436002)(53936002)(8676002)(54906003)(66066001)(6512007)(478600001)(99286004)(186003)(71200400001)(97736004)(86362001)(2906002)(256004)(71190400001)(305945005)(446003)(6636002)(102836004)(105586002)(25786009)(7736002)(26005)(106356001)(107886003)(76176011)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1796;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: OL5nIY6LbYQeOtRdRWe7wtZdecL1vIruQp1rvCx2/lxPItEeWRYSslfTNiZsI10EjFeEBZv7uCNwRanoh6cIOGIac7ZsFFRYT0dA+T0o91YXj/vagZwPiDf9OeHBHQ0qfxoZzxCB/t2g0mCNxGG9bvZvjbB4i6WRTwNEtahJuVlyr5aeQgsDW1hNl9MsO5ieweR+ABaDksYt4y2gxT9s4ZebE1GxvkkYlByAzG+PJ6kYKBSz99Na6vr7pKB38N9BOyxwfMdxiaBfwa9Tp/kSOAVM+u3dcfpHJ4GMSjkLqgP9IgVy/Jp3aOozgShcoDDTu2R99GXTQTRxUfbgZ/DWgUsUxg0KVPBnwGF3QHHIHZlCHYEjpKptsT/RiNEGXtprvgOFDb7dh/cx549CR8KzpDQs6VR/noGlCQZmunb9bd4= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 28717ec4-e49e-4dc6-6247-08d686c4cc0b X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 15:08:29.9261 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1796 X-OriginatorOrg: microchip.com 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 From: Tudor Ambarus Cosmetic change, no functional change. Signed-off-by: Tudor Ambarus Reviewed-by: Boris Brezillon --- drivers/spi/atmel-quadspi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index f79b17792a11..64475ad16c83 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -22,16 +22,15 @@ * This driver is based on drivers/mtd/spi-nor/fsl-quadspi.c from Freescale. */ -#include #include -#include -#include #include #include #include -#include - #include +#include +#include +#include +#include #include /* QSPI register offsets */ From patchwork Wed Jan 30 15:08:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10788789 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 8281413BF for ; Wed, 30 Jan 2019 15:09:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D7802EB2D for ; Wed, 30 Jan 2019 15:09:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B6832F6A8; Wed, 30 Jan 2019 15:09:19 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B823E2EB2D for ; Wed, 30 Jan 2019 15:09:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728404AbfA3PIh (ORCPT ); Wed, 30 Jan 2019 10:08:37 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:7120 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfA3PIg (ORCPT ); Wed, 30 Jan 2019 10:08:36 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="26094015" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Jan 2019 08:08:36 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.107) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 30 Jan 2019 08:08:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=H6wQ6dQ7wO44QDdSxR25CKR0+gZu+1+vP5anujzgEEs=; b=tmY1OPdId8ET3tJn87sXdphy+Dn5FjvozrL8zSdRuEDaJeeVkxq2BOb9hwoQwIWEKhfT59HEVgqIDdDUVU9SNmGjhPCspYEDyOdLSrTg4JiILGk5hcmFKKU+LS7O3vAhOk5DbpDOBoqUCAJUhxI5QUBG2ZzHtZR50er3KShEoYI= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1796.namprd11.prod.outlook.com (10.175.99.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.17; Wed, 30 Jan 2019 15:08:33 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Wed, 30 Jan 2019 15:08:33 +0000 From: To: , , , CC: , , , , Subject: [PATCH 3/9] spi: atmel-quadspi: fix naming scheme Thread-Topic: [PATCH 3/9] spi: atmel-quadspi: fix naming scheme Thread-Index: AQHUuK2rht/7ZFEtQkGJmNLPHPLPUQ== Date: Wed, 30 Jan 2019 15:08:33 +0000 Message-ID: <20190130150818.24902-4-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> In-Reply-To: <20190130150818.24902-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P189CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::32) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1796;6:AEPj0GcsKJNgOaRfDioSNq5qA8Jb2kIK1NLrz1xJ+rd9+eGMXhvBx/7/UvYfwhnshgU0E48a/YhezjY6ZynMRius0b4uvyqnTFPW2n4MFH59H5bcWF/jpkGFuuftK8SiZqNxfOBpuE4hYfLFpBVfmMO7vXJKb5z8mx5H/nZUh8TZ3jTyAdRP2gXyXabNV4W3IeLL2qKz91koQFKFPV8p/357bwJ2ZCrrWP88MNWkbirRfZarjVGXXROOmbNwf3dEct0/29W7d/AlFpTm1Y5qYS/npvu/RLyLqaZBNFRWHTILbzPY/spv3gN3S3++mu9psX75UkBw9sNIdORdYpwrQuNJqwYdwqqb4ne6iv9akN7H0AxVd9vOc2Fzq3i6WPJECc8ThKPkaJ8/Ty0N//XHzDCIwdKJrcOwxoc+PRbThqclqCcnVAHKamyN65iRpauLMwbPnWE1fd7xjIUwnftm2Q==;5:Sm1QUxs8Xr2IHGRWTvVsVc2skHfRr31kIawScPgIzrXQSJPRZbkqnh8CLbizVMWtap6msHVm/XTdoB/fVbgQ85rpz/Evb7xcMVsj21Fm/3hg94iuBmWIlOG+nxHxV9JPhQYFSa5kFF1gzaK+UaO9yZDOAuBzDNLAHtjbbjE74jHZ/Witcutj4DPcF8nzmxfHSZCTo7KUAPhNsOW98SLjVg==;7:e9xyZOeprdmjqrdyh0XxoHrCbdqsuSE5FfmFnS+q6bCRKJqVTP7L22rHTHs/HpNmoZacceNQzeGwd7abhatHmKx+YiXGfYE9uhJhhcUriniF8gEpR1et0AQds93q0e2dBjmyEEVOoTk08TUcaWjD2A== x-ms-office365-filtering-correlation-id: d6b057bd-2828-4ced-2f7a-08d686c4cd52 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1796; x-ms-traffictypediagnostic: BN6PR11MB1796: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(366004)(346002)(136003)(396003)(199004)(189003)(386003)(316002)(81156014)(2501003)(72206003)(81166006)(486006)(14454004)(476003)(110136005)(1076003)(8936002)(6116002)(4326008)(11346002)(50226002)(52116002)(6506007)(2616005)(36756003)(3846002)(68736007)(6486002)(6436002)(53936002)(8676002)(54906003)(66066001)(6512007)(478600001)(99286004)(186003)(71200400001)(97736004)(86362001)(2906002)(256004)(71190400001)(14444005)(305945005)(446003)(6636002)(102836004)(105586002)(25786009)(7736002)(26005)(106356001)(107886003)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1796;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: lRIAurCRc51BV6LQDcYknX4ZLsTm7V9QqmAHF4YPdLv2mRloO/8UXp7ehnompQ54Kaw5+w0F61ocems5WsDZuPVk2vKFbzGXg7razATVcZBoS+HMB5Zwlax+MgJwdWUrbiccF0p3rwVLj8he7Z2kRADaOGz2OWKdsl9rCgBZDL/OKc9YKnCCG5bXKaBH+OuNn896ahqOXak1lWnku1HS+7wDX+eq/GwurDUguPCSgHhkGN/hkBWfrfRuW/N5K55gMQBNl8j3pqtGyjbW+cDtpZHpYzFwFMqZqPd31bhYUuxVLmwnNb/jwr7uc0nGWw2RlpxWSnN7dOnKu9FqNbgy/2SFN8BPUItKQ0ACEcQFP7hwJ0jyS8aHLG8+eXd2/UneE3YKee66otCJza9nxC0Lz8/0DNLg2cHKwYxTM53YT9U= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d6b057bd-2828-4ced-2f7a-08d686c4cd52 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 15:08:32.0999 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1796 X-OriginatorOrg: microchip.com 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 From: Tudor Ambarus Let general names to core drivers. Signed-off-by: Tudor Ambarus --- drivers/spi/atmel-quadspi.c | 52 ++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 64475ad16c83..e156c345705b 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -157,14 +157,14 @@ struct atmel_qspi { struct completion cmd_completion; }; -struct qspi_mode { +struct atmel_qspi_mode { u8 cmd_buswidth; u8 addr_buswidth; u8 data_buswidth; u32 config; }; -static const struct qspi_mode sama5d2_qspi_modes[] = { +static const struct atmel_qspi_mode sama5d2_qspi_modes[] = { { 1, 1, 1, QSPI_IFR_WIDTH_SINGLE_BIT_SPI }, { 1, 1, 2, QSPI_IFR_WIDTH_DUAL_OUTPUT }, { 1, 1, 4, QSPI_IFR_WIDTH_QUAD_OUTPUT }, @@ -175,18 +175,18 @@ static const struct qspi_mode sama5d2_qspi_modes[] = { }; /* Register access functions */ -static inline u32 qspi_readl(struct atmel_qspi *aq, u32 reg) +static inline u32 atmel_qspi_readl(struct atmel_qspi *aq, u32 reg) { return readl_relaxed(aq->regs + reg); } -static inline void qspi_writel(struct atmel_qspi *aq, u32 reg, u32 value) +static inline void atmel_qspi_writel(struct atmel_qspi *aq, u32 reg, u32 value) { writel_relaxed(value, aq->regs + reg); } -static inline bool is_compatible(const struct spi_mem_op *op, - const struct qspi_mode *mode) +static inline bool atmel_qspi_is_compatible(const struct spi_mem_op *op, + const struct atmel_qspi_mode *mode) { if (op->cmd.buswidth != mode->cmd_buswidth) return false; @@ -200,12 +200,12 @@ static inline bool is_compatible(const struct spi_mem_op *op, return true; } -static int find_mode(const struct spi_mem_op *op) +static int atmel_qspi_find_mode(const struct spi_mem_op *op) { u32 i; for (i = 0; i < ARRAY_SIZE(sama5d2_qspi_modes); i++) - if (is_compatible(op, &sama5d2_qspi_modes[i])) + if (atmel_qspi_is_compatible(op, &sama5d2_qspi_modes[i])) return i; return -1; @@ -214,7 +214,7 @@ static int find_mode(const struct spi_mem_op *op) static bool atmel_qspi_supports_op(struct spi_mem *mem, const struct spi_mem_op *op) { - if (find_mode(op) < 0) + if (atmel_qspi_find_mode(op) < 0) return false; /* special case not supported by hardware */ @@ -237,7 +237,7 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) icr = QSPI_ICR_INST(op->cmd.opcode); ifr = QSPI_IFR_INSTEN; - mode = find_mode(op); + mode = atmel_qspi_find_mode(op); if (mode < 0) return -ENOTSUPP; @@ -293,17 +293,17 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) ifr |= QSPI_IFR_TFRTYP_TRSFR_WRITE; /* Clear pending interrupts */ - (void)qspi_readl(aq, QSPI_SR); + (void)atmel_qspi_readl(aq, QSPI_SR); /* Set QSPI Instruction Frame registers */ - qspi_writel(aq, QSPI_IAR, iar); - qspi_writel(aq, QSPI_ICR, icr); - qspi_writel(aq, QSPI_IFR, ifr); + atmel_qspi_writel(aq, QSPI_IAR, iar); + atmel_qspi_writel(aq, QSPI_ICR, icr); + atmel_qspi_writel(aq, QSPI_IFR, ifr); /* Skip to the final steps if there is no data */ if (op->data.nbytes) { /* Dummy read of QSPI_IFR to synchronize APB and AHB accesses */ - (void)qspi_readl(aq, QSPI_IFR); + (void)atmel_qspi_readl(aq, QSPI_IFR); /* Send/Receive data */ if (op->data.dir == SPI_MEM_DATA_IN) @@ -314,22 +314,22 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) op->data.buf.out, op->data.nbytes); /* Release the chip-select */ - qspi_writel(aq, QSPI_CR, QSPI_CR_LASTXFER); + atmel_qspi_writel(aq, QSPI_CR, QSPI_CR_LASTXFER); } /* Poll INSTRuction End status */ - sr = qspi_readl(aq, QSPI_SR); + sr = atmel_qspi_readl(aq, QSPI_SR); if ((sr & QSPI_SR_CMD_COMPLETED) == QSPI_SR_CMD_COMPLETED) return err; /* Wait for INSTRuction End interrupt */ reinit_completion(&aq->cmd_completion); aq->pending = sr & QSPI_SR_CMD_COMPLETED; - qspi_writel(aq, QSPI_IER, QSPI_SR_CMD_COMPLETED); + atmel_qspi_writel(aq, QSPI_IER, QSPI_SR_CMD_COMPLETED); if (!wait_for_completion_timeout(&aq->cmd_completion, msecs_to_jiffies(1000))) err = -ETIMEDOUT; - qspi_writel(aq, QSPI_IDR, QSPI_SR_CMD_COMPLETED); + atmel_qspi_writel(aq, QSPI_IDR, QSPI_SR_CMD_COMPLETED); return err; } @@ -368,7 +368,7 @@ static int atmel_qspi_setup(struct spi_device *spi) scbr--; scr = QSPI_SCR_SCBR(scbr); - qspi_writel(aq, QSPI_SCR, scr); + atmel_qspi_writel(aq, QSPI_SCR, scr); return 0; } @@ -376,13 +376,13 @@ static int atmel_qspi_setup(struct spi_device *spi) static int atmel_qspi_init(struct atmel_qspi *aq) { /* Reset the QSPI controller */ - qspi_writel(aq, QSPI_CR, QSPI_CR_SWRST); + atmel_qspi_writel(aq, QSPI_CR, QSPI_CR_SWRST); /* Set the QSPI controller in Serial Memory Mode */ - qspi_writel(aq, QSPI_MR, QSPI_MR_SMM); + atmel_qspi_writel(aq, QSPI_MR, QSPI_MR_SMM); /* Enable the QSPI controller */ - qspi_writel(aq, QSPI_CR, QSPI_CR_QSPIEN); + atmel_qspi_writel(aq, QSPI_CR, QSPI_CR_QSPIEN); return 0; } @@ -392,8 +392,8 @@ static irqreturn_t atmel_qspi_interrupt(int irq, void *dev_id) struct atmel_qspi *aq = (struct atmel_qspi *)dev_id; u32 status, mask, pending; - status = qspi_readl(aq, QSPI_SR); - mask = qspi_readl(aq, QSPI_IMR); + status = atmel_qspi_readl(aq, QSPI_SR); + mask = atmel_qspi_readl(aq, QSPI_IMR); pending = status & mask; if (!pending) @@ -499,7 +499,7 @@ static int atmel_qspi_remove(struct platform_device *pdev) struct atmel_qspi *aq = spi_controller_get_devdata(ctrl); spi_unregister_controller(ctrl); - qspi_writel(aq, QSPI_CR, QSPI_CR_QSPIDIS); + atmel_qspi_writel(aq, QSPI_CR, QSPI_CR_QSPIDIS); clk_disable_unprepare(aq->clk); return 0; } From patchwork Wed Jan 30 15:08:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10788785 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 8621A6C2 for ; Wed, 30 Jan 2019 15:09:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73B2B2F112 for ; Wed, 30 Jan 2019 15:09:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AF7E2C8CA; Wed, 30 Jan 2019 15:09:11 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 00BAF2F112 for ; Wed, 30 Jan 2019 15:09:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731499AbfA3PIk (ORCPT ); Wed, 30 Jan 2019 10:08:40 -0500 Received: from esa3.microchip.iphmx.com ([68.232.153.233]:7120 "EHLO esa3.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730517AbfA3PIj (ORCPT ); Wed, 30 Jan 2019 10:08:39 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="26094017" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Jan 2019 08:08:38 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.107) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 30 Jan 2019 08:08:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Os2tdyNKEPCMm909MpCewpd6kQGkzIfTJFtLpLZTIg=; b=c99bKrwX2t3OT3sQXWZCTIz2QmhFtt0T0ZzV6r8rYMckldJC2Wp9HnI19jQgYSfL/KPj1Ve3Jtf8H1+naW+TDEdzd/2PvMgLjLq0luCMBsNshY/MhNNUmYcxvxlDPq+jCCvdEsCfx0ENijwFEJIww4oTDWHJPya0i60qUx15qyI= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1796.namprd11.prod.outlook.com (10.175.99.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.17; Wed, 30 Jan 2019 15:08:36 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Wed, 30 Jan 2019 15:08:36 +0000 From: To: , , , CC: , , , , Subject: [PATCH 4/9] spi: atmel-quadspi: remove unnecessary cast Thread-Topic: [PATCH 4/9] spi: atmel-quadspi: remove unnecessary cast Thread-Index: AQHUuK2spztuTCidrUSdAFF1gcbY/A== Date: Wed, 30 Jan 2019 15:08:35 +0000 Message-ID: <20190130150818.24902-5-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> In-Reply-To: <20190130150818.24902-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P189CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::32) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1796;6:DWDxTCNNSbvD9hb6OiinnTm2+ZqmPpDVzYwoiBNnkJ5DsOoi1j1SwzLzOTyaPBCgjYCeFJkaRmcbuiRtncdMzrZu8zv92sxrfRCZiPXtkSNoAdZ0NiLpKvqaIQXJuglsK/zdFn1EC9p9qqpsCZxt22KbanLwOx6D/OAyeyrElVKBf4nTlMTh3OIXF+xF4JinFEEW7gbxSxKM9wTKR+FJ9FhV9eqhpwQ8t1AWIveb1UkUHbJtrI1IXEUwXmNocsjx8jIPzaOwJQv48Wy+HXC3u41sUdVBCAuKQ+pv71UPeyiFWzE3f8dOFcSTqt5VNwlPVE96kdE/6EqDtVVvWi/RjKZEHZgvLsav5HLyVXg4yoyUvqoKyBs9AnRfp5zyLM84Rx2tXPjHNqYv86o/mybhDyM8OhMGlSqH3yuWmpa9+bLHSAl30BhFBzuld3KMHYVcapIhT3ggdIGJSLNqLvSjkA==;5:Xu7BNE8kbf1KnfTQaDmCZ1V4WaMnx/nbrInZjKrzx6H/T8jwqL70Uj7b/jd87kUhfXra2ViVnit8m0Hy+tAbCu8r+yRcjXK4Kd/OTNsW7m5rPq0xaVCQVpshanLNJo8zLQ65cKZcm14FBEpRAICdgIeicYKSrml1Wnb3VwAuJ1JHtCuISRg9y7NBXoR4QQgpnsRzyJCc+HoDr0VXNUPqRQ==;7:JUnXVEC2kKZ4zt0F65kjNNR+ec/3xxW6ELlwsCOd2eadt8+/pwgesXA34S9xjn1Wm4dqvpdGLuSaLbMbqeKgtIMT967fX1wN3QvhAylt66ET4NvaJ6kOGJYXEOboHpR4MZNE+f3y3OZETN76iwlx0Q== x-ms-office365-filtering-correlation-id: 10591938-85c4-4e38-759a-08d686c4ce78 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1796; x-ms-traffictypediagnostic: BN6PR11MB1796: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(366004)(346002)(136003)(396003)(199004)(189003)(386003)(316002)(81156014)(2501003)(72206003)(81166006)(4744005)(486006)(14454004)(476003)(110136005)(1076003)(8936002)(6116002)(4326008)(11346002)(50226002)(52116002)(6506007)(2616005)(36756003)(3846002)(68736007)(6486002)(6436002)(53936002)(8676002)(54906003)(66066001)(6512007)(478600001)(99286004)(186003)(71200400001)(97736004)(86362001)(2906002)(256004)(71190400001)(14444005)(305945005)(446003)(6636002)(102836004)(105586002)(25786009)(7736002)(26005)(106356001)(107886003)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1796;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ybFcjN+xHv7DMSoStm530K1Gewm9yKcYEA9s+K1W4uWLic88/EejA3J73V6NrPgf7xwfR2tm8D2vRvYtDmgKEFjEBZQHv+A2ODYs73QwCL+sQFb0ImGizRD3ER0TaxGn4IQLWQd/PGacFoU7EGY2BtXjXqiNl2UKpSV8C+vkE5MeA071qFq3h4HzPVugFhBwI6/KyqMk13k5Ml9izbmutt3fh6DEAlRZVfKEXeSddxBRj/p27XN+00as+rjigUwsJX4UVQ7Tof+28lgq2D7inj1n++xmdzWn5nzDNYAckeo1CWFRgX4JSB0mz8ULZ6XUoiDolkE12vkiqxtc2f9F9zvmrhhR7xdMQonjisjm1izRO+npQmI54913h4aFKAcUw1LGrfohpeWx586XvQGOV5F1eGMNQdOaBmeQhSdPTrA= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 10591938-85c4-4e38-759a-08d686c4ce78 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 15:08:34.1095 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1796 X-OriginatorOrg: microchip.com 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 From: Tudor Ambarus The cast is done implicitly. Signed-off-by: Tudor Ambarus Reviewed-by: Boris Brezillon --- drivers/spi/atmel-quadspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index e156c345705b..3643f0c851b0 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -389,7 +389,7 @@ static int atmel_qspi_init(struct atmel_qspi *aq) static irqreturn_t atmel_qspi_interrupt(int irq, void *dev_id) { - struct atmel_qspi *aq = (struct atmel_qspi *)dev_id; + struct atmel_qspi *aq = dev_id; u32 status, mask, pending; status = atmel_qspi_readl(aq, QSPI_SR); From patchwork Wed Jan 30 15:08:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10788781 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 D85DE13BF for ; Wed, 30 Jan 2019 15:09:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4CC72F00B for ; Wed, 30 Jan 2019 15:09:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2C0B2A0FF; Wed, 30 Jan 2019 15:09:09 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 6751B2F00B for ; Wed, 30 Jan 2019 15:09:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730486AbfA3PIo (ORCPT ); Wed, 30 Jan 2019 10:08:44 -0500 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:13626 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730505AbfA3PIk (ORCPT ); Wed, 30 Jan 2019 10:08:40 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="27058554" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Jan 2019 08:08:39 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.107) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 30 Jan 2019 08:08:39 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AS0bpVOWnq4BG8ZsO4M6ItdHVuTTkLJQPyTfOxA2OME=; b=gZoeLnUL/du3/yC6Zw6pAyy4jzlM9dBFntlDDcOaBeRVbJYl11xp5kY56gjTpBxnVDV4KVW4H0G4giHGWF1XO0rPwYj5RoJ8w8csLsiIljVzC09H4sKD0sMJNBVYvVO0czIK3Z+Ot0hbaYADkRj8egczvoCm8wZoJIYuD2X41r8= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1796.namprd11.prod.outlook.com (10.175.99.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.17; Wed, 30 Jan 2019 15:08:38 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Wed, 30 Jan 2019 15:08:38 +0000 From: To: , , , CC: , , , , Subject: [PATCH 5/9] spi: atmel-quadspi: return appropriate error code Thread-Topic: [PATCH 5/9] spi: atmel-quadspi: return appropriate error code Thread-Index: AQHUuK2tLf54vHcEj0qIhNwqgM2FvQ== Date: Wed, 30 Jan 2019 15:08:38 +0000 Message-ID: <20190130150818.24902-6-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> In-Reply-To: <20190130150818.24902-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P189CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::32) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1796;6:lIxuI5mySjgfjaDSAMYGj9Hz7exzlnQw5tnQFrVjejd3Tbjb7sI9qTeiLN0zCn075meXwH+QpNIRA25/rySXkdqiYLpJk8qv5xs5vl1adCAaqd1Kq0XkkfoxIZkrO2I6ihyEc/vZcM3Z1RCuaPCP8pDDBZm4xuP7YviloykpqcZ3DKo8A8c+MZUM7u3ZdmIdUXnpm12vwXZM34Ok0cD9xBZYm66x5jysMIqo7yT/uxmSihGttWSO2Q86y5J8qyAAwEuVzq7clzutvZ35v7GejvHoWxlawXH5Q1sCOMXIs0zf0PhBHsIUEv9OGAfUx8IJtKS7atr+QxpXvu4Xr5PhGDBDUMKwHn6hbaNqu6W6gmtlh8Ye5z2Y0gVJALiw3SVLoBfqvlpEIcxquB2y+bAEsau2fVeumt2N7mv0vbGjZTtvBpbwoA54AWvkkcaJgjg6KDRGT6D57XQSmdwvra7cvQ==;5:/5E5cu3Sgqpyn0xBYKex/1q4M7iEcf7NnxzdD7h3WJHJ1m0dM6MAmXPyzndLLU9ETz6VeusxBuPPJAXjIdEK52rTxfBlfV0pDbq3GmUGZqiNc8Zp/W7j4X56owQZJ/GkyDErkutP9QNeiaNzps2hjMvRWN2gmGgsJRbHEgQiqvnrxxi4uLS7waXdwmAuhbMfdn0rxxwBsuKKKQlofR88EQ==;7:wqE/lgEm0eaw8TqALHgZNHKaS8+LQOMgJJv6B9Rr1TPIYHMavgBcHyP3wcD+Ui/RVnh9kn/IdCXMsUy4pSaZOmPeRariwuxK2R8Q6hOxiF6SVYe5AXFN1Vh+6064jiqpXXk5cLQ+BfhjNxa7rYIv9w== x-ms-office365-filtering-correlation-id: 4f271410-df67-4df6-2eba-08d686c4cff3 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1796; x-ms-traffictypediagnostic: BN6PR11MB1796: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(366004)(346002)(136003)(396003)(199004)(189003)(386003)(316002)(81156014)(2501003)(72206003)(81166006)(4744005)(486006)(14454004)(476003)(110136005)(1076003)(8936002)(6116002)(4326008)(11346002)(50226002)(52116002)(6506007)(2616005)(36756003)(3846002)(68736007)(6486002)(6436002)(53936002)(8676002)(54906003)(66066001)(6512007)(478600001)(99286004)(186003)(71200400001)(97736004)(86362001)(2906002)(256004)(71190400001)(305945005)(446003)(6636002)(102836004)(105586002)(25786009)(7736002)(26005)(106356001)(107886003)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1796;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Ln0zl3WikV1+6MVqHwT/u3dbmUmG6Asyaa7KkNYoVZqiqcYeOcko4RSXAoVWn7q8lFMBotCSQSwDICAQT4K/LqDj479stxiEpN8en1grRBVsed7bd+2tjq7vpaleyu3lv6obrlyLk4pAtP+xSINrTT5AeBFAXAw0WhFYGIX5Bk7E9m5M3kOmIGR+lJuACFrhlqInNF8sm1Y5hQtq/1G9KdWCAWow5i9ip72zEKjBdBiwyr6g3WjX3NtHF6ogbDTQaSNZrypJnYm6Ol6nQChigLWULUjZO5GoqaVsL6MDG1paOn1mwaJkU5vSBctA9DL1pbLTdUFOjryqyl1/0Oe9hAv5IMll2qog4z70zjW9fgXHsaFjTWU6HT67lDrctgSxpx3rqVn25wUXoESp7yosYARmJw38q7vors1tVkq6lyE= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 4f271410-df67-4df6-2eba-08d686c4cff3 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 15:08:36.2222 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1796 X-OriginatorOrg: microchip.com 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 From: Tudor Ambarus Return -ENOTSUPP when atmel_qspi_find_mode() fails. Propagate the error in atmel_qspi_exec_op(). Signed-off-by: Tudor Ambarus Reviewed-by: Boris Brezillon --- drivers/spi/atmel-quadspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 3643f0c851b0..e6de6e3d1345 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -208,7 +208,7 @@ static int atmel_qspi_find_mode(const struct spi_mem_op *op) if (atmel_qspi_is_compatible(op, &sama5d2_qspi_modes[i])) return i; - return -1; + return -ENOTSUPP; } static bool atmel_qspi_supports_op(struct spi_mem *mem, @@ -239,7 +239,7 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) mode = atmel_qspi_find_mode(op); if (mode < 0) - return -ENOTSUPP; + return mode; ifr |= sama5d2_qspi_modes[mode].config; From patchwork Wed Jan 30 15:08:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10788787 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 212CC6C2 for ; Wed, 30 Jan 2019 15:09:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F80F2EB2D for ; Wed, 30 Jan 2019 15:09:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D6342F2E4; Wed, 30 Jan 2019 15:09:18 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 9F0A52EB2D for ; Wed, 30 Jan 2019 15:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731246AbfA3PJL (ORCPT ); Wed, 30 Jan 2019 10:09:11 -0500 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:37513 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731480AbfA3PJL (ORCPT ); Wed, 30 Jan 2019 10:09:11 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="25940456" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Jan 2019 08:09:07 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.49) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 30 Jan 2019 08:08:42 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jHHna9VDyXkM/w3fk4YcVBk9k8fvYwyfLaJ2raH3rsg=; b=2ZV4+7xzwIY2f06kZ7FsIwbrFNykyXm3H7iLO1F7ICfytjY/Syo+QwFzw8eZy83xAJnTdHUerKI3PELCD9d1nOFM4CZ2WfVQfawtSa1aJMsAJmm76AEeDQw6zmMMSb5ZSt6PeS8tc8rq2yCPzuzB/+8XIh44uf9Qvw7EHRWcYpU= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1796.namprd11.prod.outlook.com (10.175.99.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.17; Wed, 30 Jan 2019 15:08:41 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Wed, 30 Jan 2019 15:08:41 +0000 From: To: , , , CC: , , , , Subject: [PATCH 6/9] spi: atmel-quadspi: switch to SPDX license identifiers Thread-Topic: [PATCH 6/9] spi: atmel-quadspi: switch to SPDX license identifiers Thread-Index: AQHUuK2vEcfS0aw/f0aWTrM/MWrx0w== Date: Wed, 30 Jan 2019 15:08:40 +0000 Message-ID: <20190130150818.24902-7-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> In-Reply-To: <20190130150818.24902-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P189CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::32) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1796;6:vu93DfEoNl8/wiZxoD6HfsOzOJdU3/COsNaxM6/5GpS9SM22dOfzzN/yiuDmUi1PV3u7dKVEhqSgjKrUnDCp/qg+gzx17hvUfvVx5+/3L79rtpxp1OBKK6+4MJXXx6HgpuGWWlEXA/np1vxie9vZKRnWhudsQkkxre9kSSovygAF84Il4f5JN5j+5qJkZQNf8O4g5F0XpnHFwF3MCKbpQMy7fVtuBJD2PhGWUlshl0vOQZXfvpxO6j25iOQ4pFZYZZXEk9WkzNsso8dsSMb6IkAQOZer4uAuGLrk0L9fUuhw0adPl6fUSYSjgtzNggQJWTww6PjqMK999yzdjsBRrUsPy1+egnXepLn+AMkZ8biCdC/VxSrG73m+NrEsMiTq+OTEKdfXC7aK5M5pBKJbfxz7n3ycTAGpO8i/VWCLFXU1u11ZaJcjY6g/zMfNTkPjGPNU07Ip1+0KZBsO/fWKHw==;5:Wxi4uGv3YtgHuiWL8rAZYB5OLp6OGXVkKrb9Xp45tXJ3A97/HqVO+qASkjl3HP0gmI69dMeBEZ5WSa4H49c2pA88ooTMwb+Pg827QlXDFaT/qaQQJK5WpmjD1vOdmSjUWR8Htw95Tq/vA/5LTx5gDLHSGwQvbmmTpvz4SRcG7Ai7vwf52JS/dUBUEELwL4sApJmhOtb8rayvrQcjlKJAOA==;7:ikR4zD4/UgXa9TOHCUhO49qUWXKq8go0HyIc+zCOHgXW5dqtCSVoCjYEtnR+29eID0ps6qnw7Bw5i/dyc8NI6Am/+ZRRWlPxgfc8aJaMzQdD2rMka0lkeZi40FEwYxKMMKctmWMPiSqejn30uuvhMQ== x-ms-office365-filtering-correlation-id: 06dbf267-1f25-49b5-4e01-08d686c4d176 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1796; x-ms-traffictypediagnostic: BN6PR11MB1796: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(366004)(346002)(136003)(396003)(199004)(189003)(386003)(316002)(81156014)(2501003)(72206003)(81166006)(486006)(14454004)(476003)(110136005)(1076003)(8936002)(6116002)(4326008)(11346002)(6306002)(50226002)(52116002)(6506007)(2616005)(36756003)(3846002)(68736007)(6486002)(6436002)(53936002)(8676002)(54906003)(66066001)(6512007)(478600001)(99286004)(186003)(71200400001)(97736004)(86362001)(2906002)(256004)(71190400001)(305945005)(446003)(6636002)(102836004)(105586002)(25786009)(7736002)(26005)(106356001)(107886003)(76176011)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1796;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: mmray3SYjCjRbRpg5izMX1CuozEWRiPli+IE0N48VZA/WmcfdGuACYf096irB+gr6AiPVx6Ql771Qkona6PAtK+0Cze0y15drUQrsDKzIjt8mVAMm78hCk9QEtP9vnzbsaab5NNik5lvBVWztcBbzWkf70sswkhdmzBC3yPn43qS9r3/+myNJe5obqYFvcceb5CampMovF1/xZb9ESdivWA89VdQ/iPmFz6ckBzvcGz70uKnLQNv3Kl06jgCfLdec01K/PYfoRDSL6ePwSi+pW2DLh/d+KUcSMeTJW77RpKBeMr5w8ZoJYQtAuGGz2pBhcpFQraPR8IoI8OwxfdTd+Ds8QU4v4g5G9XC8Uxm22cj3Gt+/nKJqTZzBOacpSBYKWoDfxM1mNWCF8nc5xQNjLuF9K9LpJGkcZ03oM4ZC9A= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 06dbf267-1f25-49b5-4e01-08d686c4d176 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 15:08:38.7632 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1796 X-OriginatorOrg: microchip.com 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 From: Tudor Ambarus Adopt the SPDX license identifiers to ease license compliance management. Signed-off-by: Tudor Ambarus Reviewed-by: Boris Brezillon --- drivers/spi/atmel-quadspi.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index e6de6e3d1345..1d21db7851e9 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for Atmel QSPI Controller * @@ -7,18 +8,6 @@ * Author: Cyrille Pitchen * Author: Piotr Bugalski * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * * This driver is based on drivers/mtd/spi-nor/fsl-quadspi.c from Freescale. */ From patchwork Wed Jan 30 15:08:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10788779 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 1DECC6C2 for ; Wed, 30 Jan 2019 15:09:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C3C32E4FC for ; Wed, 30 Jan 2019 15:09:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A4E82F00A; Wed, 30 Jan 2019 15:09:09 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 AECC92F0F0 for ; Wed, 30 Jan 2019 15:09:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731570AbfA3PIs (ORCPT ); Wed, 30 Jan 2019 10:08:48 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:57676 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731269AbfA3PIr (ORCPT ); Wed, 30 Jan 2019 10:08:47 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="23208575" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Jan 2019 08:08:46 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.38) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 30 Jan 2019 08:08:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hsJ+rz6/ZiQXa6gww3fp2N07xekBu4FSEPPXkpJSc0E=; b=nr9iMbiA6MyhTJz1hkgcKMvbZXwIA/fmk34WSZ8fTWZrfMxYgjALfGSAR+X8PJ4gLhEJam+E3kG0ipgoFrkL813PLUu5wxGwhIb0W+W/Yw5GkKwykREEYXZHTrvsJbx8goJDC0NpOX1J8nIoGaqjKmEj7j5WKxJJrP0EVtsLB3Y= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1428.namprd11.prod.outlook.com (10.172.21.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Wed, 30 Jan 2019 15:08:43 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Wed, 30 Jan 2019 15:08:43 +0000 From: To: , , , CC: , , , , Subject: [PATCH 7/9] dt-bindings: spi: atmel-quadspi: update example to new clock binding Thread-Topic: [PATCH 7/9] dt-bindings: spi: atmel-quadspi: update example to new clock binding Thread-Index: AQHUuK2wJYG8B+2MyEqKItkUoaw7pA== Date: Wed, 30 Jan 2019 15:08:43 +0000 Message-ID: <20190130150818.24902-8-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> In-Reply-To: <20190130150818.24902-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P189CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::32) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1428;6:0vQS+F3EQv76rKUg8wYx3UL7u6gEUM6NmXXNGtLjOqbm/NM+9B5vCKrWBOjhUY4iPs7PRMAIxjnV8gUIM9obO3SkLiOKHfnpEwTtNEzlE6FRVsVFPRxsUHCRAIIap02AkgtEvs+qTWxJygkaoeLEDpNlsWElIwBNQKORZRpONCdS4sQrXL3P+mERBxBaww6I+vLI6kxTsO31deabjgDuIEfhCwm/t6SDsXadmeVvIgj/tzc9yGGZB0b4pJOwot08LtSirVud9BqByTCu+v4XRfxm4fEOpyc0aDB2Le4RyNzXmKrnp3uxJWc8osuLpH2IIMm69EulUc2fcaDdRn/mNzRNrmyZyxXwGfP1cNA95p1dpfiZMbUxa+00G69Xc577dsjl212TVDgW/GfI421sEeAnuGEMqHnovMywXtWhSwAYevGi6mDRiOQXnirGcFSYZCEMKBhzMjkx29Un1MgkqQ==;5:t6Y1FonrbUP5dWNM5Ipy9abbV0cf4xMjM1y420IAkNn1PjIKi+0q81BGXPJXSWpshGI1/FFAaNrehNqPsOEPeKxPd4AOv2Pd1p5kk1Ka352xCdF6lzhExEqwruluX9EymAj4JoBvRAlgq5GovS+JXeHDz7FBi0UCujafq6EPCM8rrnkWvhlo0ikQ7wpA06R2ClAQdk4t/Tx89sWoYOp1NQ==;7:fXjyC2iXejPIf20olKCJe2snuuM24iaEXiRJHRNbgCCtoXdlypJJut/C7drv0iaiMKQyY4jJwWzv3FS0Dzy2VCQMQbXnfFn5QHueQTOQbv0aCjd06OBjQwbWEKflHshsCTG44YC5eCMRufMVXQnWlA== x-ms-office365-filtering-correlation-id: dc5dcd13-fde0-4ca5-384b-08d686c4d2d7 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1428; x-ms-traffictypediagnostic: BN6PR11MB1428: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(376002)(39860400002)(366004)(346002)(189003)(199004)(6436002)(68736007)(97736004)(6636002)(52116002)(6116002)(186003)(8936002)(50226002)(2501003)(66066001)(26005)(486006)(107886003)(3846002)(53936002)(4326008)(110136005)(86362001)(6486002)(71200400001)(81166006)(316002)(6506007)(102836004)(2616005)(11346002)(25786009)(476003)(71190400001)(54906003)(446003)(386003)(105586002)(8676002)(1076003)(305945005)(106356001)(2906002)(81156014)(478600001)(72206003)(7736002)(4744005)(99286004)(76176011)(6512007)(256004)(14454004)(14444005)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1428;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: I++BtMuD7TfYlm/GVPtiU8rtRVDJNhQY0733mO9Tf2/O/gA4DoBZ6c/Y1PrBlcH8oD3s/4vWlbAaV0+Qv9EcReRjgwTGXKQMc9Ob302S4/zTHTNg3izN2l2vwYSNGecaaF1HDyRpBboxLKIQyUv24FkeZCTPWTzmWdWzUpaVnL3lvUW9nOidtgD2vpa5KIqN7/a3gBycbSfdqPpTFYmSEH60EPkSx8yHFJthPuWe9XBVEShVN9tlQ88XqLtq9YId1rnudVWEqh4cK8RcVIjaQ/DaZGRYzlcRsMzGctGKXgTpTfgyRKC8DQ5mPKX0yEZekXG2NM4UQkehkJTSzjdzSOXIMCY79Jn/e9jKL/wR7CqwfB/xULl2uWg+HZyiUzH4pHZGXgfCQxXiuv9NAO3Ksm2C+8ETpUSvrNUlx8bH/vA= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: dc5dcd13-fde0-4ca5-384b-08d686c4d2d7 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 15:08:41.3083 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1428 X-OriginatorOrg: microchip.com 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 From: Tudor Ambarus Introduced in: commit b60557876849 ("ARM: dts: at91: sama5d2: switch to new clock binding") Signed-off-by: Tudor Ambarus Reviewed-by: Boris Brezillon --- Documentation/devicetree/bindings/spi/atmel-quadspi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/spi/atmel-quadspi.txt b/Documentation/devicetree/bindings/spi/atmel-quadspi.txt index b93c1e2f25dd..e9dae6264d89 100644 --- a/Documentation/devicetree/bindings/spi/atmel-quadspi.txt +++ b/Documentation/devicetree/bindings/spi/atmel-quadspi.txt @@ -19,7 +19,7 @@ spi@f0020000 { reg = <0xf0020000 0x100>, <0xd0000000 0x8000000>; reg-names = "qspi_base", "qspi_mmap"; interrupts = <52 IRQ_TYPE_LEVEL_HIGH 7>; - clocks = <&spi0_clk>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 52>; #address-cells = <1>; #size-cells = <0>; pinctrl-names = "default"; From patchwork Wed Jan 30 15:08:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10788775 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 A597513BF for ; Wed, 30 Jan 2019 15:09:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92F072EFC8 for ; Wed, 30 Jan 2019 15:09:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8302B2E4FC; Wed, 30 Jan 2019 15:09:01 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 135442EFD1 for ; Wed, 30 Jan 2019 15:09:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731584AbfA3PIt (ORCPT ); Wed, 30 Jan 2019 10:08:49 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:57676 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731569AbfA3PIs (ORCPT ); Wed, 30 Jan 2019 10:08:48 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="23208579" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Jan 2019 08:08:47 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.38) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 30 Jan 2019 08:08:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5TG71vXqO0OqB+nWHjqNIPzPDwPgd30426H8GG2TERY=; b=RxV9nspuAxilRVYOjIeMcOThGQXSRxE0dRClL3CmOCGaCWPcrcKTEnFx2sUBDsfMQXfjYdboTFRBNE6xOxAgucctXjwjLAbKa/MUK/nHgymm+YlZ+knBpyuXbcPZpqPLpRYZ2orvI1iTQBU17EW6SD72rZd/sgoUTMqxgeZOIE8= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1428.namprd11.prod.outlook.com (10.172.21.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Wed, 30 Jan 2019 15:08:45 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Wed, 30 Jan 2019 15:08:45 +0000 From: To: , , , CC: , , , , Subject: [PATCH 8/9] dt-bindings: spi: atmel-quadspi: QuadSPI driver for Microchip SAM9X60 Thread-Topic: [PATCH 8/9] dt-bindings: spi: atmel-quadspi: QuadSPI driver for Microchip SAM9X60 Thread-Index: AQHUuK2xf3u2KPfoDkGm5485KIOYJw== Date: Wed, 30 Jan 2019 15:08:45 +0000 Message-ID: <20190130150818.24902-9-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> In-Reply-To: <20190130150818.24902-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P189CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::32) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1428;6:FYV9AvQcZlKuG/kUR+LnYnWETLChnFPKMmwTNueG7OcioIUaTfd0PoZNem5Rqup9NdM7oFH1GFV1QLSx4Q9pC4F7mVI7vjdMfaT8XDnxESWVUapzYWDQ5RXvsimthswtNbMYVpWPIkthUosGrEOxOKcyJHbnKzhRYHgC1lOnVjYjJLjHKD4jlsYT0064idSxeH0/roXKwxoYUKrwa4qhFAxjfd9ZLe8yAS0pRSuT/lsDGsEnaQVvek3vg8GVqMvmdCQ1kkTvHK3xse6Y0oKxi2inwlnMSxcN3xBAMCUlJc1qKjLVX/cX1UlJYeh/eBVE4kdJ9WQxBKaIsDMZPQ2Mo/JJBOuNN3K5wJMsGQi14WdgapGAxe2W1k0gFJ+pkpSbOXP+sSR08YrUYyvoAm7IvyPas1E2TK2JajCuWQdVL4l/nkVp0fxMdIjAGzcr5C+XuNIvw2e0nioFAd3Rw1DWXw==;5:9S5g6qtGYGOaqwuXsPEwh21sKa63p/6NWWTPxnr0/Fmwj+WGXIKNydBVQTUHzjxR2l+lb15PqggaxkWstSM0jZFEEf/borTUpROe7IpMKvNc0KTyt+940u6bnTkNhdumPGyfxq2A4RG06TFNwfQEmZ5OolZbtlqgfYKQjL+eJ+mSRvj2kgTUi6zOUBSR8hhRj3J/WJt+fO/Nl1DwEoRUnQ==;7:gCpf+6Rc6DUF4SOf1qWhTB52QxPihpz77qlE1brWjw9Hlg5MqVd9mb/2+ackwBAhbErRYZ66yuJxjq0W60wiY/PKXwHzs3hRiXhbZbMhrP4Kix+Xc46bA552cJrpr+8aDSbCTKVZh7YiyPlH7lxMDQ== x-ms-office365-filtering-correlation-id: f062ca55-80fd-444a-226f-08d686c4d419 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1428; x-ms-traffictypediagnostic: BN6PR11MB1428: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(376002)(39860400002)(366004)(346002)(189003)(199004)(6436002)(68736007)(97736004)(6636002)(52116002)(6116002)(186003)(8936002)(50226002)(2501003)(66066001)(26005)(486006)(107886003)(3846002)(53936002)(4326008)(110136005)(86362001)(6486002)(71200400001)(81166006)(316002)(6506007)(102836004)(2616005)(11346002)(25786009)(476003)(71190400001)(54906003)(446003)(386003)(105586002)(8676002)(1076003)(305945005)(106356001)(2906002)(81156014)(478600001)(72206003)(7736002)(99286004)(76176011)(6512007)(256004)(14454004)(14444005)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1428;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: DWAma5nbTSyLJ/RSh+RUQ/9jzYXf+W8x0/Z2FmUhs7Mh61+8jQbumAljMsMI3U1M1cNC3wAqaPiZNNNXVmXN7TbdD1Yu7sFzSv62awmweu+K7VLT6E7wBkIxGqfwUypupeD/gZtqLp7kmtAL6zCbceUyKiP6yqStANc8CDTgIUNm60fUl/HwaTossSKDuYm2EpRukxCPv8rnT7Zu9i9Ax2Ud1jvh9LUP5KVSd01Rc3/fWuBYZK0ytj3YUGHGZmHc1j2t9FAy5l+JFcpGWSB7b//Rh7c9ABZKAQedGixFZg4+L6BoGX8j28vVD8hLu5cDXAQ+XQH2NbtbbzwmIrLmy1nz7nPYRjJm5QFXnI0T5mW/Ee9evTxw7cXsXFr+JIz9myXw/dupnUZ7sw0Cs4gFB9/BioPcMueK8oRxJ+XSW14= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f062ca55-80fd-444a-226f-08d686c4d419 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 15:08:43.4900 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1428 X-OriginatorOrg: microchip.com 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 From: Tudor Ambarus The sam9x60 qspi controller uses 2 clocks, one for the peripheral register access, the other for the qspi core and phy. Both are mandatory. Signed-off-by: Tudor Ambarus --- .../devicetree/bindings/spi/atmel-quadspi.txt | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/atmel-quadspi.txt b/Documentation/devicetree/bindings/spi/atmel-quadspi.txt index e9dae6264d89..e7b7f297c5d7 100644 --- a/Documentation/devicetree/bindings/spi/atmel-quadspi.txt +++ b/Documentation/devicetree/bindings/spi/atmel-quadspi.txt @@ -1,14 +1,22 @@ * Atmel Quad Serial Peripheral Interface (QSPI) Required properties: -- compatible: Should be "atmel,sama5d2-qspi". +- compatible: Should be one of the following + - "atmel,sama5d2-qspi" + - "microchip,sam9x60-qspi" - reg: Should contain the locations and lengths of the base registers and the mapped memory. - reg-names: Should contain the resource reg names: - qspi_base: configuration register address space - qspi_mmap: memory mapped address space - interrupts: Should contain the interrupt for the device. -- clocks: The phandle of the clock needed by the QSPI controller. +- clocks: - "atmel,sama5d2-qspi": the phandle of the clock needed by the + QSPI controller. + - "microchip,sam9x60-qspi": should reference the peripheral + and system QSPI clocks. +- clock-names: Only for sam9x60 - should contain two strigs: + - "pclk" for the peripheral clock + - "qspick" for the system clock - #address-cells: Should be <1>. - #size-cells: Should be <0>. @@ -29,3 +37,19 @@ spi@f0020000 { ... }; }; + +qspi@f0014000 { + compatible = "microchip,sam9x60-qspi"; + reg = <0xf0014000 0x100>, <0x70000000 0x08000000>; + reg-names = "qspi_base", "qspi_mmap"; + interrupts = <35 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 35>, <&pmc PMC_TYPE_SYSTEM 19>; + clock-names = "pclk", "qspick"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + + flash@0 { + ... + }; +}; From patchwork Wed Jan 30 15:08:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10788777 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 7E4D113BF for ; Wed, 30 Jan 2019 15:09:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A85D28BE0 for ; Wed, 30 Jan 2019 15:09:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68AB92EDDD; Wed, 30 Jan 2019 15:09:08 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 471812A3AD for ; Wed, 30 Jan 2019 15:09:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731439AbfA3PJB (ORCPT ); Wed, 30 Jan 2019 10:09:01 -0500 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:21605 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731480AbfA3PJA (ORCPT ); Wed, 30 Jan 2019 10:09:00 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539673200"; d="scan'208";a="24020814" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 30 Jan 2019 08:08:50 -0700 Received: from NAM01-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 30 Jan 2019 08:08:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8OaSCpo9vw4gbCsA7Dfhq0e7SofVC7nQqACgXlafFNA=; b=QFS6K0Jq3RHwxBxNmWjJeMv4eK0I0eEputSY86wD93YrlfzGpFTOpc8DjZfT20jKBvUTjbjiR3pLJGUDgGNk7aNSFgpkNwJAmxfpbjSpN3SOS5EhN5oKfJRXtIp0Y9V8iHkv/0T9duR8UDUAgzXTb6l65XNngsDOThWvVdQRBXY= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB1428.namprd11.prod.outlook.com (10.172.21.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Wed, 30 Jan 2019 15:08:47 +0000 Received: from BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f]) by BN6PR11MB1842.namprd11.prod.outlook.com ([fe80::847:4296:13b9:fc9f%8]) with mapi id 15.20.1580.017; Wed, 30 Jan 2019 15:08:47 +0000 From: To: , , , CC: , , , , Subject: [PATCH 9/9] spi: atmel-quadspi: add support for sam9x60 qspi controller Thread-Topic: [PATCH 9/9] spi: atmel-quadspi: add support for sam9x60 qspi controller Thread-Index: AQHUuK2zcy+YTju2sU2WL87l1ywXpQ== Date: Wed, 30 Jan 2019 15:08:47 +0000 Message-ID: <20190130150818.24902-10-tudor.ambarus@microchip.com> References: <20190130150818.24902-1-tudor.ambarus@microchip.com> In-Reply-To: <20190130150818.24902-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P189CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::32) To BN6PR11MB1842.namprd11.prod.outlook.com (2603:10b6:404:101::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Tudor.Ambarus@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.9.5 x-originating-ip: [94.177.32.154] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR11MB1428;6:1LpO6nHFtMoGGoJUrOaT6dbmEGaccXpE2UhKKsMawL1/elV/obA614LPtVu4c0jeaXAWokH5w+nW8++Z7mLOcojlpijuiABSwFFR/Ih2aodtfLYi1yoje4G748m2ZXynGD1tkMoghlThplYmG83m/UQOdVVfF5TZP7Q283HChFpIYufvcL5K0NPq6/TDMHHS0cXLqTa4M8PjnjW70poaz0bCVLioKGCWwzr7RIg4f5uWQ+qZ7KUqGx6j8sN8vfF3/W40SoKOJPtYHp8AWLw/1TUtQ0s7burpvjwXZ6Ju5yGqzjkblntOjFh4dlcDAdyPplufihKqySjXeO7JW7GnIIjOP4LK30LQKdocQ0e6/E1u1DX2ONjGg6W2Du0ilCRmMs8WHGJ0NikJ9G9xgbbLqD5QyMEU4Vd96YFe2AqXvfv53QmPdfhPiNInLrguSVpSQQrAvE79QiW5QPeBa5nbBQ==;5:+SWkmFS8iwWKxc0JbFSaDGEkjIItN6Q9vNSv1fBws9twbLlM8jdrjUxU86/Q/DoYXCNjrttmmCzv2vYTHD9/8VqJg5LZArMKc92HspzKL67wnWMT/UtF/cpx1wBoxiFkbzvtWmdLdlOwGq0PhVYz5Cn0KiHK2BTdyVR38GglmV2+oJ+rrAZOdraai2EuqB2lB7ss4aEPbJOZddmxNPUwrA==;7:EnJp2xGnuJ8+jWs5q/aOvYwxGugIfND2kU2Gh8aLUYtkMeXAQo7rXEnoGqoMdtFc4mypzeXOOqH++1SwE4SZryeYQ5djLeRgWLHCs3AHqY1KYzCZjMlqC5dhP7DBef/2HmCisuBbLtRm9HJ7EEMpOg== x-ms-office365-filtering-correlation-id: 27aecd75-affe-4e64-f9af-08d686c4d564 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020);SRVR:BN6PR11MB1428; x-ms-traffictypediagnostic: BN6PR11MB1428: x-microsoft-antispam-prvs: x-forefront-prvs: 0933E9FD8D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(376002)(39860400002)(366004)(346002)(189003)(199004)(6436002)(68736007)(97736004)(6636002)(52116002)(6116002)(186003)(8936002)(50226002)(2501003)(66066001)(26005)(486006)(107886003)(53946003)(3846002)(53936002)(4326008)(110136005)(86362001)(6486002)(71200400001)(81166006)(316002)(6506007)(102836004)(2616005)(11346002)(25786009)(476003)(71190400001)(54906003)(446003)(386003)(105586002)(8676002)(1076003)(305945005)(106356001)(2906002)(81156014)(478600001)(72206003)(7736002)(99286004)(76176011)(30864003)(6512007)(256004)(14454004)(14444005)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1428;H:BN6PR11MB1842.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: hbGuU+hUgxcL6IT1q2WHukh4nP94+HJZrbrLBKQAfj1/ZIF8xfEDKAYS5eIb+sf1dK6Fpb9fv9fJyEPyL44Lbv+QMmmiaKQvjP4xqUirf/XoWcj6CrixZuqBujcLhyNWbf5Uav7dujhXwuQ40+SBfG5akliAdPuH9x3iocN7yTt1jdVyafC/bZkdki9AC3tSBxENeMjosllboiO+XC9lTqMSCCzifAif9GKA98EPlIle0DXbXfD7kkG4iOBex4EFJcVB60BD7bEkpfVLhIgeaomsxdnu98TZK6EoM68oxuqs+e21Yl6rCoflox0fLWZ0TRUVa5neBb7QbHP10exQ7epIaN3YWxrx9yhMGLjFP9PGCw7p0UwmcySOHTOgkeNgbr5WM93k3RB+aau017s2nN10rudlulAZv74G5EkY9/E= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 27aecd75-affe-4e64-f9af-08d686c4d564 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2019 15:08:45.5157 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1428 X-OriginatorOrg: microchip.com 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 From: Tudor Ambarus The sam9x60 qspi controller uses 2 clocks, one for the peripheral register access, the other for the qspi core and phy. Both are mandatory. It uses dedicated register for Read Instruction Code Register (RICR) and Write Instruction Code Register (WICR). ICR/RICR/WICR have identical fields. Tested with sst26vf064b jedec,spi-nor flash. Backward compatibility test done on sama5d2 qspi controller and mx25l25635e jedec,spi-nor flash. Signed-off-by: Tudor Ambarus --- drivers/spi/atmel-quadspi.c | 331 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 277 insertions(+), 54 deletions(-) diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index 1d21db7851e9..bfdc8488f23b 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,9 @@ #define QSPI_IAR 0x0030 /* Instruction Address Register */ #define QSPI_ICR 0x0034 /* Instruction Code Register */ +#define QSPI_WICR 0x0034 /* Write Instruction Code Register */ #define QSPI_IFR 0x0038 /* Instruction Frame Register */ +#define QSPI_RICR 0x003C /* Read Instruction Code Register */ #define QSPI_SMR 0x0040 /* Scrambling Mode Register */ #define QSPI_SKR 0x0044 /* Scrambling Key Register */ @@ -88,7 +91,7 @@ #define QSPI_SCR_DLYBS_MASK GENMASK(23, 16) #define QSPI_SCR_DLYBS(n) (((n) << 16) & QSPI_SCR_DLYBS_MASK) -/* Bitfields in QSPI_ICR (Instruction Code Register) */ +/* Bitfields in QSPI_ICR (Read/Write Instruction Code Register) */ #define QSPI_ICR_INST_MASK GENMASK(7, 0) #define QSPI_ICR_INST(inst) (((inst) << 0) & QSPI_ICR_INST_MASK) #define QSPI_ICR_OPT_MASK GENMASK(23, 16) @@ -113,6 +116,8 @@ #define QSPI_IFR_OPTL_4BIT (2 << 8) #define QSPI_IFR_OPTL_8BIT (3 << 8) #define QSPI_IFR_ADDRL BIT(10) +#define QSPI_IFR_TFRTYP_TRSFR_MEM BIT(12) +#define QSPI_IFR_TFRTYP_TRSFR_REG (0 << 12) #define QSPI_IFR_TFRTYP_MASK GENMASK(13, 12) #define QSPI_IFR_TFRTYP_TRSFR_READ (0 << 12) #define QSPI_IFR_TFRTYP_TRSFR_READ_MEM (1 << 12) @@ -121,6 +126,8 @@ #define QSPI_IFR_CRM BIT(14) #define QSPI_IFR_NBDUM_MASK GENMASK(20, 16) #define QSPI_IFR_NBDUM(n) (((n) << 16) & QSPI_IFR_NBDUM_MASK) +#define QSPI_IFR_APBTFRTYP_WRITE (0 << 24) +#define QSPI_IFR_APBTFRTYP_READ BIT(24) /* Bitfields in QSPI_SMR (Scrambling Mode Register) */ #define QSPI_SMR_SCREN BIT(0) @@ -137,15 +144,37 @@ #define QSPI_WPSR_WPVSRC(src) (((src) << 8) & QSPI_WPSR_WPVSRC) +/* Describes register values. */ +struct atmel_qspi_cfg { + u32 icr; + u32 iar; + u32 ifr; +}; + +struct atmel_qspi_caps; + struct atmel_qspi { void __iomem *regs; void __iomem *mem; struct clk *clk; + struct clk *qspick; struct platform_device *pdev; + const struct atmel_qspi_caps *caps; u32 pending; struct completion cmd_completion; }; +struct atmel_qspi_ops { + int (*clk_prepare_enable)(struct atmel_qspi *aq); + void (*clk_disable_unprepare)(struct atmel_qspi *aq); + int (*set_qspi_cfg)(struct atmel_qspi *aq, const struct spi_mem_op *op, + struct atmel_qspi_cfg *cfg); +}; + +struct atmel_qspi_caps { + const struct atmel_qspi_ops *ops; +}; + struct atmel_qspi_mode { u8 cmd_buswidth; u8 addr_buswidth; @@ -214,23 +243,36 @@ static bool atmel_qspi_supports_op(struct spi_mem *mem, return true; } -static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) +static int atmel_qspi_set_mode(struct atmel_qspi_cfg *cfg, + const struct spi_mem_op *op) { - struct atmel_qspi *aq = spi_controller_get_devdata(mem->spi->master); - int mode; - u32 dummy_cycles = 0; - u32 iar, icr, ifr, sr; - int err = 0; - - iar = 0; - icr = QSPI_ICR_INST(op->cmd.opcode); - ifr = QSPI_IFR_INSTEN; + int mode = atmel_qspi_find_mode(op); - mode = atmel_qspi_find_mode(op); if (mode < 0) return mode; + cfg->ifr = QSPI_IFR_INSTEN | sama5d2_qspi_modes[mode].config; + return 0; +} - ifr |= sama5d2_qspi_modes[mode].config; +/* + * atmel_qspi_set_address_mode() - set address mode. + * @cfg: contains register values + * @op: describes a SPI memory operation + * + * The controller allows 24 and 32-bit addressing while NAND-flash requires + * 16-bit long. Handling 8-bit long addresses is done using the option field. + * For the 16-bit addresses, the workaround depends of the number of requested + * dummy bits. If there are 8 or more dummy cycles, the address is shifted and + * sent with the first dummy byte. Otherwise opcode is disabled and the first + * byte of the address contains the command opcode (works only if the opcode and + * address use the same buswidth). The limitation is when the 16-bit address is + * used without enough dummy cycles and the opcode is using a different buswidth + * than the address. + */ +static int atmel_qspi_set_address_mode(struct atmel_qspi_cfg *cfg, + const struct spi_mem_op *op) +{ + u32 dummy_cycles = 0; if (op->dummy.buswidth && op->dummy.nbytes) dummy_cycles = op->dummy.nbytes * 8 / op->dummy.buswidth; @@ -240,28 +282,28 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) case 0: break; case 1: - ifr |= QSPI_IFR_OPTEN | QSPI_IFR_OPTL_8BIT; - icr |= QSPI_ICR_OPT(op->addr.val & 0xff); + cfg->ifr |= QSPI_IFR_OPTEN | QSPI_IFR_OPTL_8BIT; + cfg->icr |= QSPI_ICR_OPT(op->addr.val & 0xff); break; case 2: if (dummy_cycles < 8 / op->addr.buswidth) { - ifr &= ~QSPI_IFR_INSTEN; - ifr |= QSPI_IFR_ADDREN; - iar = (op->cmd.opcode << 16) | - (op->addr.val & 0xffff); + cfg->ifr &= ~QSPI_IFR_INSTEN; + cfg->ifr |= QSPI_IFR_ADDREN; + cfg->iar = (op->cmd.opcode << 16) | + (op->addr.val & 0xffff); } else { - ifr |= QSPI_IFR_ADDREN; - iar = (op->addr.val << 8) & 0xffffff; + cfg->ifr |= QSPI_IFR_ADDREN; + cfg->iar = (op->addr.val << 8) & 0xffffff; dummy_cycles -= 8 / op->addr.buswidth; } break; case 3: - ifr |= QSPI_IFR_ADDREN; - iar = op->addr.val & 0xffffff; + cfg->ifr |= QSPI_IFR_ADDREN; + cfg->iar = op->addr.val & 0xffffff; break; case 4: - ifr |= QSPI_IFR_ADDREN | QSPI_IFR_ADDRL; - iar = op->addr.val & 0x7ffffff; + cfg->ifr |= QSPI_IFR_ADDREN | QSPI_IFR_ADDRL; + cfg->iar = op->addr.val & 0x7ffffff; break; default: return -ENOTSUPP; @@ -270,24 +312,99 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) /* Set number of dummy cycles */ if (dummy_cycles) - ifr |= QSPI_IFR_NBDUM(dummy_cycles); + cfg->ifr |= QSPI_IFR_NBDUM(dummy_cycles); - /* Set data enable */ - if (op->data.nbytes) - ifr |= QSPI_IFR_DATAEN; + return 0; +} + +static int atmel_sama5d2_qspi_set_cfg(struct atmel_qspi *aq, + const struct spi_mem_op *op, + struct atmel_qspi_cfg *cfg) +{ + int ret = atmel_qspi_set_mode(cfg, op); + + if (ret) + return ret; + + cfg->icr = QSPI_ICR_INST(op->cmd.opcode); if (op->data.dir == SPI_MEM_DATA_IN && op->data.nbytes) - ifr |= QSPI_IFR_TFRTYP_TRSFR_READ; + cfg->ifr |= QSPI_IFR_TFRTYP_TRSFR_READ; else - ifr |= QSPI_IFR_TFRTYP_TRSFR_WRITE; + cfg->ifr |= QSPI_IFR_TFRTYP_TRSFR_WRITE; + + /* Set data enable */ + if (op->data.nbytes) + cfg->ifr |= QSPI_IFR_DATAEN; + + ret = atmel_qspi_set_address_mode(cfg, op); + if (ret) + return ret; + + /* Clear pending interrupts */ + (void)atmel_qspi_readl(aq, QSPI_SR); + + /* Set QSPI Instruction Frame registers */ + atmel_qspi_writel(aq, QSPI_IAR, cfg->iar); + atmel_qspi_writel(aq, QSPI_ICR, cfg->icr); + atmel_qspi_writel(aq, QSPI_IFR, cfg->ifr); + + return 0; +} + +static int atmel_sam9x60_qspi_set_cfg(struct atmel_qspi *aq, + const struct spi_mem_op *op, + struct atmel_qspi_cfg *cfg) +{ + int ret = atmel_qspi_set_mode(cfg, op); + + if (ret) + return ret; + + cfg->icr = QSPI_ICR_INST(op->cmd.opcode); + + if (!op->addr.nbytes) { + cfg->ifr |= QSPI_IFR_TFRTYP_TRSFR_REG; + if (op->data.dir == SPI_MEM_DATA_OUT) + cfg->ifr |= QSPI_IFR_APBTFRTYP_WRITE; + else + cfg->ifr |= QSPI_IFR_APBTFRTYP_READ; + } else { + cfg->ifr |= QSPI_IFR_TFRTYP_TRSFR_MEM; + } + + /* Set data enable */ + if (op->data.nbytes) + cfg->ifr |= QSPI_IFR_DATAEN; + + ret = atmel_qspi_set_address_mode(cfg, op); + if (ret) + return ret; /* Clear pending interrupts */ (void)atmel_qspi_readl(aq, QSPI_SR); /* Set QSPI Instruction Frame registers */ - atmel_qspi_writel(aq, QSPI_IAR, iar); - atmel_qspi_writel(aq, QSPI_ICR, icr); - atmel_qspi_writel(aq, QSPI_IFR, ifr); + atmel_qspi_writel(aq, QSPI_IAR, cfg->iar); + if (op->data.dir == SPI_MEM_DATA_OUT) + atmel_qspi_writel(aq, QSPI_ICR, cfg->icr); + else + atmel_qspi_writel(aq, QSPI_RICR, cfg->icr); + atmel_qspi_writel(aq, QSPI_IFR, cfg->ifr); + + return 0; +} + +static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) +{ + struct atmel_qspi *aq = spi_controller_get_devdata(mem->spi->master); + struct atmel_qspi_cfg cfg = {0}; + u32 sr; + int err; + + err = aq->caps->ops->set_qspi_cfg(aq, op, &cfg); + if (err) + return err; /* Skip to the final steps if there is no data */ if (op->data.nbytes) { @@ -296,11 +413,11 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) /* Send/Receive data */ if (op->data.dir == SPI_MEM_DATA_IN) - _memcpy_fromio(op->data.buf.in, - aq->mem + iar, op->data.nbytes); + _memcpy_fromio(op->data.buf.in, aq->mem + cfg.iar, + op->data.nbytes); else - _memcpy_toio(aq->mem + iar, - op->data.buf.out, op->data.nbytes); + _memcpy_toio(aq->mem + cfg.iar, op->data.buf.out, + op->data.nbytes); /* Release the chip-select */ atmel_qspi_writel(aq, QSPI_CR, QSPI_CR_LASTXFER); @@ -395,10 +512,84 @@ static irqreturn_t atmel_qspi_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } +static int atmel_sama5d2_qspi_clk_prepare_enable(struct atmel_qspi *aq) +{ + int ret; + + if (!aq->clk) { + /* Get the peripheral clock */ + aq->clk = devm_clk_get(&aq->pdev->dev, NULL); + if (IS_ERR(aq->clk)) { + dev_err(&aq->pdev->dev, "missing peripheral clock\n"); + return PTR_ERR(aq->clk); + } + } + + /* Enable the peripheral clock */ + ret = clk_prepare_enable(aq->clk); + if (ret) + dev_err(&aq->pdev->dev, + "failed to enable the peripheral clock\n"); + + return ret; +} + +static void atmel_sama5d2_qspi_clk_disable_unprepare(struct atmel_qspi *aq) +{ + clk_disable_unprepare(aq->clk); +} + +static int atmel_sam9x60_qspi_clk_prepare_enable(struct atmel_qspi *aq) +{ + struct device *dev = &aq->pdev->dev; + int ret; + + if (!aq->clk) { + /* Get the peripheral clock */ + aq->clk = devm_clk_get(dev, "pclk"); + if (IS_ERR(aq->clk)) { + dev_err(dev, "missing peripheral clock\n"); + return PTR_ERR(aq->clk); + } + } + + if (!aq->qspick) { + /* Get the QSPI system clock */ + aq->qspick = devm_clk_get(dev, "qspick"); + if (IS_ERR(aq->qspick)) { + dev_err(dev, "missing system clock\n"); + return PTR_ERR(aq->qspick); + } + } + + /* Enable the peripheral clock */ + ret = clk_prepare_enable(aq->clk); + if (ret) { + dev_err(dev, "failed to enable the peripheral clock\n"); + return ret; + } + + /* Enable the QSPI system clock */ + ret = clk_prepare_enable(aq->qspick); + if (ret) { + dev_err(dev, "failed to enable the QSPI system clock\n"); + clk_disable_unprepare(aq->clk); + } + + return ret; +} + +static void atmel_sam9x60_qspi_clk_disable_unprepare(struct atmel_qspi *aq) +{ + clk_disable_unprepare(aq->qspick); + clk_disable_unprepare(aq->clk); +} + static int atmel_qspi_probe(struct platform_device *pdev) { struct spi_controller *ctrl; struct atmel_qspi *aq; + const struct atmel_qspi_caps *caps; struct resource *res; int irq, err = 0; @@ -437,20 +628,22 @@ static int atmel_qspi_probe(struct platform_device *pdev) goto exit; } - /* Get the peripheral clock */ - aq->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(aq->clk)) { - dev_err(&pdev->dev, "missing peripheral clock\n"); - err = PTR_ERR(aq->clk); - goto exit; + caps = of_device_get_match_data(&pdev->dev); + if (!caps) { + dev_err(&pdev->dev, "Could not retrieve QSPI caps\n"); + return -EINVAL; } - /* Enable the peripheral clock */ - err = clk_prepare_enable(aq->clk); - if (err) { - dev_err(&pdev->dev, "failed to enable the peripheral clock\n"); - goto exit; + if (!caps->ops->clk_prepare_enable || + !caps->ops->clk_disable_unprepare || !caps->ops->set_qspi_cfg) { + dev_err(&pdev->dev, "Could not retrieve QSPI ops\n"); + return -EINVAL; } + aq->caps = caps; + + err = caps->ops->clk_prepare_enable(aq); + if (err) + return err; /* Request the IRQ */ irq = platform_get_irq(pdev, 0); @@ -475,7 +668,7 @@ static int atmel_qspi_probe(struct platform_device *pdev) return 0; disable_clk: - clk_disable_unprepare(aq->clk); + caps->ops->clk_disable_unprepare(aq); exit: spi_controller_put(ctrl); @@ -486,18 +679,20 @@ static int atmel_qspi_remove(struct platform_device *pdev) { struct spi_controller *ctrl = platform_get_drvdata(pdev); struct atmel_qspi *aq = spi_controller_get_devdata(ctrl); + const struct atmel_qspi_caps *caps = aq->caps; spi_unregister_controller(ctrl); atmel_qspi_writel(aq, QSPI_CR, QSPI_CR_QSPIDIS); - clk_disable_unprepare(aq->clk); + caps->ops->clk_disable_unprepare(aq); return 0; } static int __maybe_unused atmel_qspi_suspend(struct device *dev) { struct atmel_qspi *aq = dev_get_drvdata(dev); + const struct atmel_qspi_caps *caps = aq->caps; - clk_disable_unprepare(aq->clk); + caps->ops->clk_disable_unprepare(aq); return 0; } @@ -505,8 +700,9 @@ static int __maybe_unused atmel_qspi_suspend(struct device *dev) static int __maybe_unused atmel_qspi_resume(struct device *dev) { struct atmel_qspi *aq = dev_get_drvdata(dev); + const struct atmel_qspi_caps *caps = aq->caps; - clk_prepare_enable(aq->clk); + caps->ops->clk_prepare_enable(aq); return atmel_qspi_init(aq); } @@ -514,8 +710,35 @@ static int __maybe_unused atmel_qspi_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(atmel_qspi_pm_ops, atmel_qspi_suspend, atmel_qspi_resume); +static const struct atmel_qspi_ops atmel_sama5d2_qspi_ops = { + .clk_prepare_enable = atmel_sama5d2_qspi_clk_prepare_enable, + .clk_disable_unprepare = atmel_sama5d2_qspi_clk_disable_unprepare, + .set_qspi_cfg = atmel_sama5d2_qspi_set_cfg, +}; + +static const struct atmel_qspi_caps atmel_sama5d2_qspi_caps = { + .ops = &atmel_sama5d2_qspi_ops, +}; + +static const struct atmel_qspi_ops atmel_sam9x60_qspi_ops = { + .clk_prepare_enable = atmel_sam9x60_qspi_clk_prepare_enable, + .clk_disable_unprepare = atmel_sam9x60_qspi_clk_disable_unprepare, + .set_qspi_cfg = atmel_sam9x60_qspi_set_cfg, +}; + +static const struct atmel_qspi_caps atmel_sam9x60_qspi_caps = { + .ops = &atmel_sam9x60_qspi_ops, +}; + static const struct of_device_id atmel_qspi_dt_ids[] = { - { .compatible = "atmel,sama5d2-qspi" }, + { + .compatible = "atmel,sama5d2-qspi", + .data = &atmel_sama5d2_qspi_caps, + }, + { + .compatible = "microchip,sam9x60-qspi", + .data = &atmel_sam9x60_qspi_caps, + }, { /* sentinel */ } };