Skip to content

Conversation

@nopjne
Copy link

@nopjne nopjne commented Oct 21, 2024

This change adds code to be able to open DOM2 space as a regular file handle.

Copy link
Collaborator

@rasky rasky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong, seems like you haven't updated this code.

return NULL;
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants