[PATCH 3/5] arm/setup_memory_tags: add multiple resource support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Nov 12 13:18:56 EST 2010


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/lib/armlinux.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index d1f8281..b74c5e8 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -73,15 +73,20 @@ static LIST_HEAD(memory_list);
 static void setup_memory_tags(void)
 {
 	struct arm_memory *mem;
+	struct resource *res;
+	int i;
 
 	list_for_each_entry(mem, &memory_list, list) {
-		params->hdr.tag = ATAG_MEM;
-		params->hdr.size = tag_size(tag_mem32);
+		for (i = 0; i < mem->dev->num_resources; i++) {
+			res = &mem->dev->resource[i];
+			params->hdr.tag = ATAG_MEM;
+			params->hdr.size = tag_size(tag_mem32);
 
-		params->u.mem.start = dev_resource_get_start(mem->dev);
-		params->u.mem.size = dev_resource_get_size(mem->dev);
+			params->u.mem.start = res->start;
+			params->u.mem.size = res->size;
 
-		params = tag_next(params);
+			params = tag_next(params);
+		}
 	}
 }
 
-- 
1.7.1




More information about the barebox mailing list