Branch: refs/heads/master Home: https://github.com/OpenAMP/libmetal Commit: 73f746ecf6d384ea328632a31e7f2982e343ebc8 https://github.com/OpenAMP/libmetal/commit/73f746ecf6d384ea328632a31e7f2982e... Author: Leo Sartre sartre.l@ecagroup.com Date: 2020-12-15 (Tue, 15 Dec 2020)
Changed paths: M lib/system/linux/device.c
Log Message: ----------- lib/system/linux: pass correct offset to metal_map()
According to UIO documentation, the offset device tree property purpose is to be used "if the device’s memory is not page aligned". Quoting the same documentation: "To map the memory of mapping N, you have to use N times the page size as your offset" So wee need to pass i * getpagesize() to get the correct mapping, otherwise, we end up with all io_region pointing to the same area.
Signed-off-by: Leo Sartre sartre.l@ecagroup.com
Commit: f52728d078578cb985940c9e6a7f247fa1baa8d1 https://github.com/OpenAMP/libmetal/commit/f52728d078578cb985940c9e6a7f247fa... Author: Leo Sartre sartre.l@ecagroup.com Date: 2020-12-15 (Tue, 15 Dec 2020)
Changed paths: M README.md
Log Message: ----------- README.md: note about non page aligned devices on Linux
According to the Linux kernel UIO documentation, access to device's memory that is not page aligned requires to add the proper offset to the pointer returned by mmap() that is stored into the 'virt' field of the metal_io_region structure. Document this limitation until this offset is handled properly by the library.
Signed-off-by: Leo Sartre sartre.l@ecagroup.com
Compare: https://github.com/OpenAMP/libmetal/compare/9c807f04e779...f52728d07857