diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2018-09-12 20:56:38 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2018-09-12 20:56:58 -0400 |
commit | 3483f08106fcd0e8edad2b9f2fc4726d25177799 (patch) | |
tree | c8c7efb26f73569993b1af6803dd07c458459d61 | |
parent | 53b0cc46f27cfc2cadca609b503a7d92b5185a47 (diff) |
drm/nouveau/devinit: fix warning when PMU/PRE_OS is missing
Messed up when sending pull request and sent an outdated version of
previous patch, this fixes it up to remove warnings.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c index d65959ef0564..17235e940ca9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm200.c | |||
@@ -86,10 +86,8 @@ pmu_load(struct nv50_devinit *init, u8 type, bool post, | |||
86 | struct nvkm_bios *bios = subdev->device->bios; | 86 | struct nvkm_bios *bios = subdev->device->bios; |
87 | struct nvbios_pmuR pmu; | 87 | struct nvbios_pmuR pmu; |
88 | 88 | ||
89 | if (!nvbios_pmuRm(bios, type, &pmu)) { | 89 | if (!nvbios_pmuRm(bios, type, &pmu)) |
90 | nvkm_error(subdev, "VBIOS PMU fuc %02x not found\n", type); | ||
91 | return -EINVAL; | 90 | return -EINVAL; |
92 | } | ||
93 | 91 | ||
94 | if (!post) | 92 | if (!post) |
95 | return 0; | 93 | return 0; |
@@ -124,29 +122,30 @@ gm200_devinit_post(struct nvkm_devinit *base, bool post) | |||
124 | return -EINVAL; | 122 | return -EINVAL; |
125 | } | 123 | } |
126 | 124 | ||
125 | /* Upload DEVINIT application from VBIOS onto PMU. */ | ||
127 | ret = pmu_load(init, 0x04, post, &exec, &args); | 126 | ret = pmu_load(init, 0x04, post, &exec, &args); |
128 | if (ret) | 127 | if (ret) { |
128 | nvkm_error(subdev, "VBIOS PMU/DEVINIT not found\n"); | ||
129 | return ret; | 129 | return ret; |
130 | } | ||
130 | 131 | ||
131 | /* upload first chunk of init data */ | 132 | /* Upload tables required by opcodes in boot scripts. */ |
132 | if (post) { | 133 | if (post) { |
133 | // devinit tables | ||
134 | u32 pmu = pmu_args(init, args + 0x08, 0x08); | 134 | u32 pmu = pmu_args(init, args + 0x08, 0x08); |
135 | u32 img = nvbios_rd16(bios, bit_I.offset + 0x14); | 135 | u32 img = nvbios_rd16(bios, bit_I.offset + 0x14); |
136 | u32 len = nvbios_rd16(bios, bit_I.offset + 0x16); | 136 | u32 len = nvbios_rd16(bios, bit_I.offset + 0x16); |
137 | pmu_data(init, pmu, img, len); | 137 | pmu_data(init, pmu, img, len); |
138 | } | 138 | } |
139 | 139 | ||
140 | /* upload second chunk of init data */ | 140 | /* Upload boot scripts. */ |
141 | if (post) { | 141 | if (post) { |
142 | // devinit boot scripts | ||
143 | u32 pmu = pmu_args(init, args + 0x08, 0x10); | 142 | u32 pmu = pmu_args(init, args + 0x08, 0x10); |
144 | u32 img = nvbios_rd16(bios, bit_I.offset + 0x18); | 143 | u32 img = nvbios_rd16(bios, bit_I.offset + 0x18); |
145 | u32 len = nvbios_rd16(bios, bit_I.offset + 0x1a); | 144 | u32 len = nvbios_rd16(bios, bit_I.offset + 0x1a); |
146 | pmu_data(init, pmu, img, len); | 145 | pmu_data(init, pmu, img, len); |
147 | } | 146 | } |
148 | 147 | ||
149 | /* execute init tables */ | 148 | /* Execute DEVINIT. */ |
150 | if (post) { | 149 | if (post) { |
151 | nvkm_wr32(device, 0x10a040, 0x00005000); | 150 | nvkm_wr32(device, 0x10a040, 0x00005000); |
152 | pmu_exec(init, exec); | 151 | pmu_exec(init, exec); |
@@ -157,7 +156,9 @@ gm200_devinit_post(struct nvkm_devinit *base, bool post) | |||
157 | return -ETIMEDOUT; | 156 | return -ETIMEDOUT; |
158 | } | 157 | } |
159 | 158 | ||
160 | /* load and execute some other ucode image (bios therm?) */ | 159 | /* Optional: Execute PRE_OS application on PMU, which should at |
160 | * least take care of fans until a full PMU has been loaded. | ||
161 | */ | ||
161 | pmu_load(init, 0x01, post, NULL, NULL); | 162 | pmu_load(init, 0x01, post, NULL, NULL); |
162 | return 0; | 163 | return 0; |
163 | } | 164 | } |