Lines Matching +full:ast2600 +full:- +full:scu

14  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
70 struct device_node *np = dev->dev->of_node; in ast_detect_config_mode()
72 struct pci_dev *pdev = to_pci_dev(dev->dev); in ast_detect_config_mode()
76 ast->config_mode = ast_use_defaults; in ast_detect_config_mode()
79 /* Check if we have device-tree properties */ in ast_detect_config_mode()
80 if (np && !of_property_read_u32(np, "aspeed,scu-revision-id", in ast_detect_config_mode()
83 ast->config_mode = ast_use_dt; in ast_detect_config_mode()
84 drm_info(dev, "Using device-tree for configuration\n"); in ast_detect_config_mode()
89 if (pdev->device != PCI_CHIP_AST2000) in ast_detect_config_mode()
93 * The BMC will set SCU 0x40 D[12] to 1 if the P2 bridge in ast_detect_config_mode()
101 if (((pdev->revision & 0xF0) == 0x40) in ast_detect_config_mode()
109 ast->config_mode = ast_use_p2a; in ast_detect_config_mode()
128 struct pci_dev *pdev = to_pci_dev(dev->dev); in ast_detect_chip()
135 * (Assumption: VGA not enabled -> need to POST) in ast_detect_chip()
149 /* Find out whether P2A works or whether to use device-tree */ in ast_detect_chip()
153 if (pdev->revision >= 0x50) { in ast_detect_chip()
154 ast->chip = AST2600; in ast_detect_chip()
156 } else if (pdev->revision >= 0x40) { in ast_detect_chip()
157 ast->chip = AST2500; in ast_detect_chip()
159 } else if (pdev->revision >= 0x30) { in ast_detect_chip()
160 ast->chip = AST2400; in ast_detect_chip()
162 } else if (pdev->revision >= 0x20) { in ast_detect_chip()
163 ast->chip = AST2300; in ast_detect_chip()
165 } else if (pdev->revision >= 0x10) { in ast_detect_chip()
168 ast->chip = AST1100; in ast_detect_chip()
172 ast->chip = AST2200; in ast_detect_chip()
176 ast->chip = AST2150; in ast_detect_chip()
180 ast->chip = AST2100; in ast_detect_chip()
184 ast->vga2_clone = false; in ast_detect_chip()
186 ast->chip = AST2000; in ast_detect_chip()
191 switch (ast->chip) { in ast_detect_chip()
193 ast->support_wide_screen = false; in ast_detect_chip()
198 ast->support_wide_screen = true; in ast_detect_chip()
200 ast->support_wide_screen = true; in ast_detect_chip()
202 ast->support_wide_screen = false; in ast_detect_chip()
203 if (ast->chip == AST2300 && in ast_detect_chip()
205 ast->support_wide_screen = true; in ast_detect_chip()
206 if (ast->chip == AST2400 && in ast_detect_chip()
208 ast->support_wide_screen = true; in ast_detect_chip()
209 if (ast->chip == AST2500 && in ast_detect_chip()
211 ast->support_wide_screen = true; in ast_detect_chip()
212 if (ast->chip == AST2600) /* ast2600 */ in ast_detect_chip()
213 ast->support_wide_screen = true; in ast_detect_chip()
219 ast->tx_chip_types |= AST_TX_NONE_BIT; in ast_detect_chip()
226 * is at power-on reset, otherwise we'll incorrectly "detect" a in ast_detect_chip()
232 ast->tx_chip_types = AST_TX_SIL164_BIT; in ast_detect_chip()
235 if ((ast->chip == AST2300) || (ast->chip == AST2400) || (ast->chip == AST2500)) { in ast_detect_chip()
244 ast->tx_chip_types = AST_TX_SIL164_BIT; in ast_detect_chip()
247 ast->dp501_fw_addr = drmm_kzalloc(dev, 32*1024, GFP_KERNEL); in ast_detect_chip()
248 if (ast->dp501_fw_addr) { in ast_detect_chip()
250 if (ast_backup_fw(dev, ast->dp501_fw_addr, 32*1024)) { in ast_detect_chip()
251 drmm_kfree(dev, ast->dp501_fw_addr); in ast_detect_chip()
252 ast->dp501_fw_addr = NULL; in ast_detect_chip()
257 ast->tx_chip_types = AST_TX_DP501_BIT; in ast_detect_chip()
259 } else if (ast->chip == AST2600) in ast_detect_chip()
260 ast_dp_launch(&ast->base, 0); in ast_detect_chip()
263 if (ast->tx_chip_types & AST_TX_NONE_BIT) in ast_detect_chip()
265 if (ast->tx_chip_types & AST_TX_SIL164_BIT) in ast_detect_chip()
267 if (ast->tx_chip_types & AST_TX_DP501_BIT) in ast_detect_chip()
275 struct device_node *np = dev->dev->of_node; in ast_get_dram_info()
280 switch (ast->config_mode) { in ast_get_dram_info()
286 if (of_property_read_u32(np, "aspeed,mcr-configuration", in ast_get_dram_info()
289 if (of_property_read_u32(np, "aspeed,mcr-scu-mpll", in ast_get_dram_info()
292 if (of_property_read_u32(np, "aspeed,mcr-scu-strap", in ast_get_dram_info()
305 ast->dram_bus_width = 16; in ast_get_dram_info()
306 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
307 if (ast->chip == AST2500) in ast_get_dram_info()
308 ast->mclk = 800; in ast_get_dram_info()
310 ast->mclk = 396; in ast_get_dram_info()
315 ast->dram_bus_width = 16; in ast_get_dram_info()
317 ast->dram_bus_width = 32; in ast_get_dram_info()
319 if (ast->chip == AST2500) { in ast_get_dram_info()
322 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
326 ast->dram_type = AST_DRAM_2Gx16; in ast_get_dram_info()
329 ast->dram_type = AST_DRAM_4Gx16; in ast_get_dram_info()
332 ast->dram_type = AST_DRAM_8Gx16; in ast_get_dram_info()
335 } else if (ast->chip == AST2300 || ast->chip == AST2400) { in ast_get_dram_info()
338 ast->dram_type = AST_DRAM_512Mx16; in ast_get_dram_info()
342 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
345 ast->dram_type = AST_DRAM_2Gx16; in ast_get_dram_info()
348 ast->dram_type = AST_DRAM_4Gx16; in ast_get_dram_info()
355 ast->dram_type = AST_DRAM_512Mx16; in ast_get_dram_info()
359 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
361 ast->dram_type = AST_DRAM_512Mx32; in ast_get_dram_info()
364 ast->dram_type = AST_DRAM_1Gx32; in ast_get_dram_info()
389 ast->mclk = ref_pll * (num + 2) / ((denum + 2) * (div * 1000)); in ast_get_dram_info()
414 ast = devm_drm_dev_alloc(&pdev->dev, drv, struct ast_private, base); in ast_device_create()
417 dev = &ast->base; in ast_device_create()
421 ret = drmm_mutex_init(dev, &ast->ioregs_lock); in ast_device_create()
425 ast->regs = pcim_iomap(pdev, 1, 0); in ast_device_create()
426 if (!ast->regs) in ast_device_create()
427 return ERR_PTR(-EIO); in ast_device_create()
436 ast->ioregs = ast->regs + AST_IO_MM_OFFSET; in ast_device_create()
440 if (!ast->ioregs) { in ast_device_create()
441 ast->ioregs = pcim_iomap(pdev, 2, 0); in ast_device_create()
442 if (!ast->ioregs) in ast_device_create()
443 return ERR_PTR(-EIO); in ast_device_create()
453 ast->mclk, ast->dram_type, ast->dram_bus_width); in ast_device_create()
463 ast->dp501_fw_buf = NULL; in ast_device_create()
464 if (dev->vram_mm->vram_size < pci_resource_len(pdev, 0)) { in ast_device_create()
465 ast->dp501_fw_buf = pci_iomap_range(pdev, 0, dev->vram_mm->vram_size, 0); in ast_device_create()
466 if (!ast->dp501_fw_buf) in ast_device_create()
474 ret = devm_add_action_or_reset(dev->dev, ast_device_release, ast); in ast_device_create()