Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp194752iob; Mon, 2 May 2022 16:53:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYATDC4vKspmlqGHqSeVIOpekTNxQBUhJE/TM6CxMd6e0DfDxk4pZQuU+q3jZMKaOfDDLw X-Received: by 2002:a17:903:41c9:b0:15e:ae15:294f with SMTP id u9-20020a17090341c900b0015eae15294fmr4178231ple.44.1651535603021; Mon, 02 May 2022 16:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651535603; cv=none; d=google.com; s=arc-20160816; b=kjYhi6XfmxLAt9C8cmwBSV1RytQzttqH1AdsQnv1cgQfvxulaMNTux7orRvIAyhqzU hLq+0AEGOM7Lh8/cpF+Ntr2bSocYPecRnCEastDsRqKT+OaIVacrUXZkAw0G3k0ev+o/ VC7Ab5Oe2O2oAGk8iB8g6hfl9J+Qeac8kfejrqf4ZvNNJ22yaTyRMRTvfAyqQlLcEFfe vn/AY6uG5KCjIi1C9rcm8v0Gy1gBbQKVyLSK24QMzN9J1ohjpUEFVVEXjcJgVW0zWF0J Qc+RDoWp6v/C+P/F+3xaNanAVz2q7vdybRIStpgHeoavhXebN86WOZxkKIvL9RJ/mS9D bIqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=SFf90Cp87yxtikwr5SrnqckhY2eRdXiPSkqLmdjSB0Y=; b=i1WTVF72jbQ6N4mFgk8E1c44B4taTcJDkAPZLmZS8jSrZraTodreEFCas9Mcs4vqOa vOF6hVNXxp3TV/iFxXrZ4ns+BEq6gaDTJCBTBgp6geK5lBVqVVLMNiBnSZf0vPECoFeE xTKMBqrNqlZD3X4EWo6tNf0iyqwJRvXRFvnILC2DfFAUtwge8n5mLTa5K/hZnMcZqH+f W/AGjkJ1C2U8xRa1+8ELJitzvdbNb8RZcS6Smu239NKBT1eMJkASxOTpR96EcsWoXUHr sXhlbJtzT1I4aHRecMJuXfZme1QWGTOTZ87u+2VKnPJZ+xxABaVWbY+ZmSpPQSDEdFux W8QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mdV8gUBf; 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 j15-20020a170902da8f00b0015e89bf8982si3282831plx.261.2022.05.02.16.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:53:23 -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=mdV8gUBf; 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 BCBE965AD; Mon, 2 May 2022 16:53:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383359AbiEBFp4 (ORCPT + 99 others); Mon, 2 May 2022 01:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349296AbiEBFpz (ORCPT ); Mon, 2 May 2022 01:45:55 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 953AB35847; Sun, 1 May 2022 22:42:27 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id e2so18211216wrh.7; Sun, 01 May 2022 22:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=SFf90Cp87yxtikwr5SrnqckhY2eRdXiPSkqLmdjSB0Y=; b=mdV8gUBfaGKV1xac9Fiq0BXYwgb3hP57li604oiegba4cvbj1pMaXz/DN3sYIqhhQJ 1jU8oDoMqE5mXAFxOieJKCSi39cshQTbMNHkSSwmWq65LOgTNnEpRESqalbv+tSPWJIR uy7UI+FzEjUZlyXN8+xikq6VznA4QpzvpT1tEYOj/SPlE3jjx/A6cspg9FQnqpHqn6KQ yIp1dvoSjMDYUZdy+hOqsKd7YrFT5ZfrrRcpv+eWPO7xcAzoXcZqhbJQAuWFix4VkW3v hR7L3/p0AqS6TXhTf5hBlYXiKYEMIow7cX939169/z2xX0giDSazAI1pPNmStA6KJpDs 0LWA== 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:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=SFf90Cp87yxtikwr5SrnqckhY2eRdXiPSkqLmdjSB0Y=; b=qnF5tAFmWx4JVGq0j/4N+Ii9Q6pUOUHjzCjkaOaZK3jyrcDL7N3tFZV5uUWJ7/qk0J PlfpCiMmKl7enmh67dyJS5+0THszmVY2KHpfdQU0g/TntfG4ToYEbGs5WHAbn1z6oIBw 8UWN0hB8x466mtzQlw4JKz2/0GTxtj1llZP+npLKDG/zJGl3SUOYCP58oJYSLEso6SDq 1YpSBS//cbF8jgMZfKr83qi+QxYIWhISbTM2IdaNgs0y0XJwGjPYZu+BCXfXJ5fsaYF0 dso+/DgjCPAUJc/IDrE+oPPKgu1LaVmzUgAerPI89LXSvQ91R61Q9s/hiPys6Cyir7sH j3Lw== X-Gm-Message-State: AOAM530RaxQJJS+DbxsLMSN7P0Fn96HxYfSBvYx9IHg/IqVD63JjQEPG V5BqduDg6Owhm8ALEEirnww= X-Received: by 2002:a05:6000:1681:b0:20c:5aa2:ae14 with SMTP id y1-20020a056000168100b0020c5aa2ae14mr4740062wrd.443.1651470146011; Sun, 01 May 2022 22:42:26 -0700 (PDT) Received: from ?IPV6:2a06:a003:501a:a7ce:5405:3d01:56ff:a60d? ([2a06:a003:501a:a7ce:5405:3d01:56ff:a60d]) by smtp.gmail.com with ESMTPSA id 6-20020a05600c230600b003942a244ecfsm5397359wmo.20.2022.05.01.22.42.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 May 2022 22:42:25 -0700 (PDT) Message-ID: Date: Mon, 2 May 2022 08:42:24 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: [PATCH v2 1/2] dt-bindings: mtd: partitions: Add binding for Sercomm parser Content-Language: en-US To: Krzysztof Kozlowski , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski Cc: NOGUCHI Hiroshi , Karim , M , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20220406195557.1956-1-csharper2005@gmail.com> <20220406195946.2019-1-csharper2005@gmail.com> <8d0d8b27-35ff-3693-cf80-897b80c26b4e@linaro.org> <57bebf2f-af4c-b2d9-10e5-19e5104946fb@gmail.com> <29cfa017-bbaf-3aba-fe1d-06771957dbaa@linaro.org> <1b391399-984b-7a63-3265-62ef09caec39@gmail.com> <25da3f43-c46e-8108-2da9-0e4f2b7cc1a4@gmail.com> <1c19faf9-fc1c-9adf-d038-97b673a8f0be@gmail.com> <0450d781-c506-c28e-a0e5-435bee16721f@gmail.com> <2e51842a-d2c9-8953-13aa-02ad3abb3f14@linaro.org> <6c3ba4a7-80b0-5fd1-eb08-1f9e256b02c4@linaro.org> <909094fd-ded0-38f9-b374-dd5f7b63e298@gmail.com> <11fbbafd-e7ce-f921-2073-146e96f01f6b@linaro.org> From: Mikhail Zhilkin In-Reply-To: <11fbbafd-e7ce-f921-2073-146e96f01f6b@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 5/1/2022 7:17 PM, Krzysztof Kozlowski wrote: > On 01/05/2022 16:51, Mikhail Zhilkin wrote: >> On 5/1/2022 11:17 AM, Krzysztof Kozlowski wrote: >> >>> On 30/04/2022 20:54, Mikhail Zhilkin wrote: >>>>  patternProperties: >>>>    "@[0-9a-f]+$": >>>> -    $ref: "partition.yaml#" >>>> +    allOf: >>>> +      - $ref: "partition.yaml#" >>>> +      - if: >>>> +          properties: >>>> +            compatible: >>>> +              contains: >>>> +                const: sercomm,sc-partitions >>>> +        then: >>>> +          properties: >>>> +            sercomm,scpart-id: >>>> +              description: Partition id in Sercomm partition map. Parser >>>> +                uses this id to get partition offset and size values from >>>> +                dynamic partition map. >>> Partition offset and size values are not derived from scpart-id. I am >>> sorry but after all these questions - it's the third time now - you >>> never answer why do you need this property and what is it used for. From >>> all the examples it could be simply removed and the partition map will >>> be exactly the same. >> scpart-id is necessary to get (using mtd parser) partition offset and >> size from dynamic partition map (NOT from the reg property): >> >> ❯ xxd -e -c 12 -s $((0x800)) -l $((0x78)) mtd1 >> 00000800: 00000000 00000000 00100000  ............ >> 0000080c: 00000001 00100000 00100000  ............ >> 00000818: 00000002 00200000 00100000  ...... ..... >> 00000824: 00000003 00300000 00100000  ......0..... >> 00000830: 00000004 00400000 00600000  ......@...`. >> 0000083c: 00000005 00a00000 00600000  ..........`. >> 00000848: 00000006 01000000 02000000  ............ >> 00000854: 00000007 03000000 02000000  ............ >> 00000860: 00000008 05000000 01400000  ..........@. >> 0000086c: 00000009 06400000 01b80000  ......@..... >>           scpart-id  offset      size >> >> With sercomm,sc-partitions the reg property will be ignored (offset = >> 0x200000, size = 0x100000) and the values will be taken from partition map. >> >> For example we have this is dts: >> >> partition@200000 { >>             label = "Factory"; >>             reg = <0x200000 0x100000>; >>             sercomm,scpart-id = <2>; >>             read-only; >>         }; >> >> Dynamic partition map: >> >> scpart-id = 2; offset = 0x00200000; size = 0x00100000 >> >> 00000002 00200000 00100000  ...... ..... >> >> In this example the offset and size are the same in reg and dynamic >> partition map. If device have bad blocks on NAND the values will be a >> little different. And we have to take partition offsets from partition >> map to avoid boot loops, wrong eeprom location and other bad things. >> >> Is there anything that needs to be explained in more detail? > Thanks a lot, this clarifies the topic. Looks good. Maybe you could put > parts of this into the scpart-id field description? Thank you for you support! I updated the scpart-id description and hope this should be clear enough. If so, I'll prepare PATCH v3.  patternProperties:    "@[0-9a-f]+$": -    $ref: "partition.yaml#" +    allOf: +      - $ref: "partition.yaml#" +      - if: +          properties: +            compatible: +              contains: +                const: sercomm,sc-partitions +        then: +          properties: +            sercomm,scpart-id: +              description: Partition id in Sercomm partition map. Mtd +                parser uses this id to find a record in the partiton map +                containing offset and size of the current partition. The +                values from partition map overrides partition offset and +                size defined in reg property of the dts. Frequently these +                values are the same, but may differ if device has bad +                eraseblocks on a flash. +              $ref: /schemas/types.yaml#/definitions/uint32 > Best regards, > Krzysztof -- Best regards, Mikhail