All of lore.kernel.org
 help / color / mirror / Atom feed
* Where in dts file one should define IORESOURCES_(IO|MEM)?
@ 2009-04-13 17:52 Subodh Nijsure
       [not found] ` <003e01c9bc60$ab11c2c0$9e70150a-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Subodh Nijsure @ 2009-04-13 17:52 UTC (permalink / raw)
  To: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A


[-- Attachment #1.1: Type: text/plain, Size: 898 bytes --]

I have read the Documentation/powerpc/booting-without-of.txt and I am still
not clear on how manifest constants in platform_get_resource() get
translated to items in dts file.
 
Example:
 
in drivers/ide/legacy/ide_platform.c there is code that looks like this.
 
 
        res_base = platform_get_resource(pdev, IORESOURCE_IO, 0);
        res_alt = platform_get_resource(pdev, IORESOURCE_IO, 1);
 
        if (!res_base || !res_alt) {
                res_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
                res_alt = platform_get_resource(pdev, IORESOURCE_MEM, 1);

If I want to specify IORESOURCE_MEM (0) and IORESOURCE_MEM ( 1) addresses in
my board specific what statements do I need to include in my dts file?
 
I have tried including them in memory {} section of dts and that doesn't
work.
 
Would appreciate help/pointer.
 
 
/Subodh Nijsure
(Standard Disclaimers Apply) 

[-- Attachment #1.2: Type: text/html, Size: 3056 bytes --]

[-- Attachment #2: Type: text/plain, Size: 194 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org
https://ozlabs.org/mailman/listinfo/devicetree-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Where in dts file one should define IORESOURCES_(IO|MEM)?
       [not found] ` <003e01c9bc60$ab11c2c0$9e70150a-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
@ 2009-04-13 18:59   ` Scott Wood
  0 siblings, 0 replies; 2+ messages in thread
From: Scott Wood @ 2009-04-13 18:59 UTC (permalink / raw)
  To: Subodh Nijsure; +Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A

Subodh Nijsure wrote:
> in drivers/ide/legacy/ide_platform.c there is code that looks like this.
>  
>  
>         res_base = platform_get_resource(pdev, IORESOURCE_IO, 0);
>         res_alt = platform_get_resource(pdev, IORESOURCE_IO, 1);
>  
>         if (!res_base || !res_alt) {
>                 res_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>                 res_alt = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> If I want to specify IORESOURCE_MEM (0) and IORESOURCE_MEM ( 1) 
> addresses in my board specific what statements do I need to include in 
> my dts file?

They would be the first and second "reg" resources of the relevant 
device node.

For IDE, you probably want drivers/ata/pata_of_platform.c rather than 
the above driver.

> I have tried including them in memory {} section of dts and that doesn't 
> work.

No, that's for *memory*, not device registers.

-Scott

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-13 18:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-13 17:52 Where in dts file one should define IORESOURCES_(IO|MEM)? Subodh Nijsure
     [not found] ` <003e01c9bc60$ab11c2c0$9e70150a-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-04-13 18:59   ` Scott Wood

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.