Skip to contentSkip to conversation

Samsung S5P SoC camera interface driver

PATCH Superseded Sylwester Nawrocki 3 participants 21 messages Jul 15, 2010 – Jul 16, 2010

Subsystems (5)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Samsung S5P SoC camera interface driver

Hello,

This is a second version of my patch series adding support for camera interface, video output and video processing contained in Samsung's S3C/S5P SoCs.

The first version can be found at:
http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg01698.html

Changes since v1:
- support for multiple SoC variants through the platform device name overriding (S5PC100 and SPV210 version definitions included)

Kernel tree
-----------------

This patch series has been prepared in assumption that the following patches for s3c-fb driver have been applied:

http://www.mail-archive.com/linux-samsung-soc at vger.kernel.org/msg02000.html [PATCH v4 0/19] Various s3c-fb updates

Patches
-----------------

The following patch series contains:

[PATCH 01/10 v2] ARM: Samsung: Add FIMC register and platform definitions [PATCH 02/10 v2] ARM: Samsung: Add FIMC resource definition and FIMC driver platform helpers [PATCH 03/10 v2] ARM: Samsung: Add platform definitions for local FIMC/FIMD fifo path [PATCH 04/10 v2] v4l: Add Samsung FIMC (video postprocessor) driver
[PATCH 05/10 v2] s3c-fb: Add v4l2 subdevice to support framebuffer local fifo input path [PATCH 06/10 v2] ARM: S5PV210: Add fifo link definitions for FIMC and framebuffer [PATCH 07/10 v2] ARM: S5PV210: add common Aquila & GONI code
[PATCH 08/10 v2] ARM: S5PV210: enable FIMC on Aquila
[PATCH 09/10 v2] ARM: s5pv210: enable FIMC on Goni
[PATCH 10/10 v2] ARM: S5PC100: enable FIMC on SMDKC100

Best regards,

Signature · 2 lines
Sylwester Nawrocki
Samsung Poland R&D Center
#1 lore raw

PATCH v2 1/10 ARM: Samsung: Add FIMC register and platform definitions

FIMC device is a camera interface embedded in S3C/S5P Samsung SOC series. It supports ITU-R BT.601/656 and MIPI-CSI2 standards, memory to memory operations, color conversion, resizing and rotation.

---
 arch/arm/plat-samsung/include/plat/fimc.h      |   31 ++
 arch/arm/plat-samsung/include/plat/regs-fimc.h |  361 ++++++++++++++++++++++++
 2 files changed, 392 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/include/plat/fimc.h
 create mode 100644 arch/arm/plat-samsung/include/plat/regs-fimc.h
arch/arm/plat-samsung/include/plat/fimc.h new file +31 -0
new file mode 100644
index 0000000..be1e853
@@ -0,0 +1,31 @@
+/* linux/arch/arm/plat-samsung/include/plat/fimc.h
+ *
+ * Platform header file for FIMC driver
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Sylwester Nawrocki, <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef FIMC_H_
+#define FIMC_H_
+
+#include <linux/device.h>
+#include <linux/platform_device.h>
+
+
+#define FIMC_MAX_FIFO_TARGETS	1
+#define FIMC_LCD_FIFO_TARGET	0
+
+struct s3c_fifo_link;
+
+struct samsung_plat_fimc {
+	struct s3c_fifo_link	*fifo_targets[FIMC_MAX_FIFO_TARGETS];
+};
+
+#endif /* FIMC_H_ */
+
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +361 -0

361 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v2 1/10 ARM: Samsung: Add FIMC register and platform definitions

Quoted 33 lines · Sylwester Nawrocki

FIMC device is a camera interface embedded in S3C/S5P Samsung SOC series. It supports ITU-R BT.601/656 and MIPI-CSI2 standards, memory to memory operations, color conversion, resizing and rotation.

---
 arch/arm/plat-samsung/include/plat/fimc.h      |   31 ++
 arch/arm/plat-samsung/include/plat/regs-fimc.h |  361
++++++++++++++++++++++++
 2 files changed, 392 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/include/plat/fimc.h
 create mode 100644 arch/arm/plat-samsung/include/plat/regs-fimc.h
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/fimc.h +0 -0

samsung/include/plat/fimc.h
new file mode 100644
index 0000000..be1e853

arch/arm/plat-samsung/include/plat/fimc.h new file +10 -0
@@ -0,0 +1,31 @@
+/* linux/arch/arm/plat-samsung/include/plat/fimc.h
+ *
+ * Platform header file for FIMC driver
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Sylwester Nawrocki, <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as

arch/arm/plat-samsung/include/plat/fimc.h line 20

Quoted 10 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +10 -0
+ * published by the Free Software Foundation.
+ */
+
+#ifndef FIMC_H_
+#define FIMC_H_
+
+#include <linux/device.h>
+#include <linux/platform_device.h>
+
+

2 empty lines...

arch/arm/plat-samsung/include/plat/fimc.h line 31

Quoted 11 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +11 -0
+#define FIMC_MAX_FIFO_TARGETS	1
+#define FIMC_LCD_FIFO_TARGET	0
+
+struct s3c_fifo_link;
+
+struct samsung_plat_fimc {
+	struct s3c_fifo_link	*fifo_targets[FIMC_MAX_FIFO_TARGETS];
+};
+
+#endif /* FIMC_H_ */
+

No need last empty line...

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/plat-

Quoted 106 lines

samsung/include/plat/regs-fimc.h
new file mode 100644
index 0000000..6946a93

arch/arm/plat-samsung/include/plat/regs-fimc.h new file +100 -0
@@ -0,0 +1,361 @@
+/* arch/arm/plat-s5p/include/plat/regs-fimc.h
+ *
+ * Register definition file for Samsung Camera Interface (FIMC) driver
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef REGS_FIMC_H_
+#define REGS_FIMC_H_
+
+#define S5P_CIOYSA(__x)				(0x18 + (__x) * 4)
+#define S5P_CIOCBSA(__x)			(0x28 + (__x) * 4)
+#define S5P_CIOCRSA(__x)			(0x38 + (__x) * 4)
+
+/* Input source format */
+#define S5P_CISRCFMT				0x00
+/* Window offset */
+#define S5P_CIWDOFST				0x04
+/* Global control */
+#define S5P_CIGCTRL				0x08
+/* Window offset 2 */
+#define S5P_CIWDOFST2				0x14
+/* Output DMA Y 1st frame start address */
+#define S5P_CIOYSA1				0x18
+/* Output DMA Y 2nd frame start address */
+#define S5P_CIOYSA2				0x1c
+/* Output DMA Y 3rd frame start address */
+#define S5P_CIOYSA3				0x20
+/* Output DMA Y 4th frame start address */
+#define S5P_CIOYSA4				0x24
+/* Output DMA Cb 1st frame start address */
+#define S5P_CIOCBSA1				0x28
+/* Output DMA Cb 2nd frame start address */
+#define S5P_CIOCBSA2				0x2c
+/* Output DMA Cb 3rd frame start address */
+#define S5P_CIOCBSA3				0x30
+/* Output DMA Cb 4th frame start address */
+#define S5P_CIOCBSA4				0x34
+/* Output DMA Cr 1st frame start address */
+#define S5P_CIOCRSA1				0x38
+/* Output DMA Cr 2nd frame start address */
+#define S5P_CIOCRSA2				0x3c
+/* Output DMA Cr 3rd frame start address */
+#define S5P_CIOCRSA3				0x40
+/* Output DMA Cr 4th frame start address */
+#define S5P_CIOCRSA4				0x44
+/* Target image format */
+#define S5P_CITRGFMT				0x48
+/* Output DMA control */
+#define S5P_CIOCTRL				0x4c
+/* Pre-scaler control 1 */
+#define S5P_CISCPRERATIO			0x50
+/* Pre-scaler control 2 */
+#define S5P_CISCPREDST				0x54
+/* Main scaler control */
+#define S5P_CISCCTRL				0x58
+/* Target area */
+#define S5P_CITAREA				0x5c
+/* Status */
+#define S5P_CISTATUS				0x64
+/* Image capture enable command */
+#define S5P_CIIMGCPT				0xc0
+/* Capture sequence */
+#define S5P_CICPTSEQ				0xc4
+/* Image effects */
+#define S5P_CIIMGEFF				0xd0
+/* Y frame start address for input DMA */
+#define S5P_CIIYSA0				0xd4
+/* Cb frame start address for input DMA */
+#define S5P_CIICBSA0				0xd8
+/* Cr frame start address for input DMA */
+#define S5P_CIICRSA0				0xdc
+/* Real input DMA image size */
+#define S5P_CIREAL_ISIZE			0xf8
+/* Input DMA control */
+#define S5P_MSCTRL				0xfc
+/* Y frame start address for input DMA */
+#define S5P_CIIYSA1				0x144
+/* Cb frame start address for input DMA */
+#define S5P_CIICBSA1				0x148
+/* Cr frame start address for input DMA */
+#define S5P_CIICRSA1				0x14c
+/* Output DMA Y offset */
+#define S5P_CIOYOFF				0x168
+/* Output DMA CB offset */
+#define S5P_CIOCBOFF				0x16c
+/* Output DMA CR offset */
+#define S5P_CIOCROFF				0x170
+/* Input DMA Y offset */
+#define S5P_CIIYOFF				0x174
+/* Input DMA CB offset */
+#define S5P_CIICBOFF				0x178
+/* Input DMA CR offset */
+#define S5P_CIICROFF				0x17c
+/* Input DMA original image size */
+#define S5P_ORGISIZE				0x180

arch/arm/plat-samsung/include/plat/regs-fimc.h line 110

Quoted 10 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +10 -0
+/* Output DMA original image size */
+#define S5P_ORGOSIZE				0x184
+/* Real output DMA image size */
+#define S5P_CIEXTEN				0x188
+/* DMA parameter */
+#define S5P_CIDMAPARAM				0x18c
+/* MIPI CSI image format */
+#define S5P_CSIIMGFMT				0x194
+
+

2 empty lines?

Quoted 47 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +47 -0
+#define S5P_CISRCFMT_SOURCEHSIZE(x)		((x) << 16)
+#define S5P_CISRCFMT_SOURCEVSIZE(x)		((x) << 0)
+
+#define S5P_CIWDOFST_WINHOROFST(x)		((x) << 16)
+#define S5P_CIWDOFST_WINVEROFST(x)		((x) << 0)
+
+#define S5P_CIWDOFST2_WINHOROFST2(x)		((x) << 16)
+#define S5P_CIWDOFST2_WINVEROFST2(x)		((x) << 0)
+
+#define S5P_CITRGFMT_TARGETHSIZE(x)		((x) << 16)
+#define S5P_CITRGFMT_TARGETVSIZE(x)		((x) << 0)
+
+#define S5P_CISCPRERATIO_SHFACTOR(x)		((x) << 28)
+#define S5P_CISCPRERATIO_PREHORRATIO(x)		((x) << 16)
+#define S5P_CISCPRERATIO_PREVERRATIO(x)		((x) << 0)
+
+#define S5P_CISCPREDST_PREDSTWIDTH(x)		((x) << 16)
+#define S5P_CISCPREDST_PREDSTHEIGHT(x)		((x) << 0)
+
+#define S5P_CISCCTRL_MAINHORRATIO(x)		((x) << 16)
+#define S5P_CISCCTRL_MAINVERRATIO(x)		((x) << 0)
+
+#define S5P_CITAREA_TARGET_AREA(x)		((x) << 0)
+
+#define S5P_CIIMGEFF_PAT_CB(x)			((x) << 13)
+#define S5P_CIIMGEFF_PAT_CR(x)			((x) << 0)
+
+#define S5P_CIREAL_ISIZE_HEIGHT(x)		((x) << 16)
+#define S5P_CIREAL_ISIZE_WIDTH(x)		((x) << 0)
+
+#define S5P_MSCTRL_SUCCESSIVE_COUNT(x)		((x) << 24)
+
+#define S5P_CIOYOFF_VERTICAL(x)			((x) << 16)
+#define S5P_CIOYOFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_CIOCBOFF_VERTICAL(x)		((x) << 16)
+#define S5P_CIOCBOFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_CIOCROFF_VERTICAL(x)		((x) << 16)
+#define S5P_CIOCROFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_CIIYOFF_VERTICAL(x)			((x) << 16)
+#define S5P_CIIYOFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_CIICBOFF_VERTICAL(x)		((x) << 16)
+#define S5P_CIICBOFF_HORIZONTAL(x)		((x) << 0)
+

arch/arm/plat-samsung/include/plat/regs-fimc.h line 167

Quoted 10 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +10 -0
+#define S5P_CIICROFF_VERTICAL(x)		((x) << 16)
+#define S5P_CIICROFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_ORGISIZE_VERTICAL(x)		((x) << 16)
+#define S5P_ORGISIZE_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_ORGOSIZE_VERTICAL(x)		((x) << 16)
+#define S5P_ORGOSIZE_HORIZONTAL(x)		((x) << 0)
+
+

Same...2 empty lines...

And above definitions used same bit shift...((x) << 16) or ((x) << 0)... Hmm...I'm thinking...whether there is any method to reduce similar codes...

arch/arm/plat-samsung/include/plat/regs-fimc.h line 180

Quoted 13 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +13 -0
+/* Register's bit definitions */
+
+/* Source format register */
+#define S5P_CISRCFMT_ITU601_8BIT		(1 << 31)
+#define S5P_CISRCFMT_ITU656_8BIT		(0 << 31)
+#define S5P_CISRCFMT_ITU601_16BIT		(1 << 29)
+#define S5P_CISRCFMT_ORDER422_YCBYCR		(0 << 14)
+#define S5P_CISRCFMT_ORDER422_YCRYCB		(1 << 14)
+#define S5P_CISRCFMT_ORDER422_CBYCRY		(2 << 14)
+#define S5P_CISRCFMT_ORDER422_CRYCBY		(3 << 14)
+/* ITU601 16bit only */
+#define S5P_CISRCFMT_ORDER422_Y4CBCRCBCR	(0 << 14)
+/* ITU601 16bit only */

Same comments... ITU601 16bit only...

Quoted 70 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +70 -0
+#define S5P_CISRCFMT_ORDER422_Y4CRCBCRCB	(1 << 14)
+
+/* Window offset register */
+#define S5P_CIWDOFST_WINOFSEN			(1 << 31)
+#define S5P_CIWDOFST_CLROVFIY			(1 << 30)
+#define S5P_CIWDOFST_CLROVRLB			(1 << 29)
+#define S5P_CIWDOFST_WINHOROFST_MASK		(0x7ff << 16)
+#define S5P_CIWDOFST_CLROVFICB			(1 << 15)
+#define S5P_CIWDOFST_CLROVFICR			(1 << 14)
+#define S5P_CIWDOFST_WINVEROFST_MASK		(0xfff << 0)
+
+/* Global control register */
+#define S5P_CIGCTRL_SWRST			(1 << 31)
+#define S5P_CIGCTRL_CAMRST_A			(1 << 30)
+#define S5P_CIGCTRL_SELCAM_ITU_B		(0 << 29)
+#define S5P_CIGCTRL_SELCAM_ITU_A		(1 << 29)
+#define S5P_CIGCTRL_SELCAM_ITU_MASK		(1 << 29)
+#define S5P_CIGCTRL_TESTPAT_NORMAL		(0 << 27)
+#define S5P_CIGCTRL_TESTPAT_COLOR_BAR		(1 << 27)
+#define S5P_CIGCTRL_TESTPAT_HOR_INC		(2 << 27)
+#define S5P_CIGCTRL_TESTPAT_VER_INC		(3 << 27)
+#define S5P_CIGCTRL_TESTPAT_MASK		(3 << 27)
+#define S5P_CIGCTRL_TESTPAT_SHIFT		(27)
+#define S5P_CIGCTRL_INVPOLPCLK			(1 << 26)
+#define S5P_CIGCTRL_INVPOLVSYNC			(1 << 25)
+#define S5P_CIGCTRL_INVPOLHREF			(1 << 24)
+#define S5P_CIGCTRL_IRQ_OVFEN			(1 << 22)
+#define S5P_CIGCTRL_HREF_MASK			(1 << 21)
+#define S5P_CIGCTRL_IRQ_EDGE			(0 << 20)
+#define S5P_CIGCTRL_IRQ_LEVEL			(1 << 20)
+#define S5P_CIGCTRL_IRQ_CLR			(1 << 19)
+#define S5P_CIGCTRL_IRQ_DISABLE			(0 << 16)
+#define S5P_CIGCTRL_IRQ_ENABLE			(1 << 16)
+#define S5P_CIGCTRL_SHDW_DISABLE		(1 << 12)
+#define S5P_CIGCTRL_SELCAM_MIPI_B		(0 << 7)
+#define S5P_CIGCTRL_SELCAM_MIPI_A		(1 << 7)
+#define S5P_CIGCTRL_SELCAM_MIPI_MASK		(1 << 7)
+#define S5P_CIGCTRL_CAMIF_SELWB			(1 << 6)
+#define S5P_CIGCTRL_INVPOLHSYNC			(1 << 4)
+#define S5P_CIGCTRL_SELCAM_ITU			(0 << 3)
+#define S5P_CIGCTRL_SELCAM_MIPI			(1 << 3)
+#define S5P_CIGCTRL_PROGRESSIVE			(0 << 0)
+#define S5P_CIGCTRL_INTERLACE			(1 << 0)
+
+/* Window offset2 register */
+#define S5P_CIWDOFST_WINHOROFST2_MASK		(0xfff << 16)
+#define S5P_CIWDOFST_WINVEROFST2_MASK		(0xfff << 16)
+
+/* Target format register */
+#define S5P_CITRGFMT_INROT90			(1 << 31)
+#define S5P_CITRGFMT_OUTFORMAT_YCBCR420		(0 << 29)
+#define S5P_CITRGFMT_OUTFORMAT_YCBCR422		(1 << 29)
+#define S5P_CITRGFMT_OUTFORMAT_YCBCR422_1PLANE	(2 << 29)
+#define S5P_CITRGFMT_OUTFORMAT_RGB		(3 << 29)
+#define S5P_CITRGFMT_OUT_FMT_MASK		(3 << 29)
+#define S5P_CITRGFMT_HSIZE_MASK			(0xfff << 16)
+#define S5P_CITRGFMT_FLIP_SHIFT			(14)
+#define S5P_CITRGFMT_FLIP_NORMAL		(0 << 14)
+#define S5P_CITRGFMT_FLIP_X_MIRROR		(1 << 14)
+#define S5P_CITRGFMT_FLIP_Y_MIRROR		(2 << 14)
+#define S5P_CITRGFMT_FLIP_180			(3 << 14)
+#define S5P_CITRGFMT_FLIP_MASK			(3 << 14)
+#define S5P_CITRGFMT_OUTROT90			(1 << 13)
+#define S5P_CITRGFMT_VSIZE_MASK			(0xfff << 0)
+
+/* Output DMA control register */
+#define S5P_CIOCTRL_ORDER422_MASK		(3 << 0)
+#define S5P_CIOCTRL_ORDER422_CRYCBY		(0 << 0)
+#define S5P_CIOCTRL_ORDER422_YCRYCB		(1 << 0)
+#define S5P_CIOCTRL_ORDER422_CBYCRY		(2 << 0)

