<p>Julius Werner would like Lin Huang, David Schneider and Philip Chen to <strong>review</strong> this change.</p><p><a href="https://review.coreboot.org/22890">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">google/gru: Prettify strapping ID ADC table<br><br>This patch shifts some comments around to make it easier to replace<br>values in the ADC strapping bucket table with compile-time conditionals.<br><br>Change-Id: Ic51917d3961a51d4e725ff824fb59aeefe149855<br>Signed-off-by: Julius Werner <jwerner@chromium.org><br>---<br>M src/mainboard/google/gru/boardid.c<br>1 file changed, 20 insertions(+), 23 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/22890/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/mainboard/google/gru/boardid.c b/src/mainboard/google/gru/boardid.c<br>index af56f1d..6d18648 100644<br>--- a/src/mainboard/google/gru/boardid.c<br>+++ b/src/mainboard/google/gru/boardid.c<br>@@ -19,29 +19,26 @@<br> #include <stdlib.h><br> #include <soc/saradc.h><br> <br>-/*<br>- * ID info:<br>- * ID : Volts : ADC value : Bucket<br>- * == ===== ========= ===========<br>- * 0 : 0.074V: 42 : 0 - 81<br>- * 1 : 0.211V: 120 : 82 - 150<br>- * 2 : 0.319V: 181 : 151 - 211<br>- * 3 : 0.427V: 242 : 212 - 274<br>- * 4 : 0.542V: 307 : 275 - 342<br>- * 5 : 0.666V: 378 : 343 - 411<br>- * 6 : 0.781V: 444 : 412 - 477<br>- * 7 : 0.900V: 511 : 478 - 545<br>- * 8 : 1.023V: 581 : 546 - 613<br>- * 9 : 1.137V: 646 : 614 - 675<br>- * 10 : 1.240V: 704 : 676 - 733<br>- * 11 : 1.343V: 763 : 734 - 795<br>- * 12 : 1.457V: 828 : 796 - 861<br>- * 13 : 1.576V: 895 : 862 - 925<br>- * 14 : 1.684V: 956 : 926 - 989<br>- * 15 : 1.800V: 1023 : 990 - 1023<br>- */<br>-static const int id_readings[] = { 81, 150, 211, 274, 342, 411, 477, 545,<br>- 613, 675, 733, 795, 861, 925, 989, 1023 };<br>+static const int id_readings[] = {<br>+/* ID : Volts : ADC value : Bucket */<br>+/* == ===== ========= ========== */<br>+/* 0 : 0.074V: 42 : 0 - 81 */ 81,<br>+/* 1 : 0.211V: 120 : 82 - 150 */ 150,<br>+/* 2 : 0.319V: 181 : 151 - 211 */ 211,<br>+/* 3 : 0.427V: 242 : 212 - 274 */ 274,<br>+/* 4 : 0.542V: 307 : 275 - 342 */ 342,<br>+/* 5 : 0.666V: 378 : 343 - 411 */ 411,<br>+/* 6 : 0.781V: 444 : 412 - 477 */ 477,<br>+/* 7 : 0.900V: 511 : 478 - 545 */ 545,<br>+/* 8 : 1.023V: 581 : 546 - 613 */ 613,<br>+/* 9 : 1.137V: 646 : 614 - 675 */ 675,<br>+/* 10 : 1.240V: 704 : 676 - 733 */ 733,<br>+/* 11 : 1.343V: 763 : 734 - 795 */ 795,<br>+/* 12 : 1.457V: 828 : 796 - 861 */ 861,<br>+/* 13 : 1.576V: 895 : 862 - 925 */ 925,<br>+/* 14 : 1.684V: 956 : 926 - 989 */ 989,<br>+/* 15 : 1.800V: 1023 : 990 - 1023 */ 1023<br>+};<br> _Static_assert(ARRAY_SIZE(id_readings) == 16, "Yo' messed up da table, bruh!");<br> static int cached_board_id = -1;<br> static int cached_ram_id = -1;<br></pre><p>To view, visit <a href="https://review.coreboot.org/22890">change 22890</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/22890"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic51917d3961a51d4e725ff824fb59aeefe149855 </div>
<div style="display:none"> Gerrit-Change-Number: 22890 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Julius Werner <jwerner@chromium.org> </div>
<div style="display:none"> Gerrit-Reviewer: David Schneider <dnschneid@chromium.org> </div>
<div style="display:none"> Gerrit-Reviewer: Lin Huang <hl@rock-chips.com> </div>
<div style="display:none"> Gerrit-Reviewer: Philip Chen <philipchen@chromium.org> </div>