Changeset bfde536e in rtems


Ignore:
Timestamp:
Jan 9, 2013, 10:12:48 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
339646e
Parents:
5828127
git-author:
Sebastian Huber <sebastian.huber@…> (01/09/13 10:12:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/09/13 15:45:25)
Message:

bsp/gen83xx: Invalidate caches only if disabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/gen83xx/startup/cpuinit.c

    r5828127 rbfde536e  
    142142  BAT dbat, ibat;
    143143  uint32_t msr;
     144  uint32_t hid0;
    144145
    145146  /* Clear MMU and segment registers */
     
    147148
    148149  /* Clear caches */
    149   PPC_CLEAR_SPECIAL_PURPOSE_REGISTER_BITS( HID0, HID0_ILOCK | HID0_DLOCK | HID0_ICE | HID0_DCE);
    150   PPC_SET_SPECIAL_PURPOSE_REGISTER_BITS( HID0, HID0_ICFI | HID0_DCI);
    151   PPC_CLEAR_SPECIAL_PURPOSE_REGISTER_BITS( HID0, HID0_ICFI | HID0_DCI);
     150  hid0 = PPC_SPECIAL_PURPOSE_REGISTER(HID0);
     151  if ((hid0 & (HID0_ICE | HID0_DCE)) == 0) {
     152    hid0 &= ~(HID0_ILOCK | HID0_DLOCK | HID0_ICE | HID0_DCE);
     153    PPC_SET_SPECIAL_PURPOSE_REGISTER(HID0, hid0);
     154    hid0 |= HID0_ICFI | HID0_DCI;
     155    PPC_SET_SPECIAL_PURPOSE_REGISTER(HID0, hid0);
     156    hid0 &= ~(HID0_ICFI | HID0_DCI);
     157    PPC_SET_SPECIAL_PURPOSE_REGISTER(HID0, hid0);
     158  }
    152159
    153160  /*
Note: See TracChangeset for help on using the changeset viewer.