All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of: Make the number of reserved memory regions configurable
@ 2025-10-23 15:35 Maxime Ripard
  2025-10-24 12:57 ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2025-10-23 15:35 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan
  Cc: Eric Chanudet, Radu Rendec, devicetree, linux-kernel,
	Maxime Ripard

Some platforms register more reserved memory regions than the current
hardcoded limit of 64.

Let's turn into a Kconfig option so we can easily tune it according to a
platform needs, while keeping the current value as a default.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
---
 drivers/of/Kconfig      | 12 ++++++++++++
 drivers/of/of_private.h |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 50697cc3b07ebeb24283e22299797ce4612db89c..721221ae73cef118f8bde8c64c6298aa5f1d106e 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -97,10 +97,22 @@ config OF_IRQ
 	depends on !SPARC && IRQ_DOMAIN
 
 config OF_RESERVED_MEM
 	def_bool OF_EARLY_FLATTREE
 
+config OF_RESERVED_MEM_AREAS
+	int "Maximum count of reserved memory areas"
+	depends on OF_RESERVED_MEM
+	default 64
+	help
+	  Platforms can create a number of reserved memory region
+	  to accomodate their firmware,	describe driver-specific
+	  memory regions, etc. This parameters sets the maximum
+	  number of reserved memory areas in the system.
+
+	  If unsure, leave to its default value 64.
+
 config OF_RESOLVE
 	bool
 
 config OF_OVERLAY
 	bool "Device Tree overlays"
diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h
index df0bb00349e01145930fa85c195aefc0a7c32a06..af424ca876b4481c21563bfbac8691a74a42970b 100644
--- a/drivers/of/of_private.h
+++ b/drivers/of/of_private.h
@@ -7,11 +7,11 @@
  * Paul Mackerras	August 1996.
  * Copyright (C) 1996-2005 Paul Mackerras.
  */
 
 #define FDT_ALIGN_SIZE 8
-#define MAX_RESERVED_REGIONS    64
+#define MAX_RESERVED_REGIONS    CONFIG_OF_RESERVED_MEM_AREAS
 
 /**
  * struct alias_prop - Alias property in 'aliases' node
  * @link:	List node to link the structure in aliases_lookup list
  * @alias:	Alias property name

---
base-commit: efb26a23ed5f5dc3554886ab398f559dcb1de96b
change-id: 20251023-of-max-reserved-mem-a8e8d7db3afe

Best regards,
-- 
Maxime Ripard <mripard@kernel.org>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-27 13:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-23 15:35 [PATCH] of: Make the number of reserved memory regions configurable Maxime Ripard
2025-10-24 12:57 ` Rob Herring
2025-10-27 10:02   ` Maxime Ripard
2025-10-27 13:48     ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.