Skip to content

Commit

Permalink
drm/ast: Fix ARM compatibility
Browse files Browse the repository at this point in the history
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 4327a6137ed43a091d900b1ac833345d60f32228)
Signed-off-by: Ian May <ian.may@canonical.com>
  • Loading branch information
jammyaspeed authored and ianmay81 committed Jun 1, 2023
1 parent 5d01bc8 commit 055c9ec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/gpu/drm/ast/ast_main.c
Expand Up @@ -427,11 +427,12 @@ struct ast_private *ast_device_create(const struct drm_driver *drv,
return ERR_PTR(-EIO);

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

0 comments on commit 055c9ec

Please sign in to comment.