summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/st/u8500/mcde_display.c4
-rw-r--r--board/st/u8500/mcde_display.h2
-rw-r--r--board/st/u8500/mcde_display_dsi.c35
-rw-r--r--board/st/u8500/u8500.c62
-rw-r--r--include/configs/u8500.h1
5 files changed, 64 insertions, 40 deletions
diff --git a/board/st/u8500/mcde_display.c b/board/st/u8500/mcde_display.c
index 9c738fac4..1e1ec51f6 100644
--- a/board/st/u8500/mcde_display.c
+++ b/board/st/u8500/mcde_display.c
@@ -13,7 +13,6 @@
#include <asm/arch/common.h>
#include <asm/arch/ab8500.h>
#include <linux/err.h>
-#include <tc35892.h> /* Needed for DSI, to be removed */
#include "mcde.h"
#include "mcde_regs.h"
#include "mcde_display.h"
@@ -38,8 +37,7 @@ static struct mcde_port port0 = {
};
struct mcde_display_generic_platform_data main_display_data = {
- .reset_gpio = TC35892_PIN_KPY7,
- .reset_delay = 10,
+ .reset_delay = CONFIG_SYS_DISPLAY_RST_DELAY,
};
struct mcde_platform_data platform_data = {
diff --git a/board/st/u8500/mcde_display.h b/board/st/u8500/mcde_display.h
index 25f74eb1e..04f61dcd3 100644
--- a/board/st/u8500/mcde_display.h
+++ b/board/st/u8500/mcde_display.h
@@ -13,6 +13,8 @@
#include "mcde.h"
extern int cpu_is_u8500v11(void);
+/* Board dependent code. Implemented in <board>.c */
+extern int board_mcde_display_reset(void);
struct mcde_display_generic_platform_data {
/* Platform info */
diff --git a/board/st/u8500/mcde_display_dsi.c b/board/st/u8500/mcde_display_dsi.c
index 30186eb2b..8870c9675 100644
--- a/board/st/u8500/mcde_display_dsi.c
+++ b/board/st/u8500/mcde_display_dsi.c
@@ -13,43 +13,12 @@
#include <asm/arch/common.h>
#include "mcde_display.h"
#include "dsilink_regs.h"
-#include <tc35892.h>
#include "mcde_regs.h"
#include <malloc.h>
#include "mcde.h"
#include <linux/err.h>
#include <asm/arch/ab8500.h>
-static int mcde_enable_gpio(void)
-{
- int ret;
-
- debug("%s: enter\n", __func__);
-
- /* Only main display should be initialized */
- ret = tc35892_gpio_dir(CONFIG_SYS_I2C_GPIOE_ADDR,
- main_display_data.reset_gpio, 1);
- if (ret) {
- printf("%s:Could not set direction for gpio\n", __func__);
- return -EINVAL;
- }
- ret = tc35892_gpio_set(CONFIG_SYS_I2C_GPIOE_ADDR,
- main_display_data.reset_gpio, 0);
- if (ret) {
- printf("%s:Could reset gpio\n", __func__);
- return -EINVAL;
- }
- mdelay(main_display_data.reset_delay);
- ret = tc35892_gpio_set(CONFIG_SYS_I2C_GPIOE_ADDR,
- main_display_data.reset_gpio, 1);
- if (ret) {
- printf("%s:Could set gpio\n", __func__);
- return -EINVAL;
- }
- mdelay(main_display_data.reset_delay);
- return 0;
-}
-
#define DCS_CMD_EXIT_SLEEP_MODE 0x11
#define DCS_CMD_SET_DISPLAY_ON 0x29
@@ -259,9 +228,9 @@ int mcde_startup_dsi(struct mcde_platform_data *pdata)
return ret;
}
- ret = mcde_enable_gpio();
+ ret = board_mcde_display_reset();
if (ret) {
- printf("%s: mcde_enable_gpio() -> %d\n", __func__, ret);
+ printf("%s: board_mcde_display_reset() -> %d\n", __func__, ret);
return ret;
}
diff --git a/board/st/u8500/u8500.c b/board/st/u8500/u8500.c
index 8b4609bf5..019d3fef4 100644
--- a/board/st/u8500/u8500.c
+++ b/board/st/u8500/u8500.c
@@ -136,7 +136,11 @@ pin_cfg_t gpio_cfg_hrefv60[] = {
GPIO66_GPIO | PIN_OUTPUT_LOW, /* DISP2 RST */
};
-int board_id; /* set in board_late_init() */
+#define BOARD_ID_MOP500 0
+#define BOARD_ID_HREF 1
+#define BOARD_ID_HREFV60 2
+int board_id; /* set in probe_href() */
+
int errno;
#ifdef CONFIG_VIDEO_LOGO
@@ -235,6 +239,56 @@ int dram_init(void)
}
#ifdef CONFIG_VIDEO_LOGO
+
+#if CONFIG_SYS_DISPLAY_DSI
+static int mcde_display_reset_gpioe(void)
+{
+ int ret;
+
+ /* Only main display should be initialized */
+ ret = tc35892_gpio_dir(CONFIG_SYS_I2C_GPIOE_ADDR,
+ TC35892_PIN_KPY7, 1);
+ if (ret) {
+ printf("%s:Could not set direction for gpio\n", __func__);
+ return -EINVAL;
+ }
+ ret = tc35892_gpio_set(CONFIG_SYS_I2C_GPIOE_ADDR,
+ TC35892_PIN_KPY7, 0);
+ if (ret) {
+ printf("%s:Could reset gpio\n", __func__);
+ return -EINVAL;
+ }
+ mdelay(main_display_data.reset_delay);
+ ret = tc35892_gpio_set(CONFIG_SYS_I2C_GPIOE_ADDR,
+ TC35892_PIN_KPY7, 1);
+ if (ret) {
+ printf("%s:Could set gpio\n", __func__);
+ return -EINVAL;
+ }
+ mdelay(main_display_data.reset_delay);
+
+ return ret;
+}
+
+/*
+ * Reset the primary display - called from mcde driver.
+ */
+int board_mcde_display_reset(void)
+{
+ int ret = 0;
+
+ if (board_id >= BOARD_ID_HREFV60) {
+ db8500_gpio_set_output(GPIO65_GPIO, 0); /* DISP1 reset */
+ mdelay(main_display_data.reset_delay);
+ db8500_gpio_set_output(GPIO65_GPIO, 1);
+ mdelay(main_display_data.reset_delay);
+ } else
+ ret = mcde_display_reset_gpioe();
+
+ return ret;
+}
+#endif /* CONFIG_SYS_DISPLAY_DSI */
+
static int dss_init(void)
{
puts("\nMCDE: ");
@@ -281,9 +335,9 @@ static void probe_href(void)
(void) i2c_set_bus_num(0);
if (!i2c_read(CONFIG_SYS_I2C_GPIOE_ADDR, 0x80, 1, &byte, 1)) {
if (byte == 0x01)
- board_id = 0;
+ board_id = BOARD_ID_MOP500;
else
- board_id = 1;
+ board_id = BOARD_ID_HREF;
} else
/* No GPIOE => HREF+ 2.0 V60 or later */
gd->bd->bi_arch_number = MACH_TYPE_HREFV60;
@@ -292,7 +346,7 @@ static void probe_href(void)
if (gd->bd->bi_arch_number == MACH_TYPE_HREFV60) {
db8500_gpio_config_pins(gpio_cfg_hrefv60,
ARRAY_SIZE(gpio_cfg_hrefv60));
- board_id = 2;
+ board_id = BOARD_ID_HREFV60;
}
}
diff --git a/include/configs/u8500.h b/include/configs/u8500.h
index db48a51de..caa31b9eb 100644
--- a/include/configs/u8500.h
+++ b/include/configs/u8500.h
@@ -291,6 +291,7 @@
#define CONFIG_SYS_DISPLAY_NATIVE_X_RES 640 /* VGA */
#else
#define CONFIG_SYS_DISPLAY_NATIVE_X_RES 864 /* HREF */
+#define CONFIG_SYS_DISPLAY_RST_DELAY 10 /* ms */
#endif
#define CONFIG_SYS_DISPLAY_NATIVE_Y_RES 480 /* VGA + HREF */
/* 2.5V */