Skip to contentSkip to conversation

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

DISCUSSION Subodh Nijsure 2 participants 2 messages Apr 13, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

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)

_______________________________________________
devicetree-discuss mailing list [email protected]
https://ozlabs.org/mailman/listinfo/devicetree-discuss

#2 lore raw
In reply to a message not in the archive
Quoted 10 lines · Subodh Nijsure

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.

Quoted 1 line

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

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

-Scott