TLB not working

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

TLB not working

1,738 次查看
mathias_edman
Contributor III

Hi,

I am playing around with TLB for MPC5777C. Booting from internal flash it looks like this:

Capture.PNG

So I remapped the TLB entry 1 by doing this:

e_lis r3, 0x1001
 mtspr 624, r3
e_lis r4, 0xC000
 e_or2i r4, 0x0400
 mtspr 625, r4
e_lis r5, 0x0080
 e_or2i r5, 0x0020
 mtspr 626, r5
e_lis r6,0x0080
 e_or2i r6, 0x003f
 mtspr 627, r6
tlbwe‍‍‍‍‍‍‍‍‍‍‍‍

This is all fine and I now have 256Kb of mapped virtual memory located at 0x00800000 to real memory at the same address. So in flash I only see this part of memory after the tlbwe instruction has been executed.

However, now I want to create a new TLB entry (5) so I did this:

e_lis r3, 0x1005
 mtspr 624, r3
e_lis r4, 0xC000
 e_or2i r4, 0x0400
 mtspr 625, r4
e_lis r5, 0x00C0
 e_or2i r5, 0x0020
 mtspr 626, r5
e_lis r6,0x00C0
 e_or2i r6, 0x003f
 mtspr 627, r6
tlbwe‍‍‍‍‍‍‍‍‍‍‍‍

Using my simple brain this should make the range 0x00C00000-0x00C3FFFF available as well but nothing is happening and I have tried with many different addresses. What am I doing wrong here?

Regards,

Mathias 

标记 (2)
0 项奖励
回复
3 回复数

1,579 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

If you are using the same startup as me, then it uses portion of cache for stack and it occupies TLB5:

pastedImage_4.png

I would recommend to show MMU table by the debugger to check what is real configuration  during runtime.

0 项奖励
回复

1,579 次查看
mathias_edman
Contributor III

Hi David,

Thanks again for helping me.

After more investigation I found that this has something to do with the fact that I am "debug stepping" through the instruction tlbwe. When I do this it does not seem to work.

However, if I am just running to a breakpoint below the function that is executing tlbwe instruction (or just below the instruction itself) then it always works.

I feel very confused about this. Perhaps you can try?

I would love to see the MMU table but I do not know if I can do this with my crappy debugger (not using Lauterbach unfortunately).

Regards,

Mathias

0 项奖励
回复

1,579 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Even simple debuggers should be able to show MMU table, for instance PeMicro debugger presents it this way.

pastedImage_11.gif

0 项奖励
回复