]> git.ipfire.org Git - people/ms/u-boot.git/blame - lib_blackfin/bootm.c
rename CFG_ENV macros to CONFIG_ENV
[people/ms/u-boot.git] / lib_blackfin / bootm.c
CommitLineData
6cb142fa 1/*
9171fc81 2 * U-boot - bootm.c - misc boot helper functions
6cb142fa 3 *
9171fc81 4 * Copyright (c) 2005-2008 Analog Devices Inc.
6cb142fa
WD
5 *
6 * (C) Copyright 2000-2004
7 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 *
9171fc81 9 * Licensed under the GPL-2 or later.
6cb142fa
WD
10 */
11
6cb142fa
WD
12#include <common.h>
13#include <command.h>
14#include <image.h>
9171fc81 15#include <asm/blackfin.h>
6cb142fa 16
6cb142fa 17#ifdef SHARED_RESOURCES
3f0606ad 18extern void swap_to(int device_id);
6cb142fa
WD
19#endif
20
9171fc81
MF
21static char *make_command_line(void)
22{
23 char *dest = (char *)CMD_LINE_ADDR;
24 char *bootargs = getenv("bootargs");
25
26 if (bootargs == NULL)
27 return NULL;
28
29 strncpy(dest, bootargs, 0x1000);
30 dest[0xfff] = 0;
31 return dest;
32}
6cb142fa 33
40d7e99d 34int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
6cb142fa 35{
d5934ad7
MB
36 int (*appl) (char *cmdline);
37 char *cmdline;
6cb142fa
WD
38
39#ifdef SHARED_RESOURCES
40 swap_to(FLASH);
41#endif
42
c160a954 43 appl = (int (*)(char *))images->ep;
d5934ad7 44
6cb142fa
WD
45 printf("Starting Kernel at = %x\n", appl);
46 cmdline = make_command_line();
9171fc81
MF
47 icache_disable();
48 dcache_disable();
3f0606ad 49 (*appl) (cmdline);
cd7c596e 50 /* does not return */
40d7e99d
KG
51error:
52 return 1;
6cb142fa 53}