arch/arm/plat-samsung/include/plat/regs-fimc.h line 260

Quoted 10 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +10 -0
+#define S5P_CIOCTRL_ORDER422_YCBYCR		(3 << 0)
+#define S5P_CIOCTRL_LASTIRQ_ENABLE		(1 << 2)
+#define S5P_CIOCTRL_YCBCR_3PLANE		(0 << 3)
+#define S5P_CIOCTRL_YCBCR_2PLANE		(1 << 3)
+#define S5P_CIOCTRL_YCBCR_PLANE_MASK		(1 << 3)
+#define S5P_CIOCTRL_ORDER2P_SHIFT		(24)
+#define S5P_CIOCTRL_ORDER2P_MASK		(3 << 24)
+#define S5P_CIOCTRL_ORDER422_2P_LSB_CRCB	(0 << 24)
+
+

2 empty lines...

Quoted 93 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +60 -0
+/* Main scaler control register */
+#define S5P_CISCCTRL_SCALERBYPASS		(1 << 31)
+#define S5P_CISCCTRL_SCALEUP_H			(1 << 30)
+#define S5P_CISCCTRL_SCALEUP_V			(1 << 29)
+#define S5P_CISCCTRL_CSCR2Y_NARROW		(0 << 28)
+#define S5P_CISCCTRL_CSCR2Y_WIDE		(1 << 28)
+#define S5P_CISCCTRL_CSCY2R_NARROW		(0 << 27)
+#define S5P_CISCCTRL_CSCY2R_WIDE		(1 << 27)
+#define S5P_CISCCTRL_LCDPATHEN_FIFO		(1 << 26)
+#define S5P_CISCCTRL_PROGRESSIVE		(0 << 25)
+#define S5P_CISCCTRL_INTERLACE			(1 << 25)
+#define S5P_CISCCTRL_SCALERSTART		(1 << 15)
+#define S5P_CISCCTRL_INRGB_FMT_RGB565		(0 << 13)
+#define S5P_CISCCTRL_INRGB_FMT_RGB666		(1 << 13)
+#define S5P_CISCCTRL_INRGB_FMT_RGB888		(2 << 13)
+#define S5P_CISCCTRL_INRGB_FMT_MASK		(3 << 13)
+#define S5P_CISCCTRL_OUTRGB_FMT_RGB565		(0 << 11)
+#define S5P_CISCCTRL_OUTRGB_FMT_RGB666		(1 << 11)
+#define S5P_CISCCTRL_OUTRGB_FMT_RGB888		(2 << 11)
+#define S5P_CISCCTRL_OUTRGB_FMT_MASK		(3 << 11)
+#define S5P_CISCCTRL_EXTRGB_NORMAL		(0 << 10)
+#define S5P_CISCCTRL_EXTRGB_EXTENSION		(1 << 10)
+#define S5P_CISCCTRL_ONE2ONE			(1 << 9)
+
+/* Status register */
+#define S5P_CISTATUS_OVFIY			(1 << 31)
+#define S5P_CISTATUS_OVFICB			(1 << 30)
+#define S5P_CISTATUS_OVFICR			(1 << 29)
+#define S5P_CISTATUS_VSYNC			(1 << 28)
+#define S5P_CISTATUS_WINOFSTEN			(1 << 25)
+#define S5P_CISTATUS_IMGCPTEN			(1 << 22)
+#define S5P_CISTATUS_IMGCPTENSC			(1 << 21)
+#define S5P_CISTATUS_VSYNC_A			(1 << 20)
+#define S5P_CISTATUS_VSYNC_B			(1 << 19)
+#define S5P_CISTATUS_OVRLB			(1 << 18)
+#define S5P_CISTATUS_FRAMEEND			(1 << 17)
+#define S5P_CISTATUS_LASTCAPTUREEND		(1 << 16)
+#define S5P_CISTATUS_VVALID_A			(1 << 15)
+#define S5P_CISTATUS_VVALID_B			(1 << 14)
+
+/* Image capture enable register */
+#define S5P_CIIMGCPT_IMGCPTEN			(1 << 31)
+#define S5P_CIIMGCPT_IMGCPTEN_SC		(1 << 30)
+#define S5P_CIIMGCPT_CPT_FREN_ENABLE		(1 << 25)
+#define S5P_CIIMGCPT_CPT_FRMOD_EN		(0 << 18)
+#define S5P_CIIMGCPT_CPT_FRMOD_CNT		(1 << 18)
+
+/* Image effects register */
+#define S5P_CIIMGEFF_IE_DISABLE			(0 << 30)
+#define S5P_CIIMGEFF_IE_ENABLE			(1 << 30)
+#define S5P_CIIMGEFF_IE_SC_BEFORE		(0 << 29)
+#define S5P_CIIMGEFF_IE_SC_AFTER		(1 << 29)
+#define S5P_CIIMGEFF_FIN_BYPASS			(0 << 26)
+#define S5P_CIIMGEFF_FIN_ARBITRARY		(1 << 26)
+#define S5P_CIIMGEFF_FIN_NEGATIVE		(2 << 26)
+#define S5P_CIIMGEFF_FIN_ARTFREEZE		(3 << 26)
+#define S5P_CIIMGEFF_FIN_EMBOSSING		(4 << 26)
+#define S5P_CIIMGEFF_FIN_SILHOUETTE		(5 << 26)
+#define S5P_CIIMGEFF_FIN_MASK			(7 << 26)
+#define S5P_CIIMGEFF_PAT_CBCR_MASK		((0xff < 13) | (0xff <

0))

arch/arm/plat-samsung/include/plat/regs-fimc.h new file +32 -0
+
+/* Real input DMA size register */
+#define S5P_CIREAL_ISIZE_AUTOLOAD_ENABLE	(1 << 31)
+#define S5P_CIREAL_ISIZE_ADDR_CH_DISABLE	(1 << 30)
+
+/* Input DMA control register */
+#define S5P_MSCTRL_IN_BURST_COUNT_MASK		(3 << 24)
+#define S5P_MSCTRL_2P_IN_ORDER_MASK		(3 << 16)
+#define S5P_MSCTRL_2P_IN_ORDER_SHIFT		(16)
+#define S5P_MSCTRL_C_INT_IN_3PLANE		(0 << 15)
+#define S5P_MSCTRL_C_INT_IN_2PLANE		(1 << 15)
+#define S5P_MSCTRL_C_INT_IN_MASK		(1 << 15)
+#define S5P_MSCTRL_FLIP_SHIFT			(13)
+#define S5P_MSCTRL_FLIP_MASK			(3 << 13)
+#define S5P_MSCTRL_FLIP_NORMAL			(0 << 13)
+#define S5P_MSCTRL_FLIP_X_MIRROR		(1 << 13)
+#define S5P_MSCTRL_FLIP_Y_MIRROR		(2 << 13)
+#define S5P_MSCTRL_FLIP_180			(3 << 13)
+#define S5P_MSCTRL_ORDER422_SHIFT		(4)
+#define S5P_MSCTRL_ORDER422_CRYCBY		(0 << 4)
+#define S5P_MSCTRL_ORDER422_YCRYCB		(1 << 4)
+#define S5P_MSCTRL_ORDER422_CBYCRY		(2 << 4)
+#define S5P_MSCTRL_ORDER422_YCBYCR		(3 << 4)
+#define S5P_MSCTRL_ORDER422_MASK		(3 << 4)
+#define S5P_MSCTRL_INPUT_EXTCAM			(0 << 3)
+#define S5P_MSCTRL_INPUT_MEMORY			(1 << 3)
+#define S5P_MSCTRL_INPUT_MASK			(1 << 3)
+#define S5P_MSCTRL_INFORMAT_YCBCR420		(0 << 1)
+#define S5P_MSCTRL_INFORMAT_YCBCR422		(1 << 1)
+#define S5P_MSCTRL_INFORMAT_YCBCR422_1PLANE	(2 << 1)
+#define S5P_MSCTRL_INFORMAT_RGB			(3 << 1)
+#define S5P_MSCTRL_INFORMAT_MASK		(3 << 1)

arch/arm/plat-samsung/include/plat/regs-fimc.h

Quoted 10 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +9 -1
+#define S5P_MSCTRL_ENVID			(1 << 0)
+
+/* DMA parameter register */
+#define S5P_CIDMAPARAM_R_MODE_64X32		(3 << 29)
+#define S5P_CIDMAPARAM_W_MODE_LINEAR		(0 << 13)
+#define S5P_CIDMAPARAM_W_MODE_CONFTILE		(1 << 13)
+#define S5P_CIDMAPARAM_W_MODE_64X32		(3 << 13)
+
+#endif /* REGS_FIMC_H_ */
--

I wonder...we really need above every definitions?

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#3 lore raw

PATCH v2 1/10 ARM: Samsung: Add FIMC register and platform definitions

Hi,

thank you for the review. Please se my comments below.

Quoted 47 lines

-----Original Message-----
From: Kukjin Kim [mailto:kgene.kim at samsung.com]
Sent: Friday, July 16, 2010 11:45 AM
To: 'Sylwester Nawrocki'; linux-samsung-soc at vger.kernel.org; linux-arm- kernel at lists.infradead.org
Cc: p.osciak at samsung.com; m.szyprowski at samsung.com; kyungmin.park at samsung.com; linux-media at vger.kernel.org
Subject: RE: [PATCH 01/10 v2] ARM: Samsung: Add FIMC register and platform definitions

Quoted 2 lines · Sylwester Nawrocki

FIMC device is a camera interface embedded in S3C/S5P Samsung SOC

series.

Quoted 1 line

It supports ITU-R BT.601/656 and MIPI-CSI2 standards, memory to

memory

Quoted 13 lines

operations, color conversion, resizing and rotation.

---
 arch/arm/plat-samsung/include/plat/fimc.h      |   31 ++
 arch/arm/plat-samsung/include/plat/regs-fimc.h |  361
++++++++++++++++++++++++
 2 files changed, 392 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/include/plat/fimc.h
 create mode 100644 arch/arm/plat-samsung/include/plat/regs-fimc.h

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/plat-

Quoted 6 lines

samsung/include/plat/fimc.h
new file mode 100644
index 0000000..be1e853

arch/arm/plat-samsung/include/plat/fimc.h line 9

Quoted 9 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +9 -0
@@ -0,0 +1,31 @@
+/* linux/arch/arm/plat-samsung/include/plat/fimc.h
+ *
+ * Platform header file for FIMC driver
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Sylwester Nawrocki, <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or

modify

Quoted 13 lines

arch/arm/plat-samsung/include/plat/fimc.h line 20

Quoted 11 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +11 -0
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef FIMC_H_
+#define FIMC_H_
+
+#include <linux/device.h>
+#include <linux/platform_device.h>
+
+

2 empty lines...

I don't mind at all changing these to single line if it is the adopted style, however I didn't file like so when looking through the existing headers.

Quoted 14 lines

arch/arm/plat-samsung/include/plat/fimc.h line 31

Quoted 12 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +11 -0
+#define FIMC_MAX_FIFO_TARGETS	1
+#define FIMC_LCD_FIFO_TARGET	0
+
+struct s3c_fifo_link;
+
+struct samsung_plat_fimc {
+	struct s3c_fifo_link	*fifo_targets[FIMC_MAX_FIFO_TARGETS];
+};
+
+#endif /* FIMC_H_ */
+

No need last empty line...

C89 and C99 standard requires a new line character at the end of file. The compiler should issue a warning when the new line character at the end of file is missing, otherwise it is not compliant with the above C standards.
So I would rather add a new line where it is missing rather than removing it.
There is lots of header files already in arch/arm/plat-samsung where there is even more than one empty line at the end of file.

Quoted 184 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

b/arch/arm/plat-

arch/arm/plat-samsung/include/plat/regs-fimc.h line 3

Quoted 9 lines

samsung/include/plat/regs-fimc.h
new file mode 100644
index 0000000..6946a93

arch/arm/plat-samsung/include/plat/regs-fimc.h new file +3 -0
@@ -0,0 +1,361 @@
+/* arch/arm/plat-s5p/include/plat/regs-fimc.h
+ *
+ * Register definition file for Samsung Camera Interface (FIMC)

driver

arch/arm/plat-samsung/include/plat/regs-fimc.h line 7

Quoted 4 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +4 -0
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * This program is free software; you can redistribute it and/or

modify

Quoted 93 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +93 -0
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef REGS_FIMC_H_
+#define REGS_FIMC_H_
+
+#define S5P_CIOYSA(__x)				(0x18 + (__x) * 4)
+#define S5P_CIOCBSA(__x)			(0x28 + (__x) * 4)
+#define S5P_CIOCRSA(__x)			(0x38 + (__x) * 4)
+
+/* Input source format */
+#define S5P_CISRCFMT				0x00
+/* Window offset */
+#define S5P_CIWDOFST				0x04
+/* Global control */
+#define S5P_CIGCTRL				0x08
+/* Window offset 2 */
+#define S5P_CIWDOFST2				0x14
+/* Output DMA Y 1st frame start address */
+#define S5P_CIOYSA1				0x18
+/* Output DMA Y 2nd frame start address */
+#define S5P_CIOYSA2				0x1c
+/* Output DMA Y 3rd frame start address */
+#define S5P_CIOYSA3				0x20
+/* Output DMA Y 4th frame start address */
+#define S5P_CIOYSA4				0x24
+/* Output DMA Cb 1st frame start address */
+#define S5P_CIOCBSA1				0x28
+/* Output DMA Cb 2nd frame start address */
+#define S5P_CIOCBSA2				0x2c
+/* Output DMA Cb 3rd frame start address */
+#define S5P_CIOCBSA3				0x30
+/* Output DMA Cb 4th frame start address */
+#define S5P_CIOCBSA4				0x34
+/* Output DMA Cr 1st frame start address */
+#define S5P_CIOCRSA1				0x38
+/* Output DMA Cr 2nd frame start address */
+#define S5P_CIOCRSA2				0x3c
+/* Output DMA Cr 3rd frame start address */
+#define S5P_CIOCRSA3				0x40
+/* Output DMA Cr 4th frame start address */
+#define S5P_CIOCRSA4				0x44
+/* Target image format */
+#define S5P_CITRGFMT				0x48
+/* Output DMA control */
+#define S5P_CIOCTRL				0x4c
+/* Pre-scaler control 1 */
+#define S5P_CISCPRERATIO			0x50
+/* Pre-scaler control 2 */
+#define S5P_CISCPREDST				0x54
+/* Main scaler control */
+#define S5P_CISCCTRL				0x58
+/* Target area */
+#define S5P_CITAREA				0x5c
+/* Status */
+#define S5P_CISTATUS				0x64
+/* Image capture enable command */
+#define S5P_CIIMGCPT				0xc0
+/* Capture sequence */
+#define S5P_CICPTSEQ				0xc4
+/* Image effects */
+#define S5P_CIIMGEFF				0xd0
+/* Y frame start address for input DMA */
+#define S5P_CIIYSA0				0xd4
+/* Cb frame start address for input DMA */
+#define S5P_CIICBSA0				0xd8
+/* Cr frame start address for input DMA */
+#define S5P_CIICRSA0				0xdc
+/* Real input DMA image size */
+#define S5P_CIREAL_ISIZE			0xf8
+/* Input DMA control */
+#define S5P_MSCTRL				0xfc
+/* Y frame start address for input DMA */
+#define S5P_CIIYSA1				0x144
+/* Cb frame start address for input DMA */
+#define S5P_CIICBSA1				0x148
+/* Cr frame start address for input DMA */
+#define S5P_CIICRSA1				0x14c
+/* Output DMA Y offset */
+#define S5P_CIOYOFF				0x168
+/* Output DMA CB offset */
+#define S5P_CIOCBOFF				0x16c
+/* Output DMA CR offset */
+#define S5P_CIOCROFF				0x170
+/* Input DMA Y offset */
+#define S5P_CIIYOFF				0x174
+/* Input DMA CB offset */
+#define S5P_CIICBOFF				0x178
+/* Input DMA CR offset */
+#define S5P_CIICROFF				0x17c
+/* Input DMA original image size */
+#define S5P_ORGISIZE				0x180

arch/arm/plat-samsung/include/plat/regs-fimc.h line 110

Quoted 10 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +10 -0
+/* Output DMA original image size */
+#define S5P_ORGOSIZE				0x184
+/* Real output DMA image size */
+#define S5P_CIEXTEN				0x188
+/* DMA parameter */
+#define S5P_CIDMAPARAM				0x18c
+/* MIPI CSI image format */
+#define S5P_CSIIMGFMT				0x194
+
+

2 empty lines?

