add polling function in cmdq helper functions
Showing the changes to include/linux (2 of 3 files). Show all
Unified · Split
| @@ -55,6 +55,7 @@ · 54 unmodified lines | |||
| 55 | enum cmdq_code { | 55 | enum cmdq_code { |
| 56 | CMDQ_CODE_MASK = 0x02, | 56 | CMDQ_CODE_MASK = 0x02, |
| 57 | CMDQ_CODE_WRITE = 0x04, | 57 | CMDQ_CODE_WRITE = 0x04, |
| 58 | CMDQ_CODE_POLL = 0x08, | ||
| 58 | CMDQ_CODE_JUMP = 0x10, | 59 | CMDQ_CODE_JUMP = 0x10, |
| 59 | CMDQ_CODE_WFE = 0x20, | 60 | CMDQ_CODE_WFE = 0x20, |
| 60 | CMDQ_CODE_EOC = 0x40, | 61 | CMDQ_CODE_EOC = 0x40, |
| @@ -99,6 +99,38 @@ int cmdq_pkt_wfe(struct cmdq_pkt *pkt, u16 event); · 98 unmodified lines | |||
| 99 | */ | 99 | */ |
| 100 | int cmdq_pkt_clear_event(struct cmdq_pkt *pkt, u16 event); | 100 | int cmdq_pkt_clear_event(struct cmdq_pkt *pkt, u16 event); |
| 101 | 101 | ||
| 102 | /** | ||
| 103 | * cmdq_pkt_poll() - Append polling command to the CMDQ packet, ask GCE to | ||
| 104 | * execute an instruction that wait for a specified | ||
| 105 | * hardware register to check for the value w/o mask. | ||
| 106 | * All GCE hardware threads will be blocked by this | ||
| 107 | * instruction. | ||
| 108 | * @pkt: the CMDQ packet | ||
| 109 | * @subsys: the CMDQ sub system code | ||
| 110 | * @offset: register offset from CMDQ sub system | ||
| 111 | * @value: the specified target register value | ||
| 112 | * | ||
| 113 | * Return: 0 for success; else the error code is returned | ||
| 114 | */ | ||
| 115 | int cmdq_pkt_poll(struct cmdq_pkt *pkt, u8 subsys, | ||
| 116 | u16 offset, u32 value); | ||
| 117 | |||
| 118 | /** | ||
| 119 | * cmdq_pkt_poll_mask() - Append polling command to the CMDQ packet, ask GCE to | ||
| 120 | * execute an instruction that wait for a specified | ||
| 121 | * hardware register to check for the value w/ mask. | ||
| 122 | * All GCE hardware threads will be blocked by this | ||
| 123 | * instruction. | ||
| 124 | * @pkt: the CMDQ packet | ||
| 125 | * @subsys: the CMDQ sub system code | ||
| 126 | * @offset: register offset from CMDQ sub system | ||
| 127 | * @value: the specified target register value | ||
| 128 | * @mask: the specified target register mask | ||
| 129 | * | ||
| 130 | * Return: 0 for success; else the error code is returned | ||
| 131 | */ | ||
| 132 | int cmdq_pkt_poll_mask(struct cmdq_pkt *pkt, u8 subsys, | ||
| 133 | u16 offset, u32 value, u32 mask); | ||
| 102 | /** | 134 | /** |
| 103 | * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ | 135 | * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ |
| 104 | * packet and call back at the end of done packet | 136 | * packet and call back at the end of done packet |