All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/9] Add MMC and DMA support for Actions S700
@ 2020-05-14 16:10 Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                   ` (8 more replies)
  0 siblings, 9 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam
  Cc: linux-actions, linux-arm-kernel, cristian.ciocaltea

This series(v1) have following changes from the previous series.

New patch(5/8) has been introduced that converts dma dt-binding
for Actions OWL SoC from text format to yaml file.

For patch(2/8) new accessor function is added to get the frame 
lenght which is common to both S900 and S700. Apart from it
SoC check is removed from irq routine as it is not needed.

Patch(4/8) which is an hack to prove our DMA and MMC works
for S700 is now sent as *do not merge* patch.
 
DMA is tested using dmatest with follwoing result:

root@ubuntu:~# echo dma0chan1 > /sys/module/dmatest/parameters/channel
root@ubuntu:~# echo 2000 > /sys/module/dmatest/parameters/timeout
root@ubuntu:~# echo 1 > /sys/module/dmatest/parameters/iterations
root@ubuntu:~# echo 1 > /sys/module/dmatest/parameters/run

root@ubuntu:~# dmesg | tail
[  303.362586] dmatest: Added 1 threads using dma0chan1
[  317.258658] dmatest: Started 1 threads using dma0chan1
[  317.259397] dmatest: dma0chan1-copy0: summary 1 tests, 0 failures 16129.03 iops 32258 KB/s (0)

----------------------------------------------------------------

The intention of previous series(RFC) is to enable uSD and DMA support for
Cubieboard7 based on Actions S700 SoC, and on the way we found that
it requires changes in dmaengine present on S700 as its different
from what is present on S900.

Patch(1/8) does provide a new way to describe DMA descriptor, idea is
to remove the bit-fields as its less maintainable. It is only build
tested and it would be great if this can be tested on S900 based
hardware.

Patch(2/8) adds S700 DMA engine support, there is new compatible
string added for it, which means a changed bindings needed to submitted
for this. I would plan to send it later the converted "owl-dma.yaml".

Patch(4/8) disables the sps node as its memory range is conflicting
pinctrl node and results in pinctrl proble failure.

Rest of patches in the series adds DMA/MMC nodes for S700
alone with binding constants and enables the uSD for Cubieboard7.

This whole series is tested, by building/compiling Kernel on
Cubieboard7-lite which was *almost* successful (OOM kicked in,
while Linking due to less RAM present on hardware).

Following is the mmc speed :

ubuntu@ubuntu:~$ sudo hdparm -tT /dev/mmcblk0

/dev/mmcblk0:
 Timing cached reads:   1310 MB in  2.00 seconds = 655.15 MB/sec
 Timing buffered disk reads:  62 MB in  3.05 seconds =  20.30 MB/sec

Amit Singh Tomar (9):
  dmaengine: Actions: get rid of bit fields from dma descriptor
  dmaengine: Actions: Add support for S700 DMA engine
  clk: actions: Add MMC clock-register reset bits
  arm64: dts: actions: do not merge disable sps node from S700
  dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
  arm64: dts: actions: Add DMA Controller for S700
  dt-bindings: reset: s700: Add binding constants for mmc
  arm64: dts: actions: Add MMC controller support for S700
  arm64: dts: actions: Add uSD support for Cubieboard7

 Documentation/devicetree/bindings/dma/owl-dma.txt  |  47 ---------
 Documentation/devicetree/bindings/dma/owl-dma.yaml |  84 +++++++++++++++
 arch/arm64/boot/dts/actions/s700-cubieboard7.dts   |  41 ++++++++
 arch/arm64/boot/dts/actions/s700.dtsi              |  48 +++++++++
 drivers/clk/actions/owl-s700.c                     |   3 +
 drivers/dma/owl-dma.c                              | 117 ++++++++++++---------
 include/dt-bindings/reset/actions,s700-reset.h     |   3 +
 7 files changed, 244 insertions(+), 99 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/dma/owl-dma.txt
 create mode 100644 Documentation/devicetree/bindings/dma/owl-dma.yaml

-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
  2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
@ 2020-05-14 16:10   ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, vkoul, afaerber, manivannan.sadhasivam
  Cc: dan.j.williams, cristian.ciocaltea, dmaengine, linux-arm-kernel,
	linux-actions

At the moment, Driver uses bit fields to describe registers of the DMA
descriptor structure that makes it less portable and maintainable, and
Andre suugested(and even sketched important bits for it) to make use of
array to describe this DMA descriptors instead. It gives the flexibility
while extending support for other platform such as Actions S700.

This commit removes the "owl_dma_lli_hw" (that includes bit-fields) and
uses array to describe DMA descriptor.

Suggested-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* No change from RFC.
---
 drivers/dma/owl-dma.c | 77 ++++++++++++++++++++++-----------------------------
 1 file changed, 33 insertions(+), 44 deletions(-)

diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c
index c683051257fd..b0d80a2fa383 100644
--- a/drivers/dma/owl-dma.c
+++ b/drivers/dma/owl-dma.c
@@ -120,30 +120,18 @@
 #define BIT_FIELD(val, width, shift, newshift)	\
 		((((val) >> (shift)) & ((BIT(width)) - 1)) << (newshift))
 
-/**
- * struct owl_dma_lli_hw - Hardware link list for dma transfer
- * @next_lli: physical address of the next link list
- * @saddr: source physical address
- * @daddr: destination physical address
- * @flen: frame length
- * @fcnt: frame count
- * @src_stride: source stride
- * @dst_stride: destination stride
- * @ctrla: dma_mode and linklist ctrl config
- * @ctrlb: interrupt config
- * @const_num: data for constant fill
- */
-struct owl_dma_lli_hw {
-	u32	next_lli;
-	u32	saddr;
-	u32	daddr;
-	u32	flen:20;
-	u32	fcnt:12;
-	u32	src_stride;
-	u32	dst_stride;
-	u32	ctrla;
-	u32	ctrlb;
-	u32	const_num;
+/* Describe DMA descriptor, hardware link list for dma transfer */
+enum owl_dmadesc_offsets {
+	OWL_DMADESC_NEXT_LLI = 0,
+	OWL_DMADESC_SADDR,
+	OWL_DMADESC_DADDR,
+	OWL_DMADESC_FLEN,
+	OWL_DMADESC_SRC_STRIDE,
+	OWL_DMADESC_DST_STRIDE,
+	OWL_DMADESC_CTRLA,
+	OWL_DMADESC_CTRLB,
+	OWL_DMADESC_CONST_NUM,
+	OWL_DMADESC_SIZE
 };
 
 /**
@@ -153,7 +141,7 @@ struct owl_dma_lli_hw {
  * @node: node for txd's lli_list
  */
 struct owl_dma_lli {
-	struct  owl_dma_lli_hw	hw;
+	u32			hw[OWL_DMADESC_SIZE];
 	dma_addr_t		phys;
 	struct list_head	node;
 };
@@ -351,8 +339,9 @@ static struct owl_dma_lli *owl_dma_add_lli(struct owl_dma_txd *txd,
 		list_add_tail(&next->node, &txd->lli_list);
 
 	if (prev) {
-		prev->hw.next_lli = next->phys;
-		prev->hw.ctrla |= llc_hw_ctrla(OWL_DMA_MODE_LME, 0);
+		prev->hw[OWL_DMADESC_NEXT_LLI] = next->phys;
+		prev->hw[OWL_DMADESC_CTRLA] |=
+					llc_hw_ctrla(OWL_DMA_MODE_LME, 0);
 	}
 
 	return next;
@@ -365,8 +354,7 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
 				  struct dma_slave_config *sconfig,
 				  bool is_cyclic)
 {
-	struct owl_dma_lli_hw *hw = &lli->hw;
-	u32 mode;
+	u32 mode, ctrlb;
 
 	mode = OWL_DMA_MODE_PW(0);
 
@@ -407,22 +395,22 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
 		return -EINVAL;
 	}
 
-	hw->next_lli = 0; /* One link list by default */
-	hw->saddr = src;
-	hw->daddr = dst;
-
-	hw->fcnt = 1; /* Frame count fixed as 1 */
-	hw->flen = len; /* Max frame length is 1MB */
-	hw->src_stride = 0;
-	hw->dst_stride = 0;
-	hw->ctrla = llc_hw_ctrla(mode,
-				 OWL_DMA_LLC_SAV_LOAD_NEXT |
-				 OWL_DMA_LLC_DAV_LOAD_NEXT);
+	lli->hw[OWL_DMADESC_CTRLA] = llc_hw_ctrla(mode,
+						  OWL_DMA_LLC_SAV_LOAD_NEXT |
+						  OWL_DMA_LLC_DAV_LOAD_NEXT);
 
 	if (is_cyclic)
-		hw->ctrlb = llc_hw_ctrlb(OWL_DMA_INTCTL_BLOCK);
+		ctrlb = llc_hw_ctrlb(OWL_DMA_INTCTL_BLOCK);
 	else
-		hw->ctrlb = llc_hw_ctrlb(OWL_DMA_INTCTL_SUPER_BLOCK);
+		ctrlb = llc_hw_ctrlb(OWL_DMA_INTCTL_SUPER_BLOCK);
+
+	lli->hw[OWL_DMADESC_NEXT_LLI] = 0;
+	lli->hw[OWL_DMADESC_SADDR] = src;
+	lli->hw[OWL_DMADESC_DADDR] = dst;
+	lli->hw[OWL_DMADESC_SRC_STRIDE] = 0;
+	lli->hw[OWL_DMADESC_DST_STRIDE] = 0;
+	lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
+	lli->hw[OWL_DMADESC_CTRLB] = ctrlb;
 
 	return 0;
 }
@@ -754,7 +742,8 @@ static u32 owl_dma_getbytes_chan(struct owl_dma_vchan *vchan)
 			/* Start from the next active node */
 			if (lli->phys == next_lli_phy) {
 				list_for_each_entry(lli, &txd->lli_list, node)
-					bytes += lli->hw.flen;
+					bytes += lli->hw[OWL_DMADESC_FLEN] &
+						 GENMASK(19, 0);
 				break;
 			}
 		}
@@ -785,7 +774,7 @@ static enum dma_status owl_dma_tx_status(struct dma_chan *chan,
 	if (vd) {
 		txd = to_owl_txd(&vd->tx);
 		list_for_each_entry(lli, &txd->lli_list, node)
-			bytes += lli->hw.flen;
+			bytes += lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
 	} else {
 		bytes = owl_dma_getbytes_chan(vchan);
 	}
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
@ 2020-05-14 16:10   ` Amit Singh Tomar
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, vkoul, afaerber, manivannan.sadhasivam
  Cc: dmaengine, dan.j.williams, linux-actions, linux-arm-kernel,
	cristian.ciocaltea

At the moment, Driver uses bit fields to describe registers of the DMA
descriptor structure that makes it less portable and maintainable, and
Andre suugested(and even sketched important bits for it) to make use of
array to describe this DMA descriptors instead. It gives the flexibility
while extending support for other platform such as Actions S700.

This commit removes the "owl_dma_lli_hw" (that includes bit-fields) and
uses array to describe DMA descriptor.

Suggested-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* No change from RFC.
---
 drivers/dma/owl-dma.c | 77 ++++++++++++++++++++++-----------------------------
 1 file changed, 33 insertions(+), 44 deletions(-)

diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c
index c683051257fd..b0d80a2fa383 100644
--- a/drivers/dma/owl-dma.c
+++ b/drivers/dma/owl-dma.c
@@ -120,30 +120,18 @@
 #define BIT_FIELD(val, width, shift, newshift)	\
 		((((val) >> (shift)) & ((BIT(width)) - 1)) << (newshift))
 
-/**
- * struct owl_dma_lli_hw - Hardware link list for dma transfer
- * @next_lli: physical address of the next link list
- * @saddr: source physical address
- * @daddr: destination physical address
- * @flen: frame length
- * @fcnt: frame count
- * @src_stride: source stride
- * @dst_stride: destination stride
- * @ctrla: dma_mode and linklist ctrl config
- * @ctrlb: interrupt config
- * @const_num: data for constant fill
- */
-struct owl_dma_lli_hw {
-	u32	next_lli;
-	u32	saddr;
-	u32	daddr;
-	u32	flen:20;
-	u32	fcnt:12;
-	u32	src_stride;
-	u32	dst_stride;
-	u32	ctrla;
-	u32	ctrlb;
-	u32	const_num;
+/* Describe DMA descriptor, hardware link list for dma transfer */
+enum owl_dmadesc_offsets {
+	OWL_DMADESC_NEXT_LLI = 0,
+	OWL_DMADESC_SADDR,
+	OWL_DMADESC_DADDR,
+	OWL_DMADESC_FLEN,
+	OWL_DMADESC_SRC_STRIDE,
+	OWL_DMADESC_DST_STRIDE,
+	OWL_DMADESC_CTRLA,
+	OWL_DMADESC_CTRLB,
+	OWL_DMADESC_CONST_NUM,
+	OWL_DMADESC_SIZE
 };
 
 /**
@@ -153,7 +141,7 @@ struct owl_dma_lli_hw {
  * @node: node for txd's lli_list
  */
 struct owl_dma_lli {
-	struct  owl_dma_lli_hw	hw;
+	u32			hw[OWL_DMADESC_SIZE];
 	dma_addr_t		phys;
 	struct list_head	node;
 };
@@ -351,8 +339,9 @@ static struct owl_dma_lli *owl_dma_add_lli(struct owl_dma_txd *txd,
 		list_add_tail(&next->node, &txd->lli_list);
 
 	if (prev) {
-		prev->hw.next_lli = next->phys;
-		prev->hw.ctrla |= llc_hw_ctrla(OWL_DMA_MODE_LME, 0);
+		prev->hw[OWL_DMADESC_NEXT_LLI] = next->phys;
+		prev->hw[OWL_DMADESC_CTRLA] |=
+					llc_hw_ctrla(OWL_DMA_MODE_LME, 0);
 	}
 
 	return next;
@@ -365,8 +354,7 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
 				  struct dma_slave_config *sconfig,
 				  bool is_cyclic)
 {
-	struct owl_dma_lli_hw *hw = &lli->hw;
-	u32 mode;
+	u32 mode, ctrlb;
 
 	mode = OWL_DMA_MODE_PW(0);
 
@@ -407,22 +395,22 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
 		return -EINVAL;
 	}
 
-	hw->next_lli = 0; /* One link list by default */
-	hw->saddr = src;
-	hw->daddr = dst;
-
-	hw->fcnt = 1; /* Frame count fixed as 1 */
-	hw->flen = len; /* Max frame length is 1MB */
-	hw->src_stride = 0;
-	hw->dst_stride = 0;
-	hw->ctrla = llc_hw_ctrla(mode,
-				 OWL_DMA_LLC_SAV_LOAD_NEXT |
-				 OWL_DMA_LLC_DAV_LOAD_NEXT);
+	lli->hw[OWL_DMADESC_CTRLA] = llc_hw_ctrla(mode,
+						  OWL_DMA_LLC_SAV_LOAD_NEXT |
+						  OWL_DMA_LLC_DAV_LOAD_NEXT);
 
 	if (is_cyclic)
-		hw->ctrlb = llc_hw_ctrlb(OWL_DMA_INTCTL_BLOCK);
+		ctrlb = llc_hw_ctrlb(OWL_DMA_INTCTL_BLOCK);
 	else
-		hw->ctrlb = llc_hw_ctrlb(OWL_DMA_INTCTL_SUPER_BLOCK);
+		ctrlb = llc_hw_ctrlb(OWL_DMA_INTCTL_SUPER_BLOCK);
+
+	lli->hw[OWL_DMADESC_NEXT_LLI] = 0;
+	lli->hw[OWL_DMADESC_SADDR] = src;
+	lli->hw[OWL_DMADESC_DADDR] = dst;
+	lli->hw[OWL_DMADESC_SRC_STRIDE] = 0;
+	lli->hw[OWL_DMADESC_DST_STRIDE] = 0;
+	lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
+	lli->hw[OWL_DMADESC_CTRLB] = ctrlb;
 
 	return 0;
 }
