[PATCH v7 0/9] Fix broken DMAFLUSHP on Rockchips platform
From: Caesar Wang <hidden>
Date: 2016-01-22 11:07:51
This series patches are apply on linus master branch. Okay, this series patches verified on my github. (https://github.com/Caesar-github/rockchip/commits/for-dma-tests) Linux version 4.4.0+ (wxt at ubuntu) (Ubuntu/Linaro 4.7.3-12ubuntu1) ) #14 SMP Fri Jan 22 18:13:12 CST 2016 The perious version 6 from Shawn. (http://www.spinics.net/lists/dmaengine/msg06606.html) I pick them up to go on upstream since Shawn hasn't much time to track them. ---- The purpose of the DMAFLUSHP instruction: - Tell the peripheral to clear its status and control registers. - Send a message to the peripheral to resend its level status. There are 3 timings described in PL330 Technical Reference Manual: - Timing 1: Burst request, can work well without DMAFLUSHP. - Timing 2: Single and burst request, DMAC will ignore the single transfer request. This timing happens if there are single and burst request. - Timing 3: Single transfers for a burst request, DMAC should signals datype to request the peripheral to flush the contents of any control registers. This timing happens if there is not enough MFIFO to places the burst data. A peripheral may signal a DMA request during the execution of DMAFLUSHP instruction, that cause DMA request being ignored by DMAC. But DMAC and all peripherals on RK3X SoCs DO NOT support DMAFLUSHP. It can't send a message to the peripheral to resend DMA request, and the peripheral can't acknowledge a flush request from DMAC. So all DMA requests should NOT be ignored by DMAC, and DMAC will not notify the peripheral to flush. To fix this problem, we need: - Do NOT execute DMAFLUSHP instruction. - Timing 2 and timing 3 should not happen. Because on RK3X SoCs, there are 6 or below channels and 32 MFIFO depth