From patchwork Wed Feb 13 08:59:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 1041057 X-Patchwork-Delegate: miquel.raynal@bootlin.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TW89Z9US"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="OQymV7ck"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43ztll40sZz9sML for ; Wed, 13 Feb 2019 20:00:35 +1100 (AEDT) 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=PKvcXVmHLFnXUxIOLa0QzHXekaUW5Zv6hvZMS3UAqm8=; b=TW89Z9USm9yc/x 4MYwpp2jJ6fi+f4z5v/qMCBc/npgIeQAoDkdbu1jz58bVz/IgNWiG2yzMaWJGB4SG81EpJgV7s+ms /CsS15JdaQPDph4TXbVBnMKwGAf8RjITx/Jl2DG9pLSQQRglLCuI5L5VPy2b7vG0sFFyHRTVUczmZ LtYAmNdLsKMprNSZ+e9cfPEX6t6WSV9hlVPq/A+c/0SIPSLZJ9r2B04zPY2xs9H161blCXNpkpTcN p3e2zYe9W/QpmdnrNocKM+z4Ic4mvdqO4jIo06GcCqLRsm6VZF2Gw8ymkpkQJ6YjzAngy8NvZ2TuH Ycnd13uLBWIIumMkGi7Q==; 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 1gtqP6-0007Ey-Bo; Wed, 13 Feb 2019 09:00:28 +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 1gtqOV-0005Hm-Mr; Wed, 13 Feb 2019 08:59:55 +0000 X-IronPort-AV: E=Sophos;i="5.58,365,1544511600"; d="scan'208";a="23778136" 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; 13 Feb 2019 01:59:51 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.105) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 13 Feb 2019 01:59:50 -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=Hc4nV9jdLKYNjIUT+gRpNFusDLGZhRyZ8ciEoFGPcx0=; b=OQymV7ckweMKp+j8tid0b2UoC/XDJpijDFAt3zyxeJVFQiWdqsj361CQuuIKLf9vqx3E2RpUEl5qCwWcZlZbqAql44j/aT+s0TNf2gX6xK1FCyQUiflzAoYt7O69kYtA5JPbHh2BekE+pH5sXTpV26CagcClYwXagHoUJkLW03k= 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:48 +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:48 +0000 From: To: , , , , , , , , , , , Subject: [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap Thread-Topic: [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap Thread-Index: AQHUw3p49S/sYBbl10WTjl6hIGDc8A== Date: Wed, 13 Feb 2019 08:59:48 +0000 Message-ID: <20190213085930.31578-3-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: ae6e05dd-e7e6-40c8-ef9f-08d691919b13 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:557XpDeJbzlhl/SeyL9HDqRRS80Xvci+V6bqinC?= =?iso-8859-1?q?oCwpWXF6bKiFV3sOD9aO9kDjd?= =?iso-8859-1?q?BCngbtnkzm3L80tesAErSbPhByIpbYk+fNppboWGXgVYhhgU7dx?= =?iso-8859-1?q?nc+C+rxiaFaziDHFKKshZCmJa6CXFHDKsuowLN5SCEigv4kCWrz?= =?iso-8859-1?q?P3BaQNqNTIjGyCPQs5ZpR8kn+8ZPsdZz0OzvLfrVVcnPVcB/NIL?= =?iso-8859-1?q?JhfwuNKqDyE+e9aV7Ueri5vfq+6ansD4ROuHvYtcOnZ/DIwkx/v?= =?iso-8859-1?q?NslpZoI1YN1EKZJ6GWEqzoXfyrrmoHj/AHtbXfYU7kZdvY0C/0m?= =?iso-8859-1?q?Tv3hnjXPK+vwWQKs9EXXkWJIAKhUVta8oJFVjutJ+xyLcmll/cw?= =?iso-8859-1?q?zOgNYS9ZuRBaEVB+IqvczZ9ngzB8KHbfQcIlChbP5qeFgXuHKmQ?= =?iso-8859-1?q?bRrZxuncMQjsene0X2SNskrGBC2rSbn6aeDh0Y6NDfkfBOIGPzg?= =?iso-8859-1?q?vyOx2jyXPWHTUL0q/fD2FCANR1yo2fD9GucYungafDRVU4HxJfe?= =?iso-8859-1?q?WKGc4WAlCjLka9l3NW22c7+kn2EFfF/BXScmyN5lxix4IZGZ2kg?= =?iso-8859-1?q?Ahyo1G+ybMQhpnee3DwvKxRdmka+EiBJZu0NsNxYD2P56bGcbPN?= =?iso-8859-1?q?Z/dxWDyqVgcH/+z/4DdgWmjyb1IZxtROyGJV3XQi59LZYJZ4IVp?= =?iso-8859-1?q?Eg6J7Hp+I/BeeDBc3gsbN9Bgu5pRZoRga3GxG3WwokVuEkwGb8g?= =?iso-8859-1?q?H5/2Biq5eoir4n3LHgZ+WoX8QmpUWPEip5M3cBDks6xWPsrV5l/?= =?iso-8859-1?q?0tNcvJ/q469gOYN1scseswZQ+fWoatBHkrAEw0rMDalgQSigRDC?= =?iso-8859-1?q?dq3YEHgv0Frkwg8oSQSHFOz6zN7ponRm7AsQKwUn/nQ+Jr8YHi5?= =?iso-8859-1?q?WvZyFAVj7pZrIrMm+3KnmB6IU7TffZzt8FyofuHaZgb0w0sM/jw?= =?iso-8859-1?q?2/U9NwqaUEeqzfgiUrkLyan161jlSLWnGZTZTSXG5Z/4ByCcept?= =?iso-8859-1?q?FK0VBiIN+i/r/z8QMQSYFkAt49AWIHtr087X9bCHRjEYMKancDE?= =?iso-8859-1?q?5ns/rbKubqgH/Eih9qaRM57ovOaLQdi0R+RsyFwrfuoH736lm4r?= =?iso-8859-1?q?E4gCWL/+xzn/mt33oYw6Sudcb8I2R9q55eR08ithKRM909PL1UF?= =?iso-8859-1?q?LHDKhQvpHQXxcOW8L1qtBMJOAevJmQ4pLrYSjnwkjgd9VhkTmUq?= =?iso-8859-1?q?0PSrgCNJrf1rGC3hiOyFeuCm01GcljKoxOYVtrpMJJIVNBvoLj3?= =?iso-8859-1?q?4aHJ1EDqlM9e3Ong6c64iJMt3m9os/NyUHYQwPHls3KDYl+WMwV?= =?iso-8859-1?q?vWZSn/MyYwPMjN4tBjWewUcCQcpczjehuH2lCvSlPdeGDT5IPvE?= =?iso-8859-1?q?WYs6zjMnq9JxXUEsgO7xSFLerRA=3D=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)(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: 9IhWswPpxidizIm7BL911oEu48ryQUJdhvfB1rQp94+beokjqxVT+EsFRKqDRIOgKW4e3F78KorxMF6V07VgUnIWvuqnOTIyI8jvQ6Vf18tiSNq2eGOiFcxfGTjVWnaR2mnXn74y1drIOGmlHaVgBJzBuM3I2wIaZoq/FjxBeUuk507YZ5KnsFkunM/eLhYXD9LXbqoAvUXGSGPysiaCCzqMoMXavFIozB2AKKcYiR1Tu99x029Id9F81D3BWphqCpQisqgPINjdTFfQdwAR4z3duBgVh9Y9PpkeiuC7DSAzePUMsuhQ00LNUZJEFs4U/uWfk5c42KmCGTsf3G7olz1UQ7EQGNH6SnkWPjR71IIY7eyRmpdHTRQwTX6+fIW4npIxTJ4R/TgdSyu8/Mk5pXDADsYTHK9bd+B47fq2OAM= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ae6e05dd-e7e6-40c8-ef9f-08d691919b13 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Feb 2019 08:59:45.2083 (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_005952_111393_BBBC386B X-CRM114-Status: GOOD ( 14.03 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.71.154.253 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 DKIMWL_WL_MED DKIMwl.org - Whitelisted Medium sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list 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-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 EBI regmap as a prerequisite for sam9x60 ebi support. Signed-off-by: Tudor Ambarus Acked-by: Alexandre Belloni --- drivers/memory/atmel-ebi.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c index c3748b414c27..b45914cfa212 100644 --- a/drivers/memory/atmel-ebi.c +++ b/drivers/memory/atmel-ebi.c @@ -36,6 +36,7 @@ struct atmel_ebi_dev { struct atmel_ebi_caps { unsigned int available_cs; unsigned int ebi_csa_offs; + const char *regmap_name; void (*get_config)(struct atmel_ebi_dev *ebid, struct atmel_ebi_dev_config *conf); int (*xlate_config)(struct atmel_ebi_dev *ebid, @@ -47,7 +48,7 @@ struct atmel_ebi_caps { struct atmel_ebi { struct clk *clk; - struct regmap *matrix; + struct regmap *regmap; struct { struct regmap *regmap; struct clk *clk; @@ -357,7 +358,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, * one "atmel,smc-" property is present. */ if (ebi->caps->ebi_csa_offs && apply) - regmap_update_bits(ebi->matrix, + regmap_update_bits(ebi->regmap, ebi->caps->ebi_csa_offs, BIT(cs), 0); @@ -372,6 +373,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, static const struct atmel_ebi_caps at91sam9260_ebi_caps = { .available_cs = 0xff, .ebi_csa_offs = AT91SAM9260_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -380,6 +382,7 @@ static const struct atmel_ebi_caps at91sam9260_ebi_caps = { static const struct atmel_ebi_caps at91sam9261_ebi_caps = { .available_cs = 0xff, .ebi_csa_offs = AT91SAM9261_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -388,6 +391,7 @@ static const struct atmel_ebi_caps at91sam9261_ebi_caps = { static const struct atmel_ebi_caps at91sam9263_ebi0_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9263_MATRIX_EBI0CSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -396,6 +400,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi0_caps = { static const struct atmel_ebi_caps at91sam9263_ebi1_caps = { .available_cs = 0x7, .ebi_csa_offs = AT91SAM9263_MATRIX_EBI1CSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -404,6 +409,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi1_caps = { static const struct atmel_ebi_caps at91sam9rl_ebi_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9RL_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -412,6 +418,7 @@ static const struct atmel_ebi_caps at91sam9rl_ebi_caps = { static const struct atmel_ebi_caps at91sam9g45_ebi_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9G45_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -420,6 +427,7 @@ static const struct atmel_ebi_caps at91sam9g45_ebi_caps = { static const struct atmel_ebi_caps at91sam9x5_ebi_caps = { .available_cs = 0x3f, .ebi_csa_offs = AT91SAM9X5_MATRIX_EBICSA, + .regmap_name = "atmel,matrix", .get_config = at91sam9_ebi_get_config, .xlate_config = atmel_ebi_xslate_smc_config, .apply_config = at91sam9_ebi_apply_config, @@ -543,13 +551,14 @@ static int atmel_ebi_probe(struct platform_device *pdev) /* * The sama5d3 does not provide an EBICSA register and thus does need - * to access the matrix registers. + * to access it. */ if (ebi->caps->ebi_csa_offs) { - ebi->matrix = - syscon_regmap_lookup_by_phandle(np, "atmel,matrix"); - if (IS_ERR(ebi->matrix)) - return PTR_ERR(ebi->matrix); + ebi->regmap = + syscon_regmap_lookup_by_phandle(np, + ebi->caps->regmap_name); + if (IS_ERR(ebi->regmap)) + return PTR_ERR(ebi->regmap); } ret = of_property_read_u32(np, "#address-cells", &val);