Changeset 25a76ab8 in mainline for boot/arch/ppc32/src/asm.S


Ignore:
Timestamp:
2010-05-08T07:53:23Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
051bc69a
Parents:
6c39a907 (diff), 1317380 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • boot/arch/ppc32/src/asm.S

    r6c39a907 r25a76ab8  
    2727#
    2828
    29 #include "asm.h"
    30 #include "regname.h"
    31 #include "ofwarch.h"
     29#include <arch/arch.h>
     30#include <arch/regname.h>
    3231
    3332.macro SMC_COHERENCY addr
     
    5958.endm
    6059
    61 .text
    62 
     60.global start
    6361.global halt
    6462.global memcpy
    6563.global jump_to_kernel
    66 .global balloc_base
     64.global real_mode
     65
     66.section BOOTSTRAP, "ax"
     67
     68start:
     69        lis r4, ofw_cif@ha
     70        addi r4, r4, ofw_cif@l
     71        stw r5, 0(r4)
     72       
     73        bl ofw_init
     74        b bootstrap
     75
     76.text
    6777
    6878halt:
     
    127137jump_to_kernel:
    128138       
    129         # r3 = bootinfo (pa)
    130         # r4 = bootinfo_size
    131         # r5 = trans (pa)
    132         # r6 = bytes to copy
    133         # r7 = real_mode (pa)
     139        # arguments:
     140        # r3 = bootinfo (physical address)
     141        # r4 = translate table (physical address)
     142        # r5 = pages to translate
     143        # r6 = real mode meeting point (physical address)
    134144       
    135145        # disable interrupts
     
    139149        mtmsr r31
    140150       
    141         # set real_mode meeting point address
    142        
    143         mtspr srr0, r7
    144        
    145         # jumps to real_mode
     151        # set real mode meeting point physical address
     152       
     153        mtspr srr0, r6
     154       
     155        # jump to real_mode
    146156       
    147157        mfmsr r31
     
    155165        rfi
    156166
     167.section REALMODE, "ax"
     168
    157169.align PAGE_WIDTH
    158 balloc_base:
    159         .fill BALLOC_MAX_SIZE
    160 
    161 .section REALMODE, "ax"
    162 
    163 .align PAGE_WIDTH
    164 .global real_mode
    165170real_mode:
    166171       
    167         # copy kernel to proper location
    168         #
    169         # r3 = bootinfo (pa)
    170         # r4 = bootinfo_size
    171         # r5 = trans (pa)
    172         # r6 = bytes to copy
     172        # arguments:
     173        # r3 = bootinfo (physical address)
     174        # r4 = translate table (physical address)
     175        # r5 = pages to translate
     176       
     177        # move the images of components to the proper
     178        # location using the translate table
    173179       
    174180        li r31, PAGE_SIZE >> 2
     
    177183        page_copy:
    178184               
    179                 cmpwi r6, 0
     185                cmpwi r5, 0
    180186                beq copy_end
    181187               
    182                 # copy page
    183                
    184188                mtctr r31
    185                 lwz r29, 0(r5)
     189                lwz r29, 0(r4)
    186190               
    187191                copy_loop:
     
    194198                        addi r29, r29, 4
    195199                        addi r30, r30, 4
    196                         subi r6, r6, 4
    197                        
    198                         cmpwi r6, 0
    199                         beq copy_end
    200200                       
    201201                        bdnz copy_loop
    202                        
    203                 addi r5, r5, 4
     202               
     203                addi r4, r4, 4
     204                subi r5, r5, 1
    204205                b page_copy
    205206       
     
    266267        # on top of memory, size 64 KB
    267268       
    268         lwz r31, 0(r3)                # r31 = memory size
     269        lwz r31, 4(r3)                # r31 = memory size
    269270       
    270271        lis r30, 65536@h
     
    303304        # create BAT identity mapping
    304305       
    305         lwz r31, 0(r3)                # r31 = memory size
     306        lwz r31, 4(r3)                # r31 = memory size
    306307       
    307308        lis r29, 0x0002
     
    354355        #
    355356        # pc = PA2KA(BOOT_OFFSET)
    356         # r3 = bootinfo (pa)
     357        # r3 = bootinfo (physical address)
    357358        # sprg0 = BOOT_OFFSET
    358359        # sprg3 = physical memory size
    359         # sp = 0 (pa)
     360        # sp = 0 (enforces the usage of sprg0 as exception stack)
    360361       
    361362        lis r31, PA2KA(BOOT_OFFSET)@ha
     
    367368        mtsprg0 r31
    368369       
    369         lwz r31, 0(r3)
     370        # bootinfo starts with a 64 bit integer containing
     371        # the physical memory size, get the lower 4 bytes
     372       
     373        lwz r31, 4(r3)
    370374        mtsprg3 r31
    371375       
     
    379383        isync
    380384        rfi
    381 
    382 .align PAGE_WIDTH
    383 .global trans
    384 trans:
    385         .rept TRANS_SIZE
    386         .int 0
    387         .endr
Note: See TracChangeset for help on using the changeset viewer.