-From 5a4331bf757fdec0ceb72bf40f7e46ce5c404e2d Mon Sep 17 00:00:00 2001
+From 04b4d27af34373bbb65df19c2c084f117fe54213 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
-Date: Tue, 11 Nov 2008 13:52:25 +0200
+Date: Thu, 13 Nov 2008 15:38:15 +0200
Subject: [PATCH] DSS: New display subsystem driver for OMAP2/3
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
arch/arm/plat-omap/dss/dispc.c | 1720 ++++++++++++++++
arch/arm/plat-omap/dss/display.c | 775 ++++++++
arch/arm/plat-omap/dss/dpi.c | 323 +++
- arch/arm/plat-omap/dss/dsi.c | 3022 +++++++++++++++++++++++++++++
- arch/arm/plat-omap/dss/dss.c | 547 ++++++
+ arch/arm/plat-omap/dss/dsi.c | 3020 +++++++++++++++++++++++++++++
+ arch/arm/plat-omap/dss/dss.c | 554 ++++++
arch/arm/plat-omap/dss/dss.h | 254 +++
arch/arm/plat-omap/dss/rfbi.c | 1234 ++++++++++++
arch/arm/plat-omap/dss/sdi.c | 157 ++
arch/arm/plat-omap/dss/venc.c | 515 +++++
arch/arm/plat-omap/include/mach/display.h | 458 +++++
- 14 files changed, 9081 insertions(+), 0 deletions(-)
+ 14 files changed, 9086 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/plat-omap/dss/Kconfig
create mode 100644 arch/arm/plat-omap/dss/Makefile
create mode 100644 arch/arm/plat-omap/dss/dispc.c
+
diff --git a/arch/arm/plat-omap/dss/dsi.c b/arch/arm/plat-omap/dss/dsi.c
new file mode 100644
-index 0000000..980be39
+index 0000000..9f31ac3
--- /dev/null
+++ b/arch/arm/plat-omap/dss/dsi.c
-@@ -0,0 +1,3022 @@
+@@ -0,0 +1,3020 @@
+/*
+ * linux/arch/arm/plat-omap/dss/dsi.c
+ *
+ continue;
+
+ if (min_fck_per_pck &&
-+ cur.dispc_fck < req_pck * min_fck_per_pck)
++ cur.dispc_fck <
++ req_pck * min_fck_per_pck)
+ continue;
+
+ match = 1;
+ cur.lck = cur.dispc_fck / cur.lck_div;
+ cur.pck = cur.lck / cur.pck_div;
+
-+ if (abs(cur.pck - req_pck) < abs(best.pck - req_pck)) {
++ if (abs(cur.pck - req_pck) <
++ abs(best.pck - req_pck)) {
+ best = cur;
+
+ if (cur.pck == req_pck)
+ if (display->ctrl && display->ctrl->disable)
+ display->ctrl->disable(display);
+
-+ /* XXX sleep a bit to make sure all DSI buffers are sent.
-+ * We should check it from somewhere, fifo fullness I guess */
-+ msleep(200);
-+
+ dsi_complexio_uninit();
+ dsi_pll_uninit();
+
+
diff --git a/arch/arm/plat-omap/dss/dss.c b/arch/arm/plat-omap/dss/dss.c
new file mode 100644
-index 0000000..da0364b
+index 0000000..8450ddd
--- /dev/null
+++ b/arch/arm/plat-omap/dss/dss.c
-@@ -0,0 +1,547 @@
+@@ -0,0 +1,554 @@
+/*
+ * linux/arch/arm/plat-omap/dss/dss.c
+ *
+
+ enable_dss_clocks();
+
++ /* We need to wait here a bit, otherwise we sometimes start to get
++ * synclost errors. I believe we could wait for one framedone or
++ * perhaps vsync interrupt, but, because dispc is not initialized yet,
++ * we don't have access to the irq register.
++ */
++ msleep(40);
++
+ _omap_dss_reset();
+
+ /* autoidle */
-From 54f114db20a45e99389bec9c3c630c76f3e6c043 Mon Sep 17 00:00:00 2001
+From adf1ac7680926ca94f1b36ae8c643f74c8a47253 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Fri, 7 Nov 2008 16:54:01 +0200
Subject: [PATCH] DSS: BEAGLE: Enable DSS in beagle defconfig
---
- arch/arm/configs/omap3_beagle_defconfig | 143 ++++++++++++++++++++++---------
- 1 files changed, 103 insertions(+), 40 deletions(-)
+ arch/arm/configs/omap3_beagle_defconfig | 149 +++++++++++++++++++++----------
+ 1 files changed, 102 insertions(+), 47 deletions(-)
diff --git a/arch/arm/configs/omap3_beagle_defconfig b/arch/arm/configs/omap3_beagle_defconfig
-index df67296..5036233 100644
+index df67296..aa3ee12 100644
--- a/arch/arm/configs/omap3_beagle_defconfig
+++ b/arch/arm/configs/omap3_beagle_defconfig
@@ -1,7 +1,7 @@
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.27-omap1
-# Fri Oct 17 14:05:39 2008
-+# Linux kernel version: 2.6.28-rc3-omap1
-+# Tue Nov 11 14:30:05 2008
++# Linux kernel version: 2.6.28-rc4-omap1
++# Thu Nov 13 15:51:03 2008
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
#
# TI OMAP Implementations
-@@ -200,17 +194,27 @@ CONFIG_OMAP_DM_TIMER=y
+@@ -200,6 +194,14 @@ CONFIG_OMAP_DM_TIMER=y
# CONFIG_OMAP_LL_DEBUG_UART1 is not set
# CONFIG_OMAP_LL_DEBUG_UART2 is not set
CONFIG_OMAP_LL_DEBUG_UART3=y
CONFIG_ARCH_OMAP34XX=y
CONFIG_ARCH_OMAP3430=y
- #
- # OMAP Board Type
- #
-+# CONFIG_MACH_NOKIA_DFL61 is not set
- # CONFIG_MACH_OMAP_LDP is not set
- # CONFIG_MACH_OMAP_3430SDP is not set
+@@ -211,6 +213,7 @@ CONFIG_ARCH_OMAP3430=y
# CONFIG_MACH_OMAP3EVM is not set
CONFIG_MACH_OMAP3_BEAGLE=y
# CONFIG_MACH_OVERO is not set
CONFIG_OMAP_TICK_GPTIMER=12
#
-@@ -263,26 +267,30 @@ CONFIG_TICK_ONESHOT=y
+@@ -263,26 +266,30 @@ CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
# CONFIG_LEDS is not set
CONFIG_ALIGNMENT_TRAP=y
-@@ -296,9 +304,10 @@ CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.16
+@@ -296,9 +303,10 @@ CONFIG_CMDLINE="root=/dev/nfs nfsroot=192.168.0.1:/home/user/buildroot ip=192.16
# CONFIG_KEXEC is not set
#
#
# Floating point emulation
-@@ -318,6 +327,8 @@ CONFIG_VFPv3=y
+@@ -318,6 +326,8 @@ CONFIG_VFPv3=y
# Userspace binary formats
#
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_MISC=y
-@@ -379,6 +390,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
+@@ -379,6 +389,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
-@@ -399,11 +411,10 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
+@@ -399,11 +410,10 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
# CONFIG_WIRELESS_EXT is not set
# CONFIG_MAC80211 is not set
# CONFIG_IEEE80211 is not set
-@@ -490,6 +501,7 @@ CONFIG_MTD_NAND=y
+@@ -490,6 +500,7 @@ CONFIG_MTD_NAND=y
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
# CONFIG_MTD_NAND_ECC_SMC is not set
# CONFIG_MTD_NAND_MUSEUM_IDS is not set
CONFIG_MTD_NAND_OMAP2=y
CONFIG_MTD_NAND_IDS=y
# CONFIG_MTD_NAND_DISKONCHIP is not set
-@@ -743,6 +755,8 @@ CONFIG_GPIO_TWL4030=y
+@@ -743,6 +754,8 @@ CONFIG_GPIO_TWL4030=y
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
# CONFIG_HWMON is not set
# CONFIG_WATCHDOG is not set
#
-@@ -760,10 +774,14 @@ CONFIG_SSB_POSSIBLE=y
+@@ -760,10 +773,14 @@ CONFIG_SSB_POSSIBLE=y
# CONFIG_HTC_EGPIO is not set
# CONFIG_HTC_PASIC3 is not set
CONFIG_TWL4030_CORE=y
#
# Multimedia devices
-@@ -790,6 +808,7 @@ CONFIG_DAB=y
+@@ -790,6 +807,7 @@ CONFIG_DAB=y
CONFIG_FB=y
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB_DDC is not set
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_COPYAREA=y
CONFIG_FB_CFB_IMAGEBLIT=y
-@@ -810,10 +829,22 @@ CONFIG_FB_CFB_IMAGEBLIT=y
+@@ -810,10 +828,22 @@ CONFIG_FB_CFB_IMAGEBLIT=y
#
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_VIRTUAL is not set
-# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
-CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=4
+# CONFIG_FB_METRONOME is not set
++# CONFIG_FB_MB862XX is not set
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14
+CONFIG_FB_OMAP2=y
+# CONFIG_FB_OMAP2_DEBUG is not set
+CONFIG_PANEL_DVI_HIGHRES=y
+# CONFIG_PANEL_DVI_VERYHIGHRES is not set
+# CONFIG_PANEL_SDP3430 is not set
-+# CONFIG_PANEL_NEVADA is not set
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
#
-@@ -862,6 +893,8 @@ CONFIG_USB_OTG=y
+@@ -862,6 +892,8 @@ CONFIG_USB_OTG=y
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
CONFIG_USB_MON=y
#
# USB Host Controller Drivers
-@@ -873,6 +906,7 @@ CONFIG_USB_MON=y
+@@ -873,6 +905,7 @@ CONFIG_USB_MON=y
# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_SOC=y
-@@ -895,6 +929,7 @@ CONFIG_USB_INVENTRA_DMA=y
+@@ -895,6 +928,7 @@ CONFIG_USB_INVENTRA_DMA=y
# CONFIG_USB_ACM is not set
# CONFIG_USB_PRINTER is not set
# CONFIG_USB_WDM is not set
#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
-@@ -923,6 +958,7 @@ CONFIG_USB_INVENTRA_DMA=y
+@@ -923,6 +957,7 @@ CONFIG_USB_INVENTRA_DMA=y
# CONFIG_USB_EMI62 is not set
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_ADUTUX is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_LEGOTOWER is not set
# CONFIG_USB_LCD is not set
-@@ -939,22 +975,25 @@ CONFIG_USB_INVENTRA_DMA=y
+@@ -939,22 +974,25 @@ CONFIG_USB_INVENTRA_DMA=y
# CONFIG_USB_IOWARRIOR is not set
# CONFIG_USB_TEST is not set
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_GADGET_DUMMY_HCD is not set
CONFIG_USB_GADGET_DUALSPEED=y
# CONFIG_USB_ZERO is not set
-@@ -971,7 +1010,7 @@ CONFIG_MMC=y
+@@ -971,7 +1009,7 @@ CONFIG_MMC=y
# CONFIG_MMC_UNSAFE_RESUME is not set
#
#
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_BOUNCE=y
-@@ -979,10 +1018,12 @@ CONFIG_MMC_BLOCK_BOUNCE=y
+@@ -979,10 +1017,12 @@ CONFIG_MMC_BLOCK_BOUNCE=y
# CONFIG_MMC_TEST is not set
#
# CONFIG_NEW_LEDS is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
-@@ -1024,12 +1065,15 @@ CONFIG_RTC_DRV_TWL4030=y
+@@ -1024,26 +1064,22 @@ CONFIG_RTC_DRV_TWL4030=y
# Platform RTC drivers
#
# CONFIG_RTC_DRV_CMOS is not set
# CONFIG_RTC_DRV_V3020 is not set
#
-@@ -1059,11 +1103,12 @@ CONFIG_EXT2_FS=y
+ # on-CPU RTC drivers
+ #
+ # CONFIG_DMADEVICES is not set
+-
+-#
+-# Voltage and Current regulators
+-#
+ # CONFIG_REGULATOR is not set
+-# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+-# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+-# CONFIG_REGULATOR_BQ24022 is not set
+ # CONFIG_UIO is not set
+
+ #
+@@ -1059,11 +1095,12 @@ CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XIP is not set
CONFIG_EXT3_FS=y
# CONFIG_EXT3_FS_XATTR is not set
# CONFIG_XFS_FS is not set
# CONFIG_OCFS2_FS is not set
CONFIG_DNOTIFY=y
-@@ -1100,6 +1145,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+@@ -1100,6 +1137,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
#
CONFIG_PROC_FS=y
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
-@@ -1148,6 +1194,7 @@ CONFIG_LOCKD_V4=y
+@@ -1148,6 +1186,7 @@ CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_RPCSEC_GSS_KRB5=y
# CONFIG_RPCSEC_GSS_SPKM3 is not set
# CONFIG_SMB_FS is not set
-@@ -1260,15 +1307,23 @@ CONFIG_DEBUG_INFO=y
+@@ -1260,15 +1299,23 @@ CONFIG_DEBUG_INFO=y
CONFIG_FRAME_POINTER=y
# CONFIG_BOOT_PRINTK_DELAY is not set
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
-@@ -1282,14 +1337,19 @@ CONFIG_HAVE_ARCH_KGDB=y
+@@ -1282,14 +1329,19 @@ CONFIG_HAVE_ARCH_KGDB=y
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set
CONFIG_CRYPTO_MANAGER=y
# CONFIG_CRYPTO_GF128MUL is not set
# CONFIG_CRYPTO_NULL is not set
-@@ -1362,14 +1422,17 @@ CONFIG_CRYPTO_DES=y
+@@ -1362,14 +1414,17 @@ CONFIG_CRYPTO_DES=y
#
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_LZO is not set