Skip to contentSkip to conversation

Aspeed: Enable video engine

PATCH Applied Eddie James 8 participants 16 messages Apr 2, 2019 – Apr 24, 2019

Subsystems (4)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Aspeed: Enable video engine

This series enables the video engine on Aspeed BMC platforms. The video engine clocking is added to the Aspeed clock driver. The use of the video engine reset line, originally planned to be made externally available in the clock driver, is removed from the video engine driver. Finally a node for the video engine is added to the AST2500 devicetree.
The series also includes a missing property for reserved memory in the devicetree documentation, and a small change to make the video engine driver start without reserved memory.

Eddie James (5):
media: platform: Aspeed: Remove use of reset line
media: platform: Aspeed: Make reserved memory optional
media: dt-bindings: aspeed-video: Add missing memory-region property
clk: Aspeed: Setup video engine clocking
ARM: dts: aspeed-g5: Add video engine

 .../devicetree/bindings/media/aspeed-video.txt     |  6 ++++
 arch/arm/boot/dts/aspeed-g5.dtsi                   | 10 ++++++
 drivers/clk/clk-aspeed.c                           | 42 ++++++++++++++++++++--
 drivers/media/platform/aspeed-video.c              | 33 ++++-------------
 4 files changed, 61 insertions(+), 30 deletions(-)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/5 media: platform: Aspeed: Remove use of reset line

The reset line is toggled by enabling the clocks, so it's not necessary to manually toggle the reset as well.

---
 drivers/media/platform/aspeed-video.c | 27 +++++----------------------
 1 file changed, 5 insertions(+), 22 deletions(-)
drivers/media/platform/aspeed-video.c +5 -22
index 692e08e..55c55a6 100644
@@ -14,7 +14,6 @@
 #include <linux/of_irq.h>
 #include <linux/of_reserved_mem.h>
 #include <linux/platform_device.h>
-#include <linux/reset.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/string.h>
@@ -208,7 +207,6 @@ struct aspeed_video {
 	void __iomem *base;
 	struct clk *eclk;
 	struct clk *vclk;
-	struct reset_control *rst;
 
 	struct device *dev;
 	struct v4l2_ctrl_handler ctrl_handler;
@@ -483,19 +481,10 @@ static void aspeed_video_enable_mode_detect(struct aspeed_video *video)
 	aspeed_video_update(video, VE_SEQ_CTRL, 0, VE_SEQ_CTRL_TRIG_MODE_DET);
 }
 
-static void aspeed_video_reset(struct aspeed_video *video)
-{
-	/* Reset the engine */
-	reset_control_assert(video->rst);
-
-	/* Don't usleep here; function may be called in interrupt context */
-	udelay(100);
-	reset_control_deassert(video->rst);
-}
-
 static void aspeed_video_off(struct aspeed_video *video)
 {
-	aspeed_video_reset(video);
+	/* Disable interrupts */
+	aspeed_video_write(video, VE_INTERRUPT_CTRL, 0);
 
 	/* Turn off the relevant clocks */
 	clk_disable_unprepare(video->vclk);
@@ -507,8 +496,6 @@ static void aspeed_video_on(struct aspeed_video *video)
 	/* Turn on the relevant clocks */
 	clk_prepare_enable(video->eclk);
 	clk_prepare_enable(video->vclk);
-
-	aspeed_video_reset(video);
 }
 
 static void aspeed_video_bufs_done(struct aspeed_video *video,
@@ -1464,7 +1451,9 @@ static void aspeed_video_stop_streaming(struct vb2_queue *q)
 		 * Need to force stop any DMA and try and get HW into a good
 		 * state for future calls to start streaming again.
 		 */
-		aspeed_video_reset(video);
+		aspeed_video_off(video);
+		aspeed_video_on(video);
+
 		aspeed_video_init_regs(video);
 
 		aspeed_video_get_resolution(video);
@@ -1619,12 +1608,6 @@ static int aspeed_video_init(struct aspeed_video *video)
 		return PTR_ERR(video->vclk);
 	}
 
