--- zzzz-none-000/linux-2.6.19.2/arch/powerpc/kernel/head_64.S 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/arch/powerpc/kernel/head_64.S 2007-01-11 07:38:19.000000000 +0000 @@ -487,7 +487,7 @@ rlwimi r13,r12,16,0x20 mfcr r12 cmpwi r13,0x2c - beq do_stab_bolted_pSeries + beq .do_stab_bolted_pSeries mtcrf 0x80,r12 mfspr r12,SPRN_SPRG2 END_FTR_SECTION_IFCLR(CPU_FTR_SLB) @@ -600,7 +600,7 @@ STD_EXCEPTION_PSERIES(., performance_monitor) .align 7 -do_stab_bolted_pSeries: +_GLOBAL(do_stab_bolted_pSeries) mtcrf 0x80,r12 mfspr r12,SPRN_SPRG2 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) @@ -1046,7 +1046,7 @@ li r5,0 std r4,_DAR(r1) std r5,_DSISR(r1) - b handle_page_fault + b .handle_page_fault unrecov_user_slb: EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN) @@ -1174,13 +1174,12 @@ .globl fp_unavailable_common fp_unavailable_common: EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN) - bne 1f /* if from user, just load it up */ + bne .load_up_fpu /* if from user, just load it up */ bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD ENABLE_INTS bl .kernel_fp_unavailable_exception BUG_OPCODE -1: b .load_up_fpu .align 7 .globl altivec_unavailable_common @@ -1280,10 +1279,10 @@ std r4,_DSISR(r1) andis. r0,r4,0xa450 /* weird error? */ - bne- handle_page_fault /* if not, try to insert a HPTE */ + bne- .handle_page_fault /* if not, try to insert a HPTE */ BEGIN_FTR_SECTION andis. r0,r4,0x0020 /* Is it a segment table fault? */ - bne- do_ste_alloc /* If so handle it */ + bne- .do_ste_alloc /* If so handle it */ END_FTR_SECTION_IFCLR(CPU_FTR_SLB) /* @@ -1325,7 +1324,7 @@ * because ret_from_except_lite will check for and handle pending * interrupts if necessary. */ - beq 13f + beq .ret_from_except_lite /* For a hash failure, we don't bother re-enabling interrupts */ ble- 12f @@ -1347,14 +1346,14 @@ END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES) /* Here we have a page fault that hash_page can't handle. */ -handle_page_fault: +_GLOBAL(handle_page_fault) ENABLE_INTS 11: ld r4,_DAR(r1) ld r5,_DSISR(r1) addi r3,r1,STACK_FRAME_OVERHEAD bl .do_page_fault cmpdi r3,0 - beq+ 13f + beq+ .ret_from_except_lite bl .save_nvgprs mr r5,r3 addi r3,r1,STACK_FRAME_OVERHEAD @@ -1371,14 +1370,12 @@ bl .low_hash_fault b .ret_from_except -13: b .ret_from_except_lite - /* here we have a segment miss */ -do_ste_alloc: +_GLOBAL(do_ste_alloc) bl .ste_allocate /* try to insert stab entry */ cmpdi r3,0 - bne- handle_page_fault - b fast_exception_return + beq+ fast_exception_return + b .handle_page_fault /* * r13 points to the PACA, r9 contains the saved CR, @@ -1583,6 +1580,11 @@ li r0,0 stdu r0,-STACK_FRAME_OVERHEAD(r1) + LOAD_REG_IMMEDIATE(r3,cpu_specs) + LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) + li r5,0 + bl .identify_cpu + LOAD_REG_IMMEDIATE(r2,__toc_start) addi r2,r2,0x4000 addi r2,r2,0x4000 @@ -1644,8 +1646,6 @@ cmpwi r0,0x3c /* 970FX */ beq 1f cmpwi r0,0x44 /* 970MP */ - beq 1f - cmpwi r0,0x45 /* 970GX */ bne 2f 1: bl .__cpu_preinit_ppc970 2: @@ -1964,6 +1964,13 @@ addi r2,r2,0x4000 add r2,r2,r26 + LOAD_REG_IMMEDIATE(r3, cpu_specs) + add r3,r3,r26 + LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) + add r4,r4,r26 + mr r5,r26 + bl .identify_cpu + /* Do very early kernel initializations, including initial hash table, * stab and slb setup before we turn on relocation. */ @@ -1993,6 +2000,13 @@ li r0,0 stdu r0,-STACK_FRAME_OVERHEAD(r1) + /* Apply the CPUs-specific fixups (nop out sections not relevant + * to this CPU + */ + li r3,0 + bl .do_cpu_ftr_fixups + bl .do_fw_ftr_fixups + /* ptr to current */ LOAD_REG_IMMEDIATE(r4, init_task) std r4,PACACURRENT(r13)