summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJammy Huang <jammy_huang@aspeedtech.com>2023-04-21 03:33:54 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-09 11:34:07 +0300
commite2d161c539a4e1d48e4575d9fbcbcd09762899d6 (patch)
treed094b36b1de271e120b7cf3ea09221243a8d6a12
parentcad1abbe488dfd149499e492344c03b87bb0b08c (diff)
downloadlinux-e2d161c539a4e1d48e4575d9fbcbcd09762899d6.tar.xz
drm/ast: Fix ARM compatibility
[ Upstream commit 4327a6137ed43a091d900b1ac833345d60f32228 ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/ast/ast_main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index 067453266897..5df527051177 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -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;
}