struct bi_record * load_kernel(unsigned long load_addr, int num_words, unsigned long cksum) { timebase_period_ns = 3; mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR); /* reset MAL */ while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for reset */ *(volatile unsigned long *)PPC44x_EMAC0_MR0 = 0x20000000; /* reset EMAC */ eieio(); return decompress_kernel(load_addr, num_words, cksum); }
int main(unsigned long stack_start_addr) { int i; //Elf32_Ehdr *pHdr; file_offset = 0; #if defined(CONFIG_RTL_819X) set_io_port_base(BASE_ADDR); #endif #ifndef __DO_QUIET__ printf("decompressing kernel:\n"); #endif #ifdef CONFIG_RTL8197B_PANA extern int is_vmlinux_checksum_ok(); REG32(0xB801900C) = REG32(0xB801900C) & (~0x0400); //SYSSR, AllSoftwareReady=0 if (!is_vmlinux_checksum_ok()) { printf("Linux image corrupted!\n"); for (;;); } #endif #ifndef BZ2_COMPRESS decompress_kernel(UNCOMPRESS_OUT, stack_start_addr+4096, FREEMEM_END, 0); #else decompress_kernel(UNCOMPRESS_OUT, stack_start_addr+4096, FREEMEM_END, 0); #endif #ifndef __DO_QUIET__ printf("done decompressing kernel.\n"); #endif flush_cache(); printf("start address: 0x%08x\n", kernelStartAddr); start_kernel(kernelStartAddr); //start_kernel(0x80000000); }
void * load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, void *ign1, void *ign2) { unsigned long long mac64; decompress_kernel(load_addr, num_words, cksum); mac64 = simple_strtoull((char *)PIBS_MAC_BASE, 0, 16); memcpy(hold_residual->bi_enetaddr, (char *)&mac64+2, 6); #if defined(CONFIG_440GX) || defined(CONFIG_440EP) mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET), 0, 16); memcpy(hold_residual->bi_enet1addr, (char *)&mac64+2, 6); #endif #ifdef CONFIG_440GX mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*2), 0, 16); memcpy(hold_residual->bi_enet2addr, (char *)&mac64+2, 6); mac64 = simple_strtoull((char *)(PIBS_MAC_BASE+PIBS_MAC_OFFSET*3), 0, 16); memcpy(hold_residual->bi_enet3addr, (char *)&mac64+2, 6); #endif return (void *)hold_residual; }
load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, void *ign1, void *ign2) { board_isa_init(); return decompress_kernel(load_addr, num_words, cksum); }
load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, void *bp) { return decompress_kernel(load_addr, num_words, cksum, bp); }
void * load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, void *ign1, void *ign2) { #ifdef CONFIG_40x openbios_bd_t *openbios_bd = NULL; openbios_bd_t *(*get_board_info)(void) = (openbios_bd_t *(*)(void))(*(unsigned long *)BOARD_INFO_VECTOR); /* * On 40x platforms we not only need the MAC-addresses, but also the * clocks and memsize. Now try to get all values using the OpenBIOS * "get_board_info()" callback. */ if ((openbios_bd = get_board_info()) != NULL) { /* * Copy bd_info from OpenBIOS struct into U-Boot struct * used by kernel */ hold_residual->bi_memsize = openbios_bd->bi_memsize; hold_residual->bi_intfreq = openbios_bd->bi_intfreq; hold_residual->bi_busfreq = openbios_bd->bi_busfreq; hold_residual->bi_pci_busfreq = openbios_bd->bi_pci_busfreq; memcpy(hold_residual->bi_pci_enetaddr, openbios_bd->bi_pci_enetaddr, 6); #ifdef CONFIG_405EP memcpy(hold_residual->bi_enetaddr, openbios_bd->bi_enetaddr[0], 6); memcpy(hold_residual->bi_enet1addr, openbios_bd->bi_enetaddr[1], 6); hold_residual->bi_opbfreq = openbios_bd->bi_opb_busfreq; hold_residual->bi_procfreq = openbios_bd->bi_pllouta_freq; #else /* CONFIG_405EP */ memcpy(hold_residual->bi_enetaddr, openbios_bd->bi_enetaddr, 6); #endif /* CONFIG_405EP */ } else { /* Hmmm...better try to stuff some defaults. */ hold_residual->bi_memsize = 16 * 1024 * 1024; hold_residual->bi_intfreq = 200000000; hold_residual->bi_busfreq = 100000000; hold_residual->bi_pci_busfreq = 66666666; /* * Only supply one mac-address in this fallback */ memcpy(hold_residual->bi_enetaddr, (void *)def_enet_addr, 6); #ifdef CONFIG_405EP hold_residual->bi_opbfreq = 50000000; hold_residual->bi_procfreq = 200000000; #endif /* CONFIG_405EP */ } timebase_period_ns = 1000000000 / hold_residual->bi_intfreq; #endif /* CONFIG_40x */ #ifdef CONFIG_440GP /* simply copy the MAC addresses */ memcpy(hold_residual->bi_enetaddr, (char *)OPENBIOS_MAC_BASE, 6); memcpy(hold_residual->bi_enet1addr, (char *)(OPENBIOS_MAC_BASE+OPENBIOS_MAC_OFFSET), 6); #endif /* CONFIG_440GP */ decompress_kernel(load_addr, num_words, cksum); return (void *)hold_residual; }