From patchwork Wed Feb 13 08:59:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 10809381 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 C63201390 for ; Wed, 13 Feb 2019 09:02:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD89F2C9DE for ; Wed, 13 Feb 2019 09:02:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB2972CA08; Wed, 13 Feb 2019 09:02:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1E5662C9DE for ; Wed, 13 Feb 2019 09:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ii/9lo6T7ybmVQOGcIQBnbzRhFYgPXWSLfx9dCHOwTY=; b=aVVWVtE4xe59wO wt89sciW6WL6I7mnNv326xyrUdxEPJ9vkrDD5jn3tCW1hhmt0N1DEuJjGJg7+TPESaXhNt2wA04kI sshzGa9pOaGuc4DJaumzZX81Dxc8uQ/9bEUO0QYAgNQzIzWkH+kk3QXlqcENu4idKb8UXFufYK41z pJTSAEoTUeJmDMUvdRdO11SHYfsPV1dYTNleoWxettkZOLmpGHCe23/JeCpO7dgyl92eFtstpdQ+q Yze5I2ObXew+SFuyKtZnT/s3jBKV00kn7adwCQ1w2RgvmBKeZuy1BX9iW2nwlLrTIMbH4sg42zDwO XKqg3KDdsIGnSkvtTWEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtqQd-00015h-Qj; Wed, 13 Feb 2019 09:02:03 +0000 Received: from esa6.microchip.iphmx.com ([216.71.154.253]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtqOh-0005Yt-2T; Wed, 13 Feb 2019 09:00:19 +0000 X-IronPort-AV: E=Sophos;i="5.58,365,1544511600"; d="scan'208";a="23778144" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 13 Feb 2019 02:00:02 -0700 Received: from NAM05-BY2-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, 13 Feb 2019 02:00:01 -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=NqitVlNfd9v40uYN1JBOEDg6FYjYqHs1pMwOVDIlhLU=; b=CD1I1veYXicSIcbdy4ALBTgPL6G1gioZE46BfY6BA4r/aHatMIW9roayt/aTVyp4uMabUxDqATMwYSumwZrygepqjh0aJ80ffzyabn88AzrZkJVTD48ejlOZsGVt70/IxP0nAfQ8vaKRQ50MoFAGaK2THNdikjCIZ+I+RDPtmHE= Received: from BN6PR11MB1842.namprd11.prod.outlook.com (10.175.98.146) by BN6PR11MB0019.namprd11.prod.outlook.com (10.161.155.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Wed, 13 Feb 2019 08:59:59 +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.1601.023; Wed, 13 Feb 2019 08:59:58 +0000 From: To: , , , , , , , , , , , Subject: [PATCH 05/11] mtd: rawnand: atmel: add generic name for EBICSA regmap Thread-Topic: [PATCH 05/11] mtd: rawnand: atmel: add generic name for EBICSA regmap Thread-Index: AQHUw3p/WcoWk5iPWUK5WAuDRxDQqA== Date: Wed, 13 Feb 2019 08:59:58 +0000 Message-ID: <20190213085930.31578-6-tudor.ambarus@microchip.com> References: <20190213085930.31578-1-tudor.ambarus@microchip.com> In-Reply-To: <20190213085930.31578-1-tudor.ambarus@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR08CA0085.eurprd08.prod.outlook.com (2603:10a6:800:d3::11) 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-ms-office365-filtering-correlation-id: a7baa671-f851-4381-9817-08d69191a174 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(2017052603328)(7153060)(7193020); SRVR:BN6PR11MB0019; x-ms-traffictypediagnostic: BN6PR11MB0019: x-microsoft-exchange-diagnostics: =?iso-8859-1?Q?1; BN6PR11MB0019; 23:Yz5UqXVkYUu4Kg/L3zuSA83NggrmH7IDW+oaJfj?= =?iso-8859-1?q?py4kpPVAsc8prG9?= =?iso-8859-1?q?5Vb2sB+4VG+DgnnuHpQeDj+eTLd1JZIJfeRSPzNLT80swj2applyO2JaRGXK?= =?iso-8859-1?q?DfnaXk4XofcHijoxEJb+NFqU6fkUf1OHMgj3lnfOm2L6ArMp7I4sqKaQwSD0?= =?iso-8859-1?q?Xq4xPsuGr+x3ZT3wXc2bOB/EqPo0HvduulXeytVBttZHQ6FZ+5+6zx7ee4Vz?= =?iso-8859-1?q?NBPkAh4S5p9sgjUnrDtCjdHFFi0YevAaaB1nyAkjcssuELeJYzPbYSdWA1ZW?= =?iso-8859-1?q?8aHnBvt99nXGDvrH5k5IKfNYJW2D8aitrrs+N/vhemzDkSOLuwan7aE2ZI9u?= =?iso-8859-1?q?P0Ye+CnQo3mxf8b1AkIQafg/MqIk66rnTKgMuOJgVGNTHo7aFZmrj++CGNpO?= =?iso-8859-1?q?RjDxerdf4Jcs4dgpvi1ChQYR80FD08wXEjVz9aNfWccJ/3NYnKFT30lV6ctB?= =?iso-8859-1?q?WCbrEz6vpQ4WE+VIBZPwPKiFyQJ+44ubhF3T0H8VJycrl8oQlU0EVZhwmwR/?= =?iso-8859-1?q?4veUqvHaMlkC8jajz9UWECLgUS6U70aiSlCR2AsaGGZdyTVYO5L5tKjW0UlM?= =?iso-8859-1?q?Y5hW//PJ4yqXrR70pa0Slwu5u12RbBu0Ai4lnhVD8EdINvHoajGUROGT5hS1?= =?iso-8859-1?q?zAi2kLL18eujCotnpAYbUeZKnEY6yzVvbthtjEw9oGIjvo0fhq/HFNhWvB8B?= =?iso-8859-1?q?uE/+agE7DmWl0NsZXbJx6XiW9EcIqD8JbU1wIOZu50ldYTT+vSzenCUCglML?= =?iso-8859-1?q?Itqod2ST22irKYpAHsB1U6g6uVOhbvQp+95eE2YHoSyA+/0rYZFP0oHa5ALc?= =?iso-8859-1?q?zQcpKQ7xDC3ABXVvA8Jp4euPJBMn9BJLIrHkTUubbSvpLpES0ZxnJx4+Y2cC?= =?iso-8859-1?q?xHoqk1G9DbqXXpV4ldx/H+/8FFDomArId+6mgEsHKg6Cq+UkBfKgWY9GEry4?= =?iso-8859-1?q?k3WbCfgLVISX7uRZqVVBT8hQ+sGVnLFss2QzAO/HXoE/RmshS83maTJPGW6L?= =?iso-8859-1?q?Elbli7Glr9WD4uWiOUDg6E2v1/WHn4hQdug3gbR5QQJfIzjKQd79Qw9ukpQK?= =?iso-8859-1?q?2rUYtUhPYVgd/etT2XklBx5QK6SP5Xvjy+dlMQfhlPEtGS2PWMfg24534hLh?= =?iso-8859-1?q?KRaq+jNBQA1RRU+ytWPaEq171ODkdputHe3/7XwNKLFBoosN7nqfqrBlvc5R?= =?iso-8859-1?q?y/p20WXwpcDqe6mfZWFhfDZ1j5MtIXiV/PYSAfjP94GZTvfBQdH7ro8/uwcd?= =?iso-8859-1?q?uE9Lkdj0krTlXaaoeHfFf8PHQTNf7CLfvOj+l4OSkY7bBM79kSVsMWTTzd03?= =?iso-8859-1?q?GNTj27ONfhXP5cyt/HiLWyKVPVMeJ3tSF2tjam9LTJO81RE7lpUexbnL/OxL?= =?iso-8859-1?q?o3u1FkEOZ1GuU=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 094700CA91 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(366004)(136003)(376002)(39860400002)(189003)(199004)(81166006)(50226002)(106356001)(7416002)(6436002)(54906003)(2201001)(1076003)(81156014)(26005)(110136005)(476003)(102836004)(107886003)(8936002)(6512007)(6486002)(4326008)(446003)(2616005)(316002)(8676002)(105586002)(99286004)(66066001)(486006)(6116002)(3846002)(186003)(11346002)(86362001)(2906002)(72206003)(71190400001)(14454004)(76176011)(53936002)(71200400001)(478600001)(68736007)(6506007)(386003)(2501003)(52116002)(97736004)(14444005)(5024004)(7736002)(305945005)(256004)(25786009)(36756003)(41533002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR11MB0019; 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: u1hesAtNFzSAPFnjrA+oJnkSG2sdMc+l0aWEJ9Apyubgqj2/0Zg+LFLHKu3J+VznowhNxzKuwgQyMnpENzSMDTAx2zXrDkP8qzkTUsyYXtpoqiMDFjLrpyOE3ilAHrXyERyaRTBzlIWowJmTwGEbbvsZu5V6Xy9xUbg7tnkxOH33+aZrdFkq87Su948h843rhr2LOjzJt5lUoG/EfmO+0qnRmb8O/XOwU6Xvd7xzTs2wt8Hs9VGrjTh73tOJL1R7dMCErGbzVA3MWKQ5VaHulhslRyWVRSS8ZTMO6td1bqivwvx9szdr0nM5tvELCuf7tQ6hmLml6D+/ujLvxSJiYlc3ihOuKhlhCRAo+Nm3Gecd0Pz/m/emW9aG8ECbWbt8bTAQMb/EMfZRGUPlligoiRKpRsVzkgWGpLTHQYl4CCg= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: a7baa671-f851-4381-9817-08d69191a174 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2019 08:59:55.8050 (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: BN6PR11MB0019 X-OriginatorOrg: microchip.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190213_010003_703353_5FADEA1B X-CRM114-Status: GOOD ( 13.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tudor.Ambarus@microchip.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tudor Ambarus The sam9x60 board defines the CCFG_EBICSA register under SFR, and not as a MATRIX register, as previous boards do. Add a more generic name for the EBICSA regmap, as a prerequisite for sam9x60 nand controller support. Signed-off-by: Tudor Ambarus --- drivers/mtd/nand/raw/atmel/nand-controller.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c index 5781fcf6b76c..6aef98b7338a 100644 --- a/drivers/mtd/nand/raw/atmel/nand-controller.c +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c @@ -211,6 +211,7 @@ struct atmel_nand_controller_caps { bool legacy_of_bindings; u32 ale_offs; u32 cle_offs; + const char *ebi_csa_regmap_name; const struct atmel_nand_controller_ops *ops; }; @@ -233,7 +234,7 @@ to_nand_controller(struct nand_controller *ctl) struct atmel_smc_nand_controller { struct atmel_nand_controller base; - struct regmap *matrix; + struct regmap *ebi_csa_regmap; unsigned int ebi_csa_offs; }; @@ -1507,12 +1508,12 @@ static void atmel_smc_nand_init(struct atmel_nand_controller *nc, atmel_nand_init(nc, nand); smc_nc = to_smc_nand_controller(chip->controller); - if (!smc_nc->matrix) + if (!smc_nc->ebi_csa_regmap) return; /* Attach the CS to the NAND Flash logic. */ for (i = 0; i < nand->numcs; i++) - regmap_update_bits(smc_nc->matrix, smc_nc->ebi_csa_offs, + regmap_update_bits(smc_nc->ebi_csa_regmap, smc_nc->ebi_csa_offs, BIT(nand->cs[i].id), BIT(nand->cs[i].id)); } @@ -1833,7 +1834,7 @@ static void atmel_nand_controller_cleanup(struct atmel_nand_controller *nc) clk_put(nc->mck); } -static const struct of_device_id atmel_matrix_of_ids[] = { +static const struct of_device_id atmel_ebi_csa_regmap_of_ids[] = { { .compatible = "atmel,at91sam9260-matrix", .data = (void *)AT91SAM9260_MATRIX_EBICSA, @@ -1982,25 +1983,26 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc) struct device_node *np; int ret; - /* We do not retrieve the matrix syscon when parsing old DTs. */ + /* We do not retrieve the EBICSA regmap when parsing old DTs. */ if (nc->base.caps->legacy_of_bindings) return 0; - np = of_parse_phandle(dev->parent->of_node, "atmel,matrix", 0); + np = of_parse_phandle(dev->parent->of_node, + nc->base.caps->ebi_csa_regmap_name, 0); if (!np) return 0; - match = of_match_node(atmel_matrix_of_ids, np); + match = of_match_node(atmel_ebi_csa_regmap_of_ids, np); if (!match) { of_node_put(np); return 0; } - nc->matrix = syscon_node_to_regmap(np); + nc->ebi_csa_regmap = syscon_node_to_regmap(np); of_node_put(np); - if (IS_ERR(nc->matrix)) { - ret = PTR_ERR(nc->matrix); - dev_err(dev, "Could not get Matrix regmap (err = %d)\n", ret); + if (IS_ERR(nc->ebi_csa_regmap)) { + ret = PTR_ERR(nc->ebi_csa_regmap); + dev_err(dev, "Could not get EBICSA regmap (err = %d)\n", ret); return ret; } @@ -2341,6 +2343,7 @@ static const struct atmel_nand_controller_ops at91rm9200_nc_ops = { static const struct atmel_nand_controller_caps atmel_rm9200_nc_caps = { .ale_offs = BIT(21), .cle_offs = BIT(22), + .ebi_csa_regmap_name = "atmel,matrix", .ops = &at91rm9200_nc_ops, }; @@ -2355,12 +2358,14 @@ static const struct atmel_nand_controller_ops atmel_smc_nc_ops = { static const struct atmel_nand_controller_caps atmel_sam9260_nc_caps = { .ale_offs = BIT(21), .cle_offs = BIT(22), + .ebi_csa_regmap_name = "atmel,matrix", .ops = &atmel_smc_nc_ops, }; static const struct atmel_nand_controller_caps atmel_sam9261_nc_caps = { .ale_offs = BIT(22), .cle_offs = BIT(21), + .ebi_csa_regmap_name = "atmel,matrix", .ops = &atmel_smc_nc_ops, }; @@ -2368,6 +2373,7 @@ static const struct atmel_nand_controller_caps atmel_sam9g45_nc_caps = { .has_dma = true, .ale_offs = BIT(21), .cle_offs = BIT(22), + .ebi_csa_regmap_name = "atmel,matrix", .ops = &atmel_smc_nc_ops, };