Skip to content

Commit

Permalink
minipack: Change I2C bus 0 clock to 400KHz (torvalds#135)
Browse files Browse the repository at this point in the history
Summary:
1. Change I2C bus 0 clock to 400KHz
2. Add retry when get BIC update status fail
Pull Request resolved: facebookexternal/openbmc.accton#135

Reviewed By: tomrepo

Differential Revision: D14145628

Pulled By: mikechoifb

fbshipit-source-id: 8013c4d8aa
  • Loading branch information
nealchen-accton authored and facebook-github-bot committed Feb 22, 2019
1 parent 7c5d8d4 commit 17e1a0e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions arch/arm/plat-aspeed/dev-i2c-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ static struct ast_i2c_driver_data ast_i2c_data_1M = {
.get_i2c_clock = ast_get_pclk,
};

static struct ast_i2c_driver_data ast_i2c_data_400K = {
.bus_clk = 400000, //bus clock 400KHz
.master_dma = MASTER_XFER_MODE,
.slave_dma = SLAVE_XFER_MODE,
.request_pool_buff_page = request_pool_buff_page,
.free_pool_buff_page = free_pool_buff_page,
.get_i2c_clock = ast_get_pclk,
};

static u64 ast_i2c_dma_mask = 0xffffffffUL;
static struct resource ast_i2c_dev0_resources[] = {
[0] = {
Expand All @@ -72,6 +81,8 @@ static struct platform_device ast_i2c_dev0_device = {
.coherent_dma_mask = 0xffffffff,
#if defined(CONFIG_AST_I2C_0_1M)
.platform_data = &ast_i2c_data_1M,
#elif defined(CONFIG_AST_I2C_0_400K)
.platform_data = &ast_i2c_data_400K,
#else
.platform_data = &ast_i2c_data,
#endif
Expand Down Expand Up @@ -437,6 +448,8 @@ void __init ast_add_device_i2c_common(void)
}
#if defined(CONFIG_AST_I2C_0_1M)
ast_i2c_data_1M.reg_gr = ast_i2c_data.reg_gr;// 1MHz reg_gr setting
#elif defined(CONFIG_AST_I2C_0_400K)
ast_i2c_data_400K.reg_gr = ast_i2c_data.reg_gr;// 400KHz reg_gr setting
#endif
platform_device_register(&ast_i2c_dev0_device);
platform_device_register(&ast_i2c_dev1_device);
Expand Down
4 changes: 4 additions & 0 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ config AST_I2C_0_1M
bool "AST I2C0 speed 1MHz"
depends on I2C_AST

config AST_I2C_0_400K
bool "AST I2C0 speed 400KHz"
depends on I2C_AST

config AST_I2C_SLAVE_MODE
bool "AST I2C Slave mode"
depends on I2C_AST
Expand Down

0 comments on commit 17e1a0e

Please sign in to comment.