Skip to content

Commit 223662b

Browse files
jammyaspeednvidia-bfigg
authored andcommitted
drm/ast: Fix ARM compatibility
BugLink: https://bugs.launchpad.net/bugs/2021535 ARM architecture only has 'memory', so all devices are accessed by MMIO if possible. Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20230421003354.27767-1-jammy_huang@aspeedtech.com Acked-by: Brad Figg <bfigg@nvidia.com> Acked-by: Jamie Nguyen <jamien@nvidia.com> (cherry picked from commit 4327a61) Signed-off-by: Ian May <ian.may@canonical.com>
1 parent e58ffee commit 223662b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

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)