@@ -754,7 +742,8 @@ static u32 owl_dma_getbytes_chan(struct owl_dma_vchan *vchan)
 			/* Start from the next active node */
 			if (lli->phys == next_lli_phy) {
 				list_for_each_entry(lli, &txd->lli_list, node)
-					bytes += lli->hw.flen;
+					bytes += lli->hw[OWL_DMADESC_FLEN] &
+						 GENMASK(19, 0);
 				break;
 			}
 		}
@@ -785,7 +774,7 @@ static enum dma_status owl_dma_tx_status(struct dma_chan *chan,
 	if (vd) {
 		txd = to_owl_txd(&vd->tx);
 		list_for_each_entry(lli, &txd->lli_list, node)
-			bytes += lli->hw.flen;
+			bytes += lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
 	} else {
 		bytes = owl_dma_getbytes_chan(vchan);
 	}
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 2/9] dmaengine: Actions: Add support for S700 DMA engine
  2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
@ 2020-05-14 16:10   ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, vkoul, afaerber, manivannan.sadhasivam
  Cc: dan.j.williams, cristian.ciocaltea, dmaengine, linux-arm-kernel,
	linux-actions

DMA controller present on S700 SoC is compatible with the one on S900
(as most of registers are same), but it has different DMA descriptor
structure where registers "fcnt" and "ctrlb" uses different encoding.

For instance, on S900 "fcnt" starts at offset 0x0c and uses upper 12
bits whereas on S700, it starts at offset 0x1c and uses lower 12 bits.

This commit adds support for DMA controller present on S700.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* Added accessor function to get the frame lenght.
	* Removed the SoC specific check in IRQ routine.
---
 drivers/dma/owl-dma.c | 50 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 37 insertions(+), 13 deletions(-)

diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c
index b0d80a2fa383..afa6c6f43d26 100644
--- a/drivers/dma/owl-dma.c
+++ b/drivers/dma/owl-dma.c
@@ -134,6 +134,11 @@ enum owl_dmadesc_offsets {
 	OWL_DMADESC_SIZE
 };
 
+enum owl_dma_id {
+	S900_DMA,
+	S700_DMA,
+};
+
 /**
  * struct owl_dma_lli - Link list for dma transfer
  * @hw: hardware link list
@@ -200,6 +205,7 @@ struct owl_dma_vchan {
  * @pchans: array of data for the physical channels
  * @nr_vchans: the number of physical channels
  * @vchans: array of data for the physical channels
+ * @devid: device id based on OWL SoC
  */
 struct owl_dma {
 	struct dma_device	dma;
@@ -214,6 +220,7 @@ struct owl_dma {
 
 	unsigned int		nr_vchans;
 	struct owl_dma_vchan	*vchans;
+	enum owl_dma_id		devid;
 };
 
 static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,
@@ -308,6 +315,11 @@ static inline u32 llc_hw_ctrlb(u32 int_ctl)
 	return ctl;
 }
 
+static inline u32 llc_hw_flen(struct owl_dma_lli *lli)
+{
+	return lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
+}
+
 static void owl_dma_free_lli(struct owl_dma *od,
 			     struct owl_dma_lli *lli)
 {
@@ -354,6 +366,7 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
 				  struct dma_slave_config *sconfig,
 				  bool is_cyclic)
 {
+	struct owl_dma *od = to_owl_dma(vchan->vc.chan.device);
 	u32 mode, ctrlb;
 
 	mode = OWL_DMA_MODE_PW(0);
@@ -409,8 +422,14 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
 	lli->hw[OWL_DMADESC_DADDR] = dst;
 	lli->hw[OWL_DMADESC_SRC_STRIDE] = 0;
 	lli->hw[OWL_DMADESC_DST_STRIDE] = 0;
-	lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
-	lli->hw[OWL_DMADESC_CTRLB] = ctrlb;
+
+	if (od->devid == S700_DMA) {
+		lli->hw[OWL_DMADESC_FLEN] = len;
+		lli->hw[OWL_DMADESC_CTRLB] = 1 | ctrlb;
+	} else {
+		lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
+		lli->hw[OWL_DMADESC_CTRLB] = ctrlb;
+	}
 
 	return 0;
 }
@@ -572,7 +591,7 @@ static irqreturn_t owl_dma_interrupt(int irq, void *dev_id)
 
 		global_irq_pending = dma_readl(od, OWL_DMA_IRQ_PD0);
 
