Changeset 965dc18 in mainline for kernel/arch/sparc64/src/start.S


Ignore:
Timestamp:
2008-12-05T19:59:03Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
49093a4
Parents:
0258e67
Message:

Merge sparc branch to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/start.S

    r0258e67 r965dc18  
    2828
    2929#include <arch/arch.h>
     30#include <arch/cpu.h>
    3031#include <arch/regdef.h>
    3132#include <arch/boot/boot.h>
     
    4647
    4748#define BSP_FLAG        1
     49
     50/*
     51 * 2^PHYSMEM_ADDR_SIZE is the size of the physical address space on
     52 * a given processor.
     53 */
     54#if defined (US)
     55    #define PHYSMEM_ADDR_SIZE   41
     56#elif defined (US3)
     57    #define PHYSMEM_ADDR_SIZE   43
     58#endif
    4859
    4960/*
     
    6879        andn %o0, %l0, %l6                      ! l6 <= start of physical memory
    6980
    70         ! Get bits 40:13 of physmem_base.
     81        ! Get bits (PHYSMEM_ADDR_SIZE - 1):13 of physmem_base.
    7182        srlx %l6, 13, %l5
    72         sllx %l5, 13 + (63 - 40), %l5
    73         srlx %l5, 63 - 40, %l5                  ! l5 <= physmem_base[40:13]
     83       
     84        ! l5 <= physmem_base[(PHYSMEM_ADDR_SIZE - 1):13]
     85        sllx %l5, 13 + (63 - (PHYSMEM_ADDR_SIZE - 1)), %l5
     86        srlx %l5, 63 - (PHYSMEM_ADDR_SIZE - 1), %l5     
    7487       
    7588        /*
     
    8497        wrpr %g0, NWINDOWS - 1, %cleanwin       ! prevent needless clean_window
    8598                                                ! traps for kernel
     99                                               
     100        wrpr %g0, 0, %wstate                    ! use default spill/fill trap
    86101
    87102        wrpr %g0, 0, %tl                        ! TL = 0, primary context
     
    245260        /*
    246261         * Precompute kernel 8K TLB data template.
    247          * %l5 contains starting physical address bits [40:13]
     262         * %l5 contains starting physical address
     263         * bits [(PHYSMEM_ADDR_SIZE - 1):13]
    248264         */
    249265        sethi %hi(kernel_8k_tlb_data_template), %l4
     
    283299
    284300
     3011:
     302#ifdef CONFIG_SMP
     303        /*
     304         * Determine the width of the MID and save its mask to %g3. The width
     305         * is
     306         *      * 5 for US and US-IIIi,
     307         *      * 10 for US3 except US-IIIi.
     308         */
     309#if defined(US)
     310        mov 0x1f, %g3
     311#elif defined(US3)
     312        mov 0x3ff, %g3
     313        rdpr %ver, %g2
     314        sllx %g2, 16, %g2
     315        srlx %g2, 48, %g2
     316        cmp %g2, IMPL_ULTRASPARCIII_I
     317        move %xcc, 0x1f, %g3
     318#endif
     319
    285320        /*
    286321         * Read MID from the processor.
    287322         */
    288 1:
    289         ldxa [%g0] ASI_UPA_CONFIG, %g1
    290         srlx %g1, UPA_CONFIG_MID_SHIFT, %g1
    291         and %g1, UPA_CONFIG_MID_MASK, %g1
    292 
    293 #ifdef CONFIG_SMP
     323        ldxa [%g0] ASI_ICBUS_CONFIG, %g1
     324        srlx %g1, ICBUS_CONFIG_MID_SHIFT, %g1
     325        and %g1, %g3, %g1
     326
    294327        /*
    295328         * Active loop for APs until the BSP picks them up. A processor cannot
Note: See TracChangeset for help on using the changeset viewer.