more changes on original files
[linux-2.4.git] / arch / ppc / boot / simple / misc-44x.c
1 /*
2  * arch/ppc/simple/misc-44x.c
3  *
4  * Misc. bootloader code for IBM PPC 44x reference boards (Ebony, Ocotea)
5  *
6  * Matt Porter <mporter@mvista.com>
7  * Eugene Surovegin <ebs@ebshome.net>
8  * 
9  * This program is free software; you can redistribute  it and/or modify it
10  * under  the terms of  the GNU General  Public License as published by the
11  * Free Software Foundation;  either version 2 of the  License, or (at your
12  * option) any later version.
13  */
14 #include <linux/config.h> 
15 #include <linux/types.h>
16 #include <asm/io.h>
17 #include <asm/processor.h>
18 #include <asm/ibm4xx.h>
19
20 extern struct bi_record *decompress_kernel(unsigned long load_addr,
21         int num_words, unsigned long cksum);
22 extern unsigned long timebase_period_ns;
23
24 struct bi_record *
25 load_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
26 {
27         timebase_period_ns = 3;
28         mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR);             /* reset MAL */
29         while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {}; /* wait for reset */
30         *(volatile unsigned long *)PPC44x_EMAC0_MR0 = 0x20000000; /* reset EMAC */
31         eieio();
32
33         return decompress_kernel(load_addr, num_words, cksum);
34 }