From patchwork Mon Sep 14 21:09:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3350 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id CA6881C4D21 for ; Mon, 14 Sep 2026 23:12:45 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-25926-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-25926-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id B75AE60C285 for ; Mon, 14 Sep 2026 21:11:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BF714A385E; Mon, 14 Sep 2026 21:10:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RN51EjHo" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-oo2-f15.google.com (mail-oo2-f15.google.com [74.125.231.143]) (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 379854A263D for ; Mon, 14 Sep 2026 21:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.231.143 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789420215; cv=none; b=CxB5RunGskGckXxB3pCxGxHgA4ingcLdekWS2SdvdczVJEkvgXtG2A1v2q5wbYlWsYBd7d+NA5pjqNxG1IZxSI/wS5sf+xLaQ0TZDP/sY9Z5KTq8VnoQHYpxP/wrd4vVYZUfBXmOnnB2ief1NjTXPJDb7KfhiE3CGsUAWz/qfRA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789420215; c=relaxed/simple; bh=TnmhAN7UAS2ynuFEOPQLlzD2wvbIo/yeVWwhOMqNS58=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IrSOYprOPSa5RVZidhNIXp9PMq0jtNu70yhzmRUqmfzPY8tA1dyq9fHpsmNmtZOHFW09d1G6Y4Pd4NjsKSBHVVw0lRpKRNoec8hkcYpoDURHui/Qu+9bWyFRyUWiIqg019gbGzdnX9KrKYz5P4eJCgBmLg2CUOvZqK/8MdxfRjs= 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=RN51EjHo; arc=none smtp.client-ip=74.125.231.143 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 Received: by mail-oo2-f15.google.com with SMTP id 006d021491bc7-6b4bff33d18so1038157eaf.3 for ; Mon, 14 Sep 2026 14:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789420212; x=1790025012; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=SP5FgDVql885MI97WgCQyPWKLiok3M5jguE0MrKj3qI=; b=RN51EjHoc9JtKaeVXg6AjhLaNC+1LbcCWuDmEXPkTGhY9Gvw1fpa1Zn9qekWZKuSdd lor+5rybOFuWm8oy65/cSC52C/FDR/8+4yVgoyyk1SLBMlFhfsq+NJ3WE7v2c19zPh17 kCgxm+YtCukEzPFwIwlX5e/1yhxwM3muOHcmdVX+Oc5m8TFN/3DX5b9TAl41nxVTLUiq v4hDZq2VW+jGQX43Jn+1KgZA6IAdnC74kGfFI+nVUknRuhqqOkOdND/hg/tZ/FcMfu5i 3bEqE/+jLmdgazbIPFoyrIQHy69oE2dD+BJFGD9pE32ulNxKy3YYOoxn9xArLmCbhtsH Hzag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789420212; x=1790025012; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=SP5FgDVql885MI97WgCQyPWKLiok3M5jguE0MrKj3qI=; b=nyQ0R/WESPPPQ+Eq7cwhekQBjjMOwiIWk0KoUGsAwbb80EQN3EI7tSslvl6Ja5TRSs ZwQW0nv0Wojm63j75GT/23cLgrcdD3RdNYBIGLFpz9GCfRM5JsSDbovC/+fq8XZ9Yit6 wryqt3cnEIN3uglatZ3gB9+bLp5yNtWGV/8+3wYzPE1W4+WVXajhmlEWWsiMjYZbiK5U 5UUmiv8g1CUKpgMTjK4Hy/gdL89PwnjsLv3hi8JhGaneTDAOQz6m7Selu2/E259YnDes FnOQFSTjiERF+IZIBkdbNawx5+5C5Sof10PpwoATktb5ssR9WhccNQAAZISuG4Dhk+A3 KUfA== X-Forwarded-Encrypted: i=1; AKwUvBzzza1iXgKgAt78EK9yN56d7wBwGCT8hCSoMf3C10i+C81dg9nt7U/5IrOZwiiP4Qw2rjp5us+vn2dWVQ==@lists.linux.dev X-Gm-Message-State: AFuF++lUZXr1dZFw7ZZbiPid5hWvO9lhoWafKQbz4ysP5KnYn53Ns3BV qYuC5RbGCjJ7ma2pQb5OotB0Yz0boFUgqPGn9PTcd6YZJIkEE8iSzC/9 X-Gm-Gg: AYBFou2llhtCFBoCWuXw8bbtuSV4vql6axIZWEf1lH0g8FVLRVBr7/xwt5EAA7SbV13 30BcHT07+UFXAQazyby1BqBK3H5+0wFnWjBg47ps5iouVMTZJzIJVYRtoz53vRaPU8fMH22TsbN RVxga2bwl7ExPxmbmDm7CuZQQ/O54gSk1eh4loLeAjReGy4Eg7h5JBDLq3dleO+KZ+IQfQowZTh ZAlet0luhhf0dV93Tq9otwU6i0xiCD2mSYb+6r8qB9L9Jl9MA6UvfkgEYycxzaLgKz1z1wk5vf2 IBIeSZtGtNMWn/ppeQ2OztsNXWSFs1N63ZQ/Fry2qUhWK2xK6A2HsTZIwvbWWlZQr7KTByoqTF6 gLFhMpIxXCaBIMXt8PSrx7E/d2aZB4cSH4kwObyN1XeQg3Y04fv6n1TmVdcNKO6cNNRxcxeYp0H lX5oob1ZrPQUpswn7vMIXJv2UNn+EeC7CX6eSQ8MkWHSdveN1U0uRx0jAF07+8nl3g7B8G27on0 THuvZ8jQB5pA0X7TKk3EIeZXmcMqEKjQJDnUSBDmadi2lCI7UrrebpfjI/G0DyO1ashUAw0b7j8 T0P3QgWcMvnWc0+bU++KrmnUlXTXVF5CjHKA7SNN7TS6KkUopspKB+xRvUA/jH7BfLok1tl1bDm UKzduA045tbVv2ymKB6jxGj/YFyn1 X-Received: by 2002:a05:6820:1609:b0:6b9:4557:2722 with SMTP id 006d021491bc7-6c53f252fa7mr2388952eaf.3.1789420211667; Mon, 14 Sep 2026 14:10:11 -0700 (PDT) Received: from [127.0.1.1] (184-96-157-145.hlrn.qwest.net. [184.96.157.145]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6c45bfc3fe9sm4698544eaf.15.2026.09.14.14.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2026 14:10:11 -0700 (PDT) From: James Hilliard Date: Mon, 14 Sep 2026 15:09:58 -0600 Subject: [PATCH v6 12/18] dt-bindings: mtd: sunxi: Add randomized OOB flag Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260914-submit-sunxi-nand-vendor-oob-layout-v1-v6-12-2fb084fe0751@gmail.com> References: <20260914-submit-sunxi-nand-vendor-oob-layout-v1-v6-0-2fb084fe0751@gmail.com> In-Reply-To: <20260914-submit-sunxi-nand-vendor-oob-layout-v1-v6-0-2fb084fe0751@gmail.com> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , Richard Genoud , Masahiro Yamada , Boris Brezillon , Brian Norris Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, James Hilliard X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.34 / 15.00]; RBL_SENDERSCORE(2.00)[172.232.135.74:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[20]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sto.lore.kernel.org:rdns,sto.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[dt]; FREEMAIL_CC(0.00)[lists.infradead.org,vger.kernel.org,lists.linux.dev,gmail.com]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-25926-noreply=patchwork.local]; R_SPF_ALLOW(0.00)[+ip4:172.232.135.74]; FREEMAIL_TO(0.00)[bootlin.com,nod.at,ti.com,kernel.org,gmail.com,sholland.org,socionext.com]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.232.128.0/19, country:SG]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: CA6881C4D21 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Allwinner NAND firmware stores the bad block marker through the controller randomizer. The mainline driver instead compensates the first two randomized bytes so that the marker remains plain on flash. On H6 and H616, the firmware also uses a fixed protected user-data placement while mainline fills the OOB space left after ECC. Add an opt-in property selecting the firmware's normal-page format for the configured controller hardware-ECC geometry. This covers the vendor-specific randomizer, bad block marker representation and protected user-data placement needed to access BSP-derived images. The property does not change raw-access semantics. Raw operations still bypass ECC and randomization and expose physical main and OOB bytes. Signed-off-by: James Hilliard Acked-by: Conor Dooley --- .../devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml b/Documentation/devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml index 9d061e2216cb..8ecafc40ddcb 100644 --- a/Documentation/devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml +++ b/Documentation/devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml @@ -79,6 +79,16 @@ patternProperties: minimum: 0 maximum: 1 + allwinner,randomized-oob: + type: boolean + description: + Select the normal-page format used by Allwinner NAND firmware for + the configured controller hardware-ECC geometry. Normal page + transfers use the controller randomizer, the bad block marker remains + in its data stream instead of being compensated to stay plain on + flash, and protected user data uses the controller-specific placement + expected by the firmware. + unevaluatedProperties: false required: