mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] rpi: completed new revision scheme
@ 2019-01-24 16:28 Moritz Augsburger
  2019-01-28  8:02 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Moritz Augsburger @ 2019-01-24 16:28 UTC (permalink / raw)
  To: Barebox List

I took the new raspi hw rev definitions from
https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
and completed rpi_models_old_scheme and rpi_models_new_scheme.

Lookint at the "New-style revision codes in use:" list you can see that 
there is a22042	2B (with BCM2837),
so BCM2836_BOARD_REV_2_B is not 100% correct, but as it is used nowhere 
else this is should be neglectable.

Best regards
Moritz

yocto@yocto-build:~/src/barebox$ cat 
0001-rpi-complete-new-revision-scheme.patch
 From ad1ba48d991347f8f47710969fcceee304308f60 Mon Sep 17 00:00:00 2001
 From: Moritz Augsburger <moritz@augsburger.name>
Date: Thu, 24 Jan 2019 15:12:25 +0000
Subject: [PATCH] rpi: complete new revision scheme

---
  arch/arm/boards/raspberry-pi/rpi-common.c | 30 +++++++++++++++++------
  arch/arm/mach-bcm283x/include/mach/mbox.h | 40 
++++++++++++++++++++-----------
  2 files changed, 49 insertions(+), 21 deletions(-)

diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c 
b/arch/arm/boards/raspberry-pi/rpi-common.c
index b7ce0ad42..eefa8bcfb 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -166,16 +166,30 @@ const struct rpi_model rpi_models_old_scheme[] = {
         RPI_MODEL(BCM2835_BOARD_REV_B_REV2_d, "Model B rev2", 
rpi_b_init),
         RPI_MODEL(BCM2835_BOARD_REV_B_REV2_e, "Model B rev2", 
rpi_b_init),
         RPI_MODEL(BCM2835_BOARD_REV_B_REV2_f, "Model B rev2", 
rpi_b_init),
-       RPI_MODEL(BCM2835_BOARD_REV_B_PLUS, "Model B+", 
rpi_b_plus_init),
-       RPI_MODEL(BCM2835_BOARD_REV_CM, "Compute Module", NULL),
-       RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, "Model A+", NULL),
+       RPI_MODEL(BCM2835_BOARD_REV_B_PLUS_10, "Model B+", 
rpi_b_plus_init),
+       RPI_MODEL(BCM2835_BOARD_REV_CM_11, "Compute Module", NULL),
+       RPI_MODEL(BCM2835_BOARD_REV_A_PLUS_12, "Model A+", NULL),
+       RPI_MODEL(BCM2835_BOARD_REV_B_PLUS_13, "Model B+", 
rpi_b_plus_init),
+       RPI_MODEL(BCM2835_BOARD_REV_CM_14, "Compute Module", NULL),
+       RPI_MODEL(BCM2835_BOARD_REV_A_PLUS_15, "Model A+", NULL),
  };

  const struct rpi_model rpi_models_new_scheme[] = {
-       RPI_MODEL(0, "Unknown model", NULL),
-       RPI_MODEL(BCM2836_BOARD_REV_2_B, "2 Model B", rpi_b_plus_init),
-       RPI_MODEL(BCM2837_BOARD_REV_3_B, "3 Model B", rpi_b_plus_init),
-       RPI_MODEL(BCM2835_BOARD_REV_ZERO, "Zero", rpi_b_plus_init),
+       RPI_MODEL(BCM2835_BOARD_REV_A,          "Model A",      NULL ),  
                // 0
+       RPI_MODEL(BCM2835_BOARD_REV_B,          "Model B",      
rpi_b_init ),           // 1
+       RPI_MODEL(BCM2835_BOARD_REV_A_PLUS,     "Model A+",     NULL ),  
                // 2
+       RPI_MODEL(BCM2835_BOARD_REV_B_PLUS,     "Model B+",     
rpi_b_plus_init ),      // 3
+       RPI_MODEL(BCM2836_BOARD_REV_2_B,        "Model 2B",     
rpi_b_plus_init),       // 4
+       RPI_MODEL(BCM283x_BOARD_REV_Alpha,      "Alpha",        NULL),   
                // 5
+       RPI_MODEL(BCM2835_BOARD_REV_CM1,        "Compute Module", NULL 
),               // 6
+       RPI_MODEL(0, "Unknown model", NULL),                             
                // 7
+       RPI_MODEL(BCM2837_BOARD_REV_3_B,        "Model 3B",     
rpi_b_init ),           // 8
+       RPI_MODEL(BCM2835_BOARD_REV_ZERO,       "Zero",         
rpi_b_plus_init),       // 9
+       RPI_MODEL(BCM2837_BOARD_REV_CM3,        "Compute Module 3", NULL 
),             // a
+       RPI_MODEL(0, "Unknown model", NULL),                             
                // b
+       RPI_MODEL(BCM2835_BOARD_REV_ZERO_W,     "Zero W",       
rpi_b_plus_init),       // c
+       RPI_MODEL(BCM2837B0_BOARD_REV_3B_PLUS, "Model 3 B+",    
rpi_b_plus_init ),      // d
+       RPI_MODEL(BCM2837B0_BOARD_REV_3A_PLUS, "Nodel 3 A+",    
rpi_b_plus_init),       // e
  };

  static int rpi_board_rev = 0;
@@ -211,10 +225,12 @@ static void rpi_get_board_rev(void)
          * http://www.raspberrypi.org/forums/viewtopic.php?f=31&t=20594
          */
         rpi_board_rev = msg->get_board_rev.body.resp.rev;
+       printf("RPI: Board rev %x\n", rpi_board_rev);
         if (rpi_board_rev & 0x800000) {
                 rpi_board_rev = (rpi_board_rev >> 4) & 0xff;
                 rpi_models = rpi_models_new_scheme;
                 rpi_models_size = ARRAY_SIZE(rpi_models_new_scheme);
+               printf("RPI: Board rev %u new\n", rpi_board_rev);

         } else {
                 rpi_board_rev &= 0xff;
diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h 
b/arch/arm/mach-bcm283x/include/mach/mbox.h
index 0d1ac074e..e4f6cb675 100644
--- a/arch/arm/mach-bcm283x/include/mach/mbox.h
+++ b/arch/arm/mach-bcm283x/include/mach/mbox.h
@@ -127,18 +127,12 @@ struct bcm2835_mbox_tag_hdr {

  #define BCM2835_MBOX_TAG_GET_BOARD_REV 0x00010002

-/* RPi 2 */
-#define BCM2836_BOARD_REV_2_B          0x4
-/* RPi 3 */
-#define BCM2837_BOARD_REV_3_B          0x8
-/* Zero */
-#define BCM2835_BOARD_REV_ZERO         0x9
-
  /*
- * 0x2..0xf from:
- * 
http://raspberryalphaomega.org.uk/2013/02/06/automatic-raspberry-pi-board-revision-detection-model-a-b1-and-b2/
- * http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=32733
- * 0x10, 0x11 from swarren's testing
+ * ids
+ *     
https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
+ * cpu info
+ *     https://en.wikipedia.org/wiki/Raspberry_Pi#Processor
+ *
   */
  #define BCM2835_BOARD_REV_B_I2C0_2     0x2
  #define BCM2835_BOARD_REV_B_I2C0_3     0x3
@@ -151,9 +145,27 @@ struct bcm2835_mbox_tag_hdr {
  #define BCM2835_BOARD_REV_B_REV2_d     0xd
  #define BCM2835_BOARD_REV_B_REV2_e     0xe
  #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
+#define BCM2835_BOARD_REV_B_PLUS_10    0x10
+#define BCM2835_BOARD_REV_CM_11                0x11
+#define BCM2835_BOARD_REV_A_PLUS_12    0x12
+#define BCM2835_BOARD_REV_B_PLUS_13    0x13
+#define BCM2835_BOARD_REV_CM_14                0x14
+#define BCM2835_BOARD_REV_A_PLUS_15    0x15
+
+
+#define BCM2835_BOARD_REV_A            0x00
+#define BCM2835_BOARD_REV_B            0x01
+#define BCM2835_BOARD_REV_A_PLUS       0x02
+#define BCM2835_BOARD_REV_B_PLUS       0x03
+#define BCM2836_BOARD_REV_2_B          0x04
+#define BCM283x_BOARD_REV_Alpha        0x05
+#define BCM2835_BOARD_REV_CM1          0x06
+#define BCM2837_BOARD_REV_3_B          0x08
+#define BCM2835_BOARD_REV_ZERO         0x09
+#define BCM2837_BOARD_REV_CM3          0x0a
+#define BCM2835_BOARD_REV_ZERO_W       0x0c
+#define BCM2837B0_BOARD_REV_3B_PLUS    0x0d
+#define BCM2837B0_BOARD_REV_3A_PLUS    0x0e

  struct bcm2835_mbox_tag_get_board_rev {
         struct bcm2835_mbox_tag_hdr tag_hdr;
--
2.11.0

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rpi: completed new revision scheme
  2019-01-24 16:28 [PATCH] rpi: completed new revision scheme Moritz Augsburger
@ 2019-01-28  8:02 ` Sascha Hauer
  2019-01-28  9:57   ` Moritz Augsburger
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2019-01-28  8:02 UTC (permalink / raw)
  To: Moritz Augsburger; +Cc: Barebox List

Hi Moritz,

On Thu, Jan 24, 2019 at 05:28:44PM +0100, Moritz Augsburger wrote:
> I took the new raspi hw rev definitions from
> https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
> and completed rpi_models_old_scheme and rpi_models_new_scheme.
> 
> Lookint at the "New-style revision codes in use:" list you can see that
> there is a22042	2B (with BCM2837),
> so BCM2836_BOARD_REV_2_B is not 100% correct, but as it is used nowhere else
> this is should be neglectable.
> 
> Best regards
> Moritz
> 
> yocto@yocto-build:~/src/barebox$ cat
> 0001-rpi-complete-new-revision-scheme.patch
> From ad1ba48d991347f8f47710969fcceee304308f60 Mon Sep 17 00:00:00 2001
> From: Moritz Augsburger <moritz@augsburger.name>
> Date: Thu, 24 Jan 2019 15:12:25 +0000
> Subject: [PATCH] rpi: complete new revision scheme
> 
> ---
>  arch/arm/boards/raspberry-pi/rpi-common.c | 30 +++++++++++++++++------
>  arch/arm/mach-bcm283x/include/mach/mbox.h | 40
> ++++++++++++++++++++-----------
>  2 files changed, 49 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c
> b/arch/arm/boards/raspberry-pi/rpi-common.c
> index b7ce0ad42..eefa8bcfb 100644
> --- a/arch/arm/boards/raspberry-pi/rpi-common.c
> +++ b/arch/arm/boards/raspberry-pi/rpi-common.c
> @@ -166,16 +166,30 @@ const struct rpi_model rpi_models_old_scheme[] = {
>         RPI_MODEL(BCM2835_BOARD_REV_B_REV2_d, "Model B rev2", rpi_b_init),
>         RPI_MODEL(BCM2835_BOARD_REV_B_REV2_e, "Model B rev2", rpi_b_init),
>         RPI_MODEL(BCM2835_BOARD_REV_B_REV2_f, "Model B rev2", rpi_b_init),
> -       RPI_MODEL(BCM2835_BOARD_REV_B_PLUS, "Model B+", rpi_b_plus_init),
> -       RPI_MODEL(BCM2835_BOARD_REV_CM, "Compute Module", NULL),
> -       RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, "Model A+", NULL),
> +       RPI_MODEL(BCM2835_BOARD_REV_B_PLUS_10, "Model B+", rpi_b_plus_init),
> +       RPI_MODEL(BCM2835_BOARD_REV_CM_11, "Compute Module", NULL),
> +       RPI_MODEL(BCM2835_BOARD_REV_A_PLUS_12, "Model A+", NULL),
> +       RPI_MODEL(BCM2835_BOARD_REV_B_PLUS_13, "Model B+", rpi_b_plus_init),
> +       RPI_MODEL(BCM2835_BOARD_REV_CM_14, "Compute Module", NULL),
> +       RPI_MODEL(BCM2835_BOARD_REV_A_PLUS_15, "Model A+", NULL),
>  };
> 
>  const struct rpi_model rpi_models_new_scheme[] = {
> -       RPI_MODEL(0, "Unknown model", NULL),
> -       RPI_MODEL(BCM2836_BOARD_REV_2_B, "2 Model B", rpi_b_plus_init),
> -       RPI_MODEL(BCM2837_BOARD_REV_3_B, "3 Model B", rpi_b_plus_init),
> -       RPI_MODEL(BCM2835_BOARD_REV_ZERO, "Zero", rpi_b_plus_init),
> +       RPI_MODEL(BCM2835_BOARD_REV_A,          "Model A",      NULL ),
> // 0
> +       RPI_MODEL(BCM2835_BOARD_REV_B,          "Model B",      rpi_b_init
> ),           // 1
> +       RPI_MODEL(BCM2835_BOARD_REV_A_PLUS,     "Model A+",     NULL ),
> // 2
> +       RPI_MODEL(BCM2835_BOARD_REV_B_PLUS,     "Model B+",
> rpi_b_plus_init ),      // 3
> +       RPI_MODEL(BCM2836_BOARD_REV_2_B,        "Model 2B",
> rpi_b_plus_init),       // 4
> +       RPI_MODEL(BCM283x_BOARD_REV_Alpha,      "Alpha",        NULL),
> // 5
> +       RPI_MODEL(BCM2835_BOARD_REV_CM1,        "Compute Module", NULL ),
> // 6
> +       RPI_MODEL(0, "Unknown model", NULL),
> // 7
> +       RPI_MODEL(BCM2837_BOARD_REV_3_B,        "Model 3B",     rpi_b_init
> ),           // 8
> +       RPI_MODEL(BCM2835_BOARD_REV_ZERO,       "Zero",
> rpi_b_plus_init),       // 9
> +       RPI_MODEL(BCM2837_BOARD_REV_CM3,        "Compute Module 3", NULL ),
> // a
> +       RPI_MODEL(0, "Unknown model", NULL),
> // b
> +       RPI_MODEL(BCM2835_BOARD_REV_ZERO_W,     "Zero W",
> rpi_b_plus_init),       // c
> +       RPI_MODEL(BCM2837B0_BOARD_REV_3B_PLUS, "Model 3 B+",
> rpi_b_plus_init ),      // d
> +       RPI_MODEL(BCM2837B0_BOARD_REV_3A_PLUS, "Nodel 3 A+",
> rpi_b_plus_init),       // e
>  };
> 
>  static int rpi_board_rev = 0;
> @@ -211,10 +225,12 @@ static void rpi_get_board_rev(void)
>          * http://www.raspberrypi.org/forums/viewtopic.php?f=31&t=20594
>          */
>         rpi_board_rev = msg->get_board_rev.body.resp.rev;
> +       printf("RPI: Board rev %x\n", rpi_board_rev);
>         if (rpi_board_rev & 0x800000) {
>                 rpi_board_rev = (rpi_board_rev >> 4) & 0xff;
>                 rpi_models = rpi_models_new_scheme;
>                 rpi_models_size = ARRAY_SIZE(rpi_models_new_scheme);
> +               printf("RPI: Board rev %u new\n", rpi_board_rev);

Are these printfs necessary? Looks like debugging aid. If yes, please
remove.

Otherwise the patch looks fine, but I can't apply it due to whitespace
damages. Could you send it using git-send-emain? If that's no option
maybe a github pull request could do it.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rpi: completed new revision scheme
  2019-01-28  8:02 ` Sascha Hauer
@ 2019-01-28  9:57   ` Moritz Augsburger
  2019-01-29 15:26     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Moritz Augsburger @ 2019-01-28  9:57 UTC (permalink / raw)
  To: Barebox List

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

Hi Sascha,

Am 2019-01-28 09:02, schrieb Sascha Hauer:
>>  static int rpi_board_rev = 0;
>> @@ -211,10 +225,12 @@ static void rpi_get_board_rev(void)
>>          * 
>> http://www.raspberrypi.org/forums/viewtopic.php?f=31&t=20594
>>          */
>>         rpi_board_rev = msg->get_board_rev.body.resp.rev;
>> +       printf("RPI: Board rev %x\n", rpi_board_rev);
>>         if (rpi_board_rev & 0x800000) {
>>                 rpi_board_rev = (rpi_board_rev >> 4) & 0xff;
>>                 rpi_models = rpi_models_new_scheme;
>>                 rpi_models_size = ARRAY_SIZE(rpi_models_new_scheme);
>> +               printf("RPI: Board rev %u new\n", rpi_board_rev);
> 
> Are these printfs necessary? Looks like debugging aid. If yes, please
> remove.

You're right, they were overseen and are a debugging leftover.

> Otherwise the patch looks fine, but I can't apply it due to whitespace
> damages. Could you send it using git-send-emain? If that's no option
> maybe a github pull request could do it.

This time as attachement, hope it  works better.

Best regards
Moritz

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-rpi-complete-new-revision-scheme.patch --]
[-- Type: text/x-diff; name=0001-rpi-complete-new-revision-scheme.patch, Size: 5010 bytes --]

From 744fd4acd8a3a5ee48e68b3e1f3e14e25386a49a Mon Sep 17 00:00:00 2001
From: Moritz Augsburger <moritz@augsburger.name>
Date: Mon, 28 Jan 2019 09:51:25 +0000
Subject: [PATCH] rpi: complete new revision scheme

---
 arch/arm/boards/raspberry-pi/rpi-common.c | 29 +++++++++++++++------
 arch/arm/mach-bcm283x/include/mach/mbox.h | 42 +++++++++++++++++++------------
 2 files changed, 47 insertions(+), 24 deletions(-)

diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index 650b26ce7..09d020547 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -166,17 +166,30 @@ const struct rpi_model rpi_models_old_scheme[] = {
 	RPI_MODEL(BCM2835_BOARD_REV_B_REV2_d, "Model B rev2", rpi_b_init),
 	RPI_MODEL(BCM2835_BOARD_REV_B_REV2_e, "Model B rev2", rpi_b_init),
 	RPI_MODEL(BCM2835_BOARD_REV_B_REV2_f, "Model B rev2", rpi_b_init),
-	RPI_MODEL(BCM2835_BOARD_REV_B_PLUS, "Model B+", rpi_b_plus_init),
-	RPI_MODEL(BCM2835_BOARD_REV_CM, "Compute Module", NULL),
-	RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, "Model A+", NULL),
+	RPI_MODEL(BCM2835_BOARD_REV_B_PLUS_10, "Model B+", rpi_b_plus_init),
+	RPI_MODEL(BCM2835_BOARD_REV_CM_11, "Compute Module", NULL),
+	RPI_MODEL(BCM2835_BOARD_REV_A_PLUS_12, "Model A+", NULL),
+	RPI_MODEL(BCM2835_BOARD_REV_B_PLUS_13, "Model B+", rpi_b_plus_init),
+	RPI_MODEL(BCM2835_BOARD_REV_CM_14, "Compute Module", NULL),
+	RPI_MODEL(BCM2835_BOARD_REV_A_PLUS_15, "Model A+", NULL),
 };
 
 const struct rpi_model rpi_models_new_scheme[] = {
-	RPI_MODEL(0, "Unknown model", NULL),
-	RPI_MODEL(BCM2836_BOARD_REV_2_B, "2 Model B", rpi_b_plus_init),
-	RPI_MODEL(BCM2837_BOARD_REV_3_B, "3 Model B", rpi_b_plus_init),
-	RPI_MODEL(BCM2835_BOARD_REV_ZERO, "Zero", rpi_b_plus_init),
-	RPI_MODEL(BCM2835_BOARD_REV_ZERO_W, "Zero W", rpi_b_plus_init),
+	RPI_MODEL(BCM2835_BOARD_REV_A, 		"Model A",	NULL ),
+	RPI_MODEL(BCM2835_BOARD_REV_B, 		"Model B", 	rpi_b_init ),
+	RPI_MODEL(BCM2835_BOARD_REV_A_PLUS, 	"Model A+", 	NULL ),
+	RPI_MODEL(BCM2835_BOARD_REV_B_PLUS, 	"Model B+", 	rpi_b_plus_init ),
+	RPI_MODEL(BCM2836_BOARD_REV_2_B, 	"Model 2B", 	rpi_b_plus_init),
+	RPI_MODEL(BCM283x_BOARD_REV_Alpha, 	"Alpha", 	NULL),
+	RPI_MODEL(BCM2835_BOARD_REV_CM1, 	"Compute Module", NULL ),
+	RPI_MODEL(0x7, "Unknown model", NULL),
+	RPI_MODEL(BCM2837_BOARD_REV_3_B, 	"Model 3B", 	rpi_b_init ),
+	RPI_MODEL(BCM2835_BOARD_REV_ZERO, 	"Zero", 	rpi_b_plus_init),
+	RPI_MODEL(BCM2837_BOARD_REV_CM3, 	"Compute Module 3", NULL ),
+	RPI_MODEL(0xb, "Unknown model", NULL),
+	RPI_MODEL(BCM2835_BOARD_REV_ZERO_W, 	"Zero W", 	rpi_b_plus_init),
+	RPI_MODEL(BCM2837B0_BOARD_REV_3B_PLUS, 	"Model 3 B+", 	rpi_b_plus_init ),
+	RPI_MODEL(BCM2837B0_BOARD_REV_3A_PLUS, 	"Nodel 3 A+", 	rpi_b_plus_init),
 };
 
 static int rpi_board_rev = 0;
diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h b/arch/arm/mach-bcm283x/include/mach/mbox.h
index 76b573f85..e4f6cb675 100644
--- a/arch/arm/mach-bcm283x/include/mach/mbox.h
+++ b/arch/arm/mach-bcm283x/include/mach/mbox.h
@@ -127,20 +127,12 @@ struct bcm2835_mbox_tag_hdr {
 
 #define BCM2835_MBOX_TAG_GET_BOARD_REV	0x00010002
 
-/* RPi 2 */
-#define BCM2836_BOARD_REV_2_B		0x4
-/* RPi 3 */
-#define BCM2837_BOARD_REV_3_B		0x8
-/* Zero */
-#define BCM2835_BOARD_REV_ZERO		0x9
-/* Zero W */
-#define BCM2835_BOARD_REV_ZERO_W	0xc
-
 /*
- * 0x2..0xf from:
- * http://raspberryalphaomega.org.uk/2013/02/06/automatic-raspberry-pi-board-revision-detection-model-a-b1-and-b2/
- * http://www.raspberrypi.org/forums/viewtopic.php?f=63&t=32733
- * 0x10, 0x11 from swarren's testing
+ * ids
+ * 	https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
+ * cpu info
+ * 	https://en.wikipedia.org/wiki/Raspberry_Pi#Processor
+ *
  */
 #define BCM2835_BOARD_REV_B_I2C0_2	0x2
 #define BCM2835_BOARD_REV_B_I2C0_3	0x3
@@ -153,9 +145,27 @@ struct bcm2835_mbox_tag_hdr {
 #define BCM2835_BOARD_REV_B_REV2_d	0xd
 #define BCM2835_BOARD_REV_B_REV2_e	0xe
 #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
+#define BCM2835_BOARD_REV_B_PLUS_10	0x10
+#define BCM2835_BOARD_REV_CM_11		0x11
+#define BCM2835_BOARD_REV_A_PLUS_12	0x12
+#define BCM2835_BOARD_REV_B_PLUS_13	0x13
+#define BCM2835_BOARD_REV_CM_14		0x14
+#define BCM2835_BOARD_REV_A_PLUS_15	0x15
+
+
+#define BCM2835_BOARD_REV_A   		0x00
+#define BCM2835_BOARD_REV_B   		0x01
+#define BCM2835_BOARD_REV_A_PLUS   	0x02
+#define BCM2835_BOARD_REV_B_PLUS   	0x03
+#define BCM2836_BOARD_REV_2_B   	0x04
+#define BCM283x_BOARD_REV_Alpha   	0x05
+#define BCM2835_BOARD_REV_CM1   	0x06
+#define BCM2837_BOARD_REV_3_B   	0x08
+#define BCM2835_BOARD_REV_ZERO   	0x09
+#define BCM2837_BOARD_REV_CM3   	0x0a
+#define BCM2835_BOARD_REV_ZERO_W   	0x0c
+#define BCM2837B0_BOARD_REV_3B_PLUS   	0x0d
+#define BCM2837B0_BOARD_REV_3A_PLUS   	0x0e
 
 struct bcm2835_mbox_tag_get_board_rev {
 	struct bcm2835_mbox_tag_hdr tag_hdr;
-- 
2.11.0


[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rpi: completed new revision scheme
  2019-01-28  9:57   ` Moritz Augsburger
@ 2019-01-29 15:26     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2019-01-29 15:26 UTC (permalink / raw)
  To: Moritz Augsburger; +Cc: Barebox List

On Mon, Jan 28, 2019 at 10:57:00AM +0100, Moritz Augsburger wrote:
> Hi Sascha,
> 
> Am 2019-01-28 09:02, schrieb Sascha Hauer:
> > >  static int rpi_board_rev = 0;
> > > @@ -211,10 +225,12 @@ static void rpi_get_board_rev(void)
> > >          *
> > > http://www.raspberrypi.org/forums/viewtopic.php?f=31&t=20594
> > >          */
> > >         rpi_board_rev = msg->get_board_rev.body.resp.rev;
> > > +       printf("RPI: Board rev %x\n", rpi_board_rev);
> > >         if (rpi_board_rev & 0x800000) {
> > >                 rpi_board_rev = (rpi_board_rev >> 4) & 0xff;
> > >                 rpi_models = rpi_models_new_scheme;
> > >                 rpi_models_size = ARRAY_SIZE(rpi_models_new_scheme);
> > > +               printf("RPI: Board rev %u new\n", rpi_board_rev);
> > 
> > Are these printfs necessary? Looks like debugging aid. If yes, please
> > remove.
> 
> You're right, they were overseen and are a debugging leftover.
> 
> > Otherwise the patch looks fine, but I can't apply it due to whitespace
> > damages. Could you send it using git-send-emain? If that's no option
> > maybe a github pull request could do it.
> 
> This time as attachement, hope it  works better.

Indeed, yes. Applied, thanks

Sascha



-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-29 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 16:28 [PATCH] rpi: completed new revision scheme Moritz Augsburger
2019-01-28  8:02 ` Sascha Hauer
2019-01-28  9:57   ` Moritz Augsburger
2019-01-29 15:26     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox