Skip to content

Commit 9effbed

Browse files
committed
drm/ast: Fix ARM compatibility
jira LE-1907 Rebuild_History Non-Buildable kernel-5.14.0-284.30.1.el9_2 commit-author Jammy Huang <[email protected]> commit 4327a61 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] (cherry picked from commit 4327a61) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 86519e4 commit 9effbed

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
@@ -426,11 +426,12 @@ struct ast_private *ast_device_create(const struct drm_driver *drv,
426426
return ERR_PTR(-EIO);
427427

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

0 commit comments

Comments
 (0)