diff --git a/board/nami/board.c b/board/nami/board.c index a5a9a1ac68..8705cb3afd 100644 --- a/board/nami/board.c +++ b/board/nami/board.c @@ -15,6 +15,7 @@ #include "charger.h" #include "chipset.h" #include "console.h" +#include "cros_board_info.h" #include "driver/pmic_tps650x30.h" #include "driver/accelgyro_bmi160.h" #include "driver/accel_bma2x2.h" @@ -57,14 +58,6 @@ #define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) #define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) -int board_get_version(void) -{ - static int version = 0; - /* dnojiri: Read version from EEPROM */ - CPRINTS("Board version: %d", version); - return version; -} - static void tcpc_alert_event(enum gpio_signal signal) { if ((signal == GPIO_USB_C0_PD_INT_ODL) && @@ -394,6 +387,11 @@ DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, chipset_pre_init, HOOK_PRIO_DEFAULT); /* Initialize board. */ static void board_init(void) { + uint32_t version; + + if (cbi_get_board_version(&version) == EC_SUCCESS) + CPRINTS("Board Version: 0x%04x", version); + /* * This enables pull-down on F_DIO1 (SPI MISO), and F_DIO0 (SPI MOSI), * whenever the EC is not doing SPI flash transactions. This avoids diff --git a/board/nami/board.h b/board/nami/board.h index e6809aa89f..ecdc63ce9a 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -20,6 +20,8 @@ #define CONFIG_BACKLIGHT_LID_ACTIVE_LOW #define CONFIG_BOARD_VERSION #define CONFIG_BOARD_SPECIFIC_VERSION +#define CONFIG_CRC8 +#define CONFIG_CROS_BOARD_INFO #define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL #define CONFIG_DPTF #define CONFIG_DPTF_DEVICE_ORIENTATION @@ -170,6 +172,7 @@ #define I2C_PORT_TCPC1 NPCX_I2C_PORT0_1 #define I2C_PORT_USB_CHARGER_0 NPCX_I2C_PORT0_0 #define I2C_PORT_USB_CHARGER_1 NPCX_I2C_PORT0_1 +#define I2C_PORT_EEPROM NPCX_I2C_PORT0_0 #define I2C_PORT_BATTERY NPCX_I2C_PORT1 #define I2C_PORT_CHARGER NPCX_I2C_PORT1 #define I2C_PORT_PMIC NPCX_I2C_PORT2 @@ -182,6 +185,7 @@ /* I2C addresses */ #define I2C_ADDR_MP2949 0x40 +#define I2C_ADDR_EEPROM 0xa0 #ifndef __ASSEMBLER__