#include <asm/bootinfo.h>
#include <asm/machdep.h>
#include <asm/coldfire.h>
-//#include <asm/cfcache.h>
+#include <asm/cache.h>
#include <asm/cacheflush.h>
#include <asm/io.h>
-//#include <asm/cfmmu.h>
+#include <asm/mmu.h>
#include <asm/setup.h>
#include <asm/irq.h>
#include <asm/traps.h>
extern char _text, _end;
extern char _etext, _edata, __init_begin, __init_end;
extern struct console mcfrs_console;
-extern char m68k_command_line[CL_SIZE];
extern unsigned long availmem;
+#if CONFIG_UBOOT
+extern char m68k_command_line[CL_SIZE];
+#endif
+
static int irq_enable[NR_IRQS];
unsigned long num_pages;
-/* ethernet mac addresses from uboot */
-#ifdef CONFIG_UBOOT
-unsigned char uboot_enet0[6];
-unsigned char uboot_enet1[6];
-#endif
-
void coldfire_sort_memrec(void)
{
int i, j;
}
/*
- * UBoot Handler
+ * Use uboot commandline if told to
*/
#ifdef CONFIG_UBOOT
int __init uboot_commandline(char *bootargs)
{
+ extern unsigned long uboot_init_sp;
+
int len = 0, cmd_line_len;
- static struct uboot_record uboot_info;
+ unsigned long cmd_line_stop, cmd_line_start;
u32 offset = PAGE_OFFSET_RAW - PHYS_OFFSET;
- extern unsigned long uboot_info_stk;
-
- /* validate address */
- if ((uboot_info_stk < PAGE_OFFSET_RAW) ||
- (uboot_info_stk >= (PAGE_OFFSET_RAW + CONFIG_SDRAM_SIZE)))
- return 0;
-
- /* Add offset to get post-remapped kernel memory location */
- uboot_info.bdi = (struct bd_info *)((*(u32 *)(uboot_info_stk)) + offset);
- uboot_info.initrd_start = (*(u32 *)(uboot_info_stk+4)) + offset;
- uboot_info.initrd_end = (*(u32 *)(uboot_info_stk+8)) + offset;
- uboot_info.cmd_line_start = (*(u32 *)(uboot_info_stk+12)) + offset;
- uboot_info.cmd_line_stop = (*(u32 *)(uboot_info_stk+16)) + offset;
-
- /* copy over mac addresses */
- memcpy(uboot_enet0, uboot_info.bdi->bi_enet0addr, 6);
- memcpy(uboot_enet1, uboot_info.bdi->bi_enet1addr, 6);
+ //uboot_init_sp parameters - must add offset to them !!
+ cmd_line_start = uboot_init_sp + 16 + offset;
+ cmd_line_start = uboot_init_sp + 20 + offset;
/* copy command line */
- cmd_line_len = uboot_info.cmd_line_stop - uboot_info.cmd_line_start;
+ cmd_line_len = cmd_line_stop - cmd_line_start;
if ((cmd_line_len > 0) && (cmd_line_len < CL_SIZE-1))
- len = (int)strncpy(bootargs, (char *)uboot_info.cmd_line_start,\
- cmd_line_len);
+ len = (int)strncpy(bootargs, (char *)cmd_line_start,cmd_line_len);
return len;
}
m68k_memory[m68k_num_memory].addr = CONFIG_SDRAM_BASE;
m68k_memory[m68k_num_memory++].size = CONFIG_SDRAM_SIZE;
-
#ifdef CONFIG_UBOOT
if (!uboot_commandline(m68k_command_line))
strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE-1);
-#else
- //FIXME: some better way here
- strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE-1);
#endif
#if defined(CONFIG_BLK_DEV_INITRD)
#endif
}
+
+//no special boot record
+int coldfire_parse_bootinfo(const struct bi_record *)
+{
+ return 1;
+}
+
+