[coreboot-gerrit] Change in ...coreboot[master]: mb/intel/kblrvp: Add helper function to get Board Id

PraveenX Hodagatta Pranesh (Code Review) gerrit at coreboot.org
Wed Dec 19 06:22:40 CET 2018


PraveenX Hodagatta Pranesh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30306


Change subject: mb/intel/kblrvp: Add helper function to get Board Id
......................................................................

mb/intel/kblrvp: Add helper function to get Board Id

Add 2 helper function get_board_id() & get_spd_index()
to read board id & spd index from EC.
Rename the get_board_id() function to get_ec_boardinfo().

BUG=None
TEST= Tested on KBL RVP11, able to read the Board id (0x44)
      and verified in serial logs. not verified on KBL RVP8.

Signed-off-by: Praveen hodagatta pranesh <praveenx.hodagatta.pranesh at intel.com>
Change-Id: Ie20bf0d45a3568c2c433e5b844bea86aac07c47d
---
M src/mainboard/intel/kblrvp/board_id.c
M src/mainboard/intel/kblrvp/board_id.h
2 files changed, 24 insertions(+), 4 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/30306/1

diff --git a/src/mainboard/intel/kblrvp/board_id.c b/src/mainboard/intel/kblrvp/board_id.c
index a362b08..8d0cad3 100644
--- a/src/mainboard/intel/kblrvp/board_id.c
+++ b/src/mainboard/intel/kblrvp/board_id.c
@@ -1,7 +1,7 @@
 /*
  * This file is part of the coreboot project.
  *
- * Copyright (C) 2016 Intel Corporation.
+ * Copyright (C) 2016-2018 Intel Corporation.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,9 +17,9 @@
 #include <stdint.h>
 
 /*
- * Get Board ID via EC I/O port write/read
+ * Get Board info via EC I/O port write/read
  */
-int get_board_id(void)
+int get_ec_boardinfo(void)
 {
 	uint8_t buffer[2];
 	uint8_t index;
@@ -30,3 +30,15 @@
 	}
 	return -1;
 }
+
+/* Get spd index */
+int get_spd_index(void)
+{
+	return ((get_ec_boardinfo() >> 5) & 0x7);
+}
+
+/* Get Board Id */
+int get_board_id(void)
+{
+	return ((get_ec_boardinfo() >> 8) & 0xff);
+}
diff --git a/src/mainboard/intel/kblrvp/board_id.h b/src/mainboard/intel/kblrvp/board_id.h
index 881866f..4405587 100644
--- a/src/mainboard/intel/kblrvp/board_id.h
+++ b/src/mainboard/intel/kblrvp/board_id.h
@@ -1,7 +1,7 @@
 /*
  * This file is part of the coreboot project.
  *
- * Copyright (C) 2016 Intel Corporation.
+ * Copyright (C) 2016-2018 Intel Corporation.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,6 +19,8 @@
 /* Mobile Board Id 0x00 - 0xFF */
 #define BOARD_ID_SKL_A0_RVP3	0x04
 #define BOARD_ID_SKL_RVP7	0x0B
+#define BOARD_ID_KBL_RVP8	0x42
+#define BOARD_ID_KBL_RVP11	0x44
 
 /* 60-6F reserved for KBL RVPs */
 #define BOARD_ID_KBL_LPDDR3_RVP3	0x60
@@ -31,6 +33,12 @@
  * Returns board information (board id[15:8] and
  * Fab info[7:0]) on success and < 0 on error
  */
+int get_ec_boardinfo(void);
+
+int get_spd_index(void);
+
+/* Board id[15:8] */
 int get_board_id(void);
 
+
 #endif /* _MAINBOARD_BOARD_ID_H_ */

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/30306
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie20bf0d45a3568c2c433e5b844bea86aac07c47d
Gerrit-Change-Number: 30306
Gerrit-PatchSet: 1
Gerrit-Owner: PraveenX Hodagatta Pranesh <praveenx.hodagatta.pranesh at intel.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181219/38a2c47b/attachment.html>


More information about the coreboot-gerrit mailing list