summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib/armlinux.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2009-06-10 20:24:54 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-07-21 16:41:45 +0200
commit8a1d5e11bbd75f3fb546c772c205118237a3b938 (patch)
tree35b384a9e16090feff3bf0a13ca0f1e900f0eff9 /arch/arm/lib/armlinux.c
parent6e921fcb3c0f16f32673e401933ca5449dd47632 (diff)
downloadbarebox-8a1d5e11bbd75f3fb546c772c205118237a3b938.tar.gz
barebox-8a1d5e11bbd75f3fb546c772c205118237a3b938.tar.xz
Get rid of DEVICE_TYPE_DRAM usage
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib/armlinux.c')
-rw-r--r--arch/arm/lib/armlinux.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index a6d450292..6dc54905b 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -30,6 +30,8 @@
#include <zlib.h>
#include <init.h>
#include <fs.h>
+#include <list.h>
+#include <xfuncs.h>
#include <asm/byteorder.h>
#include <asm/global_data.h>
@@ -112,6 +114,22 @@ void armlinux_set_architecture(int architecture)
armlinux_architecture = architecture;
}
+struct arm_memory {
+ struct list_head list;
+ struct device_d *dev;
+};
+
+static LIST_HEAD(memory_list);
+
+void armlinux_add_dram(struct device_d *dev)
+{
+ struct arm_memory *mem = xzalloc(sizeof(*mem));
+
+ mem->dev = dev;
+
+ list_add_tail(&mem->list, &memory_list);
+}
+
int do_bootm_linux(struct image_data *data)
{
void (*theKernel)(int zero, int arch, void *params);
@@ -212,18 +230,16 @@ __setup_start_tag(void)
void
__setup_memory_tags(void)
{
- struct device_d *dev = NULL;
+ struct arm_memory *mem;
- list_for_each_entry(dev, &device_list, list) {
- if (dev->type == DEVICE_TYPE_DRAM) {
- params->hdr.tag = ATAG_MEM;
- params->hdr.size = tag_size(tag_mem32);
+ list_for_each_entry(mem, &memory_list, list) {
+ params->hdr.tag = ATAG_MEM;
+ params->hdr.size = tag_size(tag_mem32);
- params->u.mem.start = dev->map_base;
- params->u.mem.size = dev->size;
+ params->u.mem.start = mem->dev->map_base;
+ params->u.mem.size = mem->dev->size;
- params = tag_next(params);
- }
+ params = tag_next(params);
}
}