* [PATCH 7/7] OF: set dma_mask for ARM
@ 2011-04-20 8:11 Kristoffer Glembo
[not found] ` <4DAE9540.8040006-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Kristoffer Glembo @ 2011-04-20 8:11 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
robherring2-Re5JQEeQqe8AvxtiuMwx3w
Hi,
Have you gotten any feedback on this? I am facing the same decision on SPARC32. I need to add dma_mask to get USB working on non-PCI buses and I'm currently thinking about doing it either the PowerPC way or going with the dma_mask = &coherent_dma_mask route. It would be nice if we could get some community agreement on which is the proper way of doing this.
Best regards,
Kristoffer Glembo
On 11/16/2010 11:24 PM, Grant Likely wrote:
>> On Tue, Nov 16, 2010 at 02:33:55PM -0600, Rob Herring wrote:
>>> From: Rob Herring<rob.herring at calxeda.com>
>>>
>>> Various drivers require dma_mask to be valid, so it needs to be setup
>>> when doing OF probing on ARM.
>>>
>>> Signed-off-by: Rob Herring<rob.herring at calxeda.com>
>>
>> I'll let patches 6& 7 lay fallow for the moment. I'm not hugely fond
>> of the powerpc approach (which microblaze copies), but I haven't had a
>> chance to look for a better solution.
>>
>
>Looking at this some more, there's a couple of options I see.
>
>Other buses (ISA, PCI, EISA) have a dma_mask in their struct. So perhaps
>platform_device should just have a dma_mask field.
>
>There are several examples of setting dma_mask = &coherent_dma_mask. I'm
>not sure if this is considered correct. At least on ARM, I don't think
>these would need to be different.
>
>Another option would be using bus notifiers to set the dma_mask like
>platform_data. But that doesn't seem like a good long term solution.
>
>Rob
^ permalink raw reply [flat|nested] 5+ messages in thread[parent not found: <4DAE9540.8040006-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>]
* Re: [PATCH 7/7] OF: set dma_mask for ARM [not found] ` <4DAE9540.8040006-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org> @ 2011-04-20 12:06 ` Rob Herring 0 siblings, 0 replies; 5+ messages in thread From: Rob Herring @ 2011-04-20 12:06 UTC (permalink / raw) To: Kristoffer Glembo; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ On 04/20/2011 03:11 AM, Kristoffer Glembo wrote: > Hi, > > Have you gotten any feedback on this? I am facing the same decision > on SPARC32. I need to add dma_mask to get USB working on non-PCI > buses and I'm currently thinking about doing it either the PowerPC > way or going with the dma_mask =&coherent_dma_mask route. It would be > nice if we could get some community agreement on which is the proper > way of doing this. > No, only Grant's original comment. I did switch to using a bus notifier callback to set the dma_mask pointer so I don't need to modify the DT or arch code. Rob > Best regards, Kristoffer Glembo > > > On 11/16/2010 11:24 PM, Grant Likely wrote: >>> On Tue, Nov 16, 2010 at 02:33:55PM -0600, Rob Herring wrote: >>>> From: Rob Herring<rob.herring at calxeda.com> >>>> >>>> Various drivers require dma_mask to be valid, so it needs to be >>>> setup when doing OF probing on ARM. >>>> >>>> Signed-off-by: Rob Herring<rob.herring at calxeda.com> >>> >>> I'll let patches 6& 7 lay fallow for the moment. I'm not >>> hugely fond of the powerpc approach (which microblaze copies), >>> but I haven't had a chance to look for a better solution. >>> >> >> Looking at this some more, there's a couple of options I see. >> >> Other buses (ISA, PCI, EISA) have a dma_mask in their struct. So >> perhaps platform_device should just have a dma_mask field. >> >> There are several examples of setting dma_mask =&coherent_dma_mask. >> I'm not sure if this is considered correct. At least on ARM, I >> don't think these would need to be different. >> >> Another option would be using bus notifiers to set the dma_mask >> like platform_data. But that doesn't seem like a good long term >> solution. >> >> Rob ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/7] Various OF fixes for little-endian and ARM
@ 2010-11-16 20:33 Rob Herring
[not found] ` <1289939635-30742-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2010-11-16 20:33 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ; +Cc: Rob Herring
From: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>
This is a mixture of driver fixes for OF on little-endian and ARM platforms.
The last 2 patches need more thought. Currently, it's just copied from PPC. There
are some ARM platforms which set 64-bit dma_masks (iop13xx and orion5x)
which is not handled. I would think 64-bit PPC would have a similar issue.
Rob Herring (7):
OF: make drivers depend on CONFIG_OF instead of CONFIG_PPC_OF
of: Fixes for OF probing on little endian systems
ipmi: explicitly include of_address.h and of_irq.h
mmc: sdhci-of: fix build on non-powerpc platforms
mmc: sdhci-of: support generic OF controllers
ARM: add dma_mask to pdev_archdata
OF: set dma_mask for ARM
arch/arm/include/asm/device.h | 1 +
drivers/char/ipmi/ipmi_si_intf.c | 24 +++++++++++++-----------
drivers/mmc/host/Kconfig | 2 +-
drivers/mmc/host/sdhci-of-core.c | 18 ++++++++++++++++--
drivers/mtd/Kconfig | 2 +-
drivers/mtd/maps/Kconfig | 2 +-
drivers/net/can/sja1000/Kconfig | 4 ++--
drivers/of/platform.c | 4 ++--
drivers/serial/Kconfig | 2 +-
drivers/usb/host/isp1760-if.c | 8 ++++----
10 files changed, 42 insertions(+), 25 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread[parent not found: <1289939635-30742-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* [PATCH 7/7] OF: set dma_mask for ARM [not found] ` <1289939635-30742-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2010-11-16 20:33 ` Rob Herring [not found] ` <1289939635-30742-8-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Rob Herring @ 2010-11-16 20:33 UTC (permalink / raw) To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ; +Cc: Rob Herring From: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org> Various drivers require dma_mask to be valid, so it needs to be setup when doing OF probing on ARM. Signed-off-by: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org> --- drivers/of/platform.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 5b4a07f..fe2669a 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -614,7 +614,7 @@ struct platform_device *of_device_alloc(struct device_node *np, } dev->dev.of_node = of_node_get(np); -#if defined(CONFIG_PPC) || defined(CONFIG_MICROBLAZE) +#if defined(CONFIG_PPC) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_ARM) dev->dev.dma_mask = &dev->archdata.dma_mask; #endif dev->dev.parent = parent; @@ -644,7 +644,7 @@ struct platform_device *of_platform_device_create(struct device_node *np, if (!dev) return NULL; -#if defined(CONFIG_PPC) || defined(CONFIG_MICROBLAZE) +#if defined(CONFIG_PPC) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_ARM) dev->archdata.dma_mask = 0xffffffffUL; #endif dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); -- 1.7.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
[parent not found: <1289939635-30742-8-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH 7/7] OF: set dma_mask for ARM [not found] ` <1289939635-30742-8-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2010-11-17 5:24 ` Grant Likely [not found] ` <20101117052448.GC12813-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Grant Likely @ 2010-11-17 5:24 UTC (permalink / raw) To: Rob Herring; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Rob Herring On Tue, Nov 16, 2010 at 02:33:55PM -0600, Rob Herring wrote: > From: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org> > > Various drivers require dma_mask to be valid, so it needs to be setup > when doing OF probing on ARM. > > Signed-off-by: Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org> I'll let patches 6 & 7 lay fallow for the moment. I'm not hugely fond of the powerpc approach (which microblaze copies), but I haven't had a chance to look for a better solution. g. > --- > drivers/of/platform.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/of/platform.c b/drivers/of/platform.c > index 5b4a07f..fe2669a 100644 > --- a/drivers/of/platform.c > +++ b/drivers/of/platform.c > @@ -614,7 +614,7 @@ struct platform_device *of_device_alloc(struct device_node *np, > } > > dev->dev.of_node = of_node_get(np); > -#if defined(CONFIG_PPC) || defined(CONFIG_MICROBLAZE) > +#if defined(CONFIG_PPC) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_ARM) > dev->dev.dma_mask = &dev->archdata.dma_mask; > #endif > dev->dev.parent = parent; > @@ -644,7 +644,7 @@ struct platform_device *of_platform_device_create(struct device_node *np, > if (!dev) > return NULL; > > -#if defined(CONFIG_PPC) || defined(CONFIG_MICROBLAZE) > +#if defined(CONFIG_PPC) || defined(CONFIG_MICROBLAZE) || defined(CONFIG_ARM) > dev->archdata.dma_mask = 0xffffffffUL; > #endif > dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); > -- > 1.7.1 > > _______________________________________________ > devicetree-discuss mailing list > devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org > https://lists.ozlabs.org/listinfo/devicetree-discuss ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20101117052448.GC12813-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>]
* Re: [PATCH 7/7] OF: set dma_mask for ARM [not found] ` <20101117052448.GC12813-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org> @ 2011-02-08 3:24 ` Rob Herring 0 siblings, 0 replies; 5+ messages in thread From: Rob Herring @ 2011-02-08 3:24 UTC (permalink / raw) To: Grant Likely; +Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ Grant, On 11/16/2010 11:24 PM, Grant Likely wrote: > On Tue, Nov 16, 2010 at 02:33:55PM -0600, Rob Herring wrote: >> From: Rob Herring<rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org> >> >> Various drivers require dma_mask to be valid, so it needs to be setup >> when doing OF probing on ARM. >> >> Signed-off-by: Rob Herring<rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org> > > I'll let patches 6& 7 lay fallow for the moment. I'm not hugely fond > of the powerpc approach (which microblaze copies), but I haven't had a > chance to look for a better solution. > Looking at this some more, there's a couple of options I see. Other buses (ISA, PCI, EISA) have a dma_mask in their struct. So perhaps platform_device should just have a dma_mask field. There are several examples of setting dma_mask = &coherent_dma_mask. I'm not sure if this is considered correct. At least on ARM, I don't think these would need to be different. Another option would be using bus notifiers to set the dma_mask like platform_data. But that doesn't seem like a good long term solution. Rob ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-04-20 12:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-20 8:11 [PATCH 7/7] OF: set dma_mask for ARM Kristoffer Glembo
[not found] ` <4DAE9540.8040006-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2011-04-20 12:06 ` Rob Herring
-- strict thread matches above, loose matches on Subject: below --
2010-11-16 20:33 [PATCH 0/7] Various OF fixes for little-endian and ARM Rob Herring
[not found] ` <1289939635-30742-1-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-16 20:33 ` [PATCH 7/7] OF: set dma_mask for ARM Rob Herring
[not found] ` <1289939635-30742-8-git-send-email-robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-17 5:24 ` Grant Likely
[not found] ` <20101117052448.GC12813-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2011-02-08 3:24 ` Rob Herring
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).