Each segment can be up to 4096 bytes in chain structure according to the
RK3399 TRM Part 2.
Set the buffers in full ring where the last one point to the first one.
Correctly reports the MMC_IVAR_MAX_DATA.
Use CACHE_LINE_SIZE for bus_dma alignment.
Details
- Reviewers
br - Group Reviewers
ARM arm64 - Commits
- rS358635: dwmmc: Rework the DMA engine
Tested on rock64 (RK3328) and rockpro64 (RK3399)
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/dev/mmc/host/dwmmc.c | ||
---|---|---|
122 ↗ | (On Diff #68992) | The linux driver uses 4096 for this value. Maybe there are other (non-rockchip) implementations that limit it to 4k? Or, maybe the limit is 8K when des2/des3 both point to buffers, or 4k when DES0_CH is set and des3 points to the chained descriptor? |
173 ↗ | (On Diff #68992) | I think ER should not be set here, it should only be set on the last one in the ring which points back to the start. |
sys/dev/mmc/host/dwmmc.c | ||
---|---|---|
122 ↗ | (On Diff #68992) | According to file:///usr/home/manu/Work/Datasheet/SoC/Rockchip%20RK3399%20TRM%20V1.3%20Part2.pdf DES1 Buffer 1 Size can go up to this value but maybe there is a non rockchip soc that have a different value yes. |
@br why 4096 was used for aligment ?
Do you have any platform that strictly require this ?
Could you test if using CACHE_LINE_SIZE works for you ?
Thanks