]> git.sur5r.net Git - u-boot/commitdiff
rpi: get rid of BCM2835_BOARD_REV_* macros
authorStephen Warren <swarren@wwwdotorg.org>
Sat, 5 Dec 2015 05:07:44 +0000 (22:07 -0700)
committerTom Rini <trini@konsulko.com>
Sat, 5 Dec 2015 23:22:35 +0000 (18:22 -0500)
There are two numbering schemes for the RPi revision values; old and new
scheme. The values within each scheme overlap. Hence, it doesn't make
sense to have absolute/global names for the revision IDs. Get rid of the
names and just use the raw revision/type values to set up the array of
per-revision data.

This change makes most sense when coupled with the next change. However,
it's split out so that the mechanical cut/paste is separate from the
logic changes for easier review and problem bisection.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
arch/arm/mach-bcm283x/include/mach/mbox.h
board/raspberrypi/rpi/rpi.c

index 9260ee2df76c245ad1952064a55527d7940bea4e..af94dff2ac639f11303a349f8afad0413e10e60b 100644 (file)
@@ -125,34 +125,6 @@ struct bcm2835_mbox_tag_hdr {
 
 #define BCM2835_MBOX_TAG_GET_BOARD_REV 0x00010002
 
-#ifdef CONFIG_BCM2836
-#define BCM2836_BOARD_REV_2_B          0x4
-#else
-/*
- * 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
- * http://git.drogon.net/?p=wiringPi;a=blob_plain;f=wiringPi/wiringPi.c;hb=5edd177112c99416f68ba3e8c6c4db6ed942e796
- */
-#define BCM2835_BOARD_REV_B_I2C0_2     0x2
-#define BCM2835_BOARD_REV_B_I2C0_3     0x3
-#define BCM2835_BOARD_REV_B_I2C1_4     0x4
-#define BCM2835_BOARD_REV_B_I2C1_5     0x5
-#define BCM2835_BOARD_REV_B_I2C1_6     0x6
-#define BCM2835_BOARD_REV_A_7          0x7
-#define BCM2835_BOARD_REV_A_8          0x8
-#define BCM2835_BOARD_REV_A_9          0x9
-#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_13    0x13
-#define BCM2835_BOARD_REV_CM_14                0x14
-#define BCM2835_BOARD_REV_A_PLUS_15    0x15
-#endif
-
 struct bcm2835_mbox_tag_get_board_rev {
        struct bcm2835_mbox_tag_hdr tag_hdr;
        union {
index 6451d1d916b103c9bea2fb40d115638ece463fb2..43ed60ae9811c425fdfacd4523483cd0002a43b6 100644 (file)
@@ -74,7 +74,11 @@ struct msg_get_clock_rate {
        u32 end_tag;
 };
 
-/* See comments in mbox.h for data source */
+/*
+ * 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
+ * http://git.drogon.net/?p=wiringPi;a=blob_plain;f=wiringPi/wiringPi.c;hb=5edd177112c99416f68ba3e8c6c4db6ed942e796
+ */
 static const struct {
        const char *name;
        const char *fdtfile;
@@ -90,93 +94,93 @@ static const struct {
                false,
        },
 #ifdef CONFIG_BCM2836
-       [BCM2836_BOARD_REV_2_B] = {
+       [0x4] = {
                "2 Model B",
                "bcm2836-rpi-2-b.dtb",
                true,
        },
 #else
-       [BCM2835_BOARD_REV_B_I2C0_2] = {
+       [0x2] = {
                "Model B (no P5)",
                "bcm2835-rpi-b-i2c0.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_B_I2C0_3] = {
+       [0x3] = {
                "Model B (no P5)",
                "bcm2835-rpi-b-i2c0.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_B_I2C1_4] = {
+       [0x4] = {
                "Model B",
                "bcm2835-rpi-b.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_B_I2C1_5] = {
+       [0x5] = {
                "Model B",
                "bcm2835-rpi-b.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_B_I2C1_6] = {
+       [0x6] = {
                "Model B",
                "bcm2835-rpi-b.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_A_7] = {
+       [0x7] = {
                "Model A",
                "bcm2835-rpi-a.dtb",
                false,
        },
-       [BCM2835_BOARD_REV_A_8] = {
+       [0x8] = {
                "Model A",
                "bcm2835-rpi-a.dtb",
                false,
        },
-       [BCM2835_BOARD_REV_A_9] = {
+       [0x9] = {
                "Model A",
                "bcm2835-rpi-a.dtb",
                false,
        },
-       [BCM2835_BOARD_REV_B_REV2_d] = {
+       [0xd] = {
                "Model B rev2",
                "bcm2835-rpi-b-rev2.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_B_REV2_e] = {
+       [0xe] = {
                "Model B rev2",
                "bcm2835-rpi-b-rev2.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_B_REV2_f] = {
+       [0xf] = {
                "Model B rev2",
                "bcm2835-rpi-b-rev2.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_B_PLUS] = {
+       [0x10] = {
                "Model B+",
                "bcm2835-rpi-b-plus.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_CM] = {
+       [0x11] = {
                "Compute Module",
                "bcm2835-rpi-cm.dtb",
                false,
        },
-       [BCM2835_BOARD_REV_A_PLUS] = {
+       [0x12] = {
                "Model A+",
                "bcm2835-rpi-a-plus.dtb",
                false,
        },
-       [BCM2835_BOARD_REV_B_PLUS_13] = {
+       [0x13] = {
                "Model B+",
                "bcm2835-rpi-b-plus.dtb",
                true,
        },
-       [BCM2835_BOARD_REV_CM_14] = {
+       [0x14] = {
                "Compute Module",
                "bcm2835-rpi-cm.dtb",
                false,
        },
-       [BCM2835_BOARD_REV_A_PLUS_15] = {
+       [0x15] = {
                "Model A+",
                "bcm2835-rpi-a-plus.dtb",
                false,