fix how to interpret board id read from gpios
nyan blaze fails to boot because tristates of the board id are interpreted in the reverse order. this change fixes it. BUG=none TEST=Booted Blaze to Linux. Built firmware for Storm. Branch=none Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I6d81092becb60d12e1cd2a92fc2c261da42c60f5 Reviewed-on: https://chromium-review.googlesource.com/211700 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
parent
3fcb3e8299
commit
3f59b13d61
3 changed files with 6 additions and 2 deletions
|
|
@ -31,6 +31,10 @@ typedef unsigned gpio_t;
|
|||
* bit fields, each represeting one GPIO value, or a number where each GPIO is
|
||||
* included multiplied by 3^gpio_num, resulting in a true tertiary value.
|
||||
*
|
||||
* gpio[]: pin positions to read. little-endian (less significant value first).
|
||||
* num_gpio: number of pins to read.
|
||||
* tertiary: 1: pins are interpreted as a quad coded tertiary.
|
||||
* 0: pins are interpreted as a set of two bit fields.
|
||||
*/
|
||||
int gpio_get_in_tristate_values(gpio_t gpio[], int num_gpio, int tertiary);
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ int gpio_get_in_tristate_values(gpio_t gpio[], int num_gpio, int tertiary)
|
|||
* 1: pull up
|
||||
* 2: floating
|
||||
*/
|
||||
for (index = 0; index < num_gpio; ++index) {
|
||||
for (index = num_gpio - 1; index >= 0; --index) {
|
||||
if (tertiary)
|
||||
id *= 3;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
uint8_t board_id(void)
|
||||
{
|
||||
uint8_t bid;
|
||||
gpio_t hw_rev_gpios[] = {68, 30, 29};
|
||||
gpio_t hw_rev_gpios[] = {29, 30, 68};
|
||||
int offset = 19;
|
||||
|
||||
bid = gpio_get_in_tristate_values(hw_rev_gpios,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue