Re: [U-Boot] [PATCH] ARM: rpi: fix RPi1 board rev detection for warranty bit

2015-03-24 Thread Tom Rini
On Mon, Mar 23, 2015 at 11:00:25PM -0600, Stephen Warren wrote:

 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 swar...@wwwdotorg.org

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARM: rpi: fix RPi1 board rev detection for warranty bit

2015-03-23 Thread Stephen Warren
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 swar...@wwwdotorg.org
---
 board/raspberrypi/rpi/rpi.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 50a699bb9e0c..a105953541be 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=63t=99293p=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=63t=98367start=250
+* http://www.raspberrypi.org/forums/viewtopic.php?f=31t=20594
 */
rpi_board_rev = msg-get_board_rev.body.resp.rev;
if (rpi_board_rev  0x80)
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);
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot