Changeset 9cd4a6e8 in rtems


Ignore:
Timestamp:
01/03/03 16:48:28 (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
fad4a52b
Parents:
8f10c92
Message:

2002-12-08 Greg Menke <gregory.menke@…>

  • bootloader/head.S: Added support for optional debug via PPCbug. Also turn off mmu/caches for the bootstrap phase, which seems to cause trouble with the 603. The cpu init functions in the bsp get all that stuff going properly.
Location:
c/src/lib/libbsp/powerpc/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/shared/ChangeLog

    r8f10c92 r9cd4a6e8  
     12002-12-08      Greg Menke <gregory.menke@gsfc.nasa.gov>
     2 
     3        * bootloader/head.S: Added support for optional debug via PPCbug.
     4        Also turn off mmu/caches for the bootstrap phase, which seems to
     5        cause trouble with the 603.  The cpu init functions in the bsp
     6        get all that stuff going properly.
     7
    182002-12-19      Joel Sherrill <joel@OARcorp.com>
    29
  • c/src/lib/libbsp/powerpc/shared/bootloader/head.S

    r8f10c92 r9cd4a6e8  
    1919#include <rtems/score/cpu.h>
    2020#include "bootldr.h"
    21                
    22 #undef TEST_PPCBUG_CALLS       
     21
     22#define TEST_PPCBUG_CALLS               
     23#undef TEST_PPCBUG_CALLS
     24       
    2325#define FRAME_SIZE 32
    24 #define LOCK_CACHES (HID0_DLOCK|HID0_ILOCK)
    25 #define INVL_CACHES (HID0_DCI|HID0_ICFI)
    26 #define ENBL_CACHES (HID0_DCE|HID0_ICE)
     26#define LOCK_CACHES (HID0_DLOCK | HID0_ILOCK)
     27#define INVL_CACHES (HID0_DCI | HID0_ICFI)
     28#define ENBL_CACHES (HID0_DCE | HID0_ICE)
    2729
    2830#define USE_PPCBUG
    2931#undef  USE_PPCBUG
    3032
     33       
     34#define PRINT_CHAR(c)           \
     35        addi    r20,r3,0        ; \
     36        li      r3,c            ; \
     37        li      r10,0x20        ; \
     38        sc                      ; \
     39        addi    r3,r20,0        ; \
     40        li      r10,0x26        ; \
     41        sc
     42       
     43       
     44       
     45       
    3146#define MONITOR_ENTER                   \
    3247        mfmsr   r10             ;       \
     
    3550        li      r10,0x63        ;       \
    3651        sc
    37        
     52
     53       
     54               
    3855        START_GOT
    3956        GOT_ENTRY(_GOT2_TABLE_)
     
    5471        .globl  start
    5572        .type   start,@function
     73       
    5674/* Point the stack into the PreP partition header in the x86 reserved
    5775 * code area, so that simple C routines can be called.
     
    5977start: 
    6078#ifdef  USE_PPCBUG
    61         MONITOR_ENTER   
     79        MONITOR_ENTER
    6280#endif
    6381        bl      1f
     
    6785        stmw    r26,FRAME_SIZE-24(r1)
    6886        GET_GOT
    69         mfmsr   r28             /* Turn off interrupts */
     87        mfmsr   r28                     /* Turn off interrupts */
    7088        ori     r0,r28,MSR_EE
    7189        xori    r0,r0,MSR_EE
     
    7391       
    7492/* Enable the caches, from now on cr2.eq set means processor is 601 */
     93       
    7594        mfpvr   r0
    7695        mfspr   r29,HID0
     
    7897        cmplwi  cr2,r0,1
    7998        beq     2,2f
     99
     100
     101/*
     102 * commented out, 11/7/2002, gregm.  This instruction sequence seems to
     103 * be pathological on the 603e.
     104 *
     105       
    80106#ifndef USE_PPCBUG
    81107        ori     r0,r29,ENBL_CACHES|INVL_CACHES|LOCK_CACHES
     
    85111        mtspr   HID0,r0
    86112#endif
     113*/
     114       
     115                       
    871162:      bl      reloc
    88117       
     
    116145        lwz     r3,mover(bd)
    117146        lwz     r6,cache_lsize(bd)
     147
    118148        bl      codemove
     149
    119150        mtctr   r3              # Where the temporary codemove is.
    120151        lwz     r3,image(bd)
     
    124155        lwz     r6,cache_lsize(bd)
    125156        lwz     r8,GOT(moved)
     157
    126158        sub     r7,r3,r4        # Difference to adjust pointers.
    127159        add     r8,r8,r7
    128160        add     r30,r30,r7
    129161        add     bd,bd,r7
     162
    130163/* Call the copy routine but return to the new area. */
     164
    131165        mtlr    r8              # for the return address
    132166        bctr                    # returns to the moved instruction
     167       
    133168/* Establish the new top stack frame. */
    134169moved:  lwz     r1,stack(bd)
     
    154189 * during this time!
    155190 */
    156 #ifndef USE_PPCBUG     
    157 4:      bl      MMUoff
    158 #endif 
     1914:
     192#ifdef USE_PPCBUG
     193        PRINT_CHAR('M')
     194#endif
     195        bl      MMUoff
     196
     197#ifdef USE_PPCBUG       
     198        PRINT_CHAR('B')
     199#endif
    159200        bl      flush_tlb
     201
    160202/* Some firmware versions leave stale values in the BATs, it's time
    161203 * to invalidate them to avoid interferences with our own mappings.
     
    163205 * the [ID]BATU. Bloat, bloat.. fortunately thrown away later.
    164206 */
     207#ifdef USE_PPCBUG       
     208        PRINT_CHAR('T')
     209#endif
    165210        li      r3,0
    166211        beq     cr2,5f
     
    180225        addi    r3,r3,__size@sectoff@l
    181226        sync                            # We are going to touch SDR1 !
     227#ifdef USE_PPCBUG       
     228        PRINT_CHAR('i')
     229#endif
    182230        bl      mm_init
     231       
     232#ifdef USE_PPCBUG       
     233        PRINT_CHAR('M')
     234#endif
    183235        bl      MMUon
    184236       
     
    193245        sc
    194246#endif 
     247#ifdef USE_PPCBUG       
     248        PRINT_CHAR('H')
     249#endif
    195250        bl      setup_hw
    196251        lwz     r4,GOT(_binary_rtems_gz_start)
     
    222277/*
    223278 *      Linux code again
     279 *
    224280        lis     r30,0xdeadc0de@ha
    225281        addi    r30,r30,0xdeadc0de@l
     
    228284*/
    229285        dcbst   0,r30   /* Make sure it's in memory ! */
     286       
    230287/* We just flash invalidate and disable the dcache, unless it's a 601,
    231288 * critical areas have been flushed and we don't care about the stack
     
    239296        xori    r0,r0,HID0_DCI|HID0_DCE
    240297        mtspr   HID0,r0
     298       
    241299/* Provisional return to FW, works for PPCBug */
    242300#if 0
     
    287345        .globl  MMUon
    288346        .type   MMUon,@function
    289 MMUon:  mfmsr   r0
     347MMUon:  blr
     348        nop
     349
     350/*     
     351        mfmsr   r0
    290352        ori     r0,r0,MSR_IR|MSR_DR|MSR_IP
    291353        mflr    r11
     
    294356        mtsrr1  r0
    295357        rfi
     358*/
    296359        .globl  MMUoff
    297360        .type   MMUoff,@function
    298 MMUoff: mfmsr   r0
     361MMUoff: blr
     362        nop
     363       
     364/*
     365        mfmsr   r0
    299366        ori     r0,r0,MSR_IR|MSR_DR|MSR_IP
    300367        mflr    r11
     
    303370        mtsrr1  r0
    304371        rfi
     372*/
    305373
    306374/* Due to the PPC architecture (and according to the specifications), a
Note: See TracChangeset for help on using the changeset viewer.