Lines Matching refs:cmd

118 	struct qcom_scm_command *cmd;  in alloc_qcom_scm_command()  local
119 size_t len = sizeof(*cmd) + sizeof(struct qcom_scm_response) + cmd_size + in alloc_qcom_scm_command()
123 cmd = kzalloc(PAGE_ALIGN(len), GFP_KERNEL); in alloc_qcom_scm_command()
124 if (cmd) { in alloc_qcom_scm_command()
125 cmd->len = cpu_to_le32(len); in alloc_qcom_scm_command()
127 cmd->buf_offset = cpu_to_le32(offset); in alloc_qcom_scm_command()
128 cmd->resp_hdr_offset = cpu_to_le32(offset + cmd_size); in alloc_qcom_scm_command()
130 return cmd; in alloc_qcom_scm_command()
139 static inline void free_qcom_scm_command(struct qcom_scm_command *cmd) in free_qcom_scm_command() argument
141 kfree(cmd); in free_qcom_scm_command()
151 const struct qcom_scm_command *cmd) in qcom_scm_command_to_response() argument
153 return (void *)cmd + le32_to_cpu(cmd->resp_hdr_offset); in qcom_scm_command_to_response()
162 static inline void *qcom_scm_get_command_buffer(const struct qcom_scm_command *cmd) in qcom_scm_get_command_buffer() argument
164 return (void *)cmd->buf; in qcom_scm_get_command_buffer()
219 static int __qcom_scm_call(const struct qcom_scm_command *cmd) in __qcom_scm_call() argument
222 u32 cmd_addr = virt_to_phys(cmd); in __qcom_scm_call()
228 __cpuc_flush_dcache_area((void *)cmd, cmd->len); in __qcom_scm_call()
229 outer_flush_range(cmd_addr, cmd_addr + cmd->len); in __qcom_scm_call()
279 struct qcom_scm_command *cmd; in qcom_scm_call() local
283 cmd = alloc_qcom_scm_command(cmd_len, resp_len); in qcom_scm_call()
284 if (!cmd) in qcom_scm_call()
287 cmd->id = cpu_to_le32((svc_id << 10) | cmd_id); in qcom_scm_call()
289 memcpy(qcom_scm_get_command_buffer(cmd), cmd_buf, cmd_len); in qcom_scm_call()
292 ret = __qcom_scm_call(cmd); in qcom_scm_call()
297 rsp = qcom_scm_command_to_response(cmd); in qcom_scm_call()
310 free_qcom_scm_command(cmd); in qcom_scm_call()
316 #define SCM_ATOMIC(svc, cmd, n) (((((svc) << 10)|((cmd) & 0x3ff)) << 12) | \ argument
330 static s32 qcom_scm_call_atomic1(u32 svc, u32 cmd, u32 arg1) in qcom_scm_call_atomic1() argument
334 register u32 r0 asm("r0") = SCM_ATOMIC(svc, cmd, 1); in qcom_scm_call_atomic1()
399 } cmd; in qcom_scm_set_boot_addr() local
401 cmd.addr = cpu_to_le32(addr); in qcom_scm_set_boot_addr()
402 cmd.flags = cpu_to_le32(flags); in qcom_scm_set_boot_addr()
404 &cmd, sizeof(cmd), NULL, 0); in qcom_scm_set_boot_addr()