lx2160: Enable support of EMC2305
authorMeenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Fri, 30 Nov 2018 17:02:12 +0000 (22:32 +0530)
committerPrabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Tue, 19 Feb 2019 04:56:44 +0000 (10:26 +0530)
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>
board/freescale/lx2160a/lx2160a.c
configs/lx2160ardb_tfa_defconfig
include/configs/lx2160ardb.h

index a62222e25c2ad68d37d2a311655152e4fb9839a8..aa474d986ee93f88b3f5a816c936a5dda2b56536 100644 (file)
 #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;
 }
index 9b63175692e5e3f6d896c26b4f20aedb4e9fac4a..80dd2c102290ec28d4f02c0694f149359c6eba8c 100644 (file)
@@ -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
index 67d214deb99aea0a900750dab3788a33f8ccd46e..818aa3856ef83d98a8b000a157b8ebd747f52cb6 100644 (file)
 
 #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