-	video->rst = devm_reset_control_get_exclusive(dev, NULL);
-	if (IS_ERR(video->rst)) {
-		dev_err(dev, "Unable to get VE reset\n");
-		return PTR_ERR(video->rst);
-	}
-
 	rc = of_reserved_mem_device_init(dev);
 	if (rc) {
 		dev_err(dev, "Unable to reserve memory\n");
Signature · 1 line
1.8.3.1
#3 lore raw

PATCH 2/5 media: platform: Aspeed: Make reserved memory optional

In reply to Eddie James

Reserved memory doesn't need to be required; system memory would work fine.

---
 drivers/media/platform/aspeed-video.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/media/platform/aspeed-video.c +1 -5
index 55c55a6..8144fe3 100644
@@ -1608,11 +1608,7 @@ static int aspeed_video_init(struct aspeed_video *video)
 		return PTR_ERR(video->vclk);
 	}
 
-	rc = of_reserved_mem_device_init(dev);
-	if (rc) {
-		dev_err(dev, "Unable to reserve memory\n");
-		return rc;
-	}
+	of_reserved_mem_device_init(dev);
 
 	rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
 	if (rc) {
Signature · 1 line
1.8.3.1
#4 lore raw

Re: [PATCH 2/5] media: platform: Aspeed: Make reserved memory optional

Quoted 2 lines · Eddie James

Reserved memory doesn't need to be required; system memory would work fine.

I had to do a bit of legwork to understand what you were doing here. My understanding is that we allocate out of the default CMA region if the memory-region property isn't specified. Is that what you're expecting? Could be helpful to be a little less terse in the commit message.

Quoted 12 lines
---
 drivers/media/platform/aspeed-video.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/media/platform/aspeed-video.c +0 -0
index 55c55a6..8144fe3 100644

drivers/media/platform/aspeed-video.c static int aspeed_video_init(struct aspeed_video · line 1612

Quoted 10 lines
drivers/media/platform/aspeed-video.c +1 -5
@@ -1608,11 +1608,7 @@ static int aspeed_video_init(struct aspeed_video 
 *video)
 		return PTR_ERR(video->vclk);
 	}
 
-	rc = of_reserved_mem_device_init(dev);
-	if (rc) {
-		dev_err(dev, "Unable to reserve memory\n");
-		return rc;
-	}
+	of_reserved_mem_device_init(dev);

You're ignoring *all* errors here with the expectation that the cause is the missing memory-region property. However, other errors can propagate out of of_reserved_mem_device_init() - e.g. ENOMEM. Rather than remove error checking, I think you should explicitly test for ENODEV, which is what is returned if the memory-region property is absent.

Cheers,

Andrew

Quoted 7 lines
drivers/media/platform/aspeed-video.c +0 -0
 	rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
 	if (rc) {
Signature · 1 line
1.8.3.1
#5 lore raw

Re: [PATCH 2/5] media: platform: Aspeed: Make reserved memory optional

Quoted 8 lines · Andrew Jeffery
Quoted 2 lines · Eddie James

Reserved memory doesn't need to be required; system memory would work fine.

I had to do a bit of legwork to understand what you were doing here. My understanding is that we allocate out of the default CMA region if the memory-region property isn't specified. Is that what you're expecting? Could be helpful to be a little less terse in the commit message.

Correct.

Quoted 16 lines
Quoted 16 lines
---
  drivers/media/platform/aspeed-video.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
drivers/media/platform/aspeed-video.c +0 -0
index 55c55a6..8144fe3 100644
@@ -1608,11 +1608,7 @@ static int aspeed_video_init(struct aspeed_video
 *video)
  		return PTR_ERR(video->vclk);
  	}
 
Quoted 11 lines

drivers/media/platform/aspeed-video.c static int aspeed_video_init(struct aspeed_video *video) · line 1611

Quoted 6 lines
drivers/media/platform/aspeed-video.c +1 -5
-	rc = of_reserved_mem_device_init(dev);
-	if (rc) {
-		dev_err(dev, "Unable to reserve memory\n");
-		return rc;
-	}
+	of_reserved_mem_device_init(dev);

You're ignoring *all* errors here with the expectation that the cause is the missing memory-region property. However, other errors can propagate out of of_reserved_mem_device_init() - e.g. ENOMEM. Rather than remove error checking, I think you should explicitly test for ENODEV, which is what is returned if the memory-region property is absent.

But it doesn't matter if it fails for any reason, any DMA allocation should fall back to default CMA memory. In the case of ENOMEM or other errors, then the later calls to allocate DMA may fail and we can deal with it then.

Thanks,

Eddie

Quoted 12 lines

Cheers,

Andrew

Quoted 7 lines
drivers/media/platform/aspeed-video.c +0 -0
  	rc = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
  	if (rc) {
Signature · 1 line
1.8.3.1
#6 lore raw

Re: [PATCH 2/5] media: platform: Aspeed: Make reserved memory optional

Quoted 44 lines · Eddie James
Quoted 8 lines · Andrew Jeffery
Quoted 2 lines · Eddie James

Reserved memory doesn't need to be required; system memory would work fine.

I had to do a bit of legwork to understand what you were doing here. My understanding is that we allocate out of the default CMA region if the memory-region property isn't specified. Is that what you're expecting? Could be helpful to be a little less terse in the commit message.

Correct.

Quoted 16 lines
Quoted 16 lines
---
  drivers/media/platform/aspeed-video.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
drivers/media/platform/aspeed-video.c +0 -0
index 55c55a6..8144fe3 100644
@@ -1608,11 +1608,7 @@ static int aspeed_video_init(struct aspeed_video
 *video)
  		return PTR_ERR(video->vclk);
  	}
 
Quoted 11 lines

drivers/media/platform/aspeed-video.c static int aspeed_video_init(struct aspeed_video *video) · line 1611

Quoted 6 lines
drivers/media/platform/aspeed-video.c +1 -5
-	rc = of_reserved_mem_device_init(dev);
-	if (rc) {
-		dev_err(dev, "Unable to reserve memory\n");
-		return rc;
-	}
+	of_reserved_mem_device_init(dev);

You're ignoring *all* errors here with the expectation that the cause is the missing memory-region property. However, other errors can propagate out of of_reserved_mem_device_init() - e.g. ENOMEM. Rather than remove error checking, I think you should explicitly test for ENODEV, which is what is returned if the memory-region property is absent.

Quoted 4 lines

But it doesn't matter if it fails for any reason, any DMA allocation should fall back to default CMA memory. In the case of ENOMEM or other errors, then the later calls to allocate DMA may fail and we can deal with it then.

Fair enough then. I think it deserves a comment, but up to you.

Andrew

#7 lore raw

PATCH 3/5 media: dt-bindings: aspeed-video: Add missing memory-region property

In reply to Eddie James

Missed documenting this property in the initial commit.

---
 Documentation/devicetree/bindings/media/aspeed-video.txt | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/media/aspeed-video.txt +6 -0
index 78b464a..346c2d3 100644
@@ -14,6 +14,11 @@ Required properties:
 			the VE
  - interrupts:		the interrupt associated with the VE on this platform
 
+Optional properties:
+ - memory-region:
+	phandle to a memory region to allocate from, as defined in
+	Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
+
 Example:
 
 video-engine at 1e700000 {
@@ -23,4 +28,5 @@ video-engine at 1e700000 {
     clock-names = "vclk", "eclk";
     resets = <&syscon ASPEED_RESET_VIDEO>;
     interrupts = <7>;
+    memory-region = <&video_engine_memory>
 };
Signature · 1 line
1.8.3.1
#8 lore raw

Re: [PATCH 3/5] media: dt-bindings: aspeed-video: Add missing memory-region property

Hi Eddie,

Quoted 24 lines · Eddie James

Missed documenting this property in the initial commit.

---
  Documentation/devicetree/bindings/media/aspeed-video.txt | 6 ++++++
  1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/media/aspeed-video.txt +5 -0
index 78b464a..346c2d3 100644
@@ -14,6 +14,11 @@ Required properties:
  			the VE
   - interrupts:		the interrupt associated with the VE on this platform
 
+Optional properties:
+ - memory-region:
+	phandle to a memory region to allocate from, as defined in
+	Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
+
  Example:
 
  video-engine at 1e700000 {

Documentation/devicetree/bindings/media/aspeed-video.txt video-engine at 1e700000 { · line 31

Quoted 4 lines
Documentation/devicetree/bindings/media/aspeed-video.txt +1 -0
@@ -23,4 +28,5 @@ video-engine at 1e700000 {
      clock-names = "vclk", "eclk";
      resets = <&syscon ASPEED_RESET_VIDEO>;
      interrupts = <7>;
+    memory-region = <&video_engine_memory>

nit: a semicolon at the end of the line.

Quoted 2 lines
Documentation/devicetree/bindings/media/aspeed-video.txt +0 -0
  };
#10 lore raw

PATCH 4/5 clk: Aspeed: Setup video engine clocking

In reply to Eddie James

Add eclk mux and clock divider table. Also change the video engine reset to the correct clock; it was previously on the video capture but needs to be on the video engine clock.

---
 drivers/clk/clk-aspeed.c | 42 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 3 deletions(-)
drivers/clk/clk-aspeed.c +39 -3
index 5961367..42b4df6 100644
@@ -87,10 +87,10 @@ struct aspeed_clk_gate {
 /* TODO: ask Aspeed about the actual parent data */
 static const struct aspeed_gate_data aspeed_gates[] = {
 	/*				 clk rst   name			parent	flags */
-	[ASPEED_CLK_GATE_ECLK] =	{  0, -1, "eclk-gate",		"eclk",	0 }, /* Video Engine */
+	[ASPEED_CLK_GATE_ECLK] =	{  0,  6, "eclk-gate",		"eclk",	0 }, /* Video Engine */
 	[ASPEED_CLK_GATE_GCLK] =	{  1,  7, "gclk-gate",		NULL,	0 }, /* 2D engine */
 	[ASPEED_CLK_GATE_MCLK] =	{  2, -1, "mclk-gate",		"mpll",	CLK_IS_CRITICAL }, /* SDRAM */
-	[ASPEED_CLK_GATE_VCLK] =	{  3,  6, "vclk-gate",		NULL,	0 }, /* Video Capture */
+	[ASPEED_CLK_GATE_VCLK] =	{  3, -1, "vclk-gate",		NULL,	0 }, /* Video Capture */
 	[ASPEED_CLK_GATE_BCLK] =	{  4,  8, "bclk-gate",		"bclk",	CLK_IS_CRITICAL }, /* PCIe/PCI */
 	[ASPEED_CLK_GATE_DCLK] =	{  5, -1, "dclk-gate",		NULL,	CLK_IS_CRITICAL }, /* DAC */
 	[ASPEED_CLK_GATE_REFCLK] =	{  6, -1, "refclk-gate",	"clkin", CLK_IS_CRITICAL },
@@ -113,6 +113,24 @@ struct aspeed_clk_gate {
 	[ASPEED_CLK_GATE_LHCCLK] =	{ 28, -1, "lhclk-gate",		"lhclk", 0 }, /* LPC master/LPC+ */
 };
 
+static const char * const eclk_parent_names[] = {
+	"mpll",
+	"hpll",
+	"dpll",
+};
+
+static const struct clk_div_table ast2500_eclk_div_table[] = {
+	{ 0x0, 2 },
+	{ 0x1, 2 },
+	{ 0x2, 3 },
+	{ 0x3, 4 },
+	{ 0x4, 5 },
+	{ 0x5, 6 },
+	{ 0x6, 7 },
+	{ 0x7, 8 },
+	{ 0 }
+};
+
 static const struct clk_div_table ast2500_mac_div_table[] = {
 	{ 0x0, 4 }, /* Yep, really. Aspeed confirmed this is correct */
 	{ 0x1, 4 },
@@ -192,18 +210,21 @@ static struct clk_hw *aspeed_ast2500_calc_pll(const char *name, u32 val)
 
 struct aspeed_clk_soc_data {
 	const struct clk_div_table *div_table;
+	const struct clk_div_table *eclk_div_table;
 	const struct clk_div_table *mac_div_table;
 	struct clk_hw *(*calc_pll)(const char *name, u32 val);
 };
 
 static const struct aspeed_clk_soc_data ast2500_data = {
 	.div_table = ast2500_div_table,
+	.eclk_div_table = ast2500_eclk_div_table,
 	.mac_div_table = ast2500_mac_div_table,
 	.calc_pll = aspeed_ast2500_calc_pll,
 };
 
 static const struct aspeed_clk_soc_data ast2400_data = {
 	.div_table = ast2400_div_table,
+	.eclk_div_table = ast2400_div_table,
 	.mac_div_table = ast2400_div_table,
 	.calc_pll = aspeed_ast2400_calc_pll,
 };
@@ -522,6 +543,22 @@ static int aspeed_clk_probe(struct platform_device *pdev)
 		return PTR_ERR(hw);
 	aspeed_clk_data->hws[ASPEED_CLK_24M] = hw;
 
+	hw = clk_hw_register_mux(dev, "eclk-mux", eclk_parent_names,
+				 ARRAY_SIZE(eclk_parent_names), 0,
+				 scu_base + ASPEED_CLK_SELECTION, 2, 0x3, 0,
+				 &aspeed_clk_lock);
+	if (IS_ERR(hw))
+		return PTR_ERR(hw);
+	aspeed_clk_data->hws[ASPEED_CLK_ECLK_MUX] = hw;
+
+	hw = clk_hw_register_divider_table(dev, "eclk", "eclk-mux", 0,
+					   scu_base + ASPEED_CLK_SELECTION, 28,
+					   3, 0, soc_data->eclk_div_table,
+					   &aspeed_clk_lock);
+	if (IS_ERR(hw))
+		return PTR_ERR(hw);
+	aspeed_clk_data->hws[ASPEED_CLK_ECLK] = hw;
+
 	/*
 	 * TODO: There are a number of clocks that not included in this driver
 	 * as more information is required:
@@ -531,7 +568,6 @@ static int aspeed_clk_probe(struct platform_device *pdev)
 	 *   RGMII
 	 *   RMII
 	 *   UART[1..5] clock source mux
-	 *   Video Engine (ECLK) mux and clock divider
 	 */
 
 	for (i = 0; i < ARRAY_SIZE(aspeed_gates); i++) {
Signature · 1 line
1.8.3.1
maintainer Reviewed-by on v1 4/5
#11 lore raw

Re: [PATCH 4/5] clk: Aspeed: Setup video engine clocking

Quoted 6 lines · Eddie James

Add eclk mux and clock divider table. Also change the video engine reset to the correct clock; it was previously on the video capture but needs to be on the video engine clock.

Stephen, Eddie and I have worked together on this change and I am happy with it now.

Cheers,

Joel

Quoted 102 lines
---
 drivers/clk/clk-aspeed.c | 42 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 3 deletions(-)
drivers/clk/clk-aspeed.c +39 -4
index 5961367..42b4df6 100644
@@ -87,10 +87,10 @@ struct aspeed_clk_gate {
 /* TODO: ask Aspeed about the actual parent data */
 static const struct aspeed_gate_data aspeed_gates[] = {
        /*                               clk rst   name                 parent  flags */
-       [ASPEED_CLK_GATE_ECLK] =        {  0, -1, "eclk-gate",          "eclk", 0 }, /* Video Engine */
+       [ASPEED_CLK_GATE_ECLK] =        {  0,  6, "eclk-gate",          "eclk", 0 }, /* Video Engine */
        [ASPEED_CLK_GATE_GCLK] =        {  1,  7, "gclk-gate",          NULL,   0 }, /* 2D engine */
        [ASPEED_CLK_GATE_MCLK] =        {  2, -1, "mclk-gate",          "mpll", CLK_IS_CRITICAL }, /* SDRAM */
-       [ASPEED_CLK_GATE_VCLK] =        {  3,  6, "vclk-gate",          NULL,   0 }, /* Video Capture */
+       [ASPEED_CLK_GATE_VCLK] =        {  3, -1, "vclk-gate",          NULL,   0 }, /* Video Capture */
        [ASPEED_CLK_GATE_BCLK] =        {  4,  8, "bclk-gate",          "bclk", CLK_IS_CRITICAL }, /* PCIe/PCI */
        [ASPEED_CLK_GATE_DCLK] =        {  5, -1, "dclk-gate",          NULL,   CLK_IS_CRITICAL }, /* DAC */
        [ASPEED_CLK_GATE_REFCLK] =      {  6, -1, "refclk-gate",        "clkin", CLK_IS_CRITICAL },
@@ -113,6 +113,24 @@ struct aspeed_clk_gate {
        [ASPEED_CLK_GATE_LHCCLK] =      { 28, -1, "lhclk-gate",         "lhclk", 0 }, /* LPC master/LPC+ */
 };
 
+static const char * const eclk_parent_names[] = {
+       "mpll",
+       "hpll",
+       "dpll",
+};
+
+static const struct clk_div_table ast2500_eclk_div_table[] = {
+       { 0x0, 2 },
+       { 0x1, 2 },
+       { 0x2, 3 },
+       { 0x3, 4 },
+       { 0x4, 5 },
+       { 0x5, 6 },
+       { 0x6, 7 },
+       { 0x7, 8 },
+       { 0 }
+};
+
 static const struct clk_div_table ast2500_mac_div_table[] = {
        { 0x0, 4 }, /* Yep, really. Aspeed confirmed this is correct */
        { 0x1, 4 },
@@ -192,18 +210,21 @@ static struct clk_hw *aspeed_ast2500_calc_pll(const char *name, u32 val)
 
 struct aspeed_clk_soc_data {
        const struct clk_div_table *div_table;
+       const struct clk_div_table *eclk_div_table;
        const struct clk_div_table *mac_div_table;
        struct clk_hw *(*calc_pll)(const char *name, u32 val);
 };
 
 static const struct aspeed_clk_soc_data ast2500_data = {
        .div_table = ast2500_div_table,
+       .eclk_div_table = ast2500_eclk_div_table,
        .mac_div_table = ast2500_mac_div_table,
        .calc_pll = aspeed_ast2500_calc_pll,
 };
 
 static const struct aspeed_clk_soc_data ast2400_data = {
        .div_table = ast2400_div_table,
+       .eclk_div_table = ast2400_div_table,
        .mac_div_table = ast2400_div_table,
        .calc_pll = aspeed_ast2400_calc_pll,
 };
@@ -522,6 +543,22 @@ static int aspeed_clk_probe(struct platform_device *pdev)
                return PTR_ERR(hw);
        aspeed_clk_data->hws[ASPEED_CLK_24M] = hw;
 
+       hw = clk_hw_register_mux(dev, "eclk-mux", eclk_parent_names,
+                                ARRAY_SIZE(eclk_parent_names), 0,
+                                scu_base + ASPEED_CLK_SELECTION, 2, 0x3, 0,
+                                &aspeed_clk_lock);
+       if (IS_ERR(hw))
+               return PTR_ERR(hw);
+       aspeed_clk_data->hws[ASPEED_CLK_ECLK_MUX] = hw;
+
+       hw = clk_hw_register_divider_table(dev, "eclk", "eclk-mux", 0,
+                                          scu_base + ASPEED_CLK_SELECTION, 28,
+                                          3, 0, soc_data->eclk_div_table,
+                                          &aspeed_clk_lock);
+       if (IS_ERR(hw))
+               return PTR_ERR(hw);
+       aspeed_clk_data->hws[ASPEED_CLK_ECLK] = hw;
+
        /*
         * TODO: There are a number of clocks that not included in this driver
         * as more information is required:
@@ -531,7 +568,6 @@ static int aspeed_clk_probe(struct platform_device *pdev)
         *   RGMII
         *   RMII
         *   UART[1..5] clock source mux
-        *   Video Engine (ECLK) mux and clock divider
         */
 
        for (i = 0; i < ARRAY_SIZE(aspeed_gates); i++) {
--

1.8.3.1

maintainer Applied
#12 lore raw

Re: [PATCH 4/5] clk: Aspeed: Setup video engine clocking

Quoting Joel Stanley (2019-04-10 19:50:16)

Quoted 6 lines · Eddie James
Quoted 5 lines

Add eclk mux and clock divider table. Also change the video engine reset to the correct clock; it was previously on the video capture but needs to be on the video engine clock.

Quoted 7 lines
Quoted 1 line

Stephen, Eddie and I have worked together on this change and I am happy with it now.

Thanks! Applied to clk-next.

#13 lore raw

PATCH 5/5 ARM: dts: aspeed-g5: Add video engine

In reply to Eddie James

Add a node to describe the video engine on the AST2500.

---
 arch/arm/boot/dts/aspeed-g5.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/aspeed-g5.dtsi +10 -0
index 85ed9db..c6d5edc 100644
@@ -243,6 +243,16 @@
 				status = "disabled";
 			};
 
+			video: video at 1e700000 {
+				compatible = "aspeed,ast2500-video-engine";
+				reg = <0x1e700000 0x1000>;
+				clocks = <&syscon ASPEED_CLK_GATE_VCLK>,
+					 <&syscon ASPEED_CLK_GATE_ECLK>;
+				clock-names = "vclk", "eclk";
+				interrupts = <7>;
+				status = "disabled";
+			};
+
 			sram: sram at 1e720000 {
 				compatible = "mmio-sram";
 				reg = <0x1e720000 0x9000>;	// 36K
Signature · 1 line
1.8.3.1
#14 lore raw
In reply to Eddie James

Hi Eddie,

Quoted 8 lines · Eddie James

This series enables the video engine on Aspeed BMC platforms. The video engine clocking is added to the Aspeed clock driver. The use of the video engine reset line, originally planned to be made externally available in the clock driver, is removed from the video engine driver. Finally a node for the video engine is added to the AST2500 devicetree.
The series also includes a missing property for reserved memory in the devicetree documentation, and a small change to make the video engine driver start without reserved memory.

I assume you'll post a v3 since there were some comments?

If you want to get it in for 5.2, then be aware that you should post it tomorrow at the latest.

Regards,

Hans

Quoted 14 lines

Eddie James (5):
media: platform: Aspeed: Remove use of reset line
media: platform: Aspeed: Make reserved memory optional
media: dt-bindings: aspeed-video: Add missing memory-region property
clk: Aspeed: Setup video engine clocking
ARM: dts: aspeed-g5: Add video engine

 .../devicetree/bindings/media/aspeed-video.txt     |  6 ++++
 arch/arm/boot/dts/aspeed-g5.dtsi                   | 10 ++++++
 drivers/clk/clk-aspeed.c                           | 42 ++++++++++++++++++++--
 drivers/media/platform/aspeed-video.c              | 33 ++++-------------
 4 files changed, 61 insertions(+), 30 deletions(-)
#15 lore raw
Quoted 11 lines · Hans Verkuil

Hi Eddie,

Quoted 8 lines · Eddie James

This series enables the video engine on Aspeed BMC platforms. The video engine clocking is added to the Aspeed clock driver. The use of the video engine reset line, originally planned to be made externally available in the clock driver, is removed from the video engine driver. Finally a node for the video engine is added to the AST2500 devicetree.
The series also includes a missing property for reserved memory in the devicetree documentation, and a small change to make the video engine driver start without reserved memory.

Quoted 1 line

I assume you'll post a v3 since there were some comments?

Sure... The only change would be a missing semi-colon in the devicetree doc. And we're only on v2 :)

Quoted 21 lines

If you want to get it in for 5.2, then be aware that you should post it tomorrow at the latest.

Regards,

Hans

Quoted 13 lines

Eddie James (5):
media: platform: Aspeed: Remove use of reset line
media: platform: Aspeed: Make reserved memory optional
media: dt-bindings: aspeed-video: Add missing memory-region property
clk: Aspeed: Setup video engine clocking
ARM: dts: aspeed-g5: Add video engine

  .../devicetree/bindings/media/aspeed-video.txt     |  6 ++++
  arch/arm/boot/dts/aspeed-g5.dtsi                   | 10 ++++++
  drivers/clk/clk-aspeed.c                           | 42 ++++++++++++++++++++--
  drivers/media/platform/aspeed-video.c              | 33 ++++-------------
  4 files changed, 61 insertions(+), 30 deletions(-)