Skip to content
Snippets Groups Projects
Commit 95b4f112 authored by Stephen Warren's avatar Stephen Warren Committed by Tom Rini
Browse files

ARM: rpi: fix RPi1 board rev detection for warranty bit


Apparently the firmware's board rev response includes both the board
revision and some other data even on the RPi1. In particular, the
"warranty bit" is bit 24. We need to mask that out when looking up the
board ID.

Signed-off-by: default avatarStephen Warren <swarren@wwwdotorg.org>
parent 7682a998
No related branches found
No related tags found
No related merge requests found
...@@ -278,10 +278,17 @@ static void get_board_rev(void) ...@@ -278,10 +278,17 @@ static void get_board_rev(void)
* https://github.com/pimoroni/RPi.version/blob/master/RPi/version.py * https://github.com/pimoroni/RPi.version/blob/master/RPi/version.py
* http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=99293&p=690282 * http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=99293&p=690282
* (a few posts down) * (a few posts down)
*
* For the RPi 1, bit 24 is the "warranty bit", so we mask off just the
* lower byte to use as the board rev:
* http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=98367&start=250
* http://www.raspberrypi.org/forums/viewtopic.php?f=31&t=20594
*/ */
rpi_board_rev = msg->get_board_rev.body.resp.rev; rpi_board_rev = msg->get_board_rev.body.resp.rev;
if (rpi_board_rev & 0x800000) if (rpi_board_rev & 0x800000)
rpi_board_rev = (rpi_board_rev >> 4) & 0xff; rpi_board_rev = (rpi_board_rev >> 4) & 0xff;
else
rpi_board_rev &= 0xff;
if (rpi_board_rev >= ARRAY_SIZE(models)) { if (rpi_board_rev >= ARRAY_SIZE(models)) {
printf("RPI: Board rev %u outside known range\n", printf("RPI: Board rev %u outside known range\n",
rpi_board_rev); rpi_board_rev);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment