ARM: EXYNOS: support mipi dsi driver
PATCH 2/2 ARM: EXYNOS: support mipi dsi driver
This patch is MIPI DSI interface driver for EXYNOS SoC
Signed-off-by Donghwa Lee <[email protected]>
Signed-off-by Inki Dae <[email protected]>
Signed-off-by Kyungmin Park <[email protected]>
--- arch/arm/include/asm/arch-exynos/dsim.h | 181 +++++++ arch/arm/include/asm/arch-exynos/mipi_dsim.h | 392 +++++++++++++++ drivers/video/Makefile | 3 + drivers/video/exynos_fb.c | 4 + drivers/video/exynos_mipi_dsi.c | 256 ++++++++++ drivers/video/exynos_mipi_dsi_common.c | 645 +++++++++++++++++++++++++ drivers/video/exynos_mipi_dsi_common.h | 48 ++ drivers/video/exynos_mipi_dsi_lowlevel.c | 669 ++++++++++++++++++++++++++ drivers/video/exynos_mipi_dsi_lowlevel.h | 111 +++++ drivers/video/s6e8ax0.c | 289 +++++++++++ include/lcd.h | 1 + 11 files changed, 2599 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/arch-exynos/dsim.h create mode 100644 arch/arm/include/asm/arch-exynos/mipi_dsim.h create mode 100644 drivers/video/exynos_mipi_dsi.c create mode 100644 drivers/video/exynos_mipi_dsi_common.c create mode 100644 drivers/video/exynos_mipi_dsi_common.h create mode 100644 drivers/video/exynos_mipi_dsi_lowlevel.c create mode 100644 drivers/video/exynos_mipi_dsi_lowlevel.h create mode 100644 drivers/video/s6e8ax0.c
arch/arm/include/asm/arch-exynos/dsim.h new file +181 -0
@@ -0,0 +1,181 @@ +/* +* Copyright (C) 2012 Samsung Electronics +* +* Author: InKi Dae <[email protected]> +* Author: Donghwa Lee <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#ifndef __ASM_ARM_ARCH_DSIM_H_ +#define __ASM_ARM_ARCH_DSIM_H_ + +#ifndef __ASSEMBLY__ + +struct exynos_mipi_dsim { +unsigned int status; +unsigned int swrst; +unsigned int clkctrl; +unsigned int timeout; +unsigned int config; +unsigned int escmode; +unsigned int mdresol; +unsigned int mvporch; +unsigned int mhporch; +unsigned int msync; +unsigned int sdresol; +unsigned int intsrc; +unsigned int intmsk; +unsigned int pkthdr; +unsigned int payload; +unsigned int rxfifo; +unsigned int fifothld; +unsigned int fifoctrl; +unsigned int memacchr; +unsigned int pllctrl; +unsigned int plltmr; +unsigned int phyacchr; +unsigned int phyacchr1; +}; + +#endif /* __ASSEMBLY__ */ + +/* +* Bit Definitions +*/ +/* DSIM_STATUS */ +#define DSIM_STOP_STATE_DAT (x) (((x) & 0xf) << 0) +#define DSIM_STOP_STATE_CLK (1 << 8) +#define DSIM_TX_READY_HS_CLK (1 << 10) +#define DSIM_PLL_STABLE (1 << 31) + +/* DSIM_SWRST */ +#define DSIM_FUNCRST (1 << 16) +#define DSIM_SWRST (1 << 0) + +/* EXYNOS_DSIM_TIMEOUT */ +#define DSIM_LPDR_TOUT_SHIFT (0) +#define DSIM_BTA_TOUT_SHIFT (16) + +/* EXYNOS_DSIM_CLKCTRL */ +#define DSIM_LANE_ESC_CLKEN_SHIFT (19) +#define DSIM_BYTE_CLKEN_SHIFT (24) +#define DSIM_BYTE_CLK_SRC_SHIFT (25) +#define DSIM_PLL_BYPASS_SHIFT (27) +#define DSIM_ESC_CLKEN_SHIFT (28) +#define DSIM_TX_REQUEST_HSCLK_SHIFT (31) +#define DSIM_LANE_ESC_CLKEN (x) (((x) & 0x1f) << \ + DSIM_LANE_ESC_CLKEN_SHIFT) +#define DSIM_BYTE_CLK_ENABLE (1 << DSIM_BYTE_CLKEN_SHIFT) +#define DSIM_BYTE_CLK_DISABLE (0 << DSIM_BYTE_CLKEN_SHIFT) +#define DSIM_PLL_BYPASS_EXTERNAL (1 << DSIM_PLL_BYPASS_SHIFT) +#define DSIM_ESC_CLKEN_ENABLE (1 << DSIM_ESC_CLKEN_SHIFT) +#define DSIM_ESC_CLKEN_DISABLE (0 << DSIM_ESC_CLKEN_SHIFT) + +/* EXYNOS_DSIM_CONFIG */ +#define DSIM_NUM_OF_DATALANE_SHIFT (5) +#define DSIM_SUBPIX_SHIFT (8) +#define DSIM_MAINPIX_SHIFT (12) +#define DSIM_SUBVC_SHIFT (16) +#define DSIM_MAINVC_SHIFT (18) +#define DSIM_HSA_MODE_SHIFT (20) +#define DSIM_HBP_MODE_SHIFT (21) +#define DSIM_HFP_MODE_SHIFT (22) +#define DSIM_HSE_MODE_SHIFT (23) +#define DSIM_AUTO_MODE_SHIFT (24) +#define DSIM_VIDEO_MODE_SHIFT (25) +#define DSIM_BURST_MODE_SHIFT (26) +#define DSIM_EOT_PACKET_SHIFT (28) +#define DSIM_AUTO_FLUSH_SHIFT (29) +#define DSIM_LANE_ENx (x) (((x) & 0x1f) << 0) + +#define DSIM_NUM_OF_DATA_LANE (x) ((x) << DSIM_NUM_OF_DATALANE_SHIFT) + +/* EXYNOS_DSIM_ESCMODE */ +#define DSIM_TX_LPDT_SHIFT (6) +#define DSIM_CMD_LPDT_SHIFT (7) +#define DSIM_TX_LPDT_LP (1 << DSIM_TX_LPDT_SHIFT) +#define DSIM_CMD_LPDT_LP (1 << DSIM_CMD_LPDT_SHIFT) +#define DSIM_STOP_STATE_CNT_SHIFT (21) +#define DSIM_FORCE_STOP_STATE_SHIFT (20) + +/* EXYNOS_DSIM_MDRESOL */ +#define DSIM_MAIN_STAND_BY (1 << 31) +#define DSIM_MAIN_VRESOL (x) (((x) & 0x7ff) << 16) +#define DSIM_MAIN_HRESOL (x) (((x) & 0X7ff) << 0) + +/* EXYNOS_DSIM_MVPORCH */ +#define DSIM_CMD_ALLOW_SHIFT (28) +#define DSIM_STABLE_VFP_SHIFT (16) +#define DSIM_MAIN_VBP_SHIFT (0) +#define DSIM_CMD_ALLOW_MASK (0xf << DSIM_CMD_ALLOW_SHIFT) +#define DSIM_STABLE_VFP_MASK (0x7ff << DSIM_STABLE_VFP_SHIFT) +#define DSIM_MAIN_VBP_MASK (0x7ff << DSIM_MAIN_VBP_SHIFT) + +/* EXYNOS_DSIM_MHPORCH */ +#define DSIM_MAIN_HFP_SHIFT (16) +#define DSIM_MAIN_HBP_SHIFT (0) +#define DSIM_MAIN_HFP_MASK ((0xffff) << DSIM_MAIN_HFP_SHIFT) +#define DSIM_MAIN_HBP_MASK ((0xffff) << DSIM_MAIN_HBP_SHIFT) + +/* EXYNOS_DSIM_MSYNC */ +#define DSIM_MAIN_VSA_SHIFT (22) +#define DSIM_MAIN_HSA_SHIFT (0) +#define DSIM_MAIN_VSA_MASK ((0x3ff) << DSIM_MAIN_VSA_SHIFT) +#define DSIM_MAIN_HSA_MASK ((0xffff) << DSIM_MAIN_HSA_SHIFT) + +/* EXYNOS_DSIM_SDRESOL */ +#define DSIM_SUB_STANDY_SHIFT (31) +#define DSIM_SUB_VRESOL_SHIFT (16) +#define DSIM_SUB_HRESOL_SHIFT (0) +#define DSIM_SUB_STANDY_MASK ((0x1) << DSIM_SUB_STANDY_SHIFT) +#define DSIM_SUB_VRESOL_MASK ((0x7ff) << DSIM_SUB_VRESOL_SHIFT) +#define DSIM_SUB_HRESOL_MASK ((0x7ff) << DSIM_SUB_HRESOL_SHIFT) + +/* EXYNOS_DSIM_INTSRC */ +#define INTSRC_FRAME_DONE (1 << 24) +#define INTSRC_PLL_STABLE (1 << 31) +#define INTSRC_SWRST_RELEASE (1 << 30) + +/* EXYNOS_DSIM_INTMSK */ +#define INTMSK_FRAME_DONE (1 << 24) + +/* EXYNOS_DSIM_FIFOCTRL */ +#define SFR_HEADER_EMPTY (1 << 22) + +/* EXYNOS_DSIM_PKTHDR */ +#define DSIM_PKTHDR_DI (x) (((x) & 0x3f) << 0) +#define DSIM_PKTHDR_DAT0 (x) ((x) << 8) +#define DSIM_PKTHDR_DAT1 (x) ((x) << 16) + +/* EXYNOS_DSIM_PHYACCHR */ +#define DSIM_AFC_CTL (x) (((x) & 0x7) << 5) +#define DSIM_AFC_CTL_SHIFT (5) +#define DSIM_AFC_EN (1 << 14) + +/* EXYNOS_DSIM_PHYACCHR1 */ +#define DSIM_DPDN_SWAP_DATA_SHIFT (0) + +/* EXYNOS_DSIM_PLLCTRL */ +#define DSIM_SCALER_SHIFT (1) +#define DSIM_MAIN_SHIFT (4) +#define DSIM_PREDIV_SHIFT (13) +#define DSIM_PRECTRL_SHIFT (20) +#define DSIM_PLL_EN_SHIFT (23) +#define DSIM_FREQ_BAND_SHIFT (24) +#define DSIM_ZEROCTRL_SHIFT (28) + +#endif
arch/arm/include/asm/arch-exynos/mipi_dsim.h new file +392 -0
392 lines not on this page · raw message
drivers/video/Makefile +3 -0
@@ -29,7 +29,10 @@ COBJS-$(CONFIG_ATI_RADEON_FB) += ati_radeon_fb.o videomodes.o COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o COBJS-$(CONFIG_EXYNOS_FB) += exynos_fb.o exynos_fimd.o +COBJS-$(CONFIG_EXYNOS_MIPI_DSIM) += exynos_mipi_dsi.o exynos_mipi_dsi_common.o \ + exynos_mipi_dsi_lowlevel.o COBJS-$(CONFIG_FSL_DIU_FB) += fsl_diu_fb.o videomodes.o +COBJS-$(CONFIG_S6E8AX0) += s6e8ax0.o COBJS-$(CONFIG_S6E63D6) += s6e63d6.o COBJS-$(CONFIG_SED156X) += sed156x.o COBJS-$(CONFIG_VIDEO_AMBA) += amba.o
drivers/video/exynos_fb.c +4 -0
@@ -30,6 +30,7 @@#include <asm/arch/cpu.h> #include <asm/arch/clock.h> #include <asm/arch/clk.h> +#include <asm/arch/mipi_dsim.h> #include <asm/arch/system.h> #include <malloc.h> #include "exynos_fb.h"
@@ -98,6 +99,9 @@ static void lcd_panel_on(vidinfo_t *vid)if (vid->enable_ldo) vid->enable_ldo (1 ); + +if (vid->mipi_enabled) +exynos_mipi_dsi_init (); }void lcd_ctrl_init (void *lcdbase)
drivers/video/exynos_mipi_dsi.c new file +256 -0
256 lines not on this page · raw message
drivers/video/exynos_mipi_dsi_common.c new file +645 -0
645 lines not on this page · raw message
drivers/video/exynos_mipi_dsi_common.h new file +48 -0
48 lines not on this page · raw message
drivers/video/exynos_mipi_dsi_lowlevel.c new file +669 -0
669 lines not on this page · raw message
drivers/video/exynos_mipi_dsi_lowlevel.h new file +111 -0
111 lines not on this page · raw message
drivers/video/s6e8ax0.c new file +289 -0
289 lines not on this page · raw message
include/lcd.h +1 -0
@@ -230,6 +230,7 @@ typedef struct vidinfo {unsigned int power_on_delay;unsigned int reset_delay;unsigned int interface_mode; +unsigned int mipi_enabled;unsigned int cs_setup;unsigned int wr_setup;unsigned int wr_act;
Signature · 1 line
1.7.4.1