summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2016-08-01 14:33:26 -0700
committerMartin Roth <martinroth@google.com>2016-08-09 00:23:10 +0200
commit0b2cf172fbf67ebea2dabea59439dfbab2e860c7 (patch)
tree1b69cbd270b645103ccd7c705344e661e282bb5c /src
parent271a2c2763cac2421630d299937e0b8f3c9e9ea4 (diff)
downloadcoreboot-0b2cf172fbf67ebea2dabea59439dfbab2e860c7.tar.xz
google/gru: Update board/RAM ID ADC values
Looks like our hardware guys have decided to change some voltage ranges in the Gru/Kevin ADC IDs since we last wrote a table. This patch updates it to the latest values from the Spreadsheet of Truth. Also adds further values up to rev15. BRANCH=none BUG=none TEST=none Change-Id: I1aa093ca3abe952afd658eb7da01b325f798eaa0 Signed-off-by: Martin Roth <martinroth@chromium.org> Original-Commit-Id: e42b4685c91f01ce1cff61638b17042be9d575fd Original-Change-Id: I646fd03dc385df1a8f0af8cb85ff3128cc31f8d8 Original-Signed-off-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/365111 Original-Tested-by: Douglas Anderson <dianders@chromium.org> Original-Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-on: https://review.coreboot.org/16053 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/google/gru/boardid.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/mainboard/google/gru/boardid.c b/src/mainboard/google/gru/boardid.c
index eb1c3780a2..683ac39fd6 100644
--- a/src/mainboard/google/gru/boardid.c
+++ b/src/mainboard/google/gru/boardid.c
@@ -20,17 +20,28 @@
/*
* ID info:
- * ID : Volts : ADC value : Bucket
- * == ===== ========= ======
- * 0 : 0.074V: 37.888 : 0 - <=82
- * 1 : 0.211V: 108.032 : 82- <=136
- * 2 : 0.319V: 163.328 : 136-<=191
- * 3 : 0.427V: 218.624 : 191-<=248
- * 4 : 0.542V: 277.504 : 248-<=309
- * 5 : 0.666V: 340.992 : 309-<=370
- * 6 : 0.781V: 399.872 : 370- 512
+ * 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[] = { 82, 136, 191, 248, 309, 370, 512 };
+static const int id_readings[] = { 81, 150, 211, 274, 342, 411, 477, 545,
+ 613, 675, 733, 795, 861, 925, 989, 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;
@@ -52,8 +63,7 @@ static uint32_t get_index(uint32_t channel, int *cached_id)
}
}
- printk(BIOS_DEBUG, "ERROR: Unmatched ADC reading of %d\n", adc_reading);
- return 0;
+ die("Read impossible value ( > 1023) from 10-bit ADC!");
}
uint8_t board_id(void)