• Viresh Kumar's avatar
    dmaengine/amba-pl08x: max_bytes_per_lli is TRANSFER_SIZE * src_width (not MIN(width)) · fa6a940b
    Viresh Kumar authored
    max_bytes_per_lli = bd.srcbus.buswidth * PL080_CONTROL_TRANSFER_SIZE_MASK;
    This is confirmed by ARM support guys.
    
    Below is summary of mail exchange with them:
    
    [Viresh] What is the total data to be transferred in case source and destination
    bus widths are different. Suppose, source bus width is 2 bytes and destination
    is 4 bytes. Now in order to transfer 80 bytes, what should be value of
    TransferSize field in control reg: 40? or 20?.
    
    [David from ARM] The value that is programmed into the TransferSize field should
    be the number of <SourceWidth> transfers needed to achieve the required data
    transfer.
    
    So, to transfer 80 bytes, with a Source Width of 2, the TransferSize field =
    should be programmed with:
    
            Total transfer size
            ------------------- = 40
              <source width>
    
    [Viresh] Will this change if source is 4 bytes and dest is 2?
    
    [David] Yes - the calculation then becomes:
    
            Total transfer size
            ------------------- =20
              <source width>
    
    Also, max_bytes_per_lli must be calculated after fixing src and dest widths not
    before that. So move this code to the correct place.
    
    This patch also removes max_bytes_per_lli from earlier print message, as till
    that point max_bytes_per_lli is unknown.
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
    Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
    fa6a940b
amba-pl08x.c 51.2 KB