From patchwork Tue Jan 7 01:15:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jae Hyun Yoo X-Patchwork-Id: 11320251 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5C9A3921 for ; Tue, 7 Jan 2020 01:14:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3276721744 for ; Tue, 7 Jan 2020 01:14:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727358AbgAGBOV (ORCPT ); Mon, 6 Jan 2020 20:14:21 -0500 Received: from mga12.intel.com ([192.55.52.136]:60822 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727250AbgAGBOV (ORCPT ); Mon, 6 Jan 2020 20:14:21 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jan 2020 17:14:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,404,1571727600"; d="scan'208";a="216992314" Received: from maru.jf.intel.com ([10.54.51.77]) by fmsmga007.fm.intel.com with ESMTP; 06 Jan 2020 17:14:20 -0800 From: Jae Hyun Yoo To: Eddie James , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Joel Stanley , Andrew Jeffery Cc: linux-aspeed@lists.ozlabs.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, openbmc@lists.ozlabs.org, Jae Hyun Yoo Subject: [PATCH 1/3] ARM: dts: aspeed-g6: Add Video Engine node Date: Mon, 6 Jan 2020 17:15:01 -0800 Message-Id: <20200107011503.17435-2-jae.hyun.yoo@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200107011503.17435-1-jae.hyun.yoo@linux.intel.com> References: <20200107011503.17435-1-jae.hyun.yoo@linux.intel.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The AST2600 has Video Engine so add it. Signed-off-by: Jae Hyun Yoo Acked-by: Joel Stanley --- 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 = ; + status = "disabled"; + }; + gpio0: gpio@1e780000 { #gpio-cells = <2>; gpio-controller; From patchwork Tue Jan 7 01:15:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jae Hyun Yoo X-Patchwork-Id: 11320253 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CCEA139A for ; Tue, 7 Jan 2020 01:14:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C30021744 for ; Tue, 7 Jan 2020 01:14:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727382AbgAGBOW (ORCPT ); Mon, 6 Jan 2020 20:14:22 -0500 Received: from mga12.intel.com ([192.55.52.136]:60822 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727250AbgAGBOW (ORCPT ); Mon, 6 Jan 2020 20:14:22 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jan 2020 17:14:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,404,1571727600"; d="scan'208";a="216992316" Received: from maru.jf.intel.com ([10.54.51.77]) by fmsmga007.fm.intel.com with ESMTP; 06 Jan 2020 17:14:21 -0800 From: Jae Hyun Yoo To: Eddie James , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Joel Stanley , Andrew Jeffery Cc: linux-aspeed@lists.ozlabs.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, openbmc@lists.ozlabs.org, Jae Hyun Yoo Subject: [PATCH 2/3] Documentation: dt-bindings: media: add AST2600 Video Engine support Date: Mon, 6 Jan 2020 17:15:02 -0800 Message-Id: <20200107011503.17435-3-jae.hyun.yoo@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200107011503.17435-1-jae.hyun.yoo@linux.intel.com> References: <20200107011503.17435-1-jae.hyun.yoo@linux.intel.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The AST2600 has Video Engine so add the compatible string into the document. Signed-off-by: Jae Hyun Yoo Acked-by: Joel Stanley Acked-by: Rob Herring --- 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) From patchwork Tue Jan 7 01:15:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jae Hyun Yoo X-Patchwork-Id: 11320255 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D8D5139A for ; Tue, 7 Jan 2020 01:14:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 56A0E207FF for ; Tue, 7 Jan 2020 01:14:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727397AbgAGBOX (ORCPT ); Mon, 6 Jan 2020 20:14:23 -0500 Received: from mga12.intel.com ([192.55.52.136]:60822 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727250AbgAGBOX (ORCPT ); Mon, 6 Jan 2020 20:14:23 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jan 2020 17:14:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,404,1571727600"; d="scan'208";a="216992332" Received: from maru.jf.intel.com ([10.54.51.77]) by fmsmga007.fm.intel.com with ESMTP; 06 Jan 2020 17:14:22 -0800 From: Jae Hyun Yoo To: Eddie James , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Joel Stanley , Andrew Jeffery Cc: linux-aspeed@lists.ozlabs.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, openbmc@lists.ozlabs.org, Jae Hyun Yoo Subject: [PATCH 3/3] media: aspeed: add AST2600 support Date: Mon, 6 Jan 2020 17:15:03 -0800 Message-Id: <20200107011503.17435-4-jae.hyun.yoo@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200107011503.17435-1-jae.hyun.yoo@linux.intel.com> References: <20200107011503.17435-1-jae.hyun.yoo@linux.intel.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- 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);