gpu: nvgpu: gv100: add IPA to PA translation

Add IPA to PA translation for GV100 nvlink / pass-through mode
- define platform->phys_addr(g, ipa) method
- call nvgpu_init_soc_vars from nvgpu_tegra_pci_probe
- in nvgpu_init_soc_vars, define set platform->phys_addr to
  nvgpu_tegra_hv_ipa_pa, if hypervisor is present.
- in __nvgpu_sgl_phys, use sg_phys, then apply platform->phys_addr
  if defined.
- implement IPA to PA translation in nvgpu_tegra_hv_ipa_pa

Bug 200392719

Change-Id: I622049ddc62c2a57a665dd259c1bb4ed3843a537
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1673582
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Richard Zhao <rizhao@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Thomas Fleury
2018-03-07 09:30:21 -08:00
committed by mobile promotions
parent 6c33a010d8
commit c6e8257c44
5 changed files with 81 additions and 3 deletions

View File

@@ -121,6 +121,9 @@ struct gk20a_platform {
*/
u32 default_pri_timeout;
/* guest/vm id, needed for IPA to PA transation */
int vmid;
/* Initialize the platform interface of the gk20a driver.
*
* The platform implementation of this function must
@@ -204,6 +207,12 @@ struct gk20a_platform {
*/
void (*dump_platform_dependencies)(struct device *dev);
/* Defined when SMMU stage-2 is enabled, and we need to use physical
* addresses (not IPA). This is the case for GV100 nvlink in HV+L
* configuration, when dGPU is in pass-through mode.
*/
u64 (*phys_addr)(struct gk20a *g, u64 ipa);
/* Callbacks to assert/deassert GPU reset */
int (*reset_assert)(struct device *dev);
int (*reset_deassert)(struct device *dev);