devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: Allow mem_reserve of memory with a base address of zero
@ 2014-08-06 20:30 Al Cooper
       [not found] ` <1407357004-31713-1-git-send-email-alcooperx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Al Cooper @ 2014-08-06 20:30 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A
  Cc: Al Cooper

__reserved_mem_reserve_reg() won't reserve memory if the base address
is zero. This change removes the check for a base address of zero and
allows it to be reserved.

Allowing the first 4K of memory to be reserved will help solve a
problem on some ARM systems where the the first 16K of memory is
unused and becomes allocable memory. This will prevent this memory
from being used for DMA by drivers like the USB OHCI driver which
consider a physical address of zero to be illegal.

Signed-off-by: Al Cooper <alcooperx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 9aa012e..379ad4f 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -453,7 +453,7 @@ static int __init __reserved_mem_reserve_reg(unsigned long node,
 		base = dt_mem_next_cell(dt_root_addr_cells, &prop);
 		size = dt_mem_next_cell(dt_root_size_cells, &prop);
 
-		if (base && size &&
+		if (size &&
 		    early_init_dt_reserve_memory_arch(base, size, nomap) == 0)
 			pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %ld MiB\n",
 				uname, &base, (unsigned long)size / SZ_1M);
-- 
1.9.0.138.g2de3478

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-08-22  3:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-06 20:30 [PATCH] of: Allow mem_reserve of memory with a base address of zero Al Cooper
     [not found] ` <1407357004-31713-1-git-send-email-alcooperx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-08-06 22:02   ` Rob Herring
     [not found]     ` <CAL_Jsq+=EZu6_Dy59sAEE0B5T_uS1vA5YQQmKAe9vj0VOHVyCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-12 16:48       ` Grant Likely
     [not found]         ` <20140812164813.6B202C405D3-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-08-12 17:02           ` Laura Abbott
     [not found]             ` <53EA48AB.4030902-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2014-08-19 18:54               ` Alan Cooper
     [not found]                 ` <CAOGqxeWqkHJtm1y1HxnnhcFNb3WdVPNnTT0hjtjJzEjNZ2icjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-22  3:26                   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).