All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add AST2600 Video Engine support
@ 2020-01-07  1:15 Jae Hyun Yoo
  2020-01-07  1:15 ` [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node Jae Hyun Yoo
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jae Hyun Yoo @ 2020-01-07  1:15 UTC (permalink / raw)
  To: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Joel Stanley, Andrew Jeffery
  Cc: linux-aspeed, linux-media, devicetree, openbmc, Jae Hyun Yoo

Video engine in AST2600 has the exactly same register set with
AST2500 except VR084 register which provides more precise JPEG
size read back. This patch set adds Video Engine node and driver
support for AST2600.

Please review it.

Thanks,

Jae

Jae Hyun Yoo (3):
  ARM: dts: aspeed-g6: Add Video Engine node
  Documentation: dt-bindings: media: add AST2600 Video Engine support
  media: aspeed: add AST2600 support

 .../devicetree/bindings/media/aspeed-video.txt    |  5 +++--
 arch/arm/boot/dts/aspeed-g6.dtsi                  | 10 ++++++++++
 drivers/media/platform/aspeed-video.c             | 15 +++++++++++----
 3 files changed, 24 insertions(+), 6 deletions(-)

-- 
2.17.1


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

* [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node
  2020-01-07  1:15 [PATCH 0/3] Add AST2600 Video Engine support Jae Hyun Yoo
@ 2020-01-07  1:15 ` Jae Hyun Yoo
  2020-01-07  3:34     ` Joel Stanley
  2020-01-07  1:15 ` [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support Jae Hyun Yoo
  2020-01-07  1:15 ` [PATCH 3/3] media: aspeed: add AST2600 support Jae Hyun Yoo
  2 siblings, 1 reply; 12+ messages in thread
From: Jae Hyun Yoo @ 2020-01-07  1:15 UTC (permalink / raw)
  To: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Joel Stanley, Andrew Jeffery
  Cc: linux-aspeed, linux-media, devicetree, openbmc, Jae Hyun Yoo

The AST2600 has Video Engine so add it.

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
---
 arch/arm/boot/dts/aspeed-g6.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi
index 5f6142d99eeb..89833987e270 100644
--- a/arch/arm/boot/dts/aspeed-g6.dtsi
+++ b/arch/arm/boot/dts/aspeed-g6.dtsi
@@ -297,6 +297,16 @@
 				quality = <100>;
 			};
 
+			video: video@1e700000 {
+				compatible = "aspeed,ast2600-video-engine";
+				reg = <0x1e700000 0x1000>;
+				clocks = <&syscon ASPEED_CLK_GATE_VCLK>,
+					 <&syscon ASPEED_CLK_GATE_ECLK>;
+				clock-names = "vclk", "eclk";
+				interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+				status = "disabled";
+			};
+
 			gpio0: gpio@1e780000 {
 				#gpio-cells = <2>;
 				gpio-controller;
-- 
2.17.1


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

* [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support
  2020-01-07  1:15 [PATCH 0/3] Add AST2600 Video Engine support Jae Hyun Yoo
  2020-01-07  1:15 ` [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node Jae Hyun Yoo
@ 2020-01-07  1:15 ` Jae Hyun Yoo
  2020-01-07  2:43     ` Joel Stanley
  2020-01-08 20:33   ` Rob Herring
  2020-01-07  1:15 ` [PATCH 3/3] media: aspeed: add AST2600 support Jae Hyun Yoo
  2 siblings, 2 replies; 12+ messages in thread
From: Jae Hyun Yoo @ 2020-01-07  1:15 UTC (permalink / raw)
  To: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Joel Stanley, Andrew Jeffery
  Cc: linux-aspeed, linux-media, devicetree, openbmc, Jae Hyun Yoo

The AST2600 has Video Engine so add the compatible string into the
document.

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
---
 Documentation/devicetree/bindings/media/aspeed-video.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/aspeed-video.txt b/Documentation/devicetree/bindings/media/aspeed-video.txt
index ce2894506e1f..d2ca32512272 100644
--- a/Documentation/devicetree/bindings/media/aspeed-video.txt
+++ b/Documentation/devicetree/bindings/media/aspeed-video.txt
@@ -1,11 +1,12 @@
 * Device tree bindings for Aspeed Video Engine
 
-The Video Engine (VE) embedded in the Aspeed AST2400 and AST2500 SOCs can
+The Video Engine (VE) embedded in the Aspeed AST2400/2500/2600 SOCs can
 capture and compress video data from digital or analog sources.
 
 Required properties:
  - compatible:		"aspeed,ast2400-video-engine" or
-			"aspeed,ast2500-video-engine"
+			"aspeed,ast2500-video-engine" or
+			"aspeed,ast2600-video-engine"
  - reg:			contains the offset and length of the VE memory region
  - clocks:		clock specifiers for the syscon clocks associated with
 			the VE (ordering must match the clock-names property)
-- 
2.17.1


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

* [PATCH 3/3] media: aspeed: add AST2600 support
  2020-01-07  1:15 [PATCH 0/3] Add AST2600 Video Engine support Jae Hyun Yoo
  2020-01-07  1:15 ` [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node Jae Hyun Yoo
  2020-01-07  1:15 ` [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support Jae Hyun Yoo
@ 2020-01-07  1:15 ` Jae Hyun Yoo
  2020-01-07  3:15     ` Joel Stanley
  2 siblings, 1 reply; 12+ messages in thread
From: Jae Hyun Yoo @ 2020-01-07  1:15 UTC (permalink / raw)
  To: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Joel Stanley, Andrew Jeffery
  Cc: linux-aspeed, linux-media, devicetree, openbmc, Jae Hyun Yoo

Video engine in AST2600 has the exactly same register set with
AST2500 except VR084 register which provides more precise JPEG
size read back. This commit adds support for the difference and
adds 'aspeed,ast2600-video-engine' compatible OF string.

Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
---
 drivers/media/platform/aspeed-video.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
index d8593cb2ae84..0dbe72672338 100644
--- a/drivers/media/platform/aspeed-video.c
+++ b/drivers/media/platform/aspeed-video.c
@@ -72,10 +72,10 @@
 #define  VE_SEQ_CTRL_CAP_BUSY		BIT(16)
 #define  VE_SEQ_CTRL_COMP_BUSY		BIT(18)
 
-#ifdef CONFIG_MACH_ASPEED_G5
-#define  VE_SEQ_CTRL_JPEG_MODE		BIT(13)	/* AST2500 */
-#else
+#ifdef CONFIG_MACH_ASPEED_G4
 #define  VE_SEQ_CTRL_JPEG_MODE		BIT(8)	/* AST2400 */
+#else
+#define  VE_SEQ_CTRL_JPEG_MODE		BIT(13)	/* AST2500/2600 */
 #endif /* CONFIG_MACH_ASPEED_G5 */
 
 #define VE_CTRL				0x008
@@ -135,6 +135,12 @@
 
 #define VE_OFFSET_COMP_STREAM		0x078
 
+#ifdef CONFIG_MACH_ASPEED_G6
+#define VE_JPEG_COMP_SIZE_READ_BACK	0x084	/* AST2600 */
+#else
+#define VE_JPEG_COMP_SIZE_READ_BACK	VE_OFFSET_COMP_STREAM
+#endif
+
 #define VE_SRC_LR_EDGE_DET		0x090
 #define  VE_SRC_LR_EDGE_DET_LEFT	GENMASK(11, 0)
 #define  VE_SRC_LR_EDGE_DET_NO_V	BIT(12)
@@ -572,7 +578,7 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg)
 	if (sts & VE_INTERRUPT_COMP_COMPLETE) {
 		struct aspeed_video_buffer *buf;
 		u32 frame_size = aspeed_video_read(video,
-						   VE_OFFSET_COMP_STREAM);
+						   VE_JPEG_COMP_SIZE_READ_BACK);
 
 		spin_lock(&video->lock);
 		clear_bit(VIDEO_FRAME_INPRG, &video->flags);
@@ -1719,6 +1725,7 @@ static int aspeed_video_remove(struct platform_device *pdev)
 static const struct of_device_id aspeed_video_of_match[] = {
 	{ .compatible = "aspeed,ast2400-video-engine" },
 	{ .compatible = "aspeed,ast2500-video-engine" },
+	{ .compatible = "aspeed,ast2600-video-engine" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
-- 
2.17.1


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

* Re: [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support
  2020-01-07  1:15 ` [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support Jae Hyun Yoo
@ 2020-01-07  2:43     ` Joel Stanley
  2020-01-08 20:33   ` Rob Herring
  1 sibling, 0 replies; 12+ messages in thread
From: Joel Stanley @ 2020-01-07  2:43 UTC (permalink / raw)
  To: Jae Hyun Yoo
  Cc: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Andrew Jeffery, linux-aspeed, linux-media, devicetree,
	OpenBMC Maillist

On Tue, 7 Jan 2020 at 01:14, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>
> The AST2600 has Video Engine so add the compatible string into the
> document.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>

Acked-by: Joel Stanley <joel@jms.id.au>

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

* Re: [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support
@ 2020-01-07  2:43     ` Joel Stanley
  0 siblings, 0 replies; 12+ messages in thread
From: Joel Stanley @ 2020-01-07  2:43 UTC (permalink / raw)
  To: Jae Hyun Yoo
  Cc: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Andrew Jeffery, linux-aspeed, linux-media, devicetree,
	OpenBMC Maillist

On Tue, 7 Jan 2020 at 01:14, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>
> The AST2600 has Video Engine so add the compatible string into the
> document.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>

Acked-by: Joel Stanley <joel@jms.id.au>

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

* Re: [PATCH 3/3] media: aspeed: add AST2600 support
  2020-01-07  1:15 ` [PATCH 3/3] media: aspeed: add AST2600 support Jae Hyun Yoo
@ 2020-01-07  3:15     ` Joel Stanley
  0 siblings, 0 replies; 12+ messages in thread
From: Joel Stanley @ 2020-01-07  3:15 UTC (permalink / raw)
  To: Jae Hyun Yoo
  Cc: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Andrew Jeffery, linux-aspeed, linux-media, devicetree,
	OpenBMC Maillist

On Tue, 7 Jan 2020 at 01:14, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>
> Video engine in AST2600 has the exactly same register set with
> AST2500 except VR084 register which provides more precise JPEG
> size read back. This commit adds support for the difference and
> adds 'aspeed,ast2600-video-engine' compatible OF string.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
> ---
>  drivers/media/platform/aspeed-video.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
> index d8593cb2ae84..0dbe72672338 100644
> --- a/drivers/media/platform/aspeed-video.c
> +++ b/drivers/media/platform/aspeed-video.c
> @@ -72,10 +72,10 @@
>  #define  VE_SEQ_CTRL_CAP_BUSY          BIT(16)
>  #define  VE_SEQ_CTRL_COMP_BUSY         BIT(18)
>
> -#ifdef CONFIG_MACH_ASPEED_G5
> -#define  VE_SEQ_CTRL_JPEG_MODE         BIT(13) /* AST2500 */
> -#else
> +#ifdef CONFIG_MACH_ASPEED_G4
>  #define  VE_SEQ_CTRL_JPEG_MODE         BIT(8)  /* AST2400 */
> +#else
> +#define  VE_SEQ_CTRL_JPEG_MODE         BIT(13) /* AST2500/2600 */
>  #endif /* CONFIG_MACH_ASPEED_G5 */

Yeah, nah. This should have never been done this way. I will send some
patches to fix it up, and you can add ast2600 support on top of them,
if that works for you.

Cheers,

Joel

>
>  #define VE_CTRL                                0x008
> @@ -135,6 +135,12 @@
>
>  #define VE_OFFSET_COMP_STREAM          0x078
>
> +#ifdef CONFIG_MACH_ASPEED_G6
> +#define VE_JPEG_COMP_SIZE_READ_BACK    0x084   /* AST2600 */
> +#else
> +#define VE_JPEG_COMP_SIZE_READ_BACK    VE_OFFSET_COMP_STREAM
> +#endif
> +
>  #define VE_SRC_LR_EDGE_DET             0x090
>  #define  VE_SRC_LR_EDGE_DET_LEFT       GENMASK(11, 0)
>  #define  VE_SRC_LR_EDGE_DET_NO_V       BIT(12)
> @@ -572,7 +578,7 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg)
>         if (sts & VE_INTERRUPT_COMP_COMPLETE) {
>                 struct aspeed_video_buffer *buf;
>                 u32 frame_size = aspeed_video_read(video,
> -                                                  VE_OFFSET_COMP_STREAM);
> +                                                  VE_JPEG_COMP_SIZE_READ_BACK);
>
>                 spin_lock(&video->lock);
>                 clear_bit(VIDEO_FRAME_INPRG, &video->flags);
> @@ -1719,6 +1725,7 @@ static int aspeed_video_remove(struct platform_device *pdev)
>  static const struct of_device_id aspeed_video_of_match[] = {
>         { .compatible = "aspeed,ast2400-video-engine" },
>         { .compatible = "aspeed,ast2500-video-engine" },
> +       { .compatible = "aspeed,ast2600-video-engine" },
>         {}
>  };
>  MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
> --
> 2.17.1
>

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

* Re: [PATCH 3/3] media: aspeed: add AST2600 support
@ 2020-01-07  3:15     ` Joel Stanley
  0 siblings, 0 replies; 12+ messages in thread
From: Joel Stanley @ 2020-01-07  3:15 UTC (permalink / raw)
  To: Jae Hyun Yoo
  Cc: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Andrew Jeffery, linux-aspeed, linux-media, devicetree,
	OpenBMC Maillist

On Tue, 7 Jan 2020 at 01:14, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>
> Video engine in AST2600 has the exactly same register set with
> AST2500 except VR084 register which provides more precise JPEG
> size read back. This commit adds support for the difference and
> adds 'aspeed,ast2600-video-engine' compatible OF string.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
> ---
>  drivers/media/platform/aspeed-video.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
> index d8593cb2ae84..0dbe72672338 100644
> --- a/drivers/media/platform/aspeed-video.c
> +++ b/drivers/media/platform/aspeed-video.c
> @@ -72,10 +72,10 @@
>  #define  VE_SEQ_CTRL_CAP_BUSY          BIT(16)
>  #define  VE_SEQ_CTRL_COMP_BUSY         BIT(18)
>
> -#ifdef CONFIG_MACH_ASPEED_G5
> -#define  VE_SEQ_CTRL_JPEG_MODE         BIT(13) /* AST2500 */
> -#else
> +#ifdef CONFIG_MACH_ASPEED_G4
>  #define  VE_SEQ_CTRL_JPEG_MODE         BIT(8)  /* AST2400 */
> +#else
> +#define  VE_SEQ_CTRL_JPEG_MODE         BIT(13) /* AST2500/2600 */
>  #endif /* CONFIG_MACH_ASPEED_G5 */

Yeah, nah. This should have never been done this way. I will send some
patches to fix it up, and you can add ast2600 support on top of them,
if that works for you.

Cheers,

Joel

>
>  #define VE_CTRL                                0x008
> @@ -135,6 +135,12 @@
>
>  #define VE_OFFSET_COMP_STREAM          0x078
>
> +#ifdef CONFIG_MACH_ASPEED_G6
> +#define VE_JPEG_COMP_SIZE_READ_BACK    0x084   /* AST2600 */
> +#else
> +#define VE_JPEG_COMP_SIZE_READ_BACK    VE_OFFSET_COMP_STREAM
> +#endif
> +
>  #define VE_SRC_LR_EDGE_DET             0x090
>  #define  VE_SRC_LR_EDGE_DET_LEFT       GENMASK(11, 0)
>  #define  VE_SRC_LR_EDGE_DET_NO_V       BIT(12)
> @@ -572,7 +578,7 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg)
>         if (sts & VE_INTERRUPT_COMP_COMPLETE) {
>                 struct aspeed_video_buffer *buf;
>                 u32 frame_size = aspeed_video_read(video,
> -                                                  VE_OFFSET_COMP_STREAM);
> +                                                  VE_JPEG_COMP_SIZE_READ_BACK);
>
>                 spin_lock(&video->lock);
>                 clear_bit(VIDEO_FRAME_INPRG, &video->flags);
> @@ -1719,6 +1725,7 @@ static int aspeed_video_remove(struct platform_device *pdev)
>  static const struct of_device_id aspeed_video_of_match[] = {
>         { .compatible = "aspeed,ast2400-video-engine" },
>         { .compatible = "aspeed,ast2500-video-engine" },
> +       { .compatible = "aspeed,ast2600-video-engine" },
>         {}
>  };
>  MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
> --
> 2.17.1
>

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

* Re: [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node
  2020-01-07  1:15 ` [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node Jae Hyun Yoo
@ 2020-01-07  3:34     ` Joel Stanley
  0 siblings, 0 replies; 12+ messages in thread
From: Joel Stanley @ 2020-01-07  3:34 UTC (permalink / raw)
  To: Jae Hyun Yoo
  Cc: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Andrew Jeffery, linux-aspeed, linux-media, devicetree,
	OpenBMC Maillist

On Tue, 7 Jan 2020 at 01:14, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>
> The AST2600 has Video Engine so add it.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>

Acked-by: Joel Stanley <joel@jms.id.au>

I will merge this through the aspeed tree for 5.6.

Cheers,

Joel

> ---
>  arch/arm/boot/dts/aspeed-g6.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi
> index 5f6142d99eeb..89833987e270 100644
> --- a/arch/arm/boot/dts/aspeed-g6.dtsi
> +++ b/arch/arm/boot/dts/aspeed-g6.dtsi
> @@ -297,6 +297,16 @@
>                                 quality = <100>;
>                         };
>
> +                       video: video@1e700000 {
> +                               compatible = "aspeed,ast2600-video-engine";
> +                               reg = <0x1e700000 0x1000>;
> +                               clocks = <&syscon ASPEED_CLK_GATE_VCLK>,
> +                                        <&syscon ASPEED_CLK_GATE_ECLK>;
> +                               clock-names = "vclk", "eclk";
> +                               interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
> +                               status = "disabled";
> +                       };
> +
>                         gpio0: gpio@1e780000 {
>                                 #gpio-cells = <2>;
>                                 gpio-controller;
> --
> 2.17.1
>

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

* Re: [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node
@ 2020-01-07  3:34     ` Joel Stanley
  0 siblings, 0 replies; 12+ messages in thread
From: Joel Stanley @ 2020-01-07  3:34 UTC (permalink / raw)
  To: Jae Hyun Yoo
  Cc: Eddie James, Mauro Carvalho Chehab, Rob Herring, Mark Rutland,
	Andrew Jeffery, linux-aspeed, linux-media, devicetree,
	OpenBMC Maillist

On Tue, 7 Jan 2020 at 01:14, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>
> The AST2600 has Video Engine so add it.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>

Acked-by: Joel Stanley <joel@jms.id.au>

I will merge this through the aspeed tree for 5.6.

Cheers,

Joel

> ---
>  arch/arm/boot/dts/aspeed-g6.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed-g6.dtsi
> index 5f6142d99eeb..89833987e270 100644
> --- a/arch/arm/boot/dts/aspeed-g6.dtsi
> +++ b/arch/arm/boot/dts/aspeed-g6.dtsi
> @@ -297,6 +297,16 @@
>                                 quality = <100>;
>                         };
>
> +                       video: video@1e700000 {
> +                               compatible = "aspeed,ast2600-video-engine";
> +                               reg = <0x1e700000 0x1000>;
> +                               clocks = <&syscon ASPEED_CLK_GATE_VCLK>,
> +                                        <&syscon ASPEED_CLK_GATE_ECLK>;
> +                               clock-names = "vclk", "eclk";
> +                               interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
> +                               status = "disabled";
> +                       };
> +
>                         gpio0: gpio@1e780000 {
>                                 #gpio-cells = <2>;
>                                 gpio-controller;
> --
> 2.17.1
>

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

* Re: [PATCH 3/3] media: aspeed: add AST2600 support
  2020-01-07  3:15     ` Joel Stanley
  (?)
@ 2020-01-07 17:58     ` Jae Hyun Yoo
  -1 siblings, 0 replies; 12+ messages in thread
From: Jae Hyun Yoo @ 2020-01-07 17:58 UTC (permalink / raw)
  To: Joel Stanley
  Cc: Mark Rutland, devicetree, linux-aspeed, Andrew Jeffery,
	OpenBMC Maillist, Eddie James, Rob Herring,
	Mauro Carvalho Chehab, linux-media



On 1/6/2020 7:15 PM, Joel Stanley wrote:
> On Tue, 7 Jan 2020 at 01:14, Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> wrote:
>>
>> Video engine in AST2600 has the exactly same register set with
>> AST2500 except VR084 register which provides more precise JPEG
>> size read back. This commit adds support for the difference and
>> adds 'aspeed,ast2600-video-engine' compatible OF string.
>>
>> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
>> ---
>>   drivers/media/platform/aspeed-video.c | 15 +++++++++++----
>>   1 file changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
>> index d8593cb2ae84..0dbe72672338 100644
>> --- a/drivers/media/platform/aspeed-video.c
>> +++ b/drivers/media/platform/aspeed-video.c
>> @@ -72,10 +72,10 @@
>>   #define  VE_SEQ_CTRL_CAP_BUSY          BIT(16)
>>   #define  VE_SEQ_CTRL_COMP_BUSY         BIT(18)
>>
>> -#ifdef CONFIG_MACH_ASPEED_G5
>> -#define  VE_SEQ_CTRL_JPEG_MODE         BIT(13) /* AST2500 */
>> -#else
>> +#ifdef CONFIG_MACH_ASPEED_G4
>>   #define  VE_SEQ_CTRL_JPEG_MODE         BIT(8)  /* AST2400 */
>> +#else
>> +#define  VE_SEQ_CTRL_JPEG_MODE         BIT(13) /* AST2500/2600 */
>>   #endif /* CONFIG_MACH_ASPEED_G5 */
> 
> Yeah, nah. This should have never been done this way. I will send some
> patches to fix it up, and you can add ast2600 support on top of them,
> if that works for you.

Yeah, the runtime configuration in your patch set is right way for it.
I'll rebase this patch set on top of your patch.

Thanks,

Jae

> Cheers,
> 
> Joel
> 
>>
>>   #define VE_CTRL                                0x008
>> @@ -135,6 +135,12 @@
>>
>>   #define VE_OFFSET_COMP_STREAM          0x078
>>
>> +#ifdef CONFIG_MACH_ASPEED_G6
>> +#define VE_JPEG_COMP_SIZE_READ_BACK    0x084   /* AST2600 */
>> +#else
>> +#define VE_JPEG_COMP_SIZE_READ_BACK    VE_OFFSET_COMP_STREAM
>> +#endif
>> +
>>   #define VE_SRC_LR_EDGE_DET             0x090
>>   #define  VE_SRC_LR_EDGE_DET_LEFT       GENMASK(11, 0)
>>   #define  VE_SRC_LR_EDGE_DET_NO_V       BIT(12)
>> @@ -572,7 +578,7 @@ static irqreturn_t aspeed_video_irq(int irq, void *arg)
>>          if (sts & VE_INTERRUPT_COMP_COMPLETE) {
>>                  struct aspeed_video_buffer *buf;
>>                  u32 frame_size = aspeed_video_read(video,
>> -                                                  VE_OFFSET_COMP_STREAM);
>> +                                                  VE_JPEG_COMP_SIZE_READ_BACK);
>>
>>                  spin_lock(&video->lock);
>>                  clear_bit(VIDEO_FRAME_INPRG, &video->flags);
>> @@ -1719,6 +1725,7 @@ static int aspeed_video_remove(struct platform_device *pdev)
>>   static const struct of_device_id aspeed_video_of_match[] = {
>>          { .compatible = "aspeed,ast2400-video-engine" },
>>          { .compatible = "aspeed,ast2500-video-engine" },
>> +       { .compatible = "aspeed,ast2600-video-engine" },
>>          {}
>>   };
>>   MODULE_DEVICE_TABLE(of, aspeed_video_of_match);
>> --
>> 2.17.1
>>

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

* Re: [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support
  2020-01-07  1:15 ` [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support Jae Hyun Yoo
  2020-01-07  2:43     ` Joel Stanley
@ 2020-01-08 20:33   ` Rob Herring
  1 sibling, 0 replies; 12+ messages in thread
From: Rob Herring @ 2020-01-08 20:33 UTC (permalink / raw)
  To: Jae Hyun Yoo
  Cc: Eddie James, Mauro Carvalho Chehab, Mark Rutland, Joel Stanley,
	Andrew Jeffery, linux-aspeed, linux-media, devicetree, openbmc,
	Jae Hyun Yoo

On Mon,  6 Jan 2020 17:15:02 -0800, Jae Hyun Yoo wrote:
> The AST2600 has Video Engine so add the compatible string into the
> document.
> 
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
> ---
>  Documentation/devicetree/bindings/media/aspeed-video.txt | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2020-01-08 20:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07  1:15 [PATCH 0/3] Add AST2600 Video Engine support Jae Hyun Yoo
2020-01-07  1:15 ` [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node Jae Hyun Yoo
2020-01-07  3:34   ` Joel Stanley
2020-01-07  3:34     ` Joel Stanley
2020-01-07  1:15 ` [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support Jae Hyun Yoo
2020-01-07  2:43   ` Joel Stanley
2020-01-07  2:43     ` Joel Stanley
2020-01-08 20:33   ` Rob Herring
2020-01-07  1:15 ` [PATCH 3/3] media: aspeed: add AST2600 support Jae Hyun Yoo
2020-01-07  3:15   ` Joel Stanley
2020-01-07  3:15     ` Joel Stanley
2020-01-07 17:58     ` Jae Hyun Yoo

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.