Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp370239lqh; Tue, 7 May 2024 01:22:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZiPaSabjwTJLRNtTeXIW7Ip1232yjkTuj58FLmX1v+ioHY2bMSyHtEiEa3ylw6Bg7f5uV4cwIGc9M2GuqJRgYXKZ9zPEL2Hn/Z626/A== X-Google-Smtp-Source: AGHT+IFX2rLsJJWcgFMcezyJzVQzrUAc8frHowTfQyc/XYnAk/uVrj51nrQZOdZl+jZx/8heoM5h X-Received: by 2002:a05:6808:114d:b0:3c9:67a5:3aef with SMTP id u13-20020a056808114d00b003c967a53aefmr8541929oiu.49.1715070178942; Tue, 07 May 2024 01:22:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715070178; cv=pass; d=google.com; s=arc-20160816; b=wtV+ukRQIk37GyTQpu/LawkBA96rn475LT7CpejWknbrPq4SEXeqnW9lzy0lY/ZqV9 Ny3nNUWY4bOMuMs3w4s4ZK9XPvzq8FmozHgT8Cm/q4JayEoJwWvaLPi3hmm3nXHR4wyi pDltRgi/9IDDNJieXS5Vd+DdWBo+F/jgeHFYH7iqEebXd7bTFGE+mgXhBH8FJcD6YtRc u37TX73Z7cF62uZWhRG+qhM0MvhXQkrMpSt9CaOBTo+XkGm+8QD08IcWritWo6BY4N8+ VESfSUb9oCPqFCU1sYrWQBabt20WgPhXYmiycGvHi/aast+ubQEh+6jF6kJ2VM9OtlKa FUmg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-filter; bh=jIjPFNyzW7kNBJrUm409Uj7Pess/SCSFbd0CJs0Wv7c=; fh=d21rU0t5ldv8qmdUTthuKC1WHykG2KPeb/08d9+CuU8=; b=ddh02dF0ZR+gNMRFX2uI1JHLdy531ap+f8dkjmqXQlGRccArPcPcF5e4do+/CwlnrC Dv5ZkmBPbein0RNgbE66J4OleJIlBwFCqG6M4QfvIRRZIBzwzV8sI+73owLrGq0cY0QR rZCNfrlnAkU3av17ztBdvvlZ/+KraLIutnUH6z/X2lD6JaBn19tFbBVR6r8FcvFfwsEX obaZvuvCKEFH5oyGHyT320lLNTnqoHl7xJmll3fbLfSEXMrj/9pRwzvfmwfFO7VvhX/C J3AQ8Z53eks4aKPNImXcRpUkBpropz1VMkjg9pO3MxxI5deamXwTvvgkaW4NG/xTizhs TN2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=m218MWw9; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-170862-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170862-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q200-20020a632ad1000000b005dc788f3767si10082677pgq.620.2024.05.07.01.22.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 01:22:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170862-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=m218MWw9; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-170862-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170862-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8E542B217E7 for ; Tue, 7 May 2024 08:22:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2BD013C910; Tue, 7 May 2024 08:22:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="m218MWw9" Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 297494087C; Tue, 7 May 2024 08:22:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.89.224.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715070151; cv=none; b=KL6skfpUXltbLSMEoIVxmf/y4PB2SqfgFbd+BVEdlBasLJr+fhIpwV8718vkexqSE9WP6Ri69mN1yFPAMPVBJ8q/iawZG4UdceW3qxHNis1XEVileaPbWw1U1r1gxCPweF3yPG5fI/P000OehHquGqUrNuDdDhGo7uPvzuGnVxs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715070151; c=relaxed/simple; bh=kh7kLfzE5Rw+UIhuqbt/RM6ItgxttAdtXPM4W7tiw6A=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=FgetcnOj4NFV9yy36ERNQH0kEMyTm1np3vdmUA/Y2NiidgULeJ9euZR1sxZwPcH9fTqN3T00IHm+GGjIixdLLt5xq90RN8EZsbIYoKmatqY27bfxz/UxZm3xUID5GoBw3zKF/BSEYZQ1Rmzs5reJvb70RSY8e4XgM4S+Cqv4H3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com; spf=pass smtp.mailfrom=salutedevices.com; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b=m218MWw9; arc=none smtp.client-ip=45.89.224.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=salutedevices.com Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 394EC120005; Tue, 7 May 2024 11:22:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 394EC120005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1715070144; bh=jIjPFNyzW7kNBJrUm409Uj7Pess/SCSFbd0CJs0Wv7c=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=m218MWw9r9laGjM9qXxEiNvkRidn7UgJrOg5Xu/R53VqsSkkAjlqB72B+mqRzdA0Q NVrFk69LCvTkzDgE0LbBuSssB/Gb5/feiw4l4bKTGBZDHMEVqIcU8mHLzobM7NaQCp BEfb8CYnn3y2QpLaM/SYHsu+oKgiDGO+9C6KfLhSXQg52k/e8IuBtYMk/n287owrOa lHnn7uieKP8moEtvi//MPbVgtQl3HvE0rwDlswWileQq53n1NwMxfFc+C2U6unno1n m1/rHO14QNofAwIWClT75WaRU1e7U9gZMxPwt67dlnhQkGIGGlzgxccLCgxKtfSWwr ZzF5If/jer8lA== Received: from smtp.sberdevices.ru (p-i-exch-sc-m02.sberdevices.ru [172.16.192.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 7 May 2024 11:22:24 +0300 (MSK) Received: from [172.28.226.125] (100.64.160.123) by p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 7 May 2024 11:22:23 +0300 Message-ID: <771a35e4-db15-8c4d-29e9-7a984cb34abc@salutedevices.com> Date: Tue, 7 May 2024 11:11:40 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v5 1/2] dt-bindings: mtd: amlogic,meson-nand: support fields for boot ROM code Content-Language: en-US To: Miquel Raynal CC: Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , , , , , , , References: <20240416085101.740458-1-avkrasnov@salutedevices.com> <20240416085101.740458-2-avkrasnov@salutedevices.com> <20240506154858.003bab54@xps-13> <20240507092726.4ab1afdb@xps-13> <20240507100553.31578d0d@xps-13> From: Arseniy Krasnov In-Reply-To: <20240507100553.31578d0d@xps-13> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 185103 [May 07 2024] X-KSMG-AntiSpam-Version: 6.1.0.4 X-KSMG-AntiSpam-Envelope-From: avkrasnov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 19 0.3.19 07c7fa124d1a1dc9662cdc5aace418c06ae99d2b, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;smtp.sberdevices.ru:5.0.1,7.1.1;127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/05/07 06:33:00 #25113436 X-KSMG-AntiVirus-Status: Clean, skipped On 07.05.2024 11:05, Miquel Raynal wrote: > Hi Arseniy, > > avkrasnov@salutedevices.com wrote on Tue, 7 May 2024 10:35:51 +0300: > >> On 07.05.2024 10:27, Miquel Raynal wrote: >>> Hi Arseniy, >>> >>> avkrasnov@salutedevices.com wrote on Tue, 7 May 2024 09:53:06 +0300: >>> >>>> On 06.05.2024 16:48, Miquel Raynal wrote: >>>>> Hi Arseniy, >>>>> >>>>> avkrasnov@salutedevices.com wrote on Tue, 16 Apr 2024 11:51:00 +0300: >>>>> >>>>>> Boot ROM code on Meson requires that some pages on NAND must be written >>>>>> in special mode: "short" ECC mode where each block is 384 bytes and >>>>>> scrambling mode is on. >>>>> >>>>> Ok >>>>> >>>>>> Such pages located with the specified interval within specified offset. >>>>> >>>>> I'm sorry I don't get that sentence. >>>> >>>> Sorry, I mean this (let me draw :) ) : >>>> >>>> [ page 0 ][ page 1 ][ page 2 ][ page 3 ][ page 4 ][ page 5 ][ page 6 ][ page 7 ][ page 8 ][ page 9 ] >>>> >>>> For example, we have 10 pages starting from the beginning of the chip - this is "within specified offset", >>>> e.g. offset is 10. BootROM on axg needs that (for example) every third page must be written in "special" >>>> mode: scrambling is on and ECC is 384 bytes. Such pages are 0, 2, 4, 6, 8. E.g. "specified interval" will >>>> be 3. >>> >>> Shall be 2, no? >> >> yes, starting from 0 - then 2. e.g. >> if (!(page_num % 2)) >> boot ROM need this page >> >>> >>>> >>>> So: >>>> >>>> amlogic,boot-pages: 10 >>>> amlogic,boot-page-step: 3 >>> >>> Ok I get it. Thanks for the explanation. I don't really understand the >>> logic behind it though. Do you know why the bootROM would access only >>> one page over 2 or 3? Is there a default value? Is this configurable? >> >> No, boot rom source is closed, I don't have access to it. I get this logic >> from old version of vendor's uboot - in practice they use non 2 or 3, they >> use hardcoded 128 step value. And amlogic,boot-pages is 1024 > > Feels like they are trying to use only the first page of each block, no? > > That's very weird but I understand better. A little bit no, they use every 128 page in range [0, 1024] pages. E.g. there will be 8 such pages: 0 128 256 512 640 768 896 1024 They write some metadata about SoC to such pages. Thanks, Arseniy > > Thanks, > Miquèl