[{"id":1759783,"web_url":"http://patchwork.ozlabs.org/comment/1759783/","msgid":"<HE1PR04MB124123999DA6E9CEE905F890979C0@HE1PR04MB1241.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-08-30T00:37:29","subject":"RE: [PATCH v2] mtd: map: new driver for NXP IFC","submitter":{"id":68094,"url":"http://patchwork.ozlabs.org/api/people/68094/","name":"Prabhakar Kushwaha","email":"prabhakar.kushwaha@nxp.com"},"content":"Dear Matt,\n\n> -----Original Message-----\n> From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of\n> Matt Weber\n> Sent: Wednesday, August 30, 2017 1:17 AM\n> To: linux-mtd@lists.infradead.org\n> Cc: Matt Weber <matthew.weber@rockwellcollins.com>; boris.brezillon@free-\n> electrons.com; Sanjay Tandel <sanjay.tandel@rockwellcollins.com>;\n> arnd@arndb.de\n> Subject: [PATCH v2] mtd: map: new driver for NXP IFC\n> \n> From: Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n> \n> This patch adds map driver for parallel flash chips interfaced over\n> a NXP Integrated Flash Controller (IFC). This driver allows either\n> 8-bit or 16-bit accesses, depending on bank-width, to parallel flash\n> chips(like Everspin MR0A16A), which are physically mapped to CPU's\n> memory space. For unaligned accesses, it performs read-modify-write\n> operations to keep access size same as bank-width.\n> \n\n\nIFC is configured as per Flash's width per Chip select via boot-loader. \n\nCan you please share more details about the driver requirement. \nWhat is not working with NXP IFC?\n\n--prabhakar","headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"tJwT7ixV\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"Wi/JOeMd\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=prabhakar.kushwaha@nxp.com; "],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhmnW5pd2z9s8w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 10:38:07 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dmr17-0006Ao-GN; Wed, 30 Aug 2017 00:38:01 +0000","from mail-db5eur03on062d.outbound.protection.outlook.com\n\t([2a01:111:f400:fe0a::62d]\n\thelo=EUR03-DB5-obe.outbound.protection.outlook.com)\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dmr13-00068s-F6\n\tfor linux-mtd@lists.infradead.org; Wed, 30 Aug 2017 00:38:00 +0000","from HE1PR04MB1241.eurprd04.prod.outlook.com (10.162.249.154) by\n\tHE1PR04MB1658.eurprd04.prod.outlook.com (10.164.49.12) with Microsoft\n\tSMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.1.1385.9; Wed, 30 Aug 2017 00:37:29 +0000","from HE1PR04MB1241.eurprd04.prod.outlook.com\n\t([fe80::5d83:2859:2d2b:f75d]) by\n\tHE1PR04MB1241.eurprd04.prod.outlook.com\n\t([fe80::5d83:2859:2d2b:f75d%13]) with mapi id 15.01.1385.014;\n\tWed, 30 Aug 2017 00:37:29 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:\n\tMessage-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=1eSPxtqH24ykQzsDSZz0LOk41P97nsfQBNCRc+du72U=;\n\tb=tJwT7ixV/B0ltA\n\tNnyf0kk2RIs3hF/U7OtkS2Q3oP2LsKIRqEI5PZc3E9rL4rmH4nDdDox4P52WAwjK/VTDxdET4Xz+n\n\tUdJ+67eugalGR+8k5c8MFhbaYvQzav5znvhDnUEIc+/32++VL4ryJOoQ+aLdGQJp6efjvboS4KxXq\n\t79N/fOKXWZZSuJ9IiqGWUnfRxpm0xfJIROp9D/5oGZ+trYpSIkM+ZFIgdoF9MQQvHTPGo8/6WCiUT\n\tR0bPrvQO5IU/+LGXBbQaZoCiAzLL85OAJH8jpa8bf5c6oZNWpMaZgEHRac64Dd8VCNkzuwRXeV5To\n\tbEp8l9GmOoqiumvhcszg==;","v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=iZqx5SRxHxrAfrFYp5JsSNl1Hy5KEQJ4CcRsvkpgpE0=;\n\tb=Wi/JOeMdV2DGXaQVcV8CYn2p4zlZykP8h7rnME5rS3UYty1IptU+Z86v8pP8EnkzTjMPyKKPmqFIr0X7BmvMf+RBej//DfhmqAM4MFEpmAmGklFNfOo2+VzLaILCjYNeJUWagFMzhWmIyqjItMvDTMv47V/jmny1RjIlSwYvDRA="],"From":"Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>","To":"Matt Weber <matthew.weber@rockwellcollins.com>,\n\t\"linux-mtd@lists.infradead.org\" <linux-mtd@lists.infradead.org>","Subject":"RE: [PATCH v2] mtd: map: new driver for NXP IFC","Thread-Topic":"[PATCH v2] mtd: map: new driver for NXP IFC","Thread-Index":"AQHTIP++qsZ5RswyiEih0NSgQR5Xq6KcDYvQ","Date":"Wed, 30 Aug 2017 00:37:29 +0000","Message-ID":"<HE1PR04MB124123999DA6E9CEE905F890979C0@HE1PR04MB1241.eurprd04.prod.outlook.com>","References":"<1504036047-38848-1-git-send-email-matthew.weber@rockwellcollins.com>","In-Reply-To":"<1504036047-38848-1-git-send-email-matthew.weber@rockwellcollins.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","authentication-results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"tJwT7ixV\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"Wi/JOeMd\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=prabhakar.kushwaha@nxp.com; "],"x-originating-ip":"[116.74.20.77]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; HE1PR04MB1658;\n\t6:m/QBWoZibmRnhxngeSHbJmBJgOwybK3SVP0r7DcDSar4XLWFilHrWbtUIIxvFNlWJvxvr1sdn9sJdT+UD7JYWYybzMS55T5czoozsRWj7q5gknmEb8se7XDb53g7pE3lhiH1Uw9KZVudRXU7Gt+geaj7w7tkav/sephz1eYGwQ83dNlHqqSIMcR/I47DCFhrixT6Nkpk64szNKjubNPYek8k5MPoi3Zn1yR5zeNPD0511vGTEKgvPbdMDmsFfPIHXFW7z5vTZSxz3b+G6hyk2i9MXJhUBTDlXyxLnOuxbsq3BHIYIRLm4ycWG3+uJ4u3x6LA2YsP/afcZGbTSYr1mA==;\n\t5:r2Xa8wYFYR3ywjyOpBPtsMzkOVclv+myevdu0INNJbyZkUjwkGhd4kFedGSBULDf1a1zPF/Kb5TmoP6nYtBgj/8Y51zIjJXUAo1I1Y0hVBUOqok/SXASqAhn+iORqk2o1oabaoX1f8EEaFhds0eG4w==;\n\t24:5mqOxaq9qtM9+NkqzoczMim+iUdDj6sNLEkoSdnYx7aJzhRxbGM7ztCcQrb0CgQ9q65lStD/eoHaUQHDWTmJn3aByVMWGEsl0HkU7ZmcjAo=;\n\t7:eAhSdEY/TTP41O8Hv9LLumjW40MQXefGf3B8GZfF4It2yJCQEVfTEqbbYY+g/1LKrkswl/idVNCKt0T8eqIjXhRQFPbNlg4QFEqWU72xDYfsAU/WBmLxQgw3DhOQS1vT3VyXoEramt5yyzU50dxhjlmCNcTsdSfN+f1TjbbT5/kohlEiH4udoZoLUb3xjxdGiChLQBGaFU23xNHOObYbBx/XnkffZbhNuVfolsSZ2AI=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;","x-ms-office365-filtering-correlation-id":"4217c5a2-e558-476d-e49d-08d4ef3f4b7d","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:HE1PR04MB1658; ","x-ms-traffictypediagnostic":"HE1PR04MB1658:","x-exchange-antispam-report-test":"UriScan:(258649278758335);","x-microsoft-antispam-prvs":"<HE1PR04MB1658749ED89D38686D46C108979C0@HE1PR04MB1658.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:HE1PR04MB1658; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:HE1PR04MB1658; ","x-forefront-prvs":"041517DFAB","x-forefront-antispam-report":"SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(189002)(199003)(13464003)(377454003)(6436002)(14454004)(53936002)(66066001)(3660700001)(2900100001)(189998001)(2950100002)(55016002)(54906002)(99286003)(76176999)(7696004)(50986999)(54356999)(2501003)(68736007)(25786009)(5250100002)(413944005)(5660300001)(8936002)(305945005)(6246003)(53546010)(74316002)(575784001)(86362001)(7736002)(9686003)(81166006)(81156014)(3280700002)(106356001)(105586002)(33656002)(6116002)(3846002)(102836003)(97736004)(478600001)(6506006)(101416001)(229853002)(2906002)(8676002)(4326008);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR04MB1658;\n\tH:HE1PR04MB1241.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"30 Aug 2017 00:37:29.3039\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"HE1PR04MB1658","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170829_173758_044723_090B8DE0 ","X-CRM114-Status":"UNSURE (   7.29  )","X-CRM114-Notice":"Please train this message.","X-Spam-Score":"-2.0 (--)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2a01:111:f400:fe0a:0:0:0:62d listed in] [list.dnswl.org]\n\t0.0 T_SPF_PERMERROR        SPF: test of record failed (permerror)\n\t-0.0 SPF_HELO_PASS          SPF: HELO matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"Scott Wood <oss@buserror.net>, \"boris.brezillon@free-electrons.com\"\n\t<boris.brezillon@free-electrons.com>, \n\tSanjay Tandel <sanjay.tandel@rockwellcollins.com>,\n\t\"arnd@arndb.de\" <arnd@arndb.de>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"}},{"id":1760404,"web_url":"http://patchwork.ozlabs.org/comment/1760404/","msgid":"<CAB0kKmzppQu7i8gqp_Q-5NYoPLoEbBJy2Bgdawv7Ek6OgWav2w@mail.gmail.com>","list_archive_url":null,"date":"2017-08-30T18:48:20","subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","submitter":{"id":72151,"url":"http://patchwork.ozlabs.org/api/people/72151/","name":"Sanjay Tandel","email":"sanjay.tandel@rockwellcollins.com"},"content":"Hi Prabhakar,\n\nOn Tue, Aug 29, 2017 at 7:37 PM, Prabhakar Kushwaha\n<prabhakar.kushwaha@nxp.com> wrote:\n> Dear Matt,\n>\n>> -----Original Message-----\n>> From: linux-mtd [mailto:linux-mtd-bounces@lists.infradead.org] On Behalf Of\n>> Matt Weber\n>> Sent: Wednesday, August 30, 2017 1:17 AM\n>> To: linux-mtd@lists.infradead.org\n>> Cc: Matt Weber <matthew.weber@rockwellcollins.com>; boris.brezillon@free-\n>> electrons.com; Sanjay Tandel <sanjay.tandel@rockwellcollins.com>;\n>> arnd@arndb.de\n>> Subject: [PATCH v2] mtd: map: new driver for NXP IFC\n>>\n>> From: Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n>>\n>> This patch adds map driver for parallel flash chips interfaced over\n>> a NXP Integrated Flash Controller (IFC). This driver allows either\n>> 8-bit or 16-bit accesses, depending on bank-width, to parallel flash\n>> chips(like Everspin MR0A16A), which are physically mapped to CPU's\n>> memory space. For unaligned accesses, it performs read-modify-write\n>> operations to keep access size same as bank-width.\n>>\n>\n>\n> IFC is configured as per Flash's width per Chip select via boot-loader.\n\nThat's right. We are configuring IFC from boot-loader.\n\n>\n> Can you please share more details about the driver requirement.\n> What is not working with NXP IFC?\n\n8-bit accesses to 16-bit MRAM (through IFC) , using MTD map driver,\nseem to corrupt the data.\nWe need this driver to limit all accesses to be bank-width size,\n\nFor more details, please refer the discussion on following thread:\nhttps://patchwork.ozlabs.org/patch/797787/\n\n>\n> --prabhakar\n>\n\nRegards,\nSanjay","headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"aCcGjZX/\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjF0x57tZz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 04:49:37 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dn83M-0008T2-ST; Wed, 30 Aug 2017 18:49:28 +0000","from da1vs04.rockwellcollins.com ([205.175.227.52])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dn82x-0008Rn-Mf\n\tfor linux-mtd@lists.infradead.org; Wed, 30 Aug 2017 18:49:05 +0000","from unknown (HELO mail-yw0-f200.google.com) ([205.175.227.20])\n\tby da1vs04.rockwellcollins.com with ESMTP/TLS/AES128-GCM-SHA256;\n\t30 Aug 2017 13:48:42 -0500","by mail-yw0-f200.google.com with SMTP id e9so13151724ywh.8\n\tfor <linux-mtd@lists.infradead.org>;\n\tWed, 30 Aug 2017 11:48:42 -0700 (PDT)","by 10.129.170.79 with HTTP; Wed, 30 Aug 2017 11:48:20 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=Fi8QsW/DvX0ECPTuJLs+11nune4VkZ7dUK/0idBYhIw=;\n\tb=aCcGjZX/CJ9p84\n\t8+CwAqZsxpc+etFblyW29xPLPGIUTV7+ZdXCiGCVeHvbjJG+n4dOxQJWr2VoUUfptLhYsV5BwD/Pp\n\tWwazO2n22xgmBmyzHSSBwHMvOtm+wR8ANDi5ry0kqBY//x5AgsaRfFgdS5OqXexJ9pKZdE8hxeRV4\n\tOYyhQ05ExHI+AYno7LgGnNr2gOKHcSqlBPu8AeHIPfVfwfQbr9RUTKqn1DEwUf45R+vVRkYD6gMrR\n\tmCF9qkLUlWDWts5SHHNxegqoPvj+EGwoGM4zTTGk6gPQ12ELecarUQOyDqa3eYxoC7gM5e1pSA3n6\n\t3O/VfkuFEq/kYSxsjd3w==;","X-RC-All-From":", 205.175.227.20, No hostname,\n\tsanjay.tandel@rockwellcollins.com, \n\tSanjay Tandel <sanjay.tandel@rockwellcollins.com>, , ","X-RC-Attachments":", ,","X-RC-RemoteIP":"205.175.227.20","X-RC-RemoteHost":"No hostname","X-RC-IP-Hostname":"da1ip04.rockwellcollins.com","X-RC-IP-MID":"56758","X-RC-IP-Group":"GOOGLE_RELAYED","X-RC-IP-Policy":"$GOOGLE_RELAYED","X-RC-IP-SBRS":"None","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=OXmBLt/gqgpIJgzZFOHHr9RbD3zWb96eJmWbP8e2+0A=;\n\tb=d5N55SDO6v/gagYLH4Wey1ltUUukqx8T/yUkx6im3xJQMcr0wEJ7Y1YF42LMqoU39I\n\t5I6uT0GA5fLMXxREljlpjHIOE1Pz9rjoMKinScf0H3chHP99bWiNqTOPdRVocA5U/Wz8\n\t6KJ8lPeq0rKXovDDbmwjjaASNM4Cy6nrER4l3Nh+C4pNIrPF06xcElsVDJYTPOPnPhuS\n\tpw9aUN8DycqsPUbaauGWOCoqkshiwhMyAObDoKO5l1IdnHKbGWUu52iYcSAb7cpOVKSL\n\tW1jCOr+GG1rRAjdsPkkJrpWRJ0Qz/KMM1usC4v5+Q3WFGkF4eAsDUqv0BZOkF4gPxCfE\n\t64LQ==","X-Gm-Message-State":"AHYfb5jvFWSmri852IOTJ6KFW6e7po4XVB6+FeTOTq5G08h1/XAWz10q\n\tVgjiwJMWbArMnj2LpmUR2BJZVc86tNZsq36zy7XLD7xknp3usjzE42s5y7nMgvgRvPFumN1xAyZ\n\t1VoeQmZ38sdHCyT3TP6uIaJ110iX8w/QYyv3HHzBaYlz8E5FOYIw=","X-Received":["by 10.129.87.74 with SMTP id l71mr2048801ywb.367.1504118921745; \n\tWed, 30 Aug 2017 11:48:41 -0700 (PDT)","by 10.129.87.74 with SMTP id l71mr2048793ywb.367.1504118921532; \n\tWed, 30 Aug 2017 11:48:41 -0700 (PDT)"],"MIME-Version":"1.0","In-Reply-To":"<HE1PR04MB124123999DA6E9CEE905F890979C0@HE1PR04MB1241.eurprd04.prod.outlook.com>","References":"<1504036047-38848-1-git-send-email-matthew.weber@rockwellcollins.com>\n\t<HE1PR04MB124123999DA6E9CEE905F890979C0@HE1PR04MB1241.eurprd04.prod.outlook.com>","From":"Sanjay Tandel <sanjay.tandel@rockwellcollins.com>","Date":"Wed, 30 Aug 2017 13:48:20 -0500","Message-ID":"<CAB0kKmzppQu7i8gqp_Q-5NYoPLoEbBJy2Bgdawv7Ek6OgWav2w@mail.gmail.com>","Subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","To":"Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170830_114903_821462_4C214FB9 ","X-CRM114-Status":"GOOD (  10.67  )","X-Spam-Score":"-1.9 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"Matt Weber <matthew.weber@rockwellcollins.com>,\n\t\"boris.brezillon@free-electrons.com\"\n\t<boris.brezillon@free-electrons.com>, \n\t\"linux-mtd@lists.infradead.org\" <linux-mtd@lists.infradead.org>,\n\tScott Wood <oss@buserror.net>, \"arnd@arndb.de\" <arnd@arndb.de>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"}},{"id":1760430,"web_url":"http://patchwork.ozlabs.org/comment/1760430/","msgid":"<20170830213450.663a218a@bbrezillon>","list_archive_url":null,"date":"2017-08-30T19:34:50","subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","submitter":{"id":63120,"url":"http://patchwork.ozlabs.org/api/people/63120/","name":"Boris Brezillon","email":"boris.brezillon@free-electrons.com"},"content":"Hi,\n\nOn Tue, 29 Aug 2017 14:47:27 -0500\nMatt Weber <matthew.weber@rockwellcollins.com> wrote:\n\n> From: Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n> \n> This patch adds map driver for parallel flash chips interfaced over\n> a NXP Integrated Flash Controller (IFC). This driver allows either\n> 8-bit or 16-bit accesses, depending on bank-width, to parallel flash\n> chips(like Everspin MR0A16A), which are physically mapped to CPU's\n> memory space. For unaligned accesses, it performs read-modify-write\n> operations to keep access size same as bank-width.\n> \n\nDid you consider re-using the physmap driver [1] and adjust it to your\nneeds like the gemini [2] or versatile [3] drivers do? If you did, what\nprevents you from using this approach?\n\nRegards,\n\nBoris\n\n[1]http://elixir.free-electrons.com/linux/v4.13-rc7/source/drivers/mtd/maps/physmap_of_core.c\n[2]http://elixir.free-electrons.com/linux/v4.13-rc7/source/drivers/mtd/maps/physmap_of_gemini.c\n[3]http://elixir.free-electrons.com/linux/v4.13-rc7/source/drivers/mtd/maps/physmap_of_versatile.c\n\n> Signed-off-by: Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n> Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>\n> ---\n> \n> Changes\n> v1 -> v2\n>  - Refactored driver to be custom for the IFC bus controllder\n>   (Suggested by Boris)\n>  - Updated patch name\n>  - Cleaned up description to be specific about issue and behavior\n>  - Version 1 - https://patchwork.ozlabs.org/patch/797787/\n> ---\n>  Documentation/devicetree/bindings/mtd/ifc-mram.txt |  34 ++\n>  drivers/mtd/maps/Kconfig                           |  13 +\n>  drivers/mtd/maps/Makefile                          |   1 +\n>  drivers/mtd/maps/ifc_mram.c                        | 343 +++++++++++++++++++++\n>  4 files changed, 391 insertions(+)\n>  create mode 100644 Documentation/devicetree/bindings/mtd/ifc-mram.txt\n>  create mode 100644 drivers/mtd/maps/ifc_mram.c\n> \n> diff --git a/Documentation/devicetree/bindings/mtd/ifc-mram.txt b/Documentation/devicetree/bindings/mtd/ifc-mram.txt\n> new file mode 100644\n> index 0000000..c5c3210\n> --- /dev/null\n> +++ b/Documentation/devicetree/bindings/mtd/ifc-mram.txt\n> @@ -0,0 +1,34 @@\n> +Integrated Flash Controller based physically-mapped parallel MRAM,\n> +NOR flash, MTD-RAM (NVRAM...)\n> +\n> + - compatible : should contain the specific model of mtd chip(s)\n> +   used, if known, followed by \"ifc-mram\".\n> + - reg : Address range(s) of the mtd chip(s)\n> +   It's possible to (optionally) define multiple \"reg\" tuples so that\n> +   non-identical chips can be described in one node.\n> + - bank-width : Width (in bytes) of the bank.  Equal to the\n> +   device width times the number of interleaved chips.\n> + - device-width : (optional) Width of a single mtd chip.  If\n> +   omitted, assumed to be equal to 'bank-width'.\n> + - #address-cells, #size-cells : Must be present if the device has\n> +   sub-nodes representing partitions (see below).  In this case\n> +   both #address-cells and #size-cells must be equal to 1.\n> + - linux,mtd-name: allow to specify the mtd name.\n> +\n> +The device tree may optionally contain sub-nodes describing partitions of the\n> +address space. See partition.txt for more detail.\n> +\n> +Example:\n> +\n> +        mram@1,0 {\n> +                #address-cells = <1>;\n> +                #size-cells = <1>;\n> +                compatible = \"everspin,mram\", \"ifc-mram\";\n> +                reg = <0x1 0x0 0x10000 0x1 0x10000 0x10000>;\n> +                bank-width = <2>;\n> +\n> +                partition@0 {\n> +                        reg = <0 0x00020000>;\n> +                        label = \"MRAM Data 0\";\n> +                };\n> +        };\n> diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig\n> index 542fdf8..95bd44e 100644\n> --- a/drivers/mtd/maps/Kconfig\n> +++ b/drivers/mtd/maps/Kconfig\n> @@ -419,4 +419,17 @@ config MTD_LATCH_ADDR\n>  \n>            If compiled as a module, it will be called latch-addr-flash.\n>  \n> +config MTD_IFC_MRAM\n> +\ttristate \"Map driver for Integrated Flash Controller\"\n> +\tdepends on MTD_COMPLEX_MAPPINGS\n> +\thelp\n> +\t  Map driver for chips connected parallely to Integrated Flash\n> +\t  Controller. This driver allows either 8-bit or 16-bit accesses,\n> +\t  depending on bank-width, to parallel flash chips, which are\n> +\t  physically mapped to CPU's memory space. For unaligned accesses,\n> +\t  it does read-modify-write.\n> +\t  Example: Everspin MR0A16A.\n> +\n> +\t  If compiled as a module, it will be called ifc-mram.\n> +\n>  endmenu\n> diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile\n> index 5a09a72..0ab793e 100644\n> --- a/drivers/mtd/maps/Makefile\n> +++ b/drivers/mtd/maps/Makefile\n> @@ -47,3 +47,4 @@ obj-$(CONFIG_MTD_VMU)\t\t+= vmu-flash.o\n>  obj-$(CONFIG_MTD_GPIO_ADDR)\t+= gpio-addr-flash.o\n>  obj-$(CONFIG_MTD_LATCH_ADDR)\t+= latch-addr-flash.o\n>  obj-$(CONFIG_MTD_LANTIQ)\t+= lantiq-flash.o\n> +obj-$(CONFIG_MTD_IFC_MRAM)\t+= ifc_mram.o\n> diff --git a/drivers/mtd/maps/ifc_mram.c b/drivers/mtd/maps/ifc_mram.c\n> new file mode 100644\n> index 0000000..1341e0a\n> --- /dev/null\n> +++ b/drivers/mtd/maps/ifc_mram.c\n> @@ -0,0 +1,343 @@\n> +/*\n> + * Integrated Flash Controlller Map Driver\n> + *\n> + * Copyright 2017 Rockwell Collins\n> + *\n> + * Aug 18 2017  Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n> + *\n> + * Based on:\n> + * Flash mappings described by the OF (or flattened) device tree\n> + *\n> + * Copyright (C) 2006 MontaVista Software Inc.\n> + * Author: Vitaly Wool <vwool@ru.mvista.com>\n> + *\n> + * Revised to handle newer style flash binding by:\n> + *   Copyright (C) 2007 David Gibson, IBM Corporation.\n> + *\n> + */\n> +\n> +#include <linux/module.h>\n> +#include <linux/types.h>\n> +#include <linux/device.h>\n> +#include <linux/mtd/mtd.h>\n> +#include <linux/mtd/map.h>\n> +#include <linux/mtd/partitions.h>\n> +#include <linux/mtd/concat.h>\n> +#include <linux/of.h>\n> +#include <linux/of_address.h>\n> +#include <linux/of_platform.h>\n> +#include <linux/slab.h>\n> +\n> +static const struct of_device_id ifc_mram_match[] = {\n> +\t{\n> +\t\t.compatible\t= \"ifc-mram\",\n> +\t},\n> +\t{}\n> +};\n> +MODULE_DEVICE_TABLE(of, ifc_mram_match);\n> +struct ifc_mram_list {\n> +\tstruct mtd_info *mtd;\n> +\tstruct map_info map;\n> +\tstruct resource *res;\n> +};\n> +\n> +struct ifc_mram {\n> +\tstruct mtd_info\t\t*cmtd;\n> +\tint list_size; /* number of elements in ifc_mram_list */\n> +\tstruct ifc_mram_list\tlist[0];\n> +};\n> +\n> +\n> +static void ifc_mram_copy_from8(void *to, void __iomem *from, size_t count)\n> +{\n> +\tu8 *t = to;\n> +\n> +\twhile (count > 0) {\n> +\t\t*t = (u8)readb_relaxed(from);\n> +\t\tt++;\n> +\t\tfrom++;\n> +\t\tcount--;\n> +\t}\n> +}\n> +\n> +static void ifc_mram_copy_from16(void *to, void __iomem *from, size_t count)\n> +{\n> +\tu8 *t = to;\n> +\n> +\tif (!(IS_ALIGNED((unsigned long)from, 2))) {\n> +\t\tfrom = (void __iomem *)ALIGN((unsigned long)from, 2) - 2;\n> +\t\t*(u8 *)t = (u8)((cpu_to_le16(readw_relaxed(from)) & 0xff00)\n> +\t\t\t\t\t\t\t\t\t>> 8);\n> +\t\tcount--;\n> +\t\tt++;\n> +\t\tfrom += 2;\n> +\t}\n> +\twhile (count >= 2) {\n> +\t\t*(u16 *)t = cpu_to_le16(readw_relaxed(from));\n> +\t\tcount -= 2;\n> +\t\tt += 2;\n> +\t\tfrom += 2;\n> +\t};\n> +\twhile (count > 0) {\n> +\t\t*(u8 *)t = (u8)(cpu_to_le16(readw_relaxed(from)) & 0x00ff);\n> +\t\tcount--;\n> +\t\tt++;\n> +\t\tfrom++;\n> +\t}\n> +}\n> +\n> +static void ifc_mram_copy_from(struct map_info *map, void *to,\n> +\t\t\t\t\tunsigned long from, ssize_t len)\n> +{\n> +\tif (map->cached)\n> +\t\tmemcpy(to, (char *)map->cached + from, len);\n> +\telse if (map_bankwidth_is_1(map))\n> +\t\tifc_mram_copy_from8(to, map->virt + from, len);\n> +\telse if (map_bankwidth_is_2(map))\n> +\t\tifc_mram_copy_from16(to, map->virt + from, len);\n> +\telse\n> +\t\tmemcpy_fromio(to, map->virt + from, len);\n> +}\n> +\n> +static void ifc_mram_copy_to8(void __iomem *to, const void *from, size_t count)\n> +{\n> +\tconst unsigned char *f = from;\n> +\n> +\twhile (count > 0) {\n> +\t\twriteb_relaxed(*f, to);\n> +\t\tcount--;\n> +\t\tto++;\n> +\t\tf++;\n> +\t}\n> +}\n> +\n> +static void ifc_mram_copy_to16(void __iomem *to, const void *from, size_t count)\n> +{\n> +\tconst unsigned char *f = from;\n> +\tu16 d;\n> +\n> +\tif (!(IS_ALIGNED((unsigned long)to, 2))) {\n> +\t\tto = (void __iomem *)ALIGN((unsigned long)to, 2) - 2;\n> +\t\td = (cpu_to_le16(readw_relaxed(to)) & 0x00ff)\n> +\t\t\t\t\t| ((u16)(*(const u8 *)f) << 8);\n> +\t\twritew_relaxed(le16_to_cpu(d), to);\n> +\t\tcount--;\n> +\t\tto += 2;\n> +\t\tf++;\n> +\t}\n> +\twhile (count >= 2) {\n> +\t\twritew_relaxed(le16_to_cpu(*(const u16 *)f), to);\n> +\t\tcount -= 2;\n> +\t\tto += 2;\n> +\t\tf += 2;\n> +\t};\n> +\twhile (count > 0) {\n> +\t\td = (cpu_to_le16(readw_relaxed(to)) & 0xff00)\n> +\t\t\t\t\t| (u16)(*(const u8 *)f);\n> +\t\twritew_relaxed(le16_to_cpu(d), to);\n> +\t\tcount--;\n> +\t\tto++;\n> +\t\tf++;\n> +\t}\n> +}\n> +\n> +static void ifc_mram_copy_to(struct map_info *map, unsigned long to,\n> +\t\t\t\t\tconst void *from, ssize_t len)\n> +{\n> +\tif (map_bankwidth_is_1(map))\n> +\t\tifc_mram_copy_to8(map->virt + to, from, len);\n> +\telse if (map_bankwidth_is_2(map))\n> +\t\tifc_mram_copy_to16(map->virt + to, from, len);\n> +\telse\n> +\t\tmemcpy_toio(map->virt + to, from, len);\n> +}\n> +static int ifc_mram_remove(struct platform_device *dev)\n> +{\n> +\tstruct ifc_mram *info;\n> +\tint i;\n> +\n> +\tinfo = dev_get_drvdata(&dev->dev);\n> +\tif (!info)\n> +\t\treturn 0;\n> +\tdev_set_drvdata(&dev->dev, NULL);\n> +\n> +\tif (info->cmtd) {\n> +\t\tmtd_device_unregister(info->cmtd);\n> +\t\tif (info->cmtd != info->list[0].mtd)\n> +\t\t\tmtd_concat_destroy(info->cmtd);\n> +\t}\n> +\n> +\tfor (i = 0; i < info->list_size; i++) {\n> +\t\tif (info->list[i].mtd)\n> +\t\t\tmap_destroy(info->list[i].mtd);\n> +\n> +\t\tif (info->list[i].map.virt)\n> +\t\t\tiounmap(info->list[i].map.virt);\n> +\n> +\t\tif (info->list[i].res) {\n> +\t\t\trelease_resource(info->list[i].res);\n> +\t\t\tkfree(info->list[i].res);\n> +\t\t}\n> +\t}\n> +\treturn 0;\n> +}\n> +\n> +static int ifc_mram_probe(struct platform_device *dev)\n> +{\n> +\tconst struct of_device_id *match;\n> +\tstruct device_node *dp = dev->dev.of_node;\n> +\tstruct resource res;\n> +\tstruct ifc_mram *info;\n> +\tconst __be32 *width;\n> +\tint err;\n> +\tint i;\n> +\tint count;\n> +\tconst __be32 *p;\n> +\tint reg_tuple_size;\n> +\tstruct mtd_info **mtd_list = NULL;\n> +\tresource_size_t res_size;\n> +\tstruct mtd_part_parser_data ppdata;\n> +\tbool map_indirect;\n> +\tconst char *mtd_name = NULL;\n> +\n> +\tmatch = of_match_device(ifc_mram_match, &dev->dev);\n> +\tif (!match) {\n> +\t\tpr_info(\"%s: compatible string not matched\\n\", __func__);\n> +\t\treturn -EINVAL;\n> +\t}\n> +\treg_tuple_size =\n> +\t\t(of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32);\n> +\n> +\tof_property_read_string(dp, \"linux,mtd-name\", &mtd_name);\n> +\n> +\tp = of_get_property(dp, \"reg\", &count);\n> +\tif (count % reg_tuple_size != 0) {\n> +\t\tdev_err(&dev->dev, \"Malformed reg property on %s\\n\",\n> +\t\t\t\tdev->dev.of_node->full_name);\n> +\t\terr = -EINVAL;\n> +\t\tgoto err_flash_remove;\n> +\t}\n> +\tcount /= reg_tuple_size;\n> +\n> +\terr = -ENOMEM;\n> +\tinfo = devm_kzalloc(&dev->dev,\n> +\t\t\t    sizeof(struct ifc_mram) +\n> +\t\t\t    sizeof(struct ifc_mram_list) * count, GFP_KERNEL);\n> +\tif (!info)\n> +\t\tgoto err_flash_remove;\n> +\n> +\tdev_set_drvdata(&dev->dev, info);\n> +\n> +\tmtd_list = kcalloc(count, sizeof(*mtd_list), GFP_KERNEL);\n> +\tif (!mtd_list)\n> +\t\tgoto err_flash_remove;\n> +\n> +\tfor (i = 0; i < count; i++) {\n> +\t\terr = -ENXIO;\n> +\t\tif (of_address_to_resource(dp, i, &res)) {\n> +\t\t\t/*\n> +\t\t\t * Continue with next register tuple if this\n> +\t\t\t * one is not mappable\n> +\t\t\t */\n> +\t\t\tcontinue;\n> +\t\t}\n> +\n> +\t\tdev_dbg(&dev->dev, \"ifc_mram device: %pR\\n\", &res);\n> +\n> +\t\terr = -EBUSY;\n> +\t\tres_size = resource_size(&res);\n> +\t\tinfo->list[i].res = request_mem_region(res.start, res_size,\n> +\t\t\t\t\t\t       dev_name(&dev->dev));\n> +\t\tif (!info->list[i].res)\n> +\t\t\tgoto err_out;\n> +\n> +\t\terr = -ENXIO;\n> +\t\twidth = of_get_property(dp, \"bank-width\", NULL);\n> +\t\tif (!width) {\n> +\t\t\tdev_err(&dev->dev,\n> +\t\t\t\t\"Can't get bank width from device tree\\n\");\n> +\t\t\tgoto err_out;\n> +\t\t}\n> +\n> +\t\tinfo->list[i].map.name = mtd_name ?: dev_name(&dev->dev);\n> +\t\tinfo->list[i].map.phys = res.start;\n> +\t\tinfo->list[i].map.size = res_size;\n> +\t\tinfo->list[i].map.bankwidth = be32_to_cpup(width);\n> +\t\tinfo->list[i].map.device_node = dp;\n> +\n> +\t\terr = -ENOMEM;\n> +\t\tinfo->list[i].map.virt = ioremap(info->list[i].map.phys,\n> +\t\t\t\t\t\t info->list[i].map.size);\n> +\t\tif (!info->list[i].map.virt) {\n> +\t\t\tdev_err(&dev->dev,\n> +\t\t\t\t\"Failed to ioremap() flash region\\n\");\n> +\t\t\tgoto err_out;\n> +\t\t}\n> +\n> +\t\tsimple_map_init(&info->list[i].map);\n> +#ifdef CONFIG_MTD_COMPLEX_MAPPINGS\n> +\t\tinfo->list[i].map.copy_from = ifc_mram_copy_from;\n> +\t\tinfo->list[i].map.copy_to = ifc_mram_copy_to;\n> +#endif\n> +\n> +\n> +\t\tinfo->list[i].mtd = do_map_probe(\"map_ram\",\n> +\t\t\t\t\t\t\t &info->list[i].map);\n> +\t\tmtd_list[i] = info->list[i].mtd;\n> +\n> +\t\terr = -ENXIO;\n> +\t\tif (!info->list[i].mtd) {\n> +\t\t\tdev_err(&dev->dev, \"do_map_probe() failed\\n\");\n> +\t\t\tgoto err_out;\n> +\t\t} else {\n> +\t\t\tinfo->list_size++;\n> +\t\t}\n> +\t\tinfo->list[i].mtd->owner = THIS_MODULE;\n> +\t\tinfo->list[i].mtd->dev.parent = &dev->dev;\n> +\t}\n> +\n> +\terr = 0;\n> +\tinfo->cmtd = NULL;\n> +\tif (info->list_size == 1) {\n> +\t\tinfo->cmtd = info->list[0].mtd;\n> +\t} else if (info->list_size > 1) {\n> +\t\t/*\n> +\t\t * We detected multiple devices. Concatenate them together.\n> +\t\t */\n> +\t\tinfo->cmtd = mtd_concat_create(mtd_list, info->list_size,\n> +\t\t\t\t\t       dev_name(&dev->dev));\n> +\t}\n> +\tif (info->cmtd == NULL)\n> +\t\terr = -ENXIO;\n> +\n> +\tif (err)\n> +\t\tgoto err_out;\n> +\n> +\tppdata.of_node = dp;\n> +\tmtd_device_parse_register(info->cmtd, NULL, &ppdata, NULL, 0);\n> +\tkfree(mtd_list);\n> +\treturn 0;\n> +\n> +err_out:\n> +\tkfree(mtd_list);\n> +err_flash_remove:\n> +\tifc_mram_remove(dev);\n> +\n> +\treturn err;\n> +}\n> +\n> +\n> +static struct platform_driver ifc_mram_driver = {\n> +\t.driver = {\n> +\t\t.name = \"ifc-mram\",\n> +\t\t.of_match_table = ifc_mram_match,\n> +\t},\n> +\t.probe\t\t= ifc_mram_probe,\n> +\t.remove\t\t= ifc_mram_remove,\n> +};\n> +\n> +module_platform_driver(ifc_mram_driver);\n> +\n> +MODULE_LICENSE(\"GPL v2\");\n> +MODULE_AUTHOR(\"Sanjay Tandel\");\n> +MODULE_DESCRIPTION(\"IFC MRAM Map Driver\");","headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"a6bdBYOL\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjG266G4tz9sP5\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 05:35:42 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dn8ly-0004ax-NQ; Wed, 30 Aug 2017 19:35:34 +0000","from mail.free-electrons.com ([62.4.15.54])\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dn8ld-0003K4-09\n\tfor linux-mtd@lists.infradead.org; Wed, 30 Aug 2017 19:35:15 +0000","by mail.free-electrons.com (Postfix, from userid 110)\n\tid 6CBDC20A2A; Wed, 30 Aug 2017 21:34:50 +0200 (CEST)","from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 1E68D2094D;\n\tWed, 30 Aug 2017 21:34:50 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=joo86gUcDIQjj6tMEmjcoip1Qh1+0j/nGmhmbiCluOU=;\n\tb=a6bdBYOLnsXHPX\n\tn+CS0cB8QsnE+tZzyfR6orsQTZdXc6Y+n0KFA6O4qf2t+WH1phjGyTCXAwhwZNX1fqCDXalKnp9Tp\n\tCXB8NBplZOq2mxrhjwuK/rpKltXHuHomn05ipj+jZKV9qcz4xmD1MFWpizvE+/okrN8tgEZUzvjb6\n\tdlZ3Pu1ULP/6ubohuvg3TM81jXCGxQnVE9mMq39LNpx9oGF+gTeTKUyXRzeFLkU+2iu16RPwE714l\n\tJDvlOcI0rfY8/l5/hLaD6ecKuw8yjqw9Hb3qBWGurOOWgmvDPuYxa5UUcBVWNKOI39To8yw8Bg6tp\n\tEqwGKL+g+UwIpOuy3SBw==;","X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT,\n\tURIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0","Date":"Wed, 30 Aug 2017 21:34:50 +0200","From":"Boris Brezillon <boris.brezillon@free-electrons.com>","To":"Matt Weber <matthew.weber@rockwellcollins.com>","Subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","Message-ID":"<20170830213450.663a218a@bbrezillon>","In-Reply-To":"<1504036047-38848-1-git-send-email-matthew.weber@rockwellcollins.com>","References":"<1504036047-38848-1-git-send-email-matthew.weber@rockwellcollins.com>","X-Mailer":"Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170830_123513_361209_A05B0E43 ","X-CRM114-Status":"GOOD (  30.91  )","X-Spam-Score":"-1.9 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"Sanjay Tandel <sanjay.tandel@rockwellcollins.com>,\n\tlinux-mtd@lists.infradead.org, arnd@arndb.de","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"}},{"id":1760576,"web_url":"http://patchwork.ozlabs.org/comment/1760576/","msgid":"<CAB0kKmy+Lx-w=t=vzMJSbahTh9jHLZ2z3aAOJhVwg-t4MPVjAQ@mail.gmail.com>","list_archive_url":null,"date":"2017-08-31T00:03:48","subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","submitter":{"id":72151,"url":"http://patchwork.ozlabs.org/api/people/72151/","name":"Sanjay Tandel","email":"sanjay.tandel@rockwellcollins.com"},"content":"Hi Boris,\n\nOn Wed, Aug 30, 2017 at 2:34 PM, Boris Brezillon\n<boris.brezillon@free-electrons.com> wrote:\n> Hi,\n>\n> On Tue, 29 Aug 2017 14:47:27 -0500\n> Matt Weber <matthew.weber@rockwellcollins.com> wrote:\n>\n>> From: Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n>>\n>> This patch adds map driver for parallel flash chips interfaced over\n>> a NXP Integrated Flash Controller (IFC). This driver allows either\n>> 8-bit or 16-bit accesses, depending on bank-width, to parallel flash\n>> chips(like Everspin MR0A16A), which are physically mapped to CPU's\n>> memory space. For unaligned accesses, it performs read-modify-write\n>> operations to keep access size same as bank-width.\n>>\n>\n> Did you consider re-using the physmap driver [1] and adjust it to your\n> needs like the gemini [2] or versatile [3] drivers do? If you did, what\n> prevents you from using this approach?\n\nThat approach would have coupled my driver with physmap driver, which has been\nmodified in newer version of kernel. So patch would not have been backward\ncompatible.\n\nI intended to create independent driver without changing any existing\ndriver code.\n\n>\n> Regards,\n>\n> Boris\n>\n> [1]http://elixir.free-electrons.com/linux/v4.13-rc7/source/drivers/mtd/maps/physmap_of_core.c\n> [2]http://elixir.free-electrons.com/linux/v4.13-rc7/source/drivers/mtd/maps/physmap_of_gemini.c\n> [3]http://elixir.free-electrons.com/linux/v4.13-rc7/source/drivers/mtd/maps/physmap_of_versatile.c\n>\n\nRegards,\nSanjay\n\n>> Signed-off-by: Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n>> Signed-off-by: Matt Weber <matthew.weber@rockwellcollins.com>\n>> ---\n>>\n>> Changes\n>> v1 -> v2\n>>  - Refactored driver to be custom for the IFC bus controllder\n>>   (Suggested by Boris)\n>>  - Updated patch name\n>>  - Cleaned up description to be specific about issue and behavior\n>>  - Version 1 - https://patchwork.ozlabs.org/patch/797787/\n>> ---\n>>  Documentation/devicetree/bindings/mtd/ifc-mram.txt |  34 ++\n>>  drivers/mtd/maps/Kconfig                           |  13 +\n>>  drivers/mtd/maps/Makefile                          |   1 +\n>>  drivers/mtd/maps/ifc_mram.c                        | 343 +++++++++++++++++++++\n>>  4 files changed, 391 insertions(+)\n>>  create mode 100644 Documentation/devicetree/bindings/mtd/ifc-mram.txt\n>>  create mode 100644 drivers/mtd/maps/ifc_mram.c\n>>\n>> diff --git a/Documentation/devicetree/bindings/mtd/ifc-mram.txt b/Documentation/devicetree/bindings/mtd/ifc-mram.txt\n>> new file mode 100644\n>> index 0000000..c5c3210\n>> --- /dev/null\n>> +++ b/Documentation/devicetree/bindings/mtd/ifc-mram.txt\n>> @@ -0,0 +1,34 @@\n>> +Integrated Flash Controller based physically-mapped parallel MRAM,\n>> +NOR flash, MTD-RAM (NVRAM...)\n>> +\n>> + - compatible : should contain the specific model of mtd chip(s)\n>> +   used, if known, followed by \"ifc-mram\".\n>> + - reg : Address range(s) of the mtd chip(s)\n>> +   It's possible to (optionally) define multiple \"reg\" tuples so that\n>> +   non-identical chips can be described in one node.\n>> + - bank-width : Width (in bytes) of the bank.  Equal to the\n>> +   device width times the number of interleaved chips.\n>> + - device-width : (optional) Width of a single mtd chip.  If\n>> +   omitted, assumed to be equal to 'bank-width'.\n>> + - #address-cells, #size-cells : Must be present if the device has\n>> +   sub-nodes representing partitions (see below).  In this case\n>> +   both #address-cells and #size-cells must be equal to 1.\n>> + - linux,mtd-name: allow to specify the mtd name.\n>> +\n>> +The device tree may optionally contain sub-nodes describing partitions of the\n>> +address space. See partition.txt for more detail.\n>> +\n>> +Example:\n>> +\n>> +        mram@1,0 {\n>> +                #address-cells = <1>;\n>> +                #size-cells = <1>;\n>> +                compatible = \"everspin,mram\", \"ifc-mram\";\n>> +                reg = <0x1 0x0 0x10000 0x1 0x10000 0x10000>;\n>> +                bank-width = <2>;\n>> +\n>> +                partition@0 {\n>> +                        reg = <0 0x00020000>;\n>> +                        label = \"MRAM Data 0\";\n>> +                };\n>> +        };\n>> diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig\n>> index 542fdf8..95bd44e 100644\n>> --- a/drivers/mtd/maps/Kconfig\n>> +++ b/drivers/mtd/maps/Kconfig\n>> @@ -419,4 +419,17 @@ config MTD_LATCH_ADDR\n>>\n>>            If compiled as a module, it will be called latch-addr-flash.\n>>\n>> +config MTD_IFC_MRAM\n>> +     tristate \"Map driver for Integrated Flash Controller\"\n>> +     depends on MTD_COMPLEX_MAPPINGS\n>> +     help\n>> +       Map driver for chips connected parallely to Integrated Flash\n>> +       Controller. This driver allows either 8-bit or 16-bit accesses,\n>> +       depending on bank-width, to parallel flash chips, which are\n>> +       physically mapped to CPU's memory space. For unaligned accesses,\n>> +       it does read-modify-write.\n>> +       Example: Everspin MR0A16A.\n>> +\n>> +       If compiled as a module, it will be called ifc-mram.\n>> +\n>>  endmenu\n>> diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile\n>> index 5a09a72..0ab793e 100644\n>> --- a/drivers/mtd/maps/Makefile\n>> +++ b/drivers/mtd/maps/Makefile\n>> @@ -47,3 +47,4 @@ obj-$(CONFIG_MTD_VMU)               += vmu-flash.o\n>>  obj-$(CONFIG_MTD_GPIO_ADDR)  += gpio-addr-flash.o\n>>  obj-$(CONFIG_MTD_LATCH_ADDR) += latch-addr-flash.o\n>>  obj-$(CONFIG_MTD_LANTIQ)     += lantiq-flash.o\n>> +obj-$(CONFIG_MTD_IFC_MRAM)   += ifc_mram.o\n>> diff --git a/drivers/mtd/maps/ifc_mram.c b/drivers/mtd/maps/ifc_mram.c\n>> new file mode 100644\n>> index 0000000..1341e0a\n>> --- /dev/null\n>> +++ b/drivers/mtd/maps/ifc_mram.c\n>> @@ -0,0 +1,343 @@\n>> +/*\n>> + * Integrated Flash Controlller Map Driver\n>> + *\n>> + * Copyright 2017 Rockwell Collins\n>> + *\n>> + * Aug 18 2017  Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n>> + *\n>> + * Based on:\n>> + * Flash mappings described by the OF (or flattened) device tree\n>> + *\n>> + * Copyright (C) 2006 MontaVista Software Inc.\n>> + * Author: Vitaly Wool <vwool@ru.mvista.com>\n>> + *\n>> + * Revised to handle newer style flash binding by:\n>> + *   Copyright (C) 2007 David Gibson, IBM Corporation.\n>> + *\n>> + */\n>> +\n>> +#include <linux/module.h>\n>> +#include <linux/types.h>\n>> +#include <linux/device.h>\n>> +#include <linux/mtd/mtd.h>\n>> +#include <linux/mtd/map.h>\n>> +#include <linux/mtd/partitions.h>\n>> +#include <linux/mtd/concat.h>\n>> +#include <linux/of.h>\n>> +#include <linux/of_address.h>\n>> +#include <linux/of_platform.h>\n>> +#include <linux/slab.h>\n>> +\n>> +static const struct of_device_id ifc_mram_match[] = {\n>> +     {\n>> +             .compatible     = \"ifc-mram\",\n>> +     },\n>> +     {}\n>> +};\n>> +MODULE_DEVICE_TABLE(of, ifc_mram_match);\n>> +struct ifc_mram_list {\n>> +     struct mtd_info *mtd;\n>> +     struct map_info map;\n>> +     struct resource *res;\n>> +};\n>> +\n>> +struct ifc_mram {\n>> +     struct mtd_info         *cmtd;\n>> +     int list_size; /* number of elements in ifc_mram_list */\n>> +     struct ifc_mram_list    list[0];\n>> +};\n>> +\n>> +\n>> +static void ifc_mram_copy_from8(void *to, void __iomem *from, size_t count)\n>> +{\n>> +     u8 *t = to;\n>> +\n>> +     while (count > 0) {\n>> +             *t = (u8)readb_relaxed(from);\n>> +             t++;\n>> +             from++;\n>> +             count--;\n>> +     }\n>> +}\n>> +\n>> +static void ifc_mram_copy_from16(void *to, void __iomem *from, size_t count)\n>> +{\n>> +     u8 *t = to;\n>> +\n>> +     if (!(IS_ALIGNED((unsigned long)from, 2))) {\n>> +             from = (void __iomem *)ALIGN((unsigned long)from, 2) - 2;\n>> +             *(u8 *)t = (u8)((cpu_to_le16(readw_relaxed(from)) & 0xff00)\n>> +                                                                     >> 8);\n>> +             count--;\n>> +             t++;\n>> +             from += 2;\n>> +     }\n>> +     while (count >= 2) {\n>> +             *(u16 *)t = cpu_to_le16(readw_relaxed(from));\n>> +             count -= 2;\n>> +             t += 2;\n>> +             from += 2;\n>> +     };\n>> +     while (count > 0) {\n>> +             *(u8 *)t = (u8)(cpu_to_le16(readw_relaxed(from)) & 0x00ff);\n>> +             count--;\n>> +             t++;\n>> +             from++;\n>> +     }\n>> +}\n>> +\n>> +static void ifc_mram_copy_from(struct map_info *map, void *to,\n>> +                                     unsigned long from, ssize_t len)\n>> +{\n>> +     if (map->cached)\n>> +             memcpy(to, (char *)map->cached + from, len);\n>> +     else if (map_bankwidth_is_1(map))\n>> +             ifc_mram_copy_from8(to, map->virt + from, len);\n>> +     else if (map_bankwidth_is_2(map))\n>> +             ifc_mram_copy_from16(to, map->virt + from, len);\n>> +     else\n>> +             memcpy_fromio(to, map->virt + from, len);\n>> +}\n>> +\n>> +static void ifc_mram_copy_to8(void __iomem *to, const void *from, size_t count)\n>> +{\n>> +     const unsigned char *f = from;\n>> +\n>> +     while (count > 0) {\n>> +             writeb_relaxed(*f, to);\n>> +             count--;\n>> +             to++;\n>> +             f++;\n>> +     }\n>> +}\n>> +\n>> +static void ifc_mram_copy_to16(void __iomem *to, const void *from, size_t count)\n>> +{\n>> +     const unsigned char *f = from;\n>> +     u16 d;\n>> +\n>> +     if (!(IS_ALIGNED((unsigned long)to, 2))) {\n>> +             to = (void __iomem *)ALIGN((unsigned long)to, 2) - 2;\n>> +             d = (cpu_to_le16(readw_relaxed(to)) & 0x00ff)\n>> +                                     | ((u16)(*(const u8 *)f) << 8);\n>> +             writew_relaxed(le16_to_cpu(d), to);\n>> +             count--;\n>> +             to += 2;\n>> +             f++;\n>> +     }\n>> +     while (count >= 2) {\n>> +             writew_relaxed(le16_to_cpu(*(const u16 *)f), to);\n>> +             count -= 2;\n>> +             to += 2;\n>> +             f += 2;\n>> +     };\n>> +     while (count > 0) {\n>> +             d = (cpu_to_le16(readw_relaxed(to)) & 0xff00)\n>> +                                     | (u16)(*(const u8 *)f);\n>> +             writew_relaxed(le16_to_cpu(d), to);\n>> +             count--;\n>> +             to++;\n>> +             f++;\n>> +     }\n>> +}\n>> +\n>> +static void ifc_mram_copy_to(struct map_info *map, unsigned long to,\n>> +                                     const void *from, ssize_t len)\n>> +{\n>> +     if (map_bankwidth_is_1(map))\n>> +             ifc_mram_copy_to8(map->virt + to, from, len);\n>> +     else if (map_bankwidth_is_2(map))\n>> +             ifc_mram_copy_to16(map->virt + to, from, len);\n>> +     else\n>> +             memcpy_toio(map->virt + to, from, len);\n>> +}\n>> +static int ifc_mram_remove(struct platform_device *dev)\n>> +{\n>> +     struct ifc_mram *info;\n>> +     int i;\n>> +\n>> +     info = dev_get_drvdata(&dev->dev);\n>> +     if (!info)\n>> +             return 0;\n>> +     dev_set_drvdata(&dev->dev, NULL);\n>> +\n>> +     if (info->cmtd) {\n>> +             mtd_device_unregister(info->cmtd);\n>> +             if (info->cmtd != info->list[0].mtd)\n>> +                     mtd_concat_destroy(info->cmtd);\n>> +     }\n>> +\n>> +     for (i = 0; i < info->list_size; i++) {\n>> +             if (info->list[i].mtd)\n>> +                     map_destroy(info->list[i].mtd);\n>> +\n>> +             if (info->list[i].map.virt)\n>> +                     iounmap(info->list[i].map.virt);\n>> +\n>> +             if (info->list[i].res) {\n>> +                     release_resource(info->list[i].res);\n>> +                     kfree(info->list[i].res);\n>> +             }\n>> +     }\n>> +     return 0;\n>> +}\n>> +\n>> +static int ifc_mram_probe(struct platform_device *dev)\n>> +{\n>> +     const struct of_device_id *match;\n>> +     struct device_node *dp = dev->dev.of_node;\n>> +     struct resource res;\n>> +     struct ifc_mram *info;\n>> +     const __be32 *width;\n>> +     int err;\n>> +     int i;\n>> +     int count;\n>> +     const __be32 *p;\n>> +     int reg_tuple_size;\n>> +     struct mtd_info **mtd_list = NULL;\n>> +     resource_size_t res_size;\n>> +     struct mtd_part_parser_data ppdata;\n>> +     bool map_indirect;\n>> +     const char *mtd_name = NULL;\n>> +\n>> +     match = of_match_device(ifc_mram_match, &dev->dev);\n>> +     if (!match) {\n>> +             pr_info(\"%s: compatible string not matched\\n\", __func__);\n>> +             return -EINVAL;\n>> +     }\n>> +     reg_tuple_size =\n>> +             (of_n_addr_cells(dp) + of_n_size_cells(dp)) * sizeof(u32);\n>> +\n>> +     of_property_read_string(dp, \"linux,mtd-name\", &mtd_name);\n>> +\n>> +     p = of_get_property(dp, \"reg\", &count);\n>> +     if (count % reg_tuple_size != 0) {\n>> +             dev_err(&dev->dev, \"Malformed reg property on %s\\n\",\n>> +                             dev->dev.of_node->full_name);\n>> +             err = -EINVAL;\n>> +             goto err_flash_remove;\n>> +     }\n>> +     count /= reg_tuple_size;\n>> +\n>> +     err = -ENOMEM;\n>> +     info = devm_kzalloc(&dev->dev,\n>> +                         sizeof(struct ifc_mram) +\n>> +                         sizeof(struct ifc_mram_list) * count, GFP_KERNEL);\n>> +     if (!info)\n>> +             goto err_flash_remove;\n>> +\n>> +     dev_set_drvdata(&dev->dev, info);\n>> +\n>> +     mtd_list = kcalloc(count, sizeof(*mtd_list), GFP_KERNEL);\n>> +     if (!mtd_list)\n>> +             goto err_flash_remove;\n>> +\n>> +     for (i = 0; i < count; i++) {\n>> +             err = -ENXIO;\n>> +             if (of_address_to_resource(dp, i, &res)) {\n>> +                     /*\n>> +                      * Continue with next register tuple if this\n>> +                      * one is not mappable\n>> +                      */\n>> +                     continue;\n>> +             }\n>> +\n>> +             dev_dbg(&dev->dev, \"ifc_mram device: %pR\\n\", &res);\n>> +\n>> +             err = -EBUSY;\n>> +             res_size = resource_size(&res);\n>> +             info->list[i].res = request_mem_region(res.start, res_size,\n>> +                                                    dev_name(&dev->dev));\n>> +             if (!info->list[i].res)\n>> +                     goto err_out;\n>> +\n>> +             err = -ENXIO;\n>> +             width = of_get_property(dp, \"bank-width\", NULL);\n>> +             if (!width) {\n>> +                     dev_err(&dev->dev,\n>> +                             \"Can't get bank width from device tree\\n\");\n>> +                     goto err_out;\n>> +             }\n>> +\n>> +             info->list[i].map.name = mtd_name ?: dev_name(&dev->dev);\n>> +             info->list[i].map.phys = res.start;\n>> +             info->list[i].map.size = res_size;\n>> +             info->list[i].map.bankwidth = be32_to_cpup(width);\n>> +             info->list[i].map.device_node = dp;\n>> +\n>> +             err = -ENOMEM;\n>> +             info->list[i].map.virt = ioremap(info->list[i].map.phys,\n>> +                                              info->list[i].map.size);\n>> +             if (!info->list[i].map.virt) {\n>> +                     dev_err(&dev->dev,\n>> +                             \"Failed to ioremap() flash region\\n\");\n>> +                     goto err_out;\n>> +             }\n>> +\n>> +             simple_map_init(&info->list[i].map);\n>> +#ifdef CONFIG_MTD_COMPLEX_MAPPINGS\n>> +             info->list[i].map.copy_from = ifc_mram_copy_from;\n>> +             info->list[i].map.copy_to = ifc_mram_copy_to;\n>> +#endif\n>> +\n>> +\n>> +             info->list[i].mtd = do_map_probe(\"map_ram\",\n>> +                                                      &info->list[i].map);\n>> +             mtd_list[i] = info->list[i].mtd;\n>> +\n>> +             err = -ENXIO;\n>> +             if (!info->list[i].mtd) {\n>> +                     dev_err(&dev->dev, \"do_map_probe() failed\\n\");\n>> +                     goto err_out;\n>> +             } else {\n>> +                     info->list_size++;\n>> +             }\n>> +             info->list[i].mtd->owner = THIS_MODULE;\n>> +             info->list[i].mtd->dev.parent = &dev->dev;\n>> +     }\n>> +\n>> +     err = 0;\n>> +     info->cmtd = NULL;\n>> +     if (info->list_size == 1) {\n>> +             info->cmtd = info->list[0].mtd;\n>> +     } else if (info->list_size > 1) {\n>> +             /*\n>> +              * We detected multiple devices. Concatenate them together.\n>> +              */\n>> +             info->cmtd = mtd_concat_create(mtd_list, info->list_size,\n>> +                                            dev_name(&dev->dev));\n>> +     }\n>> +     if (info->cmtd == NULL)\n>> +             err = -ENXIO;\n>> +\n>> +     if (err)\n>> +             goto err_out;\n>> +\n>> +     ppdata.of_node = dp;\n>> +     mtd_device_parse_register(info->cmtd, NULL, &ppdata, NULL, 0);\n>> +     kfree(mtd_list);\n>> +     return 0;\n>> +\n>> +err_out:\n>> +     kfree(mtd_list);\n>> +err_flash_remove:\n>> +     ifc_mram_remove(dev);\n>> +\n>> +     return err;\n>> +}\n>> +\n>> +\n>> +static struct platform_driver ifc_mram_driver = {\n>> +     .driver = {\n>> +             .name = \"ifc-mram\",\n>> +             .of_match_table = ifc_mram_match,\n>> +     },\n>> +     .probe          = ifc_mram_probe,\n>> +     .remove         = ifc_mram_remove,\n>> +};\n>> +\n>> +module_platform_driver(ifc_mram_driver);\n>> +\n>> +MODULE_LICENSE(\"GPL v2\");\n>> +MODULE_AUTHOR(\"Sanjay Tandel\");\n>> +MODULE_DESCRIPTION(\"IFC MRAM Map Driver\");\n>","headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"KWagjs4r\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjN0n381Kz9sMN\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 10:04:57 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnCyO-00041C-8X; Thu, 31 Aug 2017 00:04:40 +0000","from smtpimr.rockwellcollins.com ([205.175.227.29]\n\thelo=da1vs02.rockwellcollins.com)\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnCyI-0003xU-Fc\n\tfor linux-mtd@lists.infradead.org; Thu, 31 Aug 2017 00:04:38 +0000","from unknown (HELO mail-yw0-f198.google.com) ([205.175.227.20])\n\tby da1vs02.rockwellcollins.com with ESMTP/TLS/AES128-GCM-SHA256;\n\t30 Aug 2017 19:04:10 -0500","by mail-yw0-f198.google.com with SMTP id e9so14284030ywh.8\n\tfor <linux-mtd@lists.infradead.org>;\n\tWed, 30 Aug 2017 17:04:09 -0700 (PDT)","by 10.129.170.79 with HTTP; Wed, 30 Aug 2017 17:03:48 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=wBQrFKwpVlS7KS1eZ6T2YyUMYGCfdPCOGfAWD47nGYE=;\n\tb=KWagjs4rTSlBdA\n\tIv/SuRj6kElVxlI7tPfMZJuSM3YPWXwR4vCHvCR3AyESIx+8ZP/xCWr37GbwXte2BZ4Nq26K2kiY7\n\t+uVrIGmSxht6/lFwASolUfZ0PUvAPB7YWrjycJ+SeshKrqa7VaZrhUF1QaCayoO97hkd+J3GDE3po\n\t4cn82Im9w/p4qVgmj1x+tjTjQ3fYk6MywTAGqOsWxKOoTLvdczFP+jum++oWRxnIrXPoSIAyqnPDC\n\tVJGl6cfG2jCiIeqXsuFkUncN5mO0ylXCtiRaPpLrIQWxl+UcG1DoyZNr/T+ERpI+tYL/HDbr4Dk1s\n\tqfdulZHawuBv0dHqPsgw==;","X-RC-All-From":", 205.175.227.20, No hostname,\n\tsanjay.tandel@rockwellcollins.com, \n\tSanjay Tandel <sanjay.tandel@rockwellcollins.com>, , ","X-RC-Attachments":", ,","X-RC-RemoteIP":"205.175.227.20","X-RC-RemoteHost":"No hostname","X-RC-IP-Hostname":"da1ip02.rockwellcollins.com","X-RC-IP-MID":"65580749","X-RC-IP-Group":"GOOGLE_RELAYED","X-RC-IP-Policy":"$GOOGLE_RELAYED","X-RC-IP-SBRS":"None","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=mpn4WFCRCzWy3Srjb/hn9MQwyPeGrBj0OaI+TosWPI0=;\n\tb=qh8/5iJ6+qJSlKjVULyW3K8Knl50CwOAx7gVg6owU2EQqCr+FdkMBxLaQind3aBbKZ\n\t0zzSY/GnbHdjf7mdfBkYvRRFV2CrI7jttPV2DLF8JpyJY9RzftosiKzLymr9klZASojM\n\t8BLICM/PHlIbogJBbCIRj9h8REt3MTTZplSYx4W5K1lkTZxHFemb2tCus4fvuoyQ731q\n\tG3CKqAf/ePW0rr3KWPfnscTs10zzqlTHeQAZ8AEXZVLxVLCauVjxQG+JEZCPy8IJw0fE\n\tJQUwO3KzfjR+ZOvq/tRVFRXGQK3kwbBc3o0ETaXzGtx+LauZ/Car5TDIrAHX129n/R3Q\n\t2v7g==","X-Gm-Message-State":"AHYfb5hl2ei9ibP9gNxS+ZRv3VMpIoUGrGhH9ziaRyQ2zxjmick7mJWG\n\tv416VOOM3bsQGFQ1/AW7II+n9Opi/xvtqDlxWBJhxmaewd7+QAHZK+Yton10Qt8E2H/rQUxOjXR\n\tYinEddx9ohMsXGnePlEU74CBepV0Xn7rl1XKt47ZvRnv1PoHId8E=","X-Received":["by 10.37.105.203 with SMTP id e194mr2922952ybc.142.1504137849153;\n\tWed, 30 Aug 2017 17:04:09 -0700 (PDT)","by 10.37.105.203 with SMTP id e194mr2922935ybc.142.1504137848629;\n\tWed, 30 Aug 2017 17:04:08 -0700 (PDT)"],"MIME-Version":"1.0","In-Reply-To":"<20170830213450.663a218a@bbrezillon>","References":"<1504036047-38848-1-git-send-email-matthew.weber@rockwellcollins.com>\n\t<20170830213450.663a218a@bbrezillon>","From":"Sanjay Tandel <sanjay.tandel@rockwellcollins.com>","Date":"Wed, 30 Aug 2017 19:03:48 -0500","Message-ID":"<CAB0kKmy+Lx-w=t=vzMJSbahTh9jHLZ2z3aAOJhVwg-t4MPVjAQ@mail.gmail.com>","Subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","To":"Boris Brezillon <boris.brezillon@free-electrons.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170830_170434_840394_E9FAA5A0 ","X-CRM114-Status":"GOOD (  23.79  )","X-Spam-Score":"-6.9 (------)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-6.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/,\n\thigh trust [205.175.227.29 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"Matt Weber <matthew.weber@rockwellcollins.com>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>, Arnd Bergmann <arnd@arndb.de>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"}},{"id":1760675,"web_url":"http://patchwork.ozlabs.org/comment/1760675/","msgid":"<20170831083253.76a8d637@bbrezillon>","list_archive_url":null,"date":"2017-08-31T06:32:53","subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","submitter":{"id":63120,"url":"http://patchwork.ozlabs.org/api/people/63120/","name":"Boris Brezillon","email":"boris.brezillon@free-electrons.com"},"content":"On Wed, 30 Aug 2017 19:03:48 -0500\nSanjay Tandel <sanjay.tandel@rockwellcollins.com> wrote:\n\n> Hi Boris,\n> \n> On Wed, Aug 30, 2017 at 2:34 PM, Boris Brezillon\n> <boris.brezillon@free-electrons.com> wrote:\n> > Hi,\n> >\n> > On Tue, 29 Aug 2017 14:47:27 -0500\n> > Matt Weber <matthew.weber@rockwellcollins.com> wrote:\n> >  \n> >> From: Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n> >>\n> >> This patch adds map driver for parallel flash chips interfaced over\n> >> a NXP Integrated Flash Controller (IFC). This driver allows either\n> >> 8-bit or 16-bit accesses, depending on bank-width, to parallel flash\n> >> chips(like Everspin MR0A16A), which are physically mapped to CPU's\n> >> memory space. For unaligned accesses, it performs read-modify-write\n> >> operations to keep access size same as bank-width.\n> >>  \n> >\n> > Did you consider re-using the physmap driver [1] and adjust it to your\n> > needs like the gemini [2] or versatile [3] drivers do? If you did, what\n> > prevents you from using this approach?  \n> \n> That approach would have coupled my driver with physmap driver, which has been\n> modified in newer version of kernel. So patch would not have been backward\n> compatible.\n\nBackward compatible? I guess you meant backport-able, and I don't think\nthis is a good argument. We want Fixes to be backportable if they\nimpact several releases, not new drivers. If you want to backport your\ndriver to previous versions of Linux you can do it but it will never be\nincluded in the official stable releases.\n\n> \n> I intended to create independent driver without changing any existing\n> driver code.\n\nPlease look at the versatile and gemini driver, there's almost nothing\nto change in the physmap_of_core.c file, and you'll have your own\nsource file (+ Kconfig option) where you can tweak the map hooks as you\nwish.\n\nRegards,\n\nBoris","headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"Dm/+oX59\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjXdD5NhXz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 16:33:35 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnJ2V-0004Al-0u; Thu, 31 Aug 2017 06:33:19 +0000","from mail.free-electrons.com ([62.4.15.54])\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnJ2R-00040r-Gh\n\tfor linux-mtd@lists.infradead.org; Thu, 31 Aug 2017 06:33:17 +0000","by mail.free-electrons.com (Postfix, from userid 110)\n\tid A1442209D4; Thu, 31 Aug 2017 08:32:52 +0200 (CEST)","from bbrezillon (unknown [91.160.177.164])\n\tby mail.free-electrons.com (Postfix) with ESMTPSA id 792742091E;\n\tThu, 31 Aug 2017 08:32:52 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=9Ae6lU4jiJiEW4pjQi9/0V8sBIEoMvKxL6AXl2BNmvk=;\n\tb=Dm/+oX59wTlS5h\n\trY6DgVLVJJXgIQPp6ezV4uh+eV7ZCtnV4bBR5mCV0JbzvM9k/kaPnAHT+3FI8PNbpVoBdn4qexcgD\n\tfOX7XMzguH5b6DLuGEbMxmaJdJet5a7TzJK889XJgrSUwceN1l/OsGZvxB17lTNJbjHzPn5I1mX1k\n\tmTYzox27IxhAUnC58im9Sa8rXSXBOeXzffmrDxvsq2Hi6B8kE2K8TKadsFoo2qI1xryJ72oW49Oxq\n\tNVhpgoMv1NGw9HUYmszZ90dUXUn10BHd1Lp8XpMcSd9ANUGykrGY9cpTCmHZzp98i/0PqWbqMvriY\n\td7ztI9vXMiTyUw4BG/Wg==;","X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on\n\tmail.free-electrons.com","X-Spam-Level":"","X-Spam-Status":"No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT\n\tshortcircuit=ham autolearn=disabled version=3.4.0","Date":"Thu, 31 Aug 2017 08:32:53 +0200","From":"Boris Brezillon <boris.brezillon@free-electrons.com>","To":"Sanjay Tandel <sanjay.tandel@rockwellcollins.com>","Subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","Message-ID":"<20170831083253.76a8d637@bbrezillon>","In-Reply-To":"<CAB0kKmy+Lx-w=t=vzMJSbahTh9jHLZ2z3aAOJhVwg-t4MPVjAQ@mail.gmail.com>","References":"<1504036047-38848-1-git-send-email-matthew.weber@rockwellcollins.com>\n\t<20170830213450.663a218a@bbrezillon>\n\t<CAB0kKmy+Lx-w=t=vzMJSbahTh9jHLZ2z3aAOJhVwg-t4MPVjAQ@mail.gmail.com>","X-Mailer":"Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170830_233315_718879_C01B8CE8 ","X-CRM114-Status":"GOOD (  15.85  )","X-Spam-Score":"-1.9 (-)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"Matt Weber <matthew.weber@rockwellcollins.com>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>, Arnd Bergmann <arnd@arndb.de>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"}},{"id":1761168,"web_url":"http://patchwork.ozlabs.org/comment/1761168/","msgid":"<CAB0kKmwzgC9BPr=J0Xz5YjK7Y+sqrrYPYMiFc-_9GTipXXJETg@mail.gmail.com>","list_archive_url":null,"date":"2017-08-31T16:24:27","subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","submitter":{"id":72151,"url":"http://patchwork.ozlabs.org/api/people/72151/","name":"Sanjay Tandel","email":"sanjay.tandel@rockwellcollins.com"},"content":"On Thu, Aug 31, 2017 at 1:32 AM, Boris Brezillon\n<boris.brezillon@free-electrons.com> wrote:\n> On Wed, 30 Aug 2017 19:03:48 -0500\n> Sanjay Tandel <sanjay.tandel@rockwellcollins.com> wrote:\n>\n>> Hi Boris,\n>>\n>> On Wed, Aug 30, 2017 at 2:34 PM, Boris Brezillon\n>> <boris.brezillon@free-electrons.com> wrote:\n>> > Hi,\n>> >\n>> > On Tue, 29 Aug 2017 14:47:27 -0500\n>> > Matt Weber <matthew.weber@rockwellcollins.com> wrote:\n>> >\n>> >> From: Sanjay Tandel <sanjay.tandel@rockwellcollins.com>\n>> >>\n>> >> This patch adds map driver for parallel flash chips interfaced over\n>> >> a NXP Integrated Flash Controller (IFC). This driver allows either\n>> >> 8-bit or 16-bit accesses, depending on bank-width, to parallel flash\n>> >> chips(like Everspin MR0A16A), which are physically mapped to CPU's\n>> >> memory space. For unaligned accesses, it performs read-modify-write\n>> >> operations to keep access size same as bank-width.\n>> >>\n>> >\n>> > Did you consider re-using the physmap driver [1] and adjust it to your\n>> > needs like the gemini [2] or versatile [3] drivers do? If you did, what\n>> > prevents you from using this approach?\n>>\n>> That approach would have coupled my driver with physmap driver, which has been\n>> modified in newer version of kernel. So patch would not have been backward\n>> compatible.\n>\n> Backward compatible? I guess you meant backport-able, and I don't think\n> this is a good argument. We want Fixes to be backportable if they\n> impact several releases, not new drivers. If you want to backport your\n> driver to previous versions of Linux you can do it but it will never be\n> included in the official stable releases.\n\nWe would leave the patch this way. It's okay if it is not included in\nofficial release.\n\n>\n>>\n>> I intended to create independent driver without changing any existing\n>> driver code.\n>\n> Please look at the versatile and gemini driver, there's almost nothing\n> to change in the physmap_of_core.c file, and you'll have your own\n> source file (+ Kconfig option) where you can tweak the map hooks as you\n> wish.\n\nI saw those drivers and they look pretty much simple to hook with physmap\nby just calling the probe function from physmap.\n\nThanks for your inputs!!!\n\n>\n> Regards,\n>\n> Boris\n\nRegards,\nSanjay","headers":{"Return-Path":"<linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133;\n\thelo=bombadil.infradead.org;\n\tenvelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"onzwFaqw\"; \n\tdkim-atps=neutral"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjnm91BlPz9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 02:25:29 +1000 (AEST)","from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnSHL-0007Bg-JJ; Thu, 31 Aug 2017 16:25:15 +0000","from secvs02.rockwellcollins.com ([205.175.225.241])\n\tby bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dnSHH-0005xi-Td\n\tfor linux-mtd@lists.infradead.org; Thu, 31 Aug 2017 16:25:13 +0000","from unknown (HELO mail-yw0-f198.google.com) ([205.175.225.133])\n\tby secvs02.rockwellcollins.com with ESMTP/TLS/AES128-GCM-SHA256;\n\t31 Aug 2017 11:24:48 -0500","by mail-yw0-f198.google.com with SMTP id s187so738259ywf.1\n\tfor <linux-mtd@lists.infradead.org>;\n\tThu, 31 Aug 2017 09:24:48 -0700 (PDT)","by 10.129.170.79 with HTTP; Thu, 31 Aug 2017 09:24:27 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:\n\tReferences:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=IG0cXveMeXdEGOnvUcoODGZOjtXFQVAcxbSe7mnBd5Y=;\n\tb=onzwFaqwDfUttI\n\tqeTjwkd7FrorjjfF5hD3C3WhlnZC6IFMBxl29I7wlVDByUqA08QNdGMKBiD1E4LFqsR9N4WCNDiHy\n\tG3ILmyj29eG0cRzmIviuY5Wk2maUokKNYBmnd+PdYqzceB0prfIiBlG5c2XUH1JPqdKuQGoXFzziV\n\thPx1XvDleEMkB3UYd9/aNgn7chlFHXiICq0601yIJ20MBeOTmHTkPrg9u7Z1Byf+ytwuh7DRZMVUX\n\telDqmIO9bk+BPATflQS5JxNgv7omQ564rf5R+HRsG2jnCOCAJ9j77Nuu7eiS6bfjW8sS7KulJn+BC\n\tSMyqsShD7b5c3CBdoEdQ==;","X-RC-All-From":", 205.175.225.133, No hostname,\n\tsanjay.tandel@rockwellcollins.com, \n\tSanjay Tandel <sanjay.tandel@rockwellcollins.com>, , ","X-RC-Attachments":", ,","X-RC-RemoteIP":"205.175.225.133","X-RC-RemoteHost":"No hostname","X-RC-IP-Hostname":"secip02.rockwellcollins.com","X-RC-IP-MID":"182358478","X-RC-IP-Group":"GOOGLE_RELAYED","X-RC-IP-Policy":"$GOOGLE_RELAYED","X-RC-IP-SBRS":"None","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=p0caxp3JAIzLitZdJIs77GcT5Jy6aH7BO6VcWUi4qcU=;\n\tb=lUp9GOFLpum+kY3kFEDRo0f4KjxPN4la8V1oTnIoQqZPhVzoGeCVfmnP3c8e4DcV0R\n\tmmJH3YXS1N5ccC2Tx06cS6DnKytfCy/n2tf5wkTPJM5QCqvV15lV6FbL1hsLdRWdrl8x\n\tVbOe0ZuqtFBUZP9/8FOBZbpXeI20hWSGxjSMD1YFIMXgBMmXLgOxxzcsfJ1c4bgdaa8s\n\tkbCh9pApmv0f5wVXZDValb1aPI7hCwfXRMG82Yw2nI1FwCJXWyT31M/UYZHHLXKFGnhM\n\tsUqv+I2S79DOZpUHOJF7wrdpAkzNDhK6n9jGmjdotfrk92n/NEJkIoqGzUl1Saa8/xuh\n\tQtpw==","X-Gm-Message-State":"AHYfb5iWS2XhVdlZamWoa5cIjWSuJ1SK+P5aRkC3wkmdoafPgbCMu0kk\n\tWo8rcfVyL/nvLU1aXt2zn6n4/xYGCQfY5itZUfERlPlXMt6SDGJFORlNqMHIFO/vaygHln3V8BX\n\tlphhe9VbTyugjbMxTy9vs/gRaV8fXRvBXe1ESCWCV6HpskUS3Yhc=","X-Received":["by 10.129.174.73 with SMTP id g9mr4891627ywk.403.1504196688324; \n\tThu, 31 Aug 2017 09:24:48 -0700 (PDT)","by 10.129.174.73 with SMTP id g9mr4891607ywk.403.1504196688014; \n\tThu, 31 Aug 2017 09:24:48 -0700 (PDT)"],"X-Google-Smtp-Source":"ADKCNb5/xXpRmIgXnfNefIlxV5K9U2HxIW1yAptuv3gBD7pfnYfRTxG157gu60ejBAPhdaO/mnw2ZDt6n3KsXeGrkXo=","MIME-Version":"1.0","In-Reply-To":"<20170831083253.76a8d637@bbrezillon>","References":"<1504036047-38848-1-git-send-email-matthew.weber@rockwellcollins.com>\n\t<20170830213450.663a218a@bbrezillon>\n\t<CAB0kKmy+Lx-w=t=vzMJSbahTh9jHLZ2z3aAOJhVwg-t4MPVjAQ@mail.gmail.com>\n\t<20170831083253.76a8d637@bbrezillon>","From":"Sanjay Tandel <sanjay.tandel@rockwellcollins.com>","Date":"Thu, 31 Aug 2017 11:24:27 -0500","Message-ID":"<CAB0kKmwzgC9BPr=J0Xz5YjK7Y+sqrrYPYMiFc-_9GTipXXJETg@mail.gmail.com>","Subject":"Re: [PATCH v2] mtd: map: new driver for NXP IFC","To":"Boris Brezillon <boris.brezillon@free-electrons.com>","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20170831_092512_095678_44E769DE ","X-CRM114-Status":"GOOD (  17.48  )","X-Spam-Score":"-6.9 (------)","X-Spam-Report":"SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-6.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/,\n\thigh trust [205.175.225.241 listed in list.dnswl.org]\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay\n\tdomain\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n\t<mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Cc":"Matt Weber <matthew.weber@rockwellcollins.com>,\n\tlinux-mtd <linux-mtd@lists.infradead.org>, Arnd Bergmann <arnd@arndb.de>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"}}]