Lines Matching full:tile

32 static int pcode_mailbox_status(struct xe_tile *tile)  in pcode_mailbox_status()  argument
47 err = xe_mmio_read32(tile->primary_gt, PCODE_MAILBOX) & PCODE_ERROR_MASK; in pcode_mailbox_status()
49 drm_err(&tile_to_xe(tile)->drm, "PCODE Mailbox failed: %d %s", err, in pcode_mailbox_status()
57 static int __pcode_mailbox_rw(struct xe_tile *tile, u32 mbox, u32 *data0, u32 *data1, in __pcode_mailbox_rw() argument
61 struct xe_gt *mmio = tile->primary_gt; in __pcode_mailbox_rw()
64 if (tile_to_xe(tile)->info.skip_pcode) in __pcode_mailbox_rw()
85 return pcode_mailbox_status(tile); in __pcode_mailbox_rw()
88 static int pcode_mailbox_rw(struct xe_tile *tile, u32 mbox, u32 *data0, u32 *data1, in pcode_mailbox_rw() argument
92 if (tile_to_xe(tile)->info.skip_pcode) in pcode_mailbox_rw()
95 lockdep_assert_held(&tile->pcode.lock); in pcode_mailbox_rw()
97 return __pcode_mailbox_rw(tile, mbox, data0, data1, timeout_ms, return_data, atomic); in pcode_mailbox_rw()
100 int xe_pcode_write_timeout(struct xe_tile *tile, u32 mbox, u32 data, int timeout) in xe_pcode_write_timeout() argument
104 mutex_lock(&tile->pcode.lock); in xe_pcode_write_timeout()
105 err = pcode_mailbox_rw(tile, mbox, &data, NULL, timeout, false, false); in xe_pcode_write_timeout()
106 mutex_unlock(&tile->pcode.lock); in xe_pcode_write_timeout()
111 int xe_pcode_read(struct xe_tile *tile, u32 mbox, u32 *val, u32 *val1) in xe_pcode_read() argument
115 mutex_lock(&tile->pcode.lock); in xe_pcode_read()
116 err = pcode_mailbox_rw(tile, mbox, val, val1, 1, true, false); in xe_pcode_read()
117 mutex_unlock(&tile->pcode.lock); in xe_pcode_read()
122 static int pcode_try_request(struct xe_tile *tile, u32 mbox, in pcode_try_request() argument
128 xe_tile_assert(tile, timeout_us > 0); in pcode_try_request()
132 *status = pcode_mailbox_rw(tile, mbox, &request, NULL, 1, true, in pcode_try_request()
135 *status = __pcode_mailbox_rw(tile, mbox, &request, NULL, 1, true, in pcode_try_request()
152 * @tile: tile
169 int xe_pcode_request(struct xe_tile *tile, u32 mbox, u32 request, in xe_pcode_request() argument
175 xe_tile_assert(tile, timeout_base_ms <= 3); in xe_pcode_request()
177 mutex_lock(&tile->pcode.lock); in xe_pcode_request()
179 ret = pcode_try_request(tile, mbox, request, reply_mask, reply, &status, in xe_pcode_request()
194 drm_err(&tile_to_xe(tile)->drm, in xe_pcode_request()
197 ret = pcode_try_request(tile, mbox, request, reply_mask, reply, &status, in xe_pcode_request()
202 mutex_unlock(&tile->pcode.lock); in xe_pcode_request()
207 * @tile: tile instance
230 int xe_pcode_init_min_freq_table(struct xe_tile *tile, u32 min_gt_freq, in xe_pcode_init_min_freq_table() argument
236 if (!tile_to_xe(tile)->info.has_llc) in xe_pcode_init_min_freq_table()
242 mutex_lock(&tile->pcode.lock); in xe_pcode_init_min_freq_table()
246 ret = pcode_mailbox_rw(tile, PCODE_WRITE_MIN_FREQ_TABLE, in xe_pcode_init_min_freq_table()
253 mutex_unlock(&tile->pcode.lock); in xe_pcode_init_min_freq_table()
262 * PCODE init mailbox is polled only on root gt of root tile
263 * as the root tile provides the initialization is complete only
273 struct xe_tile *tile = xe_device_get_root_tile(xe); in xe_pcode_ready() local
284 mutex_lock(&tile->pcode.lock); in xe_pcode_ready()
286 ret = pcode_try_request(tile, DGFX_PCODE_STATUS, request, in xe_pcode_ready()
292 mutex_unlock(&tile->pcode.lock); in xe_pcode_ready()
303 * @tile: tile instance
308 void xe_pcode_init(struct xe_tile *tile) in xe_pcode_init() argument
310 drmm_mutex_init(&tile_to_xe(tile)->drm, &tile->pcode.lock); in xe_pcode_init()