Quoted 47 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +47 -0
+#define S5P_CISRCFMT_SOURCEHSIZE(x)		((x) << 16)
+#define S5P_CISRCFMT_SOURCEVSIZE(x)		((x) << 0)
+
+#define S5P_CIWDOFST_WINHOROFST(x)		((x) << 16)
+#define S5P_CIWDOFST_WINVEROFST(x)		((x) << 0)
+
+#define S5P_CIWDOFST2_WINHOROFST2(x)		((x) << 16)
+#define S5P_CIWDOFST2_WINVEROFST2(x)		((x) << 0)
+
+#define S5P_CITRGFMT_TARGETHSIZE(x)		((x) << 16)
+#define S5P_CITRGFMT_TARGETVSIZE(x)		((x) << 0)
+
+#define S5P_CISCPRERATIO_SHFACTOR(x)		((x) << 28)
+#define S5P_CISCPRERATIO_PREHORRATIO(x)		((x) << 16)
+#define S5P_CISCPRERATIO_PREVERRATIO(x)		((x) << 0)
+
+#define S5P_CISCPREDST_PREDSTWIDTH(x)		((x) << 16)
+#define S5P_CISCPREDST_PREDSTHEIGHT(x)		((x) << 0)
+
+#define S5P_CISCCTRL_MAINHORRATIO(x)		((x) << 16)
+#define S5P_CISCCTRL_MAINVERRATIO(x)		((x) << 0)
+
+#define S5P_CITAREA_TARGET_AREA(x)		((x) << 0)
+
+#define S5P_CIIMGEFF_PAT_CB(x)			((x) << 13)
+#define S5P_CIIMGEFF_PAT_CR(x)			((x) << 0)
+
+#define S5P_CIREAL_ISIZE_HEIGHT(x)		((x) << 16)
+#define S5P_CIREAL_ISIZE_WIDTH(x)		((x) << 0)
+
+#define S5P_MSCTRL_SUCCESSIVE_COUNT(x)		((x) << 24)
+
+#define S5P_CIOYOFF_VERTICAL(x)			((x) << 16)
+#define S5P_CIOYOFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_CIOCBOFF_VERTICAL(x)		((x) << 16)
+#define S5P_CIOCBOFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_CIOCROFF_VERTICAL(x)		((x) << 16)
+#define S5P_CIOCROFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_CIIYOFF_VERTICAL(x)			((x) << 16)
+#define S5P_CIIYOFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_CIICBOFF_VERTICAL(x)		((x) << 16)
+#define S5P_CIICBOFF_HORIZONTAL(x)		((x) << 0)
+

arch/arm/plat-samsung/include/plat/regs-fimc.h line 167

Quoted 10 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +10 -0
+#define S5P_CIICROFF_VERTICAL(x)		((x) << 16)
+#define S5P_CIICROFF_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_ORGISIZE_VERTICAL(x)		((x) << 16)
+#define S5P_ORGISIZE_HORIZONTAL(x)		((x) << 0)
+
+#define S5P_ORGOSIZE_VERTICAL(x)		((x) << 16)
+#define S5P_ORGOSIZE_HORIZONTAL(x)		((x) << 0)
+
+

Same...2 empty lines...

Quoted 4 lines

And above definitions used same bit shift...((x) << 16) or ((x) << 0)...
Hmm...I'm thinking...whether there is any method to reduce similar codes...

OK, I will just define 2 generic macros for these DMA offsets and possibly other two for the sizes. However when the shifts are changed in the future SoC versions we will have to go back to separate definitions per each register and modify the driver again.

Quoted 196 lines
Quoted 4 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +3 -0
+/* Register's bit definitions */
+
+/* Source format register */

arch/arm/plat-samsung/include/plat/regs-fimc.h line 180

Quoted 10 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +10 -0
+#define S5P_CISRCFMT_ITU601_8BIT		(1 << 31)
+#define S5P_CISRCFMT_ITU656_8BIT		(0 << 31)
+#define S5P_CISRCFMT_ITU601_16BIT		(1 << 29)
+#define S5P_CISRCFMT_ORDER422_YCBYCR		(0 << 14)
+#define S5P_CISRCFMT_ORDER422_YCRYCB		(1 << 14)
+#define S5P_CISRCFMT_ORDER422_CBYCRY		(2 << 14)
+#define S5P_CISRCFMT_ORDER422_CRYCBY		(3 << 14)
+/* ITU601 16bit only */
+#define S5P_CISRCFMT_ORDER422_Y4CBCRCBCR	(0 << 14)
+/* ITU601 16bit only */

Same comments... ITU601 16bit only...

Quoted 70 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +70 -0
+#define S5P_CISRCFMT_ORDER422_Y4CRCBCRCB	(1 << 14)
+
+/* Window offset register */
+#define S5P_CIWDOFST_WINOFSEN			(1 << 31)
+#define S5P_CIWDOFST_CLROVFIY			(1 << 30)
+#define S5P_CIWDOFST_CLROVRLB			(1 << 29)
+#define S5P_CIWDOFST_WINHOROFST_MASK		(0x7ff << 16)
+#define S5P_CIWDOFST_CLROVFICB			(1 << 15)
+#define S5P_CIWDOFST_CLROVFICR			(1 << 14)
+#define S5P_CIWDOFST_WINVEROFST_MASK		(0xfff << 0)
+
+/* Global control register */
+#define S5P_CIGCTRL_SWRST			(1 << 31)
+#define S5P_CIGCTRL_CAMRST_A			(1 << 30)
+#define S5P_CIGCTRL_SELCAM_ITU_B		(0 << 29)
+#define S5P_CIGCTRL_SELCAM_ITU_A		(1 << 29)
+#define S5P_CIGCTRL_SELCAM_ITU_MASK		(1 << 29)
+#define S5P_CIGCTRL_TESTPAT_NORMAL		(0 << 27)
+#define S5P_CIGCTRL_TESTPAT_COLOR_BAR		(1 << 27)
+#define S5P_CIGCTRL_TESTPAT_HOR_INC		(2 << 27)
+#define S5P_CIGCTRL_TESTPAT_VER_INC		(3 << 27)
+#define S5P_CIGCTRL_TESTPAT_MASK		(3 << 27)
+#define S5P_CIGCTRL_TESTPAT_SHIFT		(27)
+#define S5P_CIGCTRL_INVPOLPCLK			(1 << 26)
+#define S5P_CIGCTRL_INVPOLVSYNC			(1 << 25)
+#define S5P_CIGCTRL_INVPOLHREF			(1 << 24)
+#define S5P_CIGCTRL_IRQ_OVFEN			(1 << 22)
+#define S5P_CIGCTRL_HREF_MASK			(1 << 21)
+#define S5P_CIGCTRL_IRQ_EDGE			(0 << 20)
+#define S5P_CIGCTRL_IRQ_LEVEL			(1 << 20)
+#define S5P_CIGCTRL_IRQ_CLR			(1 << 19)
+#define S5P_CIGCTRL_IRQ_DISABLE			(0 << 16)
+#define S5P_CIGCTRL_IRQ_ENABLE			(1 << 16)
+#define S5P_CIGCTRL_SHDW_DISABLE		(1 << 12)
+#define S5P_CIGCTRL_SELCAM_MIPI_B		(0 << 7)
+#define S5P_CIGCTRL_SELCAM_MIPI_A		(1 << 7)
+#define S5P_CIGCTRL_SELCAM_MIPI_MASK		(1 << 7)
+#define S5P_CIGCTRL_CAMIF_SELWB			(1 << 6)
+#define S5P_CIGCTRL_INVPOLHSYNC			(1 << 4)
+#define S5P_CIGCTRL_SELCAM_ITU			(0 << 3)
+#define S5P_CIGCTRL_SELCAM_MIPI			(1 << 3)
+#define S5P_CIGCTRL_PROGRESSIVE			(0 << 0)
+#define S5P_CIGCTRL_INTERLACE			(1 << 0)
+
+/* Window offset2 register */
+#define S5P_CIWDOFST_WINHOROFST2_MASK		(0xfff << 16)
+#define S5P_CIWDOFST_WINVEROFST2_MASK		(0xfff << 16)
+
+/* Target format register */
+#define S5P_CITRGFMT_INROT90			(1 << 31)
+#define S5P_CITRGFMT_OUTFORMAT_YCBCR420		(0 << 29)
+#define S5P_CITRGFMT_OUTFORMAT_YCBCR422		(1 << 29)
+#define S5P_CITRGFMT_OUTFORMAT_YCBCR422_1PLANE	(2 << 29)
+#define S5P_CITRGFMT_OUTFORMAT_RGB		(3 << 29)
+#define S5P_CITRGFMT_OUT_FMT_MASK		(3 << 29)
+#define S5P_CITRGFMT_HSIZE_MASK			(0xfff << 16)
+#define S5P_CITRGFMT_FLIP_SHIFT			(14)
+#define S5P_CITRGFMT_FLIP_NORMAL		(0 << 14)
+#define S5P_CITRGFMT_FLIP_X_MIRROR		(1 << 14)
+#define S5P_CITRGFMT_FLIP_Y_MIRROR		(2 << 14)
+#define S5P_CITRGFMT_FLIP_180			(3 << 14)
+#define S5P_CITRGFMT_FLIP_MASK			(3 << 14)
+#define S5P_CITRGFMT_OUTROT90			(1 << 13)
+#define S5P_CITRGFMT_VSIZE_MASK			(0xfff << 0)
+
+/* Output DMA control register */
+#define S5P_CIOCTRL_ORDER422_MASK		(3 << 0)
+#define S5P_CIOCTRL_ORDER422_CRYCBY		(0 << 0)
+#define S5P_CIOCTRL_ORDER422_YCRYCB		(1 << 0)
+#define S5P_CIOCTRL_ORDER422_CBYCRY		(2 << 0)

arch/arm/plat-samsung/include/plat/regs-fimc.h line 260

Quoted 10 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +10 -0
+#define S5P_CIOCTRL_ORDER422_YCBYCR		(3 << 0)
+#define S5P_CIOCTRL_LASTIRQ_ENABLE		(1 << 2)
+#define S5P_CIOCTRL_YCBCR_3PLANE		(0 << 3)
+#define S5P_CIOCTRL_YCBCR_2PLANE		(1 << 3)
+#define S5P_CIOCTRL_YCBCR_PLANE_MASK		(1 << 3)
+#define S5P_CIOCTRL_ORDER2P_SHIFT		(24)
+#define S5P_CIOCTRL_ORDER2P_MASK		(3 << 24)
+#define S5P_CIOCTRL_ORDER422_2P_LSB_CRCB	(0 << 24)
+
+

2 empty lines...

Quoted 96 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +60 -0
+/* Main scaler control register */
+#define S5P_CISCCTRL_SCALERBYPASS		(1 << 31)
+#define S5P_CISCCTRL_SCALEUP_H			(1 << 30)
+#define S5P_CISCCTRL_SCALEUP_V			(1 << 29)
+#define S5P_CISCCTRL_CSCR2Y_NARROW		(0 << 28)
+#define S5P_CISCCTRL_CSCR2Y_WIDE		(1 << 28)
+#define S5P_CISCCTRL_CSCY2R_NARROW		(0 << 27)
+#define S5P_CISCCTRL_CSCY2R_WIDE		(1 << 27)
+#define S5P_CISCCTRL_LCDPATHEN_FIFO		(1 << 26)
+#define S5P_CISCCTRL_PROGRESSIVE		(0 << 25)
+#define S5P_CISCCTRL_INTERLACE			(1 << 25)
+#define S5P_CISCCTRL_SCALERSTART		(1 << 15)
+#define S5P_CISCCTRL_INRGB_FMT_RGB565		(0 << 13)
+#define S5P_CISCCTRL_INRGB_FMT_RGB666		(1 << 13)
+#define S5P_CISCCTRL_INRGB_FMT_RGB888		(2 << 13)
+#define S5P_CISCCTRL_INRGB_FMT_MASK		(3 << 13)
+#define S5P_CISCCTRL_OUTRGB_FMT_RGB565		(0 << 11)
+#define S5P_CISCCTRL_OUTRGB_FMT_RGB666		(1 << 11)
+#define S5P_CISCCTRL_OUTRGB_FMT_RGB888		(2 << 11)
+#define S5P_CISCCTRL_OUTRGB_FMT_MASK		(3 << 11)
+#define S5P_CISCCTRL_EXTRGB_NORMAL		(0 << 10)
+#define S5P_CISCCTRL_EXTRGB_EXTENSION		(1 << 10)
+#define S5P_CISCCTRL_ONE2ONE			(1 << 9)
+
+/* Status register */
+#define S5P_CISTATUS_OVFIY			(1 << 31)
+#define S5P_CISTATUS_OVFICB			(1 << 30)
+#define S5P_CISTATUS_OVFICR			(1 << 29)
+#define S5P_CISTATUS_VSYNC			(1 << 28)
+#define S5P_CISTATUS_WINOFSTEN			(1 << 25)
+#define S5P_CISTATUS_IMGCPTEN			(1 << 22)
+#define S5P_CISTATUS_IMGCPTENSC			(1 << 21)
+#define S5P_CISTATUS_VSYNC_A			(1 << 20)
+#define S5P_CISTATUS_VSYNC_B			(1 << 19)
+#define S5P_CISTATUS_OVRLB			(1 << 18)
+#define S5P_CISTATUS_FRAMEEND			(1 << 17)
+#define S5P_CISTATUS_LASTCAPTUREEND		(1 << 16)
+#define S5P_CISTATUS_VVALID_A			(1 << 15)
+#define S5P_CISTATUS_VVALID_B			(1 << 14)
+
+/* Image capture enable register */
+#define S5P_CIIMGCPT_IMGCPTEN			(1 << 31)
+#define S5P_CIIMGCPT_IMGCPTEN_SC		(1 << 30)
+#define S5P_CIIMGCPT_CPT_FREN_ENABLE		(1 << 25)
+#define S5P_CIIMGCPT_CPT_FRMOD_EN		(0 << 18)
+#define S5P_CIIMGCPT_CPT_FRMOD_CNT		(1 << 18)
+
+/* Image effects register */
+#define S5P_CIIMGEFF_IE_DISABLE			(0 << 30)
+#define S5P_CIIMGEFF_IE_ENABLE			(1 << 30)
+#define S5P_CIIMGEFF_IE_SC_BEFORE		(0 << 29)
+#define S5P_CIIMGEFF_IE_SC_AFTER		(1 << 29)
+#define S5P_CIIMGEFF_FIN_BYPASS			(0 << 26)
+#define S5P_CIIMGEFF_FIN_ARBITRARY		(1 << 26)
+#define S5P_CIIMGEFF_FIN_NEGATIVE		(2 << 26)
+#define S5P_CIIMGEFF_FIN_ARTFREEZE		(3 << 26)
+#define S5P_CIIMGEFF_FIN_EMBOSSING		(4 << 26)
+#define S5P_CIIMGEFF_FIN_SILHOUETTE		(5 << 26)
+#define S5P_CIIMGEFF_FIN_MASK			(7 << 26)
+#define S5P_CIIMGEFF_PAT_CBCR_MASK		((0xff < 13) | (0xff <

0))

arch/arm/plat-samsung/include/plat/regs-fimc.h new file +35 -0
+
+/* Real input DMA size register */
+#define S5P_CIREAL_ISIZE_AUTOLOAD_ENABLE	(1 << 31)
+#define S5P_CIREAL_ISIZE_ADDR_CH_DISABLE	(1 << 30)
+
+/* Input DMA control register */
+#define S5P_MSCTRL_IN_BURST_COUNT_MASK		(3 << 24)
+#define S5P_MSCTRL_2P_IN_ORDER_MASK		(3 << 16)
+#define S5P_MSCTRL_2P_IN_ORDER_SHIFT		(16)
+#define S5P_MSCTRL_C_INT_IN_3PLANE		(0 << 15)
+#define S5P_MSCTRL_C_INT_IN_2PLANE		(1 << 15)
+#define S5P_MSCTRL_C_INT_IN_MASK		(1 << 15)
+#define S5P_MSCTRL_FLIP_SHIFT			(13)
+#define S5P_MSCTRL_FLIP_MASK			(3 << 13)
+#define S5P_MSCTRL_FLIP_NORMAL			(0 << 13)
+#define S5P_MSCTRL_FLIP_X_MIRROR		(1 << 13)
+#define S5P_MSCTRL_FLIP_Y_MIRROR		(2 << 13)
+#define S5P_MSCTRL_FLIP_180			(3 << 13)
+#define S5P_MSCTRL_ORDER422_SHIFT		(4)
+#define S5P_MSCTRL_ORDER422_CRYCBY		(0 << 4)
+#define S5P_MSCTRL_ORDER422_YCRYCB		(1 << 4)
+#define S5P_MSCTRL_ORDER422_CBYCRY		(2 << 4)
+#define S5P_MSCTRL_ORDER422_YCBYCR		(3 << 4)
+#define S5P_MSCTRL_ORDER422_MASK		(3 << 4)
+#define S5P_MSCTRL_INPUT_EXTCAM			(0 << 3)
+#define S5P_MSCTRL_INPUT_MEMORY			(1 << 3)
+#define S5P_MSCTRL_INPUT_MASK			(1 << 3)
+#define S5P_MSCTRL_INFORMAT_YCBCR420		(0 << 1)
+#define S5P_MSCTRL_INFORMAT_YCBCR422		(1 << 1)
+#define S5P_MSCTRL_INFORMAT_YCBCR422_1PLANE	(2 << 1)
+#define S5P_MSCTRL_INFORMAT_RGB			(3 << 1)
+#define S5P_MSCTRL_INFORMAT_MASK		(3 << 1)
+#define S5P_MSCTRL_ENVID			(1 << 0)
+
+/* DMA parameter register */
Quoted 8 lines

arch/arm/plat-samsung/include/plat/regs-fimc.h

Quoted 7 lines
arch/arm/plat-samsung/include/plat/regs-fimc.h new file +6 -1
+#define S5P_CIDMAPARAM_R_MODE_64X32		(3 << 29)
+#define S5P_CIDMAPARAM_W_MODE_LINEAR		(0 << 13)
+#define S5P_CIDMAPARAM_W_MODE_CONFTILE		(1 << 13)
+#define S5P_CIDMAPARAM_W_MODE_64X32		(3 << 13)
+
+#endif /* REGS_FIMC_H_ */
--

I wonder...we really need above every definitions?

