linux-bk/arch/ppc/boot/simple/head.S
<<
>>
Prefs
   1/*
   2 * arch/ppc/boot/simple/head.S
   3 *
   4 * Initial board bringup code for many different boards.
   5 *
   6 * Author: Tom Rini
   7 *         trini@mvista.com
   8 * Derived from arch/ppc/boot/prep/head.S (Cort Dougan, many others).
   9 *
  10 * 2001-2003 (c) MontaVista, Software, Inc.  This file is licensed under
  11 * the terms of the GNU General Public License version 2.  This program
  12 * is licensed "as is" without any warranty of any kind, whether express
  13 * or implied.
  14 */
  15
  16#include <linux/config.h>
  17#include <asm/reg.h>
  18#include <asm/cache.h>
  19#include <asm/ppc_asm.h>
  20
  21        .text
  22
  23/*
  24 *      Begin at some arbitrary location in RAM or Flash
  25 *        Initialize core registers
  26 *        Configure memory controller (Not executing from RAM)
  27 *      Move the boot code to the link address (8M)
  28 *        Setup C stack
  29 *        Initialize UART
  30 *      Decompress the kernel to 0x0
  31 *      Jump to the kernel entry
  32 *
  33 */
  34
  35        .globl  start
  36start:
  37        bl      start_
  38#ifdef CONFIG_IBM_OPENBIOS
  39        /* The IBM "Tree" bootrom knows that the address of the bootrom
  40         * read only structure is 4 bytes after _start.
  41         */
  42        .long   0x62726f6d              # structure ID - "brom"
  43        .long   0x5f726f00              #              - "_ro\0"
  44        .long   1                       # structure version
  45        .long   bootrom_cmdline         # address of *bootrom_cmdline
  46#endif
  47
  48start_:
  49#ifdef CONFIG_FORCE
  50        /* We have some really bad firmware.  We must disable the L1
  51         * icache/dcache now or the board won't boot.
  52         */
  53        li      r4,0x0000
  54        isync
  55        mtspr   HID0,r4
  56        sync
  57        isync
  58#endif
  59
  60#if defined(CONFIG_MBX) || defined(CONFIG_RPX6)
  61        mr      r29,r3  /* On the MBX860, r3 is the board info pointer.
  62                         * On the RPXSUPER, r3 points to the
  63                         * NVRAM configuration keys.
  64                         */
  65#endif
  66
  67        mflr    r3      /* Save our actual starting address. */
  68
  69        /* The following functions we call must not modify r3 or r4.....
  70        */
  71#ifdef CONFIG_6xx
  72        bl      disable_6xx_mmu
  73        bl      disable_6xx_l1cache
  74
  75        CLEAR_CACHES
  76#endif
  77
  78#ifdef CONFIG_8xx
  79        mfmsr   r8              /* Turn off interrupts */
  80        li      r9,0
  81        ori     r9,r9,MSR_EE
  82        andc    r8,r8,r9
  83        mtmsr   r8
  84
  85        /* We do this because some boot roms don't initialize the
  86         * processor correctly. Don't do this if you want to debug
  87         * using a BDM device.
  88         */
  89        li      r4,0            /* Zero DER to prevent FRZ */
  90        mtspr   SPRN_DER,r4
  91#endif
  92
  93#ifdef CONFIG_REDWOOD_4
  94        /* All of this Redwood 4 stuff will soon disappear when the
  95         * boot rom is straightened out.
  96         */
  97        mr      r29, r3         /* Easier than changing the other code */
  98        bl      HdwInit
  99        mr      r3, r29
 100#endif
 101
 102#if defined(CONFIG_MBX) || defined(CONFIG_RPX6)
 103        mr      r4,r29  /* put the board info pointer where the relocate
 104                         * routine will find it
 105                         */
 106#endif
 107
 108#ifdef  CONFIG_EV64260
 109        /* Move 64260's base regs & CS window for external UART */
 110        bl      ev64260_init
 111#endif
 112
 113        /* Get the load address.
 114        */
 115        subi    r3, r3, 4       /* Get the actual IP, not NIP */
 116        b       relocate
 117
 118
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.