summaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2013-07-08 14:18:01 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-12-12 22:04:00 +0100
commitd0a6a38bb7902324f87fd3111b48ba30d1817cb6 (patch)
tree64311ba9c753d8e0dbbe0c48869a3d433a92cc65 /src/ec/google/chromeec
parenta367892c98a8ae84470a28ab2d9e4dd8a09596b4 (diff)
chromeec: Allow get_board_version to be called from romstage.
We will soon need to call google_chromeec_get_board_version to determine correct DDR SPD. We must do so before DDR is initialized, so allow this function to be called from romstage. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I882d84e38d11bf66067193a6f408f941f2cf8a81 Reviewed-on: https://gerrit.chromium.org/gerrit/61191 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: Shawn Nematbakhsh <shawnn@chromium.org> Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: http://review.coreboot.org/4351 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/ec/google/chromeec')
-rw-r--r--src/ec/google/chromeec/ec.c34
-rw-r--r--src/ec/google/chromeec/ec.h2
2 files changed, 18 insertions, 18 deletions
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index 7546a82ee8..f1cefae4f2 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -132,6 +132,23 @@ void google_chromeec_early_init(void)
hlt();
}
}
+
+u16 google_chromeec_get_board_version(void)
+{
+ struct chromeec_command cmd;
+ struct ec_response_board_version board_v;
+
+ cmd.cmd_code = EC_CMD_GET_BOARD_VERSION;
+ cmd.cmd_version = 0;
+ cmd.cmd_size_in = 0;
+ cmd.cmd_size_out = sizeof(board_v);
+ cmd.cmd_data_out = &board_v;
+
+ if (google_chromeec_command(&cmd) != 0)
+ return 0;
+
+ return board_v.board_version;
+}
#endif /* ! __SMM__ */
#ifndef __PRE_RAM__
@@ -308,23 +325,6 @@ void google_chromeec_log_events(u32 mask)
#endif
}
-u16 google_chromeec_get_board_version(void)
-{
- struct chromeec_command cmd;
- struct ec_response_board_version board_v;
-
- cmd.cmd_code = EC_CMD_GET_BOARD_VERSION;
- cmd.cmd_version = 0;
- cmd.cmd_size_in = 0;
- cmd.cmd_size_out = sizeof(board_v);
- cmd.cmd_data_out = &board_v;
-
- if (google_chromeec_command(&cmd) != 0)
- return 0;
-
- return board_v.board_version;
-}
-
int google_chromeec_set_usb_charge_mode(u8 port_id, enum usb_charge_mode mode)
{
struct chromeec_command cmd;
diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h
index f661d311a8..a037d0147d 100644
--- a/src/ec/google/chromeec/ec.h
+++ b/src/ec/google/chromeec/ec.h
@@ -33,12 +33,12 @@ int google_chromeec_set_smi_mask(u32 mask);
int google_chromeec_set_wake_mask(u32 mask);
u8 google_chromeec_get_event(void);
int google_ec_running_ro(void);
-u16 google_chromeec_get_board_version(void);
void google_chromeec_init(void);
#endif
void google_chromeec_early_init(void);
uint8_t google_chromeec_calc_checksum(const uint8_t *data, int size);
+u16 google_chromeec_get_board_version(void);
u32 google_chromeec_get_events_b(void);
int google_chromeec_kbbacklight(int percent);
void google_chromeec_post(u8 postcode);