X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=common%2Flynxkdi.c;h=22ad384ef66c29b73f57bb788f0d8338e834eae6;hb=4d2d2ae559c14dee59f1b4db29181945eb98f734;hp=ed1b595b844d4c0012e6c5768778dde9580b967e;hpb=7b230f61db319d87d51449d4620d520822813fbb;p=karo-tx-uboot.git diff --git a/common/lynxkdi.c b/common/lynxkdi.c index ed1b595b84..22ad384ef6 100644 --- a/common/lynxkdi.c +++ b/common/lynxkdi.c @@ -16,48 +16,51 @@ #include #include #include +#include -#if defined(CONFIG_LYNXKDI) #include +DECLARE_GLOBAL_DATA_PTR; + #if defined(CONFIG_MPC8260) || defined(CONFIG_440EP) || defined(CONFIG_440GR) -void lynxkdi_boot ( image_header_t *hdr ) +void lynxkdi_boot(image_header_t *hdr) { - void (*lynxkdi)(void) = (void(*)(void)) ntohl(hdr->ih_ep); + void (*lynxkdi)(void) = (void(*)(void))image_get_ep(hdr); lynxos_bootparms_t *parms = (lynxos_bootparms_t *)0x0020; bd_t *kbd; - DECLARE_GLOBAL_DATA_PTR; - u32 *psz = (u32 *)(ntohl(hdr->ih_load) + 0x0204); + u32 *psz = (u32 *)(image_get_load(hdr) + 0x0204); - memset( parms, 0, sizeof(*parms)); + memset(parms, 0, sizeof(*parms)); kbd = gd->bd; parms->clock_ref = kbd->bi_busfreq; parms->dramsz = kbd->bi_memsize; - memcpy(parms->ethaddr, kbd->bi_enetaddr, 6); + eth_getenv_enetaddr("ethaddr", parms->ethaddr); mtspr(SPRN_SPRG2, 0x0020); /* Do a simple check for Bluecat so we can pass the * kernel command line parameters. */ - if( le32_to_cpu(*psz) == ntohl(hdr->ih_size) ){ /* FIXME: NOT SURE HERE ! */ - char *args; - char *cmdline = (char *)(ntohl(hdr->ih_load) + 0x020c); - int len; + /* FIXME: NOT SURE HERE ! */ + if (le32_to_cpu(*psz) == image_get_data_size(hdr)) { + char *args; + char *cmdline = (char *)(image_get_load(hdr) + 0x020c); + int len; - printf("Booting Bluecat KDI ...\n"); - udelay(200*1000); /* Allow serial port to flush */ - if ((args = getenv("bootargs")) == NULL) - args = ""; - /* Prepend the cmdline */ - len = strlen(args); - if( len && (len + strlen(cmdline) + 2 < (0x0400 - 0x020c))) { - memmove( cmdline + strlen(args) + 1, cmdline, strlen(cmdline) ); - strcpy( cmdline, args ); - cmdline[len] = ' '; - } + printf("Booting Bluecat KDI ...\n"); + udelay(200*1000); /* Allow serial port to flush */ + if ((args = getenv("bootargs")) == NULL) + args = ""; + /* Prepend the cmdline */ + len = strlen(args); + if (len && (len + strlen(cmdline) + 2 < (0x0400 - 0x020c))) { + memmove(cmdline + strlen(args) + 1, cmdline, + strlen(cmdline)); + strcpy(cmdline, args); + cmdline[len] = ' '; + } } else { - printf("Booting LynxOS KDI ...\n"); + printf("Booting LynxOS KDI ...\n"); } lynxkdi(); @@ -65,5 +68,3 @@ void lynxkdi_boot ( image_header_t *hdr ) #else #error "Lynx KDI support not implemented for configured CPU" #endif - -#endif /* CONFIG_LYNXKDI */