Lines Matching full:ipa

15 #include "ipa.h"
22 * DOC: IPA Immediate Commands
24 * The AP command TX endpoint is used to issue immediate commands to the IPA.
25 * An immediate command is generally used to request the IPA do something
74 /* For IPA v4.0+, this opcode gets modified with pipeline clear options */
80 __le16 flags; /* Unused/reserved for IPA v3.5.1 */
84 __le32 clear_options; /* Unused/reserved for IPA v4.0+ */
88 /* The next field is present for IPA v4.0 and above */
90 /* The next field is present for IPA v3.5.1 only */
93 /* The next field and its values are present for IPA v3.5.1 only */
108 /* For IPA v4.0+, this opcode gets modified with pipeline clear options */
126 /* The next two fields are present for IPA v3.5.1 only. */
168 bool ipa_cmd_table_valid(struct ipa *ipa, const struct ipa_mem *mem, in ipa_cmd_table_valid() argument
171 struct device *dev = &ipa->pdev->dev; in ipa_cmd_table_valid()
177 ipa->mem_offset > offset_max - mem->offset) { in ipa_cmd_table_valid()
182 ipa->mem_offset, mem->offset, offset_max); in ipa_cmd_table_valid()
186 if (mem->offset > ipa->mem_size || in ipa_cmd_table_valid()
187 mem->size > ipa->mem_size - mem->offset) { in ipa_cmd_table_valid()
192 mem->offset, mem->size, ipa->mem_size); in ipa_cmd_table_valid()
200 static bool ipa_cmd_header_valid(struct ipa *ipa) in ipa_cmd_header_valid() argument
202 const struct ipa_mem *mem = &ipa->mem[IPA_MEM_MODEM_HEADER]; in ipa_cmd_header_valid()
203 struct device *dev = &ipa->pdev->dev; in ipa_cmd_header_valid()
210 ipa->mem_offset > offset_max - mem->offset) { in ipa_cmd_header_valid()
213 ipa->mem_offset + mem->offset, offset_max); in ipa_cmd_header_valid()
218 size = ipa->mem[IPA_MEM_MODEM_HEADER].size; in ipa_cmd_header_valid()
219 size += ipa->mem[IPA_MEM_AP_HEADER].size; in ipa_cmd_header_valid()
220 if (mem->offset > ipa->mem_size || size > ipa->mem_size - mem->offset) { in ipa_cmd_header_valid()
223 mem->offset, size, ipa->mem_size); in ipa_cmd_header_valid()
231 static bool ipa_cmd_register_write_offset_valid(struct ipa *ipa, in ipa_cmd_register_write_offset_valid() argument
235 struct device *dev = &ipa->pdev->dev; in ipa_cmd_register_write_offset_valid()
240 * on the version of IPA. IPA v3.5.1 supports a 16 bit offset, but in ipa_cmd_register_write_offset_valid()
244 if (ipa->version != IPA_VERSION_3_5_1) in ipa_cmd_register_write_offset_valid()
249 if (offset > offset_max || ipa->mem_offset > offset_max - offset) { in ipa_cmd_register_write_offset_valid()
251 ipa->mem_offset + offset, offset_max); in ipa_cmd_register_write_offset_valid()
259 static bool ipa_cmd_register_write_valid(struct ipa *ipa) in ipa_cmd_register_write_valid() argument
264 offset = ipa_reg_filt_rout_hash_flush_offset(ipa->version); in ipa_cmd_register_write_valid()
266 if (!ipa_cmd_register_write_offset_valid(ipa, name, offset)) in ipa_cmd_register_write_valid()
271 if (!ipa_cmd_register_write_offset_valid(ipa, name, offset)) in ipa_cmd_register_write_valid()
277 bool ipa_cmd_data_valid(struct ipa *ipa) in ipa_cmd_data_valid() argument
279 if (!ipa_cmd_header_valid(ipa)) in ipa_cmd_data_valid()
282 if (!ipa_cmd_register_write_valid(ipa)) in ipa_cmd_data_valid()
329 ipa_cmd_payload_alloc(struct ipa *ipa, dma_addr_t *addr) in ipa_cmd_payload_alloc() argument
334 endpoint = ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]; in ipa_cmd_payload_alloc()
335 trans_info = &ipa->gsi.channel[endpoint->channel_id].trans_info; in ipa_cmd_payload_alloc()
346 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_cmd_table_init_add() local
354 offset += ipa->mem_offset; in ipa_cmd_table_init_add()
361 hash_offset += ipa->mem_offset; in ipa_cmd_table_init_add()
368 cmd_payload = ipa_cmd_payload_alloc(ipa, &payload_addr); in ipa_cmd_table_init_add()
381 /* Initialize header space in IPA-local memory */
385 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_cmd_hdr_init_local_add() local
393 offset += ipa->mem_offset; in ipa_cmd_hdr_init_local_add()
395 /* With this command we tell the IPA where in its local memory the in ipa_cmd_hdr_init_local_add()
397 * also written via DMA into that space. The IPA hardware owns in ipa_cmd_hdr_init_local_add()
400 cmd_payload = ipa_cmd_payload_alloc(ipa, &payload_addr); in ipa_cmd_hdr_init_local_add()
415 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_cmd_register_write_add() local
427 if (ipa->version != IPA_VERSION_3_5_1) { in ipa_cmd_register_write_add()
452 cmd_payload = ipa_cmd_payload_alloc(ipa, &payload_addr); in ipa_cmd_register_write_add()
468 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_cmd_ip_packet_init_add() local
478 cmd_payload = ipa_cmd_payload_alloc(ipa, &payload_addr); in ipa_cmd_ip_packet_init_add()
488 /* Use a DMA command to read or write a block of IPA-resident memory */
492 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_cmd_dma_shared_mem_add() local
502 /* assert(offset <= U16_MAX && ipa->mem_offset <= U16_MAX - offset); */ in ipa_cmd_dma_shared_mem_add()
504 offset += ipa->mem_offset; in ipa_cmd_dma_shared_mem_add()
506 cmd_payload = ipa_cmd_payload_alloc(ipa, &payload_addr); in ipa_cmd_dma_shared_mem_add()
509 /* payload->clear_after_read was reserved prior to IPA v4.0. It's in ipa_cmd_dma_shared_mem_add()
515 * direction: 0 = write to IPA, 1 read from IPA in ipa_cmd_dma_shared_mem_add()
534 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_cmd_ip_tag_status_add() local
543 cmd_payload = ipa_cmd_payload_alloc(ipa, &payload_addr); in ipa_cmd_ip_tag_status_add()
555 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_cmd_transfer_add() local
564 payload = ipa_cmd_payload_alloc(ipa, &payload_addr); in ipa_cmd_transfer_add()
572 struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); in ipa_cmd_tag_process_add() local
575 endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]; in ipa_cmd_tag_process_add()
589 void ipa_cmd_tag_process(struct ipa *ipa) in ipa_cmd_tag_process() argument
594 trans = ipa_cmd_trans_alloc(ipa, count); in ipa_cmd_tag_process()
599 dev_err(&ipa->pdev->dev, in ipa_cmd_tag_process()
609 channel = &endpoint->ipa->gsi.channel[endpoint->channel_id]; in ipa_cmd_info_alloc()
615 struct gsi_trans *ipa_cmd_trans_alloc(struct ipa *ipa, u32 tre_count) in ipa_cmd_trans_alloc() argument
620 endpoint = ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]; in ipa_cmd_trans_alloc()
622 trans = gsi_channel_trans_alloc(&ipa->gsi, endpoint->channel_id, in ipa_cmd_trans_alloc()