Lines Matching refs:ast

13 	struct ast_private *ast = data;  in ast_release_firmware()  local
15 release_firmware(ast->dp501_fw); in ast_release_firmware()
16 ast->dp501_fw = NULL; in ast_release_firmware()
21 struct ast_private *ast = to_ast_private(dev); in ast_load_dp501_microcode() local
24 ret = request_firmware(&ast->dp501_fw, "ast_dp501_fw.bin", dev->dev); in ast_load_dp501_microcode()
28 return devm_add_action_or_reset(dev->dev, ast_release_firmware, ast); in ast_load_dp501_microcode()
31 static void send_ack(struct ast_private *ast) in send_ack() argument
34 sendack = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, 0xff); in send_ack()
36 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, 0x00, sendack); in send_ack()
39 static void send_nack(struct ast_private *ast) in send_nack() argument
42 sendack = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, 0xff); in send_nack()
44 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, 0x00, sendack); in send_nack()
47 static bool wait_ack(struct ast_private *ast) in wait_ack() argument
52 waitack = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd2, 0xff); in wait_ack()
63 static bool wait_nack(struct ast_private *ast) in wait_nack() argument
68 waitack = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd2, 0xff); in wait_nack()
79 static void set_cmd_trigger(struct ast_private *ast) in set_cmd_trigger() argument
81 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, ~0x40, 0x40); in set_cmd_trigger()
84 static void clear_cmd_trigger(struct ast_private *ast) in clear_cmd_trigger() argument
86 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9b, ~0x40, 0x00); in clear_cmd_trigger()
90 static bool wait_fw_ready(struct ast_private *ast)
95 waitready = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd2, 0xff);
109 struct ast_private *ast = to_ast_private(dev); in ast_write_cmd() local
111 if (wait_nack(ast)) { in ast_write_cmd()
112 send_nack(ast); in ast_write_cmd()
113 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9a, 0x00, data); in ast_write_cmd()
114 send_ack(ast); in ast_write_cmd()
115 set_cmd_trigger(ast); in ast_write_cmd()
117 if (wait_ack(ast)) { in ast_write_cmd()
118 clear_cmd_trigger(ast); in ast_write_cmd()
119 send_nack(ast); in ast_write_cmd()
124 clear_cmd_trigger(ast); in ast_write_cmd()
125 send_nack(ast); in ast_write_cmd()
131 struct ast_private *ast = to_ast_private(dev); in ast_write_data() local
133 if (wait_nack(ast)) { in ast_write_data()
134 send_nack(ast); in ast_write_data()
135 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9a, 0x00, data); in ast_write_data()
136 send_ack(ast); in ast_write_data()
137 if (wait_ack(ast)) { in ast_write_data()
138 send_nack(ast); in ast_write_data()
142 send_nack(ast); in ast_write_data()
149 struct ast_private *ast = to_ast_private(dev);
154 if (wait_ack(ast) == false)
156 tmp = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd3, 0xff);
158 if (wait_nack(ast) == false) {
159 send_nack(ast);
162 send_nack(ast);
166 static void clear_cmd(struct ast_private *ast)
168 send_nack(ast);
169 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x9a, 0x00, 0x00);
181 static u32 get_fw_base(struct ast_private *ast) in get_fw_base() argument
183 return ast_mindwm(ast, 0x1e6e2104) & 0x7fffffff; in get_fw_base()
188 struct ast_private *ast = to_ast_private(dev); in ast_backup_fw() local
192 if (ast->config_mode != ast_use_p2a) in ast_backup_fw()
195 data = ast_mindwm(ast, 0x1e6e2100) & 0x01; in ast_backup_fw()
197 boot_address = get_fw_base(ast); in ast_backup_fw()
199 *(u32 *)(addr + i) = ast_mindwm(ast, boot_address + i); in ast_backup_fw()
207 struct ast_private *ast = to_ast_private(dev); in ast_launch_m68k() local
213 if (ast->config_mode != ast_use_p2a) in ast_launch_m68k()
216 data = ast_mindwm(ast, 0x1e6e2100) & 0x01; in ast_launch_m68k()
219 if (ast->dp501_fw_addr) { in ast_launch_m68k()
220 fw_addr = ast->dp501_fw_addr; in ast_launch_m68k()
223 if (!ast->dp501_fw && in ast_launch_m68k()
227 fw_addr = (u8 *)ast->dp501_fw->data; in ast_launch_m68k()
228 len = ast->dp501_fw->size; in ast_launch_m68k()
231 ast_moutdwm(ast, 0x1e6e2000, 0x1688a8a8); in ast_launch_m68k()
232 data = ast_mindwm(ast, 0x1e6e0004); in ast_launch_m68k()
253 ast_moutdwm(ast, boot_address + i, data); in ast_launch_m68k()
257 ast_moutdwm(ast, 0x1e6e2000, 0x1688a8a8); in ast_launch_m68k()
260 ast_moutdwm(ast, 0x1e6e2104, 0x80000000 + boot_address); in ast_launch_m68k()
261 ast_moutdwm(ast, 0x1e6e2100, 1); in ast_launch_m68k()
264 data = ast_mindwm(ast, 0x1e6e2040) & 0xfffff1ff; /* D[11:9] = 100b: UEFI handling */ in ast_launch_m68k()
266 ast_moutdwm(ast, 0x1e6e2040, data); in ast_launch_m68k()
268 …jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x99, 0xfc); /* D[1:0]: Reserved Video Buffer… in ast_launch_m68k()
270 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0x99, jreg); in ast_launch_m68k()
277 struct ast_private *ast = to_ast_private(dev); in ast_dp501_read_edid() local
281 if (ast->config_mode == ast_use_p2a) { in ast_dp501_read_edid()
282 boot_address = get_fw_base(ast); in ast_dp501_read_edid()
286 data = ast_mindwm(ast, boot_address + offset); in ast_dp501_read_edid()
292 data = ast_mindwm(ast, boot_address + offset); in ast_dp501_read_edid()
299 data = ast_mindwm(ast, boot_address + offset + i); in ast_dp501_read_edid()
304 if (!ast->dp501_fw_buf) in ast_dp501_read_edid()
309 data = readl(ast->dp501_fw_buf + offset); in ast_dp501_read_edid()
313 data = readl(ast->dp501_fw_buf + offset); in ast_dp501_read_edid()
319 data = readl(ast->dp501_fw_buf + offset); in ast_dp501_read_edid()
326 data = readl(ast->dp501_fw_buf + offset + i); in ast_dp501_read_edid()
337 struct ast_private *ast = to_ast_private(dev); in ast_init_dvo() local
340 ast_write32(ast, 0xf004, 0x1e6e0000); in ast_init_dvo()
341 ast_write32(ast, 0xf000, 0x1); in ast_init_dvo()
342 ast_write32(ast, 0x12000, 0x1688a8a8); in ast_init_dvo()
344 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); in ast_init_dvo()
347 data = ast_read32(ast, 0x12008); in ast_init_dvo()
351 ast_write32(ast, 0x12008, data); in ast_init_dvo()
353 if (ast->chip == AST2300) { in ast_init_dvo()
354 data = ast_read32(ast, 0x12084); in ast_init_dvo()
357 ast_write32(ast, 0x12084, data); in ast_init_dvo()
359 data = ast_read32(ast, 0x12088); in ast_init_dvo()
362 ast_write32(ast, 0x12088, data); in ast_init_dvo()
364 data = ast_read32(ast, 0x12090); in ast_init_dvo()
368 ast_write32(ast, 0x12090, data); in ast_init_dvo()
370 data = ast_read32(ast, 0x12088); in ast_init_dvo()
373 ast_write32(ast, 0x12088, data); in ast_init_dvo()
375 data = ast_read32(ast, 0x1208c); in ast_init_dvo()
378 ast_write32(ast, 0x1208c, data); in ast_init_dvo()
380 data = ast_read32(ast, 0x120a4); in ast_init_dvo()
383 ast_write32(ast, 0x120a4, data); in ast_init_dvo()
385 data = ast_read32(ast, 0x120a8); in ast_init_dvo()
388 ast_write32(ast, 0x120a8, data); in ast_init_dvo()
390 data = ast_read32(ast, 0x12094); in ast_init_dvo()
393 ast_write32(ast, 0x12094, data); in ast_init_dvo()
398 data = ast_read32(ast, 0x1202c); in ast_init_dvo()
400 ast_write32(ast, 0x1202c, data); in ast_init_dvo()
403 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xcf, 0x80); in ast_init_dvo()
410 struct ast_private *ast = to_ast_private(dev); in ast_init_analog() local
418 ast_write32(ast, 0xf004, 0x1e6e0000); in ast_init_analog()
419 ast_write32(ast, 0xf000, 0x1); in ast_init_analog()
422 ast_write32(ast, 0x12000, 0x1688a8a8); in ast_init_analog()
423 ast_write32(ast, 0x12000, 0x1688a8a8); in ast_init_analog()
424 ast_write32(ast, 0x12000, 0x1688a8a8); in ast_init_analog()
427 data = ast_read32(ast, 0x1202c); in ast_init_analog()
429 ast_write32(ast, 0, data); in ast_init_analog()
432 ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xcf, 0x00); in ast_init_analog()
437 struct ast_private *ast = to_ast_private(dev); in ast_init_3rdtx() local
440 if (ast->chip == AST2300 || ast->chip == AST2400) { in ast_init_3rdtx()
441 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff); in ast_init_3rdtx()
453 if (ast->tx_chip_types & BIT(AST_TX_SIL164)) in ast_init_3rdtx()