~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/mailbox/mtk-cmdq-mailbox.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright (c) 2018 MediaTek Inc.
  4  *
  5  */
  6 
  7 #ifndef __MTK_CMDQ_MAILBOX_H__
  8 #define __MTK_CMDQ_MAILBOX_H__
  9 
 10 #include <linux/platform_device.h>
 11 #include <linux/slab.h>
 12 #include <linux/types.h>
 13 
 14 #define CMDQ_INST_SIZE                  8 /* instruction is 64-bit */
 15 #define CMDQ_SUBSYS_SHIFT               16
 16 #define CMDQ_OP_CODE_SHIFT              24
 17 #define CMDQ_JUMP_PASS                  CMDQ_INST_SIZE
 18 
 19 #define CMDQ_WFE_UPDATE                 BIT(31)
 20 #define CMDQ_WFE_UPDATE_VALUE           BIT(16)
 21 #define CMDQ_WFE_WAIT                   BIT(15)
 22 #define CMDQ_WFE_WAIT_VALUE             0x1
 23 
 24 /*
 25  * WFE arg_b
 26  * bit 0-11: wait value
 27  * bit 15: 1 - wait, 0 - no wait
 28  * bit 16-27: update value
 29  * bit 31: 1 - update, 0 - no update
 30  */
 31 #define CMDQ_WFE_OPTION                 (CMDQ_WFE_WAIT | CMDQ_WFE_WAIT_VALUE)
 32 
 33 /** cmdq event maximum */
 34 #define CMDQ_MAX_EVENT                  0x3ff
 35 
 36 /*
 37  * CMDQ_CODE_MASK:
 38  *   set write mask
 39  *   format: op mask
 40  * CMDQ_CODE_WRITE:
 41  *   write value into target register
 42  *   format: op subsys address value
 43  * CMDQ_CODE_JUMP:
 44  *   jump by offset
 45  *   format: op offset
 46  * CMDQ_CODE_WFE:
 47  *   wait for event and clear
 48  *   it is just clear if no wait
 49  *   format: [wait]  op event update:1 to_wait:1 wait:1
 50  *           [clear] op event update:1 to_wait:0 wait:0
 51  * CMDQ_CODE_EOC:
 52  *   end of command
 53  *   format: op irq_flag
 54  */
 55 enum cmdq_code {
 56         CMDQ_CODE_MASK = 0x02,
 57         CMDQ_CODE_WRITE = 0x04,
 58         CMDQ_CODE_POLL = 0x08,
 59         CMDQ_CODE_JUMP = 0x10,
 60         CMDQ_CODE_WFE = 0x20,
 61         CMDQ_CODE_EOC = 0x40,
 62         CMDQ_CODE_READ_S = 0x80,
 63         CMDQ_CODE_WRITE_S = 0x90,
 64         CMDQ_CODE_WRITE_S_MASK = 0x91,
 65         CMDQ_CODE_LOGIC = 0xa0,
 66 };
 67 
 68 struct cmdq_cb_data {
 69         int                     sta;
 70         struct cmdq_pkt         *pkt;
 71 };
 72 
 73 struct cmdq_pkt {
 74         void                    *va_base;
 75         dma_addr_t              pa_base;
 76         size_t                  cmd_buf_size; /* command occupied size */
 77         size_t                  buf_size; /* real buffer size */
 78         void                    *cl;
 79 };
 80 
 81 u8 cmdq_get_shift_pa(struct mbox_chan *chan);
 82 
 83 #endif /* __MTK_CMDQ_MAILBOX_H__ */
 84 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php