From patchwork Wed Mar 6 04:15:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KR Kim X-Patchwork-Id: 1908539 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=hTn8shrp; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=skyhighmemory.onmicrosoft.com header.i=@skyhighmemory.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-skyhighmemory-onmicrosoft-com header.b=7INxlBqS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqJzJ2wjtz1yX0 for ; Wed, 6 Mar 2024 15:16:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dAk7kIOpeldWLEYC3OCjgHT1QK1xbyvlYt/2I46dyUE=; b=hTn8shrpMN3iZ0 nbd5bSuD7Pk85j8S0AOOE898zXODNh7frHYjOX+kBqQq3mbMj4fjWY0Y/JJvNHr8BIyqQyaZGLDE6 CehIuSQrxf0ajR3X+dXckXvR6e0QxNbnWQ3WPOagFU/du7PafL6aiHDk7ObeERSvKxIeL8nd+wkX0 x7pWy0Du8LYXNgrbK28vMNA5hTqKExzt+7pFHw6A1OZ6y2s6xKpD2Cf2M1hohpjO8eCQKH4BORxWc Iztfq5+cElJdTtiwVrZwYsrWt/f5bIOGG+pSrzCmJiv/ye4FG2rBw0QsjLyzVYZlDa04Z5yuON/kT dE+FDzkwtAoJb6XmqVXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhihh-0000000GEf0-34q9; Wed, 06 Mar 2024 04:16:29 +0000 Received: from mail-ps2kor01on062b.outbound.protection.outlook.com ([2a01:111:f400:fead::62b] helo=KOR01-PS2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhihe-0000000GEcD-3usg for linux-mtd@lists.infradead.org; Wed, 06 Mar 2024 04:16:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QvJwJxw51yNN3jFoOcyR/d1NZ7XE3dp+9g+XVWpnnkkgTmJms+IpG6iCdFSo3YpskHKtNt0YXqCSgB2mf4Rr78dV1oioc4Dyeb+x28LZEA9Fn/h5cpKsJ1xZ7tmVVXqJZ6h8BJLcf2Z9gDpCDKNRUoc1ZmoZ0emJ1z2AdS3t+pKv/Rft82jSt8hYa7EiupK6RRA1A5e75zMgCKNTpzyTDWj/hbFVRTyqt7MAesLGsIAykbdtqb0Ni2VJX08ay/6WpxVt9wKGFJDTaiROvfR7f6ddJshljwlDaqA5fDNuaLm4V12SKkitKs2zZQd+ajwGGLKMoWRdaNb7mkkeDZocxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=89trl++5sIrUmtdjWJlt+98R0lOUKCJOxXi8QsSM5Qc=; b=gpu9nIs7Kb15debRxrMvqAPU7JDRTqr2Ze1aigGXS/q5Yu4DLxFsMNHOfqcgel36yRhTrODr0JaxPULtTa7jf3Wzg52ba5JCwZkJThfRCNcvq/BRBfDNHANeDBQxZ+FpHYpJTl+TknMpava+j67FNUsp2nSgWVgDr71xA4Lb18Zc4DsDaVUqpgZC3O1m3BAhHkKvTxvED5NYXcCoUY4zACzAeuyolfF717PvM2XFxIZwWk5Uywtgqq5oT9Xd3zdCW8fkT2aYjrSccHkT/Iya0Nj1buwGCCdj+r4qIBwW+lgA8PwbR811dNmQboztsn208otUuIlWS6/BmQKiIQ1HWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=skyhighmemory.com; dmarc=pass action=none header.from=skyhighmemory.com; dkim=pass header.d=skyhighmemory.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skyhighmemory.onmicrosoft.com; s=selector1-skyhighmemory-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=89trl++5sIrUmtdjWJlt+98R0lOUKCJOxXi8QsSM5Qc=; b=7INxlBqS0/w3N0/C0JTB/ta+k5UR72liBGsa6Kkh/DADWvgAFpxhX8ygejKvd6mMxVGNJmVdkndNhCOXwuq6n3kR2Q7aE6uvXJMx8PvV4L0VanMS5IMwOf8a3GscTkqKU1Of+i1ewCTzfUfZQg2glSSW6K947v7a2Fnq41j41Uc0PpJ6nB4WDyVCtOUa6Sw/F597hNx+cYg0TFqJTxuyzh2t/K+rzwlzQBqYgkmz2/Ge42sGfdkWjtQXcKu/iHP6bRSU3arC8sqIEWkdqrpr8lcFGzPTkyM9Ol4hMn9/7ZkYpcy3klnmHhsJOo62iaWzMlCtDsEfSIu2syCIJMGXHw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=skyhighmemory.com; Received: from SE2P216MB2102.KORP216.PROD.OUTLOOK.COM (2603:1096:101:11b::5) by SE2P216MB1992.KORP216.PROD.OUTLOOK.COM (2603:1096:101:119::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Wed, 6 Mar 2024 04:16:14 +0000 Received: from SE2P216MB2102.KORP216.PROD.OUTLOOK.COM ([fe80::6bad:dd98:cdca:c48d]) by SE2P216MB2102.KORP216.PROD.OUTLOOK.COM ([fe80::6bad:dd98:cdca:c48d%3]) with mapi id 15.20.7362.019; Wed, 6 Mar 2024 04:16:14 +0000 From: KR Kim To: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, mmkurbanov@salutedevices.com, ddrokosov@sberdevices.ru Cc: kr.kim@skyhighmemory.com, gch981213@gmail.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, moh.sardi@skyhighmemory.com, changsub.shim@skyhighmemory.com Subject: [PATCH 2/2] SPI Nand Patch code for SkyHigh Momory Date: Wed, 6 Mar 2024 13:15:32 +0900 Message-Id: <20240306041532.16985-1-kr.kim@skyhighmemory.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SL2P216CA0079.KORP216.PROD.OUTLOOK.COM (2603:1096:101:2::12) To SE2P216MB2102.KORP216.PROD.OUTLOOK.COM (2603:1096:101:11b::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SE2P216MB2102:EE_|SE2P216MB1992:EE_ X-MS-Office365-Filtering-Correlation-Id: ce872f17-71c5-415e-7e44-08dc3d9429de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: buRo6fCD+geAf6UMK/NXpvbUo2sT0/SXgtv7154C8j73P1F+zIcfbxv+ypJxEPIKfT0NcKiTLmkh7xqDDvnfltyT876SrxcSpwfB1wEPBQt9xw+21yYf2Ohc3fDUB/xQmcv/G493tYXsyvK8Ep7p0Xs2UCokKe1IP83wRuh25Z/c6cmoETGL7DF3vkgq6jkwbeJEgx23Ilr2C1xdzorWkVSg7LcMhHXLjZzpP8TJUFZI8azDJn/Y1ONiKzr7THt8z84Pe6Dc22oz2ses6UiCdBTpjG2vkQmP8tX0MfMru5sJEcp9gG4NRktUc8V/0hLYC9H26X2VpWfaGipAUpfpPjLx2462VyX4RbcQdZ3Ctg8vpe0vo9wNUH/YnSr0kwnff4m3PALJX0zvuL9xaKOgjt7KPjIyQ2ICCubOUk/PiMwKUlIs0ZdoVGkt2HQTzu+KC5HAJ6UA8CAINM3ojjt+PIioCr6DX2bv+IzQqLkK5XrEg7qC/TRAJXlb66AfOndxwoOMtuIqtMsge4OQHy3m+rVISZHguleBT4tKbIB54K4Xb0/HdJwvPBtCZDQ27RI5IQ+umjivv3mMpYRUDgjMbyjWDGUu0SmcP52j2iSUdqPHi6nakUBFJNhAhrP+l1ZC0qQrhTQiidWjs+Y6RqiEnSqzXqrCUexZpS3qnr+uFmHAQhh6UaazzzIsQDY+teWL7jRbJPeghigL4kjyWcDncw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SE2P216MB2102.KORP216.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(376005)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /pMq6yMP7evG0k/FJffwywPYyCQPHMB2Lp7fLpbcIOKyhNsihRr1qGQgBK4G9sF1doEAZ7wwbDrb7roUnl0oF66hbDEVb1w8py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PNyGMxeTNtSIdUVdLv8jmlf2Bb/HgQcFUx/jDuo4Yq6WmdAqkal9o6dtGXPV/6JLn8Vh5QCIJmxnNzzrWtY7Ay5eYTvuw62qiet6jt/1byQYnkhFIVxD0HMt5/td+qCEArENETbrl50vqptEaofm7WIa/7chW4gubhdccJdRVeI3bDGN5TIjcDyOjpNbBUSyya5MSt7OrlseN71OMLRJNVeFa889QfRG0AEeANwvrkL9C3ngeFk5LVhS1PL8PXoNsx502dDJwpV/QFNpXJrtFJgQpeYXJWusk8ShwauUGf2N8AuFmH853m3qnslgzHiNDbjUbTZCtz1dGxx/xiL1gWLLkQwC4fsMncnRtCiqIZBUGd78koj2u3H+1R38h7XYdQboKaY0+ENsnN05OfF4xYgEiv2IXZ9H5Syj2lAShtFNXnx1U/aRB6iv94vFg== X-OriginatorOrg: skyhighmemory.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce872f17-71c5-415e-7e44-08dc3d9429de X-MS-Exchange-CrossTenant-AuthSource: SE2P216MB2102.KORP216.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2024 04:16:14.7350 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 39b82b34-0966-49dc-81a7-5bcab7ea53c0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1ppHe1htDSHnpq1LYB9XQkAJwhXiB1Tl9H0ajAB945X0NAGy3W6H1O1Y4wLj8SWEVqp4tpDT8HkPPHN9QwmGIv4RYriAcwRg+/5FbsfsGo8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SE2P216MB1992 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240305_201626_990123_DCE44407 X-CRM114-Status: GOOD ( 12.22 ) X-Spam-Score: -0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: --- drivers/mtd/nand/spi/Makefile | 2 +- drivers/mtd/nand/spi/skyhigh.c | 57 ++++++ 2 files changed, 11 insertions(+), 48 deletions(-) diff --git a/drivers/mtd/nand/spi/Makefile b/drivers/mtd/nand/spi/Makefile index 48b429d90460..1e61ab21893a 100755 --- a/drivers/mtd/nand/spi/Makefile +++ b/drivers/mtd/nand/spi/Makefile @@ -1,4 +1,4 [...] Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 ARC_VALID Message has a valid ARC signature 0.0 ARC_SIGNED Message has a ARC signature -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org --- drivers/mtd/nand/spi/Makefile | 2 +- drivers/mtd/nand/spi/skyhigh.c | 57 ++++++---------------------------- 2 files changed, 11 insertions(+), 48 deletions(-) diff --git a/drivers/mtd/nand/spi/Makefile b/drivers/mtd/nand/spi/Makefile index 48b429d90460..1e61ab21893a 100755 --- a/drivers/mtd/nand/spi/Makefile +++ b/drivers/mtd/nand/spi/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 spinand-objs := core.o alliancememory.o ato.o esmt.o foresee.o gigadevice.o macronix.o -spinand-objs += micron.o paragon.o toshiba.o winbond.o xtx.o skyhigh.o +spinand-objs += micron.o paragon.o skyhigh.o toshiba.o winbond.o xtx.o obj-$(CONFIG_MTD_SPI_NAND) += spinand.o diff --git a/drivers/mtd/nand/spi/skyhigh.c b/drivers/mtd/nand/spi/skyhigh.c index 71de4fa34406..dd348849216d 100644 --- a/drivers/mtd/nand/spi/skyhigh.c +++ b/drivers/mtd/nand/spi/skyhigh.c @@ -12,8 +12,8 @@ #define SPINAND_MFR_SKYHIGH 0x01 #define SKYHIGH_STATUS_ECC_1TO2_BITFLIPS (1 << 4) -#define SKYHIGH_STATUS_ECC_3TO4_BITFLIPS (2 << 4) -#define SKYHIGH_STATUS_ECC_5TO6_BITFLIPS (3 << 4) +#define SKYHIGH_STATUS_ECC_3TO6_BITFLIPS (2 << 4) +#define SKYHIGH_STATUS_ECC_UNCOR_ERROR (3 << 4) #define SKYHIGH_CONFIG_PROTECT_EN BIT(1) @@ -62,49 +62,15 @@ static const struct mtd_ooblayout_ops skyhigh_spinand_ooblayout = { .free = skyhigh_spinand_ooblayout_free, }; -#if 0 -bool skyhigh_spinand_isbad(struct spinand_device *spinand, - const struct nand_pos *pos) -{ - u8 marker; - struct nand_page_io_req req = { - .pos = *pos, - .ooblen = 1, - .ooboffs = 0, - .oobbuf.in = &marker, - .mode = MTD_OPS_RAW, - }; - - req.pos.page = 0; - spinand_read_page(spinand, &req); - if (marker != 0xff) - return true; - -#if 0 - req.pos.page = 1; - spinand_read_page(spinand, &req); - if (marker != 0xff) - return true; - - req.pos.page = 63; - spinand_read_page(spinand, &req); - if (marker != 0xff) - return true; -#endif - - return false; -} -#endif - static int skyhigh_spinand_ecc_get_status(struct spinand_device *spinand, u8 status) { /* SHM - 00 : No bit-flip - 01 : 1-2 errors corrected - 10 : 3-6 errors corrected - 11 : uncorrectable - */ + * 00 : No bit-flip + * 01 : 1-2 errors corrected + * 10 : 3-6 errors corrected + * 11 : uncorrectable + */ switch (status & STATUS_ECC_MASK) { case STATUS_ECC_NO_BITFLIPS: @@ -113,12 +79,10 @@ static int skyhigh_spinand_ecc_get_status(struct spinand_device *spinand, case SKYHIGH_STATUS_ECC_1TO2_BITFLIPS: return 2; - /* change from 4 to 6 */ - case SKYHIGH_STATUS_ECC_3TO4_BITFLIPS: + case SKYHIGH_STATUS_ECC_3TO6_BITFLIPS: return 6; - /* uncorrectable for '11' */ - case SKYHIGH_STATUS_ECC_5TO6_BITFLIPS: + case SKYHIGH_STATUS_ECC_UNCOR_ERROR: return -EBADMSG;; default: @@ -179,8 +143,7 @@ static int skyhigh_spinand_init(struct spinand_device *spinand) static const struct spinand_manufacturer_ops skyhigh_spinand_manuf_ops = { .init = skyhigh_spinand_init, -/* .isbad = skyhigh_spinand_isbad,*/ -}; + }; const struct spinand_manufacturer skyhigh_spinand_manufacturer = { .id = SPINAND_MFR_SKYHIGH,