From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4D20C04AB5 for ; Mon, 3 Jun 2019 12:44:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA11B27EBE for ; Mon, 3 Jun 2019 12:44:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=micron.com header.i=@micron.com header.b="jrcqtaqP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728118AbfFCMoL (ORCPT ); Mon, 3 Jun 2019 08:44:11 -0400 Received: from mail-eopbgr770075.outbound.protection.outlook.com ([40.107.77.75]:12399 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727675AbfFCMnk (ORCPT ); Mon, 3 Jun 2019 08:43:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=micron.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vUZDn4kynYb8CzfeIIUlIK5EF6qvw4aXhcKlRXa1dcg=; b=jrcqtaqPxl84vmO7/MIcWqfEkT/63hcIyHP1yfScR2d9eqzpXQALhdgt9pnW1Klf9o5kV8gV+ovrLCMzeHBf8sVZBauSn/9emEdotyEU60m3miYn52dJTvS/UZ4y2uxjaZ7TeFXYhvsFd/CcwQURB8PZ3dhLJ7pvYjvPhquTSsE= Received: from MN2PR08MB5951.namprd08.prod.outlook.com (20.179.85.220) by MN2PR08MB5854.namprd08.prod.outlook.com (20.179.98.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1943.22; Mon, 3 Jun 2019 12:43:37 +0000 Received: from MN2PR08MB5951.namprd08.prod.outlook.com ([fe80::f0f7:f262:a3c6:ce23]) by MN2PR08MB5951.namprd08.prod.outlook.com ([fe80::f0f7:f262:a3c6:ce23%7]) with mapi id 15.20.1943.018; Mon, 3 Jun 2019 12:43:37 +0000 From: "Shivamurthy Shastri (sshivamurthy)" To: Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Vignesh Raghavendra , Boris Brezillon , Yixun Lan , Lucas Stach , Anders Roxell , Stefan Agner , Marcel Ziswiler , "Bean Huo (beanhuo)" , Paul Cercueil , Frieder Schrempf , Chuanhong Guo , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v3 08/12] mtd: spinand: add parameter page fixup function Thread-Topic: [PATCH v3 08/12] mtd: spinand: add parameter page fixup function Thread-Index: AdUaBeblBBkTiS6jRfmQuYfbqm3u7g== Date: Mon, 3 Jun 2019 12:43:36 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sshivamurthy@micron.com; x-originating-ip: [165.225.81.42] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4d38a7a5-159e-474a-7d01-08d6e82118f9 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);SRVR:MN2PR08MB5854; x-ms-traffictypediagnostic: MN2PR08MB5854:|MN2PR08MB5854: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-forefront-prvs: 0057EE387C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(346002)(136003)(396003)(376002)(39860400002)(189003)(199004)(5660300002)(81166006)(8936002)(7696005)(14444005)(7736002)(8676002)(305945005)(55016002)(256004)(2501003)(81156014)(102836004)(2906002)(110136005)(6506007)(25786009)(55236004)(33656002)(76116006)(476003)(73956011)(66066001)(66556008)(66946007)(26005)(99286004)(64756008)(486006)(66446008)(186003)(66476007)(52536014)(6436002)(74316002)(9686003)(6116002)(3846002)(2201001)(14454004)(7416002)(86362001)(316002)(53936002)(71190400001)(71200400001)(68736007)(478600001)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR08MB5854;H:MN2PR08MB5951.namprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: micron.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2cCEbgFW0oux968vZAZ5+PK4vE/2EobbGSH5rQuHNWgXxCtlc4FvyeJddPoqFBIH7lm/LyqUQCK8DrvebadzbsyO3EYrqgHs62EgyEp5my9tl7alR9/kC8H6h++jK0FPRCpmAdV+ldIoJRRMbb4dgHq9b0Y5UF0FLF9wkBQiQRhKgAu3heq6efZodPwpgZZm9BKmqVEADtbxQWbzzbtdY+LcNJUqwjSqSb5C8EZXlTtO0k5+zFlV9rb664s96SZzwr8EUmGrrKxDtJC3WxcHgRnRRJ7BBUBOzxsQo4X02sOo3BDkx4xUwcmPI0hlYvKsHqxsMNkWQQtv4G/y+jeqy6FIent2z1DFMBklGqrGvl36E8ATx+gTz3+yLC5lkgsH13pyANU4BMGyGIsxvqFBwi77HtVct6IZs9HE+2yfWlI= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: micron.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d38a7a5-159e-474a-7d01-08d6e82118f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2019 12:43:36.7663 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f38a5ecd-2813-4862-b11b-ac1d563c806f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sshivamurthy@micron.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR08MB5854 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Parameter page not following any standard. Hence, manufacturers may interpret parameters differently, and it is better to have a fixup function. Signed-off-by: Shivamurthy Shastri --- drivers/mtd/nand/spi/core.c | 6 ++++++ include/linux/mtd/spinand.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index b031c4a2cdf9..cdf578c45c08 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -479,6 +479,12 @@ static int check_version(struct nand_device *base, static int spinand_intf_data(struct nand_device *base, struct nand_onfi_params *p) { + struct spinand_device *spinand =3D nand_to_spinand(base); + + /* Manufacturers may interpret the parameter page differently */ + if (spinand->manufacturer->ops->fixup_param_page) + spinand->manufacturer->ops->fixup_param_page(spinand, p); + return 0; } =20 diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 507f7e289bd1..41a03d59f003 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -179,6 +179,8 @@ struct spinand_manufacturer_ops { int (*detect)(struct spinand_device *spinand); int (*init)(struct spinand_device *spinand); void (*cleanup)(struct spinand_device *spinand); + void (*fixup_param_page)(struct spinand_device *spinand, + struct nand_onfi_params *p); }; =20 /** --=20 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33EA7C04AB5 for ; Mon, 3 Jun 2019 12:44:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 090DC2808F for ; Mon, 3 Jun 2019 12:44:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RXG31/83"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=micron.com header.i=@micron.com header.b="jrcqtaqP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 090DC2808F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=micron.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=NJbbsvsHxFbzpBPY2FJnQxfeP4QPLmmz1OMk0Xz0uOo=; b=RXG31/83UiBkl2 gNQKkqrxfft0YbL5XwAShY/KnFTZsxjv0Q4aDppsPsjYpTdi4apULWUw6wBQH2n9zzUiXRQ8jNdla D8f5+YNqppqJynylfH1X1e5gqGkCDk1/vS3j+rK8VReok2Wpfef+zekxEXhuD4kqfudBeMcPayoQX VDr/cVP58w1tb8eymPI/UVFSSnKftnt7cYlYblq5Bmm2OrdRF3B3AjpeO2S5q0Ti7ZKCqPJliWeEr 4dV8YnrAvfei+MjdCM0ryy37zgtq3e8F96z9ZC8AyWsPT3DVPAGMpKxdnZ7P0AusUhMEqBGT0OWI4 QahlHqK43vWFMCinZHiA==; 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 1hXmK5-0005LO-UM; Mon, 03 Jun 2019 12:44:21 +0000 Received: from mail-eopbgr770042.outbound.protection.outlook.com ([40.107.77.42] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hXmJQ-0004Oj-I0 for linux-mtd@lists.infradead.org; Mon, 03 Jun 2019 12:43:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=micron.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vUZDn4kynYb8CzfeIIUlIK5EF6qvw4aXhcKlRXa1dcg=; b=jrcqtaqPxl84vmO7/MIcWqfEkT/63hcIyHP1yfScR2d9eqzpXQALhdgt9pnW1Klf9o5kV8gV+ovrLCMzeHBf8sVZBauSn/9emEdotyEU60m3miYn52dJTvS/UZ4y2uxjaZ7TeFXYhvsFd/CcwQURB8PZ3dhLJ7pvYjvPhquTSsE= Received: from MN2PR08MB5951.namprd08.prod.outlook.com (20.179.85.220) by MN2PR08MB5854.namprd08.prod.outlook.com (20.179.98.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1943.22; Mon, 3 Jun 2019 12:43:37 +0000 Received: from MN2PR08MB5951.namprd08.prod.outlook.com ([fe80::f0f7:f262:a3c6:ce23]) by MN2PR08MB5951.namprd08.prod.outlook.com ([fe80::f0f7:f262:a3c6:ce23%7]) with mapi id 15.20.1943.018; Mon, 3 Jun 2019 12:43:37 +0000 From: "Shivamurthy Shastri (sshivamurthy)" To: Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Vignesh Raghavendra , Boris Brezillon , Yixun Lan , Lucas Stach , Anders Roxell , Stefan Agner , Marcel Ziswiler , "Bean Huo (beanhuo)" , Paul Cercueil , Frieder Schrempf , Chuanhong Guo , "linux-mtd@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH v3 08/12] mtd: spinand: add parameter page fixup function Thread-Topic: [PATCH v3 08/12] mtd: spinand: add parameter page fixup function Thread-Index: AdUaBeblBBkTiS6jRfmQuYfbqm3u7g== Date: Mon, 3 Jun 2019 12:43:36 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=sshivamurthy@micron.com; x-originating-ip: [165.225.81.42] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4d38a7a5-159e-474a-7d01-08d6e82118f9 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:MN2PR08MB5854; x-ms-traffictypediagnostic: MN2PR08MB5854:|MN2PR08MB5854: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-forefront-prvs: 0057EE387C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(136003)(396003)(376002)(39860400002)(189003)(199004)(5660300002)(81166006)(8936002)(7696005)(14444005)(7736002)(8676002)(305945005)(55016002)(256004)(2501003)(81156014)(102836004)(2906002)(110136005)(6506007)(25786009)(55236004)(33656002)(76116006)(476003)(73956011)(66066001)(66556008)(66946007)(26005)(99286004)(64756008)(486006)(66446008)(186003)(66476007)(52536014)(6436002)(74316002)(9686003)(6116002)(3846002)(2201001)(14454004)(7416002)(86362001)(316002)(53936002)(71190400001)(71200400001)(68736007)(478600001)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR08MB5854; H:MN2PR08MB5951.namprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: micron.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2cCEbgFW0oux968vZAZ5+PK4vE/2EobbGSH5rQuHNWgXxCtlc4FvyeJddPoqFBIH7lm/LyqUQCK8DrvebadzbsyO3EYrqgHs62EgyEp5my9tl7alR9/kC8H6h++jK0FPRCpmAdV+ldIoJRRMbb4dgHq9b0Y5UF0FLF9wkBQiQRhKgAu3heq6efZodPwpgZZm9BKmqVEADtbxQWbzzbtdY+LcNJUqwjSqSb5C8EZXlTtO0k5+zFlV9rb664s96SZzwr8EUmGrrKxDtJC3WxcHgRnRRJ7BBUBOzxsQo4X02sOo3BDkx4xUwcmPI0hlYvKsHqxsMNkWQQtv4G/y+jeqy6FIent2z1DFMBklGqrGvl36E8ATx+gTz3+yLC5lkgsH13pyANU4BMGyGIsxvqFBwi77HtVct6IZs9HE+2yfWlI= MIME-Version: 1.0 X-OriginatorOrg: micron.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d38a7a5-159e-474a-7d01-08d6e82118f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2019 12:43:36.7663 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f38a5ecd-2813-4862-b11b-ac1d563c806f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sshivamurthy@micron.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR08MB5854 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190603_054341_225989_592C3A3F X-CRM114-Status: GOOD ( 10.43 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org Parameter page not following any standard. Hence, manufacturers may interpret parameters differently, and it is better to have a fixup function. Signed-off-by: Shivamurthy Shastri --- drivers/mtd/nand/spi/core.c | 6 ++++++ include/linux/mtd/spinand.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index b031c4a2cdf9..cdf578c45c08 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -479,6 +479,12 @@ static int check_version(struct nand_device *base, static int spinand_intf_data(struct nand_device *base, struct nand_onfi_params *p) { + struct spinand_device *spinand = nand_to_spinand(base); + + /* Manufacturers may interpret the parameter page differently */ + if (spinand->manufacturer->ops->fixup_param_page) + spinand->manufacturer->ops->fixup_param_page(spinand, p); + return 0; } diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 507f7e289bd1..41a03d59f003 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -179,6 +179,8 @@ struct spinand_manufacturer_ops { int (*detect)(struct spinand_device *spinand); int (*init)(struct spinand_device *spinand); void (*cleanup)(struct spinand_device *spinand); + void (*fixup_param_page)(struct spinand_device *spinand, + struct nand_onfi_params *p); }; /** -- 2.17.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/