Re: [PATCH] dmaengine: qcom: Add ADM driver

From: Jonathan McDowell
Date: Fri Sep 18 2020 - 14:39:31 EST


On Fri, Sep 18, 2020 at 05:04:43PM +0530, Vinod Koul wrote:
> Hello Jonathan
>
> On 16-09-20, 07:43, Jonathan McDowell wrote:
> > From: Andy Gross <agross@xxxxxxxxxxxxxx>
> >
> > (I'm not sure how best to attribute this. It's originally from Andy
> > Gross, the version I picked up was a later version from Thomas Pedersen,
> > and I can't find clear indication of why the latest version wasn't
> > applied. The device tree details were added back in September 2014. The
> > driver is the missing piece in mainline for IPQ8064 NAND support and
> > I've been using it successfully with my RB3011 device on 5.8+)
>
> Yeah not sure why the driver was missed :(
> Btw this note is helpful but not great for log, you should add it after
> sob lines.

Noted, I'll move it for v2.

> > diff --git a/drivers/dma/qcom/Kconfig b/drivers/dma/qcom/Kconfig
> > index 3bcb689162c6..75ee112ccea9 100644
> > --- a/drivers/dma/qcom/Kconfig
> > +++ b/drivers/dma/qcom/Kconfig
> > @@ -28,3 +28,13 @@ config QCOM_HIDMA
> > (user to kernel, kernel to kernel, etc.). It only supports
> > memcpy interface. The core is not intended for general
> > purpose slave DMA.
> > +
> > +config QCOM_ADM
>
> alphabetical sort please

Ok.

> > + tristate "Qualcomm ADM support"
> > + depends on ARCH_QCOM || (COMPILE_TEST && OF && ARM)
>
> Why COMPILE_TEST && OF? just COMPILE_TEST should be fine

Turns out (ARCH_QCOM || COMPILE_TEST) && !64BIT is sufficient.

> > + select DMA_ENGINE
> > + select DMA_VIRTUAL_CHANNELS
> > + ---help---
> > + Enable support for the Qualcomm ADM DMA controller. This controller
> > + provides DMA capabilities for both general purpose and on-chip
> > + peripheral devices.
> > diff --git a/drivers/dma/qcom/Makefile b/drivers/dma/qcom/Makefile
> > index 1ae92da88b0c..98a021fc6fe5 100644
> > --- a/drivers/dma/qcom/Makefile
> > +++ b/drivers/dma/qcom/Makefile
> > @@ -4,3 +4,4 @@ obj-$(CONFIG_QCOM_HIDMA_MGMT) += hdma_mgmt.o
> > hdma_mgmt-objs := hidma_mgmt.o hidma_mgmt_sys.o
> > obj-$(CONFIG_QCOM_HIDMA) += hdma.o
> > hdma-objs := hidma_ll.o hidma.o hidma_dbg.o
> > +obj-$(CONFIG_QCOM_ADM) += qcom_adm.o
>
> alphabetical sort please

Ok.

> > +/* channel conf */
> > +#define ADM_CH_CONF_SHADOW_EN BIT(12)
> > +#define ADM_CH_CONF_MPU_DISABLE BIT(11)
> > +#define ADM_CH_CONF_PERM_MPU_CONF BIT(9)
> > +#define ADM_CH_CONF_FORCE_RSLT_EN BIT(7)
> > +#define ADM_CH_CONF_SEC_DOMAIN(ee) (((ee & 0x3) << 4) | ((ee & 0x4) << 11))
>
> USE FIELD_PREP for this?

I can't see a way to neatly use FIELD_PREP for a split field; am I
missing something?

(other pieces fixed up for v2 as well; I'd run checkpatch but not with
--strict. Will post once I've actually tested it.)

J.

--
Minorities are the foundation of | .''`. Debian GNU/Linux Developer
society. | : :' : Happy to accept PGP signed
| `. `' or encrypted mail - RSA
| `- key on the keyservers.