summaryrefslogtreecommitdiff
path: root/board/freescale/common/vid.c
diff options
context:
space:
mode:
authorYing Zhang <b40530@freescale.com>2016-01-22 04:15:12 (GMT)
committerYork Sun <york.sun@nxp.com>2016-01-25 20:37:03 (GMT)
commitcabe4d2f1970eae618ffac4262b61460b9ad3097 (patch)
tree9ffd3f1926a91b5e17396ce0cef6b8cd33b3c8b8 /board/freescale/common/vid.c
parent43381474ff99afc02b0433acfdf48ebdd6d11ce2 (diff)
downloadu-boot-cabe4d2f1970eae618ffac4262b61460b9ad3097.tar.xz
board/freescale/common: Check IR chip mode for VID support
IR chip on all the boards are required to be used in Intel mode to support VID. VDD will not be adjusted if IR chip is used in other modes. Signed-off-by: Ying Zhang <b40530@freescale.com> Reviewed-by: York Sun <york.sun@nxp.com>
Diffstat (limited to 'board/freescale/common/vid.c')
-rw-r--r--board/freescale/common/vid.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/board/freescale/common/vid.c b/board/freescale/common/vid.c
index f1bed51..1ea1b88 100644
--- a/board/freescale/common/vid.c
+++ b/board/freescale/common/vid.c
@@ -292,7 +292,7 @@ int adjust_vdd(ulong vdd_override)
(void __iomem *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
#endif
u32 fusesr;
- u8 vid;
+ u8 vid, buf;
int vdd_target, vdd_current, vdd_last;
int ret, i2caddress;
unsigned long vdd_string_override;
@@ -346,6 +346,21 @@ int adjust_vdd(ulong vdd_override)
debug("VID: IR Chip found on I2C address 0x%02x\n", i2caddress);
}
+ /* check IR chip work on Intel mode*/
+ ret = i2c_read(i2caddress,
+ IR36021_INTEL_MODE_OOFSET,
+ 1, (void *)&buf, 1);
+ if (ret) {
+ printf("VID: failed to read IR chip mode.\n");
+ ret = -1;
+ goto exit;
+ }
+ if ((buf & IR36021_MODE_MASK) != IR36021_INTEL_MODE) {
+ printf("VID: IR Chip is not used in Intel mode.\n");
+ ret = -1;
+ goto exit;
+ }
+
/* get the voltage ID from fuse status register */
fusesr = in_be32(&gur->dcfg_fusesr);
/*