From 5e0b35c3e05a2ab26a21ba56269a8d8ecb97b6a0 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 19 May 2017 13:21:57 -0700 Subject: rdc: add macros for memory alignment Add helper macros which allow to align memory for RDC memory region mappings. Signed-off-by: Stefan Agner --- platform/drivers/inc/rdc.h | 7 +++++++ 1 file changed, 7 insertions(+) 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 #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 * @{ -- cgit v1.2.3