drm/ast: Fix ARM compatibility
Subsystems (3)
PATCH 1/1 drm/ast: Fix ARM compatibility
ARM architecture only has 'memory', so all devices are accessed by MMIO.
--- drivers/gpu/drm/ast/ast_main.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-)
drivers/gpu/drm/ast/ast_main.c +1 -16
@@ -424,22 +424,7 @@ struct ast_device *ast_device_create(const struct drm_driver *drv,if (!ast->regs)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). -*/ -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 ; - } - -/* "map" IO regs if the above hasn't done so already */ -if (!ast->ioregs) { - ast->ioregs =pcim_iomap (pdev,2 ,0 ); -if (!ast->ioregs) -return ERR_PTR (-EIO ); - } + ast->ioregs = ast->regs +AST_IO_MM_OFFSET ;ast_detect_chip (dev, &need_post);
base-commit: 254986e324add8a30d0019c6da59f81adc8b565f
Signature · 1 line
2.25.1
Hi Thomas,
Could you help review this patch??
We met some problem on nvidia's ARM platfrom and need this patch to fix it.
Quoted 37 lines · Jammy Huang
ARM architecture only has 'memory', so all devices are accessed by MMIO.
Signed-off-by Jammy Huang <[email protected]>--- drivers/gpu/drm/ast/ast_main.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-)drivers/gpu/drm/ast/ast_main.c +1
-16@@ -424,22 +424,7 @@ struct ast_device *ast_device_create(const struct drm_driver *drv,if (!ast->regs)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). -*/ -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 ; - } - -/* "map" IO regs if the above hasn't done so already */ -if (!ast->ioregs) { - ast->ioregs =pcim_iomap (pdev,2 ,0 ); -if (!ast->ioregs) -return ERR_PTR (-EIO ); - } + ast->ioregs = ast->regs +AST_IO_MM_OFFSET ;ast_detect_chip (dev, &need_post);base-commit:
254986e324add8a30d0019c6da59f81adc8b565f
Signature · 2 lines
Best Regards Jammy
Thomas Zimmermann
maintainerHi
Am 07.04.23 um 04:09 schrieb Jammy Huang:
Quoted 27 lines
Hi Thomas,
Could you help review this patch??
We met some problem on nvidia's ARM platfrom and need this patch to fix it.
Quoted 20 lines · Jammy Huang
ARM architecture only has 'memory', so all devices are accessed by MMIO.
Signed-off-by Jammy Huang <[email protected]>---
drivers/gpu/drm/ast/ast_main.c| 17 +----------------1 file changed, 1 insertion(+), 16 deletions(-)drivers/gpu/drm/ast/ast_main.c +0
-5@@ -424,22 +424,7 @@ struct ast_device *ast_device_create(const struct drm_driver *drv, if (!ast->regs) 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). -*/
Quoted 8 lines
drivers/gpu/drm/ast/ast_main.c struct ast_device *ast_device_create(const struct drm_driver *drv, · line 439
Quoted 8 lines
drivers/gpu/drm/ast/ast_main.c +0
-8- 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; - } - - /* "map" IO regs if the above hasn't done so already */ - if (!ast->ioregs) { - ast->ioregs = pcim_iomap(pdev, 2, 0);
What happens on systems that use this branch?
Best regards
Thomas
Quoted 8 lines
Quoted 7 lines
drivers/gpu/drm/ast/ast_main.c +1
-3- if (!ast->ioregs) - return ERR_PTR(-EIO); - } + ast->ioregs = ast->regs + AST_IO_MM_OFFSET; ast_detect_chip(dev, &need_post);base-commit:
254986e324add8a30d0019c6da59f81adc8b565f
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
Hi Thomas,
The Intel(x86) CPUs have a separate address space for "IO", but the ARM architecture only has "memory", so all IO devices are accessed as if they were memory. Which means ARM does not support isolated IO. Here is a related discussion on ARM's forum.
Thus, we want to adapt MMIO only after this patch.
Quoted 53 lines · Thomas Zimmermann
Hi
Am 07.04.23 um 04:09 schrieb Jammy Huang:
Quoted 27 lines
Hi Thomas,
Could you help review this patch??
We met some problem on nvidia's ARM platfrom and need this patch to fix it.
Quoted 20 lines · Jammy Huang
ARM architecture only has 'memory', so all devices are accessed by MMIO.
Signed-off-by Jammy Huang <[email protected]>---
drivers/gpu/drm/ast/ast_main.c| 17 +----------------1 file changed, 1 insertion(+), 16 deletions(-)drivers/gpu/drm/ast/ast_main.c +0
-5@@ -424,22 +424,7 @@ struct ast_device *ast_device_create(const struct drm_driver *drv, if (!ast->regs) 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). -*/ Quoted 8 lines
drivers/gpu/drm/ast/ast_main.c struct ast_device *ast_device_create(const struct drm_driver *drv, · line 439
Quoted 8 lines
drivers/gpu/drm/ast/ast_main.c +0
-8- 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; - } - - /* "map" IO regs if the above hasn't done so already */ - if (!ast->ioregs) { - ast->ioregs = pcim_iomap(pdev, 2, 0);What happens on systems that use this branch?
Best regards
ThomasQuoted 8 lines
Quoted 7 lines
drivers/gpu/drm/ast/ast_main.c +1
-3- if (!ast->ioregs) - return ERR_PTR(-EIO); - } + ast->ioregs = ast->regs + AST_IO_MM_OFFSET; ast_detect_chip(dev, &need_post);base-commit:
254986e324add8a30d0019c6da59f81adc8b565f
Signature · 2 lines
Best Regards Jammy
Thomas Zimmermann
maintainerHi
Am 18.04.23 um 03:23 schrieb Jammy Huang:
Quoted 7 lines
Hi Thomas,
The Intel(x86) CPUs have a separate address space for "IO", but the ARM architecture only has "memory", so all IO devices are accessed as if they were memory. Which means ARM does not support isolated IO. Here is a related discussion on ARM's forum.
Thus, we want to adapt MMIO only after this patch.
What I mean is that there's a comment that says "assume the chip has MMIO enabled by default (rev 0x20 and higher)". We also support revs before 0x20. What happens to them?
Best regards
Thomas
Quoted 59 lines · Thomas Zimmermann
Quoted 53 lines
Hi
Am 07.04.23 um 04:09 schrieb Jammy Huang:
Quoted 27 lines
Hi Thomas,
Could you help review this patch??
We met some problem on nvidia's ARM platfrom and need this patch to fix it.
Quoted 20 lines · Jammy Huang
ARM architecture only has 'memory', so all devices are accessed by MMIO.
Signed-off-by Jammy Huang <[email protected]>---
drivers/gpu/drm/ast/ast_main.c| 17 +----------------1 file changed, 1 insertion(+), 16 deletions(-)drivers/gpu/drm/ast/ast_main.c +0
-5@@ -424,22 +424,7 @@ struct ast_device *ast_device_create(const struct drm_driver *drv, if (!ast->regs) 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). -*/ Quoted 8 lines
drivers/gpu/drm/ast/ast_main.c struct ast_device *ast_device_create(const struct drm_driver *drv, · line 439
Quoted 8 lines
drivers/gpu/drm/ast/ast_main.c +0
-8- 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; - } - - /* "map" IO regs if the above hasn't done so already */ - if (!ast->ioregs) { - ast->ioregs = pcim_iomap(pdev, 2, 0);What happens on systems that use this branch?
Best regards
ThomasQuoted 8 lines
Quoted 7 lines
drivers/gpu/drm/ast/ast_main.c +1
-3- if (!ast->ioregs) - return ERR_PTR(-EIO); - } + ast->ioregs = ast->regs + AST_IO_MM_OFFSET; ast_detect_chip(dev, &need_post);base-commit:
254986e324add8a30d0019c6da59f81adc8b565fSignature · 2 lines
Best Regards Jammy
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
Hi Thomas,
Thanks for you reminder. The comment you mentioned is added in 2014 for AST2400 rev 0x20, which means MMIO is not enable by default before that revision. I will send another patch to handle it.
Quoted 77 lines · Thomas Zimmermann
Hi
Am 18.04.23 um 03:23 schrieb Jammy Huang:
Quoted 8 lines
Hi Thomas,
The Intel(x86) CPUs have a separate address space for "IO", but the ARM architecture only has "memory", so all IO devices are accessed as if they were memory. Which means ARM does not support isolated IO. Here is a related discussion on ARM's forum.
Thus, we want to adapt MMIO only after this patch.
What I mean is that there's a comment that says "assume the chip has MMIO enabled by default (rev
0x20and higher)". We also support revs before0x20. What happens to them?Best regards
ThomasQuoted 59 lines · Thomas Zimmermann
Quoted 53 lines
Hi
Am 07.04.23 um 04:09 schrieb Jammy Huang:
Quoted 27 lines
Hi Thomas,
Could you help review this patch??
We met some problem on nvidia's ARM platfrom and need this patch to fix it.
Quoted 20 lines · Jammy Huang
ARM architecture only has 'memory', so all devices are accessed by MMIO.
Signed-off-by Jammy Huang <[email protected]>---
drivers/gpu/drm/ast/ast_main.c| 17 +----------------1 file changed, 1 insertion(+), 16 deletions(-)drivers/gpu/drm/ast/ast_main.c +0
-5@@ -424,22 +424,7 @@ struct ast_device *ast_device_create(const struct drm_driver *drv, if (!ast->regs) 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). -*/ Quoted 8 lines
drivers/gpu/drm/ast/ast_main.c struct ast_device *ast_device_create(const struct drm_driver *drv, · line 439
Quoted 8 lines
drivers/gpu/drm/ast/ast_main.c +0
-8- 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; - } - - /* "map" IO regs if the above hasn't done so already */ - if (!ast->ioregs) { - ast->ioregs = pcim_iomap(pdev, 2, 0);What happens on systems that use this branch?
Best regards
ThomasQuoted 8 lines
Quoted 7 lines
drivers/gpu/drm/ast/ast_main.c +1
-3- if (!ast->ioregs) - return ERR_PTR(-EIO); - } + ast->ioregs = ast->regs + AST_IO_MM_OFFSET; ast_detect_chip(dev, &need_post);base-commit:
254986e324add8a30d0019c6da59f81adc8b565fSignature · 2 lines
Best Regards Jammy
Signature · 2 lines
Best Regards Jammy