nyan_big: nyan_blaze: Add code to handle more board strappin... [chromiumos/platform/depthcharge : master]

2 views
Skip to first unread message

Gabe Black (Gerrit)

unread,
Apr 17, 2014, 8:15:54 PM4/17/14
to chromium-...@chromium.org
Gabe Black has uploaded a new change for review.

https://chromium-review.googlesource.com/195497

Change subject: nyan_big: nyan_blaze: Add code to handle more board
strappings.
......................................................................

nyan_big: nyan_blaze: Add code to handle more board strappings.

This adds code to handle board strappings for revisions 3-5.

BUG=None
TEST=Built for blaze, booted on big.
BRANCH=None

Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Signed-off-by: Gabe Black <gabe...@google.com>
---
M src/board/nyan_big/board.c
M src/board/nyan_blaze/board.c
2 files changed, 24 insertions(+), 0 deletions(-)



diff --git a/src/board/nyan_big/board.c b/src/board/nyan_big/board.c
index 84dd5f4..03b9063 100644
--- a/src/board/nyan_big/board.c
+++ b/src/board/nyan_big/board.c
@@ -75,6 +75,9 @@
BOARD_ID_REV0 = 0x00, /* prototype */
BOARD_ID_REV1 = 0x01, /* EVT */
BOARD_ID_REV2 = 0x02, /* DVT */
+ BOARD_ID_REV3 = 0x04, /* PVT */
+ BOARD_ID_REV4 = 0x05,
+ BOARD_ID_REV5 = 0x06
};

enum {
@@ -108,6 +111,15 @@
case BOARD_ID_REV2:
fit_override_kernel_compat("google,nyan-big-rev2");
break;
+ case BOARD_ID_REV3:
+ fit_override_kernel_compat("google,nyan-blaze-rev3");
+ break;
+ case BOARD_ID_REV4:
+ fit_override_kernel_compat("google,nyan-blaze-rev4");
+ break;
+ case BOARD_ID_REV5:
+ fit_override_kernel_compat("google,nyan-blaze-rev5");
+ break;
default:
printf("Unrecognized board ID %#x.\n", id);
return 1;
diff --git a/src/board/nyan_blaze/board.c b/src/board/nyan_blaze/board.c
index 85b0b5f..09d4b97 100644
--- a/src/board/nyan_blaze/board.c
+++ b/src/board/nyan_blaze/board.c
@@ -75,6 +75,9 @@
BOARD_ID_REV0 = 0x00, /* prototype */
BOARD_ID_REV1 = 0x01, /* EVT */
BOARD_ID_REV2 = 0x02, /* DVT */
+ BOARD_ID_REV3 = 0x04, /* PVT */
+ BOARD_ID_REV4 = 0x05,
+ BOARD_ID_REV5 = 0x06
};

