Lines Matching refs:gmu

54 static int a6xx_hfi_queue_write(struct a6xx_gmu *gmu,  in a6xx_hfi_queue_write()  argument
78 gmu_write(gmu, REG_A6XX_GMU_HOST2GMU_INTR_SET, 0x01); in a6xx_hfi_queue_write()
99 static void a6xx_hfi_handle_ack(struct a6xx_gmu *gmu, in a6xx_hfi_handle_ack() argument
123 dev_err(gmu->dev, "Nobody was waiting for HFI message %d\n", seqnum); in a6xx_hfi_handle_ack()
126 static void a6xx_hfi_handle_error(struct a6xx_gmu *gmu, in a6xx_hfi_handle_error() argument
131 dev_err(gmu->dev, "GMU firmware error %d\n", error->code); in a6xx_hfi_handle_error()
136 struct a6xx_gmu *gmu = (struct a6xx_gmu *) data; in a6xx_hfi_task() local
137 struct a6xx_hfi_queue *queue = &gmu->queues[HFI_RESPONSE_QUEUE]; in a6xx_hfi_task()
148 dev_err(gmu->dev, in a6xx_hfi_task()
156 a6xx_hfi_handle_ack(gmu, &resp); in a6xx_hfi_task()
158 a6xx_hfi_handle_error(gmu, &resp); in a6xx_hfi_task()
162 static int a6xx_hfi_send_msg(struct a6xx_gmu *gmu, int id, in a6xx_hfi_send_msg() argument
165 struct a6xx_hfi_queue *queue = &gmu->queues[HFI_COMMAND_QUEUE]; in a6xx_hfi_send_msg()
184 ret = a6xx_hfi_queue_write(gmu, queue, data, dwords); in a6xx_hfi_send_msg()
186 dev_err(gmu->dev, "Unable to send message %s id %d\n", in a6xx_hfi_send_msg()
195 dev_err(gmu->dev, in a6xx_hfi_send_msg()
211 dev_err(gmu->dev, "Message %s id %d returned error %d\n", in a6xx_hfi_send_msg()
225 static int a6xx_hfi_send_gmu_init(struct a6xx_gmu *gmu, int boot_state) in a6xx_hfi_send_gmu_init() argument
229 msg.dbg_buffer_addr = (u32) gmu->debug->iova; in a6xx_hfi_send_gmu_init()
230 msg.dbg_buffer_size = (u32) gmu->debug->size; in a6xx_hfi_send_gmu_init()
233 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_INIT, &msg, sizeof(msg), in a6xx_hfi_send_gmu_init()
237 static int a6xx_hfi_get_fw_version(struct a6xx_gmu *gmu, u32 *version) in a6xx_hfi_get_fw_version() argument
244 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_FW_VERSION, &msg, sizeof(msg), in a6xx_hfi_get_fw_version()
248 static int a6xx_hfi_send_perf_table(struct a6xx_gmu *gmu) in a6xx_hfi_send_perf_table() argument
253 msg.num_gpu_levels = gmu->nr_gpu_freqs; in a6xx_hfi_send_perf_table()
254 msg.num_gmu_levels = gmu->nr_gmu_freqs; in a6xx_hfi_send_perf_table()
256 for (i = 0; i < gmu->nr_gpu_freqs; i++) { in a6xx_hfi_send_perf_table()
257 msg.gx_votes[i].vote = gmu->gx_arc_votes[i]; in a6xx_hfi_send_perf_table()
258 msg.gx_votes[i].freq = gmu->gpu_freqs[i] / 1000; in a6xx_hfi_send_perf_table()
261 for (i = 0; i < gmu->nr_gmu_freqs; i++) { in a6xx_hfi_send_perf_table()
262 msg.cx_votes[i].vote = gmu->cx_arc_votes[i]; in a6xx_hfi_send_perf_table()
263 msg.cx_votes[i].freq = gmu->gmu_freqs[i] / 1000; in a6xx_hfi_send_perf_table()
266 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_PERF_TABLE, &msg, sizeof(msg), in a6xx_hfi_send_perf_table()
270 static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu) in a6xx_hfi_send_bw_table() argument
313 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_BW_TABLE, &msg, sizeof(msg), in a6xx_hfi_send_bw_table()
317 static int a6xx_hfi_send_test(struct a6xx_gmu *gmu) in a6xx_hfi_send_test() argument
321 return a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_TEST, &msg, sizeof(msg), in a6xx_hfi_send_test()
325 int a6xx_hfi_start(struct a6xx_gmu *gmu, int boot_state) in a6xx_hfi_start() argument
329 ret = a6xx_hfi_send_gmu_init(gmu, boot_state); in a6xx_hfi_start()
333 ret = a6xx_hfi_get_fw_version(gmu, NULL); in a6xx_hfi_start()
343 ret = a6xx_hfi_send_perf_table(gmu); in a6xx_hfi_start()
347 ret = a6xx_hfi_send_bw_table(gmu); in a6xx_hfi_start()
355 a6xx_hfi_send_test(gmu); in a6xx_hfi_start()
360 void a6xx_hfi_stop(struct a6xx_gmu *gmu) in a6xx_hfi_stop() argument
364 for (i = 0; i < ARRAY_SIZE(gmu->queues); i++) { in a6xx_hfi_stop()
365 struct a6xx_hfi_queue *queue = &gmu->queues[i]; in a6xx_hfi_stop()
371 dev_err(gmu->dev, "HFI queue %d is not empty\n", i); in a6xx_hfi_stop()
402 void a6xx_hfi_init(struct a6xx_gmu *gmu) in a6xx_hfi_init() argument
404 struct a6xx_gmu_bo *hfi = gmu->hfi; in a6xx_hfi_init()
415 table_size += (ARRAY_SIZE(gmu->queues) * in a6xx_hfi_init()
423 table->num_queues = ARRAY_SIZE(gmu->queues); in a6xx_hfi_init()
424 table->active_queues = ARRAY_SIZE(gmu->queues); in a6xx_hfi_init()
428 a6xx_hfi_queue_init(&gmu->queues[0], &headers[0], hfi->virt + offset, in a6xx_hfi_init()
433 a6xx_hfi_queue_init(&gmu->queues[1], &headers[1], hfi->virt + offset, in a6xx_hfi_init()