Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp129851iof; Sun, 5 Jun 2022 23:15:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7D6CiUGeGr+jcgD3FbcJnY0qP2WMyCU+d1PHq8bVNVnUCRUD5ndEz9lDNs+pLU5o/hzOp X-Received: by 2002:a05:6a00:996:b0:50b:76b8:3bb1 with SMTP id u22-20020a056a00099600b0050b76b83bb1mr23025884pfg.9.1654496118852; Sun, 05 Jun 2022 23:15:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654496118; cv=none; d=google.com; s=arc-20160816; b=BXi611MdO8ckfqaVFeCaEI8cMLdM4ytIEelIzruWsy/0TQXUYmhEkRuhCT4mpYqEND Z9mngFt62SHmkGoJ3d/idfhjuXcRu68gt+18cuIJaUf5oX40HoJ46F9ZG+4sUzG6nxtE lrddlNGqoDvcQi8PZVH2PtcO88Cvs0z/oZlYa3V5OsnM/9N61nKaOJtDGnEP9JXOlTp/ CQA8ejNEGma9PpxprIQtkC0smriEQ/3oRXChxRWlXzFAXWphP0Cbx4SDglo5OGE1TU0y ewnundladopNInApmUmgGYwcvu8iEzaiFVACwGRLQVvFS5v5O4JTOw61dJRyNtNKOfwF C89A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:subject:cc:to:from:date :message-id:dkim-signature; bh=lqyq5k+XF5KgaIo5e3mhOS1nBHM477MF0d9qU6OOaQk=; b=p6G+zGZe5IpOx2b+wuRevQfxMVNK0w5OJhmHarUO9BfJh/i6R+VD6tQkF1QHRYfhcu xgcn3ZGqrv8EKiJw5HGt4evm117f9KDvI1Md6P2q0O/r8QIurjLg+WxZIoNzVlYLzzvF mhLCjhogu3Wsym7wDjt91d57BG6vfb5csJB9NoUtXbSSjA227c716zhCZfvqABSFNNQ9 SPu7jqxqlI2gmUHSsfppbo/sL/D9XTM2n0MqnX1j9oczUHfHepKQzomgYeawjYTK0HaU 96tgixwg0UiE+v4FEadAzNsJ194Lu8XvxzhuNKs7tq8bffO658KLZf2mF7kqQqxM9EVU bGxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HSg4VtPt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j3-20020a170902da8300b00162039486e4si10462053plx.319.2022.06.05.23.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:15:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HSg4VtPt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 68DF1CFE28; Sun, 5 Jun 2022 21:54:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245461AbiFCPXZ (ORCPT + 99 others); Fri, 3 Jun 2022 11:23:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiFCPXW (ORCPT ); Fri, 3 Jun 2022 11:23:22 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93C713701C; Fri, 3 Jun 2022 08:23:21 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id n10so16608972ejk.5; Fri, 03 Jun 2022 08:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:from:to:cc:subject:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=lqyq5k+XF5KgaIo5e3mhOS1nBHM477MF0d9qU6OOaQk=; b=HSg4VtPtX0FA6DhM4M/SK75iaIqx+VCXGg1pUX53SLtsvYkg9pR2/pFuxQOoAOefOq f2mBPGr0EJPdKqptHoGR2BDFmui6PKhSl5cNSTZumEQEIEtD+AwyoOGhkaKufrb/YkyA O7HW3sXJPjTYabzBxRqdVUgaUmMZeF/JWyndNXz9QHNiNKb8zhOFOgHXf+OwM5vtVX2m ga+1ePUiy0iH24OzhdlMhA4lJL3L1Hevddd64pxppQ8N2RNyc+ifeBmZqWdsamxcNaGl ziZC1ktFKTGilRtug72eUBvGnaFRVHgpbsfjFN9IdVMAMj/KSbx5BDYVXA7ZHxcE95GG cPgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:from:to:cc:subject:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=lqyq5k+XF5KgaIo5e3mhOS1nBHM477MF0d9qU6OOaQk=; b=kJPMG+RxFHyH4lbLSE5nIaCf9uU2eXOOkisdJhQaXYBcqo0CWEElAzjZb+Um+bGLn5 FX/9UH/xbUV62UNXcyBYF7kNqvr973fjcyvcpdOtaJ/T1q7WuRi2IBFzHUwrZqiUssJB Cd63oJyXIDOeP1R0UUfpAWoyNcFwS5PE/EEoDgHPn3tatE1wUanpj5CfCo61uH1tkQ+h JsXNXX0rPy7QPgd6EgQ6nMQiQbs6MWAXHYV/bCEH6CY48XgtE4ztJD15HqM+DIRBqQlu Hm8kuMtdLctpurunp6UVz5MLp01pi5Kso5lk1Bxd6h4hH1yh7g1ZnzKNUGNywPWPSY/Y HCEA== X-Gm-Message-State: AOAM532gnVkGoWc7L0RgRJSpqAQp+g29aQkNz+n8C5SNf7AjAep18l27 eWte9lrazsZM0TGo2Z/5Cvw= X-Received: by 2002:a17:907:7290:b0:6ff:1fa2:e9e3 with SMTP id dt16-20020a170907729000b006ff1fa2e9e3mr9042275ejc.345.1654269799791; Fri, 03 Jun 2022 08:23:19 -0700 (PDT) Received: from Ansuel-xps. (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.gmail.com with ESMTPSA id g9-20020aa7c849000000b0042a2d9af0f8sm3998719edt.79.2022.06.03.08.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 08:23:19 -0700 (PDT) Message-ID: <629a2767.1c69fb81.ee3de.6097@mx.google.com> X-Google-Original-Message-ID: Date: Fri, 3 Jun 2022 17:23:17 +0200 From: Ansuel Smith To: Manivannan Sadhasivam Cc: Andy Gross , Bjorn Andersson , Miquel Raynal , 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 References: <20220519190112.6344-1-ansuelsmth@gmail.com> <20220603151806.GB26696@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220603151806.GB26696@thinkpad> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 On Fri, Jun 03, 2022 at 08:48:06PM +0530, Manivannan Sadhasivam wrote: > On Thu, May 19, 2022 at 09:01:10PM +0200, Ansuel Smith wrote: > > 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. > > > > 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. > > > > Can you please point me to the downstream/vendor driver that has this > implementation? > > Thanks, > Mani > Sure, is it good if I give you a gist link with the source of driver? > > This series comes to fix this. > > > > A user can declare offset and size of these special partition using the > > qcom,boot-pages binding. > > > > 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. > > > > A user can use this form to declare sparse boot pages > > qcom,boot-pages = <0x0 0x0c80000 0x0c80000 0x0500000>; > > > > 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. > > > > 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. > > > > 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 > > > > 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 > > > > .../devicetree/bindings/mtd/qcom,nandc.yaml | 26 +++ > > drivers/mtd/nand/raw/qcom_nandc.c | 148 +++++++++++++++++- > > 2 files changed, 169 insertions(+), 5 deletions(-) > > > > -- > > 2.34.1 > > > > -- > மணிவண்ணன் சதாசிவம் -- Ansuel