]> git.ipfire.org Git - people/ms/u-boot.git/blame - lib_blackfin/boot.c
mpc83xx: match dtb filename references to their dts equivalents in the linux kernel
[people/ms/u-boot.git] / lib_blackfin / boot.c
CommitLineData
6cb142fa 1/*
81b799ad 2 * U-boot - boot.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{
36cd52a0 23 char *dest = (char *)CONFIG_LINUX_CMDLINE_ADDR;
9171fc81
MF
24 char *bootargs = getenv("bootargs");
25
26 if (bootargs == NULL)
27 return NULL;
28
36cd52a0
MF
29 strncpy(dest, bootargs, CONFIG_LINUX_CMDLINE_SIZE);
30 dest[CONFIG_LINUX_CMDLINE_SIZE - 1] = 0;
9171fc81
MF
31 return dest;
32}
6cb142fa 33
b1e9435b
MF
34extern ulong bfin_poweron_retx;
35
40d7e99d 36int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
6cb142fa 37{
d5934ad7
MB
38 int (*appl) (char *cmdline);
39 char *cmdline;
6cb142fa 40
49c3a861
KG
41 if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
42 return 1;
43
6cb142fa
WD
44#ifdef SHARED_RESOURCES
45 swap_to(FLASH);
46#endif
47
c160a954 48 appl = (int (*)(char *))images->ep;
d5934ad7 49
fe033ad6 50 printf("Starting Kernel at = %p\n", appl);
6cb142fa 51 cmdline = make_command_line();
9171fc81
MF
52 icache_disable();
53 dcache_disable();
b1e9435b
MF
54 asm __volatile__(
55 "RETX = %[retx];"
56 "CALL (%0);"
57 :
58 : "p"(appl), "q0"(cmdline), [retx] "d"(bfin_poweron_retx)
59 );
cd7c596e 60 /* does not return */
a3a08c0c 61
40d7e99d 62 return 1;
6cb142fa 63}