From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C221131E83F for ; Thu, 5 Mar 2026 07:12:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772694776; cv=none; b=MEoq67UBjuMPMRLYwHFUGvFOLzUFHV787JNMRt5V1U1YmQHnDHvtJPxCGBEdzfKh7SS6EiDIL0XUJ8hMRxtzn4VsdQoo5W21LBPENOTwSI2cgzURGDDDXUDbeH7gKy90/F1z2GaKfVGBG4cqY9wEBaRO+K30BcZfBocNUq1Uy9I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772694776; c=relaxed/simple; bh=HwsQEiu17VuA3xIRJOPgmGo8ZEG64SFKUPK3RyCa3Tc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=fiYfMQO+H9LETddo0ilvAn2zHF2OHvjfLxRNYgEzXM/FMwmYnMnrspPqC0WS8gLJ24EvspJPrCNgVa81Zf5loHBebpgF57iPGQ9obKjkBvTfGyDmEqMWRBwlfiDbRc6TdTqRkYSB7SDOMUiAvvZFcE8GMK+nJ06cgtVLZVxC/js= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=f6otFqRK; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f6otFqRK" Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-c06cb8004e8so2994466a12.0 for ; Wed, 04 Mar 2026 23:12:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772694774; x=1773299574; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=N5f4RqYhIr8SlZiekPT6yrIR6+52GHg/ZPht85pzRuw=; b=f6otFqRKsweSCbQ94nmpryk5FNBOaJaTGO7gQ8DfK+Utcg6oB5RvJ798xZ2Vk4MeBv eOQoluuumg+fBNsxdZjtEv8pkrE9A+ZlOSB6skVx4zM4awINzgg/9YQfv8H8Na2fHO0f W4JrD/9phNVERt/FA8/5ZdKL5vzzOn00S3bBnxDFHy4Q+8WCeCmdt284wPVO0f9Qvz8P c27qmZ9NLV5AqJYtKaPuyYklg3LWVGolWLoNSZmbcOT/qQslbA4uT63TIHclNO8daxx4 lJxt1G384/P7+SGoneGqVFT4E14sJg7Hlf8ZSC33o1q0QpL2XHpTEcFaQsYI+giJMuG/ DXcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772694774; x=1773299574; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=N5f4RqYhIr8SlZiekPT6yrIR6+52GHg/ZPht85pzRuw=; b=oXMudLmFBq1YubDo2qRdGbIGa/Nzi0CJEvw0E56PNvOI1KdZqConAI59jZrFObc+wJ I9WIVdDxjJ+bk8nDB1G+C4zOdzO3z2c+HEd0NuhVZNBB1kGwtSYcsukUjhPcQ43lTVbe D2k/8hqFnzHD98Kt/DZ2Ib+SbXT7PxKeYl5M0ShwSK9enuNVxv+Xj8B/Jj0vL9JIHutM B+4AdSFU4I6Pupda4vUsPJ4ox0QfgsndYBz2YiXSP871KvBDAR47OSl6zBlaHIl4fSNS aN6ZGvEBtaBsNMEr7oPdqlitsHsU/DGKYTKVIgkf96/++pBMaLIsw6MHDhWVE3x+KJPt swjw== X-Forwarded-Encrypted: i=1; AJvYcCW3PpGIVvRaYEAbyaJYmrQNfrU4wilYwV7w6Hpwt3M6FRKnD7aXJyroxeEhg2rm1MT9iGn8y20Fcl2Zi8Y=@vger.kernel.org X-Gm-Message-State: AOJu0YxQ2AaP2H5x8ognmWRWuayVH21BwJx62FPtwO5txl/bOng/lqhR L6r6WgAUN3s5hhOoAv6iV4arIwNGirR9bx8DEXBhBKWB6FqwwhI6QApD X-Gm-Gg: ATEYQzzZIF1oyjjBrkQKXMWoVho1x5/p8iockj9N/N4gZ3rXBnFP5IJ8J/KxttDAdd4 WzBEV8+TtWupr8+kELEiP0YTcpFhDOhWCxPwzbQtvLOBARKkCpY1o6XLNnf2QZiyPiXI0gsfxbP x29c52NJV28IdN1PlWJw09LcSjHNIKR4MUy8x8nVoQed5oGrF4T6Ae1ClI9omABq/JveOqHS9RP OgNofQv/xRQOlS6+AaiGZoXroQsvkYIqHm3BQakxCrtcyEW+Hispef6n1ChxqUk+XRzYKWTRuAp wmRb6x6qFtXtGcgCTvbgzw1rJXjlRJAYJvV1qJCqYdYL7BdalrqE2wTkTPXLY6qMxkb1fNJwWAO yFVLm9KTzqCDwbP6EzGebv74Ps1JVTpvxFyiq1S4AgBc8xa/7vlRDvtnxg3hhtWCtkkHkksicSN UegxKQ2z8Y2ev9AJttV+CxUBui7iCZmK3IH7Rgh+hIJkqfeA== X-Received: by 2002:a17:90b:2252:b0:354:999f:1b22 with SMTP id 98e67ed59e1d1-359a6a7cacamr4099055a91.32.1772694774083; Wed, 04 Mar 2026 23:12:54 -0800 (PST) Received: from twhmp6px (mxsmtp211.mxic.com.tw. [211.75.127.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-359b2d6ee67sm992920a91.14.2026.03.04.23.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2026 23:12:53 -0800 (PST) Received: from hqs-appsw-a2o.mp600.macronix.com (unknown [172.17.236.67]) by twhmp6px (Postfix) with ESMTPS id B2CB14163B63; Thu, 5 Mar 2026 15:12:50 +0800 (CST) From: Cheng Ming Lin To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Tudor Ambarus , Mikhail Kshevetskiy , Pablo Martin-Gomez , Tianling Shen , Pratyush Yadav , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alvinzhou@mxic.com.tw, Cheng Ming Lin Subject: [PATCH v8 0/3] mtd: spi-nand: Add support for randomizer feature Date: Thu, 5 Mar 2026 15:10:39 +0800 Message-Id: <20260305071042.1193522-1-linchengming884@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Cheng Ming Lin This patch series introduces randomizer support for SPI NAND devices. - Patch 1: add the nand-randomizer-enable and nand-randomizer-disable boolean properties to the generic nand-chip.yaml bindings. - Patch 2: add the initialization logic and the set_randomizer callback to the core framework. The core will now parse the device tree properties and enable or disable the randomizer accordingly during spinand_init. - Patch 3: implement the set_randomizer callback specifically for Macronix chips (MX35LF/UF series) to handle the vendor-specific register operations. v8: * dt-bindings: spi-nand: macronix: Remove the chip-specific Application Note link from the commit message to keep the binding generic. * mtd: spi-nand: macronix: Update the broken Application Note link and move it here from the dt-binding patch per Miquel's suggestion. v7: * Directly return the result in macronix_set_randomizer() v6: * Added mutual-exclusive constraints using not with required for nand-randomizer-enable and nand-randomizer-disable properties based on Krzysztof's feedback. * Simplified the return path in macronix_set_randomizer() to directly return ret; and dropped unrelated formatting changes. v5: * Promoted the randomizer configuration to use generic NAND properties (nand-randomizer-enable and nand-randomizer-disable) instead of vendor-specific bindings. * Refactored the initialization architecture in core.c. The core framework is now responsible for parsing the device tree properties and deciding whether to enable or disable the randomizer. v4: * Fix a build error in spinand_randomizer_init() where a value was returned from a void function. (Reported by kernel test robot) * Update the return type to int. v3: * Revert the device tree property to the vendor-specific "mxic,randomizer-enable" to strictly follow vendor-specific bindings. * Update the 'set_randomizer' callback signature to accept a boolean 'enable' argument, allowing the feature to be explicitly enabled or disabled. * Switch the implementation to use the standard SET_FEATURE command to modify the Configuration Register (0x10), replacing the previous special program command method. v2: * Create a global NAND DT property Cheng Ming Lin (3): dt-bindings: mtd: spinand: Add randomizer enable/disable properties mtd: spi-nand: Add support for randomizer mtd: spi-nand: macronix: Enable randomizer support .../devicetree/bindings/mtd/nand-chip.yaml | 18 +++++++++ drivers/mtd/nand/spi/core.c | 27 +++++++++++++ drivers/mtd/nand/spi/macronix.c | 38 ++++++++++++++----- include/linux/mtd/spinand.h | 9 +++++ 4 files changed, 82 insertions(+), 10 deletions(-) -- 2.25.1