]>
git.ipfire.org Git - people/ms/u-boot.git/blob - common/lynxkdi.c
2 * Copyright (c) Orbacom Systems, Inc <www.orbacom.com>
5 * Redistribution and use in source and binary forms are freely
6 * permitted provided that the above copyright notice and this
7 * paragraph and the following disclaimer are duplicated in all
10 * This software is provided "AS IS" and without any express or
11 * implied warranties, including, without limitation, the implied
12 * warranties of merchantability and fitness for a particular
17 #include <asm/processor.h>
23 DECLARE_GLOBAL_DATA_PTR
;
25 #if defined(CONFIG_MPC8260) || defined(CONFIG_440EP) || defined(CONFIG_440GR)
26 void lynxkdi_boot(image_header_t
*hdr
)
28 void (*lynxkdi
)(void) = (void(*)(void))image_get_ep(hdr
);
29 lynxos_bootparms_t
*parms
= (lynxos_bootparms_t
*)0x0020;
31 u32
*psz
= (u32
*)(image_get_load(hdr
) + 0x0204);
33 memset(parms
, 0, sizeof(*parms
));
35 parms
->clock_ref
= kbd
->bi_busfreq
;
36 parms
->dramsz
= kbd
->bi_memsize
;
37 eth_getenv_enetaddr("ethaddr", parms
->ethaddr
);
38 mtspr(SPRN_SPRG2
, 0x0020);
40 /* Do a simple check for Bluecat so we can pass the
41 * kernel command line parameters.
43 /* FIXME: NOT SURE HERE ! */
44 if (le32_to_cpu(*psz
) == image_get_data_size(hdr
)) {
46 char *cmdline
= (char *)(image_get_load(hdr
) + 0x020c);
49 printf("Booting Bluecat KDI ...\n");
50 udelay(200*1000); /* Allow serial port to flush */
51 if ((args
= getenv("bootargs")) == NULL
)
53 /* Prepend the cmdline */
55 if (len
&& (len
+ strlen(cmdline
) + 2 < (0x0400 - 0x020c))) {
56 memmove(cmdline
+ strlen(args
) + 1, cmdline
,
58 strcpy(cmdline
, args
);
63 printf("Booting LynxOS KDI ...\n");
69 #error "Lynx KDI support not implemented for configured CPU"