I think I could get rid of some of them. But I was not sure whether it is better to define all available bit fields at once or rather only those used by the current driver, and then re-submit what is missing.
Anyway I will try to remove as many as possible statements that define a single bit position with 1 and 0.

Quoted 8 lines

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Kind regards,
Sylwester

#4 lore raw

PATCH v2 1/10 ARM: Samsung: Add FIMC register and platform definitions

Op 16-07-10 15:30, Sylwester Nawrocki schreef:

Quoted 78 lines

Hi,

thank you for the review. Please se my comments below.

Quoted 46 lines

-----Original Message-----
From: Kukjin Kim [mailto:kgene.kim at samsung.com]
Sent: Friday, July 16, 2010 11:45 AM
To: 'Sylwester Nawrocki'; linux-samsung-soc at vger.kernel.org; linux-arm- kernel at lists.infradead.org
Cc: p.osciak at samsung.com; m.szyprowski at samsung.com; kyungmin.park at samsung.com; linux-media at vger.kernel.org
Subject: RE: [PATCH 01/10 v2] ARM: Samsung: Add FIMC register and platform definitions

Quoted 1 line · Sylwester Nawrocki

FIMC device is a camera interface embedded in S3C/S5P Samsung SOC

series.

Quoted 1 line

It supports ITU-R BT.601/656 and MIPI-CSI2 standards, memory to

memory

Quoted 13 lines

operations, color conversion, resizing and rotation.

---
 arch/arm/plat-samsung/include/plat/fimc.h      |   31 ++
 arch/arm/plat-samsung/include/plat/regs-fimc.h |  361
++++++++++++++++++++++++
 2 files changed, 392 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/include/plat/fimc.h
 create mode 100644 arch/arm/plat-samsung/include/plat/regs-fimc.h

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/plat-

Quoted 6 lines

samsung/include/plat/fimc.h
new file mode 100644
index 0000000..be1e853

arch/arm/plat-samsung/include/plat/fimc.h line 9

Quoted 9 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +9 -0
@@ -0,0 +1,31 @@
+/* linux/arch/arm/plat-samsung/include/plat/fimc.h
+ *
+ * Platform header file for FIMC driver
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Sylwester Nawrocki, <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or

modify

Quoted 12 lines

arch/arm/plat-samsung/include/plat/fimc.h line 20

Quoted 11 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +11 -0
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef FIMC_H_
+#define FIMC_H_
+
+#include <linux/device.h>
+#include <linux/platform_device.h>
+
+

2 empty lines...

I don't mind at all changing these to single line if it is the adopted style, however I didn't file like so when looking through the existing headers.

Quoted 4 lines
Quoted 4 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +4 -0
+#define FIMC_MAX_FIFO_TARGETS	1
+#define FIMC_LCD_FIFO_TARGET	0
+
+struct s3c_fifo_link;
Quoted 8 lines

arch/arm/plat-samsung/include/plat/fimc.h line 31

Quoted 7 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +7 -0
+
+struct samsung_plat_fimc {
+	struct s3c_fifo_link	*fifo_targets[FIMC_MAX_FIFO_TARGETS];
+};
+
+#endif /* FIMC_H_ */
+

No need last empty line...

Quoted 8 lines

C89 and C99 standard requires a new line character at the end of file. The compiler should issue a warning when the new line character at the end of file is missing, otherwise it is not compliant with the above C standards.
So I would rather add a new line where it is missing rather than removing it.
There is lots of header files already in arch/arm/plat-samsung where there is even more than one empty line at the end of file.

AFAIK there *already is* an empty line, git just omits it in diffs. Try removing the last line with your editor and see what git diff gives, it'll show "\ No newline at end of file".

Signature · 1 line
Maurus Cuelenaere
#5 lore raw

PATCH v2 1/10 ARM: Samsung: Add FIMC register and platform definitions

Quoted 26 lines

-----Original Message-----
From: Maurus Cuelenaere [mailto:mcuelenaere at gmail.com]
Sent: Friday, July 16, 2010 3:36 PM
To: Sylwester Nawrocki
Cc: 'Kukjin Kim'; Pawel Osciak; Marek Szyprowski;
kyungmin.park at samsung.com; linux-media at vger.kernel.org; linux-samsung- soc at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH 01/10 v2] ARM: Samsung: Add FIMC register and platform definitions

Op 16-07-10 15:30, Sylwester Nawrocki schreef:

Quoted 8 lines

Hi,

thank you for the review. Please se my comments below.

Quoted 4 lines

-----Original Message-----
From: Kukjin Kim [mailto:kgene.kim at samsung.com]
Sent: Friday, July 16, 2010 11:45 AM
To: 'Sylwester Nawrocki'; linux-samsung-soc at vger.kernel.org; linux-

arm-

Quoted 6 lines
Quoted 6 lines

kernel at lists.infradead.org
Cc: p.osciak at samsung.com; m.szyprowski at samsung.com; kyungmin.park at samsung.com; linux-media at vger.kernel.org
Subject: RE: [PATCH 01/10 v2] ARM: Samsung: Add FIMC register and platform definitions

<snip>

Quoted 18 lines
Quoted 9 lines
Quoted 8 lines

arch/arm/plat-samsung/include/plat/fimc.h line 31

Quoted 7 lines
arch/arm/plat-samsung/include/plat/fimc.h new file +7 -0
+
+struct samsung_plat_fimc {
+	struct s3c_fifo_link	*fifo_targets[FIMC_MAX_FIFO_TARGETS];
+};
+
+#endif /* FIMC_H_ */
+

No need last empty line...

C89 and C99 standard requires a new line character at the end of

file.

Quoted 7 lines

The compiler should issue a warning when the new line character at the end of file is missing, otherwise it is not compliant with the above C standards.
So I would rather add a new line where it is missing rather than removing it.
There is lots of header files already in arch/arm/plat-samsung where there is even more than one empty line at the end of file.

Quoted 4 lines

AFAIK there *already is* an empty line, git just omits it in diffs. Try removing the last line with your editor and see what git diff gives, it'll
show "\ No newline at end of file".

Indeed, I just had two new-line characters with single empty line..

Quoted 3 lines

--
Maurus Cuelenaere

Thanks,
Sylwester

#6 lore raw

PATCH v2 2/10 ARM: Samsung: Add FIMC resource definition and FIMC driver platform helpers

In reply to Sylwester Nawrocki

Add camera interface SoC resource definitions and setup code for FIMC/FB fifo links.

---
 arch/arm/mach-s5pc100/Kconfig                  |   15 ++++++
 arch/arm/mach-s5pc100/Makefile                 |    3 +
 arch/arm/mach-s5pc100/include/mach/map.h       |    8 +++
 arch/arm/mach-s5pc100/setup-fimc0.c            |   14 ++++++
 arch/arm/mach-s5pc100/setup-fimc1.c            |   14 ++++++
 arch/arm/mach-s5pc100/setup-fimc2.c            |   14 ++++++
 arch/arm/mach-s5pv210/Kconfig                  |   15 ++++++
 arch/arm/mach-s5pv210/Makefile                 |    3 +
 arch/arm/mach-s5pv210/cpu.c                    |    5 ++
 arch/arm/mach-s5pv210/include/mach/map.h       |    8 +++
 arch/arm/mach-s5pv210/setup-fimc0.c            |   14 ++++++
 arch/arm/mach-s5pv210/setup-fimc1.c            |   14 ++++++
 arch/arm/mach-s5pv210/setup-fimc2.c            |   14 ++++++
 arch/arm/plat-s5p/Kconfig                      |   16 +++++++
 arch/arm/plat-s5p/Makefile                     |    3 +
 arch/arm/plat-s5p/dev-fimc0.c                  |   56 ++++++++++++++++++++++++
 arch/arm/plat-s5p/dev-fimc1.c                  |   55 +++++++++++++++++++++++
 arch/arm/plat-s5p/dev-fimc2.c                  |   55 +++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/fimc-core.h |   45 +++++++++++++++++++
 arch/arm/plat-samsung/include/plat/fimc.h      |   12 +++++
 20 files changed, 383 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pc100/setup-fimc0.c
 create mode 100644 arch/arm/mach-s5pc100/setup-fimc1.c
 create mode 100644 arch/arm/mach-s5pc100/setup-fimc2.c
 create mode 100644 arch/arm/mach-s5pv210/setup-fimc0.c
 create mode 100644 arch/arm/mach-s5pv210/setup-fimc1.c
 create mode 100644 arch/arm/mach-s5pv210/setup-fimc2.c
 create mode 100644 arch/arm/plat-s5p/dev-fimc0.c
 create mode 100644 arch/arm/plat-s5p/dev-fimc1.c
 create mode 100644 arch/arm/plat-s5p/dev-fimc2.c
 create mode 100644 arch/arm/plat-samsung/include/plat/fimc-core.h
arch/arm/mach-s5pc100/Kconfig +15 -0
index d421f80..791270d 100644
@@ -36,6 +36,21 @@ config S5PC100_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for SDHCI gpio.
 
+config S5PC100_SETUP_FIMC0
+	bool
+	help
+	  Setup code for FIMC controller 0
+
+config S5PC100_SETUP_FIMC1
+	bool
+	help
+	  Setup code for FIMC controller 1
+
+config S5PC100_SETUP_FIMC2
+	bool
+	help
+	  Setup code for FIMC controller 2
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
arch/arm/mach-s5pc100/Makefile +3 -0
index f2073bc..7b43337 100644
@@ -25,6 +25,9 @@ obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
 # device support
 obj-y				+= dev-audio.o
 obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
+obj-$(CONFIG_S5PC100_SETUP_FIMC0)	+= setup-fimc0.o
+obj-$(CONFIG_S5PC100_SETUP_FIMC1)	+= setup-fimc1.o
+obj-$(CONFIG_S5PC100_SETUP_FIMC2)	+= setup-fimc2.o
 
 # machine support
 
arch/arm/mach-s5pc100/include/mach/map.h +8 -0
index c025064..a1c6f22 100644
@@ -112,6 +112,11 @@
 #define S5PC100_PA_SDRAM	(0x30000000)
 #define S5P_PA_SDRAM		S5PC100_PA_SDRAM
 
+/* FIMC */
+#define S5PC100_PA_FIMC0	(0xEE200000)
+#define S5PC100_PA_FIMC1	(0xEE300000)
+#define S5PC100_PA_FIMC2	(0xEE400000)
+
 /* compatibiltiy defines. */
 #define S3C_PA_UART		S5PC100_PA_UART
 #define S3C_PA_IIC		S5PC100_PA_IIC0
@@ -134,5 +139,8 @@
 #define S3C_PA_ONENAND		S5PC100_PA_ONENAND
 #define S3C_PA_ONENAND_BUF	S5PC100_PA_ONENAND_BUF
 #define S3C_SZ_ONENAND_BUF	S5PC100_SZ_ONENAND_BUF
+#define S5P_PA_FIMC0		S5PC100_PA_FIMC0
+#define S5P_PA_FIMC1		S5PC100_PA_FIMC1
+#define S5P_PA_FIMC2		S5PC100_PA_FIMC2
 
 #endif /* __ASM_ARCH_C100_MAP_H */
arch/arm/mach-s5pc100/setup-fimc0.c new file +14 -0
new file mode 100644
index 0000000..dea33c2
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pc100/setup-fimc0.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PC100 - setup for S5P FIMC device 0
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc0_default_data __initdata = {};
arch/arm/mach-s5pc100/setup-fimc1.c new file +14 -0
new file mode 100644
index 0000000..1833377
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pc100/setup-fimc1.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PC100 - setup for S5P FIMC device 1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc1_default_data __initdata = {};
arch/arm/mach-s5pc100/setup-fimc2.c new file +14 -0
new file mode 100644
index 0000000..746e0f0
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pc100/setup-fimc2.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PC100 - setup for S5P FIMC device 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc2_default_data __initdata = {};
arch/arm/mach-s5pv210/Kconfig +15 -0
index d876ff0..4bb5a85 100644
@@ -32,6 +32,21 @@ config S5PV210_SETUP_FB_24BPP
 	help
           Common setup code for S5PV210 with an 24bpp RGB display helper.
 
+config S5PV210_SETUP_FIMC0
+	bool
+	help
+	  Setup code for FIMC controller 0
+
+config S5PV210_SETUP_FIMC1
+	bool
+	help
+	  Setup code for FIMC controller 1
+
+config S5PV210_SETUP_FIMC2
+	bool
+	help
+	  Setup code for FIMC controller 2
+
 config S5PV210_SETUP_SDHCI
         bool
         select S5PV210_SETUP_SDHCI_GPIO
arch/arm/mach-s5pv210/Makefile +3 -0
index 7b3a984..6eceeb8 100644
@@ -35,3 +35,6 @@ obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
+obj-$(CONFIG_S5PV210_SETUP_FIMC0)	+= setup-fimc0.o
+obj-$(CONFIG_S5PV210_SETUP_FIMC1)	+= setup-fimc1.o
+obj-$(CONFIG_S5PV210_SETUP_FIMC2)	+= setup-fimc2.o
arch/arm/mach-s5pv210/cpu.c +5 -0
index fc3801b..4133cae 100644
@@ -35,6 +35,7 @@
 #include <plat/iic-core.h>
 #include <plat/sdhci.h>
 #include <plat/fb-core.h>
+#include <plat/fimc-core.h>
 
 /* Initial IO mappings */
 
@@ -95,6 +96,10 @@ void __init s5pv210_map_io(void)
 	s3c_i2c2_setname("s3c2440-i2c");
 
 	s3c_fb_setname("s5pv210-fb");
+
+	s3c_fimc_setname(0, "s5pv210-fimc");
+	s3c_fimc_setname(1, "s5pv210-fimc");
+	s3c_fimc_setname(2, "s5pv210-fimc");
 }
 
 void __init s5pv210_init_clocks(int xtal)
arch/arm/mach-s5pv210/include/mach/map.h +8 -0
index e78bd47..9b8cf69 100644
@@ -96,6 +96,11 @@
 
 #define S5PV210_PA_ADC		(0xE1700000)
 
+/* FIMC */
+#define S5PV210_PA_FIMC0	(0xFB200000)
+#define S5PV210_PA_FIMC1	(0xFB300000)
+#define S5PV210_PA_FIMC2	(0xFB400000)
+
 /* compatibiltiy defines. */
 #define S3C_PA_UART		S5PV210_PA_UART
 #define S3C_PA_HSMMC0		S5PV210_PA_HSMMC(0)
@@ -111,5 +116,8 @@
 #define SAMSUNG_PA_ADC		S5PV210_PA_ADC
 #define S3C_PA_USB_HSOTG	S5PV210_PA_USB_HSOTG
 #define S3C_PA_USB_HSPHY	S5PV210_PA_USB_HSPHY
+#define S5P_PA_FIMC0		S5PV210_PA_FIMC0
+#define S5P_PA_FIMC1		S5PV210_PA_FIMC1
+#define S5P_PA_FIMC2		S5PV210_PA_FIMC2
 
 #endif /* __ASM_ARCH_MAP_H */
arch/arm/mach-s5pv210/setup-fimc0.c new file +14 -0
new file mode 100644
index 0000000..0e5ef0a
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pv210/setup-fimc0.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PV210 - setup for S5P FIMC device 0
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc0_default_data __initdata = {};
arch/arm/mach-s5pv210/setup-fimc1.c new file +14 -0
new file mode 100644
index 0000000..80da0e7
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pv210/setup-fimc1.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PV210 - setup for S5P FIMC device 1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc1_default_data __initdata = {};
arch/arm/mach-s5pv210/setup-fimc2.c new file +14 -0
new file mode 100644
index 0000000..bc6a27b
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pv210/setup-fimc2.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PV210 - setup for S5P FIMC device 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc2_default_data __initdata = {};
arch/arm/plat-s5p/Kconfig +16 -0
index 11d6a1b..38b60c7 100644
@@ -5,6 +5,22 @@
 #
 # Licensed under GPLv2
 
+config S5P_DEV_FIMC0
+	bool
+	help
+	  Compile in platform device definitions for FIMC controller 0
+
+config S5P_DEV_FIMC1
+	bool
+	help
+	  Compile in platform device definitions for FIMC controller 1
+
+config S5P_DEV_FIMC2
+	bool
+	help
+	  Compile in platform device definitions for FIMC controller 2
+
+
 config PLAT_S5P
 	bool
 	depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PC100 || ARCH_S5PV210)
arch/arm/plat-s5p/Makefile +3 -0
index b56b4d3..a7d3c35 100644
@@ -18,3 +18,6 @@ obj-y				+= clock.o
 obj-y				+= irq.o irq-gpioint.o
 obj-$(CONFIG_S5P_EXT_INT)	+= irq-eint.o
 
+obj-$(CONFIG_S5P_DEV_FIMC0)	+= dev-fimc0.o
+obj-$(CONFIG_S5P_DEV_FIMC1)	+= dev-fimc1.o
+obj-$(CONFIG_S5P_DEV_FIMC2)	+= dev-fimc2.o
arch/arm/plat-s5p/dev-fimc0.c new file +56 -0

56 lines not on this page · raw message

arch/arm/plat-s5p/dev-fimc1.c new file +55 -0

55 lines not on this page · raw message

arch/arm/plat-s5p/dev-fimc2.c new file +55 -0

55 lines not on this page · raw message

arch/arm/plat-samsung/include/plat/fimc-core.h new file +45 -0

45 lines not on this page · raw message

arch/arm/plat-samsung/include/plat/fimc.h +12 -0
index be1e853..cf7d2fb 100644
@@ -27,5 +27,17 @@ struct samsung_plat_fimc {
 	struct s3c_fifo_link	*fifo_targets[FIMC_MAX_FIFO_TARGETS];
 };
 
+extern struct platform_device s5p_device_fimc0;
+extern struct platform_device s5p_device_fimc1;
+extern struct platform_device s5p_device_fimc2;
+
+extern struct samsung_plat_fimc s5p_fimc0_default_data;
+extern struct samsung_plat_fimc s5p_fimc1_default_data;
+extern struct samsung_plat_fimc s5p_fimc2_default_data;
+
+extern void s5p_fimc0_set_platdata(struct samsung_plat_fimc *fimc);
+extern void s5p_fimc1_set_platdata(struct samsung_plat_fimc *fimc);
+extern void s5p_fimc2_set_platdata(struct samsung_plat_fimc *fimc);
+
 #endif /* FIMC_H_ */
 
