From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 5929B256C84 for ; Wed, 25 Feb 2026 01:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771984746; cv=none; b=IuiHS0+s7zCgrXQfCqWn8e0PfG1MNpm2NFEmQ89pO+9JY3whMn8zD/ssHcXPqjRawDWtyHk2HZ3FEYt1FZ/q2NcFidMcm0pwX/4x7821BddFeFMw87nN4efZ9Ejknbb8Imc3mekSRd0/2P8wnwX258sWuEp00yF9wxagFDYSYAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771984746; c=relaxed/simple; bh=W2KKtQ6U1y1uHnGI/uA+jFy7/QOEsOMRiGUqVPJW/vs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=rM2fY5zBlG7XVoMOjUo9gfQoHNUPA6sDzQVJcrMwCDp7qhAYu2IrenTlGmj4HGYay5NeAwOH6+CHgP1aqPzlGF4/Sl6P26j07NHJeP9JtMGcFyxWEi99yINCFtA4+JucIkqSxXpxvfXUWR45HaX0mEdQruQagNqs1TqRx+WnaUg= 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=Oglb09DA; arc=none smtp.client-ip=209.85.214.174 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="Oglb09DA" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2aaecf9c325so2550545ad.1 for ; Tue, 24 Feb 2026 17:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771984745; x=1772589545; 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=sFSQgKMpbT4Jja0uO7WjQXE+RhpLS+aEelpO+yxQLtk=; b=Oglb09DAEuvCJ/2h3W8nq0JVuXbX8nsUipifd9x4a7ZuaKPK42/uadnP3eU2PM240S kPWSRjP9sTzuLIGYgHCJyrLKGr4oQ71B8Di+KporcBm8TTKhDt8axAiuPHbZ+iGi4puX lpPbLYk4Ihl/TwtXaFYeuh2tRQ67DUI4xDFdkhXcxyoUtNsD6yy3BKbxXaX+/oLxbS2l dcEB1dmyJrCgzy8j93YfnN6kXBzdtQ0RMaYUxDiOwbJCVRHEvO6+JCKiAb+5gWSaRnyZ BWedLXDUiR4HdmyMtRh1+xhx7eQ/WZqogBzBKX4CDMlLv4yZCnf4G5NsLP8UTxXG3FVX vUSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771984745; x=1772589545; 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=sFSQgKMpbT4Jja0uO7WjQXE+RhpLS+aEelpO+yxQLtk=; b=UIka+pQSIcSyEd3q5QJK/qlnS062JvPSJl38R/YLUmFSSAhGc75WWpWhP7Jrd+V2fP Hk8NJxmQcXBkROmymNDAAlj98wIKiKaZKkKcmDCcgYPH73r77DT2aeubfJybZoIPARVi 5YWwZlRZ1SWF1WrV0DRRhzZpQ0vj1yp+ACuW1HkCmVsw+gS1YpbJGRVtJL6zoe0KA67D rQydw//fSeM7bivzJKCdiUnMc+pksz33bMIOJ2CZWXq2ne55o5uG5ighn6qdgHIBUPOO NsKXyH3ifQGwYd/FLr1kyToRbhJxlzt/n5+pjcEDDJ5nnbd268jVGJKXPlz1ZCCTYQ0Z QLAw== X-Forwarded-Encrypted: i=1; AJvYcCXw9wm9QoAxHmVTZjOSsvGhU/BdDjtdLVGqDY47L9YxNtDsWmnpuANrwwwokhP/QkhRVKWPPodQ12qPlk0=@vger.kernel.org X-Gm-Message-State: AOJu0YyheYCa4jSkayu64eTcUnA4tNxI9reEYMa726AXBGqFa+yRaYGn O7kWxlkqmb6EJyh84oBK//LoX0pWxruwxVQchEFe8z7wz1VvexF6Ek+n X-Gm-Gg: ATEYQzyWcVwDb8EQt4AqUsxaCFmZ0KqxZDW3tf8rJD6gWS9uZcKrtDi5WzNgkm1A1oq PUqvwm+tYZZHWoK8tfpf0WnOOUGkl7HNDNyfUkZ/HJ7jEvXjYJDJieDLdI4zu7wvSIW7AkRAN9J JqRYBjUlzuWS7kpMgjGFhWYqBZHuRnlFPbAR57rQW2Ojm+TAIEZDV7ASsEwufU7pzq/owOXWu3i 5kPkel8oUTx4+CvtqBWgpVBtLFIkTALD4UXpGV6kEoyxPsq0eAJ/el3m1FX85XedHllViCsm5zi 8Zvvb/N0pdyOlIDgei/dYAy0v10FTiLuxJbSx9Y2isF53u50ApBFjRG6j6wrMrFtFwRsDYat2UK 89l/N5W7yiuNr5sjKrS+Sd2nxrrzymcOb8FTF5Sbg36QObw+Sz5pJkIWyI56kGSkemqBgwlDUu7 EXQ2MvK9m/bpFtoSdLHvnTrP68WmmW4JCfCfJvCPL3VSFi8w== X-Received: by 2002:a17:903:46c6:b0:2aa:e9f0:146c with SMTP id d9443c01a7336-2adbde10d4amr18311745ad.29.1771984744657; Tue, 24 Feb 2026 17:59:04 -0800 (PST) Received: from twhmp6px (mxsmtp211.mxic.com.tw. [211.75.127.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad75027affsm114744415ad.66.2026.02.24.17.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 17:59:04 -0800 (PST) Received: from hqs-appsw-a2o.mp600.macronix.com (unknown [172.17.236.67]) by twhmp6px (Postfix) with ESMTPS id 7B0A84136071; Wed, 25 Feb 2026 09:59:02 +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 v7 0/3] mtd: spi-nand: Add support for randomizer feature Date: Wed, 25 Feb 2026 09:57:02 +0800 Message-Id: <20260225015705.1113199-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. 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