From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796104686; b=CPH9YWFNj+WkST3n9rmX4fLOGXJyOse0g5O93gN9mHMeIS8Uj4CmIEcNj0B35oEyPvBU xWGGKfBr1SWXgyDv9a0wHvyTjFW/o53v+vtbdOhfTkIin35E8Vr4R8OlTTSgagLZCx84w m243rfeRxIPM9y4Wk8921AvVhEQUYQk8+rnvFtToewME+Di+DVSR4MfITLkPi0LxgU0Nv 2M+uMEb5fb0lkcgvphoAN8Nlx4bDPV2o9HtXhKX9Bg2Fn+ppLdnl449gcZP7331i+5HyE THkNn7bJrNbqqfkmU52YxyhegCwlfNMzAhLuCq6LJ30WANH85pbaoX+WX1a/KkRqiPA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796104686; h=Received:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key: X-Endpoint-Received:X-Original-From:Reply-To; bh=6DHXUJFdS9ltoOWBuHpW3uH8RUAcvg2jiiiSvpNw3m8=; b=4LtWu/WA6oXTX677TyyNAeFs9M0em5UQD1nqBjA44xA6ZRz/YVkWjRc4GXHvKjKYG5Sa TxQf46Gg+ErtAwSrUXTm5sKCmyp+NCfh0NZW06QhJFPEEIsvbOrCDZR7kUvx0dxQDxqS3 yHDXje+vENGSLLvJFwrFt7uFLgmE8BM9PuUc6LanWkqCmEu0vAySg1N3JDK4Ek5B+TFek d4IvapZgsFPfP1/9DkWgkQKglhnA8j/uPWWU3t3aEbtU/CWSqE2qqPflYezMUlD/2ZpZX iuopJyHXdW+AFV/E963QlS2Pn2ho2IGzCW3lLErLsX2syFy5Akn1HGxd0gx8bWxvcbw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L0vmmTH6; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB078606A329; Tue, 1 Dec 2026 05:58:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L0vmmTH6 Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796104685; b=Ii/Rc1/+aDqkQD74fukXg02wZ3dtefybb39yUdCXqWYPsJde78xOIoPerQNn77wjjE0g Kqym8eJWleVl2xiFjgWE3ZbNJpz9BhixNMoPhZdcRlkLjD4OlIVy1A8txPNFM7PgtXlh1 Fb8Zb4SQktiOmXN5Mn+yKdpeBhN879DjJzOcLH/zecpjo5+106wpwOH9htSDj7ecj2MwN Ix26uDJ/5tiO4ehWpgZDteVpyKNHoiO15eHIsPitnMDHv69+ach5JHo7IxXM2iFl/RJ2z hWKJRqCmvR/Twy4aZ6HUXRpB1lZhHWObTGcISTPLBFimiEjghD0ShRbj+CK6/T5H1HA== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796104685; h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=6DHXUJFdS9ltoOWBuHpW3uH8RUAcvg2jiiiSvpNw3m8=; b=Zts0I8rRdqysws56vb0RR/sQCwXGV6fHzcuHNUR5GZ3xvSBu/M4HEI08prev7auLeKxs +Onb3dHLojyhKNj4DMgfV+TUfS/zlKsjp0dOelH9tmx2574zIpRNbVErbaOxZKnOkDR9O Enrtbi+cf9tRMVtZyc4EfGR+W1ZCQkH+JqXYen/B5XJE5ZquT5O8vEq4wYpXKxCJXaLf3 yh0tQoKNuPiWmvtbbE0qOgsyTDrd44HhRiloyHAn+FiJYDzFkWB54abxpyzM1fdjUq+ax OoIvRUJCCKgPBiAe1dQzDgmMs+XzWCH3SXeTr6lCaAG1sXt8AiUNADvCJ2BC3Fs7+Pw== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 8ED841F0089C; Tue, 1 Dec 2026 05:58:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796104685; bh=6DHXUJFdS9ltoOWBuHpW3uH8RUAcvg2jiiiSvpNw3m8=; h=From:Subject:Date:To:Cc:Reply-To; b=L0vmmTH6YjS7Y7M/DclZWbB/zHZ6SYDqs2F10AqEDz3ZN3GR4eB4ebhZ6owJ0LKYi 5d1jkvbyDgtJ1TXZUxEDcyvluw/YlkNsZfmypuz6wC9oxIsLIInhJsM6p3L0gaBOni ru3FvcNmQX7VzzoIU3bslqPxmUI6yYIyVItpNGgwKamnrtUGrKx4679mqR+Y5ZVChm BYK4IZialwySdcAotFpMxUH8ny+/xAXOU2pq7ttdQT0TNC5IDAP0KwM/4bO2m/wRnM aW363lllOKHTK+WUcm6vAmF9fjM6IiLPUieGPuL3H3DKCEzJSrDsy8k9oCqXjdCdD/ DGerUAdtXK+1A== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id E0C564EBF2; Tue, 1 Dec 2026 05:58:03 +0000 (UTC) From: Fil Dunsky via B4 Relay Subject: [PATCH v6 0/3] Add Cortina Systems CS7542 NAND controller support Date: Tue, 01 Dec 2026 08:58:02 +0300 Message-Id: <20261201-b4-cs7542-nand-v6-0-e6b0d712745b@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/33NTW7CMBCG4asgr2s043931XtULGJ7Aq5KUsUQt UK5Ow5sokR0+UnzvHNjhYZMhb3vbmygMZfcd3WYtx2Lp6Y7Es+pbiZAGEQheVA8FquV4F3TJe6 s95YkAFjPKvoZqM2/j+Dn4bnLNXxRvMyV+eKUy6Uf/h4fR5zvXsZH5MBtJLQ+AiKJj+O5yd/72 J/ZHB/F/1xU7pNvwRlwWqo1l0uuN1xWDsEkVBgRBK25WnKz4apy6Ug515rWBVxzveR2w3XlSgd svAgJZVryaZrugfQIXLoBAAA= X-Change-ID: 20261123-b4-cs7542-nand-87997e300079 To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Fil Dunsky , Philipp Zabel Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796104682; l=5572; i=filipp.dunsky@gmail.com; s=20260930; h=from:subject:message-id; bh=IK+hKdQFkS6V8Ov3ZaEIcjm6hzJjqgyPN8YI7UkbSC0=; b=dRR2/tiUMSz1r+dJU04s+usbb17awaOc2WkJBdsg+nPfRK+jR7Z0cDSU5wKjSiZysI1PZINJo caO8CDy3j7/B11zSF6yctYqShlnx/X0yJ8sh6yLpzVf4KfJKBvpwKuw X-Developer-Key: i=filipp.dunsky@gmail.com; a=ed25519; pk=JAYP8e2rJ54DHOmhNtXud8rl1igAaAXoOHxtJmVXI1g= X-Endpoint-Received: by B4 Relay for filipp.dunsky@gmail.com/20260930 with auth_id=1085 X-Original-From: Fil Dunsky Reply-To: filipp.dunsky@gmail.com Add the CS7542 programmed-I/O NAND controller independently of the platform series and ARCH_CORTINA_ACCESS. Describe the hardware's two chip selects, 8/16-bit bus and Hamming/BCH capabilities in the binding. The initial driver supports one connected 8-bit target on either CS, on-host Hamming with 256-byte steps, software ECC and raw transfers. ECC_NONE is rejected: the core installs split raw-page callbacks for that mode, which are not safe for this sequencer. It preserves firmware bus timing by retaining the AXI clock rate. The optional flash reset is acquired without a pulse; PIO polls completion without claiming the flash IRQ or shared SSP DMA. Validate generic operation descriptors separately from execution. Use NAND core page-operation builders in the hardware ECC callbacks instead of assembling read/program opcodes independently. Preserve the existing Almond+ Hamming/OOB layout. Retained v4 validation (the on-host Hamming path is unchanged in v5): - Full ARM vmlinux/modules builds with the driver =y and =m, without the platform series and with COMPILE_TEST=n; software Hamming enabled. - Binding/example validation and strict source checkpatch. - Actual NAND core builders and the driver validator: 9815 cases each against native and OpenWrt 6.18 headers, GCC and Clang ASan/UBSan. - Actual hardware-ECC sequencing versus v3: 240 cases per compiler, including command/address registers, CS/bank selection, main/ECC/OOB ordering and fault cleanup. - Exact driver compilation with the installed OpenWrt 6.18.64 headers. The v4 NAND driver booted on Almond+ in a combined OpenWrt 6.18.64 RAM kernel. It read 56 MiB of protected regions with matching SHA-256 and matched raw/generic 64-byte OOB reads in all four banks. The real UBI stack created a temporary two-LEB volume, wrote/compared two 253952-byte patterns, physically erased both LEBs and read back ff. The temporary volume was removed and the normal reserve restored to 80 blocks (free 0/bad 0, original five volumes intact). The independent fixed-deadline watchdog returned to installed OpenWrt automatically; all 13 protected hashes and all configuration hashes matched, and the four LCD services and normal 30-second watchdog were running. The RAM run tested the retained hardware Hamming layout. Software ECC was checked by compilation and the core-operation host tests, rather than changing the ECC format of the existing flash. No kernel image was installed by the RAM test. Native driver source bytes were identical to the tested 6.18 integration; the native full builds are separate. New v5 checks: full native ARM vmlinux/modules with COMPILE_TEST=n, exact Linux 6.18 ARM object compilation with Werror, and 52 actual-source attach/child-selection cases per compiler under GCC/Clang ASan/UBSan. These cover a disabled CS0 sibling with enabled CS1 and rejection of ECC_NONE while retaining software ECC. The board uses a single enabled CS0 with on-host Hamming; these changes do not alter that tested path. No new hardware write test or installation is claimed for the v5 delta. --- Changes in v6: - Bound each PIO transfer with one deadline and preserve the cached read position when rejecting a change-column request. - Link to v5: https://patch.msgid.link/20261127-b4-cs7542-nand-v5-0-45b1a92bd13d@gmail.com Changes in v5: - Select the available NAND child, including CS1 when CS0 is disabled. - Reject ECC_NONE; retain software ECC and monolithic raw transfers. - Check the changed attach and probe paths with actual-source tests. - Link to v4: https://patch.msgid.link/20261126-b4-cs7542-nand-v4-0-38e488f6f8b1@gmail.com Changes in v4: - Address Miquel Raynal's binding and driver review on v2. - Describe controller capabilities rather than only the initial driver. - Add the AXI clock, flash IRQ, optional reset and data aperture binding. - Separate supports_op() and remove the NAND opcode whitelist. - Use core page helpers for hardware ECC; allow software ECC/raw transfers. - Support either chip select and reject multiple connected targets explicitly. - Preserve bus timing through clock rate exclusivity; do not pulse flash reset. - Clarify the vendor EXTADDR convention; retain the existing Hamming layout. - Link to v3: https://patch.msgid.link/20261125-b4-cs7542-nand-v3-0-0b6d141c102e@gmail.com To: Fil Dunsky To: Miquel Raynal To: Richard Weinberger To: Vignesh Raghavendra To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Philipp Zabel Cc: linux-mtd@lists.infradead.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- Fil Dunsky (3): dt-bindings: mtd: Add Cortina CS7542 NAND controller mtd: rawnand: Add Cortina CS7542 controller support MAINTAINERS: Add Cortina CS7542 NAND controller entry .../bindings/mtd/cortina,cs7542-nand.yaml | 90 +++ MAINTAINERS | 7 + drivers/mtd/nand/raw/Kconfig | 12 + drivers/mtd/nand/raw/Makefile | 1 + drivers/mtd/nand/raw/cs752x_nand.c | 759 +++++++++++++++++++++ 5 files changed, 869 insertions(+) --- base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f change-id: 20261123-b4-cs7542-nand-87997e300079 Best regards, -- Fil Dunsky