From patchwork Fri Dec 20 17:52:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Zabel X-Patchwork-Id: 3390461 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 69FF7C0D4A for ; Fri, 20 Dec 2013 17:53:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 527BF206E6 for ; Fri, 20 Dec 2013 17:53:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41BA9206E5 for ; Fri, 20 Dec 2013 17:53:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751838Ab3LTRxU (ORCPT ); Fri, 20 Dec 2013 12:53:20 -0500 Received: from metis.ext.pengutronix.de ([92.198.50.35]:45926 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751810Ab3LTRxS (ORCPT ); Fri, 20 Dec 2013 12:53:18 -0500 Received: from dude.hi.pengutronix.de ([10.1.0.7] helo=dude.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Vu4Ft-0004r6-Uo; Fri, 20 Dec 2013 18:52:57 +0100 From: Philipp Zabel To: devel@driverdev.osuosl.org, linux-fbdev@vger.kernel.org Cc: Russell King , Shawn Guo , Greg Kroah-Hartman , Tomi Valkeinen , Dave Airlie , kernel@pengutronix.de, Philipp Zabel Subject: [RFC PATCH 2/5] gpu: ipu-v3: Add SMFC code Date: Fri, 20 Dec 2013 18:52:43 +0100 Message-Id: <1387561966-31758-3-git-send-email-p.zabel@pengutronix.de> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1387561966-31758-1-git-send-email-p.zabel@pengutronix.de> References: <1387561966-31758-1-git-send-email-p.zabel@pengutronix.de> X-SA-Exim-Connect-IP: 10.1.0.7 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-fbdev@vger.kernel.org Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Sensor Multi Fifo Controller (SMFC) is used as a buffer between the two CSIs (writing simultaneously) and up to four IDMAC channels. Signed-off-by: Philipp Zabel --- drivers/gpu/ipu-v3/Makefile | 2 +- drivers/gpu/ipu-v3/ipu-common.c | 10 +++++ drivers/gpu/ipu-v3/ipu-prv.h | 6 +++ drivers/gpu/ipu-v3/ipu-smfc.c | 97 +++++++++++++++++++++++++++++++++++++++++ include/video/imx-ipu-v3.h | 6 +++ 5 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/ipu-v3/ipu-smfc.c diff --git a/drivers/gpu/ipu-v3/Makefile b/drivers/gpu/ipu-v3/Makefile index d21cc37..1887972b 100644 --- a/drivers/gpu/ipu-v3/Makefile +++ b/drivers/gpu/ipu-v3/Makefile @@ -1,3 +1,3 @@ obj-$(CONFIG_IMX_IPUV3_CORE) += imx-ipu-v3.o -imx-ipu-v3-objs := ipu-common.o ipu-dc.o ipu-di.o ipu-dp.o ipu-dmfc.o +imx-ipu-v3-objs := ipu-common.o ipu-dc.o ipu-di.o ipu-dp.o ipu-dmfc.o ipu-smfc.o diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index a59cc6c..8f98719 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c @@ -876,8 +876,17 @@ static int ipu_submodules_init(struct ipu_soc *ipu, goto err_dp; } + ret = ipu_smfc_init(ipu, dev, ipu_base + + devtype->cm_ofs + IPU_CM_SMFC_REG_OFS); + if (ret) { + unit = "smfc"; + goto err_smfc; + } + return 0; +err_smfc: + ipu_dp_exit(ipu); err_dp: ipu_dmfc_exit(ipu); err_dmfc: @@ -949,6 +958,7 @@ EXPORT_SYMBOL_GPL(ipu_idmac_channel_irq); static void ipu_submodules_exit(struct ipu_soc *ipu) { + ipu_smfc_exit(ipu); ipu_dp_exit(ipu); ipu_dmfc_exit(ipu); ipu_dc_exit(ipu); diff --git a/drivers/gpu/ipu-v3/ipu-prv.h b/drivers/gpu/ipu-v3/ipu-prv.h index 5cb075f..acf1811 100644 --- a/drivers/gpu/ipu-v3/ipu-prv.h +++ b/drivers/gpu/ipu-v3/ipu-prv.h @@ -151,6 +151,8 @@ struct ipuv3_channel { struct ipu_dc_priv; struct ipu_dmfc_priv; struct ipu_di; +struct ipu_smfc_priv; + struct ipu_devtype; struct ipu_soc { @@ -178,6 +180,7 @@ struct ipu_soc { struct ipu_dp_priv *dp_priv; struct ipu_dmfc_priv *dmfc_priv; struct ipu_di *di_priv[2]; + struct ipu_smfc_priv *smfc_priv; }; void ipu_srm_dp_sync_update(struct ipu_soc *ipu); @@ -203,4 +206,7 @@ void ipu_dc_exit(struct ipu_soc *ipu); int ipu_cpmem_init(struct ipu_soc *ipu, struct device *dev, unsigned long base); void ipu_cpmem_exit(struct ipu_soc *ipu); +int ipu_smfc_init(struct ipu_soc *ipu, struct device *dev, unsigned long base); +void ipu_smfc_exit(struct ipu_soc *ipu); + #endif /* __IPU_PRV_H__ */ diff --git a/drivers/gpu/ipu-v3/ipu-smfc.c b/drivers/gpu/ipu-v3/ipu-smfc.c new file mode 100644 index 0000000..e4f85ad --- /dev/null +++ b/drivers/gpu/ipu-v3/ipu-smfc.c @@ -0,0 +1,97 @@ +/* + * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved. + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ +#define DEBUG +#include +#include +#include +#include +#include +#include +#include +#include +#include