Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1929844lqp; Tue, 16 Apr 2024 02:02:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjUPjqhPuzo7yWssIoa3qDp8/0ghaz4zpv/2jqu/OPPKTyHcsKtwu8a82Lv17wHI4nQdPFjKdE6n0GUlQ/7m/2EiHZx+pO82hB7xMMXw== X-Google-Smtp-Source: AGHT+IEX7U8R0ItLmNBiu0jGKXpN6iUbCgZRAAHy1EkkvFma8aVo19Gk71K1l0g6xRdo471IldFg X-Received: by 2002:aca:2406:0:b0:3c6:d6b:b3ce with SMTP id n6-20020aca2406000000b003c60d6bb3cemr13407319oic.38.1713258143421; Tue, 16 Apr 2024 02:02:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713258143; cv=pass; d=google.com; s=arc-20160816; b=gpWd5327E7On1rMoAaaSnqurT3GvU7yV4Zn5ZgWZzNrbGrbDjcDVd+jLdobo3p3QH+ br8VjmZd26PxcqjfYn/FkfDdVMtH0I8DdKRutBF7cTgb2sQ/RJyzlC1C7SlvNoUfenD1 InM4QgA3YImsSMkw/ilIV8W6L0pNllGS8az/+SlVgbhKaG8THBz+pTdQ0a2siDLlAQbe qI+YgglID3hv2/Sspp3UoT/I7ufaDdl7rIWBnF0H4x//gYrlavkABBmpjT1shOLsHy4l SZCRt7JIblYLHOFQJmB6qFnieMXW9pYUIWIK/hemLIq9usMyno/MXosxtaZEHgQwnbzr NDfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=tCk6YfiA2NBicys5PRme4xna6OEXLbDGKKZqI74wPjs=; fh=nhecQrwVApGCu1TdcailefrHyWo/zWU/hH6HfNaDWJI=; b=oaKrOb2CCk3JHuzUyr5KDmSrtY0KybXMZOrfZlHNuQteNanEsGJPD7gqufBbvQ5mDs F4hc17ds6oK+j0plqtRf378A+Noj+5qGSOV4eEpg22wl+LDZpDhGu4GbTpSFNdQPSJy0 hi4RDGAFYzPgR876EUUi6Li2UUJErP4kq6W1LPpKRDwO67hiiSthpcfhRd9Li+sPWJ9I bGmyqfHGuVnXU2lJaSRCPUvxRJN7WzsW5tGeb7naVGAdIqqwfXYjOSUj3N8eXfCPmcKq 7Nezi7lo+2lOw+i9ViIng3f6Mym95IZoEup52cOOLbiC3S24tF5oiExI1wEdUdLCBRed Xx2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=J+HeJeDY; 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-146529-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146529-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id t26-20020a05620a0b1a00b0078ec905414asi10044566qkg.19.2024.04.16.02.02.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 02:02:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146529-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=J+HeJeDY; 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-146529-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146529-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1E1AB1C20A83 for ; Tue, 16 Apr 2024 09:02:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8F9F84FD8; Tue, 16 Apr 2024 09:02:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="J+HeJeDY" 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 DFC7E205E10; Tue, 16 Apr 2024 09:02:09 +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=1713258133; cv=none; b=D1baSabD8GAf+T5jOUf1Tc3yHgTslxSiOOzyZV7zrRznhiL5fCEYM9WhApogdQoxPzAHbLv6HLGNGGm8WAcJonLvObg+iZMQNH3SC3CNQ++VrlalgoAx01/JkmAvNWT0glGD4znn2UTYG+rPoo14yoZht44RODPNme4iI7XdO1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713258133; c=relaxed/simple; bh=CeDlWPaQUklTPhkRQRU7v3aoErZV/RvO0hmIAHh1jao=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=L0MKXDfmjA5TJVo7XW25AvBxa6Ip5mntxKPk+1+XhrlfDpr5H/tGx+uSLOKjoG6kne1Wbpt5xxIA7LCPtPtLLN2bH9gQcU4Evns1tUtvoHaxoL0VUlQ2sg6b1oB4rMSS48KMFgLm32zEFo+rKPNqTOi1gMtDoLAxpByU/ZLrnZM= 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=J+HeJeDY; 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 B7BB9120004; Tue, 16 Apr 2024 12:02:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru B7BB9120004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1713258120; bh=tCk6YfiA2NBicys5PRme4xna6OEXLbDGKKZqI74wPjs=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=J+HeJeDYLymkzpXwSpXY34R6o29NxLpoQAGZ/cx9Xwe7K0NWG1sdWO1bdfNvgRMkS bB+U5NkThhh0VU0wqD56ye8OfXqQv4wBzVAY0DKgWmnqdfl+VxNAvJFb71GGdGLQEN F0oDHq/+lzLVONdKt2kywisoQdXyEJsAFKQ137EzsCtZKiFBafGQapBCOwzq0wBELr STkzvFTIEMJ53g/AzGEHvJ9AqI7RIPzm8IhAlFmlU/sp+SIEZZddkc9qLlubfqUOgN OKr+GT/gHDg7C9f9qRqk8Gf12D+chhQ7xbKtqTc0l43gyGKwGimHQic6y9yYvjESp/ 3sWh2MEbbBHbg== 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, 16 Apr 2024 12:02:00 +0300 (MSK) Received: from localhost.localdomain (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, 16 Apr 2024 12:01:59 +0300 From: Arseniy Krasnov To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl CC: , , , , , , , Arseniy Krasnov Subject: [PATCH v5 0/2] Meson: R/W support for pages used by boot ROM Date: Tue, 16 Apr 2024 11:50:59 +0300 Message-ID: <20240416085101.740458-1-avkrasnov@salutedevices.com> X-Mailer: git-send-email 2.35.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) 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: 184729 [Apr 16 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: 17 0.3.17 f2153f38d75b12894d9cf445f96cd15c9ef63a9d, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;smtp.sberdevices.ru:5.0.1,7.1.1;100.64.160.123:7.1.2;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/04/16 06:39:00 #24817376 X-KSMG-AntiVirus-Status: Clean, skipped Amlogic's boot ROM code needs that some pages on NAND must be written in special "short" ECC mode with scrambling enabled. Such pages: 1) Contain some metadata about hardware. 2) Located with some interval starting from 0 offset, until some specified offset. Interval and second offset are set in the device tree. This patchset adds R/W support for such pages. To enable it we can setup it in dts: nand-is-boot-medium; amlogic,boot-pages = <1024>; amlogic,boot-page-step = <128>; It means that each 128th page in range 0 to 1024 pages will be accessed in special mode ("short" ECC + scrambling). In practice this feature is needed when we want to update first block of NAND - driver will enable required mode by itself using value from device tree. Changelog: v1 -> v2: * Rename 'meson,boot-page-XXX' -> 'amlogic,boot-page-XXX'. * Add words that 'amlogic,boot-page-step' is measured in pages. * Remove words that 'amlogic,boot-page-XXX' depends on 'nand-is-boot-medium'. * Make both 'amlogic,boot-page-XXX' depend on each other also, in addition to 'nand-is-boot-medium' dependency. v2 -> v3: * Add quotes to 0001 in dependencies. This fixes 'make dt_binding_check' warning. v3 -> v4: * Rename 'amlogic,boot-page-last' to 'amlogic,boot-pages'. v4 -> v5: * Update 'description' fields in bindings. Arseniy Krasnov (2): dt-bindings: mtd: amlogic,meson-nand: support fields for boot ROM code mtd: rawnand: meson: support R/W mode for boot ROM .../bindings/mtd/amlogic,meson-nand.yaml | 14 +++ drivers/mtd/nand/raw/meson_nand.c | 88 +++++++++++++------ 2 files changed, 73 insertions(+), 29 deletions(-) -- 2.35.0