Hello alexander,
thank you for your answer.
I took your advice and I'm now trying to fully understand the MMU configuration.
I believe to successfully access memory from core1 I need to add the correct TLB entry.
Lets assume I want to access the first 1GiB of memory from core1. Since the TLB entry for that memory region in core0 doesn't feature memory coherency be default, I took the liberty and set MAS2_M while TLB configuration of U-Boot.
For core1 I figured I had to put the same entry into the TLB, so I basically copied the TLB configuration of that entry (just changed the access codes). I'm basically using the following code to set it:
int main()
{
write_tlb_entry(0x10070000, 0xc0000a00, 0x4, 0x3f, 0);
}
void write_tlb_entry(int mas0, int mas1, int mas2, int mas3, int mas7)
{
asm volatile(
"mtspr %0,%6;"
"mtspr %1,%7;"
"mtspr %2,%8;"
"mtspr %3,%9;"
"mtspr %4,%10;"
"li 3,0;"
"mtspr %5,3;"
"isync;"
"tlbwe;"
"msync;"
"isync" : : "i"(MAS0), "i"(MAS1), "i"(MAS2), "i"(MAS3), "i"(MAS7), "i"(MAS8),
"r"(mas0), "r"(mas1), "r"(mas2), "r"(mas3), "r"(mas7));
}
Unfortunately I'm stuck with a TLB Error Interrupt every time I try to set the entry.
Maybe you can help me to figure out what I'm missing.
Best regards,
Mirko