Lines Matching +full:ast2400 +full:- +full:scu
14 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
70 struct drm_device *dev = &ast->base; in ast_enable_mmio()
74 return devm_add_action_or_reset(dev->dev, ast_enable_mmio_release, ast); in ast_enable_mmio()
84 struct drm_device *dev = &ast->base; in ast_device_config_init()
85 struct pci_dev *pdev = to_pci_dev(dev->dev); in ast_device_config_init()
86 struct device_node *np = dev->dev->of_node; in ast_device_config_init()
92 * Find configuration mode and read SCU revision in ast_device_config_init()
95 ast->config_mode = ast_use_defaults; in ast_device_config_init()
97 /* Check if we have device-tree properties */ in ast_device_config_init()
98 if (np && !of_property_read_u32(np, "aspeed,scu-revision-id", &data)) { in ast_device_config_init()
100 ast->config_mode = ast_use_dt; in ast_device_config_init()
102 } else if (pdev->device == PCI_CHIP_AST2000) { // Not all families have a P2A bridge in ast_device_config_init()
104 * The BMC will set SCU 0x40 D[12] to 1 if the P2 bridge in ast_device_config_init()
117 if ((pdev->revision & 0xf0) == 0x40) { in ast_device_config_init()
125 ast->config_mode = ast_use_p2a; in ast_device_config_init()
135 switch (ast->config_mode) { in ast_device_config_init()
140 drm_info(dev, "Using device-tree for configuration\n"); in ast_device_config_init()
151 if (pdev->revision >= 0x50) { in ast_device_config_init()
152 ast->chip = AST2600; in ast_device_config_init()
154 } else if (pdev->revision >= 0x40) { in ast_device_config_init()
157 ast->chip = AST2510; in ast_device_config_init()
161 ast->chip = AST2500; in ast_device_config_init()
164 } else if (pdev->revision >= 0x30) { in ast_device_config_init()
167 ast->chip = AST1400; in ast_device_config_init()
171 ast->chip = AST2400; in ast_device_config_init()
174 } else if (pdev->revision >= 0x20) { in ast_device_config_init()
177 ast->chip = AST1300; in ast_device_config_init()
181 ast->chip = AST2300; in ast_device_config_init()
185 } else if (pdev->revision >= 0x10) { in ast_device_config_init()
188 ast->chip = AST1100; in ast_device_config_init()
192 ast->chip = AST2200; in ast_device_config_init()
196 ast->chip = AST2150; in ast_device_config_init()
200 ast->chip = AST2100; in ast_device_config_init()
205 ast->chip = AST2000; in ast_device_config_init()
219 ast->support_wide_screen = false; in ast_detect_widescreen()
224 ast->support_wide_screen = true; in ast_detect_widescreen()
226 ast->support_wide_screen = true; in ast_detect_widescreen()
228 ast->support_wide_screen = false; in ast_detect_widescreen()
229 if (ast->chip == AST1300) in ast_detect_widescreen()
230 ast->support_wide_screen = true; in ast_detect_widescreen()
231 if (ast->chip == AST1400) in ast_detect_widescreen()
232 ast->support_wide_screen = true; in ast_detect_widescreen()
233 if (ast->chip == AST2510) in ast_detect_widescreen()
234 ast->support_wide_screen = true; in ast_detect_widescreen()
236 ast->support_wide_screen = true; in ast_detect_widescreen()
244 struct drm_device *dev = &ast->base; in ast_detect_tx_chip()
248 ast->tx_chip_types |= AST_TX_NONE_BIT; in ast_detect_tx_chip()
255 * is at power-on reset, otherwise we'll incorrectly "detect" a in ast_detect_tx_chip()
261 ast->tx_chip_types = AST_TX_SIL164_BIT; in ast_detect_tx_chip()
273 ast->tx_chip_types = AST_TX_SIL164_BIT; in ast_detect_tx_chip()
276 ast->dp501_fw_addr = drmm_kzalloc(dev, 32*1024, GFP_KERNEL); in ast_detect_tx_chip()
277 if (ast->dp501_fw_addr) { in ast_detect_tx_chip()
279 if (ast_backup_fw(dev, ast->dp501_fw_addr, 32*1024)) { in ast_detect_tx_chip()
280 drmm_kfree(dev, ast->dp501_fw_addr); in ast_detect_tx_chip()
281 ast->dp501_fw_addr = NULL; in ast_detect_tx_chip()
286 ast->tx_chip_types = AST_TX_DP501_BIT; in ast_detect_tx_chip()
291 ast->tx_chip_types = AST_TX_ASTDP_BIT; in ast_detect_tx_chip()
292 ast_dp_launch(&ast->base); in ast_detect_tx_chip()
297 if (ast->tx_chip_types & AST_TX_NONE_BIT) in ast_detect_tx_chip()
299 if (ast->tx_chip_types & AST_TX_SIL164_BIT) in ast_detect_tx_chip()
301 if (ast->tx_chip_types & AST_TX_DP501_BIT) in ast_detect_tx_chip()
303 if (ast->tx_chip_types & AST_TX_ASTDP_BIT) in ast_detect_tx_chip()
309 struct device_node *np = dev->dev->of_node; in ast_get_dram_info()
314 switch (ast->config_mode) { in ast_get_dram_info()
320 if (of_property_read_u32(np, "aspeed,mcr-configuration", in ast_get_dram_info()
323 if (of_property_read_u32(np, "aspeed,mcr-scu-mpll", in ast_get_dram_info()
326 if (of_property_read_u32(np, "aspeed,mcr-scu-strap", in ast_get_dram_info()
339 ast->dram_bus_width = 16; in ast_get_dram_info()
340 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
342 ast->mclk = 800; in ast_get_dram_info()
344 ast->mclk = 396; in ast_get_dram_info()
349 ast->dram_bus_width = 16; in ast_get_dram_info()
351 ast->dram_bus_width = 32; in ast_get_dram_info()
356 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
360 ast->dram_type = AST_DRAM_2Gx16; in ast_get_dram_info()
363 ast->dram_type = AST_DRAM_4Gx16; in ast_get_dram_info()
366 ast->dram_type = AST_DRAM_8Gx16; in ast_get_dram_info()
372 ast->dram_type = AST_DRAM_512Mx16; in ast_get_dram_info()
376 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
379 ast->dram_type = AST_DRAM_2Gx16; in ast_get_dram_info()
382 ast->dram_type = AST_DRAM_4Gx16; in ast_get_dram_info()
389 ast->dram_type = AST_DRAM_512Mx16; in ast_get_dram_info()
393 ast->dram_type = AST_DRAM_1Gx16; in ast_get_dram_info()
395 ast->dram_type = AST_DRAM_512Mx32; in ast_get_dram_info()
398 ast->dram_type = AST_DRAM_1Gx32; in ast_get_dram_info()
423 ast->mclk = ref_pll * (num + 2) / ((denum + 2) * (div * 1000)); in ast_get_dram_info()
436 ast = devm_drm_dev_alloc(&pdev->dev, drv, struct ast_device, base); in ast_device_create()
439 dev = &ast->base; in ast_device_create()
443 ret = drmm_mutex_init(dev, &ast->ioregs_lock); in ast_device_create()
447 ast->regs = pcim_iomap(pdev, 1, 0); in ast_device_create()
448 if (!ast->regs) in ast_device_create()
449 return ERR_PTR(-EIO); in ast_device_create()
455 if (pdev->revision >= 0x40) { in ast_device_create()
456 ast->ioregs = ast->regs + AST_IO_MM_OFFSET; in ast_device_create()
459 ast->ioregs = ast->regs + AST_IO_MM_OFFSET; in ast_device_create()
463 if (!ast->ioregs) { in ast_device_create()
464 ast->ioregs = pcim_iomap(pdev, 2, 0); in ast_device_create()
465 if (!ast->ioregs) in ast_device_create()
466 return ERR_PTR(-EIO); in ast_device_create()
499 ast->mclk, ast->dram_type, ast->dram_bus_width); in ast_device_create()
509 ast->dp501_fw_buf = NULL; in ast_device_create()
510 if (ast->vram_size < pci_resource_len(pdev, 0)) { in ast_device_create()
511 ast->dp501_fw_buf = pci_iomap_range(pdev, 0, ast->vram_size, 0); in ast_device_create()
512 if (!ast->dp501_fw_buf) in ast_device_create()