[PATCH] linux_3.0: Add BeagleBoardToys ULCD support for BeagleBoard

201 views
Skip to first unread message

Jason Kridner

unread,
Aug 9, 2011, 3:02:03 PM8/9/11
to beagl...@googlegroups.com, Jason Kridner, Koen Kooi, Roger Monk, Joel A Fernandes
This is a patch for meta-texasinstruments in attempt to add support for the BeagleBoardToys ULCD board to the
BeagleBoard. For now, I just want to get something in the kernel everyone can use for display purposes. We
can add the touchscreen later.

Tasks remaining:
* Needs basic testing.
* Needs to be submitted to openembedded-core list for inclusion in meta-ti (if it doesn't break anything).
* Use some dynamic identification, such as an 'lcd=' line or usage of the EDID or expansion EEPROM.
* Needs upstream kernel submission.
* Add touch support.

Cc: Koen Kooi <ko...@dominion.thruhere.net>
Cc: Roger Monk <r-m...@ti.com>
Cc: Joel A Fernandes <agnel...@gmail.com>

---
.../linux/linux-3.0/beagleboard/defconfig | 1 +
...ays-Add-support-for-ThreeFiveCorp-S9700-D.patch | 171 ++++++++++++++++++++
.../ulcd/0001-omap3-beagle-added-lcd-driver.patch | 72 ++++++++
recipes-kernel/linux/linux_3.0.bb | 4 +
4 files changed, 248 insertions(+), 0 deletions(-)
create mode 100644 recipes-kernel/linux/linux-3.0/ulcd/0001-omap2-displays-Add-support-for-ThreeFiveCorp-S9700-D.patch
create mode 100644 recipes-kernel/linux/linux-3.0/ulcd/0001-omap3-beagle-added-lcd-driver.patch

diff --git a/recipes-kernel/linux/linux-3.0/beagleboard/defconfig b/recipes-kernel/linux/linux-3.0/beagleboard/defconfig
index 1942725..94a7147 100644
--- a/recipes-kernel/linux/linux-3.0/beagleboard/defconfig
+++ b/recipes-kernel/linux/linux-3.0/beagleboard/defconfig
@@ -2384,6 +2384,7 @@ CONFIG_PANEL_GENERIC_DPI=y
# CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set
CONFIG_PANEL_SHARP_LS037V7DW01=y
CONFIG_PANEL_NEC_NL8048HL11_01B=y
+CONFIG_PANEL_TFCS9700RTWV35TR01B=y
# CONFIG_PANEL_TAAL is not set
CONFIG_PANEL_TPO_TD043MTEA1=m
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
diff --git a/recipes-kernel/linux/linux-3.0/ulcd/0001-omap2-displays-Add-support-for-ThreeFiveCorp-S9700-D.patch b/recipes-kernel/linux/linux-3.0/ulcd/0001-omap2-displays-Add-support-for-ThreeFiveCorp-S9700-D.patch
new file mode 100644
index 0000000..2eebb7a
--- /dev/null
+++ b/recipes-kernel/linux/linux-3.0/ulcd/0001-omap2-displays-Add-support-for-ThreeFiveCorp-S9700-D.patch
@@ -0,0 +1,171 @@
+From fd6066706db91dfbae305fbfb287f1506dc6da4e Mon Sep 17 00:00:00 2001
+From: Roger Monk <r-m...@ti.com>
+Date: Mon, 18 Jul 2011 12:21:18 +0100
+Subject: [PATCH 1/3] omap2-displays: Add support for ThreeFiveCorp S9700 Display
+
+ * Add support for s9700rtwv35tr01b display panel
+ * This is used on BeagleBoardToys ULCD/-lite daugtercards
+
+Signed-off-by: Roger Monk <r-m...@ti.com>
+---
+ drivers/video/omap2/displays/Kconfig | 6 +
+ drivers/video/omap2/displays/Makefile | 2 +-
+ .../omap2/displays/panel-tfc-s9700rtwv35tr01b.c | 118 ++++++++++++++++++++
+ 3 files changed, 125 insertions(+), 1 deletions(-)
+ create mode 100644 drivers/video/omap2/displays/panel-tfc-s9700rtwv35tr01b.c
+
+diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
+index 875250a..79be0a2 100644
+--- a/drivers/video/omap2/displays/Kconfig
++++ b/drivers/video/omap2/displays/Kconfig
+@@ -31,6 +31,12 @@ config PANEL_SHARP_LQ043T1DG01
+ help
+ LCD Panel used in TI's OMAP3517 EVM boards
+
++config PANEL_TFCS9700RTWV35TR01B
++ tristate "TFC S9700RTWV35TR01B"
++ depends on OMAP2_DSS
++ help
++ LCD Panel used on BeagleboardToys 800x480 LCD Expansion Module
++
+ config PANEL_TAAL
+ tristate "Taal DSI Panel"
+ depends on OMAP2_DSS_DSI
+diff --git a/drivers/video/omap2/displays/Makefile b/drivers/video/omap2/displays/Makefile
+index f8e6c52..5010474 100644
+--- a/drivers/video/omap2/displays/Makefile
++++ b/drivers/video/omap2/displays/Makefile
+@@ -3,5 +3,5 @@ obj-$(CONFIG_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o
+ obj-$(CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C) += panel-samsung-lte430wq-f0c.o
+ obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
+ obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
+-
++obj-$(CONFIG_PANEL_TFCS9700RTWV35TR01B) += panel-tfc-s9700rtwv35tr01b.o
+ obj-$(CONFIG_PANEL_TAAL) += panel-taal.o
+diff --git a/drivers/video/omap2/displays/panel-tfc-s9700rtwv35tr01b.c b/drivers/video/omap2/displays/panel-tfc-s9700rtwv35tr01b.c
+new file mode 100644
+index 0000000..796393d
+--- /dev/null
++++ b/drivers/video/omap2/displays/panel-tfc-s9700rtwv35tr01b.c
+@@ -0,0 +1,118 @@
++/*
++ * LCD panel driver for TFC S9700RTWV35TR-01B
++ *
++ * Copyright (C) 2011 Texas Instruments Inc
++ * Author: Roger Monk <r-m...@ti.com>
++ * From Original by : Vaibhav Hiremath <hvai...@ti.com>
++ *
++ * 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.
++ *
++ * 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, see <http://www.gnu.org/licenses/>.
++ */
++
++#include <linux/module.h>
++#include <linux/delay.h>
++#include <linux/device.h>
++#include <linux/err.h>
++
++#include <plat/display.h>
++
++static struct omap_video_timings tfc_timings = {
++ .x_res = 800,
++ .y_res = 480,
++
++ .pixel_clock = 30000,
++
++ .hsw = 49,
++ .hfp = 41,
++ .hbp = 40,
++
++ .vsw = 4,
++ .vfp = 14,
++ .vbp = 29,
++};
++
++static int tfc_panel_probe(struct omap_dss_device *dssdev)
++{
++ dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
++ OMAP_DSS_LCD_IHS; // | OMAP_DSS_LCD_IEO; - TODO check this - doesn't work with this enabled
++ dssdev->panel.acb = 0x0;
++ dssdev->panel.timings = tfc_timings;
++
++ return 0;
++}
++
++static void tfc_panel_remove(struct omap_dss_device *dssdev)
++{
++}
++
++static int tfc_panel_enable(struct omap_dss_device *dssdev)
++{
++ int r = 0;
++
++ /* wait couple of vsyncs until enabling the LCD */
++ msleep(50);
++
++ if (dssdev->platform_enable)
++ r = dssdev->platform_enable(dssdev);
++
++ return r;
++}
++
++static void tfc_panel_disable(struct omap_dss_device *dssdev)
++{
++ if (dssdev->platform_disable)
++ dssdev->platform_disable(dssdev);
++
++ /* wait at least 5 vsyncs after disabling the LCD */
++
++ msleep(100);
++}
++
++static int tfc_panel_suspend(struct omap_dss_device *dssdev)
++{
++ tfc_panel_disable(dssdev);
++ return 0;
++}
++
++static int tfc_panel_resume(struct omap_dss_device *dssdev)
++{
++ return tfc_panel_enable(dssdev);
++}
++
++static struct omap_dss_driver tfc_s9700_driver = {
++ .probe = tfc_panel_probe,
++ .remove = tfc_panel_remove,
++
++ .enable = tfc_panel_enable,
++ .disable = tfc_panel_disable,
++ .suspend = tfc_panel_suspend,
++ .resume = tfc_panel_resume,
++
++ .driver = {
++ .name = "tfc_s9700_panel",
++ .owner = THIS_MODULE,
++ },
++};
++
++static int __init tfc_panel_drv_init(void)
++{
++ return omap_dss_register_driver(&tfc_s9700_driver);
++}
++
++static void __exit tfc_panel_drv_exit(void)
++{
++ omap_dss_unregister_driver(&tfc_s9700_driver);
++}
++
++module_init(tfc_panel_drv_init);
++module_exit(tfc_panel_drv_exit);
++MODULE_LICENSE("GPL");
+--
+1.7.0.4
+
diff --git a/recipes-kernel/linux/linux-3.0/ulcd/0001-omap3-beagle-added-lcd-driver.patch b/recipes-kernel/linux/linux-3.0/ulcd/0001-omap3-beagle-added-lcd-driver.patch
new file mode 100644
index 0000000..0e91dfa
--- /dev/null
+++ b/recipes-kernel/linux/linux-3.0/ulcd/0001-omap3-beagle-added-lcd-driver.patch
@@ -0,0 +1,72 @@
+From 12d2ade903189cd9438835ae14e08212eb2291b5 Mon Sep 17 00:00:00 2001
+From: Jason Kridner <jkri...@beagleboard.org>
+Date: Fri, 5 Aug 2011 18:07:09 +0000
+Subject: [PATCH] omap3: beagle: added lcd driver
+
+This enables the tfc_s9700_panel by default. Needs to be extended to
+redefine the driver name at boot time.
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 25 +++++++++++++++++++++++++
+ 1 files changed, 25 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 32f5f89..a72808c 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -83,11 +83,13 @@ static struct {
+ int usb_pwr_level;
+ int reset_gpio;
+ int usr_button_gpio;
++ char *lcd_driver_name;
+ } beagle_config = {
+ .mmc1_gpio_wp = -EINVAL,
+ .usb_pwr_level = GPIOF_OUT_INIT_LOW,
+ .reset_gpio = 129,
+ .usr_button_gpio = 4,
++ .lcd_driver_name = "",
+ };
+
+ static struct gpio omap3_beagle_rev_gpios[] __initdata = {
+@@ -225,9 +227,28 @@ static struct omap_dss_device beagle_tv_device = {
+ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
+ };
+
++static int beagle_enable_lcd(struct omap_dss_device *dssdev)
++{
++ return 0;
++}
++
++static int beagle_disable_lcd(struct omap_dss_device *dssdev)
++{
++}
++
++static struct omap_dss_device beagle_lcd_device = {
++ .name = "lcd",
++ .driver_name = "",
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .phy.dpi.data_lines = 24,
++ .platform_enable = beagle_enable_lcd,
++ .platform_disable = beagle_disable_lcd,
++};
++
+ static struct omap_dss_device *beagle_dss_devices[] = {
+ &beagle_dvi_device,
+ &beagle_tv_device,
++ &beagle_lcd_device,
+ };
+
+ static struct omap_dss_board_info beagle_dss_data = {
+@@ -533,6 +554,10 @@ static void __init omap3_beagle_init(void)
+
+ gpio_buttons[0].gpio = beagle_config.usr_button_gpio;
+
++ /* TODO: set lcd_driver_name by command line or device tree */
++ beagle_config.lcd_driver_name = "tfc_s9700_panel";
++ beagle_lcd_device.driver_name = beagle_config.lcd_driver_name;
++
+ platform_add_devices(omap3_beagle_devices,
+ ARRAY_SIZE(omap3_beagle_devices));
+ omap_display_init(&beagle_dss_data);
+--
+1.7.3.4
+
diff --git a/recipes-kernel/linux/linux_3.0.bb b/recipes-kernel/linux/linux_3.0.bb
index edb8df7..a75bb6a 100644
--- a/recipes-kernel/linux/linux_3.0.bb
+++ b/recipes-kernel/linux/linux_3.0.bb
@@ -214,6 +214,10 @@ SRC_URI += "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-3.0.y.git
file://sakoman/0013-omap-mmc-twl4030-move-clock-input-selection-prior-to.patch \
\
file://sgx/0001-ARM-L2-Add-and-export-outer_clean_all.patch \
+ \
+ file://ulcd/0001-omap2-displays-Add-support-for-ThreeFiveCorp-S9700-D.patch \
+ file://ulcd/0001-omap3-beagle-added-lcd-driver.patch \
+ \
file://defconfig"

SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
--
1.7.3.4

Jason Kridner

unread,
Aug 9, 2011, 3:46:09 PM8/9/11
to beagl...@googlegroups.com, Jason Kridner, Koen Kooi, Roger Monk, Joel A Fernandes
On Tue, Aug 9, 2011 at 3:02 PM, Jason Kridner <jkri...@beagleboard.org> wrote:
> This is a patch for meta-texasinstruments in attempt to add support for the BeagleBoardToys ULCD board to the
> BeagleBoard.  For now, I just want to get something in the kernel everyone can use for display purposes.  We
> can add the touchscreen later.
>
> Tasks remaining:
> * Needs basic testing.
> * Needs to be submitted to openembedded-core list for inclusion in meta-ti (if it doesn't break anything).
> * Use some dynamic identification, such as an 'lcd=' line or usage of the EDID or expansion EEPROM.
> * Needs upstream kernel submission.

* Add uenv.txt/user.txt entries that provide the start-up for the LCD.
* Add support in u-boot.

Joel A Fernandes

unread,
Aug 16, 2011, 2:33:02 AM8/16/11
to Jason Kridner, beagl...@googlegroups.com, Koen Kooi, Roger Monk
Hi Jason,

I tried this patch with the 3.0.1 kernel I built and your u-boot
params with a BBT ULCD and BB xM Rev C

- I had to modify the path to the header file for it to build [1]

- fbset does give non-zero values with 3.0.1 + the BBT ULCD patch
root@beagleboard:~# fbset

mode "800x480-60"
# D: 28.800 MHz, H: 30.000 kHz, V: 60.484 Hz
geometry 800 480 800 480 32
timings 34722 80 48 3 6 32 7
accel false
rgba 8/16,8/8,8/0,0/0
endmode

- I get a light blue screen displayed with 25% of the right side in
white. Is this the same symptom you're seeing with kernel 3.0?

- only difference I can see so far is that since 2.6.32, omap dss was
rewritten as omap dss2 adding more features, maybe something could
have been added to this layer that broke support (?).

Thanks,
Joel

[1] https://github.com/joelagnel/linux-omap-2.6/commit/3b5b7c0313668eb3d48516775a5efa160e46a74d

Reply all
Reply to author
Forward
0 new messages