* [PATCH] drm/ast: Fix ARM compatibility
@ 2023-03-02 2:19 Jammy Huang
2023-04-07 2:09 ` Jammy Huang
0 siblings, 1 reply; 5+ messages in thread
From: Jammy Huang @ 2023-03-02 2:19 UTC (permalink / raw)
To: airlied, tzimmermann, airlied, daniel; +Cc: dri-devel, linux-kernel
ARM architecture only has 'memory', so all devices are accessed by MMIO.
Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
---
drivers/gpu/drm/ast/ast_main.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
index 794ffd4a29c5..f86d01e9f024 100644
--- a/drivers/gpu/drm/ast/ast_main.c
+++ b/drivers/gpu/drm/ast/ast_main.c
@@ -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
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/ast: Fix ARM compatibility
2023-03-02 2:19 [PATCH] drm/ast: Fix ARM compatibility Jammy Huang
@ 2023-04-07 2:09 ` Jammy Huang
2023-04-17 11:51 ` Thomas Zimmermann
0 siblings, 1 reply; 5+ messages in thread
From: Jammy Huang @ 2023-04-07 2:09 UTC (permalink / raw)
To: airlied, tzimmermann, airlied, daniel; +Cc: dri-devel, linux-kernel, giantl
Hi Thomas,
Could you help review this patch??
We met some problem on nvidia's ARM platfrom and need this patch to fix it.
On 2023/3/2 上午 10:19, Jammy Huang wrote:
> ARM architecture only has 'memory', so all devices are accessed by MMIO.
>
> Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
> ---
> drivers/gpu/drm/ast/ast_main.c | 17 +----------------
> 1 file changed, 1 insertion(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
> index 794ffd4a29c5..f86d01e9f024 100644
> --- a/drivers/gpu/drm/ast/ast_main.c
> +++ b/drivers/gpu/drm/ast/ast_main.c
> @@ -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
--
Best Regards
Jammy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/ast: Fix ARM compatibility
2023-04-07 2:09 ` Jammy Huang
@ 2023-04-17 11:51 ` Thomas Zimmermann
[not found] ` <c5fb047b-ed55-be1f-56ae-3b21b1d1dd29@aspeedtech.com>
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Zimmermann @ 2023-04-17 11:51 UTC (permalink / raw)
To: Jammy Huang, airlied, airlied, daniel; +Cc: giantl, linux-kernel, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 2015 bytes --]
Hi
Am 07.04.23 um 04:09 schrieb Jammy Huang:
> Hi Thomas,
>
> Could you help review this patch??
>
> We met some problem on nvidia's ARM platfrom and need this patch to fix it.
>
> On 2023/3/2 上午 10:19, Jammy Huang wrote:
>> ARM architecture only has 'memory', so all devices are accessed by MMIO.
>>
>> Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
>> ---
>> drivers/gpu/drm/ast/ast_main.c | 17 +----------------
>> 1 file changed, 1 insertion(+), 16 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ast/ast_main.c
>> b/drivers/gpu/drm/ast/ast_main.c
>> index 794ffd4a29c5..f86d01e9f024 100644
>> --- a/drivers/gpu/drm/ast/ast_main.c
>> +++ b/drivers/gpu/drm/ast/ast_main.c
>> @@ -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);
What happens on systems that use this branch?
Best regards
Thomas
>> - if (!ast->ioregs)
>> - return ERR_PTR(-EIO);
>> - }
>> + ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
>> ast_detect_chip(dev, &need_post);
>>
>> base-commit: 254986e324add8a30d0019c6da59f81adc8b565f
>
--
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/ast: Fix ARM compatibility
[not found] ` <c5fb047b-ed55-be1f-56ae-3b21b1d1dd29@aspeedtech.com>
@ 2023-04-18 7:24 ` Thomas Zimmermann
2023-04-18 7:55 ` Jammy Huang
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Zimmermann @ 2023-04-18 7:24 UTC (permalink / raw)
To: Jammy Huang, airlied, airlied, daniel; +Cc: giantl, linux-kernel, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 2962 bytes --]
Hi
Am 18.04.23 um 03:23 schrieb Jammy Huang:
> 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.
>
> https://community.arm.com/support-forums/f/architectures-and-processors-forum/52046/how-to-read-write-an-i-o-port-in-aarch64
>
> 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
>
> On 2023/4/17 下午 07:51, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 07.04.23 um 04:09 schrieb Jammy Huang:
>>> Hi Thomas,
>>>
>>> Could you help review this patch??
>>>
>>> We met some problem on nvidia's ARM platfrom and need this patch to
>>> fix it.
>>>
>>> On 2023/3/2 上午 10:19, Jammy Huang wrote:
>>>> ARM architecture only has 'memory', so all devices are accessed by
>>>> MMIO.
>>>>
>>>> Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
>>>> ---
>>>> drivers/gpu/drm/ast/ast_main.c | 17 +----------------
>>>> 1 file changed, 1 insertion(+), 16 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/ast/ast_main.c
>>>> b/drivers/gpu/drm/ast/ast_main.c
>>>> index 794ffd4a29c5..f86d01e9f024 100644
>>>> --- a/drivers/gpu/drm/ast/ast_main.c
>>>> +++ b/drivers/gpu/drm/ast/ast_main.c
>>>> @@ -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);
>>
>> What happens on systems that use this branch?
>>
>> Best regards
>> Thomas
>>
>>>> - if (!ast->ioregs)
>>>> - return ERR_PTR(-EIO);
>>>> - }
>>>> + ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
>>>> ast_detect_chip(dev, &need_post);
>>>>
>>>> base-commit: 254986e324add8a30d0019c6da59f81adc8b565f
>>>
>>
> --
> Best Regards
> Jammy
>
--
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/ast: Fix ARM compatibility
2023-04-18 7:24 ` Thomas Zimmermann
@ 2023-04-18 7:55 ` Jammy Huang
0 siblings, 0 replies; 5+ messages in thread
From: Jammy Huang @ 2023-04-18 7:55 UTC (permalink / raw)
To: Thomas Zimmermann, airlied, airlied, daniel
Cc: giantl, linux-kernel, dri-devel
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.
On 2023/4/18 下午 03:24, Thomas Zimmermann wrote:
> Hi
>
> Am 18.04.23 um 03:23 schrieb Jammy Huang:
>> 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.
>>
>> https://community.arm.com/support-forums/f/architectures-and-processors-forum/52046/how-to-read-write-an-i-o-port-in-aarch64
>>
>>
>> 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
>
>>
>> On 2023/4/17 下午 07:51, Thomas Zimmermann wrote:
>>> Hi
>>>
>>> Am 07.04.23 um 04:09 schrieb Jammy Huang:
>>>> Hi Thomas,
>>>>
>>>> Could you help review this patch??
>>>>
>>>> We met some problem on nvidia's ARM platfrom and need this patch to
>>>> fix it.
>>>>
>>>> On 2023/3/2 上午 10:19, Jammy Huang wrote:
>>>>> ARM architecture only has 'memory', so all devices are accessed by
>>>>> MMIO.
>>>>>
>>>>> Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
>>>>> ---
>>>>> drivers/gpu/drm/ast/ast_main.c | 17 +----------------
>>>>> 1 file changed, 1 insertion(+), 16 deletions(-)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/ast/ast_main.c
>>>>> b/drivers/gpu/drm/ast/ast_main.c
>>>>> index 794ffd4a29c5..f86d01e9f024 100644
>>>>> --- a/drivers/gpu/drm/ast/ast_main.c
>>>>> +++ b/drivers/gpu/drm/ast/ast_main.c
>>>>> @@ -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);
>>>
>>> What happens on systems that use this branch?
>>>
>>> Best regards
>>> Thomas
>>>
>>>>> - if (!ast->ioregs)
>>>>> - return ERR_PTR(-EIO);
>>>>> - }
>>>>> + ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
>>>>> ast_detect_chip(dev, &need_post);
>>>>>
>>>>> base-commit: 254986e324add8a30d0019c6da59f81adc8b565f
>>>>
>>>
>> --
>> Best Regards
>> Jammy
>>
>
--
Best Regards
Jammy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-04-18 7:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-02 2:19 [PATCH] drm/ast: Fix ARM compatibility Jammy Huang
2023-04-07 2:09 ` Jammy Huang
2023-04-17 11:51 ` Thomas Zimmermann
[not found] ` <c5fb047b-ed55-be1f-56ae-3b21b1d1dd29@aspeedtech.com>
2023-04-18 7:24 ` Thomas Zimmermann
2023-04-18 7:55 ` Jammy Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®