Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp93542iof; Sun, 5 Jun 2022 22:09:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDRHkoqtB/h7SrtcRuUffOq6RirMCxfHqMWKpJv/XpXF9G4j0sbbp4KgDKCxXhObvpHA+9 X-Received: by 2002:a17:903:2308:b0:167:6bfe:a800 with SMTP id d8-20020a170903230800b001676bfea800mr8249773plh.100.1654492155118; Sun, 05 Jun 2022 22:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654492155; cv=none; d=google.com; s=arc-20160816; b=Gi0bXjWT5UqomGQiJqCV3yycwd53uwfruSyP8R173qTi5wVekiRrZAqK07Z9H8B1je a9J7B4XeQ8skncbcwBvi4HZMaOHYrE4240bNEk1PrdmrpzhCfl9SN42AQzSsyha3McTS dqx+gC5LWcbM9KuMBz7dxIMLK/KJvjJ5NBa6hQg+BEIjN9ye6dQr57XsDSj8GIF5qTd1 AM8F04GgQzSRMo6VmFdP8IDm/PDP62rtZBasNUg+fxJlWPpXJ/jFYIfwRGDf6EAVzpmi DUg3+5gudBw69Dv9wUZR3nMCcrcmUXh0dr2+/VBEulS4sqpmLKD1D5fCJgtqqG0s+KLT FhQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=HiUwik3EhO3JFdFLVKOMNj1TCjCKUI8ClkdISKetXBM=; b=LTuErY+rzvSRiccCSyyqoAPM8BctJcy2QhMuyY3W9NpMBjJGI1ySWgcqOkamaHCMj6 lYxI2I8cgGrvUqmREyX0eexacp7THzp4shU9a/Fs71dmNOHWkjpGWumNqGbkPNL2UaL6 qCk4lEYaE8kv0XPSOc/x7HJYVSZ+OyRFBSt/mm3kALwxnY0x/W7C/dPCS7/pMQz0ttWg MheJd9QSnNolPHSlF1k1etRZZsswedPXFiXodYrIxRPJF2JuKxAaH7JW49Pkp1ntGKGz txEhtY6/tftdi052wxl9rHONbHuaGbsassT8dbpOcx1uB/qsbFpJ7McWhTyNwKyhS/CQ lW5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZitsYbiD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 2-20020a630902000000b003fc04782bbdsi19029742pgj.380.2022.06.05.22.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:09:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZitsYbiD; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 436CC16FEF8; Sun, 5 Jun 2022 21:21:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244805AbiFCNtl (ORCPT + 99 others); Fri, 3 Jun 2022 09:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243775AbiFCNtj (ORCPT ); Fri, 3 Jun 2022 09:49:39 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CC7A60D2; Fri, 3 Jun 2022 06:49:38 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 667701BF208; Fri, 3 Jun 2022 13:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1654264177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HiUwik3EhO3JFdFLVKOMNj1TCjCKUI8ClkdISKetXBM=; b=ZitsYbiDmmu0QEQK0tHpWRWxB7TnWCpnSoq+I8d/Yfc1w3sKzRu52h9LAQSX3QtsiTl4yW RfP1AIS5Ni/6TnYd7o6XZy49Wk9HcVTkBZok3zncudqlUJjpTvUK8vsRz5wd78QethutFq dLa2BLrsBHb76V05calbgIZQ+t1d+Sm+1DnUiM7ciXsMY9MspfTQEWNbecXprMnwd58/0e bFqsUzOchOw+jNW5/N7uS90b5+5eAS08VeFMLT1865QackX9G017RfeWTnGGNBruv/P2Em rBcOeXkxqak6EQ1TyuwG9i+rdzOUtSDsbGRL7k7K330Sl8Hf27EEHsXQfIwv3A== Date: Fri, 3 Jun 2022 15:49:34 +0200 From: Miquel Raynal To: Ansuel Smith Cc: Manivannan Sadhasivam , Andy Gross , Bjorn Andersson , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , linux-mtd@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 0/2] Add support for unprotected spare data page Message-ID: <20220603154934.521c57ab@xps-13> In-Reply-To: <20220519190112.6344-1-ansuelsmth@gmail.com> References: <20220519190112.6344-1-ansuelsmth@gmail.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, ansuelsmth@gmail.com wrote on Thu, 19 May 2022 21:01:10 +0200: > Some background about this. > On original qsdk ipq8064 based firmware there was a big separation from > boot partition and user partition. With boot partition we refer to > partition used to init the router (bootloader, spm firmware and other > internal stuff) With user partition we refer to linux partition and data > partition not used to init the router. > When someone had to write to these boot partition a special mode was > needed, to switch the nand driver to this special configuration. >=20 > Upstream version of the nandc driver totally dropped this and the result > is that if someone try to read data from these partition a CRC warning > is printed and if someone try to write that (if for example someone > wants to replace the bootloader) result is a broken system as the data > is badly written. >=20 > This series comes to fix this. >=20 > A user can declare offset and size of these special partition using the > qcom,boot-pages binding. >=20 > An initial implementation of this assumed that the boot-pages started > from the start of the nand but we discover that some device have backup > of these special partition and we can have situation where we have this > partition scheme > - APPSBL (require special mode) > - APPSBLENV (doesn't require special mode) > - ART > - APPSBLBK (back of APPSBL require special mode) > - APPSBLENVBK (back of APPSBLENV doesn't require special mode) > With this configuration we need to declare sparse boot page and we can't > assume boot-pages always starts from the start of the nand. >=20 > A user can use this form to declare sparse boot pages > qcom,boot-pages =3D <0x0 0x0c80000 0x0c80000 0x0500000>; >=20 > The driver internally will parse this array, convert it to nand pages > and check internally on every read/write if this special configuration > should used for that page or the normal one. >=20 > The reason for all of this is that qcom FOR SOME REASON, disable ECC for > spare data only for these boot partition and we need to reflect this > special configuration to mute these warning and to permit actually > writing to these pages. Manivannan, any feedback on this? >=20 > v4: > - Fix wrong compatible set for boot-pages (ipq8074 instead of ipq806x) > v3: > - Fix typo in Docmunetation commit desription > - Add items description for uint32-matrix > v2: > - Add fixes from Krzysztof in Documentation >=20 > Ansuel Smith (2): > mtd: nand: raw: qcom_nandc: add support for unprotected spare data > pages > dt-bindings: mtd: qcom_nandc: document qcom,boot-pages binding >=20 > .../devicetree/bindings/mtd/qcom,nandc.yaml | 26 +++ > drivers/mtd/nand/raw/qcom_nandc.c | 148 +++++++++++++++++- > 2 files changed, 169 insertions(+), 5 deletions(-) >=20 Thanks, Miqu=C3=A8l