Skip to content

Commit 4327a61

Browse files
jammyaspeedThomas Zimmermann
authored andcommitted
drm/ast: Fix ARM compatibility
ARM architecture only has 'memory', so all devices are accessed by MMIO if possible. Signed-off-by: Jammy Huang <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b63a553 commit 4327a61

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/ast/ast_main.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,12 @@ struct ast_private *ast_device_create(const struct drm_driver *drv,
425425
return ERR_PTR(-EIO);
426426

427427
/*
428-
* If we don't have IO space at all, use MMIO now and
429-
* assume the chip has MMIO enabled by default (rev 0x20
430-
* and higher).
428+
* After AST2500, MMIO is enabled by default, and it should be adopted
429+
* to be compatible with Arm.
431430
*/
432-
if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) {
431+
if (pdev->revision >= 0x40) {
432+
ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
433+
} else if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) {
433434
drm_info(dev, "platform has no IO space, trying MMIO\n");
434435
ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
435436
}

0 commit comments

Comments
 (0)