summaryrefslogtreecommitdiffstats
path: root/bsps/arm/raspberrypi/include/bsp
diff options
context:
space:
mode:
authorChristian Mauderer <christian.mauderer@embedded-brains.de>2019-12-27 22:08:12 +0100
committerChristian Mauderer <christian.mauderer@embedded-brains.de>2020-01-07 17:55:13 +0100
commitf1f6cd95c9f421bdd5683258670a9cea98b794ee (patch)
treeb1af46762a40d9ff9bd00feb33fc43e7e202d03b /bsps/arm/raspberrypi/include/bsp
parentbsps/arm: Define index of the workspace entry. (diff)
downloadrtems-f1f6cd95c9f421bdd5683258670a9cea98b794ee.tar.bz2
bsp/raspberrypi: Fix size of work area.
The BSP tried to get the size of the SDRAM based on the revision code. Unfortunately the code had some bugs so that the default size has been used. Beneath that the MMU table hasn't been adapted. This patch queries the SDRAM size via a special VC Mailbox call instead. For the MMU adaption a simmilar method to the one in the imx BSP is used.
Diffstat (limited to 'bsps/arm/raspberrypi/include/bsp')
-rw-r--r--bsps/arm/raspberrypi/include/bsp/vc.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/bsps/arm/raspberrypi/include/bsp/vc.h b/bsps/arm/raspberrypi/include/bsp/vc.h
index 107b6acf0c..422d28cdd9 100644
--- a/bsps/arm/raspberrypi/include/bsp/vc.h
+++ b/bsps/arm/raspberrypi/include/bsp/vc.h
@@ -138,6 +138,17 @@ int bcm2835_mailbox_get_board_model( bcm2835_get_board_spec_entries *_entries );
int bcm2835_mailbox_get_board_revision(
bcm2835_get_board_spec_entries *_entries );
+/*
+ * See the official documentation for the format of the revision codes:
+ * https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
+ */
+#define BCM2835_REVISION_IS_NEW_STYLE(revision) ((revision & (1 << 23)) != 0)
+#define BCM2835_REVISION_MEMORY_SIZE(revision) ((revision >> 20) & 0x7)
+#define BCM2835_REVISION_MANUFACTURER(revision) ((revision >> 16) & 0xf)
+#define BCM2835_REVISION_PROCESSOR(revision) ((revision >> 12) & 0xf)
+#define BCM2835_REVISION_TYPE(revision) ((revision >> 4) & 0xff)
+#define BCM2835_REVISION_REVISION(revision) ((revision >> 0) & 0xf)
+
typedef struct {
uint64_t board_serial;
} bcm2835_get_board_serial_entries;