From patchwork Thu Feb 27 11:15:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 868955 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1561:b0:38f:210b:807b with SMTP id 1csp207712wrz; Thu, 27 Feb 2025 03:16:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX+tArhM5d+i2CetA3qx1Wj7svCDGSMPCDf+xlyQBgZydttwH5ovkuP7HD+SBEBi24qFzrmxg==@linaro.org X-Google-Smtp-Source: AGHT+IHaltFvNUNGb1fDSsdlNQamn1P5E54aXyColMKchKEV+SBy0MHqMX6z9n7IAcwNj8shLaG3 X-Received: by 2002:a05:6000:1845:b0:390:d82d:6d4f with SMTP id ffacd0b85a97d-390d82d71cemr5600612f8f.52.1740654979386; Thu, 27 Feb 2025 03:16:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740654979; cv=none; d=google.com; s=arc-20240605; b=ciZ1bVhDMYDJs2OBQ1c/u1eqwbITC+hF/CH6UUtSaSPE+RwFmtkcpF1OmdTkKbnbQU WWlK0EZTxl/PhqnL6kbv4ZU1EQkuCMSVst3jdf69cNrYHmHRTe82cDYD4p8Z1qJ0l9PU R2RcaFOaWAeLVEuXmXvGje0e2NNq3H78RN70/Hy7xSXDvklvulnMU5o+bR0k5J5nFDj/ DNgskqHqKxkKq0tAi5FkUJ3lJYCMGDfdMtE5GK/+sfUs10egdmEO+uAURdQFV+DTrPzk 868hOH+cR/pqgPmtWpeuXakqfEeth7Jggiln+OTpbWw7g1CCCnlt8lihuImQF0PaYWKj 5nvQ== 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=ApZSLZqpYKrrEinDzztBnELkhkg+KB2CbSebOyjdXO4=; fh=WIErNPtEyr4LSk0kn+FyUcnvc47vQRNxykSeJQzwMAA=; b=YGBEjv9wWdAee1Nh+psayEiFZrzRC0HCjiwQQ92osdYEZqQtVbXYAw3fMteU5i28M4 iOKpztz/TWckUsXztnVQel0JstM5ZYougC6YLCmh/1n3cNNBApADMJSGzsDCINo9xzWb L2QQp8yhkHUGZ9UyYWz0IeVjnCXI4IepqNXuG6VMc7da0ck+MyX1F5NJYSCCPaQfXMXR lcoNL/Yj3UqbVuBfPU5PAsykMk3BivIkB4eWovIP1eV0kLudU8PU6fDijZGinc4G4qPa TYSNp/H21yvWwrpsjC3e2aq1JKQw3haKU1a2wv/F//eLDEg/h7+TCGclXdntbgJZZrhG RGMw==; 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 ffacd0b85a97d-390e4797976si894348f8f.166.2025.02.27.03.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2025 03:16:19 -0800 (PST) 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 A2336812BB; Thu, 27 Feb 2025 12:15:58 +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 467D5812BB; Thu, 27 Feb 2025 12:15:58 +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 3683B8118A for ; Thu, 27 Feb 2025 12:15:56 +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 470362BCC; Thu, 27 Feb 2025 03:16:11 -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 DD00D3F6A8; Thu, 27 Feb 2025 03:15:52 -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 v5 4/6] blkmap: store type of blkmap slice in corresponding structure Date: Thu, 27 Feb 2025 16:45:17 +0530 Message-Id: <20250227111519.45787-5-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250227111519.45787-1-sughosh.ganu@linaro.org> References: <20250227111519.45787-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 --- Changes since V4: * Use BIT() based macros instead of enum * Change the name of the field from type to attr as it would contain attributes other than the type of the slice 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,