Lines Matching full:fw

94  * @fw:		Pointer to secure-monitor firmware
105 int meson_sm_call(struct meson_sm_firmware *fw, unsigned int cmd_index, in meson_sm_call() argument
111 if (!fw->chip) in meson_sm_call()
114 cmd = meson_sm_get_cmd(fw->chip, cmd_index); in meson_sm_call()
130 * @fw: Pointer to secure-monitor firmware
144 int meson_sm_call_read(struct meson_sm_firmware *fw, void *buffer, in meson_sm_call_read() argument
151 if (!fw->chip) in meson_sm_call_read()
154 if (!fw->chip->cmd_shmem_out_base) in meson_sm_call_read()
157 if (bsize > fw->chip->shmem_size) in meson_sm_call_read()
160 if (meson_sm_call(fw, cmd_index, &size, arg0, arg1, arg2, arg3, arg4) < 0) in meson_sm_call_read()
177 memcpy(buffer, fw->sm_shmem_out_base, size); in meson_sm_call_read()
186 * @fw: Pointer to secure-monitor firmware
198 int meson_sm_call_write(struct meson_sm_firmware *fw, void *buffer, in meson_sm_call_write() argument
204 if (!fw->chip) in meson_sm_call_write()
207 if (size > fw->chip->shmem_size) in meson_sm_call_write()
210 if (!fw->chip->cmd_shmem_in_base) in meson_sm_call_write()
213 memcpy(fw->sm_shmem_in_base, buffer, size); in meson_sm_call_write()
215 if (meson_sm_call(fw, cmd_index, &written, arg0, arg1, arg2, arg3, arg4) < 0) in meson_sm_call_write()
251 struct meson_sm_firmware *fw; in serial_show() local
255 fw = platform_get_drvdata(pdev); in serial_show()
261 ret = meson_sm_call_read(fw, id_buf, SM_CHIP_ID_LENGTH, SM_GET_CHIP_ID, in serial_show()
292 struct meson_sm_firmware *fw; in meson_sm_probe() local
294 fw = devm_kzalloc(dev, sizeof(*fw), GFP_KERNEL); in meson_sm_probe()
295 if (!fw) in meson_sm_probe()
303 fw->sm_shmem_in_base = meson_sm_map_shmem(chip->cmd_shmem_in_base, in meson_sm_probe()
305 if (WARN_ON(!fw->sm_shmem_in_base)) in meson_sm_probe()
310 fw->sm_shmem_out_base = meson_sm_map_shmem(chip->cmd_shmem_out_base, in meson_sm_probe()
312 if (WARN_ON(!fw->sm_shmem_out_base)) in meson_sm_probe()
316 fw->chip = chip; in meson_sm_probe()
318 platform_set_drvdata(pdev, fw); in meson_sm_probe()
328 iounmap(fw->sm_shmem_out_base); in meson_sm_probe()
330 iounmap(fw->sm_shmem_in_base); in meson_sm_probe()