blob: d728324272933febc4532e67862a1322c8847432 [file] [log] [blame]
Angel Pons210a0082020-04-02 23:48:24 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Furquan Shaikha2094832017-09-25 08:04:49 -07002
3#include <boardid.h>
4#include <ec/google/chromeec/ec.h>
5
Julius Wernere2f17f72017-12-05 13:39:10 -08006uint32_t board_id(void)
Furquan Shaikha2094832017-09-25 08:04:49 -07007{
Jeremy Compostellaf65ae742023-09-06 10:57:56 -07008 static uint32_t id = BOARD_ID_INIT;
Furquan Shaikha2094832017-09-25 08:04:49 -07009
Karthikeyan Ramasubramanianc80ff842018-09-17 16:19:34 -060010 if (id == BOARD_ID_INIT) {
11 if (google_chromeec_get_board_version(&id))
12 id = BOARD_ID_UNKNOWN;
13 }
Furquan Shaikha2094832017-09-25 08:04:49 -070014
15 return id;
16}