Write to physical flash memory when remapped

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to physical flash memory when remapped

Jump to solution
250 Views
mathias_edman
Contributor III

Hi,

I use MPC5644A.

I wonder if it is possible to write to a flash location that has been remapped to a virtual address using TLB.

So for example:

Physical address 0x0000-0x1000 is remapped to virtual address 0x8000-0x9000. Is it then still possible to write to physical flash memory 0x0000 ?

Regards,

Mathias

0 Kudos
1 Solution
161 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

we are allowed to access only an address range which is covered by MMU. Otherwise an exception TLB Miss is triggered.

Each core access (I do not consider debug features) uses virtual address. It doesn't matter if virtual address and physical address is identical or if there's some translation.

If you want to access the same physical address using two virtual addresses, it can be done but you need to have two TLBs.

First TLB will be configured in this way: physical address 0x0000-0x1000, virtual address 0x0000-0x1000

Second TLB: physical address 0x0000-0x1000, virtual address 0x8000-0x9000

"My assumption is that the flash driver cannot handle virtual address space, and that only real physical address should be used."

SSD flash drivers expect that physical and virtual address is identical because it checks addresses, blocks and so on... That means you should really have two TLBs as mentioned above and use 'physical' address for programming.

Regards,

Lukas

View solution in original post

4 Replies
161 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

yes but there should be two TLBs - one covering virtual address 0x0000-0x1000 and second covering virtual address 0x8000-0x9000 while both are translating the address to physical address 0x0000-0x1000.

In other words, two TLBs with different virtual address range can point to the same physical address range. It doesn't work in opposite direction, of course.

Regards,

Lukas

0 Kudos
161 Views
mathias_edman
Contributor III

Hi again,

Thanks for answer, but I am not sure I understand.

If I have remapped the physical memory 0x0000-0x1000 to virtual address 0x8000-0x9000, then as far as I understand I cannot write anything to the address range 0x0000-0x1000 any longer. You are saying that creating another TBL originating from the same physical memory will help my cause?

My scenario is to install new software to a physical address in flash that has been remapped to a virtual address at another location. My assumption is that the flash driver cannot handle virtual address space, and that only real physical address should be used.

Mathias

0 Kudos
162 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

we are allowed to access only an address range which is covered by MMU. Otherwise an exception TLB Miss is triggered.

Each core access (I do not consider debug features) uses virtual address. It doesn't matter if virtual address and physical address is identical or if there's some translation.

If you want to access the same physical address using two virtual addresses, it can be done but you need to have two TLBs.

First TLB will be configured in this way: physical address 0x0000-0x1000, virtual address 0x0000-0x1000

Second TLB: physical address 0x0000-0x1000, virtual address 0x8000-0x9000

"My assumption is that the flash driver cannot handle virtual address space, and that only real physical address should be used."

SSD flash drivers expect that physical and virtual address is identical because it checks addresses, blocks and so on... That means you should really have two TLBs as mentioned above and use 'physical' address for programming.

Regards,

Lukas

View solution in original post

161 Views
mathias_edman
Contributor III

Crystal clear now, thanks!

0 Kudos