Signature · 1 line
1.7.0.4
#7 lore raw

PATCH v2 2/10 ARM: Samsung: Add FIMC resource definition and FIMC driver platform helpers

Review

Quoted 70 lines · Sylwester Nawrocki

Add camera interface SoC resource definitions and setup code for FIMC/FB fifo links.

---
 arch/arm/mach-s5pc100/Kconfig                  |   15 ++++++
 arch/arm/mach-s5pc100/Makefile                 |    3 +
 arch/arm/mach-s5pc100/include/mach/map.h       |    8 +++
 arch/arm/mach-s5pc100/setup-fimc0.c            |   14 ++++++
 arch/arm/mach-s5pc100/setup-fimc1.c            |   14 ++++++
 arch/arm/mach-s5pc100/setup-fimc2.c            |   14 ++++++
 arch/arm/mach-s5pv210/Kconfig                  |   15 ++++++
 arch/arm/mach-s5pv210/Makefile                 |    3 +
 arch/arm/mach-s5pv210/cpu.c                    |    5 ++
 arch/arm/mach-s5pv210/include/mach/map.h       |    8 +++
 arch/arm/mach-s5pv210/setup-fimc0.c            |   14 ++++++
 arch/arm/mach-s5pv210/setup-fimc1.c            |   14 ++++++
 arch/arm/mach-s5pv210/setup-fimc2.c            |   14 ++++++
 arch/arm/plat-s5p/Kconfig                      |   16 +++++++
 arch/arm/plat-s5p/Makefile                     |    3 +
 arch/arm/plat-s5p/dev-fimc0.c                  |   56
++++++++++++++++++++++++
 arch/arm/plat-s5p/dev-fimc1.c                  |   55
+++++++++++++++++++++++
 arch/arm/plat-s5p/dev-fimc2.c                  |   55
+++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/fimc-core.h |   45 +++++++++++++++++++
 arch/arm/plat-samsung/include/plat/fimc.h      |   12 +++++
 20 files changed, 383 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pc100/setup-fimc0.c
 create mode 100644 arch/arm/mach-s5pc100/setup-fimc1.c
 create mode 100644 arch/arm/mach-s5pc100/setup-fimc2.c
 create mode 100644 arch/arm/mach-s5pv210/setup-fimc0.c
 create mode 100644 arch/arm/mach-s5pv210/setup-fimc1.c
 create mode 100644 arch/arm/mach-s5pv210/setup-fimc2.c
 create mode 100644 arch/arm/plat-s5p/dev-fimc0.c
 create mode 100644 arch/arm/plat-s5p/dev-fimc1.c
 create mode 100644 arch/arm/plat-s5p/dev-fimc2.c
 create mode 100644 arch/arm/plat-samsung/include/plat/fimc-core.h
arch/arm/mach-s5pc100/Kconfig +15 -0
index d421f80..791270d 100644
@@ -36,6 +36,21 @@ config S5PC100_SETUP_SDHCI_GPIO
 	help
 	  Common setup code for SDHCI gpio.
 
+config S5PC100_SETUP_FIMC0
+	bool
+	help
+	  Setup code for FIMC controller 0
+
+config S5PC100_SETUP_FIMC1
+	bool
+	help
+	  Setup code for FIMC controller 1
+
+config S5PC100_SETUP_FIMC2
+	bool
+	help
+	  Setup code for FIMC controller 2
+
 config MACH_SMDKC100
 	bool "SMDKC100"
 	select CPU_S5PC100
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/Makefile

Review

Quoted 41 lines

index f2073bc..7b43337 100644

arch/arm/mach-s5pc100/Makefile +0 -0
@@ -25,6 +25,9 @@ obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO)	+= setup-

sdhci-gpio.o

 # device support
 obj-y				+= dev-audio.o
 obj-$(CONFIG_S3C64XX_DEV_SPI)	+= dev-spi.o
arch/arm/mach-s5pc100/Makefile +3 -0
+obj-$(CONFIG_S5PC100_SETUP_FIMC0)	+= setup-fimc0.o
+obj-$(CONFIG_S5PC100_SETUP_FIMC1)	+= setup-fimc1.o
+obj-$(CONFIG_S5PC100_SETUP_FIMC2)	+= setup-fimc2.o
 
 # machine support
arch/arm/mach- renamed from arch/arm/mach-s5pc100/include/mach/map.h +0 -0

s5pc100/include/mach/map.h
index c025064..a1c6f22 100644

arch/arm/mach-s5pc100/include/mach/map.h +8 -0
@@ -112,6 +112,11 @@
 #define S5PC100_PA_SDRAM	(0x30000000)
 #define S5P_PA_SDRAM		S5PC100_PA_SDRAM
 
+/* FIMC */
+#define S5PC100_PA_FIMC0	(0xEE200000)
+#define S5PC100_PA_FIMC1	(0xEE300000)
+#define S5PC100_PA_FIMC2	(0xEE400000)
+
 /* compatibiltiy defines. */
 #define S3C_PA_UART		S5PC100_PA_UART
 #define S3C_PA_IIC		S5PC100_PA_IIC0
@@ -134,5 +139,8 @@
 #define S3C_PA_ONENAND		S5PC100_PA_ONENAND
 #define S3C_PA_ONENAND_BUF	S5PC100_PA_ONENAND_BUF
 #define S3C_SZ_ONENAND_BUF	S5PC100_SZ_ONENAND_BUF
+#define S5P_PA_FIMC0		S5PC100_PA_FIMC0
+#define S5P_PA_FIMC1		S5PC100_PA_FIMC1
+#define S5P_PA_FIMC2		S5PC100_PA_FIMC2
 
 #endif /* __ASM_ARCH_C100_MAP_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/setup-

Review

Quoted 21 lines

fimc0.c
new file mode 100644
index 0000000..dea33c2

arch/arm/mach-s5pc100/setup-fimc0.c new file +14 -0
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pc100/setup-fimc0.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PC100 - setup for S5P FIMC device 0
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc0_default_data __initdata = {};
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/setup-

Review

Quoted 21 lines

fimc1.c
new file mode 100644
index 0000000..1833377

arch/arm/mach-s5pc100/setup-fimc1.c new file +14 -0
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pc100/setup-fimc1.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PC100 - setup for S5P FIMC device 1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc1_default_data __initdata = {};
(quoted diff) +0 -0

b/arch/arm/mach-s5pc100/setup-

Review

Quoted 47 lines

fimc2.c
new file mode 100644
index 0000000..746e0f0

arch/arm/mach-s5pc100/setup-fimc2.c new file +14 -0
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pc100/setup-fimc2.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PC100 - setup for S5P FIMC device 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc2_default_data __initdata = {};
arch/arm/mach-s5pv210/Kconfig +15 -0
index d876ff0..4bb5a85 100644
@@ -32,6 +32,21 @@ config S5PV210_SETUP_FB_24BPP
 	help
           Common setup code for S5PV210 with an 24bpp RGB display helper.
 
+config S5PV210_SETUP_FIMC0
+	bool
+	help
+	  Setup code for FIMC controller 0
+
+config S5PV210_SETUP_FIMC1
+	bool
+	help
+	  Setup code for FIMC controller 1
+
+config S5PV210_SETUP_FIMC2
+	bool
+	help
+	  Setup code for FIMC controller 2
+
 config S5PV210_SETUP_SDHCI
         bool
         select S5PV210_SETUP_SDHCI_GPIO
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/Makefile

Review

Quoted 60 lines

index 7b3a984..6eceeb8 100644

arch/arm/mach-s5pv210/Makefile +3 -0
@@ -35,3 +35,6 @@ obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
+obj-$(CONFIG_S5PV210_SETUP_FIMC0)	+= setup-fimc0.o
+obj-$(CONFIG_S5PV210_SETUP_FIMC1)	+= setup-fimc1.o
+obj-$(CONFIG_S5PV210_SETUP_FIMC2)	+= setup-fimc2.o
arch/arm/mach-s5pv210/cpu.c +5 -0
index fc3801b..4133cae 100644
@@ -35,6 +35,7 @@
 #include <plat/iic-core.h>
 #include <plat/sdhci.h>
 #include <plat/fb-core.h>
+#include <plat/fimc-core.h>
 
 /* Initial IO mappings */
 
@@ -95,6 +96,10 @@ void __init s5pv210_map_io(void)
 	s3c_i2c2_setname("s3c2440-i2c");
 
 	s3c_fb_setname("s5pv210-fb");
+
+	s3c_fimc_setname(0, "s5pv210-fimc");
+	s3c_fimc_setname(1, "s5pv210-fimc");
+	s3c_fimc_setname(2, "s5pv210-fimc");
 }
 
 void __init s5pv210_init_clocks(int xtal)
arch/arm/mach- renamed from arch/arm/mach-s5pv210/include/mach/map.h +0 -0

s5pv210/include/mach/map.h
index e78bd47..9b8cf69 100644

arch/arm/mach-s5pv210/include/mach/map.h +8 -0
@@ -96,6 +96,11 @@
 
 #define S5PV210_PA_ADC		(0xE1700000)
 
+/* FIMC */
+#define S5PV210_PA_FIMC0	(0xFB200000)
+#define S5PV210_PA_FIMC1	(0xFB300000)
+#define S5PV210_PA_FIMC2	(0xFB400000)
+
 /* compatibiltiy defines. */
 #define S3C_PA_UART		S5PV210_PA_UART
 #define S3C_PA_HSMMC0		S5PV210_PA_HSMMC(0)
@@ -111,5 +116,8 @@
 #define SAMSUNG_PA_ADC		S5PV210_PA_ADC
 #define S3C_PA_USB_HSOTG	S5PV210_PA_USB_HSOTG
 #define S3C_PA_USB_HSPHY	S5PV210_PA_USB_HSPHY
+#define S5P_PA_FIMC0		S5PV210_PA_FIMC0
+#define S5P_PA_FIMC1		S5PV210_PA_FIMC1
+#define S5P_PA_FIMC2		S5PV210_PA_FIMC2
 
 #endif /* __ASM_ARCH_MAP_H */
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/setup-

Review

Quoted 21 lines

fimc0.c
new file mode 100644
index 0000000..0e5ef0a

arch/arm/mach-s5pv210/setup-fimc0.c new file +14 -0
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pv210/setup-fimc0.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PV210 - setup for S5P FIMC device 0
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc0_default_data __initdata = {};
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/setup-

Review

Quoted 21 lines

fimc1.c
new file mode 100644
index 0000000..80da0e7

arch/arm/mach-s5pv210/setup-fimc1.c new file +14 -0
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pv210/setup-fimc1.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PV210 - setup for S5P FIMC device 1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc1_default_data __initdata = {};
(quoted diff) +0 -0

b/arch/arm/mach-s5pv210/setup-

Quoted 34 lines

fimc2.c
new file mode 100644
index 0000000..bc6a27b

arch/arm/mach-s5pv210/setup-fimc2.c new file +14 -0
@@ -0,0 +1,14 @@
+/* linux/arch/arm/mach-s5pv210/setup-fimc2.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * S5PV210 - setup for S5P FIMC device 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <plat/fimc.h>
+
+struct samsung_plat_fimc s5p_fimc2_default_data __initdata = {};
arch/arm/plat-s5p/Kconfig +6 -0
index 11d6a1b..38b60c7 100644
@@ -5,6 +5,22 @@
 #
 # Licensed under GPLv2
 
+config S5P_DEV_FIMC0
+	bool
+	help
+	  Compile in platform device definitions for FIMC controller 0
+
+config S5P_DEV_FIMC1

arch/arm/plat-s5p/Kconfig line 23

Quoted 10 lines
arch/arm/plat-s5p/Kconfig +10 -0
+	bool
+	help
+	  Compile in platform device definitions for FIMC controller 1
+
+config S5P_DEV_FIMC2
+	bool
+	help
+	  Compile in platform device definitions for FIMC controller 2
+
+

2 empty lines...

Quoted 32 lines
arch/arm/plat-s5p/Kconfig +0 -0
 config PLAT_S5P
 	bool
 	depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PC100 ||

ARCH_S5PV210)

arch/arm/plat-s5p/Makefile +3 -0
index b56b4d3..a7d3c35 100644
@@ -18,3 +18,6 @@ obj-y				+= clock.o
 obj-y				+= irq.o irq-gpioint.o
 obj-$(CONFIG_S5P_EXT_INT)	+= irq-eint.o
 
+obj-$(CONFIG_S5P_DEV_FIMC0)	+= dev-fimc0.o
+obj-$(CONFIG_S5P_DEV_FIMC1)	+= dev-fimc1.o
+obj-$(CONFIG_S5P_DEV_FIMC2)	+= dev-fimc2.o
arch/arm/plat-s5p/dev-fimc0.c new file +11 -0
new file mode 100644
index 0000000..cfa10f0
@@ -0,0 +1,56 @@
+/* linux/arch/arm/plat-s5p/dev-fimc0.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Base S5P FIMC0 resource and device definitions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+

arch/arm/plat-s5p/dev-fimc0.c line 21

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc0.c new file +10 -0
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <mach/map.h>
+#include <mach/irqs.h>
+#include <plat/fimc.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+

Same...2 empty lines...

Quoted 11 lines
arch/arm/plat-s5p/dev-fimc0.c new file +11 -0
+static struct resource s5p_fimc_resource[] = {
+	[0] = {
+		.start	= S5P_PA_FIMC0,
+		.end	= S5P_PA_FIMC0 + SZ_1M - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_FIMC0,
+		.end	= IRQ_FIMC0,
+		.flags	= IORESOURCE_IRQ,
+	},

arch/arm/plat-s5p/dev-fimc0.c line 42

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc0.c new file +10 -0
+};
+
+struct platform_device s5p_device_fimc0 = {
+	.name		= "s5p-fimc",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(s5p_fimc_resource),
+	.resource	= s5p_fimc_resource,
+};
+
+

2 empty lines...

arch/arm/plat-s5p/dev-fimc0.c line 43

Quoted 1 line
arch/arm/plat-s5p/dev-fimc0.c new file +1 -0
+void __init s5p_fimc0_set_platdata(struct samsung_plat_fimc *pd)

Actually, we can use Ben's 's3c_set_platdata' which can replace a number of sites...

Please refer to below URL.
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-May/016650.html

I think this method is better to us.

arch/arm/plat-s5p/dev-fimc0.c line 56

Quoted 13 lines
arch/arm/plat-s5p/dev-fimc0.c new file +13 -0
+{
+	struct samsung_plat_fimc *npd;
+
+	if (!pd)
+		pd = &s5p_fimc0_default_data;
+
+	npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
+	if (!npd)
+		printk(KERN_ERR "%s: out of memory\n", __func__);
+
+	s5p_device_fimc0.dev.platform_data = npd;
+}
+

No need last empty line

Quoted 17 lines
arch/arm/plat-s5p/dev-fimc1.c new file +11 -0
new file mode 100644
index 0000000..7178477
@@ -0,0 +1,55 @@
+/* linux/arch/arm/plat-s5p/dev-fimc1.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Base S5P FIMC1 resource and device definitions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+

arch/arm/plat-s5p/dev-fimc1.c line 21

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc1.c new file +10 -0
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <mach/map.h>
+#include <mach/irqs.h>
+#include <plat/fimc.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+

2 empty lines..

Quoted 24 lines
arch/arm/plat-s5p/dev-fimc1.c new file +24 -0
+static struct resource s5p_fimc_resource[] = {
+	[0] = {
+		.start	= S5P_PA_FIMC1,
+		.end	= S5P_PA_FIMC1 + SZ_1M - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_FIMC1,
+		.end	= IRQ_FIMC1,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device s5p_device_fimc1 = {
+	.name		= "s5p-fimc",
+	.id		= 1,
+	.num_resources	= ARRAY_SIZE(s5p_fimc_resource),
+	.resource	= s5p_fimc_resource,
+};
+
+void __init s5p_fimc1_set_platdata(struct samsung_plat_fimc *pd)
+{
+	struct samsung_plat_fimc *npd;
+

arch/arm/plat-s5p/dev-fimc1.c line 55

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc1.c new file +10 -0
+	if (!pd)
+		pd = &s5p_fimc1_default_data;
+
+	npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
+	if (!npd)
+		printk(KERN_ERR "%s: out of memory\n", __func__);
+
+	s5p_device_fimc1.dev.platform_data = npd;
+}
+

No need last empty line...

Quoted 17 lines
arch/arm/plat-s5p/dev-fimc2.c new file +11 -0
new file mode 100644
index 0000000..fe1a6c0
@@ -0,0 +1,55 @@
+/* linux/arch/arm/plat-s5p/dev-fimc2.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Base S5P FIMC2 resource and device definitions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+

arch/arm/plat-s5p/dev-fimc2.c line 21

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc2.c new file +10 -0
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <mach/map.h>
+#include <mach/irqs.h>
+#include <plat/fimc.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+

Same...

Quoted 24 lines
arch/arm/plat-s5p/dev-fimc2.c new file +24 -0
+static struct resource s5p_fimc_resource[] = {
+	[0] = {
+		.start	= S5P_PA_FIMC2,
+		.end	= S5P_PA_FIMC2 + SZ_1M - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_FIMC2,
+		.end	= IRQ_FIMC2,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device s5p_device_fimc2 = {
+	.name		= "s5p-fimc",
+	.id		= 2,
+	.num_resources	= ARRAY_SIZE(s5p_fimc_resource),
+	.resource	= s5p_fimc_resource,
+};
+
+void __init s5p_fimc2_set_platdata(struct samsung_plat_fimc *pd)
+{
+	struct samsung_plat_fimc *npd;
+

arch/arm/plat-s5p/dev-fimc2.c line 55

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc2.c new file +10 -0
+	if (!pd)
+		pd = &s5p_fimc2_default_data;
+
+	npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
+	if (!npd)
+		printk(KERN_ERR "%s: out of memory\n", __func__);
+
+	s5p_device_fimc2.dev.platform_data = npd;
+}
+

Same..

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/plat-

Quoted 19 lines

samsung/include/plat/fimc-core.h
new file mode 100644
index 0000000..a126bbd

arch/arm/plat-samsung/include/plat/fimc-core.h new file +13 -0
@@ -0,0 +1,45 @@
+/*
+ * arch/arm/plat-samsung/include/plat/fimc-core.h
+ *
+ * Copyright 2010 Samsung Electronics Co., Ltd.
+ *	Sylwester Nawrocki <[email protected]>
+ *
+ * Samsung camera interface driver core functions
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __ASM_PLAT_FIMC_CORE_H

arch/arm/plat-samsung/include/plat/fimc-core.h line 23

Quoted 10 lines
arch/arm/plat-samsung/include/plat/fimc-core.h new file +10 -0
+#define __ASM_PLAT_FIMC_CORE_H __FILE__
+
+/*
+ * These functions are only for use with the core support code, such as
+ * the CPU-specific initialization code.
+ */
+
+#include <plat/fimc.h>
+
+/* Re-define device name to differentiate the subsystem in various SoCs.

*/

