All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common: Add Kconfig option for FDT mem alignment
@ 2020-04-13  8:03 Michal Simek
  2020-04-13 23:38 ` Heinrich Schuchardt
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Michal Simek @ 2020-04-13  8:03 UTC (permalink / raw)
  To: u-boot

From: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>

FDT memory is aligned by 4KB. This is hardcoded in common/board_f.c.
Add Kconfig option, assign default value of 0x1000 and enable option to
change this value.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 common/board_f.c | 3 ++-
 dts/Kconfig      | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/common/board_f.c b/common/board_f.c
index 82a164752aa3..928874e03555 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -546,7 +546,8 @@ static int reserve_fdt(void)
 	 * will be relocated with other data.
 	 */
 	if (gd->fdt_blob) {
-		gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32);
+		gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) +
+				     CONFIG_FDT_MEM_ALIGN_SIZE, 32);
 
 		gd->start_addr_sp -= gd->fdt_size;
 		gd->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size);
diff --git a/dts/Kconfig b/dts/Kconfig
index 046a54a17366..696c0b71afaf 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -121,6 +121,13 @@ config DEFAULT_DEVICE_TREE
 	  It can be overridden from the command line:
 	  $ make DEVICE_TREE=<device-tree-name>
 
+config FDT_MEM_ALIGN_SIZE
+	hex "FDT memory alignment size"
+	default 0x1000
+	help
+	  This option is used to set the default alignment when reserving memory
+	  for fdt.
+
 config OF_LIST
 	string "List of device tree files to include for DT control"
 	depends on SPL_LOAD_FIT || MULTI_DTB_FIT
-- 
2.26.0

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

end of thread, other threads:[~2020-04-20  8:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13  8:03 [PATCH] common: Add Kconfig option for FDT mem alignment Michal Simek
2020-04-13 23:38 ` Heinrich Schuchardt
2020-04-14  7:46   ` Michal Simek
2020-04-16 16:45     ` Heinrich Schuchardt
2020-04-16 15:39 ` Tom Rini
2020-04-16 15:47   ` Michal Simek
2020-04-16 17:06     ` Tom Rini
2020-04-16 17:21       ` Stephen Warren
2020-04-17  6:49         ` Michal Simek
2020-04-19 23:37 ` Simon Glass
2020-04-20  8:28   ` Michal Simek

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.