Changeset bcc223b2 in mainline


Ignore:
Timestamp:
2006-03-07T09:15:25Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d6b42a7
Parents:
5eb84ab
Message:

flush caches

Location:
arch/ppc32/loader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • arch/ppc32/loader/asm.S

    r5eb84ab rbcc223b2  
    2929#include "regname.h"
    3030#include "spr.h"
     31
     32.data
     33
     34flush_buffer:
     35        .space 4
    3136
    3237.text
     
    145150        b halt
    146151
     152flush_instruction_cache:
     153
     154        # Flush data cache
     155       
     156        lis r3, flush_buffer@h
     157        ori r3, r3, flush_buffer@l
     158        li r4, L1_CACHE_LINES
     159        mtctr r4
     160       
     161        0:
     162       
     163        lwz r4, 0(r3)
     164        addi r3, r3, L1_CACHE_BYTES
     165        bdnz 0b
     166       
     167        # Invalidate instruction cache
     168       
     169        li r3, 0
     170        ori     r3, r3, (HID0_ICE | HID0_DCE | HID0_ICFI | HID0_DCI)
     171        mfspr r4, SPRN_HID0
     172        or r5, r4, r3
     173        isync
     174        mtspr SPRN_HID0, r5
     175        sync
     176        isync
     177       
     178        # Enable instruction cache
     179       
     180        ori     r5, r4, HID0_ICE
     181        mtspr SPRN_HID0, r5
     182        sync
     183        isync
     184        blr
     185
    147186jump_to_kernel:
    148187        mfmsr r4
     
    150189        mtspr SPRN_SRR0, r3
    151190        mtspr SPRN_SRR1, r4
    152         sync
    153         RFI
     191        bl flush_instruction_cache
     192        rfi
  • arch/ppc32/loader/spr.h

    r5eb84ab rbcc223b2  
    3030#define __SPR_H__
    3131
    32 #define MSR_DR (1<<27)
    33 #define MSR_IR (1<<26)
     32#define MSR_DR (1 << 27)
     33#define MSR_IR (1 << 26)
    3434
    3535#define SPRN_SRR0  0x1a
    3636#define SPRN_SRR1  0x1b
     37#define SPRN_HID0  0x3f0
    3738
    38 /* Works for PPC32 */
    39 #define L1_CACHE_BYTES (1 << 5)
     39#define HID0_ICE  (1 << 15)
     40#define HID0_DCE  (1 << 14)
     41#define HID0_ICFI (1 << 11)
     42#define HID0_DCI  (1 << 10)
     43
     44#define L1_CACHE_LINES (128 * 8)
     45#define L1_CACHE_BYTES 5
    4046
    4147#endif
Note: See TracChangeset for help on using the changeset viewer.