Quoted 36 lines
arch/arm/plat-samsung/include/plat/fimc-core.h new file +22 -0
+static inline void s3c_fimc_setname(int id, char *name)
+{
+	switch(id) {
+#ifdef CONFIG_S5P_DEV_FIMC0
+	case 0:
+		s5p_device_fimc0.name = name;
+		break;
+#endif
+#ifdef CONFIG_S5P_DEV_FIMC1
+	case 1:
+		s5p_device_fimc1.name = name;
+		break;
+#endif
+#ifdef CONFIG_S5P_DEV_FIMC2
+	case 2:
+		s5p_device_fimc2.name = name;
+		break;
+#endif
+	}
+}
+
+#endif /* __ASM_PLAT_FIMC_CORE_H */
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/fimc.h +0 -0

samsung/include/plat/fimc.h
index be1e853..cf7d2fb 100644

arch/arm/plat-samsung/include/plat/fimc.h +5 -0
@@ -27,5 +27,17 @@ struct samsung_plat_fimc {
 	struct s3c_fifo_link	*fifo_targets[FIMC_MAX_FIFO_TARGETS];
 };
 
+extern struct platform_device s5p_device_fimc0;
+extern struct platform_device s5p_device_fimc1;
+extern struct platform_device s5p_device_fimc2;
+
+extern struct samsung_plat_fimc s5p_fimc0_default_data;

arch/arm/plat-samsung/include/plat/fimc.h struct samsung_plat_fimc {

Quoted 10 lines
arch/arm/plat-samsung/include/plat/fimc.h +7 -1
+extern struct samsung_plat_fimc s5p_fimc1_default_data;
+extern struct samsung_plat_fimc s5p_fimc2_default_data;
+
+extern void s5p_fimc0_set_platdata(struct samsung_plat_fimc *fimc);
+extern void s5p_fimc1_set_platdata(struct samsung_plat_fimc *fimc);
+extern void s5p_fimc2_set_platdata(struct samsung_plat_fimc *fimc);
+
 #endif /* FIMC_H_ */
 
--

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#8 lore raw

PATCH v2 2/10 ARM: Samsung: Add FIMC resource definition and FIMC driver platform helpers

Hello,

Quoted 55 lines

-----Original Message-----
From: Kukjin Kim [mailto:kgene.kim at samsung.com]
Sent: Friday, July 16, 2010 12:08 PM
To: 'Sylwester Nawrocki'; linux-samsung-soc at vger.kernel.org; linux-arm- kernel at lists.infradead.org
Cc: p.osciak at samsung.com; m.szyprowski at samsung.com; kyungmin.park at samsung.com
Subject: RE: [PATCH 02/10 v2] ARM: Samsung: Add FIMC resource definition and FIMC driver platform helpers

Quoted 22 lines · Sylwester Nawrocki

Add camera interface SoC resource definitions and setup code for FIMC/FB fifo links.

---
 arch/arm/mach-s5pc100/Kconfig                  |   15 ++++++
 arch/arm/mach-s5pc100/Makefile                 |    3 +
 arch/arm/mach-s5pc100/include/mach/map.h       |    8 +++
 arch/arm/mach-s5pc100/setup-fimc0.c            |   14 ++++++
 arch/arm/mach-s5pc100/setup-fimc1.c            |   14 ++++++
 arch/arm/mach-s5pc100/setup-fimc2.c            |   14 ++++++
 arch/arm/mach-s5pv210/Kconfig                  |   15 ++++++
 arch/arm/mach-s5pv210/Makefile                 |    3 +
 arch/arm/mach-s5pv210/cpu.c                    |    5 ++
 arch/arm/mach-s5pv210/include/mach/map.h       |    8 +++
 arch/arm/mach-s5pv210/setup-fimc0.c            |   14 ++++++
 arch/arm/mach-s5pv210/setup-fimc1.c            |   14 ++++++
 arch/arm/mach-s5pv210/setup-fimc2.c            |   14 ++++++
 arch/arm/plat-s5p/Kconfig                      |   16 +++++++
Quoted 8 lines
 arch/arm/plat-s5p/Makefile                     |    3 +
 arch/arm/plat-s5p/dev-fimc0.c                  |   56
++++++++++++++++++++++++
 arch/arm/plat-s5p/dev-fimc1.c                  |   55
+++++++++++++++++++++++
 arch/arm/plat-s5p/dev-fimc2.c                  |   55
+++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/fimc-core.h |   45

+++++++++++++++++++

Quoted 13 lines
 arch/arm/plat-samsung/include/plat/fimc.h      |   12 +++++
 20 files changed, 383 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pc100/setup-fimc0.c
 create mode 100644 arch/arm/mach-s5pc100/setup-fimc1.c
 create mode 100644 arch/arm/mach-s5pc100/setup-fimc2.c
 create mode 100644 arch/arm/mach-s5pv210/setup-fimc0.c
 create mode 100644 arch/arm/mach-s5pv210/setup-fimc1.c
 create mode 100644 arch/arm/mach-s5pv210/setup-fimc2.c
 create mode 100644 arch/arm/plat-s5p/dev-fimc0.c
 create mode 100644 arch/arm/plat-s5p/dev-fimc1.c
 create mode 100644 arch/arm/plat-s5p/dev-fimc2.c
 create mode 100644 arch/arm/plat-samsung/include/plat/fimc-core.h

<snip>

Quoted 8 lines

arch/arm/plat-s5p/Kconfig line 23

Quoted 6 lines
arch/arm/plat-s5p/Kconfig +6 -0
+config S5P_DEV_FIMC2
+	bool
+	help
+	  Compile in platform device definitions for FIMC controller 2
+
+

2 empty lines...

OK, will try to pay more attention to these.

Quoted 31 lines

arch/arm/plat-s5p/dev-

Quoted 17 lines

config PLAT_S5P

(quoted diff) +0 -0
 	bool
 	depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PC100 ||

ARCH_S5PV210)

arch/arm/plat-s5p/Makefile +3 -0
index b56b4d3..a7d3c35 100644
@@ -18,3 +18,6 @@ obj-y				+= clock.o
 obj-y				+= irq.o irq-gpioint.o
 obj-$(CONFIG_S5P_EXT_INT)	+= irq-eint.o
 
+obj-$(CONFIG_S5P_DEV_FIMC0)	+= dev-fimc0.o
+obj-$(CONFIG_S5P_DEV_FIMC1)	+= dev-fimc1.o
+obj-$(CONFIG_S5P_DEV_FIMC2)	+= dev-fimc2.o
arch/arm/plat-s5p/dev- renamed from arch/arm/plat-s5p/dev-fimc0.c +0 -0

fimc0.c

arch/arm/plat-s5p/dev-fimc0.c line 7

Quoted 12 lines

new file mode 100644
index 0000000..cfa10f0

arch/arm/plat-s5p/dev-fimc0.c new file +7 -0
@@ -0,0 +1,56 @@
+/* linux/arch/arm/plat-s5p/dev-fimc0.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Base S5P FIMC0 resource and device definitions
+ *
+ * This program is free software; you can redistribute it and/or

modify

Quoted 16 lines
Quoted 4 lines
arch/arm/plat-s5p/dev-fimc0.c new file +4 -0
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+

arch/arm/plat-s5p/dev-fimc0.c line 21

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc0.c new file +10 -0
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <mach/map.h>
+#include <mach/irqs.h>
+#include <plat/fimc.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+

Same...2 empty lines...

Please see my comment to previous patch.

Quoted 31 lines
Quoted 12 lines
arch/arm/plat-s5p/dev-fimc0.c new file +11 -0
+static struct resource s5p_fimc_resource[] = {
+	[0] = {
+		.start	= S5P_PA_FIMC0,
+		.end	= S5P_PA_FIMC0 + SZ_1M - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_FIMC0,
+		.end	= IRQ_FIMC0,
+		.flags	= IORESOURCE_IRQ,
+	},

arch/arm/plat-s5p/dev-fimc0.c line 42

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc0.c new file +10 -0
+};
+
+struct platform_device s5p_device_fimc0 = {
+	.name		= "s5p-fimc",
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(s5p_fimc_resource),
+	.resource	= s5p_fimc_resource,
+};
+
+

2 empty lines...

arch/arm/plat-s5p/dev-fimc0.c line 43

Quoted 1 line
arch/arm/plat-s5p/dev-fimc0.c new file +1 -0
+void __init s5p_fimc0_set_platdata(struct samsung_plat_fimc *pd)

Actually, we can use Ben's 's3c_set_platdata' which can replace a number of
sites...

Quoted 5 lines

Please refer to below URL.
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-
May/016650.html

I think this method is better to us.

Thank you for pointing this out. I expected such changes, but I wanted to move on with the development so I have done that similar to the other devices.
I will rework this part too.

Quoted 16 lines
Quoted 4 lines
arch/arm/plat-s5p/dev-fimc0.c new file +3 -0
+{
+	struct samsung_plat_fimc *npd;
+

arch/arm/plat-s5p/dev-fimc0.c line 56

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc0.c new file +10 -0
+	if (!pd)
+		pd = &s5p_fimc0_default_data;
+
+	npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
+	if (!npd)
+		printk(KERN_ERR "%s: out of memory\n", __func__);
+
+	s5p_device_fimc0.dev.platform_data = npd;
+}
+

No need last empty line

Right, I will clean this up in the next patch version.

Quoted 138 lines

arch/arm/plat-s5p/dev-

Quoted 2 lines
arch/arm/plat-s5p/dev- renamed from arch/arm/plat-s5p/dev-fimc1.c +0 -0

fimc1.c

arch/arm/plat-s5p/dev-fimc1.c line 7

Quoted 12 lines

new file mode 100644
index 0000000..7178477

arch/arm/plat-s5p/dev-fimc1.c new file +7 -0
@@ -0,0 +1,55 @@
+/* linux/arch/arm/plat-s5p/dev-fimc1.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Base S5P FIMC1 resource and device definitions
+ *
+ * This program is free software; you can redistribute it and/or

modify

Quoted 4 lines
arch/arm/plat-s5p/dev-fimc1.c new file +4 -0
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+

arch/arm/plat-s5p/dev-fimc1.c line 21

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc1.c new file +10 -0
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <mach/map.h>
+#include <mach/irqs.h>
+#include <plat/fimc.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+

2 empty lines..

Quoted 24 lines
arch/arm/plat-s5p/dev-fimc1.c new file +24 -0
+static struct resource s5p_fimc_resource[] = {
+	[0] = {
+		.start	= S5P_PA_FIMC1,
+		.end	= S5P_PA_FIMC1 + SZ_1M - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_FIMC1,
+		.end	= IRQ_FIMC1,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device s5p_device_fimc1 = {
+	.name		= "s5p-fimc",
+	.id		= 1,
+	.num_resources	= ARRAY_SIZE(s5p_fimc_resource),
+	.resource	= s5p_fimc_resource,
+};
+
+void __init s5p_fimc1_set_platdata(struct samsung_plat_fimc *pd)
+{
+	struct samsung_plat_fimc *npd;
+

arch/arm/plat-s5p/dev-fimc1.c line 55

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc1.c new file +10 -0
+	if (!pd)
+		pd = &s5p_fimc1_default_data;
+
+	npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
+	if (!npd)
+		printk(KERN_ERR "%s: out of memory\n", __func__);
+
+	s5p_device_fimc1.dev.platform_data = npd;
+}
+

No need last empty line...

arch/arm/plat-s5p/dev-

Quoted 1 line
arch/arm/plat-s5p/dev- renamed from arch/arm/plat-s5p/dev-fimc2.c +0 -0

fimc2.c

arch/arm/plat-s5p/dev-fimc2.c line 7

Quoted 12 lines

new file mode 100644
index 0000000..fe1a6c0

arch/arm/plat-s5p/dev-fimc2.c new file +7 -0
@@ -0,0 +1,55 @@
+/* linux/arch/arm/plat-s5p/dev-fimc2.c
+ *
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * Base S5P FIMC2 resource and device definitions
+ *
+ * This program is free software; you can redistribute it and/or

modify

Quoted 4 lines
arch/arm/plat-s5p/dev-fimc2.c new file +4 -0
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+

arch/arm/plat-s5p/dev-fimc2.c line 21

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc2.c new file +10 -0
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <mach/map.h>
+#include <mach/irqs.h>
+#include <plat/fimc.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+

Same...

Quoted 24 lines
arch/arm/plat-s5p/dev-fimc2.c new file +24 -0
+static struct resource s5p_fimc_resource[] = {
+	[0] = {
+		.start	= S5P_PA_FIMC2,
+		.end	= S5P_PA_FIMC2 + SZ_1M - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_FIMC2,
+		.end	= IRQ_FIMC2,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device s5p_device_fimc2 = {
+	.name		= "s5p-fimc",
+	.id		= 2,
+	.num_resources	= ARRAY_SIZE(s5p_fimc_resource),
+	.resource	= s5p_fimc_resource,
+};
+
+void __init s5p_fimc2_set_platdata(struct samsung_plat_fimc *pd)
+{
+	struct samsung_plat_fimc *npd;
+

arch/arm/plat-s5p/dev-fimc2.c line 55

Quoted 10 lines
arch/arm/plat-s5p/dev-fimc2.c new file +10 -0
+	if (!pd)
+		pd = &s5p_fimc2_default_data;
+
+	npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
+	if (!npd)
+		printk(KERN_ERR "%s: out of memory\n", __func__);
+
+	s5p_device_fimc2.dev.platform_data = npd;
+}
+

Same..

<snip>

Quoted 9 lines

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Regards,
Sylwester

#9 lore raw

PATCH v2 3/10 ARM: Samsung: Add platform definitions for local FIMC/FIMD fifo path

In reply to Sylwester Nawrocki

From: Marek Szyprowski <[email protected]>

Add a common s3c_fifo_link structure that describes a local path link between 2 multimedia devices (like FIMC and FrameBuffer).

---
 arch/arm/plat-samsung/include/plat/fifo.h |   37 +++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-samsung/include/plat/fifo.h
arch/arm/plat-samsung/include/plat/fifo.h new file +37 -0
new file mode 100644
index 0000000..84d242b
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2010 Samsung Electronics
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef FIFO_H_
+#define FIFO_H_
+
+#include <linux/device.h>
+#include <media/v4l2-subdev.h>
+
+/*
+ * The multimedia devices contained in Samsung S3C/S5P SoC series
+ * like framebuffer, camera interface or tv scaler can transfer data
+ * directly between each other through hardware fifo channels.
+ * s3c_fifo_link data structure is an abstraction for such links,
+ * it allows to define V4L2 device drivers hierarchy according to
+ * the hardware structure. Fifo links are mostly unidirectional, exclusive
+ * data buses. To control data transfer in fifo mode synchronization is
+ * is required between drivers at both ends of the fifo channel
+ * (master_dev, slave_dev). s3c_fifo_link:sub_dev is intended  to export
+ * in a consistent way all the functionality of the slave device required
+ * at master device driver to enable transfer through fifo channel.
+ * master_dev and slave_dev is to be setup by the platform code whilst
+ * sub_dev entry will mostly be initlized during slave_dev probe().
+ */
+struct s3c_fifo_link {
+	struct device		*master_dev;
+	struct device		*slave_dev;
+	struct v4l2_subdev	*sub_dev;
+};
+
+#endif /* FIFO_H_ */
+
Signature · 1 line
1.7.0.4
#10 lore raw

PATCH v2 4/10 v4l: Add Samsung FIMC (video postprocessor) driver

In reply to Sylwester Nawrocki

This driver exports two video device nodes per each FIMC device, one for for memory to memory (color conversion, image resizing, flipping and rotation) operations and one for direct V4L2 output interface to framebuffer.

---
 drivers/media/video/Kconfig                  |   20 +
 drivers/media/video/Makefile                 |    1 +
 drivers/media/video/samsung/fimc/Makefile    |    3 +
 drivers/media/video/samsung/fimc/fimc-core.c | 1664 ++++++++++++++++++++++++++
 drivers/media/video/samsung/fimc/fimc-core.h |  541 +++++++++
 drivers/media/video/samsung/fimc/fimc-fifo.c |  814 +++++++++++++
 drivers/media/video/samsung/fimc/fimc-reg.c  |  585 +++++++++
 include/linux/videodev2.h                    |    1 +
 8 files changed, 3629 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/samsung/fimc/Makefile
 create mode 100644 drivers/media/video/samsung/fimc/fimc-core.c
 create mode 100644 drivers/media/video/samsung/fimc/fimc-core.h
 create mode 100644 drivers/media/video/samsung/fimc/fimc-fifo.c
 create mode 100644 drivers/media/video/samsung/fimc/fimc-reg.c
drivers/media/video/Kconfig +20 -0
index bdbc9d3..5895646 100644
@@ -969,6 +969,16 @@ config VIDEO_OMAP2
 	---help---
 	  This is a v4l2 driver for the TI OMAP2 camera capture interface
 
