Allow pifiles to be writable in the DOM2 area#631
Allow pifiles to be writable in the DOM2 area#631nopjne wants to merge 2 commits intoDragonMinded:unstablefrom
Conversation
rasky
left a comment
There was a problem hiding this comment.
Thanks! Unfortunately I don't trust dma_write_raw_async especially for misaligned writes because I have not verified it on hardware and also Ares doesn't implement it.
If you want to push this forward, we need a test that performs DMA in a R/W area (eg: SRAM) for writing, and the performs a series of writes + reads + tests at different addresses, different sizes, and different length. Check test_dma_read_misalign, we would need something similar for DMA writes.
| data_cache_hit_writeback_invalidate(tmp, n); | ||
| dma_write_raw_async(tmp, f->base + f->ptr, n); | ||
| dma_wait(); | ||
| memcpy(buf, tmp, n); |
There was a problem hiding this comment.
This seems wrong, seems like you haven't updated this code.
| return NULL; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
I don't think we need this at this level. In general any device can expose any writeable area at any PI address, so I wouldn't hardcode the range. Eg: many flashcarts allow to write the internal SDRAM by writing at 0x10000000, maybe after enabling writes with some register.
So I would just remove the check and let the user know what they are doing.
This change adds code to be able to open DOM2 space as a regular file handle.