<meta http-equiv="Content-Type" content="text/html; charset=GB18030"><font size="4"><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" style=""><b>Dear friend,</b></font><br style="  ;; display: block; width: 705px; height: 0px; margin: 0px; color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; "><br style="  ;; display: block; width: 705px; height: 0px; margin: 0px; color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; "><span style="font-weight: bold; color: rgb(51, 51, 51);">Good day.</span><br style="  ;; display: block; width: 705px; height: 0px; margin: 0px; color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; "><br style="  ;; display: block; width: 705px; height: 0px; margin: 0px; color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; "><span style="font-weight: bold; color: rgb(51, 51, 51);">This is jason from china.I am the os developer of powepc 7448 board.  </span><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" style="font-weight: bold;">Recently, I encountered a problem during development. I enabled L1 DCache during kernel startup. The code is as follows</font><span style="font-weight: bold; color: rgb(51, 51, 51);">:</span></font><div><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><font size="4"><b>     mfspr   <span class="m" style="color: rgb(0, 0, 221);">8</span><span class="p">,</span> <span class="mh" style="color: rgb(0, 0, 221);">0x3f0</span>      <span class="o">/*</span> HID0 <span class="o">*/</span>
</b></font></pre></div><div><span class="o"><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><font size="4"><b>      ori     <span class="m" style="color: rgb(0, 0, 221);">8</span><span class="p">,</span> <span class="m" style="color: rgb(0, 0, 221);">8</span><span class="p">,</span> <span class="p">(</span><span class="m" style="color: rgb(0, 0, 221);">1</span><span class="o"><<</span><span class="m" style="color: rgb(0, 0, 221);">14</span><span class="p">)</span><span class="o">|</span><span class="p">(</span><span class="m" style="color: rgb(0, 0, 221);">1</span><span class="o"><<</span><span class="m" style="color: rgb(0, 0, 221);">10</span><span class="p">)</span>      <span class="o">/*</span> HID0_DCE<span class="o">|</span>HID0_DCFI<span class="o">*/</span>
        mtspr   <span class="mh" style="color: rgb(0, 0, 221);">0x3f0</span><span class="p">,</span> <span class="m" style="color: rgb(0, 0, 221);">8</span>      <span class="o">/*</span> HID0 <span class="o">*/</span>
        isync</b></font></pre></span></div><div><div><font size="4"><b><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma"> During the startup of my OS code, I first initialize the interrupt vector table, then set the page table to adopt the method of segment mapping (without bat mapping), and finally enable L1 Icache and L1 DCache(I don't enable L2 Cache).</font><span style=" color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; ">After</span><span style=" color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; "> </span><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">Enable L1 DCache  The following happened:</font></b></font></div><div><font size="4"><b><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">1:</font><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">The exception deliberately created by the software cannot enter normally, software instruction jump  or print  </font><span style=" color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; ">at the entry of the exception vector table get </span><span style="color: rgb(51, 51, 51);">no effect, and the clock interrupt cannot be triggered normally.</span></b></font></div><div><font size="4"><b><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">2:</font><span style="color: rgb(51, 51, 51);">Function calls and programs are executed normally, and the execution speed of test dead loop is increased by 20 ~ 60 times</span></b></font></div><div><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" size="4"><b>3:The software instruction can jump to the exception vector table, and the contents of the exception vector table can be read normally</b></font></div><div><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" size="4"><b>4:After DCache is enabled for a while  i disable it, the system works normally</b></font></div><div><br></div></div><div><font size="4"><b><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">I tried to do this</font><span style=" color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; ">:</span></b></font></div><div><font size="4"><b><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">1.</font><span style="color: rgb(51, 51, 51);">Refresh the cache before and after starting the cache. L1 L2 cache is invalid and has no effect</span></b></font></div><div><font size="4"><b><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">2.</font><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">The exception vector table uses a high address space and has no effect</font></b></font></div><div><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" size="4"><b>3.Turn on the hid0 SPD bit, that is, turn off the cache prediction function, which has no effect</b></font></div><div><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" size="4"><b>4.Configuring the first 16K separately, that is, adding cache and guard attributes to the MMU mapping attribute of the exception vector table, has no effect</b></font></div><div><font size="4"><b><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">5.</font><span style="color: rgb(51, 51, 51);">Simply configure l2cr and enable L2 cache (no other L2 related registers are configured), which has no effect</span></b></font></div><div><font size="4"><b><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">6.</font><span style="color: rgb(51, 51, 51);">Restoring hid0 to the reset value during system initialization has no effect</span></b></font></div><div><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" size="4"><div style=""><b>7.Replace the system load address to 0x30000 which has no effect</b></div></font></div><div><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" size="4"><b>8.Try to use the dcache enable code  of uboot, VX and Linux to enable dcache, but there is no effect</b></font></div><div><br></div><div><div><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" size="4"><b>My question is below:</b></font></div><div><font size="4"><b><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma">1.whether L1 </font><span style=" color: rgb(51, 51, 51) ; ; ; ; ; ; ; ">DCache can open before data mmu enable ?</span></b></font></div><div><span style=" color: rgb(51, 51, 51) ; ; ; ; ; ; ; "><font size="4"><b>2.is there something must to do before openning  L1 DCache </b></font></span></div><div><span style=" color: rgb(51, 51, 51) ; ; ; ; ; ; ; "><font size="4"><b>3.the possible reason which lead to the exception  handle abnormally when openning HID0 dCache</b></font></span></div><div><br></div><div><font color="#333333" face="PingFang SC, Lantinghei SC, Microsoft YaHei, arial, 宋体, sans-serif, tahoma" size="4"><b>I found out from the Linux community that you have some experience in this field before. I hope you can give me some advices.</b></font></div><div><br></div></div><div><font size="4"><b><span style="color: rgb(51, 51, 51);">Thanks & Best Regards,</span><br style="  ;; display: block; width: 705px; height: 0px; margin: 0px; color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; "><br style="  ;; display: block; width: 705px; height: 0px; margin: 0px; color: rgb(51, 51, 51) ; ; ; ; ; ; ; ; "><span style="color: rgb(51, 51, 51);">jason</span></b></font></div>