~ubuntu-branches/ubuntu/maverick/uboot-imx/maverick

« back to all changes in this revision

Viewing changes to lib_blackfin/bootm.c

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2010-01-20 15:41:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100120154126-7bha1jeyjegu7xm5
Tags: 2009.08+really2009.01-0ubuntu1
* revert to the 2009.01 upstream version, 2009.08 has still to 
  many work in progress items in the freescale patchset (MMC and NIC
  dont work at all)
* add the latest patchset from freescale for 2009.01
* add 1002_enable_hush_shell_and_ext2.patch to enable hush shell and ext2 
* add 1003_fix_board_revision_numbers to make sure babbage 2.5 boards have 
  revision 51120 and babbage 3.0 boards have revision 51130 properly set in 
  their cpuinfo

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * U-boot - bootm.c - misc boot helper functions
 
3
 *
 
4
 * Copyright (c) 2005-2008 Analog Devices Inc.
 
5
 *
 
6
 * (C) Copyright 2000-2004
 
7
 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
8
 *
 
9
 * Licensed under the GPL-2 or later.
 
10
 */
 
11
 
 
12
#include <common.h>
 
13
#include <command.h>
 
14
#include <image.h>
 
15
#include <asm/blackfin.h>
 
16
 
 
17
#ifdef SHARED_RESOURCES
 
18
extern void swap_to(int device_id);
 
19
#endif
 
20
 
 
21
static 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
}
 
33
 
 
34
int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 
35
{
 
36
        int     (*appl) (char *cmdline);
 
37
        char    *cmdline;
 
38
 
 
39
        if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
 
40
                return 1;
 
41
 
 
42
#ifdef SHARED_RESOURCES
 
43
        swap_to(FLASH);
 
44
#endif
 
45
 
 
46
        appl = (int (*)(char *))images->ep;
 
47
 
 
48
        printf("Starting Kernel at = %x\n", appl);
 
49
        cmdline = make_command_line();
 
50
        icache_disable();
 
51
        dcache_disable();
 
52
        (*appl) (cmdline);
 
53
        /* does not return */
 
54
 
 
55
        return 1;
 
56
}