From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subodh Nijsure Subject: Where in dts file one should define IORESOURCES_(IO|MEM)? Date: Mon, 13 Apr 2009 10:52:52 -0700 Message-ID: <003e01c9bc60$ab11c2c0$9e70150a@cisco.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0282115898==" Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org To: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org List-Id: devicetree@vger.kernel.org --===============0282115898== Content-Type: multipart/alternative; boundary="----=_NextPart_000_003F_01C9BC25.FEB2EAC0" ------=_NextPart_000_003F_01C9BC25.FEB2EAC0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline 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) ------=_NextPart_000_003F_01C9BC25.FEB2EAC0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
I have r= ead the=20 Documentation/powerpc/booting-without-of.txt and I am still not clear on h= ow=20 manifest constants in platform_get_resource() get translated to items in d= ts=20 file.
 
Example:
 
in=20 drivers/ide/legacy/ide_platform.c there is code that looks like=20 this.
 
 
        res= _base =3D=20 platform_get_resource(pdev, IORESOURCE_IO,=20 0);
        res_alt =3D=20 platform_get_resource(pdev, IORESOURCE_IO, 1);
 
        if=20 (!res_base || !res_alt)=20 {
           &n= bsp;   =20 res_base =3D platform_get_resource(pdev, IORESOURCE_MEM,=20 0);
           =     =20 res_alt =3D platform_get_resource(pdev, IORESOURCE_MEM,=20 1);
If I wa= nt to specify=20 IORESOURCE_MEM (0) and IORESOURCE_MEM ( 1) addresses in my board specific= what=20 statements do I need to include in my dts file?
 
I have t= ried=20 including them in memory {} section of dts and that doesn't=20 work.
 
Would a= ppreciate=20 help/pointer.
 
 
/Subodh= =20 Nijsure
(Standa= rd=20 Disclaimers Apply) 
------=_NextPart_000_003F_01C9BC25.FEB2EAC0-- --===============0282115898== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ devicetree-discuss mailing list devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org https://ozlabs.org/mailman/listinfo/devicetree-discuss --===============0282115898==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: Where in dts file one should define IORESOURCES_(IO|MEM)? Date: Mon, 13 Apr 2009 13:59:25 -0500 Message-ID: <49E38B8D.8040105@freescale.com> References: <003e01c9bc60$ab11c2c0$9e70150a@cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <003e01c9bc60$ab11c2c0$9e70150a-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-mnsaURCQ41sdnm+yROfE0A@public.gmane.org To: Subodh Nijsure Cc: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org List-Id: devicetree@vger.kernel.org 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