2006-03-12 01:12:27 +00:00
|
|
|
/*
|
2009-12-15 08:11:09 +00:00
|
|
|
* barebox - blackfin_linux.c
|
2006-03-12 01:12:27 +00:00
|
|
|
*
|
|
|
|
* Copyright (c) 2005 blackfin.uclinux.org
|
|
|
|
*
|
|
|
|
* (C) Copyright 2000-2004
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
|
|
|
* See file CREDITS for list of people who contributed to this
|
|
|
|
* project.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Dummy functions, currently not in Use */
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <command.h>
|
|
|
|
#include <image.h>
|
2007-09-13 13:35:49 +00:00
|
|
|
#include <environment.h>
|
2006-03-12 01:12:27 +00:00
|
|
|
#include <asm/byteorder.h>
|
2007-09-13 13:35:49 +00:00
|
|
|
#include <asm/cpu.h>
|
2007-10-23 10:25:14 +00:00
|
|
|
#include <asm/blackfin.h>
|
2011-12-06 07:53:26 +00:00
|
|
|
#include <errno.h>
|
2008-02-21 12:18:53 +00:00
|
|
|
#include <init.h>
|
|
|
|
#include <boot.h>
|
2006-03-12 01:12:27 +00:00
|
|
|
|
|
|
|
#define CMD_LINE_ADDR 0xFF900000 /* L1 scratchpad */
|
|
|
|
|
2008-02-21 12:18:53 +00:00
|
|
|
static int do_bootm_linux(struct image_data *idata)
|
2006-03-12 01:12:27 +00:00
|
|
|
{
|
|
|
|
int (*appl)(char *cmdline);
|
2012-04-29 18:13:53 +00:00
|
|
|
const char *cmdline = linux_bootargs_get();
|
2007-09-13 13:35:49 +00:00
|
|
|
char *cmdlinedest = (char *) CMD_LINE_ADDR;
|
2006-03-12 01:12:27 +00:00
|
|
|
|
2011-12-06 07:53:26 +00:00
|
|
|
if (!idata->os_res)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
appl = (void *)(idata->os_address + idata->os_entry);
|
2011-01-07 10:35:46 +00:00
|
|
|
printf("Starting Kernel at 0x%p\n", appl);
|
2007-09-16 09:18:53 +00:00
|
|
|
|
2007-09-27 10:16:40 +00:00
|
|
|
icache_disable();
|
|
|
|
|
2007-09-13 13:35:49 +00:00
|
|
|
strncpy(cmdlinedest, cmdline, 0x1000);
|
|
|
|
cmdlinedest[0xfff] = 0;
|
|
|
|
|
2007-10-23 10:25:14 +00:00
|
|
|
*(volatile unsigned long *) IMASK = 0x1f;
|
|
|
|
|
2007-09-13 13:35:49 +00:00
|
|
|
(*appl)(cmdlinedest);
|
2006-03-12 01:12:27 +00:00
|
|
|
|
2007-09-13 13:35:49 +00:00
|
|
|
return -1;
|
2006-03-12 01:12:27 +00:00
|
|
|
}
|
2007-09-13 13:35:49 +00:00
|
|
|
|
2008-02-21 12:18:53 +00:00
|
|
|
static struct image_handler handler = {
|
2011-12-06 07:53:26 +00:00
|
|
|
.name = "Blackfin Linux",
|
2008-02-21 12:18:53 +00:00
|
|
|
.bootm = do_bootm_linux,
|
2011-12-06 07:53:26 +00:00
|
|
|
.filetype = filetype_uimage,
|
|
|
|
.ih_os = IH_OS_LINUX,
|
2008-02-21 12:18:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int bfinlinux_register_image_handler(void)
|
|
|
|
{
|
|
|
|
return register_image_handler(&handler);
|
|
|
|
}
|
|
|
|
|
|
|
|
late_initcall(bfinlinux_register_image_handler);
|
|
|
|
|