From patchwork Wed Mar 12 08:54:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 872823 Delivered-To: patch@linaro.org Received: by 2002:a5d:64e7:0:b0:38f:210b:807b with SMTP id g7csp159644wri; Wed, 12 Mar 2025 01:55:50 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXFeLOeeqnt+t//OeBrbqAXGtpLzrGVf0pVAR50aBW1sQ5A09TjIeASlvBJiaKYDMvtEyTbtA==@linaro.org X-Google-Smtp-Source: AGHT+IH+9TuWgAhTJYOA9nzwAfkjT5jcAcc34VVgJs5JgNHf8XL7y6RaQPVZmbhex/pejGfloIHJ X-Received: by 2002:a05:6902:2308:b0:e5b:1119:60d0 with SMTP id 3f1490d57ef6-e63b521144cmr8102979276.34.1741769750492; Wed, 12 Mar 2025 01:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741769750; cv=none; d=google.com; s=arc-20240605; b=czE7PzOe/pHVQ6GPIJwncxNzIyZnrYm/iMTUJ55gOzP8WZFVrc6hzeJQ0SKeqm/4y3 p3mNdy4aFAtYaIYkiyrdJrOUJy9VZxEu8mmxJ606Fp7ANx8ty2qygiYFvcJi003Q5GpM nxSZrQCBthwBVXfIhT4EfMQkjT+0L/13xlwEIhAI2wGhZ4uvThXQmIb/tgJYw6zmI/FK eUg0LhNl4zKLwQE0gRyUXLd7bineMtIebbZnxyxgANikveVzqK20nEP1+DIVSnq5LVob PvOzUAYM2DCo9REF6GAs4frWjz0ANNX5fKwdSr2N1TmsgQU3/2du1qyViZRWv/JvOqOh ljsA== 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=BNY4+Y9Qwa0ZfylKUS55yLml7GVG0fF0heh5oHpFR7k=; fh=Evn5eBx2ytD/hj+tB8Xv1T61prWYrP0E59LRKWAPORI=; b=OT14DLBflbgVq81OGDeiocvvG9ETUGginSPkddU1tSWyaDKEd7Aq6F7qZhD4Aosh/g l6ae8YeTlE0xlZYTks5yIMjWZ0rfKys/lhW+4mD9JPllUIFx5pdGNP1FVSK3Pd6ptSe3 FTBzyz9HtDJmo7ZEktCgBqZEi+dzhBsTTCq6uONaab4bHN4zQqH+gQrPOZxgBzJuqWvt lCgaSUBuQ4gOylznpFI3WFysjd25qeYzfl5qN4m3lNgnyxh52pjn+Ni+C4Zzo0WCLvfm nsZsQlQ6yo5u/IdJLvKU5YmQTV0u5p4a/GCk7T2FN+lJtJg6lm5YKqCQVrCKCiI9LrkW dRvg==; 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-e634b8d18c1si13261695276.369.2025.03.12.01.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Mar 2025 01:55:50 -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 F312C801FB; Wed, 12 Mar 2025 09:55: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 9375081895; Wed, 12 Mar 2025 09:55:09 +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 0C2058169D for ; Wed, 12 Mar 2025 09:55:06 +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 4EB18152B; Wed, 12 Mar 2025 01:55:16 -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 EC17B3F5A1; Wed, 12 Mar 2025 01:55:02 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Simon Glass , Tom Rini , Heinrich Schuchardt , Anton Antonov , Tobias Waldekranz , Sughosh Ganu Subject: [PATCH v8 6/8] blkmap: store type of blkmap slice in corresponding structure Date: Wed, 12 Mar 2025 14:24:22 +0530 Message-Id: <20250312085424.1201148-7-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250312085424.1201148-1-sughosh.ganu@linaro.org> References: <20250312085424.1201148-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 V7: 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,