• Stephan Gerhold's avatar
    dmaengine: qcom: bam_dma: allow omitting num-{channels,ees} · 8975dd41
    Stephan Gerhold authored
    The bam_dma driver needs to know the number of channels and execution
    environments (EEs) at probe time. If we are in full control of the BAM
    controller this information can be obtained from the BAM identification
    registers (BAM_REVISION/BAM_NUM_PIPES).
    
    When the BAM is "controlled remotely" it is more complicated. The BAM
    might not be on at probe time, so reading the registers could fail.
    This is why the information must be added to the device tree in this
    case, using "num-channels" and "qcom,num-ees".
    
    However, there are also some BAM instances that are initialized by
    something else but we still have a clock that allows to turn it on when
    needed. This can be set up in the DT with "qcom,controlled-remotely"
    and "clocks" and is already supported by the bam_dma driver. Examples
    for this are the typical BLSP BAM instances on older SoCs, QPIC BAM
    (for NAND) and the crypto BAM on some SoCs.
    
    In this case, there is no need to read "num-channels" and
    "qcom,num-ees" from the DT. The BAN can be turned on using the clock
    so we can just read it from the BAM registers like in the normal case.
    
    Check for the BAM clock earlier and skip reading "num-channels" and
    "qcom,num-ees" if it is present to allow simplifying the DT description
    a bit.
    Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
    Reviewed-by: default avatarBhupesh Sharma <bhupesh.sharma@linaro.org>
    Link: https://lore.kernel.org/r/20230518-bamclk-dt-v2-1-a1a857b966ca@gerhold.netSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    8975dd41
bam_dma.c 39.6 KB