+config  VIDEO_SAMSUNG_FIMC
+	tristate "Samsung S3C/S5P FIMC (video postprocessor) driver"
+	depends on VIDEO_DEV && VIDEO_V4L2
+	select VIDEOBUF_DMA_CONTIG
+	select V4L2_MEM2MEM_DEV
+	default n
+	help
+	  This is a v4l2 driver for the S3C/S5P camera interface
+	  (video postprocessor).
+
 #
 # USB Multimedia device configuration
 #
@@ -1150,4 +1160,14 @@ config VIDEO_MEM2MEM_TESTDEV
 	  This is a virtual test device for the memory-to-memory driver
 	  framework.
 
+config  VIDEO_SAMSUNG_FIMC
+	tristate "Samsung S3C/S5P FIMC (video postprocessor) driver"
+	depends on VIDEO_DEV && VIDEO_V4L2
+	select VIDEOBUF_DMA_CONTIG
+	select V4L2_MEM2MEM_DEV
+	default n
+	help
+	  This is a v4l2 driver for the S3C/S5P camera interface
+	  (video postprocessor)
+
 endif # V4L_MEM2MEM_DRIVERS
drivers/media/video/Makefile +1 -0
index cc93859..e4c2e1f 100644
@@ -165,6 +165,7 @@ obj-$(CONFIG_VIDEO_MX1)			+= mx1_camera.o
 obj-$(CONFIG_VIDEO_MX3)			+= mx3_camera.o
 obj-$(CONFIG_VIDEO_PXA27x)		+= pxa_camera.o
 obj-$(CONFIG_VIDEO_SH_MOBILE_CEU)	+= sh_mobile_ceu_camera.o
+obj-$(CONFIG_VIDEO_SAMSUNG_FIMC) 	+= samsung/fimc/
 
 obj-$(CONFIG_ARCH_DAVINCI)		+= davinci/
 
drivers/media/video/samsung/fimc/Makefile new file +3 -0
new file mode 100644
index 0000000..c5c40c1
@@ -0,0 +1,3 @@
+
+obj-$(CONFIG_VIDEO_SAMSUNG_FIMC) := samsung-fimc.o
+samsung-fimc-y := fimc-core.o fimc-reg.o fimc-fifo.o
drivers/media/video/samsung/fimc/fimc-core.c new file +1664 -0

1,664 lines not on this page · raw message

drivers/media/video/samsung/fimc/fimc-core.h new file +541 -0

541 lines not on this page · raw message

drivers/media/video/samsung/fimc/fimc-fifo.c new file +814 -0

755 lines not on this page · raw message

drivers/media/video/samsung/fimc/fimc-reg.c new file +585 -0

585 lines not on this page · raw message

include/linux/videodev2.h +1 -0
index 047f7e6..974dc51 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.0.4

Part of the diff is not shown here. View the raw message.

#11 lore raw

PATCH v2 4/10 v4l: Add Samsung FIMC (video postprocessor) driver

Quoted 1 line · Sylwester Nawrocki

Hi,

Samsung S.LSI hardly recommends DMA mode to implement the feature not FIFO mode because of H/W limitation.

Quoted 9 lines

This driver exports two video device nodes per each FIMC device, one for for memory to memory (color conversion, image resizing, flipping and rotation) operations and one for direct V4L2 output interface to framebuffer.

Quoted 17 lines
---
 drivers/media/video/Kconfig                  |   20 +
 drivers/media/video/Makefile                 |    1 +
 drivers/media/video/samsung/fimc/Makefile    |    3 +
 drivers/media/video/samsung/fimc/fimc-core.c | 1664
++++++++++++++++++++++++++
 drivers/media/video/samsung/fimc/fimc-core.h |  541 +++++++++
 drivers/media/video/samsung/fimc/fimc-fifo.c |  814 +++++++++++++
 drivers/media/video/samsung/fimc/fimc-reg.c  |  585 +++++++++
 include/linux/videodev2.h                    |    1 +
 8 files changed, 3629 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/samsung/fimc/Makefile
 create mode 100644 drivers/media/video/samsung/fimc/fimc-core.c
 create mode 100644 drivers/media/video/samsung/fimc/fimc-core.h
 create mode 100644 drivers/media/video/samsung/fimc/fimc-fifo.c
 create mode 100644 drivers/media/video/samsung/fimc/fimc-reg.c

(snip)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#12 lore raw

PATCH v2 4/10 v4l: Add Samsung FIMC (video postprocessor) driver

Quoted 10 lines

-----Original Message-----
From: Kukjin Kim [mailto:kgene.kim at samsung.com]
Sent: Friday, July 16, 2010 1:39 PM
To: 'Sylwester Nawrocki'; linux-samsung-soc at vger.kernel.org; linux-arm- kernel at lists.infradead.org
Cc: p.osciak at samsung.com; m.szyprowski at samsung.com; kyungmin.park at samsung.com; linux-media at vger.kernel.org
Subject: RE: [PATCH 04/10 v2] v4l: Add Samsung FIMC (video postprocessor) driver

Quoted 7 lines
Quoted 1 line · Sylwester Nawrocki

Hi,

Samsung S.LSI hardly recommends DMA mode to implement the feature not FIFO
mode because of H/W limitation.

Does the hardware issue occur in all SoCs or only some specific versions are affected?
So far we were successful with S5PC110 EVT0, however we could not make it work on S5PV210 (EVT1). That said I have created an option in the FIMC variant definition (samsung_fimc_variant::fifo_capable) so that the V4L2 video node for FIMC FIFO operation mode is registered only for selected SoC variants.

Quoted 30 lines
Quoted 27 lines

This driver exports two video device nodes per each FIMC device, one for for memory to memory (color conversion, image resizing, flipping and rotation) operations and one for direct V4L2 output interface to framebuffer.

---
 drivers/media/video/Kconfig                  |   20 +
 drivers/media/video/Makefile                 |    1 +
 drivers/media/video/samsung/fimc/Makefile    |    3 +
 drivers/media/video/samsung/fimc/fimc-core.c | 1664
++++++++++++++++++++++++++
 drivers/media/video/samsung/fimc/fimc-core.h |  541 +++++++++
 drivers/media/video/samsung/fimc/fimc-fifo.c |  814 +++++++++++++
 drivers/media/video/samsung/fimc/fimc-reg.c  |  585 +++++++++
 include/linux/videodev2.h                    |    1 +
 8 files changed, 3629 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/samsung/fimc/Makefile
 create mode 100644 drivers/media/video/samsung/fimc/fimc-core.c
 create mode 100644 drivers/media/video/samsung/fimc/fimc-core.h
 create mode 100644 drivers/media/video/samsung/fimc/fimc-fifo.c
 create mode 100644 drivers/media/video/samsung/fimc/fimc-reg.c

(snip)

Quoted 7 lines

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Best regards,
--
Sylwester Nawrocki
Samsung Poland R&D Center

#13 lore raw

PATCH v2 5/10 s3c-fb: Add v4l2 subdevice to support framebuffer local fifo input path

In reply to Sylwester Nawrocki

Selected multimedia devices in Samsung S3C/S5P SoC series are capable of transferring data directly between each other, bypassing the main system bus. Such a datapath exists between the camera interface/video postprocessor and the lcd controller. To control the data flow from the fimc driver level v4l2-subdevice driver is added to the framebuffer. It enables to configure the lcd controller into FIFO or DMA input mode.

---
 arch/arm/plat-samsung/include/plat/fb.h |    6 +
 drivers/video/s3c-fb.c                  |  487 +++++++++++++++++++++++++++++--
 2 files changed, 472 insertions(+), 21 deletions(-)
arch/arm/plat-samsung/include/plat/fb.h +6 -0
index cb3ca3a..7dc6110 100644
@@ -22,6 +22,10 @@
  */
 #define S3C_FB_MAX_WIN	(5)
 
+#define S3C_FB_MAX_WIN_SOURCES	(2)
+
+struct s3c_fifo_link;
+
 /**
  * struct s3c_fb_pd_win - per window setup data
  * @win_mode: The display parameters to initialise (not for window 0)
@@ -35,6 +39,8 @@ struct s3c_fb_pd_win {
 	unsigned short		max_bpp;
 	unsigned short		virtual_x;
 	unsigned short		virtual_y;
+
+	struct s3c_fifo_link	*fifo_sources[S3C_FB_MAX_WIN_SOURCES];
 };
 
 /**
drivers/video/s3c-fb.c +466 -21

626 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#14 lore raw

PATCH v2 5/10 s3c-fb: Add v4l2 subdevice to support framebuffer local fifo input path

Op 15-07-10 11:10, Sylwester Nawrocki schreef:

Quoted 14 lines

Selected multimedia devices in Samsung S3C/S5P SoC series are capable of transferring data directly between each other, bypassing the main system bus. Such a datapath exists between the camera interface/video postprocessor and the lcd controller. To control the data flow from the fimc driver level v4l2-subdevice driver is added to the framebuffer. It enables to configure the lcd controller into FIFO or DMA input mode.

---
 arch/arm/plat-samsung/include/plat/fb.h |    6 +
 drivers/video/s3c-fb.c                  |  487 +++++++++++++++++++++++++++++--
 2 files changed, 472 insertions(+), 21 deletions(-)

<snip>

Quoted 15 lines

/**
+ * s3c_fb_enable_local() - switch window between input DMA and fifo modes
+ *
+ * @fb_sd: window subdevice for fifo input
+ * @en: 1 - switch from input DMA to fifo mode and apply
+ * window size and position set by the window's subdevice
+ * 0 - restore from fifo to DMA mode
+ */

