}
void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve")));
+#if defined(__ARM__)
+ #define IH_INITRD_ARCH IH_ARCH_ARM
+#elif defined(__avr32__)
+ #define IH_INITRD_ARCH IH_ARCH_AVR32
+#elif defined(__bfin__)
+ #define IH_INITRD_ARCH IH_ARCH_BLACKFIN
+#elif defined(__I386__)
+ #define IH_INITRD_ARCH IH_ARCH_I386
+#elif defined(__M68K__)
+ #define IH_INITRD_ARCH IH_ARCH_M68K
+#elif defined(__microblaze__)
+ #define IH_INITRD_ARCH IH_ARCH_MICROBLAZE
+#elif defined(__mips__)
+ #define IH_INITRD_ARCH IH_ARCH_MIPS
+#elif defined(__nios__)
+ #define IH_INITRD_ARCH IH_ARCH_NIOS
+#elif defined(__nios2__)
+ #define IH_INITRD_ARCH IH_ARCH_NIOS2
+#elif defined(__PPC__)
+ #define IH_INITRD_ARCH IH_ARCH_PPC
+#elif defined(__sh__)
+ #define IH_INITRD_ARCH IH_ARCH_SH
+#elif defined(__sparc__)
+ #define IH_INITRD_ARCH IH_ARCH_SPARC
+#else
+# error Unknown CPU type
+#endif
/*******************************************************************/
/* bootm - boot application image from image in memory */
ulong load_start, load_end;
ulong mem_start;
phys_size_t mem_size;
+ int ret;
struct lmb lmb;
return 1;
}
+ if (os == IH_OS_LINUX) {
+ /* find ramdisk */
+ ret = boot_get_ramdisk (argc, argv, &images, IH_INITRD_ARCH,
+ &images.rd_start, &images.rd_end);
+ if (ret) {
+ puts ("Ramdisk image is corrupt\n");
+ return 1;
+ }
+ }
+
image_start = (ulong)os_hdr;
load_end = 0;
type_name = genimg_get_type_name (type);
ulong ep; /* entry point of OS */
+ ulong rd_start, rd_end;/* ramdisk start/end */
+
int verify; /* getenv("verify")[0] != 'n' */
struct lmb *lmb; /* for memory mgmt */
} bootm_headers_t;
void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
bootm_headers_t *images)
{
- ulong initrd_start, initrd_end;
bd_t *bd = gd->bd;
char *s;
int machid = bd->bi_arch_number;
printf ("Using machid 0x%x from environment\n", machid);
}
- ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_ARM,
- &initrd_start, &initrd_end);
- if (ret)
- goto error;
-
show_boot_progress (15);
debug ("## Transferring control to Linux (at address %08lx) ...\n",
setup_commandline_tag (bd, commandline);
#endif
#ifdef CONFIG_INITRD_TAG
- if (initrd_start && initrd_end)
- setup_initrd_tag (bd, initrd_start, initrd_end);
+ if (images->rd_start && images->rd_end)
+ setup_initrd_tag (bd, images->rd_start, images->rd_end);
#endif
#if defined (CONFIG_VFD) || defined (CONFIG_LCD)
setup_videolfb_tag ((gd_t *) gd);
void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
bootm_headers_t *images)
{
- ulong initrd_start, initrd_end;
void (*theKernel)(int magic, void *tagtable);
struct tag *params, *params_start;
char *commandline = getenv("bootargs");
theKernel = (void *)images->ep;
- ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_AVR32,
- &initrd_start, &initrd_end);
- if (ret)
- goto error;
-
show_boot_progress (15);
params = params_start = (struct tag *)gd->bd->bi_boot_params;
params = setup_start_tag(params);
params = setup_memory_tags(params);
- if (initrd_start) {
+ if (images->rd_start) {
params = setup_ramdisk_tag(params,
- PHYSADDR(initrd_start),
- PHYSADDR(initrd_end));
+ PHYSADDR(images->rd_start),
+ PHYSADDR(images->rd_end));
}
params = setup_commandline_tag(params, commandline);
params = setup_clock_tags(params);
{
void *base_ptr;
ulong os_data, os_len;
- ulong initrd_start, initrd_end;
image_header_t *hdr;
int ret;
#if defined(CONFIG_FIT)
size_t len;
#endif
- ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_I386,
- &initrd_start, &initrd_end);
- if (ret)
- goto error;
-
if (images->legacy_hdr_valid) {
hdr = images->legacy_hdr_os;
if (image_check_type (hdr, IH_TYPE_MULTI)) {
}
base_ptr = load_zimage ((void*)os_data, os_len,
- initrd_start, initrd_end - initrd_start, 0);
+ images->rd_start, images->rd_end - images->rd_start, 0);
if (NULL == base_ptr) {
printf ("## Kernel loading failed ...\n");
{
ulong sp;
- ulong rd_data_start, rd_data_end, rd_len;
+ ulong rd_len;
ulong initrd_start, initrd_end;
int ret;
kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))images->ep;
- /* find ramdisk */
- ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_M68K,
- &rd_data_start, &rd_data_end);
- if (ret)
- goto error;
-
- rd_len = rd_data_end - rd_data_start;
- ret = boot_ramdisk_high (lmb, rd_data_start, rd_len,
+ rd_len = images->rd_end - images->rd_start;
+ ret = boot_ramdisk_high (lmb, images->rd_start, rd_len,
&initrd_start, &initrd_end);
if (ret)
goto error;
void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[],
bootm_headers_t *images)
{
- ulong initrd_start, initrd_end;
void (*theKernel) (int, char **, char **, int *);
char *commandline = getenv ("bootargs");
char env_buf[12];
/* find kernel entry point */
theKernel = (void (*)(int, char **, char **, int *))images->ep;
- ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_MIPS,
- &initrd_start, &initrd_end);
- if (ret)
- goto error;
-
show_boot_progress (15);
#ifdef DEBUG
linux_env_set ("memsize", env_buf);
- sprintf (env_buf, "0x%08X", (uint) UNCACHED_SDRAM (initrd_start));
- linux_env_set ("initrd_start", env_buf);
+ sprintf (env_buf, "0x%08X", (uint) UNCACHED_SDRAM (images->rd_start));
+ linux_env_set ("images->rd_start", env_buf);
- sprintf (env_buf, "0x%X", (uint) (initrd_end - initrd_start));
+ sprintf (env_buf, "0x%X", (uint) (images->rd_end - images->rd_start));
linux_env_set ("initrd_size", env_buf);
sprintf (env_buf, "0x%08X", (uint) (gd->bd->bi_flashstart));
ulong sp;
ulong initrd_start, initrd_end;
- ulong rd_data_start, rd_data_end, rd_len;
+ ulong rd_len;
ulong size;
phys_size_t bootm_size;
set_clocks_in_mhz(kbd);
}
- /* find ramdisk */
- ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_PPC,
- &rd_data_start, &rd_data_end);
- if (ret)
- goto error;
-
- rd_len = rd_data_end - rd_data_start;
+ rd_len = images->rd_end - images->rd_start;
#if defined(CONFIG_OF_LIBFDT)
ret = boot_relocate_fdt (lmb, bootmap_base,
*/
if (of_size) {
/* pass in dummy initrd info, we'll fix up later */
- if (fdt_chosen(of_flat_tree, rd_data_start, rd_data_end, 0) < 0) {
+ if (fdt_chosen(of_flat_tree, images->rd_start, images->rd_end, 0) < 0) {
fdt_error ("/chosen node create failed");
goto error;
}
}
#endif /* CONFIG_OF_LIBFDT */
- ret = boot_ramdisk_high (lmb, rd_data_start, rd_len, &initrd_start, &initrd_end);
+ ret = boot_ramdisk_high (lmb, images->rd_start, rd_len, &initrd_start, &initrd_end);
if (ret)
goto error;
/* Look for the dummy entry and delete it */
for (j = 0; j < total; j++) {
fdt_get_mem_rsv(of_flat_tree, j, &addr, &size);
- if (addr == rd_data_start) {
+ if (addr == images->rd_start) {
fdt_del_mem_rsv(of_flat_tree, j);
break;
}
char *bootargs;
ulong load;
ulong initrd_start, initrd_end;
- ulong rd_data_start, rd_data_end, rd_len;
+ ulong rd_len;
unsigned int data, len, checksum;
unsigned int initrd_addr, kernend;
void (*kernel) (struct linux_romvec *, void *);
* extracted and is writeable.
*/
- /*
- * Are we going to use an initrd image?
- */
- ret = boot_get_ramdisk(argc, argv, images, IH_ARCH_SPARC,
- &rd_data_start, &rd_data_end);
- if (ret) {
- /* RAM disk found but was corrupt */
- puts("RAM Disk corrupt\n");
- goto error;
- }
-
/* Calc length of RAM disk, if zero no ramdisk available */
- rd_len = rd_data_end - rd_data_start;
+ rd_len = images->rd_end - images->rd_start;
if (rd_len) {
*/
lmb_reserve(lmb, CFG_RELOC_MONITOR_BASE, CFG_RAM_END);
- ret = boot_ramdisk_high(lmb, rd_data_start, rd_len,
+ ret = boot_ramdisk_high(lmb, images->rd_start, rd_len,
&initrd_start, &initrd_end);
if (ret) {
puts("### Failed to relocate RAM disk\n");