Ying, There is no ls2088ardb board. It is ls2080ardb target supporting all three variants.
On 11/21/2016 05:30 AM, ying.zhang22...@nxp.com wrote: > From: Ying Zhang <ying.zhang22...@nxp.com> > > Fan settings(PWM signal set to ~50% duty cycle for all three rear) > fans provide good thermal air flow with considerable reduction of > fan noise. This grammar is wrong in this sentence. > > Signed-off-by: Ying Zhang <ying.zhang22...@nxp.com> > --- > [changed from v1]: make the function static. > > board/freescale/ls2080ardb/ls2080ardb.c | 31 +++++++++++++++++++++++++++++++ > include/configs/ls2080ardb.h | 6 ++++++ > 2 files changed, 37 insertions(+) > > diff --git a/board/freescale/ls2080ardb/ls2080ardb.c > b/board/freescale/ls2080ardb/ls2080ardb.c > index 83d9e7e..bc5dd53 100644 > --- a/board/freescale/ls2080ardb/ls2080ardb.c > +++ b/board/freescale/ls2080ardb/ls2080ardb.c > @@ -151,6 +151,36 @@ int config_board_mux(int ctrl_type) > return 0; > } > > +static void set_fan_speed(void) > +{ > + int ret, i; > + u8 value; > + > + select_i2c_ch_pca9547(I2C_MUX_CH_FAN); > + value = 0x80; What are these values 0x80. 1, 0x20? Can you put some comments here so others don't have to read through the reference manual of the i2c chip? > + ret = i2c_write(I2C_FAN_CONTROLLER_ADDR, 0x0, 1, &value, 1); > + if (ret) { > + printf("Fan: Failed to set fan speed\n"); > + return; > + } > + value = 1; > + ret = i2c_write(I2C_FAN_CONTROLLER_ADDR, 0x58, 1, &value, 1); > + if (ret) { > + printf("Fan: Failed to set fan speed\n"); > + return; > + } > + > + /* set PWM = ~50% DCyc for all rear PWM fans */ > + value = 0x20; > + for (i = 0xb4; i < 0xb9; i++) { > + ret = i2c_write(I2C_FAN_CONTROLLER_ADDR, i, 1, &value, 1); > + if (ret) { > + printf("Fan: Failed to set fan speed\n"); > + return; > + } > + } Do you want to skip the rest of fans if one fails? York > +} > + > int board_init(void) > { > char *env_hwconfig; > @@ -175,6 +205,7 @@ int board_init(void) > #ifdef CONFIG_ENV_IS_NOWHERE > gd->env_addr = (ulong)&default_environment[0]; > #endif > + set_fan_speed(); > select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); > > QIXIS_WRITE(rst_ctl, QIXIS_RST_CTL_RESET_EN); > diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h > index b9cb6d3..05f98c0 100644 > --- a/include/configs/ls2080ardb.h > +++ b/include/configs/ls2080ardb.h > @@ -264,6 +264,7 @@ unsigned long get_board_sys_clk(void); > > /* I2C bus multiplexer */ > #define I2C_MUX_CH_DEFAULT 0x8 > +#define I2C_MUX_CH_FAN 0xd > > /* SPI */ > #ifdef CONFIG_FSL_DSPI > @@ -279,6 +280,11 @@ unsigned long get_board_sys_clk(void); > #define CONFIG_SYS_I2C_RTC_ADDR 0x68 > #define CONFIG_CMD_DATE > > +/* > + * Winbond fan controller > + */ > +#define I2C_FAN_CONTROLLER_ADDR 0x2c > + > /* EEPROM */ > #define CONFIG_ID_EEPROM > #define CONFIG_CMD_EEPROM > _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot