From 88b63ce8f5ff00055f8076578ded7819bb2036a3 Mon Sep 17 00:00:00 2001 From: Divya Jyothi Date: Mon, 23 Mar 2015 21:45:23 -0700 Subject: [PATCH] Strago: I2C port support added and SPI Flash Size corrected I2C ports initialized as per board design. Modules assigned to its corresponding I2C port numbers Altered the SPI flash size to match the Braswell Ref Design board BUG=None BRANCH=None TEST=Tested all I2C modules on all ports using i2cscan and i2cxfer console commands Change-Id: I4158c1aeb29193b5bd07450ba28cdcdc2413926a Signed-off-by: Divya Jyothi Reviewed-on: https://chromium-review.googlesource.com/264261 Reviewed-by: Shawn N --- board/strago/board.c | 9 +++++++++ board/strago/board.h | 15 ++++++++++++--- board/strago/build.mk | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/board/strago/board.c b/board/strago/board.c index 1aa9762515..bfd574d5cf 100644 --- a/board/strago/board.c +++ b/board/strago/board.c @@ -6,6 +6,7 @@ #include "extpower.h" #include "gpio.h" +#include "i2c.h" #include "lid_switch.h" #include "power.h" #include "power_button.h" @@ -26,3 +27,11 @@ const struct power_signal_info power_signal_list[] = { {GPIO_PCH_SLP_S4_L, 1, "SLP_S4#_DEASSERTED"}, }; BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); + +const struct i2c_port_t i2c_ports[] = { + {"batt_chg", 0, 100}, + {"sensors", 1, 100}, + {"pd_mcu", 2, 100}, + {"thermal", 3, 100} +}; +const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); diff --git a/board/strago/board.h b/board/strago/board.h index aa34254306..e33bcb6c6b 100644 --- a/board/strago/board.h +++ b/board/strago/board.h @@ -26,17 +26,26 @@ #define CONFIG_SPI_PORT 1 #define CONFIG_SPI_CS_GPIO GPIO_PVT_CS0 #define CONFIG_SPI_FLASH -#define CONFIG_SPI_FLASH_SIZE 4194304 -/* TODO: Add flash protect support for the SPI part strago actually has */ +#define CONFIG_SPI_FLASH_SIZE 524288 #define CONFIG_SPI_FLASH_W25Q64 +#define CONFIG_I2C + +/* I2C ports */ +#define I2C_PORT_BATTERY 0 +#define I2C_PORT_CHARGER 0 +#define I2C_PORT_ACCEL 1 +#define I2C_PORT_GYRO 1 +#define I2C_PORT_ALS 1 +#define I2C_PORT_PD_MCU 2 +#define I2C_PORT_THERMAL 3 + /* Modules we want to exclude */ #undef CONFIG_EEPROM #undef CONFIG_EOPTION #undef CONFIG_PSTORE #undef CONFIG_PECI #undef CONFIG_SWITCH -#undef CONFIG_I2C #undef CONFIG_PWM #undef CONFIG_FANS #undef CONFIG_ADC diff --git a/board/strago/build.mk b/board/strago/build.mk index 23c88a95a9..89c42061bc 100644 --- a/board/strago/build.mk +++ b/board/strago/build.mk @@ -8,7 +8,7 @@ # the IC is SMSC MEC1322 / external SPI is 4MB / external clock is crystal CHIP:=mec1322 -CHIP_SPI_SIZE_KB:=4096 +CHIP_SPI_SIZE_KB:=512 board-y=board.o board-$(CONFIG_BATTERY_SMART)+=battery.o