Nami: Read board info from EEPROM

Eanble CONFIG_CROS_BOARD_INFO to read board info from EEPROM.
	1. Change the EEPROM address to 0xa0.

BUG=none
BRANCH=none
TEST=Read data from EEPROM.

Change-Id: I81fbada6dd64627cc438d6ed405b696e442c3a83
Signed-off-by: raymondchou <raymond_chou@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/880525
Commit-Ready: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Tested-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Reviewed-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
raymondchou
2018-01-23 13:32:31 +08:00
committed by chrome-bot
parent 82fe7e647a
commit d173cf4d6c
2 changed files with 10 additions and 8 deletions

View File

@@ -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

View File

@@ -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__