]> git.sur5r.net Git - u-boot/commitdiff
powerpc/board/t4240rdb: Enable VID support
authorYing Zhang <b40530@freescale.com>
Fri, 22 Jan 2016 04:15:13 +0000 (12:15 +0800)
committerYork Sun <york.sun@nxp.com>
Mon, 25 Jan 2016 20:38:05 +0000 (12:38 -0800)
The fuse status register provides the values from on-chip
voltage ID efuses programmed at the factory. These values
define the voltage requirements for the chip. u-boot reads
FUSESR and translates the values into the appropriate
commands to set the voltage output value of an external
voltage regulator.

Signed-off-by: Ying Zhang <b40530@freescale.com>
Reviewed-by: York Sun <york.sun@nxp.com>
board/freescale/common/vid.c
board/freescale/t4rdb/t4240rdb.c
include/configs/T4240RDB.h

index 1ea1b88a10470efcdf0c362c3c2f6b69a48a6bda..1bd65a8e5578feb0905587892b62fe3bc482576e 100644 (file)
@@ -42,7 +42,7 @@ int __weak board_vdd_drop_compensation(void)
  * The IR chip can show up under the following addresses:
  * 0x08 (Verified on T1040RDB-PA,T4240RDB-PB,X-T4240RDB-16GPA)
  * 0x09 (Verified on T1040RDB-PA)
- * 0x38 (Verified on T2080QDS, T2081QDS)
+ * 0x38 (Verified on T2080QDS, T2081QDS, T4240RDB)
  */
 static int find_ir_chip_on_i2c(void)
 {
index 4f0bbed721b992d1b6df8ccf34ebf1c6100b4eff..406fb132aea131188b6ed919340e35ad14b9271a 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "t4rdb.h"
 #include "cpld.h"
+#include "../common/vid.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -74,6 +75,13 @@ int board_early_init_r(void)
                MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
                0, flash_esel, BOOKE_PAGESZ_256M, 1);
 
+       /*
+        * Adjust core voltage according to voltage ID
+        * This function changes I2C mux to channel 2.
+       */
+       if (adjust_vdd(0))
+               printf("Warning: Adjusting core voltage failed.\n");
+
        return 0;
 }
 
index 73279c899e8cbc64dd5e2066ec98132697caee46..4a17f41eb33973b456fbf0b74ef94c45140dfafa 100644 (file)
@@ -606,6 +606,16 @@ unsigned long get_board_ddr_clk(void);
 #define I2C_VOL_MONITOR_BUS_V_OVF      0x1
 #define I2C_VOL_MONITOR_BUS_V_SHIFT    3
 
+#define CONFIG_VID_FLS_ENV             "t4240rdb_vdd_mv"
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_VID
+#endif
+#define CONFIG_VOL_MONITOR_IR36021_SET
+#define CONFIG_VOL_MONITOR_IR36021_READ
+/* The lowest and highest voltage allowed for T4240RDB */
+#define VDD_MV_MIN                     819
+#define VDD_MV_MAX                     1212
+
 /*
  * eSPI - Enhanced SPI
  */