| .. | .. |
|---|
| 52 | 52 | clk_set_rate(tdev->clk_pwr, 204000000); |
|---|
| 53 | 53 | udelay(10); |
|---|
| 54 | 54 | |
|---|
| 55 | | - reset_control_assert(tdev->rst); |
|---|
| 56 | | - udelay(10); |
|---|
| 57 | | - |
|---|
| 58 | 55 | if (!tdev->pdev->dev.pm_domain) { |
|---|
| 56 | + reset_control_assert(tdev->rst); |
|---|
| 57 | + udelay(10); |
|---|
| 58 | + |
|---|
| 59 | 59 | ret = tegra_powergate_remove_clamping(TEGRA_POWERGATE_3D); |
|---|
| 60 | 60 | if (ret) |
|---|
| 61 | 61 | goto err_clamp; |
|---|
| 62 | 62 | udelay(10); |
|---|
| 63 | | - } |
|---|
| 64 | 63 | |
|---|
| 65 | | - reset_control_deassert(tdev->rst); |
|---|
| 66 | | - udelay(10); |
|---|
| 64 | + reset_control_deassert(tdev->rst); |
|---|
| 65 | + udelay(10); |
|---|
| 66 | + } |
|---|
| 67 | 67 | |
|---|
| 68 | 68 | return 0; |
|---|
| 69 | 69 | |
|---|
| .. | .. |
|---|
| 123 | 123 | |
|---|
| 124 | 124 | mutex_init(&tdev->iommu.mutex); |
|---|
| 125 | 125 | |
|---|
| 126 | | - if (iommu_present(&platform_bus_type)) { |
|---|
| 126 | + if (device_iommu_mapped(dev)) { |
|---|
| 127 | 127 | tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type); |
|---|
| 128 | 128 | if (!tdev->iommu.domain) |
|---|
| 129 | 129 | goto error; |
|---|
| .. | .. |
|---|
| 279 | 279 | struct nvkm_device **pdevice) |
|---|
| 280 | 280 | { |
|---|
| 281 | 281 | struct nvkm_device_tegra *tdev; |
|---|
| 282 | + unsigned long rate; |
|---|
| 282 | 283 | int ret; |
|---|
| 283 | 284 | |
|---|
| 284 | 285 | if (!(tdev = kzalloc(sizeof(*tdev), GFP_KERNEL))) |
|---|
| .. | .. |
|---|
| 307 | 308 | goto free; |
|---|
| 308 | 309 | } |
|---|
| 309 | 310 | |
|---|
| 311 | + rate = clk_get_rate(tdev->clk); |
|---|
| 312 | + if (rate == 0) { |
|---|
| 313 | + ret = clk_set_rate(tdev->clk, ULONG_MAX); |
|---|
| 314 | + if (ret < 0) |
|---|
| 315 | + goto free; |
|---|
| 316 | + |
|---|
| 317 | + rate = clk_get_rate(tdev->clk); |
|---|
| 318 | + |
|---|
| 319 | + dev_dbg(&pdev->dev, "GPU clock set to %lu\n", rate); |
|---|
| 320 | + } |
|---|
| 321 | + |
|---|
| 310 | 322 | if (func->require_ref_clk) |
|---|
| 311 | 323 | tdev->clk_ref = devm_clk_get(&pdev->dev, "ref"); |
|---|
| 312 | 324 | if (IS_ERR(tdev->clk_ref)) { |
|---|