All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mitch Bradley <wmb-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
To: Kumar Gala <galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
Cc: Yoder Stuart-B08248
	<b08248-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	devicetree-discuss
	<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>
Subject: Re: standard property to convey device dma address width?
Date: Tue, 17 Aug 2010 11:22:26 -1000	[thread overview]
Message-ID: <4C6AFD92.1000700@firmworks.com> (raw)
In-Reply-To: <366D8D84-D210-4BC1-8FC1-4E0A9E06C433-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>

Kumar Gala wrote:
> On Aug 16, 2010, at 3:17 PM, Mitch Bradley wrote:
>
>   
>> Kumar Gala wrote:
>>     
>>> Do we or should we have a standard property to convey that address width a device is capable of?
>>>  
>>>       
>> ...
>> If I had to describe a partial address, I'd consider a property name like "dma-address-mask", whose value is a bitmap of implemented bits, corresponding to the bits in a unit address for the parent bus.  Low-order bits might be zero if the DMA addressing hardware had alignment restrictions.
>>     
>
> As I said to Stuart.  On the Freescale SOCs we have different device blocks w/varying dma address capabilities.  Some are limited to 32-bits some are capable of 36-bits on the same SOC.
>
> - k
>
>   

The closest existing property that I know of is "dma-ranges" - see 
http://playground.sun.com/1275/proposals/Closed/Accepted/410-it.txt

That's not directly applicable, as "dma-ranges" in its current form 
applies to bus bridges, describing the translation between DMA addresses 
on a child bus to DMA addresses on a parent bus.

The case in question has some general similarities, in that the limited 
devices have an implicit 32-bit "child bus" that is translated to the 
36-bit parent bus, presumably by concatenating zeros in bits 35:32.  Is 
that correct, i.e. are the high bits implicitly 0?

The dma-ranges representation doesn't assume the "zero-extend" property, 
but rather explicitly lists child-base-address,parent-base-address,size 
triples.  I wonder if that generality is justifiable in this case?

I see several obvious representations with varying degrees of generality:

a) boolean property saying "this is one of those 32-bit only devices, 
with all the implications"
b) width in bits - assumes an implicit translation rule (e.g. zero-extend)
c) bitmask - assumes implicit translation rule, capable of representing 
alignment restrictions with low-order zeros
d) something like dma-ranges - explicitly represents translation rule, 
no representation for alignment restriction

My 2 cents: Generality is often only justified when you have a good 
collection of problem instances, so you can amortize the generality over 
several specific known examples.  Otherwise you often end up 
implementing something elaborate that never gets used.

  parent reply	other threads:[~2010-08-17 21:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 16:01 standard property to convey device dma address width? Kumar Gala
     [not found] ` <5A878376-AFCC-4CB0-A0E9-F2F497066FD5-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2010-08-16 20:17   ` Mitch Bradley
     [not found]     ` <4C699CC6.1060507-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2010-08-17 20:55       ` Kumar Gala
     [not found]         ` <366D8D84-D210-4BC1-8FC1-4E0A9E06C433-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
2010-08-17 21:03           ` Scott Wood
     [not found]             ` <20100817160317.458ea513-1MYqz8GpK7RekFaExTCHk1jVikpgYyvb5NbjCUgZEJk@public.gmane.org>
2010-08-18  3:57               ` Kumar Gala
2010-08-17 21:22           ` Mitch Bradley [this message]
2010-08-17 20:50   ` Yoder Stuart-B08248
     [not found]     ` <9696D7A991D0824DBA8DFAC74A9C5FA3065BD776-ofAVchDyotYzzZk0BCvKg5jmvxFtTJ+o0e7PPNI6Mm0@public.gmane.org>
2010-08-17 20:54       ` Kumar Gala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C6AFD92.1000700@firmworks.com \
    --to=wmb-d5eqfidgl7eakbo8gow8eq@public.gmane.org \
    --cc=b08248-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=galak-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.