Lines Matching +full:reg +full:- +full:names

33 #include "atom-names.h"
34 #include "atom-bits.h"
91 while (n--) in debug_print_spaces()
105 struct radeon_device *rdev = ctx->card->dev->dev_private; in atom_iio_execute()
114 temp = ctx->card->ioreg_read(ctx->card, CU16(base + 1)); in atom_iio_execute()
118 if (rdev->family == CHIP_RV515) in atom_iio_execute()
119 (void)ctx->card->ioreg_read(ctx->card, CU16(base + 1)); in atom_iio_execute()
120 ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp); in atom_iio_execute()
125 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) << in atom_iio_execute()
131 (0xFFFFFFFF >> (32 - CU8(base + 1))) << CU8(base + in atom_iio_execute()
137 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) << in atom_iio_execute()
141 (0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base + in atom_iio_execute()
147 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) << in atom_iio_execute()
151 (0xFFFFFFFF >> (32 - CU8(base + 1)))) << CU8(base + in atom_iio_execute()
157 ~((0xFFFFFFFF >> (32 - CU8(base + 1))) << in atom_iio_execute()
160 ((ctx-> in atom_iio_execute()
161 io_attr >> CU8(base + 2)) & (0xFFFFFFFF >> (32 - in atom_iio_execute()
181 struct atom_context *gctx = ctx->ctx; in atom_get_src_int()
189 DEBUG("REG[0x%04X]", idx); in atom_get_src_int()
190 idx += gctx->reg_block; in atom_get_src_int()
191 switch (gctx->io_mode) { in atom_get_src_int()
193 val = gctx->card->reg_read(gctx->card, idx); in atom_get_src_int()
204 if (!(gctx->io_mode & 0x80)) { in atom_get_src_int()
208 if (!gctx->iio[gctx->io_mode & 0x7F]) { in atom_get_src_int()
211 gctx->io_mode & 0x7F); in atom_get_src_int()
216 gctx->iio[gctx->io_mode & 0x7F], in atom_get_src_int()
225 val = get_unaligned_le32((u32 *)&ctx->ps[idx]); in atom_get_src_int()
236 val = gctx->divmul[0]; in atom_get_src_int()
239 val = gctx->divmul[1]; in atom_get_src_int()
242 val = gctx->data_block; in atom_get_src_int()
245 val = gctx->shift; in atom_get_src_int()
248 val = 1 << gctx->shift; in atom_get_src_int()
251 val = ~(1 << gctx->shift); in atom_get_src_int()
254 val = gctx->fb_base; in atom_get_src_int()
257 val = gctx->io_attr; in atom_get_src_int()
260 val = gctx->reg_block; in atom_get_src_int()
263 val = ctx->ws[idx]; in atom_get_src_int()
270 if (gctx->data_block) in atom_get_src_int()
271 DEBUG("ID[0x%04X+%04X]", idx, gctx->data_block); in atom_get_src_int()
275 val = U32(idx + gctx->data_block); in atom_get_src_int()
280 if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) { in atom_get_src_int()
282 gctx->fb_base + (idx * 4), gctx->scratch_size_bytes); in atom_get_src_int()
285 val = gctx->scratch[(gctx->fb_base / 4) + idx]; in atom_get_src_int()
321 val = gctx->card->pll_read(gctx->card, idx); in atom_get_src_int()
328 val = gctx->card->mc_read(gctx->card, idx); in atom_get_src_int()
338 DEBUG(".[31:0] -> 0x%08X\n", val); in atom_get_src_int()
341 DEBUG(".[15:0] -> 0x%04X\n", val); in atom_get_src_int()
344 DEBUG(".[23:8] -> 0x%04X\n", val); in atom_get_src_int()
347 DEBUG(".[31:16] -> 0x%04X\n", val); in atom_get_src_int()
350 DEBUG(".[7:0] -> 0x%02X\n", val); in atom_get_src_int()
353 DEBUG(".[15:8] -> 0x%02X\n", val); in atom_get_src_int()
356 DEBUG(".[23:16] -> 0x%02X\n", val); in atom_get_src_int()
359 DEBUG(".[31:24] -> 0x%02X\n", val); in atom_get_src_int()
454 struct atom_context *gctx = ctx->ctx; in atom_put_dst()
464 DEBUG("REG[0x%04X]", idx); in atom_put_dst()
465 idx += gctx->reg_block; in atom_put_dst()
466 switch (gctx->io_mode) { in atom_put_dst()
469 gctx->card->reg_write(gctx->card, idx, in atom_put_dst()
472 gctx->card->reg_write(gctx->card, idx, val); in atom_put_dst()
483 if (!(gctx->io_mode & 0x80)) { in atom_put_dst()
487 if (!gctx->iio[gctx->io_mode & 0xFF]) { in atom_put_dst()
490 gctx->io_mode & 0x7F); in atom_put_dst()
493 atom_iio_execute(gctx, gctx->iio[gctx->io_mode & 0xFF], in atom_put_dst()
501 ctx->ps[idx] = cpu_to_le32(val); in atom_put_dst()
509 gctx->divmul[0] = val; in atom_put_dst()
512 gctx->divmul[1] = val; in atom_put_dst()
515 gctx->data_block = val; in atom_put_dst()
518 gctx->shift = val; in atom_put_dst()
524 gctx->fb_base = val; in atom_put_dst()
527 gctx->io_attr = val; in atom_put_dst()
530 gctx->reg_block = val; in atom_put_dst()
533 ctx->ws[idx] = val; in atom_put_dst()
539 if ((gctx->fb_base + (idx * 4)) > gctx->scratch_size_bytes) { in atom_put_dst()
541 gctx->fb_base + (idx * 4), gctx->scratch_size_bytes); in atom_put_dst()
543 gctx->scratch[(gctx->fb_base / 4) + idx] = val; in atom_put_dst()
550 gctx->card->pll_write(gctx->card, idx, val); in atom_put_dst()
556 gctx->card->mc_write(gctx->card, idx, val); in atom_put_dst()
561 DEBUG(".[31:0] <- 0x%08X\n", old_val); in atom_put_dst()
564 DEBUG(".[15:0] <- 0x%04X\n", old_val); in atom_put_dst()
567 DEBUG(".[23:8] <- 0x%04X\n", old_val); in atom_put_dst()
570 DEBUG(".[31:16] <- 0x%04X\n", old_val); in atom_put_dst()
573 DEBUG(".[7:0] <- 0x%02X\n", old_val); in atom_put_dst()
576 DEBUG(".[15:8] <- 0x%02X\n", old_val); in atom_put_dst()
579 DEBUG(".[23:16] <- 0x%02X\n", old_val); in atom_put_dst()
582 DEBUG(".[31:24] <- 0x%02X\n", old_val); in atom_put_dst()
629 if (U16(ctx->ctx->cmd_table + 4 + 2 * idx)) in atom_op_calltable()
630 r = atom_execute_table_locked(ctx->ctx, idx, ctx->ps + ctx->ps_shift); in atom_op_calltable()
632 ctx->abort = true; in atom_op_calltable()
656 ctx->ctx->cs_equal = (dst == src); in atom_op_compare()
657 ctx->ctx->cs_above = (dst > src); in atom_op_compare()
658 SDEBUG(" result: %s %s\n", ctx->ctx->cs_equal ? "EQ" : "NE", in atom_op_compare()
659 ctx->ctx->cs_above ? "GT" : "LE"); in atom_op_compare()
683 ctx->ctx->divmul[0] = dst / src; in atom_op_div()
684 ctx->ctx->divmul[1] = dst % src; in atom_op_div()
686 ctx->ctx->divmul[0] = 0; in atom_op_div()
687 ctx->ctx->divmul[1] = 0; in atom_op_div()
704 execute = ctx->ctx->cs_above; in atom_op_jump()
707 execute = ctx->ctx->cs_above || ctx->ctx->cs_equal; in atom_op_jump()
713 execute = !(ctx->ctx->cs_above || ctx->ctx->cs_equal); in atom_op_jump()
716 execute = !ctx->ctx->cs_above; in atom_op_jump()
719 execute = ctx->ctx->cs_equal; in atom_op_jump()
722 execute = !ctx->ctx->cs_equal; in atom_op_jump()
729 if (ctx->last_jump == (ctx->start + target)) { in atom_op_jump()
731 if (time_after(cjiffies, ctx->last_jump_jiffies)) { in atom_op_jump()
732 cjiffies -= ctx->last_jump_jiffies; in atom_op_jump()
735 ctx->abort = true; in atom_op_jump()
739 ctx->last_jump_jiffies = jiffies; in atom_op_jump()
742 ctx->last_jump = ctx->start + target; in atom_op_jump()
743 ctx->last_jump_jiffies = jiffies; in atom_op_jump()
745 *ptr = ctx->start + target; in atom_op_jump()
791 ctx->ctx->divmul[0] = dst * src; in atom_op_mul()
840 ctx->ctx->data_block = 0; in atom_op_setdatablock()
842 ctx->ctx->data_block = ctx->start; in atom_op_setdatablock()
844 ctx->ctx->data_block = U16(ctx->ctx->data_table + 4 + 2 * idx); in atom_op_setdatablock()
845 SDEBUG(" base: 0x%04X\n", ctx->ctx->data_block); in atom_op_setdatablock()
852 ctx->ctx->fb_base = atom_get_src(ctx, attr, ptr); in atom_op_setfbbase()
866 ctx->ctx->io_mode = ATOM_IO_MM; in atom_op_setport()
868 ctx->ctx->io_mode = ATOM_IO_IIO | port; in atom_op_setport()
872 ctx->ctx->io_mode = ATOM_IO_PCI; in atom_op_setport()
876 ctx->ctx->io_mode = ATOM_IO_SYSIO; in atom_op_setport()
884 ctx->ctx->reg_block = U16(*ptr); in atom_op_setregblock()
886 SDEBUG(" base: 0x%04X\n", ctx->ctx->reg_block); in atom_op_setregblock()
968 dst -= src; in atom_op_sub()
989 *ptr = ctx->start + target; in atom_op_switch()
1008 ctx->ctx->cs_equal = ((dst & src) == 0); in atom_op_test()
1009 SDEBUG(" result: %s\n", ctx->ctx->cs_equal ? "EQ" : "NE"); in atom_op_test()
1161 int base = CU16(ctx->cmd_table + 4 + 2 * index); in atom_execute_table_locked()
1168 return -EINVAL; in atom_execute_table_locked()
1192 SDEBUG("%s @ 0x%04X\n", atom_op_names[op], ptr - 1); in atom_execute_table_locked()
1194 SDEBUG("[%d] @ 0x%04X\n", op, ptr - 1); in atom_execute_table_locked()
1197 base, len, ws, ps, ptr - 1); in atom_execute_table_locked()
1198 ret = -EINVAL; in atom_execute_table_locked()
1211 debug_depth--; in atom_execute_table_locked()
1224 mutex_lock(&ctx->mutex); in atom_execute_table()
1225 /* reset reg block */ in atom_execute_table()
1226 ctx->reg_block = 0; in atom_execute_table()
1228 ctx->fb_base = 0; in atom_execute_table()
1230 ctx->io_mode = ATOM_IO_MM; in atom_execute_table()
1232 mutex_unlock(&ctx->mutex); in atom_execute_table()
1240 ctx->iio = kzalloc(2 * 256, GFP_KERNEL); in atom_index_iio()
1242 ctx->iio[CU8(base + 1)] = base + 2; in atom_index_iio()
1262 ctx->card = card; in atom_parse()
1263 ctx->bios = bios; in atom_parse()
1287 ctx->cmd_table = CU16(base + ATOM_ROM_CMD_PTR); in atom_parse()
1288 ctx->data_table = CU16(base + ATOM_ROM_DATA_PTR); in atom_parse()
1289 atom_index_iio(ctx, CU16(ctx->data_table + ATOM_DATA_IIO_PTR) + 4); in atom_parse()
1309 int hwi = CU16(ctx->data_table + ATOM_DATA_FWI_PTR); in atom_asic_init()
1318 if (!CU16(ctx->cmd_table + 4 + 2 * ATOM_CMD_INIT)) in atom_asic_init()
1325 if (ctx->iio) in atom_destroy()
1326 kfree(ctx->iio); in atom_destroy()
1335 int idx = CU16(ctx->data_table + offset); in atom_parse_data_header()
1336 u16 *mdt = (u16 *)(ctx->bios + ctx->data_table + 4); in atom_parse_data_header()
1355 int idx = CU16(ctx->cmd_table + offset); in atom_parse_cmd_header()
1356 u16 *mct = (u16 *)(ctx->bios + ctx->cmd_table + 4); in atom_parse_cmd_header()
1376 firmware_usage = (struct _ATOM_VRAM_USAGE_BY_FIRMWARE *)(ctx->bios + data_offset); in atom_allocate_fb_scratch()
1379 firmware_usage->asFirmwareVramReserveInfo[0].ulStartAddrUsedByFirmware, in atom_allocate_fb_scratch()
1380 firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb); in atom_allocate_fb_scratch()
1382 usage_bytes = firmware_usage->asFirmwareVramReserveInfo[0].usFirmwareUseInKb * 1024; in atom_allocate_fb_scratch()
1384 ctx->scratch_size_bytes = 0; in atom_allocate_fb_scratch()
1388 ctx->scratch = kzalloc(usage_bytes, GFP_KERNEL); in atom_allocate_fb_scratch()
1389 if (!ctx->scratch) in atom_allocate_fb_scratch()
1390 return -ENOMEM; in atom_allocate_fb_scratch()
1391 ctx->scratch_size_bytes = usage_bytes; in atom_allocate_fb_scratch()