aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBuddy Liong2018-03-29 16:27:50 -0500
committerBuddy Liong2018-04-06 12:05:57 -0500
commit005ed96568be0cca0ab0068ee29e2d03acece3f9 (patch)
treec5fcef6ba43a96dcc1dbca9596f12ddf5a7a999e
parented47cd5eb1a7bb97b7b445b73e070d0bce6bb9c5 (diff)
downloadu-boot-6AO.1.0-rvc.tar.gz
u-boot-6AO.1.0-rvc.tar.xz
u-boot-6AO.1.0-rvc.zip
RVC: Enabling TFP410 from u-boot for DRA76rvc-5.06AO.1.0-rvc
Signed-off-by: Buddy Liong <a0270631@ti.com>
-rw-r--r--board/ti/dra7xx/display.c77
-rw-r--r--board/ti/dra7xx/display.h1
2 files changed, 50 insertions, 28 deletions
diff --git a/board/ti/dra7xx/display.c b/board/ti/dra7xx/display.c
index 4098815651..1fe5d60200 100644
--- a/board/ti/dra7xx/display.c
+++ b/board/ti/dra7xx/display.c
@@ -14,6 +14,8 @@
14#include "display.h" 14#include "display.h"
15#include "../common/board_detect.h" 15#include "../common/board_detect.h"
16#include "regs.h" 16#include "regs.h"
17#include <asm/gpio.h>
18#include <asm/arch/gpio.h>
17 19
18/* Choose VID1 or VID3 for the DSS pipeline */ 20/* Choose VID1 or VID3 for the DSS pipeline */
19#define DISPC_MACRO(REGNAME) DISPC_VID3_##REGNAME 21#define DISPC_MACRO(REGNAME) DISPC_VID3_##REGNAME
@@ -26,6 +28,8 @@
26#define TLC59108_LEDOUT0 0x0c 28#define TLC59108_LEDOUT0 0x0c
27#define TLC59108_LEDOUT1 0x0d 29#define TLC59108_LEDOUT1 0x0d
28 30
31#define GPIO_CON_LCD_PWR_DN 65
32
29enum omap_dss_signal_level { 33enum omap_dss_signal_level {
30 OMAPDSS_SIG_ACTIVE_LOW, 34 OMAPDSS_SIG_ACTIVE_LOW,
31 OMAPDSS_SIG_ACTIVE_HIGH, 35 OMAPDSS_SIG_ACTIVE_HIGH,
@@ -427,27 +431,37 @@ void lcd_do_init_sequence(u32 lcd_type)
427 case LCD_TYPE_OSD_2045_10_INCH: 431 case LCD_TYPE_OSD_2045_10_INCH:
428 bdata = &tlc_osd_2045_10_inch_data; 432 bdata = &tlc_osd_2045_10_inch_data;
429 break; 433 break;
434 case LCD_TYPE_DVI_ADAPTER:
435 break;
430 default: 436 default:
431 printf("Unsupported LCD\n"); 437 printf("Unsupported LCD\n");
432 hang(); 438 hang();
433 } 439 }
434 init_seq = bdata->init_seq;
435 init_seq_len = bdata->init_seq_len;
436 for (i = 0; i < init_seq_len; i += 2) {
437 addr = init_seq[i];
438 data = init_seq[i+1];
439 i2c_write(TLC_I2C_ADDR, addr, 1, &data, 1);
440 }
441 440
442 if (lcd_type == LCD_TYPE_OSD_2045_10_INCH) { 441 if (lcd_type == LCD_TYPE_DVI_ADAPTER) {
443 buf[0] = 0; 442 debug("lcd_do_init_sequence for DVI adapter setting gpio \n");
444 buf[1] = 0; 443 // Turn on TP410
445 buf[2] = 0; 444 gpio_request(GPIO_CON_LCD_PWR_DN, "con_lcd_pwr_dn");
446 buf[3] = 0; 445 gpio_direction_output(GPIO_CON_LCD_PWR_DN, 0);
446 } else {
447 init_seq = bdata->init_seq;
448 init_seq_len = bdata->init_seq_len;
449 for (i = 0; i < init_seq_len; i += 2) {
450 addr = init_seq[i];
451 data = init_seq[i+1];
452 i2c_write(TLC_I2C_ADDR, addr, 1, &data, 1);
453 }
447 454
448 i2c_read(0x0E, 0x0000, 2, buf, 2); 455 if (lcd_type == LCD_TYPE_OSD_2045_10_INCH) {
449 debug("TC3587_CHIPID Read data 0x%02x 0x%02x 0x%02x 0x%02x\n", buf[0], buf[1], buf[2], buf[3]); 456 buf[0] = 0;
450 } 457 buf[1] = 0;
458 buf[2] = 0;
459 buf[3] = 0;
460
461 i2c_read(0x0E, 0x0000, 2, buf, 2);
462 debug("TC3587_CHIPID Read data 0x%02x 0x%02x 0x%02x 0x%02x\n", buf[0], buf[1], buf[2], buf[3]);
463 }
464 }
451 return; 465 return;
452} 466}
453 467
@@ -475,32 +489,32 @@ void setup_lcd_i2c(u32 lcd_type)
475 i2c_read(0x20, 0, 1, data, 2); 489 i2c_read(0x20, 0, 1, data, 2);
476 debug("IO_EXPANDER_1_I2C_ADDR Read data 0x%02x 0x%02x\n", data[0], data[1]); 490 debug("IO_EXPANDER_1_I2C_ADDR Read data 0x%02x 0x%02x\n", data[0], data[1]);
477 491
478
479 /* Clear P15 (CON_LCD_PWR_DN / MASTER_POWER_EN) to power up LCD */ 492 /* Clear P15 (CON_LCD_PWR_DN / MASTER_POWER_EN) to power up LCD */
480 /* Set I2C1 PCF857x@0x20 Set bit 13 to low */ 493 /* Set I2C1 PCF857x@0x20 Set bit 13 to low */
481 data[1] = data[1] & (~0x20); 494 data[1] = data[1] & (~0x20);
482 i2c_write(0x20, 0, 0, data, 2); 495 i2c_write(0x20, 0, 0, data, 2);
483 debug("Writing data 0x%02x 0x%02x\n", data[0], data[1]); 496 debug("Writing data 0x%02x 0x%02x\n", data[0], data[1]);
484 497
498#ifdef DEBUG
485 /* probe i2c device */ 499 /* probe i2c device */
486 while ((i2c_probe(I2C_LCD_ADDR) != 0) && (retry_count != 0)) { 500 while ((i2c_probe(I2C_LCD_ADDR) != 0) && (retry_count != 0)) {
487 retry_count--; 501 retry_count--;
488 printf("Waiting for LCD Power on\n"); 502 printf("Waiting for LCD Power on\n");
489 } 503 }
504
490 if (retry_count == 0) { 505 if (retry_count == 0) {
491 printf("LCD not powered on\n"); 506 printf("LCD not powered on\n");
492 return; 507 return;
493 } 508 }
494 509
495#ifdef DEBUG
496 data[0] = 0; 510 data[0] = 0;
497 data[1] = 0; 511 data[1] = 0;
498 i2c_read(0x20, 0, 0, data, 2); 512 i2c_read(0x20, 0, 0, data, 2);
499 debug("Read data 0x%02x 0x%02x\n", data[0], data[1]); 513 printf("Read data 0x%02x 0x%02x\n", data[0], data[1]);
500 514
501 data[0] = data[0] & (~0xA0); 515 data[0] = data[0] & (~0xA0);
502 i2c_write(0x20, 0, 0, data, 2); 516 i2c_write(0x20, 0, 0, data, 2);
503 debug("Setting LED 4 and 2 on using data 0x%02x 0x%02x\n", data[0], data[1]); 517 printf("Setting LED 4 and 2 on using data 0x%02x 0x%02x\n", data[0], data[1]);
504#endif 518#endif
505 519
506 if ((lcd_type == LCD_TYPE_AUO_10_INCH) || (lcd_type == LCD_TYPE_OSD_2045_10_INCH)) { 520 if ((lcd_type == LCD_TYPE_AUO_10_INCH) || (lcd_type == LCD_TYPE_OSD_2045_10_INCH)) {
@@ -594,7 +608,13 @@ void spl_setup_display(void)
594 u32 display_type = LCD_TYPE_10_INCH; 608 u32 display_type = LCD_TYPE_10_INCH;
595 609
596 if (board_ti_is("DRA76/7x")) { 610 if (board_ti_is("DRA76/7x")) {
597 debug("DRA76 EVM board, no display setup - HDMI \n"); 611 display_type = LCD_TYPE_DVI_ADAPTER;
612
613 // Enabling I2C3
614 debug("Enabling I2C3\n");
615 reg = __raw_readl(CM_L4PER_I2C3_CLKCTRL);
616 __raw_writel((reg & ~0x00000003)|0x2, CM_L4PER_I2C3_CLKCTRL);
617
598 } else { 618 } else {
599 if (board_ti_is("DRA79x,D")) { 619 if (board_ti_is("DRA79x,D")) {
600 debug("Board TI is DRA79x \n"); 620 debug("Board TI is DRA79x \n");
@@ -619,14 +639,15 @@ void spl_setup_display(void)
619 reg = __raw_readl(CM_L4PER_I2C4_CLKCTRL); 639 reg = __raw_readl(CM_L4PER_I2C4_CLKCTRL);
620 __raw_writel((reg & ~0x00000003)|0x2, CM_L4PER_I2C4_CLKCTRL); 640 __raw_writel((reg & ~0x00000003)|0x2, CM_L4PER_I2C4_CLKCTRL);
621 641
622 debug("Enabling LCD\n"); 642 }
623 setup_lcd_i2c(display_type); 643
644 debug("Enabling LCD\n");
645 setup_lcd_i2c(display_type);
624 646
625 /* Get the TLC59108 Running */ 647 /* Get the TLC59108 Running */
626 debug("Doing LCD Init sequence\n"); 648 debug("Doing LCD Init sequence\n");
627 lcd_do_init_sequence(display_type); 649 lcd_do_init_sequence(display_type);
628 650
629 if (display_type == LCD_TYPE_OSD_2045_10_INCH) 651 if (display_type == LCD_TYPE_OSD_2045_10_INCH)
630 Tc358778_lcdBridgeInit(0, TC3587_SLAVE_ADDR); 652 Tc358778_lcdBridgeInit(0, TC3587_SLAVE_ADDR);
631 }
632} 653}
diff --git a/board/ti/dra7xx/display.h b/board/ti/dra7xx/display.h
index 2cacacadcc..1ea3a5a58b 100644
--- a/board/ti/dra7xx/display.h
+++ b/board/ti/dra7xx/display.h
@@ -119,6 +119,7 @@ enum display_lcd_type {
119 LCD_TYPE_OSD_2045_10_INCH = 2, /* OSD 2045 panel 1920x1200 */ 119 LCD_TYPE_OSD_2045_10_INCH = 2, /* OSD 2045 panel 1920x1200 */
120 LCD_TYPE_OSD_2587_10_INCH = 3, /* OSD 2587 panel 1920x1200 */ 120 LCD_TYPE_OSD_2587_10_INCH = 3, /* OSD 2587 panel 1920x1200 */
121 LCD_TYPE_AUO_10_INCH = 4, /* AUO panel 1280x800 */ 121 LCD_TYPE_AUO_10_INCH = 4, /* AUO panel 1280x800 */
122 LCD_TYPE_DVI_ADAPTER = 5, /* DVI display adapter */
122}; 123};
123 124
124struct vid_pll_config { 125struct vid_pll_config {