Lines Matching +full:ati +full:- +full:target
33 #include "atom-names.h"
34 #include "atom-bits.h"
92 while (n--) in debug_print_spaces()
106 struct radeon_device *rdev = ctx->card->dev->dev_private; in atom_iio_execute()
115 temp = ctx->card->ioreg_read(ctx->card, CU16(base + 1)); in atom_iio_execute()
119 if (rdev->family == CHIP_RV515) in atom_iio_execute()
120 (void)ctx->card->ioreg_read(ctx->card, CU16(base + 1)); in atom_iio_execute()
121 ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp); in atom_iio_execute()
126 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) << in atom_iio_execute()
132 (0xFFFFFFFF >> (32 - CU8(base + 1))) << CU8(base + in atom_iio_execute()
138 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) << in atom_iio_execute()
142 (0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base + in atom_iio_execute()
148 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) << in atom_iio_execute()
152 (0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base + in atom_iio_execute()
158 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) << in atom_iio_execute()
161 ((ctx-> in atom_iio_execute()
162 io_attr >> CU8(base + 2)) & (0xFFFFFFFF >> (32 - in atom_iio_execute()
182 struct atom_context *gctx = ctx->ctx; in atom_get_src_int()
191 idx += gctx->reg_block; in atom_get_src_int()
192 switch (gctx->io_mode) { in atom_get_src_int()
194 val = gctx->card->reg_read(gctx->card, idx); in atom_get_src_int()
203 if (!(gctx->io_mode & 0x80)) { in atom_get_src_int()
207 if (!gctx->iio[gctx->io_mode & 0x7F]) { in atom_get_src_int()
209 gctx->io_mode & 0x7F); in atom_get_src_int()
214 gctx->iio[gctx->io_mode & 0x7F], in atom_get_src_int()
223 val = get_unaligned_le32((u32 *)&ctx->ps[idx]); in atom_get_src_int()
234 val = gctx->divmul[0]; in atom_get_src_int()
237 val = gctx->divmul[1]; in atom_get_src_int()
240 val = gctx->data_block; in atom_get_src_int()
243 val = gctx->shift; in atom_get_src_int()
246 val = 1 << gctx->shift; in atom_get_src_int()
249 val = ~(1 << gctx->shift); in atom_get_src_int()
252 val = gctx->fb_base; in atom_get_src_int()
255 val = gctx->io_attr; in atom_get_src_int()
258 val = gctx->reg_block; in atom_get_src_int()
261 val = ctx->ws[idx]; in atom_get_src_int()
268 if (gctx->data_block) in atom_get_src_int()
269 DEBUG("ID[0x%04X+%04X]", idx, gctx->data_block); in atom_get_src_int()
273 val = U32(idx + gctx->data_block); in atom_get_src_int()
278 if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) { in atom_get_src_int()
280 gctx->fb_base + (idx * 4), gctx->scratch_size_bytes); in atom_get_src_int()
283 val = gctx->scratch[(gctx->fb_base / 4) + idx]; in atom_get_src_int()
319 val = gctx->card->pll_read(gctx->card, idx); in atom_get_src_int()
326 val = gctx->card->mc_read(gctx->card, idx); in atom_get_src_int()
336 DEBUG(".[31:0] -> 0x%08X\n", val); in atom_get_src_int()
339 DEBUG(".[15:0] -> 0x%04X\n", val); in atom_get_src_int()
342 DEBUG(".[23:8] -> 0x%04X\n", val); in atom_get_src_int()
345 DEBUG(".[31:16] -> 0x%04X\n", val); in atom_get_src_int()
348 DEBUG(".[7:0] -> 0x%02X\n", val); in atom_get_src_int()
351 DEBUG(".[15:8] -> 0x%02X\n", val); in atom_get_src_int()
354 DEBUG(".[23:16] -> 0x%02X\n", val); in atom_get_src_int()
357 DEBUG(".[31:24] -> 0x%02X\n", val); in atom_get_src_int()
452 struct atom_context *gctx = ctx->ctx; in atom_put_dst()
463 idx += gctx->reg_block; in atom_put_dst()
464 switch (gctx->io_mode) { in atom_put_dst()
467 gctx->card->reg_write(gctx->card, idx, in atom_put_dst()
470 gctx->card->reg_write(gctx->card, idx, val); in atom_put_dst()
479 if (!(gctx->io_mode & 0x80)) { in atom_put_dst()
483 if (!gctx->iio[gctx->io_mode & 0xFF]) { in atom_put_dst()
485 gctx->io_mode & 0x7F); in atom_put_dst()
488 atom_iio_execute(gctx, gctx->iio[gctx->io_mode & 0xFF], in atom_put_dst()
496 ctx->ps[idx] = cpu_to_le32(val); in atom_put_dst()
504 gctx->divmul[0] = val; in atom_put_dst()
507 gctx->divmul[1] = val; in atom_put_dst()
510 gctx->data_block = val; in atom_put_dst()
513 gctx->shift = val; in atom_put_dst()
519 gctx->fb_base = val; in atom_put_dst()
522 gctx->io_attr = val; in atom_put_dst()
525 gctx->reg_block = val; in atom_put_dst()
528 ctx->ws[idx] = val; in atom_put_dst()
534 if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) { in atom_put_dst()
536 gctx->fb_base + (idx * 4), gctx->scratch_size_bytes); in atom_put_dst()
538 gctx->scratch[(gctx->fb_base / 4) + idx] = val; in atom_put_dst()
545 gctx->card->pll_write(gctx->card, idx, val); in atom_put_dst()
551 gctx->card->mc_write(gctx->card, idx, val); in atom_put_dst()
556 DEBUG(".[31:0] <- 0x%08X\n", old_val); in atom_put_dst()
559 DEBUG(".[15:0] <- 0x%04X\n", old_val); in atom_put_dst()
562 DEBUG(".[23:8] <- 0x%04X\n", old_val); in atom_put_dst()
565 DEBUG(".[31:16] <- 0x%04X\n", old_val); in atom_put_dst()
568 DEBUG(".[7:0] <- 0x%02X\n", old_val); in atom_put_dst()
571 DEBUG(".[15:8] <- 0x%02X\n", old_val); in atom_put_dst()
574 DEBUG(".[23:16] <- 0x%02X\n", old_val); in atom_put_dst()
577 DEBUG(".[31:24] <- 0x%02X\n", old_val); in atom_put_dst()
624 if (U16(ctx->ctx->cmd_table + 4 + 2 * idx)) in atom_op_calltable()
625 r = atom_execute_table_locked(ctx->ctx, idx, ctx->ps + ctx->ps_shift); in atom_op_calltable()
627 ctx->abort = true; in atom_op_calltable()
651 ctx->ctx->cs_equal = (dst == src); in atom_op_compare()
652 ctx->ctx->cs_above = (dst > src); in atom_op_compare()
653 SDEBUG(" result: %s %s\n", ctx->ctx->cs_equal ? "EQ" : "NE", in atom_op_compare()
654 ctx->ctx->cs_above ? "GT" : "LE"); in atom_op_compare()
678 ctx->ctx->divmul[0] = dst / src; in atom_op_div()
679 ctx->ctx->divmul[1] = dst % src; in atom_op_div()
681 ctx->ctx->divmul[0] = 0; in atom_op_div()
682 ctx->ctx->divmul[1] = 0; in atom_op_div()
693 int execute = 0, target = U16(*ptr); in atom_op_jump() local
699 execute = ctx->ctx->cs_above; in atom_op_jump()
702 execute = ctx->ctx->cs_above || ctx->ctx->cs_equal; in atom_op_jump()
708 execute = !(ctx->ctx->cs_above || ctx->ctx->cs_equal); in atom_op_jump()
711 execute = !ctx->ctx->cs_above; in atom_op_jump()
714 execute = ctx->ctx->cs_equal; in atom_op_jump()
717 execute = !ctx->ctx->cs_equal; in atom_op_jump()
722 SDEBUG(" target: 0x%04X\n", target); in atom_op_jump()
724 if (ctx->last_jump == (ctx->start + target)) { in atom_op_jump()
726 if (time_after(cjiffies, ctx->last_jump_jiffies)) { in atom_op_jump()
727 cjiffies -= ctx->last_jump_jiffies; in atom_op_jump()
730 ctx->abort = true; in atom_op_jump()
734 ctx->last_jump_jiffies = jiffies; in atom_op_jump()
737 ctx->last_jump = ctx->start + target; in atom_op_jump()
738 ctx->last_jump_jiffies = jiffies; in atom_op_jump()
740 *ptr = ctx->start + target; in atom_op_jump()
786 ctx->ctx->divmul[0] = dst * src; in atom_op_mul()
835 ctx->ctx->data_block = 0; in atom_op_setdatablock()
837 ctx->ctx->data_block = ctx->start; in atom_op_setdatablock()
839 ctx->ctx->data_block = U16(ctx->ctx->data_table + 4 + 2 * idx); in atom_op_setdatablock()
840 SDEBUG(" base: 0x%04X\n", ctx->ctx->data_block); in atom_op_setdatablock()
847 ctx->ctx->fb_base = atom_get_src(ctx, attr, ptr); in atom_op_setfbbase()
861 ctx->ctx->io_mode = ATOM_IO_MM; in atom_op_setport()
863 ctx->ctx->io_mode = ATOM_IO_IIO | port; in atom_op_setport()
867 ctx->ctx->io_mode = ATOM_IO_PCI; in atom_op_setport()
871 ctx->ctx->io_mode = ATOM_IO_SYSIO; in atom_op_setport()
879 ctx->ctx->reg_block = U16(*ptr); in atom_op_setregblock()
881 SDEBUG(" base: 0x%04X\n", ctx->ctx->reg_block); in atom_op_setregblock()
963 dst -= src; in atom_op_sub()
971 uint32_t src, val, target; in atom_op_switch() local
981 target = U16(*ptr); in atom_op_switch()
983 SDEBUG(" target: %04X\n", target); in atom_op_switch()
984 *ptr = ctx->start + target; in atom_op_switch()
1003 ctx->ctx->cs_equal = ((dst & src) == 0); in atom_op_test()
1004 SDEBUG(" result: %s\n", ctx->ctx->cs_equal ? "EQ" : "NE"); in atom_op_test()
1156 int base = CU16(ctx->cmd_table + 4 + 2 * index); in atom_execute_table_locked()
1163 return -EINVAL; in atom_execute_table_locked()
1187 SDEBUG("%s @ 0x%04X\n", atom_op_names[op], ptr - 1); in atom_execute_table_locked()
1189 SDEBUG("[%d] @ 0x%04X\n", op, ptr - 1); in atom_execute_table_locked()
1192 base, len, ws, ps, ptr - 1); in atom_execute_table_locked()
1193 ret = -EINVAL; in atom_execute_table_locked()
1206 debug_depth--; in atom_execute_table_locked()
1219 mutex_lock(&ctx->mutex); in atom_execute_table_scratch_unlocked()
1221 ctx->data_block = 0; in atom_execute_table_scratch_unlocked()
1223 ctx->reg_block = 0; in atom_execute_table_scratch_unlocked()
1225 ctx->fb_base = 0; in atom_execute_table_scratch_unlocked()
1227 ctx->io_mode = ATOM_IO_MM; in atom_execute_table_scratch_unlocked()
1229 ctx->divmul[0] = 0; in atom_execute_table_scratch_unlocked()
1230 ctx->divmul[1] = 0; in atom_execute_table_scratch_unlocked()
1232 mutex_unlock(&ctx->mutex); in atom_execute_table_scratch_unlocked()
1239 mutex_lock(&ctx->scratch_mutex); in atom_execute_table()
1241 mutex_unlock(&ctx->scratch_mutex); in atom_execute_table()
1249 ctx->iio = kzalloc(2 * 256, GFP_KERNEL); in atom_index_iio()
1250 if (!ctx->iio) in atom_index_iio()
1253 ctx->iio[CU8(base + 1)] = base + 2; in atom_index_iio()
1273 ctx->card = card; in atom_parse()
1274 ctx->bios = bios; in atom_parse()
1284 pr_info("Invalid ATI magic\n"); in atom_parse()
1298 ctx->cmd_table = CU16(base + ATOM_ROM_CMD_PTR); in atom_parse()
1299 ctx->data_table = CU16(base + ATOM_ROM_DATA_PTR); in atom_parse()
1300 atom_index_iio(ctx, CU16(ctx->data_table + ATOM_DATA_IIO_PTR) + 4); in atom_parse()
1301 if (!ctx->iio) { in atom_parse()
1324 struct radeon_device *rdev = ctx->card->dev->dev_private; in atom_asic_init()
1325 int hwi = CU16(ctx->data_table + ATOM_DATA_FWI_PTR); in atom_asic_init()
1336 if (!CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_INIT)) in atom_asic_init()
1344 if (rdev->family < CHIP_R600) { in atom_asic_init()
1345 if (CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_SPDFANCNTL)) in atom_asic_init()
1353 kfree(ctx->iio); in atom_destroy()
1362 int idx = CU16(ctx->data_table + offset); in atom_parse_data_header()
1363 u16 *mdt = (u16 *)(ctx->bios + ctx->data_table + 4); in atom_parse_data_header()
1382 int idx = CU16(ctx->cmd_table + offset); in atom_parse_cmd_header()
1383 u16 *mct = (u16 *)(ctx->bios + ctx->cmd_table + 4); in atom_parse_cmd_header()
1403 firmware_usage = (struct _ATOM_VRAM_USAGE_BY_FIRMWARE *)(ctx->bios + data_offset); in atom_allocate_fb_scratch()
1406 le32_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].ulStartAddrUsedByFirmware), in atom_allocate_fb_scratch()
1407 le16_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb)); in atom_allocate_fb_scratch()
1409 usage_bytes = le16_to_cpu(firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb) * 1024; in atom_allocate_fb_scratch()
1411 ctx->scratch_size_bytes = 0; in atom_allocate_fb_scratch()
1415 ctx->scratch = kzalloc(usage_bytes, GFP_KERNEL); in atom_allocate_fb_scratch()
1416 if (!ctx->scratch) in atom_allocate_fb_scratch()
1417 return -ENOMEM; in atom_allocate_fb_scratch()
1418 ctx->scratch_size_bytes = usage_bytes; in atom_allocate_fb_scratch()