Lines Matching full:doorbell
28 * amdgpu_mm_rdoorbell - read a doorbell dword
31 * @index: doorbell index
33 * Returns the value in the doorbell aperture at the
34 * requested doorbell index (CIK).
41 if (index < adev->doorbell.num_kernel_doorbells)
42 return readl(adev->doorbell.cpu_addr + index);
44 dev_err(adev->dev, "reading beyond doorbell aperture: 0x%08x!\n",
50 * amdgpu_mm_wdoorbell - write a doorbell dword
53 * @index: doorbell index
56 * Writes @v to the doorbell aperture at the
57 * requested doorbell index (CIK).
64 if (index < adev->doorbell.num_kernel_doorbells)
65 writel(v, adev->doorbell.cpu_addr + index);
68 "writing beyond doorbell aperture: 0x%08x!\n", index);
72 * amdgpu_mm_rdoorbell64 - read a doorbell Qword
75 * @index: doorbell index
77 * Returns the value in the doorbell aperture at the
78 * requested doorbell index (VEGA10+).
85 if (index < adev->doorbell.num_kernel_doorbells)
86 return atomic64_read((atomic64_t *)(adev->doorbell.cpu_addr + index));
88 dev_err(adev->dev, "reading beyond doorbell aperture: 0x%08x!\n",
94 * amdgpu_mm_wdoorbell64 - write a doorbell Qword
97 * @index: doorbell index
100 * Writes @v to the doorbell aperture at the
101 * requested doorbell index (VEGA10+).
108 if (index < adev->doorbell.num_kernel_doorbells)
109 atomic64_set((atomic64_t *)(adev->doorbell.cpu_addr + index), v);
112 "writing beyond doorbell aperture: 0x%08x!\n", index);
116 * amdgpu_doorbell_index_on_bar - Find doorbell's absolute offset in BAR
119 * @db_bo: doorbell object's bo
120 * @doorbell_index: doorbell relative index in this doorbell object
121 * @db_size: doorbell size is in byte
123 * returns doorbell's absolute index in BAR
134 /* doorbell index is 32 bit but doorbell's size can be 32 bit
155 if (adev->doorbell.num_kernel_doorbells == 0)
159 size = ALIGN(adev->doorbell.num_kernel_doorbells * sizeof(u32), PAGE_SIZE);
169 &adev->doorbell.kernel_doorbells,
171 (void **)&adev->doorbell.cpu_addr);
178 adev->doorbell.num_kernel_doorbells = size / sizeof(u32);
183 * GPU doorbell aperture helpers function.
186 * amdgpu_doorbell_init - Init doorbell driver information.
190 * Init doorbell driver information (CIK)
196 /* No doorbell on SI hardware generation */
198 adev->doorbell.base = 0;
199 adev->doorbell.size = 0;
200 adev->doorbell.num_kernel_doorbells = 0;
209 /* doorbell bar mapping */
210 adev->doorbell.base = pci_resource_start(adev->pdev, 2);
211 adev->doorbell.size = pci_resource_len(adev->pdev, 2);
213 adev->doorbell.num_kernel_doorbells =
214 min_t(u32, adev->doorbell.size / sizeof(u32),
216 if (adev->doorbell.num_kernel_doorbells == 0)
220 * For Vega, reserve and map two pages on doorbell BAR since SDMA
221 * paging queue doorbell use the second page. The
227 adev->doorbell.num_kernel_doorbells += 0x400;
233 * amdgpu_doorbell_fini - Tear down doorbell driver information.
237 * Tear down doorbell driver information (CIK)
241 amdgpu_bo_free_kernel(&adev->doorbell.kernel_doorbells,
243 (void **)&adev->doorbell.cpu_addr);