mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-28 01:51:33 +00:00
Merge branch 'master' of git://git.denx.de/u-boot-mpc85xx
This commit is contained in:
commit
2bcbd429f4
1 changed files with 22 additions and 6 deletions
|
@ -110,15 +110,31 @@ void init_tlbs(void)
|
||||||
void init_addr_map(void)
|
void init_addr_map(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
unsigned int max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xff;
|
||||||
|
|
||||||
for (i = 0; i < num_tlb_entries; i++) {
|
/* walk all the entries */
|
||||||
if (tlb_table[i].tlb == 0)
|
for (i = 0; i < max_cam; i++) {
|
||||||
|
unsigned long epn;
|
||||||
|
u32 tsize, _mas1;
|
||||||
|
phys_addr_t rpn;
|
||||||
|
|
||||||
|
mtspr(MAS0, FSL_BOOKE_MAS0(1, i, 0));
|
||||||
|
|
||||||
|
asm volatile("tlbre;isync");
|
||||||
|
_mas1 = mfspr(MAS1);
|
||||||
|
|
||||||
|
/* if the entry isn't valid skip it */
|
||||||
|
if (!(_mas1 & MAS1_VALID))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
addrmap_set_entry(tlb_table[i].epn,
|
tsize = (_mas1 >> 8) & 0xf;
|
||||||
tlb_table[i].rpn,
|
epn = mfspr(MAS2) & MAS2_EPN;
|
||||||
(1UL << ((tlb_table[i].tsize * 2) + 10)),
|
rpn = mfspr(MAS3) & MAS3_RPN;
|
||||||
tlb_table[i].esel);
|
#ifdef CONFIG_ENABLE_36BIT_PHYS
|
||||||
|
rpn |= ((phys_addr_t)mfspr(MAS7)) << 32;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
addrmap_set_entry(epn, rpn, (1UL << ((tsize * 2) + 10)), i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ;
|
return ;
|
||||||
|
|
Loading…
Add table
Reference in a new issue