-		if (chan_irq_pending && !(global_irq_pending & BIT(i)))	{
+		if (chan_irq_pending && !(global_irq_pending & BIT(i))) {
 			dev_dbg(od->dma.dev,
 				"global and channel IRQ pending match err\n");
 
@@ -741,9 +760,9 @@ static u32 owl_dma_getbytes_chan(struct owl_dma_vchan *vchan)
 		list_for_each_entry(lli, &txd->lli_list, node) {
 			/* Start from the next active node */
 			if (lli->phys == next_lli_phy) {
-				list_for_each_entry(lli, &txd->lli_list, node)
-					bytes += lli->hw[OWL_DMADESC_FLEN] &
-						 GENMASK(19, 0);
+				list_for_each_entry(lli, &txd->lli_list,
+						    node)
+					bytes += llc_hw_flen(lli);
 				break;
 			}
 		}
@@ -774,7 +793,7 @@ static enum dma_status owl_dma_tx_status(struct dma_chan *chan,
 	if (vd) {
 		txd = to_owl_txd(&vd->tx);
 		list_for_each_entry(lli, &txd->lli_list, node)
-			bytes += lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
+			bytes += llc_hw_flen(lli);
 	} else {
 		bytes = owl_dma_getbytes_chan(vchan);
 	}
@@ -1031,11 +1050,20 @@ static struct dma_chan *owl_dma_of_xlate(struct of_phandle_args *dma_spec,
 	return chan;
 }
 
+static const struct of_device_id owl_dma_match[] = {
+	{ .compatible = "actions,s900-dma", .data = (void *)S900_DMA,},
+	{ .compatible = "actions,s700-dma", .data = (void *)S700_DMA,},
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, owl_dma_match);
+
 static int owl_dma_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct owl_dma *od;
 	int ret, i, nr_channels, nr_requests;
+	const struct of_device_id *of_id =
+				of_match_device(owl_dma_match, &pdev->dev);
 
 	od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
 	if (!od)
@@ -1060,6 +1088,8 @@ static int owl_dma_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "dma-channels %d, dma-requests %d\n",
 		 nr_channels, nr_requests);
 
+	od->devid = (enum owl_dma_id)of_id->data;
+
 	od->nr_pchans = nr_channels;
 	od->nr_vchans = nr_requests;
 
@@ -1192,12 +1222,6 @@ static int owl_dma_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id owl_dma_match[] = {
-	{ .compatible = "actions,s900-dma", },
-	{ /* sentinel */ }
-};
-MODULE_DEVICE_TABLE(of, owl_dma_match);
-
 static struct platform_driver owl_dma_driver = {
 	.probe	= owl_dma_probe,
 	.remove	= owl_dma_remove,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 2/9] dmaengine: Actions: Add support for S700 DMA engine
@ 2020-05-14 16:10   ` Amit Singh Tomar
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, vkoul, afaerber, manivannan.sadhasivam
  Cc: dmaengine, dan.j.williams, linux-actions, linux-arm-kernel,
	cristian.ciocaltea

DMA controller present on S700 SoC is compatible with the one on S900
(as most of registers are same), but it has different DMA descriptor
structure where registers "fcnt" and "ctrlb" uses different encoding.

For instance, on S900 "fcnt" starts at offset 0x0c and uses upper 12
bits whereas on S700, it starts at offset 0x1c and uses lower 12 bits.

This commit adds support for DMA controller present on S700.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* Added accessor function to get the frame lenght.
	* Removed the SoC specific check in IRQ routine.
---
 drivers/dma/owl-dma.c | 50 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 37 insertions(+), 13 deletions(-)

diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c
index b0d80a2fa383..afa6c6f43d26 100644
--- a/drivers/dma/owl-dma.c
+++ b/drivers/dma/owl-dma.c
@@ -134,6 +134,11 @@ enum owl_dmadesc_offsets {
 	OWL_DMADESC_SIZE
 };
 
+enum owl_dma_id {
+	S900_DMA,
+	S700_DMA,
+};
+
 /**
  * struct owl_dma_lli - Link list for dma transfer
  * @hw: hardware link list
@@ -200,6 +205,7 @@ struct owl_dma_vchan {
  * @pchans: array of data for the physical channels
  * @nr_vchans: the number of physical channels
  * @vchans: array of data for the physical channels
+ * @devid: device id based on OWL SoC
  */
 struct owl_dma {
 	struct dma_device	dma;
@@ -214,6 +220,7 @@ struct owl_dma {
 
 	unsigned int		nr_vchans;
 	struct owl_dma_vchan	*vchans;
+	enum owl_dma_id		devid;
 };
 
 static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,
@@ -308,6 +315,11 @@ static inline u32 llc_hw_ctrlb(u32 int_ctl)
 	return ctl;
 }
 
+static inline u32 llc_hw_flen(struct owl_dma_lli *lli)
+{
+	return lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
+}
+
 static void owl_dma_free_lli(struct owl_dma *od,
 			     struct owl_dma_lli *lli)
 {
@@ -354,6 +366,7 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
 				  struct dma_slave_config *sconfig,
 				  bool is_cyclic)
 {
+	struct owl_dma *od = to_owl_dma(vchan->vc.chan.device);
 	u32 mode, ctrlb;
 
 	mode = OWL_DMA_MODE_PW(0);
@@ -409,8 +422,14 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
 	lli->hw[OWL_DMADESC_DADDR] = dst;
 	lli->hw[OWL_DMADESC_SRC_STRIDE] = 0;
 	lli->hw[OWL_DMADESC_DST_STRIDE] = 0;
-	lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
-	lli->hw[OWL_DMADESC_CTRLB] = ctrlb;
+
+	if (od->devid == S700_DMA) {
+		lli->hw[OWL_DMADESC_FLEN] = len;
+		lli->hw[OWL_DMADESC_CTRLB] = 1 | ctrlb;
+	} else {
+		lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
+		lli->hw[OWL_DMADESC_CTRLB] = ctrlb;
+	}
 
 	return 0;
 }
@@ -572,7 +591,7 @@ static irqreturn_t owl_dma_interrupt(int irq, void *dev_id)
 
 		global_irq_pending = dma_readl(od, OWL_DMA_IRQ_PD0);
 
-		if (chan_irq_pending && !(global_irq_pending & BIT(i)))	{
+		if (chan_irq_pending && !(global_irq_pending & BIT(i))) {
 			dev_dbg(od->dma.dev,
 				"global and channel IRQ pending match err\n");
 
@@ -741,9 +760,9 @@ static u32 owl_dma_getbytes_chan(struct owl_dma_vchan *vchan)
 		list_for_each_entry(lli, &txd->lli_list, node) {
 			/* Start from the next active node */
 			if (lli->phys == next_lli_phy) {
-				list_for_each_entry(lli, &txd->lli_list, node)
-					bytes += lli->hw[OWL_DMADESC_FLEN] &
-						 GENMASK(19, 0);
+				list_for_each_entry(lli, &txd->lli_list,
+						    node)
+					bytes += llc_hw_flen(lli);
 				break;
 			}
 		}
@@ -774,7 +793,7 @@ static enum dma_status owl_dma_tx_status(struct dma_chan *chan,
 	if (vd) {
 		txd = to_owl_txd(&vd->tx);
 		list_for_each_entry(lli, &txd->lli_list, node)
-			bytes += lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
+			bytes += llc_hw_flen(lli);
 	} else {
 		bytes = owl_dma_getbytes_chan(vchan);
 	}
@@ -1031,11 +1050,20 @@ static struct dma_chan *owl_dma_of_xlate(struct of_phandle_args *dma_spec,
 	return chan;
 }
 
+static const struct of_device_id owl_dma_match[] = {
+	{ .compatible = "actions,s900-dma", .data = (void *)S900_DMA,},
+	{ .compatible = "actions,s700-dma", .data = (void *)S700_DMA,},
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, owl_dma_match);
+
 static int owl_dma_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct owl_dma *od;
 	int ret, i, nr_channels, nr_requests;
+	const struct of_device_id *of_id =
+				of_match_device(owl_dma_match, &pdev->dev);
 
 	od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
 	if (!od)
@@ -1060,6 +1088,8 @@ static int owl_dma_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "dma-channels %d, dma-requests %d\n",
 		 nr_channels, nr_requests);
 
+	od->devid = (enum owl_dma_id)of_id->data;
+
 	od->nr_pchans = nr_channels;
 	od->nr_vchans = nr_requests;
 
@@ -1192,12 +1222,6 @@ static int owl_dma_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id owl_dma_match[] = {
-	{ .compatible = "actions,s900-dma", },
-	{ /* sentinel */ }
-};
-MODULE_DEVICE_TABLE(of, owl_dma_match);
-
 static struct platform_driver owl_dma_driver = {
 	.probe	= owl_dma_probe,
 	.remove	= owl_dma_remove,
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 3/9] clk: actions: Add MMC clock-register reset bits
  2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
@ 2020-05-14 16:10 ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, sboyd
  Cc: linux-actions, linux-arm-kernel, cristian.ciocaltea

This commit adds reset bits needed for MMC clock registers present
on Actions S700 SoC.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes from RFC:
	* No change.
---
 drivers/clk/actions/owl-s700.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/clk/actions/owl-s700.c b/drivers/clk/actions/owl-s700.c
index a2f34d13fb54..cd60eca7727d 100644
--- a/drivers/clk/actions/owl-s700.c
+++ b/drivers/clk/actions/owl-s700.c
@@ -577,6 +577,9 @@ static const struct owl_reset_map s700_resets[] = {
 	[RESET_DSI]	= { CMU_DEVRST0, BIT(2) },
 	[RESET_CSI]	= { CMU_DEVRST0, BIT(13) },
 	[RESET_SI]	= { CMU_DEVRST0, BIT(14) },
+	[RESET_SD0]     = { CMU_DEVRST0, BIT(22) },
+	[RESET_SD1]     = { CMU_DEVRST0, BIT(23) },
+	[RESET_SD2]     = { CMU_DEVRST0, BIT(24) },
 	[RESET_I2C0]	= { CMU_DEVRST1, BIT(0) },
 	[RESET_I2C1]	= { CMU_DEVRST1, BIT(1) },
 	[RESET_I2C2]	= { CMU_DEVRST1, BIT(2) },
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 4/9] arm64: dts: actions: do not merge disable sps node from S700
  2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
@ 2020-05-14 16:10   ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

After commit 7cdf8446ed1d ("arm64: dts: actions: Add pinctrl node for
Actions Semi S700") following error has been observed while booting
Linux on Cubieboard7-lite(based on S700 SoC).

[    0.257415] pinctrl-s700 e01b0000.pinctrl: can't request region for
resource [mem 0xe01b0000-0xe01b0fff]
[    0.266902] pinctrl-s700: probe of e01b0000.pinctrl failed with error -16

This is due to the fact that memory range for "sps" power domain controller
clashes with pinctrl.

This commit disable "sps" to avoid this conflict and let us test DMA and MMC
related changes.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* kept as do not merge.
---
 arch/arm64/boot/dts/actions/s700.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
index 2006ad5424fa..0397c5dd3dec 100644
--- a/arch/arm64/boot/dts/actions/s700.dtsi
+++ b/arch/arm64/boot/dts/actions/s700.dtsi
@@ -220,6 +220,7 @@
 			compatible = "actions,s700-sps";
 			reg = <0x0 0xe01b0100 0x0 0x100>;
 			#power-domain-cells = <1>;
+			status = "disabled";
 		};
 
 		timer: timer@e024c000 {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 4/9] arm64: dts: actions: do not merge disable sps node from S700
@ 2020-05-14 16:10   ` Amit Singh Tomar
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: devicetree, linux-actions, linux-arm-kernel, cristian.ciocaltea

After commit 7cdf8446ed1d ("arm64: dts: actions: Add pinctrl node for
Actions Semi S700") following error has been observed while booting
Linux on Cubieboard7-lite(based on S700 SoC).

[    0.257415] pinctrl-s700 e01b0000.pinctrl: can't request region for
resource [mem 0xe01b0000-0xe01b0fff]
[    0.266902] pinctrl-s700: probe of e01b0000.pinctrl failed with error -16

This is due to the fact that memory range for "sps" power domain controller
clashes with pinctrl.

This commit disable "sps" to avoid this conflict and let us test DMA and MMC
related changes.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* kept as do not merge.
---
 arch/arm64/boot/dts/actions/s700.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
index 2006ad5424fa..0397c5dd3dec 100644
--- a/arch/arm64/boot/dts/actions/s700.dtsi
+++ b/arch/arm64/boot/dts/actions/s700.dtsi
@@ -220,6 +220,7 @@
 			compatible = "actions,s700-sps";
 			reg = <0x0 0xe01b0100 0x0 0x100>;
 			#power-domain-cells = <1>;
+			status = "disabled";
 		};
 
 		timer: timer@e024c000 {
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
  2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
@ 2020-05-14 16:10   ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

Converts the device tree bindings for the Actions Semi Owl SoCs DMA
Controller over to YAML schemas.

It also adds new compatible string "actions,s700-dma" to match
the driver.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
New patch, was not there in RFC.
---
 Documentation/devicetree/bindings/dma/owl-dma.txt  | 47 ------------
 Documentation/devicetree/bindings/dma/owl-dma.yaml | 84 ++++++++++++++++++++++
 2 files changed, 84 insertions(+), 47 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/dma/owl-dma.txt
 create mode 100644 Documentation/devicetree/bindings/dma/owl-dma.yaml

diff --git a/Documentation/devicetree/bindings/dma/owl-dma.txt b/Documentation/devicetree/bindings/dma/owl-dma.txt
deleted file mode 100644
index 03e9bb12b75f..000000000000
--- a/Documentation/devicetree/bindings/dma/owl-dma.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-* Actions Semi Owl SoCs DMA controller
-
-This binding follows the generic DMA bindings defined in dma.txt.
-
-Required properties:
-- compatible: Should be "actions,s900-dma".
-- reg: Should contain DMA registers location and length.
-- interrupts: Should contain 4 interrupts shared by all channel.
-- #dma-cells: Must be <1>. Used to represent the number of integer
-              cells in the dmas property of client device.
-- dma-channels: Physical channels supported.
-- dma-requests: Number of DMA request signals supported by the controller.
-                Refer to Documentation/devicetree/bindings/dma/dma.txt
-- clocks: Phandle and Specifier of the clock feeding the DMA controller.
-
-Example:
-
-Controller:
-                dma: dma-controller@e0260000 {
-                        compatible = "actions,s900-dma";
-                        reg = <0x0 0xe0260000 0x0 0x1000>;
-                        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
-                                     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
-                                     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
-                                     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
-                        #dma-cells = <1>;
-                        dma-channels = <12>;
-                        dma-requests = <46>;
-                        clocks = <&clock CLK_DMAC>;
-                };
-
-Client:
-
-DMA clients connected to the Actions Semi Owl SoCs DMA controller must
-use the format described in the dma.txt file, using a two-cell specifier
-for each channel.
-
-The two cells in order are:
-1. A phandle pointing to the DMA controller.
-2. The channel id.
-
-uart5: serial@e012a000 {
-        ...
-        dma-names = "tx", "rx";
-        dmas = <&dma 26>, <&dma 27>;
-        ...
-};
diff --git a/Documentation/devicetree/bindings/dma/owl-dma.yaml b/Documentation/devicetree/bindings/dma/owl-dma.yaml
new file mode 100644
index 000000000000..12e68c0ece67
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/owl-dma.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/owl-dma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl SoCs DMA controller
+
+description: |
+  The OWL DMA is a general-purpose direct memory access controller capable of
+  supporting 10 and 12 independent DMA channels for S700 and S900 SoCs
+  respectively.
+  DMA clients connected to the Actions Semi Owl SoCs DMA controller must
+  use the format described in the owl-dma.yaml file, using a two-cell specifier
+  for each channel.
+
+  The two cells in order are:
+  1. A phandle pointing to the DMA controller.
+  2. The channel id.
+
+  uart5: serial@e012a000 {
+    ...
+    dma-names = "tx", "rx";
+    dmas = <&dma 26>, <&dma 27>;
+    ...
+  };
+
+maintainers:
+  - Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+
+allOf:
+  - $ref: "dma-controller.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - actions,s900-dma
+      - actions,s700-dma
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 4
+
+  "#dma-cells":
+    const: 1
+
+  dma-channels:
+    maxItems: 1
+
+  dma-requests:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#dma-cells"
+  - dma-channels
+  - dma-requests
+  - clocks
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/actions,s700-cmu.h>
+    dma: dma-controller@e0260000 {
+        compatible = "actions,s900-dma";
+        reg = <0x0 0xe0260000 0x0 0x1000>;
+        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+        #dma-cells = <1>;
+        dma-channels = <12>;
+        dma-requests = <46>;
+        clocks = <&clock CLK_DMAC>;
+    };
+
+...
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
@ 2020-05-14 16:10   ` Amit Singh Tomar
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: devicetree, linux-actions, linux-arm-kernel, cristian.ciocaltea

Converts the device tree bindings for the Actions Semi Owl SoCs DMA
Controller over to YAML schemas.

It also adds new compatible string "actions,s700-dma" to match
the driver.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
New patch, was not there in RFC.
---
 Documentation/devicetree/bindings/dma/owl-dma.txt  | 47 ------------
 Documentation/devicetree/bindings/dma/owl-dma.yaml | 84 ++++++++++++++++++++++
 2 files changed, 84 insertions(+), 47 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/dma/owl-dma.txt
 create mode 100644 Documentation/devicetree/bindings/dma/owl-dma.yaml

diff --git a/Documentation/devicetree/bindings/dma/owl-dma.txt b/Documentation/devicetree/bindings/dma/owl-dma.txt
deleted file mode 100644
index 03e9bb12b75f..000000000000
--- a/Documentation/devicetree/bindings/dma/owl-dma.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-* Actions Semi Owl SoCs DMA controller
-
-This binding follows the generic DMA bindings defined in dma.txt.
-
-Required properties:
-- compatible: Should be "actions,s900-dma".
-- reg: Should contain DMA registers location and length.
-- interrupts: Should contain 4 interrupts shared by all channel.
-- #dma-cells: Must be <1>. Used to represent the number of integer
-              cells in the dmas property of client device.
-- dma-channels: Physical channels supported.
-- dma-requests: Number of DMA request signals supported by the controller.
-                Refer to Documentation/devicetree/bindings/dma/dma.txt
-- clocks: Phandle and Specifier of the clock feeding the DMA controller.
-
-Example:
-
-Controller:
-                dma: dma-controller@e0260000 {
-                        compatible = "actions,s900-dma";
-                        reg = <0x0 0xe0260000 0x0 0x1000>;
-                        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
-                                     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
-                                     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
-                                     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
-                        #dma-cells = <1>;
-                        dma-channels = <12>;
-                        dma-requests = <46>;
-                        clocks = <&clock CLK_DMAC>;
-                };
-
-Client:
-
-DMA clients connected to the Actions Semi Owl SoCs DMA controller must
-use the format described in the dma.txt file, using a two-cell specifier
-for each channel.
-
-The two cells in order are:
-1. A phandle pointing to the DMA controller.
-2. The channel id.
-
-uart5: serial@e012a000 {
-        ...
-        dma-names = "tx", "rx";
-        dmas = <&dma 26>, <&dma 27>;
-        ...
-};
diff --git a/Documentation/devicetree/bindings/dma/owl-dma.yaml b/Documentation/devicetree/bindings/dma/owl-dma.yaml
new file mode 100644
index 000000000000..12e68c0ece67
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/owl-dma.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/owl-dma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl SoCs DMA controller
+
+description: |
+  The OWL DMA is a general-purpose direct memory access controller capable of
+  supporting 10 and 12 independent DMA channels for S700 and S900 SoCs
+  respectively.
+  DMA clients connected to the Actions Semi Owl SoCs DMA controller must
+  use the format described in the owl-dma.yaml file, using a two-cell specifier
+  for each channel.
+
+  The two cells in order are:
+  1. A phandle pointing to the DMA controller.
+  2. The channel id.
+
+  uart5: serial@e012a000 {
+    ...
+    dma-names = "tx", "rx";
+    dmas = <&dma 26>, <&dma 27>;
+    ...
+  };
+
+maintainers:
+  - Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+
+allOf:
+  - $ref: "dma-controller.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - actions,s900-dma
+      - actions,s700-dma
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 4
+
+  "#dma-cells":
+    const: 1
+
+  dma-channels:
+    maxItems: 1
+
+  dma-requests:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - "#dma-cells"
+  - dma-channels
+  - dma-requests
+  - clocks
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/actions,s700-cmu.h>
+    dma: dma-controller@e0260000 {
+        compatible = "actions,s900-dma";
+        reg = <0x0 0xe0260000 0x0 0x1000>;
+        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+        #dma-cells = <1>;
+        dma-channels = <12>;
+        dma-requests = <46>;
+        clocks = <&clock CLK_DMAC>;
+    };
+
+...
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 6/9] arm64: dts: actions: Add DMA Controller for S700
  2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
@ 2020-05-14 16:10   ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

This commit adds DAM controller present on Actions S700, it differs from
S900 in terms of number of dma channels and requests.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* No Change.
---
 arch/arm64/boot/dts/actions/s700.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
index 0397c5dd3dec..56f2f84812cb 100644
--- a/arch/arm64/boot/dts/actions/s700.dtsi
+++ b/arch/arm64/boot/dts/actions/s700.dtsi
@@ -245,5 +245,18 @@
 				     <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
 		};
+
+		dma: dma-controller@e0230000 {
+			compatible = "actions,s700-dma";
+			reg = <0x0 0xe0230000 0x0 0x1000>;
+			interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+			#dma-cells = <1>;
+			dma-channels = <10>;
+			dma-requests = <44>;
+			clocks = <&cmu CLK_DMAC>;
+		};
 	};
 };
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 6/9] arm64: dts: actions: Add DMA Controller for S700
@ 2020-05-14 16:10   ` Amit Singh Tomar
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: devicetree, linux-actions, linux-arm-kernel, cristian.ciocaltea

This commit adds DAM controller present on Actions S700, it differs from
S900 in terms of number of dma channels and requests.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* No Change.
---
 arch/arm64/boot/dts/actions/s700.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
index 0397c5dd3dec..56f2f84812cb 100644
--- a/arch/arm64/boot/dts/actions/s700.dtsi
+++ b/arch/arm64/boot/dts/actions/s700.dtsi
@@ -245,5 +245,18 @@
 				     <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
 		};
+
+		dma: dma-controller@e0230000 {
+			compatible = "actions,s700-dma";
+			reg = <0x0 0xe0230000 0x0 0x1000>;
+			interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+			#dma-cells = <1>;
+			dma-channels = <10>;
+			dma-requests = <44>;
+			clocks = <&cmu CLK_DMAC>;
+		};
 	};
 };
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 7/9] dt-bindings: reset: s700: Add binding constants for mmc
  2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
@ 2020-05-14 16:10   ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

This commit adds device tree binding reset constants for mmc controller
present on Actions S700 Soc.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* added Rob's acked-by tag
---
 include/dt-bindings/reset/actions,s700-reset.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/dt-bindings/reset/actions,s700-reset.h b/include/dt-bindings/reset/actions,s700-reset.h
index 5e3b16b8ef53..a3118de6d7aa 100644
--- a/include/dt-bindings/reset/actions,s700-reset.h
+++ b/include/dt-bindings/reset/actions,s700-reset.h
@@ -30,5 +30,8 @@
 #define RESET_UART4				20
 #define RESET_UART5				21
 #define RESET_UART6				22
+#define RESET_SD0				23
+#define RESET_SD1				24
+#define RESET_SD2				25
 
 #endif /* __DT_BINDINGS_ACTIONS_S700_RESET_H */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 7/9] dt-bindings: reset: s700: Add binding constants for mmc
