vic.c (8dd06ef34b6e2f41b29fbf5fc1663780f2524285) vic.c (58ef3aeb9ac3b2c542d85a2e6b4af8ff12c09b68)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2015, NVIDIA Corporation.
4 */
5
6#include <linux/clk.h>
7#include <linux/delay.h>
8#include <linux/host1x.h>

--- 121 unchanged lines hidden (view full) ---

130 NV_PVIC_MISC_PRI_VIC_CG);
131
132 err = falcon_boot(&vic->falcon);
133 if (err < 0)
134 return err;
135
136 hdr = vic->falcon.firmware.virt;
137 fce_bin_data_offset = *(u32 *)(hdr + VIC_UCODE_FCE_DATA_OFFSET);
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2015, NVIDIA Corporation.
4 */
5
6#include <linux/clk.h>
7#include <linux/delay.h>
8#include <linux/host1x.h>

--- 121 unchanged lines hidden (view full) ---

130 NV_PVIC_MISC_PRI_VIC_CG);
131
132 err = falcon_boot(&vic->falcon);
133 if (err < 0)
134 return err;
135
136 hdr = vic->falcon.firmware.virt;
137 fce_bin_data_offset = *(u32 *)(hdr + VIC_UCODE_FCE_DATA_OFFSET);
138 hdr = vic->falcon.firmware.virt +
139 *(u32 *)(hdr + VIC_UCODE_FCE_HEADER_OFFSET);
140 fce_ucode_size = *(u32 *)(hdr + FCE_UCODE_SIZE_OFFSET);
141
142 falcon_execute_method(&vic->falcon, VIC_SET_APPLICATION_ID, 1);
138
139 falcon_execute_method(&vic->falcon, VIC_SET_APPLICATION_ID, 1);
143 falcon_execute_method(&vic->falcon, VIC_SET_FCE_UCODE_SIZE,
144 fce_ucode_size);
145 falcon_execute_method(&vic->falcon, VIC_SET_FCE_UCODE_OFFSET,
146 (vic->falcon.firmware.iova + fce_bin_data_offset)
147 >> 8);
148
140
141 /* Old VIC firmware needs kernel help with setting up FCE microcode. */
142 if (fce_bin_data_offset != 0x0 && fce_bin_data_offset != 0xa5a5a5a5) {
143 hdr = vic->falcon.firmware.virt +
144 *(u32 *)(hdr + VIC_UCODE_FCE_HEADER_OFFSET);
145 fce_ucode_size = *(u32 *)(hdr + FCE_UCODE_SIZE_OFFSET);
146
147 falcon_execute_method(&vic->falcon, VIC_SET_FCE_UCODE_SIZE,
148 fce_ucode_size);
149 falcon_execute_method(
150 &vic->falcon, VIC_SET_FCE_UCODE_OFFSET,
151 (vic->falcon.firmware.iova + fce_bin_data_offset) >> 8);
152 }
153
149 err = falcon_wait_idle(&vic->falcon);
150 if (err < 0) {
151 dev_err(vic->dev,
152 "failed to set application ID and FCE base\n");
153 return err;
154 }
155
156 vic->booted = true;

--- 382 unchanged lines hidden ---
154 err = falcon_wait_idle(&vic->falcon);
155 if (err < 0) {
156 dev_err(vic->dev,
157 "failed to set application ID and FCE base\n");
158 return err;
159 }
160
161 vic->booted = true;

--- 382 unchanged lines hidden ---