summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2017-05-19 13:21:57 -0700
committerStefan Agner <stefan.agner@toradex.com>2017-05-22 17:09:55 -0700
commit5e0b35c3e05a2ab26a21ba56269a8d8ecb97b6a0 (patch)
tree0a734f4003402729efc434d67bdd9ffd58434f6c /platform
parent9b8b9edd56a16b1b69f2952b0aa84290f0b9ea39 (diff)
rdc: add macros for memory alignment
Add helper macros which allow to align memory for RDC memory region mappings. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/drivers/inc/rdc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/drivers/inc/rdc.h b/platform/drivers/inc/rdc.h
index 872e39d..1a10975 100644
--- a/platform/drivers/inc/rdc.h
+++ b/platform/drivers/inc/rdc.h
@@ -36,6 +36,13 @@
#include <assert.h>
#include "device_imx.h"
+#define __round_mask(x, y) ((typeof(x))((y)-1))
+#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
+#define round_down(x, y) ((x) & ~__round_mask(x, y))
+
+#define RDC_REGION_RES_MMDC 4096
+#define RDC_REGION_RES_OCRAM 128
+
/*!
* @addtogroup rdc_driver
* @{