enum {
@@ -108,6 +111,15 @@
case BOARD_ID_REV2:
fit_override_kernel_compat("google,nyan-blaze-rev2");
break;
+ case BOARD_ID_REV3:
+ fit_override_kernel_compat("google,nyan-blaze-rev3");
+ break;
+ case BOARD_ID_REV4:
+ fit_override_kernel_compat("google,nyan-blaze-rev4");
+ break;
+ case BOARD_ID_REV5:
+ fit_override_kernel_compat("google,nyan-blaze-rev5");
+ break;
default:
printf("Unrecognized board ID %#x.\n", id);
return 1;

--
To view, visit https://chromium-review.googlesource.com/195497
To unsubscribe, visit https://chromium-review.googlesource.com/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/depthcharge
Gerrit-Branch: master
Gerrit-Owner: Gabe Black <gabe...@chromium.org>

Katie Roberts-Hoffman (Gerrit)

unread,
Apr 17, 2014, 8:18:06 PM4/17/14
to Gabe Black, Hung-Te Lin, David Hendricks, Katie Roberts-Hoffman, Julius Werner
Katie Roberts-Hoffman has posted comments on this change.

Change subject: nyan_big: nyan_blaze: Add code to handle more board
strappings.
......................................................................


Patch Set 1:

(1 comment)

https://chromium-review.googlesource.com/#/c/195497/1/src/board/nyan_big/board.c
File src/board/nyan_big/board.c:

Line 78: BOARD_ID_REV3 = 0x04, /* PVT */
why does REV3 = 4?
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/depthcharge
Gerrit-Branch: master
Gerrit-Owner: Gabe Black <gabe...@chromium.org>
Gerrit-Reviewer: David Hendricks <dhen...@chromium.org>
Gerrit-Reviewer: Hung-Te Lin <hun...@chromium.org>
Gerrit-Reviewer: Julius Werner <jwe...@chromium.org>
Gerrit-Reviewer: Katie Roberts-Hoffman <kat...@chromium.org>
Gerrit-HasComments: Yes

Gabe Black (Gerrit)

unread,
Apr 17, 2014, 8:24:09 PM4/17/14
to Hung-Te Lin, David Hendricks, Katie Roberts-Hoffman, Julius Werner
Gabe Black has posted comments on this change.

Change subject: nyan_big: nyan_blaze: Add code to handle more board
strappings.
......................................................................


Patch Set 1:

(1 comment)

https://chromium-review.googlesource.com/#/c/195497/1/src/board/nyan_big/board.c
File src/board/nyan_big/board.c:

Line 78: BOARD_ID_REV3 = 0x04, /* PVT */
> why does REV3 = 4?
The GPIO settings are encoded in groups of two bits where 0 is pulled low,
1 is pulled high, and 2 is floating. The revision numbering is densely
packed where rev0 = 00, rev1 = 01, rev2 = 0Z, and rev3 = 10, and in binary
that turns into 00 00, 00 01, 00 10, and 01 00 which in hex is 0x0, 0x1,
0x2, and 0x4.

The GPIO encoding was my suggestion and the intention was to make it easy
to look at and see what the GPIO values were without doing a bunch of math,
and conversely to make it easy to generate the values from the GPIOs. It
does mean it's not densely packed, though, so the encoding will grow faster
than the revision number which looks a little odd.
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/depthcharge
Gerrit-Branch: master
Gerrit-Owner: Gabe Black <gabe...@chromium.org>
Gerrit-Reviewer: David Hendricks <dhen...@chromium.org>
Gerrit-Reviewer: Gabe Black <gabe...@chromium.org>

Katie Roberts-Hoffman (Gerrit)

unread,
Apr 17, 2014, 8:26:59 PM4/17/14
to Gabe Black, Hung-Te Lin, David Hendricks, Katie Roberts-Hoffman, Julius Werner
Katie Roberts-Hoffman has posted comments on this change.

Change subject: nyan_big: nyan_blaze: Add code to handle more board
strappings.
......................................................................


Patch Set 1:

(1 comment)

https://chromium-review.googlesource.com/#/c/195497/1/src/board/nyan_big/board.c
File src/board/nyan_big/board.c:

Line 78: BOARD_ID_REV3 = 0x04, /* PVT */
> The GPIO settings are encoded in groups of two bits where 0 is pulled low,
i see.. in the table we have a "decimal" = "hex" = "base 3" so I'm missing
how when we decode things we don't end up with the same counting method...
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/depthcharge
Gerrit-Branch: master
Gerrit-Owner: Gabe Black <gabe...@chromium.org>

Gabe Black (Gerrit)

unread,
Apr 17, 2014, 8:31:29 PM4/17/14
to Hung-Te Lin, David Hendricks, Katie Roberts-Hoffman, Julius Werner
Gabe Black has posted comments on this change.

Change subject: nyan_big: nyan_blaze: Add code to handle more board
strappings.
......................................................................


Patch Set 1:

(1 comment)

https://chromium-review.googlesource.com/#/c/195497/1/src/board/nyan_big/board.c
File src/board/nyan_big/board.c:

Line 78: BOARD_ID_REV3 = 0x04, /* PVT */
> i see.. in the table we have a "decimal" = "hex" = "base 3" so I'm missing
The name of the constant is the revision number and follows what's in the
spreadsheet in those various columns. The actual number is an internal
representation which is essentially the "GPIOs" column but obviously
without a "Z" digit. That's what the GPIO settings come back as from the
function that reads the hardware, and what we compare against when picking
a compatibility string.
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/depthcharge
Gerrit-Branch: master
Gerrit-Owner: Gabe Black <gabe...@chromium.org>

Katie Roberts-Hoffman (Gerrit)

unread,
Apr 17, 2014, 8:34:51 PM4/17/14
to Gabe Black, Hung-Te Lin, David Hendricks, Julius Werner, Katie Roberts-Hoffman
Katie Roberts-Hoffman has posted comments on this change.

Change subject: nyan_big: nyan_blaze: Add code to handle more board
strappings.
......................................................................


Patch Set 1: Code-Review+2
Line 78: BOARD_ID_REV3 = 0x04, /* PVT */
> The name of the constant is the revision number and follows what's in the
> s
yeah ok... now I get it... lgtm
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/depthcharge
Gerrit-Branch: master
Gerrit-Owner: Gabe Black <gabe...@chromium.org>

Gabe Black (Gerrit)

unread,
Apr 17, 2014, 8:35:18 PM4/17/14
to Katie Roberts-Hoffman, Hung-Te Lin, David Hendricks, Julius Werner
Gabe Black has posted comments on this change.

Change subject: nyan_big: nyan_blaze: Add code to handle more board
strappings.
......................................................................


Patch Set 1: Commit-Queue+1 Verified+1
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/depthcharge
Gerrit-Branch: master
Gerrit-Owner: Gabe Black <gabe...@chromium.org>
Gerrit-Reviewer: David Hendricks <dhen...@chromium.org>
Gerrit-Reviewer: Gabe Black <gabe...@chromium.org>
Gerrit-Reviewer: Hung-Te Lin <hun...@chromium.org>
Gerrit-Reviewer: Julius Werner <jwe...@chromium.org>
Gerrit-Reviewer: Katie Roberts-Hoffman <kat...@chromium.org>
Gerrit-HasComments: No

Julius Werner (Gerrit)

unread,
Apr 17, 2014, 10:15:32 PM4/17/14
to Gabe Black, Katie Roberts-Hoffman, Hung-Te Lin, David Hendricks, chrome-internal-fetch
Julius Werner has posted comments on this change.

Change subject: nyan_big: nyan_blaze: Add code to handle more board
strappings.
......................................................................


Patch Set 1:
Line 78: BOARD_ID_REV3 = 0x04, /* PVT */
> The GPIO settings are encoded in groups of two bits where 0 is pulled low,
FWIW, I think this is a good reason to change the implementation of
board_id() instead of making this table so confusing. It really wouldn't be
difficult either (just do 'id = ((value[3] * 3 + value[2]) * 3 + value[1])
* 3 + value[0];' and you might even get it on one line), and it would allow
you to replace this whole enum/switch table by a single line of snprintf().
(Your version will also really confuse the next guy who will look at
the "Unrecognized board ID" printout in a month or two and think "My board
should be wired to 6, why the hell does it say 'board ID 0xa'???"...)
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Gerrit-PatchSet: 1
Gerrit-Project: chromiumos/platform/depthcharge
Gerrit-Branch: master
Gerrit-Owner: Gabe Black <gabe...@chromium.org>
Gerrit-Reviewer: David Hendricks <dhen...@chromium.org>
Gerrit-Reviewer: Gabe Black <gabe...@chromium.org>
Gerrit-Reviewer: Hung-Te Lin <hun...@chromium.org>
Gerrit-Reviewer: Julius Werner <jwe...@chromium.org>
Gerrit-Reviewer: Katie Roberts-Hoffman <kat...@chromium.org>
Gerrit-Reviewer: chrome-internal-fetch <chrome-int...@google.com>
Gerrit-HasComments: Yes

chrome-internal-fetch (Gerrit)

unread,
Apr 18, 2014, 12:53:18 AM4/18/14
to Gabe Black, Katie Roberts-Hoffman
chrome-internal-fetch has submitted this change and it was merged.

Change subject: nyan_big: nyan_blaze: Add code to handle more board
strappings.
......................................................................


nyan_big: nyan_blaze: Add code to handle more board strappings.

This adds code to handle board strappings for revisions 3-5.

BUG=None
TEST=Built for blaze, booted on big.
BRANCH=None

Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Signed-off-by: Gabe Black <gabe...@google.com>
Reviewed-on: https://chromium-review.googlesource.com/195497
Reviewed-by: Katie Roberts-Hoffman <kat...@chromium.org>
Commit-Queue: Gabe Black <gabe...@chromium.org>
Tested-by: Gabe Black <gabe...@chromium.org>
---
M src/board/nyan_big/board.c
M src/board/nyan_blaze/board.c
2 files changed, 24 insertions(+), 0 deletions(-)

Approvals:
Gabe Black: Ready; Verified
Katie Roberts-Hoffman: Looks good to me, approved
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia7c1881c4153bb6d0ed8e70a6fddc6450c891dc0
Gerrit-PatchSet: 2
Gerrit-Project: chromiumos/platform/depthcharge
Gerrit-Branch: master
Gerrit-Owner: Gabe Black <gabe...@chromium.org>
Gerrit-Reviewer: Gabe Black <gabe...@chromium.org>
Reply all
Reply to author
Forward
0 new messages