=================================================================== RCS file: /cvs/prex-old/boot/avr32/ngw100/bootinfo.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- prex-old/boot/avr32/ngw100/bootinfo.c 2008/07/15 23:48:16 1.1 +++ prex-old/boot/avr32/ngw100/bootinfo.c 2008/07/15 23:56:23 1.2 @@ -1,5 +1,5 @@ /* - * $Id: bootinfo.c,v 1.1 2008/07/15 22:48:16 nbrk Exp $ + * $Id: bootinfo.c,v 1.2 2008/07/15 22:56:23 nbrk Exp $ */ /*- * Copyright (c) 2005, Kohsuke Ohtani @@ -32,6 +32,7 @@ #include #include +#include /* * Setup boot information. @@ -51,9 +52,24 @@ bp->video.text_x = 0; bp->video.text_y = 0; - /* use defaults */ - bp->main_mem.start = 0x10000000; - bp->main_mem.size = 0x02000000; /* 32MB */ + /* + * Try to ask first stage bootloader about physical memory. + */ + printk("setup_bootinfo: fetching boot_params @0x%x", BOOT_PARAMS); + ucfp = uboot_map(BOOT_PARAMS); + if (ucfp != NULL) { + bp->main_mem.start = ucfp->ucf_memstart; + bp->main_mem.size = ucfp->ucf_memsize; + } else { + /* use defaults */ + bp->main_mem.start = 0x10000000; + bp->main_mem.size = 0x02000000; /* 32MB */ + } + + printk("setup_bootinfo: main memory start=%x size=%x (using %s values)\n", + (int)boot_info->main_mem.start, + (int)boot_info->main_mem.size, + ucfp == NULL ? "default" : "u-boot"); *bpp = bp; }