Lines Matching +full:ast2500 +full:- +full:scu

14  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
70 struct device_node *np = dev->pdev->dev.of_node; in ast_detect_config_mode()
75 ast->config_mode = ast_use_defaults; in ast_detect_config_mode()
78 /* Check if we have device-tree properties */ in ast_detect_config_mode()
79 if (np && !of_property_read_u32(np, "aspeed,scu-revision-id", in ast_detect_config_mode()
82 ast->config_mode = ast_use_dt; in ast_detect_config_mode()
83 drm_info(dev, "Using device-tree for configuration\n"); in ast_detect_config_mode()
88 if (dev->pdev->device != PCI_CHIP_AST2000) in ast_detect_config_mode()
92 * The BMC will set SCU 0x40 D[12] to 1 if the P2 bridge in ast_detect_config_mode()
103 ast->config_mode = ast_use_p2a; in ast_detect_config_mode()
128 * (Assumption: VGA not enabled -> need to POST) in ast_detect_chip()
142 /* Find out whether P2A works or whether to use device-tree */ in ast_detect_chip()
146 if (dev->pdev->revision >= 0x40) { in ast_detect_chip()
147 ast->chip = AST2500; in ast_detect_chip()
149 } else if (dev->pdev->revision >= 0x30) { in ast_detect_chip()
150 ast->chip = AST2400; in ast_detect_chip()
152 } else if (dev->pdev->revision >= 0x20) { in ast_detect_chip()
153 ast->chip = AST2300; in ast_detect_chip()
155 } else if (dev->pdev->revision >= 0x10) { in ast_detect_chip()
158 ast->chip = AST1100; in ast_detect_chip()
162 ast->chip = AST2200; in ast_detect_chip()
166 ast->chip = AST2150; in ast_detect_chip()
170 ast->chip = AST2100; in ast_detect_chip()
174 ast->vga2_clone = false; in ast_detect_chip()
176 ast->chip = AST2000; in ast_detect_chip()
181 switch (ast->chip) { in ast_detect_chip()
183 ast->support_wide_screen = false; in ast_detect_chip()
188 ast->support_wide_screen = true; in ast_detect_chip()
190 ast->support_wide_screen = true; in ast_detect_chip()
192 ast->support_wide_screen = false; in ast_detect_chip()
193 if (ast->chip == AST2300 && in ast_detect_chip()
195 ast->support_wide_screen = true; in ast_detect_chip()
196 if (ast->chip == AST2400 && in ast_detect_chip()
198 ast->support_wide_screen = true; in ast_detect_chip()
199 if (ast->chip == AST2500 && in ast_detect_chip()
201 ast->support_wide_screen = true; in ast_detect_chip()
207 ast->tx_chip_type = AST_TX_NONE; in ast_detect_chip()
214 * is at power-on reset, otherwise we'll incorrectly "detect" a in ast_detect_chip()
220 ast->tx_chip_type = AST_TX_SIL164; in ast_detect_chip()
223 if ((ast->chip == AST2300) || (ast->chip == AST2400)) { in ast_detect_chip()
232 ast->tx_chip_type = AST_TX_SIL164; in ast_detect_chip()
235 ast->dp501_fw_addr = drmm_kzalloc(dev, 32*1024, GFP_KERNEL); in ast_detect_chip()
236 if (ast->dp501_fw_addr) { in ast_detect_chip()
238 if (ast_backup_fw(dev, ast->dp501_fw_addr, 32*1024)) { in ast_detect_chip()
239 drmm_kfree(dev, ast->dp501_fw_addr); in ast_detect_chip()
240 ast->dp501_fw_addr = NULL; in ast_detect_chip()
245 ast->tx_chip_type = AST_TX_DP501; in ast_detect_chip()
250 switch(ast->tx_chip_type) { in ast_detect_chip()
265 struct device_node *np = dev->pdev->dev.of_node; in ast_get_dram_info()
270 switch (ast->config_mode) { in ast_get_dram_info()
276 if (of_property_read_u32(np, "aspeed,mcr-configuration", in ast_get_dram_info()
279 if (of_property_read_u32(np, "aspeed,mcr-scu-mpll", in ast_get_dram_info()
282 if (of_property_read_u32(np, "aspeed,mcr-scu-strap", in ast_get_dram_info()
295 ast->dram_bus_width = 16; in ast_get_dram_info()
296 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
297 if (ast->chip == AST2500) in ast_get_dram_info()
298 ast->mclk = 800; in ast_get_dram_info()
300 ast->mclk = 396; in ast_get_dram_info()
305 ast->dram_bus_width = 16; in ast_get_dram_info()
307 ast->dram_bus_width = 32; in ast_get_dram_info()
309 if (ast->chip == AST2500) { in ast_get_dram_info()
312 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
316 ast->dram_type = AST_DRAM_2Gx16; in ast_get_dram_info()
319 ast->dram_type = AST_DRAM_4Gx16; in ast_get_dram_info()
322 ast->dram_type = AST_DRAM_8Gx16; in ast_get_dram_info()
325 } else if (ast->chip == AST2300 || ast->chip == AST2400) { in ast_get_dram_info()
328 ast->dram_type = AST_DRAM_512Mx16; in ast_get_dram_info()
332 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
335 ast->dram_type = AST_DRAM_2Gx16; in ast_get_dram_info()
338 ast->dram_type = AST_DRAM_4Gx16; in ast_get_dram_info()
345 ast->dram_type = AST_DRAM_512Mx16; in ast_get_dram_info()
349 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
351 ast->dram_type = AST_DRAM_512Mx32; in ast_get_dram_info()
354 ast->dram_type = AST_DRAM_1Gx32; in ast_get_dram_info()
379 ast->mclk = ref_pll * (num + 2) / ((denum + 2) * (div * 1000)); in ast_get_dram_info()
404 ast = devm_drm_dev_alloc(&pdev->dev, drv, struct ast_private, base); in ast_device_create()
407 dev = &ast->base; in ast_device_create()
409 dev->pdev = pdev; in ast_device_create()
412 ast->regs = pci_iomap(dev->pdev, 1, 0); in ast_device_create()
413 if (!ast->regs) in ast_device_create()
414 return ERR_PTR(-EIO); in ast_device_create()
421 if (!(pci_resource_flags(dev->pdev, 2) & IORESOURCE_IO)) { in ast_device_create()
423 ast->ioregs = ast->regs + AST_IO_MM_OFFSET; in ast_device_create()
427 if (!ast->ioregs) { in ast_device_create()
428 ast->ioregs = pci_iomap(dev->pdev, 2, 0); in ast_device_create()
429 if (!ast->ioregs) in ast_device_create()
430 return ERR_PTR(-EIO); in ast_device_create()
440 ast->mclk, ast->dram_type, ast->dram_bus_width); in ast_device_create()
453 ret = devm_add_action_or_reset(dev->dev, ast_device_release, ast); in ast_device_create()