From patchwork Tue Oct 15 15:37:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 835446 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c8f:0:b0:37d:45d0:187 with SMTP id z15csp300551wrs; Tue, 15 Oct 2024 08:38:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX2ooNdkiD5WnGceMwHklmm9lcg0x9Wnbi4gk3CUUdNYyPBdAYQf/nkpBFQKeKG8uzMpZJ/Pw==@linaro.org X-Google-Smtp-Source: AGHT+IEV7FugqNfFxj8aup1U1wxAlY+yL42ym7Kw4UE9tPtggoUWLWaQGDAXa85v7G1VLEMDxe1a X-Received: by 2002:a05:6e02:17cd:b0:3a0:915d:a4a7 with SMTP id e9e14a558f8ab-3a3bcd962d8mr105374525ab.2.1729006683085; Tue, 15 Oct 2024 08:38:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729006683; cv=none; d=google.com; s=arc-20240605; b=df+V5qLp8D/I0rU8Xxt3XVKVSaMpbgYldyk5SvlN1mlumnP+vbzZvNAn2fYxcwqDo5 dbG/KCeZTZipYjdcVC0Wq2KpY1QRdmDLPtZ8V5m1jNKtaKdl8LF+XPDMigJv3phN3W9O bOEtEHbaCNasq1n5hRRW3QhRGvznFQhs818oUHq8Ksl8jRoTWHFC2ZrkLM6pWOk+oHaS 6lN6aKgelvl7xjNp5W7ptWn5DCBJYrhNONhjD+UNRmNsclX1TvcnH9s69rItz8OcFL1H eQfkZr3zLC2DzvI67coE5nyZF7JZvYSg0/CLAp5+6s8AVkr+bEGN2o2WqqRxKm2gCCbu j0KQ== 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=9CvQW9Zs/qwbX6AWJzVeVJk/zPhA8KEg+6kyl+v6fpg=; fh=MYvlzMqd61VHJORtkCu1tTA+qP9jRMJFkVEqSzDEdy8=; b=L9ayG/937YbKeADOjdAG/wfahEtt++CQJApd/6yTSmFgSDwoiyx0BpUK1GhisSqS+X AxRlpP4ySt8ZDXHWKiYyZTd7MGhiZmUx32Prrl8m0LA8Ljjf6fD/DUFr2OfiWpK6IuVf PckpVtwAldqvK8K8dKi50oto13oC3QeKWEQjPYUAiUuro/gU+5yT8HePxrCmb2tsbXxe tDCdgXrNqxNlYkBVCeScaCe5A+KZnoicnWN3nGjiPr8kasF0LpeyFLSfD8uNyZPLq9YX 5E+8R32k7B62TiQkJuALNYJEqp1cy8D7zfG0w1oh+1cwfxgd4SzHmNQud/o0o/qBENPa 2Yfw==; 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 e9e14a558f8ab-3a3d71e2a0bsi7383905ab.188.2024.10.15.08.38.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2024 08:38:03 -0700 (PDT) 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 7382988A47; Tue, 15 Oct 2024 17:37:49 +0200 (CEST) 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 AB3A388730; Tue, 15 Oct 2024 17:37:47 +0200 (CEST) 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 B7063889B3 for ; Tue, 15 Oct 2024 17:37:45 +0200 (CEST) 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 C474C1477; Tue, 15 Oct 2024 08:38:14 -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 50E6E3F528; Tue, 15 Oct 2024 08:37:42 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Tom Rini , Caleb Connolly , Jonas Karlman , Mark Kettenis , Sughosh Ganu Subject: [PATCH v4 02/15] lmb: add a flag to allow suppressing memory map change notification Date: Tue, 15 Oct 2024 21:07:04 +0530 Message-Id: <20241015153717.401371-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015153717.401371-1-sughosh.ganu@linaro.org> References: <20241015153717.401371-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 a flag LMB_NONOTIFY that can be passed to the LMB API's for reserving memory. This will then result in no notification being sent from the LMB module for the changes to the LMB's memory map. While here, also add a description of the memory attributes that the flags signify. Signed-off-by: Sughosh Ganu --- Changes since V3: * Add comments for the LMB_NOOVERWRITE and LMB_NONOTIFY flags include/lmb.h | 3 +++ lib/lmb.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/lmb.h b/include/lmb.h index 0e8426f4379..ec477c1f51d 100644 --- a/include/lmb.h +++ b/include/lmb.h @@ -18,11 +18,14 @@ * enum lmb_flags - definition of memory region attributes * @LMB_NONE: no special request * @LMB_NOMAP: don't add to mmu configuration + * @LMB_NOOVERWRITE: the memory region cannot be overwritten/re-reserved + * @LMB_NONOTIFY: do not notify other modules of changes to this memory region */ enum lmb_flags { LMB_NONE = 0, LMB_NOMAP = BIT(1), LMB_NOOVERWRITE = BIT(2), + LMB_NONOTIFY = BIT(3), }; /** diff --git a/lib/lmb.c b/lib/lmb.c index a38537af9c3..e1e616679f0 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -30,7 +30,7 @@ static struct lmb lmb; static void lmb_print_region_flags(enum lmb_flags flags) { u64 bitpos; - const char *flag_str[] = { "none", "no-map", "no-overwrite" }; + const char *flag_str[] = { "none", "no-map", "no-overwrite", "no-notify" }; do { bitpos = flags ? fls(flags) - 1 : 0;