summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeenakshi Aggarwal <meenakshi.aggarwal@nxp.com>2018-11-30 22:32:12 +0530
committerPrabhakar Kushwaha <prabhakar.kushwaha@nxp.com>2019-02-19 10:26:44 +0530
commit938e35e58f98ff2db46b4f40964a1c3b242b1295 (patch)
tree0b05b2bf06879a08ac6512fb9a72a8007ace0165
parente088e587eda7a8813c977ddee84207ca728f87c5 (diff)
lx2160: Enable support of EMC2305
Enable support for FAN controller EMC2305 for LX2160A RDB board. Signed-off-by: Sriram Dash <sriram.dash@nxp.com> Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> [PK: enable EMC2305 for lx2160rdb] Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
-rw-r--r--board/freescale/lx2160a/lx2160a.c11
-rw-r--r--configs/lx2160ardb_tfa_defconfig1
-rw-r--r--include/configs/lx2160ardb.h6
3 files changed, 18 insertions, 0 deletions
diff --git a/board/freescale/lx2160a/lx2160a.c b/board/freescale/lx2160a/lx2160a.c
index a62222e25c..aa474d986e 100644
--- a/board/freescale/lx2160a/lx2160a.c
+++ b/board/freescale/lx2160a/lx2160a.c
@@ -26,6 +26,10 @@
#include "../common/vid.h"
#include <fsl_immap.h>
+#ifdef CONFIG_EMC2305
+#include "../common/emc2305.h"
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
static struct pl01x_serial_platdata serial0 = {
@@ -81,6 +85,13 @@ int board_early_init_f(void)
/* get required clock for UART IP */
uart_get_clock();
+#ifdef CONFIG_EMC2305
+ select_i2c_ch_pca9547(I2C_MUX_CH_EMC2305);
+ emc2305_init();
+ set_fan_speed(I2C_EMC2305_PWM);
+ select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
+#endif
+
fsl_lsch3_early_init_f();
return 0;
}
diff --git a/configs/lx2160ardb_tfa_defconfig b/configs/lx2160ardb_tfa_defconfig
index 9b63175692..80dd2c1022 100644
--- a/configs/lx2160ardb_tfa_defconfig
+++ b/configs/lx2160ardb_tfa_defconfig
@@ -2,6 +2,7 @@ CONFIG_ARM=y
CONFIG_TARGET_LX2160ARDB=y
CONFIG_SYS_TEXT_BASE=0x82000000
CONFIG_SYS_MALLOC_F_LEN=0x6000
+CONFIG_EMC2305=y
CONFIG_TFABOOT=y
CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT=y
CONFIG_SEC_FIRMWARE_ARMV8_PSCI=y
diff --git a/include/configs/lx2160ardb.h b/include/configs/lx2160ardb.h
index 67d214deb9..818aa3856e 100644
--- a/include/configs/lx2160ardb.h
+++ b/include/configs/lx2160ardb.h
@@ -70,6 +70,12 @@
#endif
+/* EMC2305 */
+#define I2C_MUX_CH_EMC2305 0x09
+#define I2C_EMC2305_ADDR 0x4D
+#define I2C_EMC2305_CMD 0x40
+#define I2C_EMC2305_PWM 0x80
+
/* EEPROM */
#define CONFIG_ID_EEPROM
#define CONFIG_SYS_I2C_EEPROM_NXID