drivers/video/s3c-fb.c +7 -0
+static int s3c_fb_enable_local_in(struct s3c_fb_win_sd *fb_sd, int en)
+{
+	struct s3c_fb_win *win = fb_sd->win;
+	struct s3c_fb *sfb = win->parent;
+	static u32 wincon;
+	u32 reg, data;
+	int ret = 0, bpp = 32;

drivers/video/s3c-fb.c static int s3c_fb_pan_display(struct fb_var_screeninfo *var, · line 1025

Quoted 10 lines
drivers/video/s3c-fb.c +10 -0
+
+	/* disable video output and the window logic */
+	reg = readl(sfb->regs + WINCON(win->index));
+	writel(reg & ~WINCONx_ENWIN, sfb->regs + WINCON(win->index));
+
+	shadow_protect_win(win, 1);
+
+	if (en == 1) {
+		if (fb_sd->streaming)
+			return 0;

Shouldn't you do shadow_protect_win(win, 0) before returning here?

Quoted 32 lines
drivers/video/s3c-fb.c +32 -0
+
+		wincon = reg;
+
+		switch (fb_sd->fmt.fmt.pix.pixelformat) {
+		case V4L2_PIX_FMT_YUYV: /* YCbCr 4:4:4 */
+			reg |= WINCONx_YCbCr | WINCONx_ENLOCAL;
+			bpp = 16;
+			break;
+
+		case V4L2_PIX_FMT_RGB24:
+		default:
+			reg &= ~(WINCONx_YCbCr | WINCONx_WSWP | WINCONx_HAWSWP |
+				 WINCONx_BYTSWP | WINCONx_BITSWP |
+				 WINCON0_BPPMODE_MASK | WINCONx_BURSTLEN_MASK);
+
+			reg |=	WINCON0_BPPMODE_24BPP_888 |
+				WINCONx_BURSTLEN_4WORD;
+			bpp = 24;
+			break;
+		}
+
+		fb_sd->streaming = 1;
+		writel(reg, sfb->regs + WINCON(win->index));
+
+		s3c_fb_set_osd(fb_sd->win, &fb_sd->curr_osd_win, bpp);
+
+		writel(reg | WINCONx_ENLOCAL, sfb->regs + WINCON(win->index));
+
+		shadow_protect_win(win, 0);
+
+		reg = readl(sfb->regs + WINCON(win->index));
+		writel(reg | WINCONx_ENWIN, sfb->regs + WINCON(win->index));

drivers/video/s3c-fb.c static int s3c_fb_pan_display(struct fb_var_screeninfo *var, · line 1067

Quoted 10 lines
drivers/video/s3c-fb.c +10 -0
+
+		if (sfb->variant.has_shadowcon)	{
+			data = readl(sfb->regs + SHADOWCON);
+			data |=	SHADOWCON_CHx_LOCAL_ENABLE(win->index);
+			writel(data, sfb->regs + SHADOWCON);
+		}
+
+	} else if (en == 0) {
+		if (!fb_sd->streaming)
+			return 0;

Same comment

Quoted 28 lines
drivers/video/s3c-fb.c +28 -0
+
+		fb_sd->streaming = 0;
+
+		/* need to be aligned with VSYNC interrupt */
+		writel(wincon & ~WINCONx_ENLOCAL,
+		       sfb->regs + WINCON(win->index));
+
+		/* restore OSD values from before we enabled local mode */
+		bpp = win->fbinfo->var.bits_per_pixel;
+		s3c_fb_set_osd(fb_sd->win, &fb_sd->default_osd_win, bpp);
+
+		shadow_protect_win(win, 0);
+
+		if (sfb->variant.has_shadowcon)	{
+			data = readl(sfb->regs + SHADOWCON);
+			data &=	~SHADOWCON_CHx_LOCAL_ENABLE(win->index);
+			writel(data, sfb->regs + SHADOWCON);
+		}
+
+		reg = readl(sfb->regs + WINCON(win->index));
+		writel(reg | WINCONx_ENWIN, sfb->regs + WINCON(win->index));
+	} else {
+		return -EINVAL;
+	}
+
+	return ret;
+}
+
Signature · 1 line
Maurus Cuelenaere
#15 lore raw

PATCH v2 5/10 s3c-fb: Add v4l2 subdevice to support framebuffer local fifo input path

Hello,

Quoted 56 lines

-----Original Message-----
From: linux-samsung-soc-owner at vger.kernel.org [mailto:linux-samsung- soc-owner at vger.kernel.org] On Behalf Of Maurus Cuelenaere
Sent: Thursday, July 15, 2010 12:32 PM
To: Sylwester Nawrocki
Cc: linux-samsung-soc at vger.kernel.org; linux-arm-
kernel at lists.infradead.org; p.osciak at samsung.com; m.szyprowski at samsung.com; kyungmin.park at samsung.com; kgene.kim at samsung.com; ben-linux at fluff.org; linux-fbdev at vger.kernel.org
Subject: Re: [PATCH 05/10 v2] s3c-fb: Add v4l2 subdevice to support framebuffer local fifo input path

Op 15-07-10 11:10, Sylwester Nawrocki schreef:

Quoted 1 line

Selected multimedia devices in Samsung S3C/S5P SoC series are capable

of

Quoted 1 line

transferring data directly between each other, bypassing the main

system

Quoted 2 lines

bus. Such a datapath exists between the camera interface/video postprocessor and the lcd controller. To control the data flow from

the

Quoted 2 lines

fimc driver level v4l2-subdevice driver is added to the framebuffer. It enables to configure the lcd controller into FIFO or DMA input

mode.

Quoted 7 lines
---
 arch/arm/plat-samsung/include/plat/fb.h |    6 +
 drivers/video/s3c-fb.c                  |  487

+++++++++++++++++++++++++++++--

Quoted 1 line
 2 files changed, 472 insertions(+), 21 deletions(-)

<snip>

Quoted 2 lines

/**
+ * s3c_fb_enable_local() - switch window between input DMA and fifo

modes

Quoted 7 lines

+ *
+ * @fb_sd: window subdevice for fifo input
+ * @en: 1 - switch from input DMA to fifo mode and apply
+ * window size and position set by the window's subdevice
+ * 0 - restore from fifo to DMA mode
+ */
+static int s3c_fb_enable_local_in(struct s3c_fb_win_sd *fb_sd, int

en)

Quoted 10 lines
drivers/video/s3c-fb.c +10 -0
+{
+	struct s3c_fb_win *win = fb_sd->win;
+	struct s3c_fb *sfb = win->parent;
+	static u32 wincon;
+	u32 reg, data;
+	int ret = 0, bpp = 32;
+
+	/* disable video output and the window logic */
+	reg = readl(sfb->regs + WINCON(win->index));
+	writel(reg & ~WINCONx_ENWIN, sfb->regs + WINCON(win->index));
Quoted 8 lines

drivers/video/s3c-fb.c static int s3c_fb_pan_display(struct fb_var_screeninfo *var, · line 1025

Quoted 6 lines
drivers/video/s3c-fb.c +6 -0
+
+	shadow_protect_win(win, 1);
+
+	if (en == 1) {
+		if (fb_sd->streaming)
+			return 0;

Shouldn't you do shadow_protect_win(win, 0) before returning here?

Yes, indeed the error path is wrong and also WINCONx_ENWIN needs to be restored.
Thank you for pointing this out.

Quoted 73 lines

drivers/video/s3c-fb.c static int s3c_fb_pan_display(struct fb_var_screeninfo *var,

Quoted 13 lines
drivers/video/s3c-fb.c +12 -0
+
+		wincon = reg;
+
+		switch (fb_sd->fmt.fmt.pix.pixelformat) {
+		case V4L2_PIX_FMT_YUYV: /* YCbCr 4:4:4 */
+			reg |= WINCONx_YCbCr | WINCONx_ENLOCAL;
+			bpp = 16;
+			break;
+
+		case V4L2_PIX_FMT_RGB24:
+		default:
+			reg &= ~(WINCONx_YCbCr | WINCONx_WSWP |

WINCONx_HAWSWP |

Quoted 22 lines
drivers/video/s3c-fb.c +15 -0
+				 WINCONx_BYTSWP | WINCONx_BITSWP |
+				 WINCON0_BPPMODE_MASK | WINCONx_BURSTLEN_MASK);
+
+			reg |=	WINCON0_BPPMODE_24BPP_888 |
+				WINCONx_BURSTLEN_4WORD;
+			bpp = 24;
+			break;
+		}
+
+		fb_sd->streaming = 1;
+		writel(reg, sfb->regs + WINCON(win->index));
+
+		s3c_fb_set_osd(fb_sd->win, &fb_sd->curr_osd_win, bpp);
+
+		writel(reg | WINCONx_ENLOCAL, sfb->regs + WINCON(win-

index));

drivers/video/s3c-fb.c +5 -0
+
+		shadow_protect_win(win, 0);
+
+		reg = readl(sfb->regs + WINCON(win->index));
+		writel(reg | WINCONx_ENWIN, sfb->regs + WINCON(win-

index));

drivers/video/s3c-fb.c static int s3c_fb_pan_display(struct fb_var_screeninfo *var, · line 1067

Quoted 10 lines
drivers/video/s3c-fb.c +10 -0
+
+		if (sfb->variant.has_shadowcon)	{
+			data = readl(sfb->regs + SHADOWCON);
+			data |=	SHADOWCON_CHx_LOCAL_ENABLE(win->index);
+			writel(data, sfb->regs + SHADOWCON);
+		}
+
+	} else if (en == 0) {
+		if (!fb_sd->streaming)
+			return 0;

Same comment

Quoted 24 lines
drivers/video/s3c-fb.c +21 -0
+
+		fb_sd->streaming = 0;
+
+		/* need to be aligned with VSYNC interrupt */
+		writel(wincon & ~WINCONx_ENLOCAL,
+		       sfb->regs + WINCON(win->index));
+
+		/* restore OSD values from before we enabled local mode */
+		bpp = win->fbinfo->var.bits_per_pixel;
+		s3c_fb_set_osd(fb_sd->win, &fb_sd->default_osd_win, bpp);
+
+		shadow_protect_win(win, 0);
+
+		if (sfb->variant.has_shadowcon)	{
+			data = readl(sfb->regs + SHADOWCON);
+			data &=	~SHADOWCON_CHx_LOCAL_ENABLE(win->index);
+			writel(data, sfb->regs + SHADOWCON);
+		}
+
+		reg = readl(sfb->regs + WINCON(win->index));
+		writel(reg | WINCONx_ENWIN, sfb->regs + WINCON(win-

index));

drivers/video/s3c-fb.c +2 -0
+	} else {
+		return -EINVAL;
Quoted 8 lines

drivers/video/s3c-fb.c static int s3c_fb_pan_display(struct fb_var_screeninfo *var, · line 1095

Quoted 5 lines
drivers/video/s3c-fb.c +5 -0
+	}
+
+	return ret;
+}
+

--
Maurus Cuelenaere

Regards,
--
Sylwester Nawrocki

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux- samsung-soc" in
the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

#16 lore raw

PATCH v2 6/10 ARM: S5PV210: Add fifo link definitions for FIMC and framebuffer

In reply to Sylwester Nawrocki

Add definition of local paths that are available on Samsung S5PV210 SoCs.

---
 arch/arm/mach-s5pv210/setup-fimc0.c       |   23 +++++++++++++++++++++++
 arch/arm/mach-s5pv210/setup-fimc1.c       |   23 +++++++++++++++++++++++
 arch/arm/mach-s5pv210/setup-fimc2.c       |   23 +++++++++++++++++++++++
 arch/arm/plat-samsung/include/plat/fimc.h |    4 ++++
 4 files changed, 73 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/setup-fimc0.c +23 -0
index 0e5ef0a..b869d87 100644
@@ -10,5 +10,28 @@
  */
 
 #include <plat/fimc.h>
+#include <plat/fifo.h>
+#include <linux/fb.h>
+#include <plat/fb.h>
+#include <plat/devs.h>
 
 struct samsung_plat_fimc s5p_fimc0_default_data __initdata = {};
+
+static struct s3c_fifo_link s5pv210_fimc0_win0_link = {
+	.master_dev	= &s5p_device_fimc0.dev,
+	.slave_dev	= &s3c_device_fb.dev,
+};
+
+void __init s5pv210_setup_fimc0_fb_link(void)
+{
+	struct s3c_fb_platdata *fb_pd;
+	struct samsung_plat_fimc *fimc_pd;
+
+	fimc_pd = s5p_device_fimc0.dev.platform_data;
+	fb_pd = s3c_device_fb.dev.platform_data;
+
+	if (fimc_pd && fb_pd && fb_pd->win[0]) {
+		fb_pd->win[0]->fifo_sources[0] = &s5pv210_fimc0_win0_link;
+		fimc_pd->fifo_targets[0] = &s5pv210_fimc0_win0_link;
+	}
+}
arch/arm/mach-s5pv210/setup-fimc1.c +23 -0
index 80da0e7..62a7804 100644
@@ -10,5 +10,28 @@
  */
 
 #include <plat/fimc.h>
+#include <plat/fifo.h>
+#include <linux/fb.h>
+#include <plat/fb.h>
+#include <plat/devs.h>
 
 struct samsung_plat_fimc s5p_fimc1_default_data __initdata = {};
+
+static struct s3c_fifo_link s5pv210_fimc1_win1_link = {
+	.master_dev	= &s5p_device_fimc1.dev,
+	.slave_dev	= &s3c_device_fb.dev,
+};
+
+void __init s5pv210_setup_fimc1_fb_link(void)
+{
+	struct s3c_fb_platdata *fb_pd;
+	struct samsung_plat_fimc *fimc_pd;
+
+	fimc_pd = s5p_device_fimc1.dev.platform_data;
+	fb_pd = s3c_device_fb.dev.platform_data;
+
+	if (fimc_pd && fb_pd && fb_pd->win[1]) {
+		fb_pd->win[1]->fifo_sources[0] = &s5pv210_fimc1_win1_link;
+		fimc_pd->fifo_targets[0] = &s5pv210_fimc1_win1_link;
+	}
+}
arch/arm/mach-s5pv210/setup-fimc2.c +23 -0
index bc6a27b..1515eac 100644
@@ -10,5 +10,28 @@
  */
 
 #include <plat/fimc.h>
+#include <plat/fifo.h>
+#include <linux/fb.h>
+#include <plat/fb.h>
+#include <plat/devs.h>
 
 struct samsung_plat_fimc s5p_fimc2_default_data __initdata = {};
+
+static struct s3c_fifo_link s5pv210_fimc2_win2_link = {
+	.master_dev	= &s5p_device_fimc2.dev,
+	.slave_dev	= &s3c_device_fb.dev,
+};
+
+void __init s5pv210_setup_fimc2_fb_link(void)
+{
+	struct s3c_fb_platdata *fb_pd;
+	struct samsung_plat_fimc *fimc_pd;
+
+	fimc_pd = s5p_device_fimc2.dev.platform_data;
+	fb_pd = s3c_device_fb.dev.platform_data;
+
+	if (fimc_pd && fb_pd && fb_pd->win[2]) {
+		fb_pd->win[2]->fifo_sources[0] = &s5pv210_fimc2_win2_link;
+		fimc_pd->fifo_targets[0] = &s5pv210_fimc2_win2_link;
+	}
+}
arch/arm/plat-samsung/include/plat/fimc.h +4 -0
index cf7d2fb..304ef42 100644
@@ -39,5 +39,9 @@ extern void s5p_fimc0_set_platdata(struct samsung_plat_fimc *fimc);
 extern void s5p_fimc1_set_platdata(struct samsung_plat_fimc *fimc);
 extern void s5p_fimc2_set_platdata(struct samsung_plat_fimc *fimc);
 
+extern void __init s5pv210_setup_fimc0_fb_link(void);
+extern void __init s5pv210_setup_fimc1_fb_link(void);
+extern void __init s5pv210_setup_fimc2_fb_link(void);
+
 #endif /* FIMC_H_ */
 
Signature · 1 line
1.7.0.4
#17 lore raw

PATCH v2 7/10 ARM: S5PV210: add common Aquila & GONI code

In reply to Sylwester Nawrocki
---
 arch/arm/mach-s5pv210/Kconfig              |    5 +++
 arch/arm/mach-s5pv210/Makefile             |    2 +
 arch/arm/mach-s5pv210/common-aquila-goni.c |   39 ++++++++++++++++++++++++++++
 arch/arm/mach-s5pv210/common-aquila-goni.h |    2 +
 4 files changed, 48 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/common-aquila-goni.c
 create mode 100644 arch/arm/mach-s5pv210/common-aquila-goni.h
arch/arm/mach-s5pv210/Kconfig +5 -0
index 4bb5a85..5206562 100644
@@ -126,6 +126,11 @@ config MACH_P1P2
 
 endmenu
 
+config COMMON_AQUILA_GONI
+	bool
+	help
+	  Compile common code for Samsung Aquila and Samsung GONI machines
+
 config S5PC110_DEV_ONENAND
 	bool
 	help
arch/arm/mach-s5pv210/Makefile +2 -0
index 6eceeb8..06de97f 100644
@@ -24,6 +24,8 @@ obj-$(CONFIG_MACH_GONI)		+= mach-goni.o
 obj-$(CONFIG_MACH_UNIVERSAL)	+= mach-universal.o
 obj-$(CONFIG_MACH_P1P2)		+= mach-p1p2.o
 
+obj-$(CONFIG_COMMON_AQUILA_GONI)	+= common-aquila-goni.o
+
 # device support
 
 obj-y				+= dev-audio.o
arch/arm/mach-s5pv210/common-aquila-goni.c new file +39 -0
new file mode 100644
index 0000000..cdfc40e
@@ -0,0 +1,39 @@
+#include <linux/err.h>
+#include <linux/clk.h>
+#include <plat/fimc.h>
+
+#include "common-aquila-goni.h"
+
+void __init s5pv210_common_fimc_clk_init(void)
+{
+	int i;
+	struct clk *clk_fimc, *parent;
+
+	struct device *fimc_devs[] = {
+		&s5p_device_fimc0.dev,
+		&s5p_device_fimc1.dev,
+		&s5p_device_fimc2.dev
+	};
+
+	parent = clk_get(NULL, "mout_epll");
+	if (IS_ERR(parent)) {
+		printk("%s: Could not get FIMC parent clock\n", __func__);
+		return;
+	}
+
+	for (i = 0; i < ARRAY_SIZE(fimc_devs); i++) {
+		if (fimc_devs[i]) {
+			clk_fimc = clk_get(fimc_devs[i], "sclk_fimc");
+
+			if (IS_ERR(clk_fimc)) {
+				printk("%s: Could not get sclk_fimc clock\n",
+				       __func__);
+				continue;
+			}
+
+			clk_set_parent(clk_fimc, parent);
+			clk_set_rate(clk_fimc, 133000000);
+		}
+	}
+	clk_put(parent);
+}
arch/arm/mach-s5pv210/common-aquila-goni.h new file +2 -0
new file mode 100644
index 0000000..f666462
@@ -0,0 +1,2 @@
+
+extern void s5pv210_common_fimc_clk_init(void);
Signature · 1 line
1.7.0.4
#18 lore raw

PATCH v2 8/10 ARM: S5PV210: enable FIMC on Aquila

In reply to Sylwester Nawrocki

From: Marek Szyprowski <[email protected]>

Add support for FIMC on Samsung Aquila board. Enable support for local path mode between fimc and frame buffer.

---
 arch/arm/mach-s5pv210/Kconfig       |    7 +++++++
 arch/arm/mach-s5pv210/mach-aquila.c |   20 ++++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/Kconfig +7 -0
index 5206562..fed64f5 100644
@@ -63,10 +63,17 @@ menu "S5PC110 Machines"
 config MACH_AQUILA
 	bool "Aquila"
 	select CPU_S5PV210
+	select COMMON_AQUILA_GONI
 	select ARCH_SPARSEMEM_ENABLE
 	select S5PV210_SETUP_FB_24BPP
 	select S5PV210_SETUP_SDHCI
 	select S3C_DEV_FB
+	select S5P_DEV_FIMC0
+	select S5PV210_SETUP_FIMC0
+	select S5P_DEV_FIMC1
+	select S5PV210_SETUP_FIMC1
+	select S5P_DEV_FIMC2
+	select S5PV210_SETUP_FIMC2
 	select S5PC110_DEV_ONENAND
 	select S3C_DEV_HSMMC
 	select S3C_DEV_HSMMC1
arch/arm/mach-s5pv210/mach-aquila.c +20 -0
index 6b60358..927bf47 100644
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/serial_core.h>
 #include <linux/fb.h>
+#include <linux/clk.h>
 #include <linux/gpio.h>
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
@@ -41,9 +42,13 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/fb.h>
+#include <plat/fimc.h>
+#include <plat/fifo.h>
 #include <plat/gpio-cfg.h>
 #include <plat/sdhci.h>
 
+#include "common-aquila-goni.h"
+
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
 				 S3C2410_UCON_RXILEVEL |	\
@@ -577,6 +582,9 @@ static struct platform_device *aquila_devices[] __initdata = {
 	&universal_spi_gpio,
 	&s5pc110_device_onenand,
 	&s3c_device_usbgadget,
+	&s5p_device_fimc0,
+	&s5p_device_fimc1,
+	&s5p_device_fimc2,
 	&s3c_device_hsmmc0,
 	&s3c_device_hsmmc1,
 	&s3c_device_hsmmc2,
@@ -599,13 +607,25 @@ static void __init aquila_machine_init(void)
 	/* SPI */
 	spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
 
+	/* FIMC */
+	s5p_fimc0_set_platdata(NULL);
+	s5p_fimc1_set_platdata(NULL);
+	s5p_fimc2_set_platdata(NULL);
+
 	/* SDHCI */
 	aquila_setup_sdhci();
 
 	/* FB */
 	s3c_fb_set_platdata(&aquila_lcd_pdata);
 
+	/* FIMC->FB fifo links */
+	s5pv210_setup_fimc0_fb_link();
+	s5pv210_setup_fimc1_fb_link();
+	s5pv210_setup_fimc2_fb_link();
+
 	platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
+
+	s5pv210_common_fimc_clk_init();
 }
 
 MACHINE_START(AQUILA, "Aquila")
Signature · 1 line
1.7.0.4
#19 lore raw

PATCH v2 9/10 ARM: s5pv210: enable FIMC on Goni

In reply to Sylwester Nawrocki

From: Marek Szyprowski <[email protected]>

---
 arch/arm/mach-s5pv210/Kconfig     |    1 +
 arch/arm/mach-s5pv210/mach-goni.c |   18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
arch/arm/mach-s5pv210/Kconfig +1 -0
index fed64f5..e9e033e 100644
@@ -85,6 +85,7 @@ config MACH_AQUILA
 config MACH_GONI
 	bool "GONI"
 	select CPU_S5PV210
+	select COMMON_AQUILA_GONI
 	select ARCH_SPARSEMEM_ENABLE
 	select S5PV210_SETUP_FB_24BPP
 	select S3C_DEV_FB
arch/arm/mach-s5pv210/mach-goni.c +18 -0
index 4792bf8..fde12df 100644
@@ -40,6 +40,9 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <plat/fb.h>
+#include <plat/fimc.h>
+
+#include "common-aquila-goni.h"
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PV210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -498,6 +501,9 @@ static struct platform_device *goni_devices[] __initdata = {
 	&s3c_device_usbgadget,
 	&goni_i2c_gpio_pmic,
 	&goni_device_gpiokeys,
+	&s5p_device_fimc0,
+	&s5p_device_fimc1,
+	&s5p_device_fimc2,
 };
 
 static void __init goni_map_io(void)
@@ -520,7 +526,19 @@ static void __init goni_machine_init(void)
 	/* SPI */
 	spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
 
+	/* FIMC */
+	s5p_fimc0_set_platdata(NULL);
+	s5p_fimc1_set_platdata(NULL);
+	s5p_fimc2_set_platdata(NULL);
+
+	/* FIMC->FB fifo links */
+	s5pv210_setup_fimc0_fb_link();
+	s5pv210_setup_fimc1_fb_link();
+	s5pv210_setup_fimc2_fb_link();
+
 	platform_add_devices(goni_devices, ARRAY_SIZE(goni_devices));
+
+	s5pv210_common_fimc_clk_init();
 }
 
 MACHINE_START(GONI, "GONI")
Signature · 1 line
1.7.0.4
#20 lore raw

PATCH v2 10/10 ARM: S5PC100: enable FIMC on SMDKC100

In reply to Sylwester Nawrocki

Add support for FIMC on Samsung SMDKC100 board.

---
 arch/arm/mach-s5pc100/Kconfig         |    6 ++++++
 arch/arm/mach-s5pc100/mach-smdkc100.c |    9 +++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
arch/arm/mach-s5pc100/Kconfig +6 -0
index 791270d..8839c07 100644
@@ -63,6 +63,12 @@ config MACH_SMDKC100
 	select S5PC100_SETUP_FB_24BPP
 	select S5PC100_SETUP_I2C1
 	select S5PC100_SETUP_SDHCI
+	select S5P_DEV_FIMC0
+	select S5PC100_SETUP_FIMC0
+	select S5P_DEV_FIMC1
+	select S5PC100_SETUP_FIMC1
+	select S5P_DEV_FIMC2
+	select S5PC100_SETUP_FIMC2
 	help
 	  Machine support for the Samsung SMDKC100
 
arch/arm/mach-s5pc100/mach-smdkc100.c +9 -0
index ce3fcde..262de8e 100644
@@ -42,6 +42,7 @@
 #include <plat/s5pc100.h>
 #include <plat/fb.h>
 #include <plat/iic.h>
+#include <plat/fimc.h>
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
 #define S5PC100_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
@@ -160,6 +161,9 @@ static struct platform_device *smdkc100_devices[] __initdata = {
 	&s5pc100_device_iis0,
 	&s5pc100_device_ac97,
 	&s3c_device_onenand,
+	&s5p_device_fimc0,
+	&s5p_device_fimc1,
+	&s5p_device_fimc2,
 };
 
 static void __init smdkc100_map_io(void)
@@ -179,6 +183,11 @@ static void __init smdkc100_machine_init(void)
 
 	s3c_fb_set_platdata(&smdkc100_lcd_pdata);
 
+	/* FIMC */
+	s5p_fimc0_set_platdata(NULL);
+	s5p_fimc1_set_platdata(NULL);
+	s5p_fimc2_set_platdata(NULL);
+
 	/* LCD init */
 	gpio_request(S5PC100_GPD(0), "GPD");
 	gpio_request(S5PC100_GPH0(6), "GPH0");
Signature · 1 line
1.7.0.4