[U-Boot] [PATCH 1/2] ARM: rpi: support model A+

Stephen Warren swarren at wwwdotorg.org
Wed Dec 24 04:01:43 CET 2014


Add a board rev entry for the new model A+, and augment the board
rev error handling code to be a bit more verbose.

Signed-off-by: Stephen Warren <swarren at wwwdotorg.org>
---
This series depends on "ARM: rpi: only set usbethaddr on relevant
systems" for context.

 arch/arm/include/asm/arch-bcm2835/mbox.h |  1 +
 board/raspberrypi/rpi/rpi.c              | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-bcm2835/mbox.h b/arch/arm/include/asm/arch-bcm2835/mbox.h
index 0289ba6a917e..88d2ec11a7c2 100644
--- a/arch/arm/include/asm/arch-bcm2835/mbox.h
+++ b/arch/arm/include/asm/arch-bcm2835/mbox.h
@@ -140,6 +140,7 @@ struct bcm2835_mbox_tag_hdr {
 #define BCM2835_BOARD_REV_B_REV2_f	0xf
 #define BCM2835_BOARD_REV_B_PLUS	0x10
 #define BCM2835_BOARD_REV_CM		0x11
+#define BCM2835_BOARD_REV_A_PLUS	0x12
 
 struct bcm2835_mbox_tag_get_board_rev {
 	struct bcm2835_mbox_tag_hdr tag_hdr;
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index ca8e86dead6c..6227e9bc12bd 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -149,6 +149,11 @@ static const struct {
 		"bcm2835-rpi-cm.dtb",
 		false,
 	},
+	[BCM2835_BOARD_REV_A_PLUS] = {
+		"Model A+",
+		"bcm2835-rpi-a-plus.dtb",
+		false,
+	},
 };
 
 u32 rpi_board_rev = 0;
@@ -260,12 +265,17 @@ static void get_board_rev(void)
 	}
 
 	rpi_board_rev = msg->get_board_rev.body.resp.rev;
-	if (rpi_board_rev >= ARRAY_SIZE(models))
+	if (rpi_board_rev >= ARRAY_SIZE(models)) {
+		printf("RPI: Board rev %u outside known range\n",
+		       rpi_board_rev);
 		rpi_board_rev = 0;
+	}
 
 	name = models[rpi_board_rev].name;
-	if (!name)
+	if (!name) {
+		printf("RPI: Board rev %u unknown\n", rpi_board_rev);
 		name = "Unknown model";
+	}
 	printf("RPI model: %s\n", name);
 }
 
-- 
1.9.1



More information about the U-Boot mailing list