@ 2020-05-14 16:10   ` Amit Singh Tomar
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: devicetree, linux-actions, linux-arm-kernel, cristian.ciocaltea

This commit adds device tree binding reset constants for mmc controller
present on Actions S700 Soc.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* added Rob's acked-by tag
---
 include/dt-bindings/reset/actions,s700-reset.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/dt-bindings/reset/actions,s700-reset.h b/include/dt-bindings/reset/actions,s700-reset.h
index 5e3b16b8ef53..a3118de6d7aa 100644
--- a/include/dt-bindings/reset/actions,s700-reset.h
+++ b/include/dt-bindings/reset/actions,s700-reset.h
@@ -30,5 +30,8 @@
 #define RESET_UART4				20
 #define RESET_UART5				21
 #define RESET_UART6				22
+#define RESET_SD0				23
+#define RESET_SD1				24
+#define RESET_SD2				25
 
 #endif /* __DT_BINDINGS_ACTIONS_S700_RESET_H */
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
@ 2020-05-14 16:10   ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

This commits adds support for MMC controllers present on Actions S700 SoC,
there are 3 MMC controllers in this SoC which can be used for accessing
SD/EMMC/SDIO cards.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* No change.
---
 arch/arm64/boot/dts/actions/s700.dtsi | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
index 56f2f84812cb..3f1fc3e48415 100644
--- a/arch/arm64/boot/dts/actions/s700.dtsi
+++ b/arch/arm64/boot/dts/actions/s700.dtsi
@@ -258,5 +258,38 @@
 			dma-requests = <44>;
 			clocks = <&cmu CLK_DMAC>;
 		};
+
+		mmc0: mmc@e0210000 {
+			compatible = "actions,owl-mmc";
+			reg = <0x0 0xe0210000 0x0 0x4000>;
+			interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cmu CLK_SD0>;
+			resets = <&cmu RESET_SD0>;
+			dmas = <&dma 2>;
+			dma-names = "mmc";
+			status = "disabled";
+		};
+
+		mmc1: mmc@e0214000 {
+			compatible = "actions,owl-mmc";
+			reg = <0x0 0xe0214000 0x0 0x4000>;
+			interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cmu CLK_SD1>;
+			resets = <&cmu RESET_SD1>;
+			dmas = <&dma 3>;
+			dma-names = "mmc";
+			status = "disabled";
+		};
+
+		mmc2: mmc@e0218000 {
+			compatible = "actions,owl-mmc";
+			reg = <0x0 0xe0218000 0x0 0x4000>;
+			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cmu CLK_SD2>;
+			resets = <&cmu RESET_SD2>;
+			dmas = <&dma 4>;
+			dma-names = "mmc";
+			status = "disabled";
+		};
 	};
 };
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-14 16:10   ` Amit Singh Tomar
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: devicetree, linux-actions, linux-arm-kernel, cristian.ciocaltea

This commits adds support for MMC controllers present on Actions S700 SoC,
there are 3 MMC controllers in this SoC which can be used for accessing
SD/EMMC/SDIO cards.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* No change.
---
 arch/arm64/boot/dts/actions/s700.dtsi | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
index 56f2f84812cb..3f1fc3e48415 100644
--- a/arch/arm64/boot/dts/actions/s700.dtsi
+++ b/arch/arm64/boot/dts/actions/s700.dtsi
@@ -258,5 +258,38 @@
 			dma-requests = <44>;
 			clocks = <&cmu CLK_DMAC>;
 		};
+
+		mmc0: mmc@e0210000 {
+			compatible = "actions,owl-mmc";
+			reg = <0x0 0xe0210000 0x0 0x4000>;
+			interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cmu CLK_SD0>;
+			resets = <&cmu RESET_SD0>;
+			dmas = <&dma 2>;
+			dma-names = "mmc";
+			status = "disabled";
+		};
+
+		mmc1: mmc@e0214000 {
+			compatible = "actions,owl-mmc";
+			reg = <0x0 0xe0214000 0x0 0x4000>;
+			interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cmu CLK_SD1>;
+			resets = <&cmu RESET_SD1>;
+			dmas = <&dma 3>;
+			dma-names = "mmc";
+			status = "disabled";
+		};
+
+		mmc2: mmc@e0218000 {
+			compatible = "actions,owl-mmc";
+			reg = <0x0 0xe0218000 0x0 0x4000>;
+			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cmu CLK_SD2>;
+			resets = <&cmu RESET_SD2>;
+			dmas = <&dma 4>;
+			dma-names = "mmc";
+			status = "disabled";
+		};
 	};
 };
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 9/9] arm64: dts: actions: Add uSD support for Cubieboard7
  2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
@ 2020-05-14 16:10   ` Amit Singh Tomar
  2020-05-14 16:10   ` Amit Singh Tomar
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

This commit adds uSD support for Cubieboard7 board based on Actions Semi
S700 SoC. SD0 is connected to uSD slot. Since there is no PMIC support
added yet, fixed regulator has been used as a regulator node.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* No change.
---
 arch/arm64/boot/dts/actions/s700-cubieboard7.dts | 41 ++++++++++++++++++++++++
 arch/arm64/boot/dts/actions/s700.dtsi            |  1 +
 2 files changed, 42 insertions(+)

diff --git a/arch/arm64/boot/dts/actions/s700-cubieboard7.dts b/arch/arm64/boot/dts/actions/s700-cubieboard7.dts
index 63e375cd9eb4..ec117eb12f3a 100644
--- a/arch/arm64/boot/dts/actions/s700-cubieboard7.dts
+++ b/arch/arm64/boot/dts/actions/s700-cubieboard7.dts
@@ -13,6 +13,7 @@
 
 	aliases {
 		serial3 = &uart3;
+		mmc0 = &mmc0;
 	};
 
 	chosen {
@@ -28,6 +29,23 @@
 		device_type = "memory";
 		reg = <0x1 0xe0000000 0x0 0x0>;
 	};
+
+	/* Fixed regulator used in the absence of PMIC */
+	vcc_3v1: vcc-3v1 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.1V";
+		regulator-min-microvolt = <3100000>;
+		regulator-max-microvolt = <3100000>;
+	};
+
+	/* Fixed regulator used in the absence of PMIC */
+	sd_vcc: sd-vcc {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.1V";
+		regulator-min-microvolt = <3100000>;
+		regulator-max-microvolt = <3100000>;
+		regulator-always-on;
+	};
 };
 
 &i2c0 {
@@ -81,6 +99,14 @@
 			bias-pull-up;
 		};
 	};
+
+	mmc0_default: mmc0_default {
+		pinmux {
+			groups = "sd0_d0_mfp", "sd0_d1_mfp", "sd0_d2_d3_mfp",
+				 "sd0_cmd_mfp", "sd0_clk_mfp";
+			function = "sd0";
+		};
+	};
 };
 
 &timer {
@@ -90,3 +116,18 @@
 &uart3 {
 	status = "okay";
 };
+
+/* uSD */
+&mmc0 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_default>;
+	cd-gpios = <&pinctrl 120 GPIO_ACTIVE_LOW>;
+	no-sdio;
+	no-mmc;
+	no-1-8-v;
+	bus-width = <4>;
+	vmmc-supply = <&sd_vcc>;
+	vqmmc-supply = <&sd_vcc>;
+};
+
diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
index 3f1fc3e48415..8a541dd48f61 100644
--- a/arch/arm64/boot/dts/actions/s700.dtsi
+++ b/arch/arm64/boot/dts/actions/s700.dtsi
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/clock/actions,s700-cmu.h>
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/actions,s700-reset.h>
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v1 9/9] arm64: dts: actions: Add uSD support for Cubieboard7
@ 2020-05-14 16:10   ` Amit Singh Tomar
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Singh Tomar @ 2020-05-14 16:10 UTC (permalink / raw)
  To: andre.przywara, afaerber, manivannan.sadhasivam, robh+dt
  Cc: devicetree, linux-actions, linux-arm-kernel, cristian.ciocaltea

This commit adds uSD support for Cubieboard7 board based on Actions Semi
S700 SoC. SD0 is connected to uSD slot. Since there is no PMIC support
added yet, fixed regulator has been used as a regulator node.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Changes since RFC:
	* No change.
---
 arch/arm64/boot/dts/actions/s700-cubieboard7.dts | 41 ++++++++++++++++++++++++
 arch/arm64/boot/dts/actions/s700.dtsi            |  1 +
 2 files changed, 42 insertions(+)

diff --git a/arch/arm64/boot/dts/actions/s700-cubieboard7.dts b/arch/arm64/boot/dts/actions/s700-cubieboard7.dts
index 63e375cd9eb4..ec117eb12f3a 100644
--- a/arch/arm64/boot/dts/actions/s700-cubieboard7.dts
+++ b/arch/arm64/boot/dts/actions/s700-cubieboard7.dts
@@ -13,6 +13,7 @@
 
 	aliases {
 		serial3 = &uart3;
+		mmc0 = &mmc0;
 	};
 
 	chosen {
@@ -28,6 +29,23 @@
 		device_type = "memory";
 		reg = <0x1 0xe0000000 0x0 0x0>;
 	};
+
+	/* Fixed regulator used in the absence of PMIC */
+	vcc_3v1: vcc-3v1 {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.1V";
+		regulator-min-microvolt = <3100000>;
+		regulator-max-microvolt = <3100000>;
+	};
+
+	/* Fixed regulator used in the absence of PMIC */
+	sd_vcc: sd-vcc {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.1V";
+		regulator-min-microvolt = <3100000>;
+		regulator-max-microvolt = <3100000>;
+		regulator-always-on;
+	};
 };
 
 &i2c0 {
@@ -81,6 +99,14 @@
 			bias-pull-up;
 		};
 	};
+
+	mmc0_default: mmc0_default {
+		pinmux {
+			groups = "sd0_d0_mfp", "sd0_d1_mfp", "sd0_d2_d3_mfp",
+				 "sd0_cmd_mfp", "sd0_clk_mfp";
+			function = "sd0";
+		};
+	};
 };
 
 &timer {
@@ -90,3 +116,18 @@
 &uart3 {
 	status = "okay";
 };
+
+/* uSD */
+&mmc0 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_default>;
+	cd-gpios = <&pinctrl 120 GPIO_ACTIVE_LOW>;
+	no-sdio;
+	no-mmc;
+	no-1-8-v;
+	bus-width = <4>;
+	vmmc-supply = <&sd_vcc>;
+	vqmmc-supply = <&sd_vcc>;
+};
+
diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
index 3f1fc3e48415..8a541dd48f61 100644
--- a/arch/arm64/boot/dts/actions/s700.dtsi
+++ b/arch/arm64/boot/dts/actions/s700.dtsi
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/clock/actions,s700-cmu.h>
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/actions,s700-reset.h>
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 2/9] dmaengine: Actions: Add support for S700 DMA engine
  2020-05-14 16:10   ` Amit Singh Tomar
@ 2020-05-14 17:02     ` André Przywara
  -1 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-14 17:02 UTC (permalink / raw)
  To: Amit Singh Tomar, vkoul, afaerber, manivannan.sadhasivam
  Cc: dan.j.williams, cristian.ciocaltea, dmaengine, linux-arm-kernel,
	linux-actions

On 14/05/2020 17:10, Amit Singh Tomar wrote:

Hi,

> DMA controller present on S700 SoC is compatible with the one on S900
> (as most of registers are same), but it has different DMA descriptor
> structure where registers "fcnt" and "ctrlb" uses different encoding.
> 
> For instance, on S900 "fcnt" starts at offset 0x0c and uses upper 12
> bits whereas on S700, it starts at offset 0x1c and uses lower 12 bits.
> 
> This commit adds support for DMA controller present on S700.
> 
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
> ---
> Changes since RFC:
> 	* Added accessor function to get the frame lenght.
> 	* Removed the SoC specific check in IRQ routine.
> ---
>  drivers/dma/owl-dma.c | 50 +++++++++++++++++++++++++++++++++++++-------------
>  1 file changed, 37 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c
> index b0d80a2fa383..afa6c6f43d26 100644
> --- a/drivers/dma/owl-dma.c
> +++ b/drivers/dma/owl-dma.c
> @@ -134,6 +134,11 @@ enum owl_dmadesc_offsets {
>  	OWL_DMADESC_SIZE
>  };
>  
> +enum owl_dma_id {
> +	S900_DMA,
> +	S700_DMA,
> +};
> +
>  /**
>   * struct owl_dma_lli - Link list for dma transfer
>   * @hw: hardware link list
> @@ -200,6 +205,7 @@ struct owl_dma_vchan {
>   * @pchans: array of data for the physical channels
>   * @nr_vchans: the number of physical channels
>   * @vchans: array of data for the physical channels
> + * @devid: device id based on OWL SoC
>   */
>  struct owl_dma {
>  	struct dma_device	dma;
> @@ -214,6 +220,7 @@ struct owl_dma {
>  
>  	unsigned int		nr_vchans;
>  	struct owl_dma_vchan	*vchans;
> +	enum owl_dma_id		devid;
>  };
>  
>  static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,
> @@ -308,6 +315,11 @@ static inline u32 llc_hw_ctrlb(u32 int_ctl)
>  	return ctl;
>  }
>  
> +static inline u32 llc_hw_flen(struct owl_dma_lli *lli)

Drop the inline, that's not needed. The compiler knows better.

> +{
> +	return lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
> +}

Please introduce this function in the previous patch already. Otherwise
you replace code here that you introduced only there.

> +
>  static void owl_dma_free_lli(struct owl_dma *od,
>  			     struct owl_dma_lli *lli)
>  {
> @@ -354,6 +366,7 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
>  				  struct dma_slave_config *sconfig,
>  				  bool is_cyclic)
>  {
> +	struct owl_dma *od = to_owl_dma(vchan->vc.chan.device);
>  	u32 mode, ctrlb;
>  
>  	mode = OWL_DMA_MODE_PW(0);
> @@ -409,8 +422,14 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
>  	lli->hw[OWL_DMADESC_DADDR] = dst;
>  	lli->hw[OWL_DMADESC_SRC_STRIDE] = 0;
>  	lli->hw[OWL_DMADESC_DST_STRIDE] = 0;
> -	lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
> -	lli->hw[OWL_DMADESC_CTRLB] = ctrlb;
> +
> +	if (od->devid == S700_DMA) {
> +		lli->hw[OWL_DMADESC_FLEN] = len;
> +		lli->hw[OWL_DMADESC_CTRLB] = 1 | ctrlb;
> +	} else {
> +		lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
> +		lli->hw[OWL_DMADESC_CTRLB] = ctrlb;

Can you either add comments or use macros to explain what's going on
here? What is the "1" about?

> +	}
>  
>  	return 0;
>  }
> @@ -572,7 +591,7 @@ static irqreturn_t owl_dma_interrupt(int irq, void *dev_id)
>  
>  		global_irq_pending = dma_readl(od, OWL_DMA_IRQ_PD0);
>  
> -		if (chan_irq_pending && !(global_irq_pending & BIT(i)))	{
> +		if (chan_irq_pending && !(global_irq_pending & BIT(i))) {
>  			dev_dbg(od->dma.dev,
>  				"global and channel IRQ pending match err\n");
>  
> @@ -741,9 +760,9 @@ static u32 owl_dma_getbytes_chan(struct owl_dma_vchan *vchan)
>  		list_for_each_entry(lli, &txd->lli_list, node) {
>  			/* Start from the next active node */
>  			if (lli->phys == next_lli_phy) {
> -				list_for_each_entry(lli, &txd->lli_list, node)
> -					bytes += lli->hw[OWL_DMADESC_FLEN] &
> -						 GENMASK(19, 0);
> +				list_for_each_entry(lli, &txd->lli_list,
> +						    node)

Not needed line break?

Cheers,
Andre.


> +					bytes += llc_hw_flen(lli);
>  				break;
>  			}
>  		}
> @@ -774,7 +793,7 @@ static enum dma_status owl_dma_tx_status(struct dma_chan *chan,
>  	if (vd) {
>  		txd = to_owl_txd(&vd->tx);
>  		list_for_each_entry(lli, &txd->lli_list, node)
> -			bytes += lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
> +			bytes += llc_hw_flen(lli);
>  	} else {
>  		bytes = owl_dma_getbytes_chan(vchan);
>  	}
> @@ -1031,11 +1050,20 @@ static struct dma_chan *owl_dma_of_xlate(struct of_phandle_args *dma_spec,
>  	return chan;
>  }
>  
> +static const struct of_device_id owl_dma_match[] = {
> +	{ .compatible = "actions,s900-dma", .data = (void *)S900_DMA,},
> +	{ .compatible = "actions,s700-dma", .data = (void *)S700_DMA,},
> +	{ /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, owl_dma_match);
> +
>  static int owl_dma_probe(struct platform_device *pdev)
>  {
>  	struct device_node *np = pdev->dev.of_node;
>  	struct owl_dma *od;
>  	int ret, i, nr_channels, nr_requests;
> +	const struct of_device_id *of_id =
> +				of_match_device(owl_dma_match, &pdev->dev);
>  
>  	od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
>  	if (!od)
> @@ -1060,6 +1088,8 @@ static int owl_dma_probe(struct platform_device *pdev)
>  	dev_info(&pdev->dev, "dma-channels %d, dma-requests %d\n",
>  		 nr_channels, nr_requests);
>  
> +	od->devid = (enum owl_dma_id)of_id->data;
> +
>  	od->nr_pchans = nr_channels;
>  	od->nr_vchans = nr_requests;
>  
> @@ -1192,12 +1222,6 @@ static int owl_dma_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static const struct of_device_id owl_dma_match[] = {
> -	{ .compatible = "actions,s900-dma", },
> -	{ /* sentinel */ }
> -};
> -MODULE_DEVICE_TABLE(of, owl_dma_match);
> -
>  static struct platform_driver owl_dma_driver = {
>  	.probe	= owl_dma_probe,
>  	.remove	= owl_dma_remove,
> 


^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 2/9] dmaengine: Actions: Add support for S700 DMA engine
@ 2020-05-14 17:02     ` André Przywara
  0 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-14 17:02 UTC (permalink / raw)
  To: Amit Singh Tomar, vkoul, afaerber, manivannan.sadhasivam
  Cc: dmaengine, dan.j.williams, linux-actions, linux-arm-kernel,
	cristian.ciocaltea

On 14/05/2020 17:10, Amit Singh Tomar wrote:

Hi,

> DMA controller present on S700 SoC is compatible with the one on S900
> (as most of registers are same), but it has different DMA descriptor
> structure where registers "fcnt" and "ctrlb" uses different encoding.
> 
> For instance, on S900 "fcnt" starts at offset 0x0c and uses upper 12
> bits whereas on S700, it starts at offset 0x1c and uses lower 12 bits.
> 
> This commit adds support for DMA controller present on S700.
> 
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
> ---
> Changes since RFC:
> 	* Added accessor function to get the frame lenght.
> 	* Removed the SoC specific check in IRQ routine.
> ---
>  drivers/dma/owl-dma.c | 50 +++++++++++++++++++++++++++++++++++++-------------
>  1 file changed, 37 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/dma/owl-dma.c b/drivers/dma/owl-dma.c
> index b0d80a2fa383..afa6c6f43d26 100644
> --- a/drivers/dma/owl-dma.c
> +++ b/drivers/dma/owl-dma.c
> @@ -134,6 +134,11 @@ enum owl_dmadesc_offsets {
>  	OWL_DMADESC_SIZE
>  };
>  
> +enum owl_dma_id {
> +	S900_DMA,
> +	S700_DMA,
> +};
> +
>  /**
>   * struct owl_dma_lli - Link list for dma transfer
>   * @hw: hardware link list
> @@ -200,6 +205,7 @@ struct owl_dma_vchan {
>   * @pchans: array of data for the physical channels
>   * @nr_vchans: the number of physical channels
>   * @vchans: array of data for the physical channels
> + * @devid: device id based on OWL SoC
>   */
>  struct owl_dma {
>  	struct dma_device	dma;
> @@ -214,6 +220,7 @@ struct owl_dma {
>  
>  	unsigned int		nr_vchans;
>  	struct owl_dma_vchan	*vchans;
> +	enum owl_dma_id		devid;
>  };
>  
>  static void pchan_update(struct owl_dma_pchan *pchan, u32 reg,
> @@ -308,6 +315,11 @@ static inline u32 llc_hw_ctrlb(u32 int_ctl)
>  	return ctl;
>  }
>  
> +static inline u32 llc_hw_flen(struct owl_dma_lli *lli)

Drop the inline, that's not needed. The compiler knows better.

> +{
> +	return lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
> +}

Please introduce this function in the previous patch already. Otherwise
you replace code here that you introduced only there.

> +
>  static void owl_dma_free_lli(struct owl_dma *od,
>  			     struct owl_dma_lli *lli)
>  {
> @@ -354,6 +366,7 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
>  				  struct dma_slave_config *sconfig,
>  				  bool is_cyclic)
>  {
> +	struct owl_dma *od = to_owl_dma(vchan->vc.chan.device);
>  	u32 mode, ctrlb;
>  
>  	mode = OWL_DMA_MODE_PW(0);
> @@ -409,8 +422,14 @@ static inline int owl_dma_cfg_lli(struct owl_dma_vchan *vchan,
>  	lli->hw[OWL_DMADESC_DADDR] = dst;
>  	lli->hw[OWL_DMADESC_SRC_STRIDE] = 0;
>  	lli->hw[OWL_DMADESC_DST_STRIDE] = 0;
> -	lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
> -	lli->hw[OWL_DMADESC_CTRLB] = ctrlb;
> +
> +	if (od->devid == S700_DMA) {
> +		lli->hw[OWL_DMADESC_FLEN] = len;
> +		lli->hw[OWL_DMADESC_CTRLB] = 1 | ctrlb;
> +	} else {
> +		lli->hw[OWL_DMADESC_FLEN] = len | 1 << 20;
> +		lli->hw[OWL_DMADESC_CTRLB] = ctrlb;

Can you either add comments or use macros to explain what's going on
here? What is the "1" about?

> +	}
>  
>  	return 0;
>  }
> @@ -572,7 +591,7 @@ static irqreturn_t owl_dma_interrupt(int irq, void *dev_id)
>  
>  		global_irq_pending = dma_readl(od, OWL_DMA_IRQ_PD0);
>  
> -		if (chan_irq_pending && !(global_irq_pending & BIT(i)))	{
> +		if (chan_irq_pending && !(global_irq_pending & BIT(i))) {
>  			dev_dbg(od->dma.dev,
>  				"global and channel IRQ pending match err\n");
>  
> @@ -741,9 +760,9 @@ static u32 owl_dma_getbytes_chan(struct owl_dma_vchan *vchan)
>  		list_for_each_entry(lli, &txd->lli_list, node) {
>  			/* Start from the next active node */
>  			if (lli->phys == next_lli_phy) {
> -				list_for_each_entry(lli, &txd->lli_list, node)
> -					bytes += lli->hw[OWL_DMADESC_FLEN] &
> -						 GENMASK(19, 0);
> +				list_for_each_entry(lli, &txd->lli_list,
> +						    node)

Not needed line break?

Cheers,
Andre.


> +					bytes += llc_hw_flen(lli);
>  				break;
>  			}
>  		}
> @@ -774,7 +793,7 @@ static enum dma_status owl_dma_tx_status(struct dma_chan *chan,
>  	if (vd) {
>  		txd = to_owl_txd(&vd->tx);
>  		list_for_each_entry(lli, &txd->lli_list, node)
> -			bytes += lli->hw[OWL_DMADESC_FLEN] & GENMASK(19, 0);
> +			bytes += llc_hw_flen(lli);
>  	} else {
>  		bytes = owl_dma_getbytes_chan(vchan);
>  	}
> @@ -1031,11 +1050,20 @@ static struct dma_chan *owl_dma_of_xlate(struct of_phandle_args *dma_spec,
>  	return chan;
>  }
>  
> +static const struct of_device_id owl_dma_match[] = {
> +	{ .compatible = "actions,s900-dma", .data = (void *)S900_DMA,},
> +	{ .compatible = "actions,s700-dma", .data = (void *)S700_DMA,},
> +	{ /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, owl_dma_match);
> +
>  static int owl_dma_probe(struct platform_device *pdev)
>  {
>  	struct device_node *np = pdev->dev.of_node;
>  	struct owl_dma *od;
>  	int ret, i, nr_channels, nr_requests;
> +	const struct of_device_id *of_id =
> +				of_match_device(owl_dma_match, &pdev->dev);
>  
>  	od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
>  	if (!od)
> @@ -1060,6 +1088,8 @@ static int owl_dma_probe(struct platform_device *pdev)
>  	dev_info(&pdev->dev, "dma-channels %d, dma-requests %d\n",
>  		 nr_channels, nr_requests);
>  
> +	od->devid = (enum owl_dma_id)of_id->data;
> +
>  	od->nr_pchans = nr_channels;
>  	od->nr_vchans = nr_requests;
>  
> @@ -1192,12 +1222,6 @@ static int owl_dma_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static const struct of_device_id owl_dma_match[] = {
> -	{ .compatible = "actions,s900-dma", },
> -	{ /* sentinel */ }
> -};
> -MODULE_DEVICE_TABLE(of, owl_dma_match);
> -
>  static struct platform_driver owl_dma_driver = {
>  	.probe	= owl_dma_probe,
>  	.remove	= owl_dma_remove,
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
  2020-05-14 16:10   ` Amit Singh Tomar
@ 2020-05-14 18:27     ` Vinod Koul
  -1 siblings, 0 replies; 58+ messages in thread
From: Vinod Koul @ 2020-05-14 18:27 UTC (permalink / raw)
  To: Amit Singh Tomar
  Cc: andre.przywara, afaerber, manivannan.sadhasivam, dan.j.williams,
	cristian.ciocaltea, dmaengine, linux-arm-kernel, linux-actions

On 14-05-20, 21:40, Amit Singh Tomar wrote:
> At the moment, Driver uses bit fields to describe registers of the DMA
> descriptor structure that makes it less portable and maintainable, and
> Andre suugested(and even sketched important bits for it) to make use of
> array to describe this DMA descriptors instead. It gives the flexibility
> while extending support for other platform such as Actions S700.
> 
> This commit removes the "owl_dma_lli_hw" (that includes bit-fields) and
> uses array to describe DMA descriptor.

So i see patch 1/9 and 2/9 in my inbox... where are the rest ? No cover
to detail out what the rest contains, who should merge them etc etc!

If you are sending a series to different subsystem please make a habit
to CC everyone on cover letter so that we understand details about the
series. If not dependent, just send as individual units to subsystems!

-- 
~Vinod

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
@ 2020-05-14 18:27     ` Vinod Koul
  0 siblings, 0 replies; 58+ messages in thread
From: Vinod Koul @ 2020-05-14 18:27 UTC (permalink / raw)
  To: Amit Singh Tomar
  Cc: andre.przywara, linux-actions, cristian.ciocaltea,
	manivannan.sadhasivam, dmaengine, dan.j.williams, afaerber,
	linux-arm-kernel

On 14-05-20, 21:40, Amit Singh Tomar wrote:
> At the moment, Driver uses bit fields to describe registers of the DMA
> descriptor structure that makes it less portable and maintainable, and
> Andre suugested(and even sketched important bits for it) to make use of
> array to describe this DMA descriptors instead. It gives the flexibility
> while extending support for other platform such as Actions S700.
> 
> This commit removes the "owl_dma_lli_hw" (that includes bit-fields) and
> uses array to describe DMA descriptor.

So i see patch 1/9 and 2/9 in my inbox... where are the rest ? No cover
to detail out what the rest contains, who should merge them etc etc!

If you are sending a series to different subsystem please make a habit
to CC everyone on cover letter so that we understand details about the
series. If not dependent, just send as individual units to subsystems!

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
  2020-05-14 18:27     ` Vinod Koul
@ 2020-05-14 18:34       ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-14 18:34 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andre Przywara, Andreas Färber, Manivannan Sadhasivam,
	dan.j.williams, cristian.ciocaltea, dmaengine, linux-arm-kernel,
	linux-actions

Hi,

On Thu, May 14, 2020 at 11:58 PM Vinod Koul <vkoul@kernel.org> wrote:
>
> On 14-05-20, 21:40, Amit Singh Tomar wrote:
> > At the moment, Driver uses bit fields to describe registers of the DMA
> > descriptor structure that makes it less portable and maintainable, and
> > Andre suugested(and even sketched important bits for it) to make use of
> > array to describe this DMA descriptors instead. It gives the flexibility
> > while extending support for other platform such as Actions S700.
> >
> > This commit removes the "owl_dma_lli_hw" (that includes bit-fields) and
> > uses array to describe DMA descriptor.
>
> So i see patch 1/9 and 2/9 in my inbox... where are the rest ? No cover
> to detail out what the rest contains, who should merge them etc etc!
>
> If you are sending a series to different subsystem please make a habit
> to CC everyone on cover letter so that we understand details about the
> series. If not dependent, just send as individual units to subsystems!

Ok, I would make note of it and Cc everyone on cover letter going forward.

Thanks
-Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
@ 2020-05-14 18:34       ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-14 18:34 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andre Przywara, linux-actions, cristian.ciocaltea,
	Manivannan Sadhasivam, dmaengine, dan.j.williams,
	Andreas Färber, linux-arm-kernel

Hi,

On Thu, May 14, 2020 at 11:58 PM Vinod Koul <vkoul@kernel.org> wrote:
>
> On 14-05-20, 21:40, Amit Singh Tomar wrote:
> > At the moment, Driver uses bit fields to describe registers of the DMA
> > descriptor structure that makes it less portable and maintainable, and
> > Andre suugested(and even sketched important bits for it) to make use of
> > array to describe this DMA descriptors instead. It gives the flexibility
> > while extending support for other platform such as Actions S700.
> >
> > This commit removes the "owl_dma_lli_hw" (that includes bit-fields) and
> > uses array to describe DMA descriptor.
>
> So i see patch 1/9 and 2/9 in my inbox... where are the rest ? No cover
> to detail out what the rest contains, who should merge them etc etc!
>
> If you are sending a series to different subsystem please make a habit
> to CC everyone on cover letter so that we understand details about the
> series. If not dependent, just send as individual units to subsystems!

Ok, I would make note of it and Cc everyone on cover letter going forward.

Thanks
-Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
  2020-05-14 18:34       ` Amit Tomer
@ 2020-05-15  6:58         ` Vinod Koul
  -1 siblings, 0 replies; 58+ messages in thread
From: Vinod Koul @ 2020-05-15  6:58 UTC (permalink / raw)
  To: Amit Tomer
  Cc: Andre Przywara, Andreas Färber, Manivannan Sadhasivam,
	dan.j.williams, cristian.ciocaltea, dmaengine, linux-arm-kernel,
	linux-actions

On 15-05-20, 00:04, Amit Tomer wrote:
> Hi,
> 
> On Thu, May 14, 2020 at 11:58 PM Vinod Koul <vkoul@kernel.org> wrote:
> >
> > On 14-05-20, 21:40, Amit Singh Tomar wrote:
> > > At the moment, Driver uses bit fields to describe registers of the DMA
> > > descriptor structure that makes it less portable and maintainable, and
> > > Andre suugested(and even sketched important bits for it) to make use of
> > > array to describe this DMA descriptors instead. It gives the flexibility
> > > while extending support for other platform such as Actions S700.
> > >
> > > This commit removes the "owl_dma_lli_hw" (that includes bit-fields) and
> > > uses array to describe DMA descriptor.
> >
> > So i see patch 1/9 and 2/9 in my inbox... where are the rest ? No cover
> > to detail out what the rest contains, who should merge them etc etc!

and what is the answer for this..?

> >
> > If you are sending a series to different subsystem please make a habit
> > to CC everyone on cover letter so that we understand details about the
> > series. If not dependent, just send as individual units to subsystems!
> 
> Ok, I would make note of it and Cc everyone on cover letter going forward.
> 
> Thanks
> -Amit

-- 
~Vinod

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
@ 2020-05-15  6:58         ` Vinod Koul
  0 siblings, 0 replies; 58+ messages in thread
From: Vinod Koul @ 2020-05-15  6:58 UTC (permalink / raw)
  To: Amit Tomer
  Cc: Andre Przywara, linux-actions, cristian.ciocaltea,
	Manivannan Sadhasivam, dmaengine, dan.j.williams,
	Andreas Färber, linux-arm-kernel

On 15-05-20, 00:04, Amit Tomer wrote:
> Hi,
> 
> On Thu, May 14, 2020 at 11:58 PM Vinod Koul <vkoul@kernel.org> wrote:
> >
> > On 14-05-20, 21:40, Amit Singh Tomar wrote:
> > > At the moment, Driver uses bit fields to describe registers of the DMA
> > > descriptor structure that makes it less portable and maintainable, and
> > > Andre suugested(and even sketched important bits for it) to make use of
> > > array to describe this DMA descriptors instead. It gives the flexibility
> > > while extending support for other platform such as Actions S700.
> > >
> > > This commit removes the "owl_dma_lli_hw" (that includes bit-fields) and
> > > uses array to describe DMA descriptor.
> >
> > So i see patch 1/9 and 2/9 in my inbox... where are the rest ? No cover
> > to detail out what the rest contains, who should merge them etc etc!

and what is the answer for this..?

> >
> > If you are sending a series to different subsystem please make a habit
> > to CC everyone on cover letter so that we understand details about the
> > series. If not dependent, just send as individual units to subsystems!
> 
> Ok, I would make note of it and Cc everyone on cover letter going forward.
> 
> Thanks
> -Amit

-- 
~Vinod

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
  2020-05-15  6:58         ` Vinod Koul
@ 2020-05-15  7:46           ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15  7:46 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andre Przywara, Andreas Färber, Manivannan Sadhasivam,
	dan.j.williams, cristian.ciocaltea, dmaengine, linux-arm-kernel,
	linux-actions

Hi

> > > So i see patch 1/9 and 2/9 in my inbox... where are the rest ? No cover
> > > to detail out what the rest contains, who should merge them etc etc!
>
> and what is the answer for this..?

I do have a cover letter for this series , But CCed only to Actions
Semi SoC maintainers
and mailing list.

Also, As I said going forward I would Cc every stake holder at least
for cover letter.

Thanks
-Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
@ 2020-05-15  7:46           ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15  7:46 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andre Przywara, linux-actions, cristian.ciocaltea,
	Manivannan Sadhasivam, dmaengine, dan.j.williams,
	Andreas Färber, linux-arm-kernel

Hi

> > > So i see patch 1/9 and 2/9 in my inbox... where are the rest ? No cover
> > > to detail out what the rest contains, who should merge them etc etc!
>
> and what is the answer for this..?

I do have a cover letter for this series , But CCed only to Actions
Semi SoC maintainers
and mailing list.

Also, As I said going forward I would Cc every stake holder at least
for cover letter.

Thanks
-Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
  2020-05-15  7:46           ` Amit Tomer
@ 2020-05-15 11:11             ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15 11:11 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andre Przywara, Andreas Färber, Manivannan Sadhasivam,
	dan.j.williams, cristian.ciocaltea, dmaengine, linux-arm-kernel,
	linux-actions

Hi,

> I do have a cover letter for this series , But CCed only to Actions
> Semi SoC maintainers
> and mailing list.

and following is the link to cover letter for v1:

http://lists.infradead.org/pipermail/linux-arm-kernel/2020-May/732075.html

Thanks
-Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor
@ 2020-05-15 11:11             ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15 11:11 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andre Przywara, linux-actions, cristian.ciocaltea,
	Manivannan Sadhasivam, dmaengine, dan.j.williams,
	Andreas Färber, linux-arm-kernel

Hi,

> I do have a cover letter for this series , But CCed only to Actions
> Semi SoC maintainers
> and mailing list.

and following is the link to cover letter for v1:

http://lists.infradead.org/pipermail/linux-arm-kernel/2020-May/732075.html

Thanks
-Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-14 16:10   ` Amit Singh Tomar
@ 2020-05-15 15:01     ` André Przywara
  -1 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-15 15:01 UTC (permalink / raw)
  To: Amit Singh Tomar, afaerber, manivannan.sadhasivam, robh+dt
  Cc: cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

On 14/05/2020 17:10, Amit Singh Tomar wrote:

Hi,

> This commits adds support for MMC controllers present on Actions S700 SoC,
> there are 3 MMC controllers in this SoC which can be used for accessing
> SD/EMMC/SDIO cards.
> 
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
> ---
> Changes since RFC:
> 	* No change.
> ---
>  arch/arm64/boot/dts/actions/s700.dtsi | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
> index 56f2f84812cb..3f1fc3e48415 100644
> --- a/arch/arm64/boot/dts/actions/s700.dtsi
> +++ b/arch/arm64/boot/dts/actions/s700.dtsi
> @@ -258,5 +258,38 @@
>  			dma-requests = <44>;
>  			clocks = <&cmu CLK_DMAC>;
>  		};
> +
> +		mmc0: mmc@e0210000 {
> +			compatible = "actions,owl-mmc";

I was wondering if we should add a SoC specific compatible here, to be
on the safe side. The BSP driver seems to differentiate between S900 and
S700, although it looks like only to cover some misplaced platform setup.

But if we later find a problem, the DTs stay the same, and the driver
can easily be fixed.

So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
to the binding, but leaving the driver alone for now.

Cheers,
Andre

> +			reg = <0x0 0xe0210000 0x0 0x4000>;
> +			interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&cmu CLK_SD0>;
> +			resets = <&cmu RESET_SD0>;
> +			dmas = <&dma 2>;
> +			dma-names = "mmc";
> +			status = "disabled";
> +		};
> +
> +		mmc1: mmc@e0214000 {
> +			compatible = "actions,owl-mmc";
> +			reg = <0x0 0xe0214000 0x0 0x4000>;
> +			interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&cmu CLK_SD1>;
> +			resets = <&cmu RESET_SD1>;
> +			dmas = <&dma 3>;
> +			dma-names = "mmc";
> +			status = "disabled";
> +		};
> +
> +		mmc2: mmc@e0218000 {
> +			compatible = "actions,owl-mmc";
> +			reg = <0x0 0xe0218000 0x0 0x4000>;
> +			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&cmu CLK_SD2>;
> +			resets = <&cmu RESET_SD2>;
> +			dmas = <&dma 4>;
> +			dma-names = "mmc";
> +			status = "disabled";
> +		};
>  	};
>  };
> 


^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-15 15:01     ` André Przywara
  0 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-15 15:01 UTC (permalink / raw)
  To: Amit Singh Tomar, afaerber, manivannan.sadhasivam, robh+dt
  Cc: devicetree, linux-actions, linux-arm-kernel, cristian.ciocaltea

On 14/05/2020 17:10, Amit Singh Tomar wrote:

Hi,

> This commits adds support for MMC controllers present on Actions S700 SoC,
> there are 3 MMC controllers in this SoC which can be used for accessing
> SD/EMMC/SDIO cards.
> 
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
> ---
> Changes since RFC:
> 	* No change.
> ---
>  arch/arm64/boot/dts/actions/s700.dtsi | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/actions/s700.dtsi b/arch/arm64/boot/dts/actions/s700.dtsi
> index 56f2f84812cb..3f1fc3e48415 100644
> --- a/arch/arm64/boot/dts/actions/s700.dtsi
> +++ b/arch/arm64/boot/dts/actions/s700.dtsi
> @@ -258,5 +258,38 @@
>  			dma-requests = <44>;
>  			clocks = <&cmu CLK_DMAC>;
>  		};
> +
> +		mmc0: mmc@e0210000 {
> +			compatible = "actions,owl-mmc";

I was wondering if we should add a SoC specific compatible here, to be
on the safe side. The BSP driver seems to differentiate between S900 and
S700, although it looks like only to cover some misplaced platform setup.

But if we later find a problem, the DTs stay the same, and the driver
can easily be fixed.

So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
to the binding, but leaving the driver alone for now.

Cheers,
Andre

> +			reg = <0x0 0xe0210000 0x0 0x4000>;
> +			interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&cmu CLK_SD0>;
> +			resets = <&cmu RESET_SD0>;
> +			dmas = <&dma 2>;
> +			dma-names = "mmc";
> +			status = "disabled";
> +		};
> +
> +		mmc1: mmc@e0214000 {
> +			compatible = "actions,owl-mmc";
> +			reg = <0x0 0xe0214000 0x0 0x4000>;
> +			interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&cmu CLK_SD1>;
> +			resets = <&cmu RESET_SD1>;
> +			dmas = <&dma 3>;
> +			dma-names = "mmc";
> +			status = "disabled";
> +		};
> +
> +		mmc2: mmc@e0218000 {
> +			compatible = "actions,owl-mmc";
> +			reg = <0x0 0xe0218000 0x0 0x4000>;
> +			interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&cmu CLK_SD2>;
> +			resets = <&cmu RESET_SD2>;
> +			dmas = <&dma 4>;
> +			dma-names = "mmc";
> +			status = "disabled";
> +		};
>  	};
>  };
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
  2020-05-14 16:10   ` Amit Singh Tomar
@ 2020-05-15 15:54     ` André Przywara
  -1 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-15 15:54 UTC (permalink / raw)
  To: Amit Singh Tomar, afaerber, manivannan.sadhasivam, robh+dt
  Cc: cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

On 14/05/2020 17:10, Amit Singh Tomar wrote:

Hi,

> Converts the device tree bindings for the Actions Semi Owl SoCs DMA
> Controller over to YAML schemas.
> 
> It also adds new compatible string "actions,s700-dma" to match
> the driver.
> 
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
> ---
> New patch, was not there in RFC.
> ---
>  Documentation/devicetree/bindings/dma/owl-dma.txt  | 47 ------------
>  Documentation/devicetree/bindings/dma/owl-dma.yaml | 84 ++++++++++++++++++++++
>  2 files changed, 84 insertions(+), 47 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/dma/owl-dma.txt
>  create mode 100644 Documentation/devicetree/bindings/dma/owl-dma.yaml
> 
> diff --git a/Documentation/devicetree/bindings/dma/owl-dma.txt b/Documentation/devicetree/bindings/dma/owl-dma.txt
> deleted file mode 100644
> index 03e9bb12b75f..000000000000
> --- a/Documentation/devicetree/bindings/dma/owl-dma.txt
> +++ /dev/null
> @@ -1,47 +0,0 @@
> -* Actions Semi Owl SoCs DMA controller
> -
> -This binding follows the generic DMA bindings defined in dma.txt.
> -
> -Required properties:
> -- compatible: Should be "actions,s900-dma".
> -- reg: Should contain DMA registers location and length.
> -- interrupts: Should contain 4 interrupts shared by all channel.
> -- #dma-cells: Must be <1>. Used to represent the number of integer
> -              cells in the dmas property of client device.
> -- dma-channels: Physical channels supported.
> -- dma-requests: Number of DMA request signals supported by the controller.
> -                Refer to Documentation/devicetree/bindings/dma/dma.txt
> -- clocks: Phandle and Specifier of the clock feeding the DMA controller.
> -
> -Example:
> -
> -Controller:
> -                dma: dma-controller@e0260000 {
> -                        compatible = "actions,s900-dma";
> -                        reg = <0x0 0xe0260000 0x0 0x1000>;
> -                        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
> -                                     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
> -                                     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
> -                                     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
> -                        #dma-cells = <1>;
> -                        dma-channels = <12>;
> -                        dma-requests = <46>;
> -                        clocks = <&clock CLK_DMAC>;
> -                };
> -
> -Client:
> -
> -DMA clients connected to the Actions Semi Owl SoCs DMA controller must
> -use the format described in the dma.txt file, using a two-cell specifier
> -for each channel.
> -
> -The two cells in order are:
> -1. A phandle pointing to the DMA controller.
> -2. The channel id.
> -
> -uart5: serial@e012a000 {
> -        ...
> -        dma-names = "tx", "rx";
> -        dmas = <&dma 26>, <&dma 27>;
> -        ...
> -};
> diff --git a/Documentation/devicetree/bindings/dma/owl-dma.yaml b/Documentation/devicetree/bindings/dma/owl-dma.yaml
> new file mode 100644
> index 000000000000..12e68c0ece67
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dma/owl-dma.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/dma/owl-dma.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Actions Semi Owl SoCs DMA controller
> +
> +description: |
> +  The OWL DMA is a general-purpose direct memory access controller capable of
> +  supporting 10 and 12 independent DMA channels for S700 and S900 SoCs
> +  respectively.

From here on the description is pretty much how DMA controller
references work in general, so I don't see the point of including this
in the description here.

> +  DMA clients connected to the Actions Semi Owl SoCs DMA controller must
> +  use the format described in the owl-dma.yaml file, using a two-cell specifier
> +  for each channel.
> +
> +  The two cells in order are:
> +  1. A phandle pointing to the DMA controller.
> +  2. The channel id.
> +
> +  uart5: serial@e012a000 {
> +    ...
> +    dma-names = "tx", "rx";
> +    dmas = <&dma 26>, <&dma 27>;
> +    ...
> +  };
> +
> +maintainers:
> +  - Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> +
> +allOf:
> +  - $ref: "dma-controller.yaml#"
> +
> +properties:
> +  compatible:
> +    enum:
> +      - actions,s900-dma
> +      - actions,s700-dma
> +
> +  reg:
> +    maxItems: 1

Could you replace those "maxItems: 1" here and below with:
  - description: ...., copying in the explanation from the .txt binding?
That should serve the same purpose as "maxItems: 1", but is more
descriptive.

> +
> +  interrupts:
> +    maxItems: 4

Please mention that the controller supports 4 interrupts, which are
freely assignable to the interrupt channels.
(The kernel chose to use only one, but that's nothing the binding is
concerned about).

> +
> +  "#dma-cells":
> +    const: 1
> +
> +  dma-channels:
> +    maxItems: 1
> +
> +  dma-requests:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - "#dma-cells"
> +  - dma-channels
> +  - dma-requests
> +  - clocks
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    #include <dt-bindings/clock/actions,s700-cmu.h>

I would drop this line and replace CLK_DMAC with some number below, to
keep this *example* as independent as possible.

Cheers,
Andre

> +    dma: dma-controller@e0260000 {
> +        compatible = "actions,s900-dma";
> +        reg = <0x0 0xe0260000 0x0 0x1000>;
> +        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
> +                     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
> +                     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
> +                     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
> +        #dma-cells = <1>;
> +        dma-channels = <12>;
> +        dma-requests = <46>;
> +        clocks = <&clock CLK_DMAC>;
> +    };
> +
> +...
> 


^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
@ 2020-05-15 15:54     ` André Przywara
  0 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-15 15:54 UTC (permalink / raw)
  To: Amit Singh Tomar, afaerber, manivannan.sadhasivam, robh+dt
  Cc: devicetree, linux-actions, linux-arm-kernel, cristian.ciocaltea

On 14/05/2020 17:10, Amit Singh Tomar wrote:

Hi,

> Converts the device tree bindings for the Actions Semi Owl SoCs DMA
> Controller over to YAML schemas.
> 
> It also adds new compatible string "actions,s700-dma" to match
> the driver.
> 
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
> ---
> New patch, was not there in RFC.
> ---
>  Documentation/devicetree/bindings/dma/owl-dma.txt  | 47 ------------
>  Documentation/devicetree/bindings/dma/owl-dma.yaml | 84 ++++++++++++++++++++++
>  2 files changed, 84 insertions(+), 47 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/dma/owl-dma.txt
>  create mode 100644 Documentation/devicetree/bindings/dma/owl-dma.yaml
> 
> diff --git a/Documentation/devicetree/bindings/dma/owl-dma.txt b/Documentation/devicetree/bindings/dma/owl-dma.txt
> deleted file mode 100644
> index 03e9bb12b75f..000000000000
> --- a/Documentation/devicetree/bindings/dma/owl-dma.txt
> +++ /dev/null
> @@ -1,47 +0,0 @@
> -* Actions Semi Owl SoCs DMA controller
> -
> -This binding follows the generic DMA bindings defined in dma.txt.
> -
> -Required properties:
> -- compatible: Should be "actions,s900-dma".
> -- reg: Should contain DMA registers location and length.
> -- interrupts: Should contain 4 interrupts shared by all channel.
> -- #dma-cells: Must be <1>. Used to represent the number of integer
> -              cells in the dmas property of client device.
> -- dma-channels: Physical channels supported.
> -- dma-requests: Number of DMA request signals supported by the controller.
> -                Refer to Documentation/devicetree/bindings/dma/dma.txt
> -- clocks: Phandle and Specifier of the clock feeding the DMA controller.
> -
> -Example:
> -
> -Controller:
> -                dma: dma-controller@e0260000 {
> -                        compatible = "actions,s900-dma";
> -                        reg = <0x0 0xe0260000 0x0 0x1000>;
> -                        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
> -                                     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
> -                                     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
> -                                     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
> -                        #dma-cells = <1>;
> -                        dma-channels = <12>;
> -                        dma-requests = <46>;
> -                        clocks = <&clock CLK_DMAC>;
> -                };
> -
> -Client:
> -
> -DMA clients connected to the Actions Semi Owl SoCs DMA controller must
> -use the format described in the dma.txt file, using a two-cell specifier
> -for each channel.
> -
> -The two cells in order are:
> -1. A phandle pointing to the DMA controller.
> -2. The channel id.
> -
> -uart5: serial@e012a000 {
> -        ...
> -        dma-names = "tx", "rx";
> -        dmas = <&dma 26>, <&dma 27>;
> -        ...
> -};
> diff --git a/Documentation/devicetree/bindings/dma/owl-dma.yaml b/Documentation/devicetree/bindings/dma/owl-dma.yaml
> new file mode 100644
> index 000000000000..12e68c0ece67
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dma/owl-dma.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/dma/owl-dma.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Actions Semi Owl SoCs DMA controller
> +
> +description: |
> +  The OWL DMA is a general-purpose direct memory access controller capable of
> +  supporting 10 and 12 independent DMA channels for S700 and S900 SoCs
> +  respectively.

From here on the description is pretty much how DMA controller
references work in general, so I don't see the point of including this
in the description here.

> +  DMA clients connected to the Actions Semi Owl SoCs DMA controller must
> +  use the format described in the owl-dma.yaml file, using a two-cell specifier
> +  for each channel.
> +
> +  The two cells in order are:
> +  1. A phandle pointing to the DMA controller.
> +  2. The channel id.
> +
> +  uart5: serial@e012a000 {
> +    ...
> +    dma-names = "tx", "rx";
> +    dmas = <&dma 26>, <&dma 27>;
> +    ...
> +  };
> +
> +maintainers:
> +  - Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> +
> +allOf:
> +  - $ref: "dma-controller.yaml#"
> +
> +properties:
> +  compatible:
> +    enum:
> +      - actions,s900-dma
> +      - actions,s700-dma
> +
> +  reg:
> +    maxItems: 1

Could you replace those "maxItems: 1" here and below with:
  - description: ...., copying in the explanation from the .txt binding?
That should serve the same purpose as "maxItems: 1", but is more
descriptive.

> +
> +  interrupts:
> +    maxItems: 4

Please mention that the controller supports 4 interrupts, which are
freely assignable to the interrupt channels.
(The kernel chose to use only one, but that's nothing the binding is
concerned about).

> +
> +  "#dma-cells":
> +    const: 1
> +
> +  dma-channels:
> +    maxItems: 1
> +
> +  dma-requests:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - "#dma-cells"
> +  - dma-channels
> +  - dma-requests
> +  - clocks
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    #include <dt-bindings/clock/actions,s700-cmu.h>

I would drop this line and replace CLK_DMAC with some number below, to
keep this *example* as independent as possible.

Cheers,
Andre

> +    dma: dma-controller@e0260000 {
> +        compatible = "actions,s900-dma";
> +        reg = <0x0 0xe0260000 0x0 0x1000>;
> +        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
> +                     <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>,
> +                     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>,
> +                     <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
> +        #dma-cells = <1>;
> +        dma-channels = <12>;
> +        dma-requests = <46>;
> +        clocks = <&clock CLK_DMAC>;
> +    };
> +
> +...
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-15 15:01     ` André Przywara
@ 2020-05-15 18:41       ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15 18:41 UTC (permalink / raw)
  To: André Przywara
  Cc: Andreas Färber, Manivannan Sadhasivam, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

Hi,

> I was wondering if we should add a SoC specific compatible here, to be
> on the safe side. The BSP driver seems to differentiate between S900 and
> S700, although it looks like only to cover some misplaced platform setup.
>
> But if we later find a problem, the DTs stay the same, and the driver
> can easily be fixed.
>
> So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
> to the binding, but leaving the driver alone for now.

I think, it can be a good idea to have this extra compatible string that may
be needed when MMC driver evolves to support more features which requires
data to be differentiated based on SoC.

Thanks
Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-15 18:41       ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15 18:41 UTC (permalink / raw)
  To: André Przywara
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel

Hi,

> I was wondering if we should add a SoC specific compatible here, to be
> on the safe side. The BSP driver seems to differentiate between S900 and
> S700, although it looks like only to cover some misplaced platform setup.
>
> But if we later find a problem, the DTs stay the same, and the driver
> can easily be fixed.
>
> So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
> to the binding, but leaving the driver alone for now.

I think, it can be a good idea to have this extra compatible string that may
be needed when MMC driver evolves to support more features which requires
data to be differentiated based on SoC.

Thanks
Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
  2020-05-15 15:54     ` André Przywara
@ 2020-05-15 19:05       ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15 19:05 UTC (permalink / raw)
  To: André Przywara
  Cc: Andreas Färber, Manivannan Sadhasivam, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

Hi,

> Could you replace those "maxItems: 1" here and below with:
>   - description: ...., copying in the explanation from the .txt binding?
> That should serve the same purpose as "maxItems: 1", but is more
> descriptive.

But having it under reg: looks bit odd to me, no?

reg:
   - description: ...

Or did you mean something else ?

Thanks
-Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
@ 2020-05-15 19:05       ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15 19:05 UTC (permalink / raw)
  To: André Przywara
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel

Hi,

> Could you replace those "maxItems: 1" here and below with:
>   - description: ...., copying in the explanation from the .txt binding?
> That should serve the same purpose as "maxItems: 1", but is more
> descriptive.

But having it under reg: looks bit odd to me, no?

reg:
   - description: ...

Or did you mean something else ?

Thanks
-Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
  2020-05-15 19:05       ` Amit Tomer
@ 2020-05-15 19:24         ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15 19:24 UTC (permalink / raw)
  To: André Przywara
  Cc: Andreas Färber, Manivannan Sadhasivam, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

> But having it under reg: looks bit odd to me, no?
>
> reg:
>    - description: ...
>
> Or did you mean something else ?

Ah, I see you wanted to have description for individual items, for instance one
for reg, one for interrupts and clock etc..

Thanks
Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
@ 2020-05-15 19:24         ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-15 19:24 UTC (permalink / raw)
  To: André Przywara
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel

> But having it under reg: looks bit odd to me, no?
>
> reg:
>    - description: ...
>
> Or did you mean something else ?

Ah, I see you wanted to have description for individual items, for instance one
for reg, one for interrupts and clock etc..

Thanks
Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
  2020-05-15 15:54     ` André Przywara
@ 2020-05-16 18:21       ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-16 18:21 UTC (permalink / raw)
  To: André Przywara
  Cc: Andreas Färber, Manivannan Sadhasivam, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

Hi,

> (The kernel chose to use only one, but that's nothing the binding is
> concerned about).
But there are four different interrupt events corresponds to these four
interrupts.
So, if Kernel chooses to have only one interrupt , how other events
would be notified ?

Thanks
-Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml
@ 2020-05-16 18:21       ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-16 18:21 UTC (permalink / raw)
  To: André Przywara
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel

Hi,

> (The kernel chose to use only one, but that's nothing the binding is
> concerned about).
But there are four different interrupt events corresponds to these four
interrupts.
So, if Kernel chooses to have only one interrupt , how other events
would be notified ?

Thanks
-Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-15 15:01     ` André Przywara
@ 2020-05-17 11:56       ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-17 11:56 UTC (permalink / raw)
  To: André Przywara
  Cc: Andreas Färber, Manivannan Sadhasivam, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

Hi,

> So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
> to the binding, but leaving the driver alone for now.

But if we leave this new string from driver , there would be DT
validation issue.
Are we okay with it ?

Thanks
-Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-17 11:56       ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-17 11:56 UTC (permalink / raw)
  To: André Przywara
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel

Hi,

> So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
> to the binding, but leaving the driver alone for now.

But if we leave this new string from driver , there would be DT
validation issue.
Are we okay with it ?

Thanks
-Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-17 11:56       ` Amit Tomer
@ 2020-05-17 16:42         ` André Przywara
  -1 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-17 16:42 UTC (permalink / raw)
  To: Amit Tomer
  Cc: Andreas Färber, Manivannan Sadhasivam, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

On 17/05/2020 12:56, Amit Tomer wrote:
> Hi,
> 
>> So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
>> to the binding, but leaving the driver alone for now.
> 
> But if we leave this new string from driver , there would be DT
> validation issue.

I don't understand what this has to do with the driver, but I asked
above to also change the binding, allowing this compatible string
combination.

Cheers,
Andre

> Are we okay with it ?
> 
> Thanks
> -Amit
> 


^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-17 16:42         ` André Przywara
  0 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-17 16:42 UTC (permalink / raw)
  To: Amit Tomer
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel

On 17/05/2020 12:56, Amit Tomer wrote:
> Hi,
> 
>> So, using "actions,s700-mmc", "actions,owl-mmc" here, adding this combo
>> to the binding, but leaving the driver alone for now.
> 
> But if we leave this new string from driver , there would be DT
> validation issue.

I don't understand what this has to do with the driver, but I asked
above to also change the binding, allowing this compatible string
combination.

Cheers,
Andre

> Are we okay with it ?
> 
> Thanks
> -Amit
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-17 16:42         ` André Przywara
@ 2020-05-17 17:12           ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-17 17:12 UTC (permalink / raw)
  To: André Przywara
  Cc: Andreas Färber, Manivannan Sadhasivam, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

> I don't understand what this has to do with the driver, but I asked
> above to also change the binding, allowing this compatible string
> combination.
if we add these two strings "actions,s700-mmc", "actions,owl-mmc" to dts file
and leave the driver as it. Wouldn't this be mismatch(as driver only
has "actions,owl-mmc"
and DTS has two strings).

Shouldn't that be concerned about  ?

Thanks
-Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-17 17:12           ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-17 17:12 UTC (permalink / raw)
  To: André Przywara
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel

> I don't understand what this has to do with the driver, but I asked
> above to also change the binding, allowing this compatible string
> combination.
if we add these two strings "actions,s700-mmc", "actions,owl-mmc" to dts file
and leave the driver as it. Wouldn't this be mismatch(as driver only
has "actions,owl-mmc"
and DTS has two strings).

Shouldn't that be concerned about  ?

Thanks
-Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-17 17:12           ` Amit Tomer
@ 2020-05-17 21:30             ` André Przywara
  -1 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-17 21:30 UTC (permalink / raw)
  To: Amit Tomer
  Cc: Andreas Färber, Manivannan Sadhasivam, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

On 17/05/2020 18:12, Amit Tomer wrote:
>> I don't understand what this has to do with the driver, but I asked
>> above to also change the binding, allowing this compatible string
>> combination.
> if we add these two strings "actions,s700-mmc", "actions,owl-mmc" to dts file
> and leave the driver as it. Wouldn't this be mismatch(as driver only
> has "actions,owl-mmc"
> and DTS has two strings).
> 
> Shouldn't that be concerned about  ?

I recommend reading the DT spec, chapter 2.3.1 "compatible":
https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf

Cheers,
Andre

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-17 21:30             ` André Przywara
  0 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-17 21:30 UTC (permalink / raw)
  To: Amit Tomer
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel

On 17/05/2020 18:12, Amit Tomer wrote:
>> I don't understand what this has to do with the driver, but I asked
>> above to also change the binding, allowing this compatible string
>> combination.
> if we add these two strings "actions,s700-mmc", "actions,owl-mmc" to dts file
> and leave the driver as it. Wouldn't this be mismatch(as driver only
> has "actions,owl-mmc"
> and DTS has two strings).
> 
> Shouldn't that be concerned about  ?

I recommend reading the DT spec, chapter 2.3.1 "compatible":
https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf

Cheers,
Andre

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-17 21:30             ` André Przywara
@ 2020-05-18  3:06               ` Amit Tomer
  -1 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-18  3:06 UTC (permalink / raw)
  To: André Przywara
  Cc: Andreas Färber, Manivannan Sadhasivam, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

Hi,

> I recommend reading the DT spec, chapter 2.3.1 "compatible":
> https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf

My point is more about, DT validation is not happy about this situation.
For instance when I run dt-validate, do see following:

/home/amit/work/kernel_work/linux/arch/arm64/boot/dts/actions/s700-cubieboard7.dt.yaml:
mmc@e0210000: compatible: Additional items are not allowed
('actions,s700-mmc' was unexpected)

and I am not sure if this is because DT and driver has different
number of compatible strings.

Thanks
Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-18  3:06               ` Amit Tomer
  0 siblings, 0 replies; 58+ messages in thread
From: Amit Tomer @ 2020-05-18  3:06 UTC (permalink / raw)
  To: André Przywara
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Manivannan Sadhasivam, Andreas Färber, linux-arm-kernel

Hi,

> I recommend reading the DT spec, chapter 2.3.1 "compatible":
> https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf

My point is more about, DT validation is not happy about this situation.
For instance when I run dt-validate, do see following:

/home/amit/work/kernel_work/linux/arch/arm64/boot/dts/actions/s700-cubieboard7.dt.yaml:
mmc@e0210000: compatible: Additional items are not allowed
('actions,s700-mmc' was unexpected)

and I am not sure if this is because DT and driver has different
number of compatible strings.

Thanks
Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-18  3:06               ` Amit Tomer
@ 2020-05-18  6:17                 ` Manivannan Sadhasivam
  -1 siblings, 0 replies; 58+ messages in thread
From: Manivannan Sadhasivam @ 2020-05-18  6:17 UTC (permalink / raw)
  To: Amit Tomer
  Cc: André Przywara, Andreas Färber, Rob Herring,
	cristian.ciocaltea, linux-arm-kernel, linux-actions, devicetree

On 0518, Amit Tomer wrote:
> Hi,
> 
> > I recommend reading the DT spec, chapter 2.3.1 "compatible":
> > https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf
> 
> My point is more about, DT validation is not happy about this situation.
> For instance when I run dt-validate, do see following:
> 
> /home/amit/work/kernel_work/linux/arch/arm64/boot/dts/actions/s700-cubieboard7.dt.yaml:
> mmc@e0210000: compatible: Additional items are not allowed
> ('actions,s700-mmc' was unexpected)
> 
> and I am not sure if this is because DT and driver has different
> number of compatible strings.
> 

Yeah, the DT YAML validation tool doesn't allow this. And there were patches
removing the additional compatible from DTS.

I don't know if the DT fallback is discouraged or not.

Anyway, is enough investigation done to justify that we need SoC specific tweaks
in the driver? I think I did look into the downstream code for s700/s500 while
upstreaming this driver and convinced myself that the same driver could be
reused without modifications.

Thanks,
Mani

> Thanks
> Amit

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-18  6:17                 ` Manivannan Sadhasivam
  0 siblings, 0 replies; 58+ messages in thread
From: Manivannan Sadhasivam @ 2020-05-18  6:17 UTC (permalink / raw)
  To: Amit Tomer
  Cc: devicetree, André Przywara, linux-actions,
	cristian.ciocaltea, Rob Herring, Andreas Färber,
	linux-arm-kernel

On 0518, Amit Tomer wrote:
> Hi,
> 
> > I recommend reading the DT spec, chapter 2.3.1 "compatible":
> > https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf
> 
> My point is more about, DT validation is not happy about this situation.
> For instance when I run dt-validate, do see following:
> 
> /home/amit/work/kernel_work/linux/arch/arm64/boot/dts/actions/s700-cubieboard7.dt.yaml:
> mmc@e0210000: compatible: Additional items are not allowed
> ('actions,s700-mmc' was unexpected)
> 
> and I am not sure if this is because DT and driver has different
> number of compatible strings.
> 

Yeah, the DT YAML validation tool doesn't allow this. And there were patches
removing the additional compatible from DTS.

I don't know if the DT fallback is discouraged or not.

Anyway, is enough investigation done to justify that we need SoC specific tweaks
in the driver? I think I did look into the downstream code for s700/s500 while
upstreaming this driver and convinced myself that the same driver could be
reused without modifications.

Thanks,
Mani

> Thanks
> Amit

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-18  6:17                 ` Manivannan Sadhasivam
@ 2020-05-18  8:29                   ` André Przywara
  -1 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-18  8:29 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Amit Tomer
  Cc: Andreas Färber, Rob Herring, cristian.ciocaltea,
	linux-arm-kernel, linux-actions, devicetree

On 18/05/2020 07:17, Manivannan Sadhasivam wrote:
> On 0518, Amit Tomer wrote:
>> Hi,
>>
>>> I recommend reading the DT spec, chapter 2.3.1 "compatible":
>>> https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf
>>
>> My point is more about, DT validation is not happy about this situation.
>> For instance when I run dt-validate, do see following:
>>
>> /home/amit/work/kernel_work/linux/arch/arm64/boot/dts/actions/s700-cubieboard7.dt.yaml:
>> mmc@e0210000: compatible: Additional items are not allowed
>> ('actions,s700-mmc' was unexpected)
>>
>> and I am not sure if this is because DT and driver has different
>> number of compatible strings.

This has nothing to do with the driver or the actual .dts(i), that's
purely a binding issue.

> Yeah, the DT YAML validation tool doesn't allow this. And there were patches
> removing the additional compatible from DTS.

There are tons of examples of how this is done in the .yaml bindings:
properties:
  compatible:
    oneOf:
      - const: actions,owl-mmc
      - items:
         - const: action,s700-mmc
         - const: actions,owl-mmc

Adding more alternatives would replace the lines after items:
         - enum
            - action,s700-mmc
            - action,s900-mmc
         - const: actions,owl-mmc

> I don't know if the DT fallback is discouraged or not.

I don't know if there is an "official" statement on this, but last thing
I heard, adding SoC specific compatibles to generic fallback strings was
encouraged. Hence my proposal, to add one.

> Anyway, is enough investigation done to justify that we need SoC specific tweaks
> in the driver? I think I did look into the downstream code for s700/s500 while
> upstreaming this driver and convinced myself that the same driver could be
> reused without modifications.

It wouldn't be the first time some tiny incompatibility would be
discovered later, also there is always the chance of a hardware errata.
So better safe than sorry.

Cheers,
Andre.

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-18  8:29                   ` André Przywara
  0 siblings, 0 replies; 58+ messages in thread
From: André Przywara @ 2020-05-18  8:29 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Amit Tomer
  Cc: devicetree, linux-actions, cristian.ciocaltea, Rob Herring,
	Andreas Färber, linux-arm-kernel

On 18/05/2020 07:17, Manivannan Sadhasivam wrote:
> On 0518, Amit Tomer wrote:
>> Hi,
>>
>>> I recommend reading the DT spec, chapter 2.3.1 "compatible":
>>> https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf
>>
>> My point is more about, DT validation is not happy about this situation.
>> For instance when I run dt-validate, do see following:
>>
>> /home/amit/work/kernel_work/linux/arch/arm64/boot/dts/actions/s700-cubieboard7.dt.yaml:
>> mmc@e0210000: compatible: Additional items are not allowed
>> ('actions,s700-mmc' was unexpected)
>>
>> and I am not sure if this is because DT and driver has different
>> number of compatible strings.

This has nothing to do with the driver or the actual .dts(i), that's
purely a binding issue.

> Yeah, the DT YAML validation tool doesn't allow this. And there were patches
> removing the additional compatible from DTS.

There are tons of examples of how this is done in the .yaml bindings:
properties:
  compatible:
    oneOf:
      - const: actions,owl-mmc
      - items:
         - const: action,s700-mmc
         - const: actions,owl-mmc

Adding more alternatives would replace the lines after items:
         - enum
            - action,s700-mmc
            - action,s900-mmc
         - const: actions,owl-mmc

> I don't know if the DT fallback is discouraged or not.

I don't know if there is an "official" statement on this, but last thing
I heard, adding SoC specific compatibles to generic fallback strings was
encouraged. Hence my proposal, to add one.

> Anyway, is enough investigation done to justify that we need SoC specific tweaks
> in the driver? I think I did look into the downstream code for s700/s500 while
> upstreaming this driver and convinced myself that the same driver could be
> reused without modifications.

It wouldn't be the first time some tiny incompatibility would be
discovered later, also there is always the chance of a hardware errata.
So better safe than sorry.

Cheers,
Andre.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
  2020-05-18  8:29                   ` André Przywara
@ 2020-05-18  9:48                     ` Andreas Färber
  -1 siblings, 0 replies; 58+ messages in thread
From: Andreas Färber @ 2020-05-18  9:48 UTC (permalink / raw)
  To: André Przywara, Manivannan Sadhasivam, Amit Tomer
  Cc: Rob Herring, cristian.ciocaltea, linux-arm-kernel, linux-actions,
	devicetree

Hi,

Am 18.05.20 um 10:29 schrieb André Przywara:
> On 18/05/2020 07:17, Manivannan Sadhasivam wrote:
>> I don't know if the DT fallback is discouraged or not.
> 
> I don't know if there is an "official" statement on this, but last thing
> I heard, adding SoC specific compatibles to generic fallback strings was
> encouraged. Hence my proposal, to add one.

I believe the official guidance would be to never be too generic in the 
first place. I.e., prefer s500 (oldest model tested) over generic owl.

But now that we have it, prepending a more specific one (rather than 
replacing it) is the only way to go. In that case the binding needs to 
be changed to allow both the old and the recommended new variant, as 
André points out. Please add a comment to help bindings readers choose 
which of the two to adopt then.

Amit, next time please quote errors you see right away, that could've 
spared a handful of messages discussing about the driver when it was in 
fact just a bindings issue (which you had been asked to fix by André).

Regards,
Andreas

-- 
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700
@ 2020-05-18  9:48                     ` Andreas Färber
  0 siblings, 0 replies; 58+ messages in thread
From: Andreas Färber @ 2020-05-18  9:48 UTC (permalink / raw)
  To: André Przywara, Manivannan Sadhasivam, Amit Tomer
  Cc: devicetree, Rob Herring, linux-actions, linux-arm-kernel,
	cristian.ciocaltea

Hi,

Am 18.05.20 um 10:29 schrieb André Przywara:
> On 18/05/2020 07:17, Manivannan Sadhasivam wrote:
>> I don't know if the DT fallback is discouraged or not.
> 
> I don't know if there is an "official" statement on this, but last thing
> I heard, adding SoC specific compatibles to generic fallback strings was
> encouraged. Hence my proposal, to add one.

I believe the official guidance would be to never be too generic in the 
first place. I.e., prefer s500 (oldest model tested) over generic owl.

But now that we have it, prepending a more specific one (rather than 
replacing it) is the only way to go. In that case the binding needs to 
be changed to allow both the old and the recommended new variant, as 
André points out. Please add a comment to help bindings readers choose 
which of the two to adopt then.

Amit, next time please quote errors you see right away, that could've 
spared a handful of messages discussing about the driver when it was in 
fact just a bindings issue (which you had been asked to fix by André).

Regards,
Andreas

-- 
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer
HRB 36809 (AG Nürnberg)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 58+ messages in thread

end of thread, other threads:[~2020-05-18  9:48 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14 16:10 [PATCH v1 0/9] Add MMC and DMA support for Actions S700 Amit Singh Tomar
2020-05-14 16:10 ` [PATCH v1 1/9] dmaengine: Actions: get rid of bit fields from dma descriptor Amit Singh Tomar
2020-05-14 16:10   ` Amit Singh Tomar
2020-05-14 18:27   ` Vinod Koul
2020-05-14 18:27     ` Vinod Koul
2020-05-14 18:34     ` Amit Tomer
2020-05-14 18:34       ` Amit Tomer
2020-05-15  6:58       ` Vinod Koul
2020-05-15  6:58         ` Vinod Koul
2020-05-15  7:46         ` Amit Tomer
2020-05-15  7:46           ` Amit Tomer
2020-05-15 11:11           ` Amit Tomer
2020-05-15 11:11             ` Amit Tomer
2020-05-14 16:10 ` [PATCH v1 2/9] dmaengine: Actions: Add support for S700 DMA engine Amit Singh Tomar
2020-05-14 16:10   ` Amit Singh Tomar
2020-05-14 17:02   ` André Przywara
2020-05-14 17:02     ` André Przywara
2020-05-14 16:10 ` [PATCH v1 3/9] clk: actions: Add MMC clock-register reset bits Amit Singh Tomar
2020-05-14 16:10 ` [PATCH v1 4/9] arm64: dts: actions: do not merge disable sps node from S700 Amit Singh Tomar
2020-05-14 16:10   ` Amit Singh Tomar
2020-05-14 16:10 ` [PATCH v1 5/9] dt-bindings: dmaengine: convert Actions Semi Owl SoCs bindings to yaml Amit Singh Tomar
2020-05-14 16:10   ` Amit Singh Tomar
2020-05-15 15:54   ` André Przywara
2020-05-15 15:54     ` André Przywara
2020-05-15 19:05     ` Amit Tomer
2020-05-15 19:05       ` Amit Tomer
2020-05-15 19:24       ` Amit Tomer
2020-05-15 19:24         ` Amit Tomer
2020-05-16 18:21     ` Amit Tomer
2020-05-16 18:21       ` Amit Tomer
2020-05-14 16:10 ` [PATCH v1 6/9] arm64: dts: actions: Add DMA Controller for S700 Amit Singh Tomar
2020-05-14 16:10   ` Amit Singh Tomar
2020-05-14 16:10 ` [PATCH v1 7/9] dt-bindings: reset: s700: Add binding constants for mmc Amit Singh Tomar
2020-05-14 16:10   ` Amit Singh Tomar
2020-05-14 16:10 ` [PATCH v1 8/9] arm64: dts: actions: Add MMC controller support for S700 Amit Singh Tomar
2020-05-14 16:10   ` Amit Singh Tomar
2020-05-15 15:01   ` André Przywara
2020-05-15 15:01     ` André Przywara
2020-05-15 18:41     ` Amit Tomer
2020-05-15 18:41       ` Amit Tomer
2020-05-17 11:56     ` Amit Tomer
2020-05-17 11:56       ` Amit Tomer
2020-05-17 16:42       ` André Przywara
2020-05-17 16:42         ` André Przywara
2020-05-17 17:12         ` Amit Tomer
2020-05-17 17:12           ` Amit Tomer
2020-05-17 21:30           ` André Przywara
2020-05-17 21:30             ` André Przywara
2020-05-18  3:06             ` Amit Tomer
2020-05-18  3:06               ` Amit Tomer
2020-05-18  6:17               ` Manivannan Sadhasivam
2020-05-18  6:17                 ` Manivannan Sadhasivam
2020-05-18  8:29                 ` André Przywara
2020-05-18  8:29                   ` André Przywara
2020-05-18  9:48                   ` Andreas Färber
2020-05-18  9:48                     ` Andreas Färber
2020-05-14 16:10 ` [PATCH v1 9/9] arm64: dts: actions: Add uSD support for Cubieboard7 Amit Singh Tomar
2020-05-14 16:10   ` Amit Singh Tomar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.