From 590d3cacb98cb377b127869b58507d2afe9c904a Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Mon, 28 Mar 2011 09:58:34 +0000 Subject: Stop passing around bootmem_base value. For the calls to boot_relocate_fdt(), boot_get_cmdline(), and boot_get_kbd(), the value of bootmem_base is always obtained by calling getenv_bootm_low(). Since the value always comes from the same source, the calling signature for those functions can be simplified by making them call getenv_bootm_low() directly. Signed-off-by: Grant Likely --- include/image.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/image.h b/include/image.h index 005e0d2..792de25 100644 --- a/include/image.h +++ b/include/image.h @@ -336,8 +336,7 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images, #ifdef CONFIG_OF_LIBFDT int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *images, char **of_flat_tree, ulong *of_size); -int boot_relocate_fdt (struct lmb *lmb, ulong bootmap_base, - char **of_flat_tree, ulong *of_size); +int boot_relocate_fdt (struct lmb *lmb, char **of_flat_tree, ulong *of_size); #endif #ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH @@ -345,11 +344,10 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len, ulong *initrd_start, ulong *initrd_end); #endif /* CONFIG_SYS_BOOT_RAMDISK_HIGH */ #ifdef CONFIG_SYS_BOOT_GET_CMDLINE -int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end, - ulong bootmap_base); +int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end); #endif /* CONFIG_SYS_BOOT_GET_CMDLINE */ #ifdef CONFIG_SYS_BOOT_GET_KBD -int boot_get_kbd (struct lmb *lmb, bd_t **kbd, ulong bootmap_base); +int boot_get_kbd (struct lmb *lmb, bd_t **kbd); #endif /* CONFIG_SYS_BOOT_GET_KBD */ #endif /* !USE_HOSTCC */ -- cgit v1.1 From c3624e6ed0a36f54aa0b3e7f32d30a6fde434f51 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Mon, 28 Mar 2011 09:58:43 +0000 Subject: Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not defined This patch adds a function getenv_bootm_mapsize() for obtaining the size of the early mapped region accessible by the kernel during early boot. It defaults to CONFIG_SYS_BOOTMAPSZ, or if not defined, defaults to getenv_bootm_size(), which in turn defaults to the size of RAM. getenv_bootm_mapsize() can also be overridden with a "bootm_mapsize" environmental variable. Signed-off-by: Grant Likely --- include/image.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/image.h b/include/image.h index 792de25..8c40557 100644 --- a/include/image.h +++ b/include/image.h @@ -451,6 +451,7 @@ int image_check_dcrc (const image_header_t *hdr); int getenv_yesno (char *var); ulong getenv_bootm_low(void); phys_size_t getenv_bootm_size(void); +phys_size_t getenv_bootm_mapsize(void); void memmove_wd (void *to, void *from, size_t len, ulong chunksz); #endif -- cgit v1.1 From ed59e58786cae9f8afcb575649afc65985beed4d Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Mon, 28 Mar 2011 09:58:49 +0000 Subject: Remove device tree booting dependency on CONFIG_SYS_BOOTMAPSZ The previous patch makes u-boot use the full accessible size of ram as the default boot mapped size if CONFIG_SYS_BOOTMAPSZ is not defined, which means boot_relocate_fdt() can be changed to depend solely on CONFIG_OF_LIBFDT. Signed-off-by: Grant Likely --- include/configs/omap3_beagle.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 5cfa4cb..a0f6829 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -56,13 +56,6 @@ #define CONFIG_MISC_INIT_R #define CONFIG_OF_LIBFDT 1 -/* - * The early kernel mapping on ARM currently only maps from the base of DRAM - * to the end of the kernel image. The kernel is loaded at DRAM base + 0x8000. - * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000, - * so that leaves DRAM base to DRAM base + 0x4000 available. - */ -#define CONFIG_SYS_BOOTMAPSZ 0x4000 #define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ #define CONFIG_SETUP_MEMORY_TAGS 1 -- cgit v1.1 From 55b0a39314562087143f439ecae57379b97db9aa Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Mon, 28 Mar 2011 09:59:01 +0000 Subject: Respect memreserve regions specified in the device tree If a regions is reserved in the fdt, then it should not be used. Add the memreserve regions to the lmb so that u-boot doesn't use them to store the initrd. Signed-off-by: Grant Likely --- include/image.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/image.h b/include/image.h index 8c40557..c31e862 100644 --- a/include/image.h +++ b/include/image.h @@ -336,6 +336,7 @@ int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images, #ifdef CONFIG_OF_LIBFDT int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *images, char **of_flat_tree, ulong *of_size); +void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob); int boot_relocate_fdt (struct lmb *lmb, char **of_flat_tree, ulong *of_size); #endif -- cgit v1.1