Where in dts file one should define IORESOURCES_(IO|MEM)?

Scott Wood scottwood at freescale.com
Tue Apr 14 04:59:25 EST 2009


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



More information about the devicetree-discuss mailing list