summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2011-09-23 11:00:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-09-23 16:32:49 +0200
commitdeef916d9c6dfe0a1c88312b8f59943b109d5208 (patch)
treeb7bd07d4d4e432e5135427dc6783be28426b67dc /arch/arm/lib
parentfbd855d7f5995514644135e7ea88cee73350001d (diff)
downloadbarebox-deef916d9c6dfe0a1c88312b8f59943b109d5208.tar.gz
barebox-deef916d9c6dfe0a1c88312b8f59943b109d5208.tar.xz
ARM: switch to generic memory banks
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/armlinux.c10
-rw-r--r--arch/arm/lib/bootz.c13
2 files changed, 12 insertions, 11 deletions
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index 25b0f2afa4..e3a74f4ffb 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -35,13 +35,13 @@
#include <malloc.h>
#include <fcntl.h>
#include <errno.h>
+#include <memory.h>
#include <asm/byteorder.h>
#include <asm/setup.h>
#include <asm/barebox-arm.h>
#include <asm/armlinux.h>
#include <asm/system.h>
-#include <asm/memory.h>
static struct tag *params;
static int armlinux_architecture = 0;
@@ -66,14 +66,14 @@ static void setup_start_tag(void)
static void setup_memory_tags(void)
{
- struct arm_memory *mem;
+ struct memory_bank *bank;
- for_each_sdram_bank(mem) {
+ for_each_memory_bank(bank) {
params->hdr.tag = ATAG_MEM;
params->hdr.size = tag_size(tag_mem32);
- params->u.mem.start = mem->dev->resource[0].start;
- params->u.mem.size = mem->dev->resource[0].size;
+ params->u.mem.start = bank->start;
+ params->u.mem.size = bank->size;
params = tag_next(params);
}
diff --git a/arch/arm/lib/bootz.c b/arch/arm/lib/bootz.c
index 13bed25aeb..fc14487bfa 100644
--- a/arch/arm/lib/bootz.c
+++ b/arch/arm/lib/bootz.c
@@ -9,6 +9,7 @@
#include <asm/armlinux.h>
#include <asm/system.h>
#include <asm-generic/memory_layout.h>
+#include <memory.h>
struct zimage_header {
u32 unused[9];
@@ -26,7 +27,7 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[])
void *zimage;
u32 end;
int usemap = 0;
- struct arm_memory *mem = list_first_entry(&memory_list, struct arm_memory, list);
+ struct memory_bank *bank = list_first_entry(&memory_banks, struct memory_bank, list);
if (argc != 2) {
barebox_cmd_usage(cmdtp);
@@ -44,8 +45,8 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[])
* the first 128MB of SDRAM.
*/
zimage = memmap(fd, PROT_READ);
- if (zimage && (unsigned long)zimage >= mem->start &&
- (unsigned long)zimage < mem->start + SZ_128M) {
+ if (zimage && (unsigned long)zimage >= bank->start &&
+ (unsigned long)zimage < bank->start + SZ_128M) {
usemap = 1;
header = zimage;
}
@@ -78,11 +79,11 @@ static int do_bootz(struct command *cmdtp, int argc, char *argv[])
end = swab32(end);
if (!usemap) {
- if (mem->size <= SZ_128M) {
+ if (bank->size <= SZ_128M) {
zimage = xmalloc(end);
} else {
- zimage = (void *)mem->start + SZ_8M;
- if (mem->start + SZ_8M + end >= MALLOC_BASE) {
+ zimage = (void *)bank->start + SZ_8M;
+ if (bank->start + SZ_8M + end >= MALLOC_BASE) {
printf("won't overwrite malloc space with image\n");
goto err_out1;
}