[coreboot-gerrit] Change in coreboot[master]: google/gru: Prettify strapping ID ADC table

Julius Werner (Code Review) gerrit at coreboot.org
Fri Dec 15 03:18:22 CET 2017


Hello Lin Huang, David Schneider, Philip Chen,

I'd like you to do a code review. Please visit

    https://review.coreboot.org/22890

to review the following change.


Change subject: google/gru: Prettify strapping ID ADC table
......................................................................

google/gru: Prettify strapping ID ADC table

This patch shifts some comments around to make it easier to replace
values in the ADC strapping bucket table with compile-time conditionals.

Change-Id: Ic51917d3961a51d4e725ff824fb59aeefe149855
Signed-off-by: Julius Werner <jwerner at chromium.org>
---
M src/mainboard/google/gru/boardid.c
1 file changed, 20 insertions(+), 23 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/22890/1

diff --git a/src/mainboard/google/gru/boardid.c b/src/mainboard/google/gru/boardid.c
index af56f1d..6d18648 100644
--- a/src/mainboard/google/gru/boardid.c
+++ b/src/mainboard/google/gru/boardid.c
@@ -19,29 +19,26 @@
 #include <stdlib.h>
 #include <soc/saradc.h>
 
-/*
- * ID info:
- *  ID : Volts : ADC value :   Bucket
- *  ==   =====   =========   ===========
- *   0 : 0.074V:        42 :    0 -   81
- *   1 : 0.211V:       120 :   82 -  150
- *   2 : 0.319V:       181 :  151 -  211
- *   3 : 0.427V:       242 :  212 -  274
- *   4 : 0.542V:       307 :  275 -  342
- *   5 : 0.666V:       378 :  343 -  411
- *   6 : 0.781V:       444 :  412 -  477
- *   7 : 0.900V:       511 :  478 -  545
- *   8 : 1.023V:       581 :  546 -  613
- *   9 : 1.137V:       646 :  614 -  675
- *  10 : 1.240V:       704 :  676 -  733
- *  11 : 1.343V:       763 :  734 -  795
- *  12 : 1.457V:       828 :  796 -  861
- *  13 : 1.576V:       895 :  862 -  925
- *  14 : 1.684V:       956 :  926 -  989
- *  15 : 1.800V:      1023 :  990 - 1023
- */
-static const int id_readings[] = { 81, 150, 211, 274, 342, 411, 477, 545,
-				  613, 675, 733, 795, 861, 925, 989, 1023 };
+static const int id_readings[] = {
+/*	ID : Volts : ADC value :    Bucket	*/
+/*	==   =====   =========    ==========	*/
+/*	 0 : 0.074V:        42 :    0 -   81	*/	81,
+/*	 1 : 0.211V:       120 :   82 -  150	*/	150,
+/*	 2 : 0.319V:       181 :  151 -  211	*/	211,
+/*	 3 : 0.427V:       242 :  212 -  274	*/	274,
+/*	 4 : 0.542V:       307 :  275 -  342	*/	342,
+/*	 5 : 0.666V:       378 :  343 -  411	*/	411,
+/*	 6 : 0.781V:       444 :  412 -  477	*/	477,
+/*	 7 : 0.900V:       511 :  478 -  545	*/	545,
+/*	 8 : 1.023V:       581 :  546 -  613	*/	613,
+/*	 9 : 1.137V:       646 :  614 -  675	*/	675,
+/*	10 : 1.240V:       704 :  676 -  733	*/	733,
+/*	11 : 1.343V:       763 :  734 -  795	*/	795,
+/*	12 : 1.457V:       828 :  796 -  861	*/	861,
+/*	13 : 1.576V:       895 :  862 -  925	*/	925,
+/*	14 : 1.684V:       956 :  926 -  989	*/	989,
+/*	15 : 1.800V:      1023 :  990 - 1023	*/	1023
+};
 _Static_assert(ARRAY_SIZE(id_readings) == 16, "Yo' messed up da table, bruh!");
 static int cached_board_id = -1;
 static int cached_ram_id = -1;

-- 
To view, visit https://review.coreboot.org/22890
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic51917d3961a51d4e725ff824fb59aeefe149855
Gerrit-Change-Number: 22890
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner at chromium.org>
Gerrit-Reviewer: David Schneider <dnschneid at chromium.org>
Gerrit-Reviewer: Lin Huang <hl at rock-chips.com>
Gerrit-Reviewer: Philip Chen <philipchen at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171215/759fd4e7/attachment-0001.html>


More information about the coreboot-gerrit mailing list