]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: socfpga: stratix10: Add macros for mailbox's arguments
authorAng, Chee Hong <chee.hong.ang@intel.com>
Thu, 20 Dec 2018 02:35:13 +0000 (18:35 -0800)
committerMarek Vasut <marex@denx.de>
Thu, 20 Dec 2018 16:12:25 +0000 (17:12 +0100)
Add macros for specifying number of arguments in mailbox command.

Signed-off-by: Ang, Chee Hong <chee.hong.ang@intel.com>
arch/arm/mach-socfpga/include/mach/mailbox_s10.h

index 660df35ab2543320b3cf063c67ec65d220ab0d15..ae728a5df5f8fa7a4b4885e91c4c4ec7bd9f7625 100644 (file)
@@ -107,6 +107,12 @@ enum ALT_SDM_MBOX_RESP_CODE {
 #define RECONFIG_STATUS_PIN_STATUS                     2
 #define RECONFIG_STATUS_SOFTFUNC_STATUS                        3
 
+/* Macros for specifying number of arguments in mailbox command */
+#define MBOX_NUM_ARGS(n, b)                            (((n) & 0xFF) << (b))
+#define MBOX_DIRECT_COUNT(n)                           MBOX_NUM_ARGS((n), 0)
+#define MBOX_ARG_DESC_COUNT(n)                         MBOX_NUM_ARGS((n), 8)
+#define MBOX_RESP_DESC_COUNT(n)                                MBOX_NUM_ARGS((n), 16)
+
 #define MBOX_CFGSTAT_STATE_IDLE                                0x00000000
 #define MBOX_CFGSTAT_STATE_CONFIG                      0x10000000
 #define MBOX_CFGSTAT_STATE_FAILACK                     0x08000000