Skip to contentSkip to conversation

fdt_support: Check for bank size before updating memory node

PATCH New Lokesh Vutla 3 participants 3 messages Oct 24, 2015 – Nov 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fdt_support: Check for bank size before updating memory node

In case if one of the bank that is passed is of size zero, then u-boot will be updating memory node with a bank of size zero. There is no need to update memory node if size is zero, so check for bank size before updating.

---
Changes since v1:
- Fixed a typo in commit message.

 common/fdt_support.c | 3 +++
 1 file changed, 3 insertions(+)
common/fdt_support.c +3 -0
index f86365e..0019eef 100644
@@ -401,6 +401,9 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
 	char *p = buf;
 
 	for (i = 0; i < n; i++) {
+		if (size[i] == 0)
+			continue;
+
 		if (address_cells == 2)
 			*(fdt64_t *)p = cpu_to_fdt64(address[i]);
 		else
Signature · 1 line
2.1.4
#1 lore raw

PATCH v2 1/1 fdt_support: Check for bank size before updating memory node

Quoted 5 lines · Lokesh Vutla

In case if one of the bank that is passed is of size zero, then u-boot will be updating memory node with a bank of size zero. There is no need to update memory node if size is zero, so check for bank size before updating.

Quoted 8 lines

---
Changes since v1:
- Fixed a typo in commit message.

 common/fdt_support.c | 3 +++
 1 file changed, 3 insertions(+)
#2 lore raw

PATCH v2 1/1 fdt_support: Check for bank size before updating memory node

In reply to Lokesh Vutla
Quoted 8 lines · Lokesh Vutla

In case if one of the bank that is passed is of size zero, then u-boot will be updating memory node with a bank of size zero. There is no need to update memory node if size is zero, so check for bank size before updating.

So, I thought about this more, and looked at device trees, more, and concluded, we're stuck with the interface we have. Today there's still many boards (such as the whole Beaglebone family!) that are setting incorrect sizes in the DTS but being correctly fixed up. We'll need to continue with the other tricks that can be done to pass in more memory in the memory node.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/e56b1fc9/attachment.sig>