• Home
  • Raw
  • Download

Lines Matching refs:ast

37 void ast_set_index_reg_mask(struct ast_private *ast,  in ast_set_index_reg_mask()  argument
42 ast_io_write8(ast, base, index); in ast_set_index_reg_mask()
43 tmp = (ast_io_read8(ast, base + 1) & mask) | val; in ast_set_index_reg_mask()
44 ast_set_index_reg(ast, base, index, tmp); in ast_set_index_reg_mask()
47 uint8_t ast_get_index_reg(struct ast_private *ast, in ast_get_index_reg() argument
51 ast_io_write8(ast, base, index); in ast_get_index_reg()
52 ret = ast_io_read8(ast, base + 1); in ast_get_index_reg()
56 uint8_t ast_get_index_reg_mask(struct ast_private *ast, in ast_get_index_reg_mask() argument
60 ast_io_write8(ast, base, index); in ast_get_index_reg_mask()
61 ret = ast_io_read8(ast, base + 1) & mask; in ast_get_index_reg_mask()
68 struct ast_private *ast = dev->dev_private; in ast_detect_config_mode() local
72 ast->config_mode = ast_use_defaults; in ast_detect_config_mode()
79 ast->config_mode = ast_use_dt; in ast_detect_config_mode()
93 jregd0 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); in ast_detect_config_mode()
94 jregd1 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff); in ast_detect_config_mode()
97 data = ast_read32(ast, 0xf004); in ast_detect_config_mode()
100 ast->config_mode = ast_use_p2a; in ast_detect_config_mode()
105 ast_write32(ast, 0xf004, 0x1e6e0000); in ast_detect_config_mode()
106 ast_write32(ast, 0xf000, 0x1); in ast_detect_config_mode()
107 *scu_rev = ast_read32(ast, 0x1207c); in ast_detect_config_mode()
118 struct ast_private *ast = dev->dev_private; in ast_detect_chip() local
137 ast_open_key(ast); in ast_detect_chip()
144 ast->chip = AST1100; in ast_detect_chip()
148 ast->chip = AST2400; in ast_detect_chip()
151 ast->chip = AST2300; in ast_detect_chip()
156 ast->chip = AST1100; in ast_detect_chip()
160 ast->chip = AST2200; in ast_detect_chip()
164 ast->chip = AST2150; in ast_detect_chip()
168 ast->chip = AST2100; in ast_detect_chip()
172 ast->vga2_clone = false; in ast_detect_chip()
174 ast->chip = AST2000; in ast_detect_chip()
180 switch (ast->chip) { in ast_detect_chip()
182 ast->support_wide_screen = true; in ast_detect_chip()
185 ast->support_wide_screen = false; in ast_detect_chip()
188 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); in ast_detect_chip()
190 ast->support_wide_screen = true; in ast_detect_chip()
192 ast->support_wide_screen = true; in ast_detect_chip()
194 ast->support_wide_screen = false; in ast_detect_chip()
195 if (ast->chip == AST2300 && in ast_detect_chip()
197 ast->support_wide_screen = true; in ast_detect_chip()
198 if (ast->chip == AST2400 && in ast_detect_chip()
200 ast->support_wide_screen = true; in ast_detect_chip()
206 ast->tx_chip_type = AST_TX_NONE; in ast_detect_chip()
217 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xff); in ast_detect_chip()
219 ast->tx_chip_type = AST_TX_SIL164; in ast_detect_chip()
222 if ((ast->chip == AST2300) || (ast->chip == AST2400)) { in ast_detect_chip()
228 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff); in ast_detect_chip()
231 ast->tx_chip_type = AST_TX_SIL164; in ast_detect_chip()
234 ast->dp501_fw_addr = kzalloc(32*1024, GFP_KERNEL); in ast_detect_chip()
235 if (ast->dp501_fw_addr) { in ast_detect_chip()
237 if (ast_backup_fw(dev, ast->dp501_fw_addr, 32*1024)) { in ast_detect_chip()
238 kfree(ast->dp501_fw_addr); in ast_detect_chip()
239 ast->dp501_fw_addr = NULL; in ast_detect_chip()
244 ast->tx_chip_type = AST_TX_DP501; in ast_detect_chip()
249 switch(ast->tx_chip_type) { in ast_detect_chip()
265 struct ast_private *ast = dev->dev_private; in ast_get_dram_info() local
269 switch (ast->config_mode) { in ast_get_dram_info()
286 ast_write32(ast, 0xf004, 0x1e6e0000); in ast_get_dram_info()
287 ast_write32(ast, 0xf000, 0x1); in ast_get_dram_info()
288 mcr_cfg = ast_read32(ast, 0x10004); in ast_get_dram_info()
289 mcr_scu_mpll = ast_read32(ast, 0x10120); in ast_get_dram_info()
290 mcr_scu_strap = ast_read32(ast, 0x10170); in ast_get_dram_info()
294 ast->dram_bus_width = 16; in ast_get_dram_info()
295 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
296 ast->mclk = 396; in ast_get_dram_info()
301 ast->dram_bus_width = 16; in ast_get_dram_info()
303 ast->dram_bus_width = 32; in ast_get_dram_info()
305 if (ast->chip == AST2300 || ast->chip == AST2400) { in ast_get_dram_info()
308 ast->dram_type = AST_DRAM_512Mx16; in ast_get_dram_info()
312 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
315 ast->dram_type = AST_DRAM_2Gx16; in ast_get_dram_info()
318 ast->dram_type = AST_DRAM_4Gx16; in ast_get_dram_info()
325 ast->dram_type = AST_DRAM_512Mx16; in ast_get_dram_info()
329 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
331 ast->dram_type = AST_DRAM_512Mx32; in ast_get_dram_info()
334 ast->dram_type = AST_DRAM_1Gx32; in ast_get_dram_info()
359 ast->mclk = ref_pll * (num + 2) / (denum + 2) * (div * 1000); in ast_get_dram_info()
429 struct ast_private *ast = dev->dev_private; in ast_get_vram_info() local
432 ast_open_key(ast); in ast_get_vram_info()
435 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xaa, 0xff); in ast_get_vram_info()
443 jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0x99, 0xff); in ast_get_vram_info()
461 struct ast_private *ast; in ast_driver_load() local
465 ast = kzalloc(sizeof(struct ast_private), GFP_KERNEL); in ast_driver_load()
466 if (!ast) in ast_driver_load()
469 dev->dev_private = ast; in ast_driver_load()
470 ast->dev = dev; in ast_driver_load()
472 ast->regs = pci_iomap(dev->pdev, 1, 0); in ast_driver_load()
473 if (!ast->regs) { in ast_driver_load()
485 ast->ioregs = ast->regs + AST_IO_MM_OFFSET; in ast_driver_load()
489 if (!ast->ioregs) { in ast_driver_load()
490 ast->ioregs = pci_iomap(dev->pdev, 2, 0); in ast_driver_load()
491 if (!ast->ioregs) { in ast_driver_load()
499 if (ast->chip != AST1180) { in ast_driver_load()
503 ast->vram_size = ast_get_vram_info(dev); in ast_driver_load()
504 DRM_INFO("dram %d %d %d %08x\n", ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size); in ast_driver_load()
510 ret = ast_mm_init(ast); in ast_driver_load()
521 dev->mode_config.fb_base = pci_resource_start(ast->dev->pdev, 0); in ast_driver_load()
523 if (ast->chip == AST2100 || in ast_driver_load()
524 ast->chip == AST2200 || in ast_driver_load()
525 ast->chip == AST2300 || in ast_driver_load()
526 ast->chip == AST2400 || in ast_driver_load()
527 ast->chip == AST1180) { in ast_driver_load()
545 kfree(ast); in ast_driver_load()
552 struct ast_private *ast = dev->dev_private; in ast_driver_unload() local
554 kfree(ast->dp501_fw_addr); in ast_driver_unload()
559 ast_mm_fini(ast); in ast_driver_unload()
560 if (ast->ioregs != ast->regs + AST_IO_MM_OFFSET) in ast_driver_unload()
561 pci_iounmap(dev->pdev, ast->ioregs); in ast_driver_unload()
562 pci_iounmap(dev->pdev, ast->regs); in ast_driver_unload()
563 kfree(ast); in ast_driver_unload()