Lines Matching defs:section

117  * struct panthor_fw_binary_section_entry_hdr - Describes a section of FW binary
123 /** @va: MCU virtual range to map this binary section to. */
132 /** @data: Data to initialize the FW section with. */
166 * struct panthor_fw_section - FW section
179 * @name: Name of the section, as specified in the binary.
239 /** @shared_section: The section containing the FW interfaces. */
399 struct panthor_fw_section *section)
401 bool was_mapped = !!section->mem->kmap;
404 if (!section->data.size &&
405 !(section->flags & CSF_FW_BINARY_IFACE_ENTRY_ZERO))
408 ret = panthor_kernel_bo_vmap(section->mem);
412 memcpy(section->mem->kmap, section->data.buf, section->data.size);
413 if (section->flags & CSF_FW_BINARY_IFACE_ENTRY_ZERO) {
414 memset(section->mem->kmap + section->data.size, 0,
415 panthor_kernel_bo_size(section->mem) - section->data.size);
419 panthor_kernel_bo_vunmap(section->mem);
496 struct panthor_fw_section *section;
550 section = drmm_kzalloc(&ptdev->base, sizeof(*section), GFP_KERNEL);
551 if (!section)
554 list_add_tail(&section->node, &ptdev->fw->sections);
555 section->flags = hdr.flags;
556 section->data.size = hdr.data.end - hdr.data.start;
558 if (section->data.size > 0) {
559 void *data = drmm_kmalloc(&ptdev->base, section->data.size, GFP_KERNEL);
564 memcpy(data, fw->data + hdr.data.start, section->data.size);
565 section->data.buf = data;
576 section->name = name;
603 section->mem = panthor_kernel_bo_create(ptdev, panthor_fw_vm(ptdev),
606 vm_map_flags, va, "FW section");
607 if (IS_ERR(section->mem))
608 return PTR_ERR(section->mem);
610 if (drm_WARN_ON(&ptdev->base, section->mem->va_node.start != hdr.va.start))
613 if (section->flags & CSF_FW_BINARY_IFACE_ENTRY_SHARED) {
614 ret = panthor_kernel_bo_vmap(section->mem);
619 panthor_fw_init_section_mem(ptdev, section);
621 bo = to_panthor_bo(section->mem->obj);
630 ptdev->fw->shared_section = section;
677 struct panthor_fw_section *section;
679 list_for_each_entry(section, &ptdev->fw->sections, node) {
682 if (!full_reload && !(section->flags & CSF_FW_BINARY_IFACE_ENTRY_WR))
685 panthor_fw_init_section_mem(ptdev, section);
686 sgt = drm_gem_shmem_get_pages_sgt(&to_panthor_bo(section->mem->obj)->base);
808 * Return: NULL if the address is not part of the shared section, non-NULL otherwise.
1162 struct panthor_fw_section *section;
1174 list_for_each_entry(section, &ptdev->fw->sections, node)
1175 panthor_kernel_bo_destroy(section->mem);