summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJiaojinxing <jiaojinxing1987@gmail.com>2015-05-15 03:40:59 (GMT)
committer Jiaojinxing <jiaojinxing1987@gmail.com>2015-05-15 03:40:59 (GMT)
commitbb03e17b24d672fdc6df38bbfcb0cc5b7e01b52a (patch)
treeb3039f6fd4e1b53a7a56fca8bc33cd03f5568725
parent6e7034e5e5734b47dabc6c97293e21fa6f15a6ae (diff)
downloadbspam335x-bb03e17b24d672fdc6df38bbfcb0cc5b7e01b52a.zip
bspam335x-bb03e17b24d672fdc6df38bbfcb0cc5b7e01b52a.tar.gz
bspam335x-bb03e17b24d672fdc6df38bbfcb0cc5b7e01b52a.tar.bz2
Fixed tsp65217 driver bug.
-rw-r--r--SylixOS/bsp/bspLib.c3
-rw-r--r--SylixOS/bsp/forlinx/bspForlinx.c80
-rw-r--r--SylixOS/driver/tps65217/tps65217.c2
-rw-r--r--config.mk4
4 files changed, 71 insertions, 18 deletions
diff --git a/SylixOS/bsp/bspLib.c b/SylixOS/bsp/bspLib.c
index 422f0d3..9a3fa8c 100644
--- a/SylixOS/bsp/bspLib.c
+++ b/SylixOS/bsp/bspLib.c
@@ -42,11 +42,8 @@ extern VOID bspDebugPutc(CHAR cChar);
BSP 信息
*********************************************************************************************************/
static const CHAR _G_pcCpuInfo[] = "TI AM335X (Cortex-A8 Max@1GHz VFPv3 NEON)";
-
static const CHAR _G_pcCacheInfo[] = "64KBytes L1-Cache(D-32K/I-32K), 256KBytes L2-Cache";
-
static const CHAR _G_pcPacketInfo[] = BSP_CFG_PLATFORM_NAME;
-
static const CHAR _G_pcVersionInfo[] = "BSP version 1.1.0";
/*********************************************************************************************************
中断相关
diff --git a/SylixOS/bsp/forlinx/bspForlinx.c b/SylixOS/bsp/forlinx/bspForlinx.c
index c467d12..6521e62 100644
--- a/SylixOS/bsp/forlinx/bspForlinx.c
+++ b/SylixOS/bsp/forlinx/bspForlinx.c
@@ -1084,44 +1084,94 @@ VOID bspPmInit (VOID)
UINT uiVoltage;
UINT uiEnable;
- deviceVersion = DeviceVersionGet();
-
- bspCpuPowerSet(LW_CPU_POWERLEVEL_TOP);
-
- am335xPrintConfigDVFS();
-
iFd = open("/dev/pmic", O_RDWR, 0666);
if (iFd >= 0) {
uiEnable = 1;
- uiVoltage = 1800;
+ /*
+ * VDD_DDR 1.5V
+ */
+ uiVoltage = 1500;
ioctl(iFd, TPS65217_DCDC1_SET, &uiVoltage);
- ioctl(iFd, TPS65217_DCDC1_EN, &uiEnable);
+ ioctl(iFd, TPS65217_DCDC1_GET, &uiVoltage);
+ printf("DCDC1=%d\n", uiVoltage);
+#if defined(ok335xs)
+ /*
+ * VDD_MPU 1.2V
+ */
+ ioctl(iFd, TPS65217_DCDC2_GET, &uiVoltage);
+ printf("DCDC2=%d\n", uiVoltage);
+
+ /*
+ * VDD_CORE 1.1V
+ */
uiVoltage = 1100;
ioctl(iFd, TPS65217_DCDC3_SET, &uiVoltage);
- ioctl(iFd, TPS65217_DCDC3_EN, &uiEnable);
+ ioctl(iFd, TPS65217_DCDC3_GET, &uiVoltage);
+ printf("DCDC3=%d\n", uiVoltage);
+#elif defined(ok335xd)
+ /*
+ * VDD_MPU 1.2V
+ */
+ ioctl(iFd, TPS65217_DCDC3_GET, &uiVoltage);
+ printf("DCDC3=%d\n", uiVoltage);
+
+ /*
+ * VDD_CORE 1.1V
+ */
+ uiVoltage = 1100;
+ ioctl(iFd, TPS65217_DCDC2_SET, &uiVoltage);
+ ioctl(iFd, TPS65217_DCDC2_GET, &uiVoltage);
+ printf("DCDC2=%d\n", uiVoltage);
+#endif
+ /*
+ * VDD_RTC 1.8V
+ */
uiVoltage = 1800;
ioctl(iFd, TPS65217_LDO1_SET, &uiVoltage);
ioctl(iFd, TPS65217_LDO1_EN, &uiEnable);
+ ioctl(iFd, TPS65217_LDO1_GET, &uiVoltage);
+ printf("LDO1=%d\n", uiVoltage);
+ /*
+ * VLDO_EXT 3.3V
+ */
uiVoltage = 3300;
ioctl(iFd, TPS65217_LDO2_SET, &uiVoltage);
ioctl(iFd, TPS65217_LDO2_EN, &uiEnable);
+ ioctl(iFd, TPS65217_LDO2_GET, &uiVoltage);
+ printf("LDO2=%d\n", uiVoltage);
- uiVoltage = 1100;
+ /*
+ * VDD_1V8 1.8V
+ */
+ uiVoltage = 1800;
ioctl(iFd, TPS65217_LDO3_SET, &uiVoltage);
ioctl(iFd, TPS65217_LDO3_EN, &uiEnable);
+ ioctl(iFd, TPS65217_LDO3_GET, &uiVoltage);
+ printf("LDO3=%d\n", uiVoltage);
+ /*
+ * VDD_3V3A 3.3V
+ */
uiVoltage = 3300;
ioctl(iFd, TPS65217_LDO4_SET, &uiVoltage);
ioctl(iFd, TPS65217_LDO4_EN, &uiEnable);
+ ioctl(iFd, TPS65217_LDO4_GET, &uiVoltage);
+ printf("LDO4=%d\n", uiVoltage);
close(iFd);
} else {
printk(KERN_ERR "bspPmInit(): failed to open /dev/pmic\n");
}
+
+ deviceVersion = DeviceVersionGet();
+
+ bspCpuPowerSet(LW_CPU_POWERLEVEL_TOP);
+
+ am335xPrintConfigDVFS();
}
/*********************************************************************************************************
** 函数名称: bspVdd1OpVoltageSet
@@ -1136,8 +1186,11 @@ VOID bspVdd1OpVoltageSet (UINT uiVoltage)
INT iFd = open("/dev/pmic", O_RDWR, 0666);
if (iFd >= 0) {
+#if defined(ok335xs)
ioctl(iFd, TPS65217_DCDC2_SET, &uiVoltage);
-
+#elif defined(ok335xd)
+ ioctl(iFd, TPS65217_DCDC3_SET, &uiVoltage);
+#endif
close(iFd);
} else {
printk(KERN_ERR "bspVdd1OpVoltageSet(): failed to open /dev/pmic\n");
@@ -1157,8 +1210,11 @@ UINT bspVdd1OpVoltageGet (VOID)
UINT uiVoltage = 0;
if (iFd >= 0) {
+#if defined(ok335xs)
ioctl(iFd, TPS65217_DCDC2_GET, &uiVoltage);
-
+#elif defined(ok335xd)
+ ioctl(iFd, TPS65217_DCDC3_GET, &uiVoltage);
+#endif
close(iFd);
} else {
printk(KERN_ERR "bspVdd1OpVoltageGet(): failed to open /dev/pmic\n");
diff --git a/SylixOS/driver/tps65217/tps65217.c b/SylixOS/driver/tps65217/tps65217.c
index eed7837..11273f3 100644
--- a/SylixOS/driver/tps65217/tps65217.c
+++ b/SylixOS/driver/tps65217/tps65217.c
@@ -665,7 +665,7 @@ static INT __tps65217Ldo34Set (__PTPS65217_DEV pTps65217,
return (PX_ERROR);
}
- ucDestValue |= 1 << 6;
+ ucDestValue |= 1 << 5;
return (__tps65217RegWrite(pTps65217, PROT_LEVEL_2,
uiLdo == 3 ? DEFLS1 : DEFLS2,
diff --git a/config.mk b/config.mk
index d61ed2f..184a9e4 100644
--- a/config.mk
+++ b/config.mk
@@ -14,9 +14,9 @@
#
# 创 建 人: RealCoder
#
-# 文件创建日期: 2015 年 05 月 11 日
+# 文件创建日期: 2015-05-13
#
-# 描 述: 本文由RealCoder生成,用于配置Makefile功能,请勿手动修改
+# 描 述: 本文件由RealCoder生成,用于配置Makefile功能,请勿手动修改
#*********************************************************************************************************
#*********************************************************************************************************
# SylixOS Base Project path