From patchwork Fri Feb 28 08:45:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 869280 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1561:b0:38f:210b:807b with SMTP id 1csp678726wrz; Fri, 28 Feb 2025 00:46:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWzKxEZxKeMraApbGEpGulcanbOTlsXmSPCzjbhDFp3dw5pMWjDhKMVTuIma4hnCOIADam37Q==@linaro.org X-Google-Smtp-Source: AGHT+IH6s7s+QZlsmZg3A9r+rpkeD/tiS85q1Isp3rF06qvyp0FdJ+joGd+Ad0pJl6LKZsMIjz5F X-Received: by 2002:a05:6000:2cd:b0:38d:dd52:1b5d with SMTP id ffacd0b85a97d-390ec7c6b95mr1430755f8f.4.1740732397985; Fri, 28 Feb 2025 00:46:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740732397; cv=none; d=google.com; s=arc-20240605; b=V8m5BoG1bhmg2QQyD0HDwe6UzI8q64jFmdr+uHIgAFeLkN84DpqZ8Rwt5WyaiaCcEa H6IQIscEINYLgMkwZSH4oiiuMTyQ31jMTPE6TgKwNSHkgV3Q31xccWzX5crUB6d4JiGk HaUZDtN+5J/vflIMiawn4aRAkp9VLIGEJ/9f8d/zDQPwI1RPNLUqcDlb5jjwKvsjYMkF Fd2YD4eaQR7+d9gjZ2k+OjzIoUuV64+WDSkVCi6w7rldFQZZ0UOyKsYCsP445h5QbcpM JBXX1EWDCHIDU6/xfv4Q3WsYuNoCFSQJF7QVnXFiCqkeKCDzdGs1GgynKiSmpVLiRC8z zLUA== 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=61AWLPUn+9pt2Qsp8pFqO/gG8aOe2Jg8TeqXinMFwVw=; fh=WIErNPtEyr4LSk0kn+FyUcnvc47vQRNxykSeJQzwMAA=; b=F5tR9wAj46MjVnS0zHhr/7UWp925iyiQKyV9pWQUELsOncKFqmCLZLBt2F6FKw9SDL gf6r6y6ZmGo0FwJ0v6KW0mdJewtL03PF8oKnIwpP8TlkQm3QP3tjvAIjXKdYERmV2PE5 f5yB7Gjavicim/VEJAPzr/Va/f/dKCLHR8ip4VQ9iR3jLRJ8oNwOhiXhxTyuN63fjR/p BuPfZPjgPv9s8mW9L7DxFy0V3hdJvsI3r6j3eT5WfqnryQfQKjoYVcqxjaE8QskvOe9K L40mUI8Xc1vKGr6O8DyZycXv7ILZGkJLHPQVwZHDmSfgxUDuDCatsOrv+XxpYZbqEsfc MCzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id ffacd0b85a97d-390e47f8b0asi2395664f8f.321.2025.02.28.00.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Feb 2025 00:46:37 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 B7A2B810FE; Fri, 28 Feb 2025 09:46:11 +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 9A8D9811C5; Fri, 28 Feb 2025 09:46:10 +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_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_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 A52C180FE1 for ; Fri, 28 Feb 2025 09:46:08 +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 48F081688; Fri, 28 Feb 2025 00:46:23 -0800 (PST) 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 1E23D3F673; Fri, 28 Feb 2025 00:46:04 -0800 (PST) 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 v6 4/6] blkmap: store type of blkmap slice in corresponding structure Date: Fri, 28 Feb 2025 14:15:27 +0530 Message-Id: <20250228084529.127823-5-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250228084529.127823-1-sughosh.ganu@linaro.org> References: <20250228084529.127823-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 V5: 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,