summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-03-28 18:50:01 +0100
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-03-28 18:50:01 +0100
commit009d75ccc11d27b9a083375a88bb93cb746b4800 (patch)
tree12abe9fcf437d58b73ee1fa8d422548560deaae5 /common
parent417c55803118eb8e350d5ab8ba6583fb39f4e2e3 (diff)
parentd53e340edf65ff253d3a7b06ebe60501045892e3 (diff)
downloadu-boot-imx-009d75ccc11d27b9a083375a88bb93cb746b4800.zip
u-boot-imx-009d75ccc11d27b9a083375a88bb93cb746b4800.tar.gz
u-boot-imx-009d75ccc11d27b9a083375a88bb93cb746b4800.tar.bz2
Merge branch 'u-boot/master' into 'u-boot-arm/master'
Conflicts: drivers/spi/tegra20_sflash.c include/fdtdec.h lib/fdtdec.c
Diffstat (limited to 'common')
-rw-r--r--common/cmd_dtt.c32
-rw-r--r--common/lcd.c4
2 files changed, 33 insertions, 3 deletions
diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c
index cd94423..edbd4a8 100644
--- a/common/cmd_dtt.c
+++ b/common/cmd_dtt.c
@@ -27,7 +27,9 @@
#include <dtt.h>
#include <i2c.h>
+#include <tmu.h>
+#if defined CONFIG_DTT_SENSORS
static unsigned long sensor_initialized;
static void _initialize_dtt(void)
@@ -59,9 +61,11 @@ void dtt_init(void)
/* switch back to original I2C bus */
I2C_SET_BUS(old_bus);
}
+#endif
-int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+int dtt_i2c(void)
{
+#if defined CONFIG_DTT_SENSORS
int i;
unsigned char sensors[] = CONFIG_DTT_SENSORS;
int old_bus;
@@ -83,8 +87,34 @@ int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
/* switch back to original I2C bus */
I2C_SET_BUS(old_bus);
+#endif
return 0;
+}
+
+int dtt_tmu(void)
+{
+#if defined CONFIG_TMU_CMD_DTT
+ int cur_temp;
+
+ /* Sense and return latest thermal info */
+ if (tmu_monitor(&cur_temp) == TMU_STATUS_INIT) {
+ puts("TMU is in unknown state, temperature is invalid\n");
+ return -1;
+ }
+ printf("Current temperature: %u degrees Celsius\n", cur_temp);
+#endif
+ return 0;
+}
+
+int do_dtt(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+ int err = 0;
+
+ err |= dtt_i2c();
+ err |= dtt_tmu();
+
+ return err;
} /* do_dtt() */
/***************************************************/
diff --git a/common/lcd.c b/common/lcd.c
index 590bbb9..77914ad 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -386,8 +386,6 @@ int drv_lcd_init (void)
lcd_base = (void *)(gd->fb_base);
- lcd_get_size(&lcd_line_length);
-
lcd_init(lcd_base); /* LCD initialization */
/* Device initialization */
@@ -470,6 +468,8 @@ static int lcd_init(void *lcdbase)
debug("[LCD] Initializing LCD frambuffer at %p\n", lcdbase);
lcd_ctrl_init(lcdbase);
+ lcd_get_size(&lcd_line_length);
+ lcd_line_length = (panel_info.vl_col * NBITS(panel_info.vl_bpix)) / 8;
lcd_is_enabled = 1;
lcd_clear();
lcd_enable ();