summaryrefslogtreecommitdiff
path: root/board/raspberrypi
diff options
context:
space:
mode:
authorStephen Warren <swarren@wwwdotorg.org>2015-03-23 23:00:25 -0600
committerTom Rini <trini@konsulko.com>2015-03-24 10:52:18 -0400
commit95b4f112f5197e90906ea701bd8ca5b2cbf46b29 (patch)
tree207935c7da3968901a5a7e997411f4eeff0fb8e3 /board/raspberrypi
parent7682a99826a624d3764656b5bb31f88e2f8b235b (diff)
downloadu-boot-imx-95b4f112f5197e90906ea701bd8ca5b2cbf46b29.zip
u-boot-imx-95b4f112f5197e90906ea701bd8ca5b2cbf46b29.tar.gz
u-boot-imx-95b4f112f5197e90906ea701bd8ca5b2cbf46b29.tar.bz2
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: Stephen Warren <swarren@wwwdotorg.org>
Diffstat (limited to 'board/raspberrypi')
-rw-r--r--board/raspberrypi/rpi/rpi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 50a699b..a105953 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -278,10 +278,17 @@ static void get_board_rev(void)
* https://github.com/pimoroni/RPi.version/blob/master/RPi/version.py
* http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=99293&p=690282
* (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;
if (rpi_board_rev & 0x800000)
rpi_board_rev = (rpi_board_rev >> 4) & 0xff;
+ else
+ rpi_board_rev &= 0xff;
if (rpi_board_rev >= ARRAY_SIZE(models)) {
printf("RPI: Board rev %u outside known range\n",
rpi_board_rev);