From patchwork Mon Mar 10 11:57:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 872200 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp942271wri; Mon, 10 Mar 2025 04:59:02 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUi76X9VaMQXuodF+GdL5yMa1TiV5/P50J7GxHjUVHXSVsifiHgakwiVZ/JD2eGBrhlMdYEEA==@linaro.org X-Google-Smtp-Source: AGHT+IEP5896VWTN73GB4/EfZaV+6XfvmI/R268TBa5wkReERg8fzL8z6eWxhEHI2gxuRA7Iv/42 X-Received: by 2002:a05:6902:1107:b0:e57:442a:befd with SMTP id 3f1490d57ef6-e635c1c4226mr14827700276.32.1741607942423; Mon, 10 Mar 2025 04:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741607942; cv=none; d=google.com; s=arc-20240605; b=NftPJyGgoyqSVSo5aeWLPorqvuphne6nh+li7XKyz/sDDAOuXh18uhKHls6pESwI// UKriV2DUahacKgu4Bug2Pvxd2WM7/C4ZNXbrGyUaFKkGy+i1pjLdETH9CBfZYwcgR+GC VBAkDBhZ/pbxTCPA3TDA92MP7tNFx1j0Bg0cl0+aNQMCIR7pGZVnoF6Nz0mGUMmh3mFA gwCqW524ClsZZ2H/MTLwkX9XTVaR0JH47fZwgrsKCoaQN8x/c3vtXuL60dU4hTQYSwNW L5ARadvGLC0z2dT2v47wp9tfCdh28N4d5/BzsLRIpgW/tlccEKvlHYnYphqQ4a31ckVN zCtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=aMOXHutqC5FiVDDLEx4P1jy7obI67eqZtFOrZBwmuBs=; fh=WIErNPtEyr4LSk0kn+FyUcnvc47vQRNxykSeJQzwMAA=; b=d+qWndFZSn2dZ3ZTyrPJrzHVyM0UEmgARkeWZ6AB/wVvRc2H+z+1qwLXeJcXMYk+iY ZBMAimC4ZCfj/Un5762OFnyyVJnAL3T/rKisRjktD8Sb2elXz84r9Zec5Pye5YQLdPm/ RuGM40NsAXJIFfbl5BV9kRzlujTGEI0ehiFasEwiLqXYnt4YigYIjzUJkXUWriLmpXz8 q45j/TZV1pIStk6Vr1tNZ16YbnAxPx9pZnJj6t4qEnqVNNE2jWJkGAAXDeZ0kUIOmwjD magh0o29IDR4RuFrxw4qWd0a2L0BzPJcrdk0e/MLy9jqWN/KWN4PeXoKOYlk+pWwC/5z 1pOw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 3f1490d57ef6-e634b909ff8si9362133276.576.2025.03.10.04.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Mar 2025 04:59:02 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 55A2E81870; Mon, 10 Mar 2025 12:58:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id AC3B78169D; Mon, 10 Mar 2025 12:58:29 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id A2AB0811DF for ; Mon, 10 Mar 2025 12:58:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9A5251516; Mon, 10 Mar 2025 04:58:38 -0700 (PDT) Received: from a079122.blr.arm.com (a079122.arm.com [10.162.17.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4874E3F5A1; Mon, 10 Mar 2025 04:58:24 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Simon Glass , Tom Rini , Heinrich Schuchardt , Anton Antonov , Tobias Waldekranz , Bin Meng , Sughosh Ganu Subject: [PATCH v7 6/8] blkmap: store type of blkmap slice in corresponding structure Date: Mon, 10 Mar 2025 17:27:48 +0530 Message-Id: <20250310115750.1019051-7-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250310115750.1019051-1-sughosh.ganu@linaro.org> References: <20250310115750.1019051-1-sughosh.ganu@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add information about the type of blkmap slice as an attribute in the corresponding slice structure. Put information in the blkmap slice structure to identify if it is associated with a memory or linear mapped device. Which can then be used to take specific action based on the type of the blkmap slice. Signed-off-by: Sughosh Ganu Reviewed-by: Tobias Waldekranz Reviewed-by: Ilias Apalodimas --- Changes since V6: None drivers/block/blkmap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/block/blkmap.c b/drivers/block/blkmap.c index 34eed1380dc..453510cca62 100644 --- a/drivers/block/blkmap.c +++ b/drivers/block/blkmap.c @@ -16,6 +16,10 @@ struct blkmap; +/* Attributes of blkmap slice */ +#define BLKMAP_SLICE_LINEAR BIT(0) +#define BLKMAP_SLICE_MEM BIT(1) + /** * struct blkmap_slice - Region mapped to a blkmap * @@ -25,12 +29,14 @@ struct blkmap; * @node: List node used to associate this slice with a blkmap * @blknr: Start block number of the mapping * @blkcnt: Number of blocks covered by this mapping + * @attr: Attributes of blkmap slice */ struct blkmap_slice { struct list_head node; lbaint_t blknr; lbaint_t blkcnt; + uint attr; /** * @read: - Read from slice @@ -169,6 +175,7 @@ int blkmap_map_linear(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, .slice = { .blknr = blknr, .blkcnt = blkcnt, + .attr = BLKMAP_SLICE_LINEAR, .read = blkmap_linear_read, .write = blkmap_linear_write, @@ -248,6 +255,7 @@ int __blkmap_map_mem(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, .slice = { .blknr = blknr, .blkcnt = blkcnt, + .attr = BLKMAP_SLICE_MEM, .read = blkmap_mem_read, .write = blkmap_mem_write,