linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* NAND Flash, Localbus and UPM
@ 2008-07-14 14:47 Alemao
  2008-07-15  6:38 ` Marco Stornelli
  0 siblings, 1 reply; 2+ messages in thread
From: Alemao @ 2008-07-14 14:47 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

Im trying to use a NAND flash (NAND512W3A, from ST) in MPC8360
localbus, with UPM.
My board is based on the mpc8360erdk. I also have a NOR flash
connected in the localbus.

But I have some doubts in how to put this information at the DTS file.
Im doing this way:

       soc8360@e0000000 {
              .
              .
              .
       };

       localbus@e0005000 {
                compatible = "fsl,mpc8360-localbus";
                #address-cells = <2>;
                #size-cells = <1>;
                reg = <e0005000 d8>;

                ranges = <0 0 ff800000   1000000      // nor flash,  16 MB
                                  1 0 60000000 4000000>;   // nand
flash, 64 MB (512 Mb)

                nor-flash@0,0 {
                        compatible = "amd,s29glxxx", "cfi-flash";
                        reg = <0 0 40000>;
                        bank-width = <2>;
                        device-width = <1>;
                };

                nand-flash@1,0 {
                        compatible = "stmicro,NAND512W3A", "fsl,upm-nand";
                        reg = <1 0 4000000>;   //reg = <1 0 1>;
                        width = <1>;
                        upm = "A";
                        upm-addr-offset = <16>;
                        upm-cmd-offset = <8>;
                        gpios = <4 18>;
                        gpio-parent = <&qe_pio>;
                        wait-pattern;
                        wait-write;
                };
       };



In range information:

ranges = <0 0 ff800000 1000000         // nor flash,  16 MB
                   1 0 60000000 4000000>;   // nand flash, 64 MB (512 Mb)

i dont know what ff800000 and 60000000 means,
i got those values from some posts in the mail-list. I also searched
the datasheet and didnt find anything about those values.

The size values, 1000000 and 4000000, im using the memory density.
Is this correct? Cause i read some posts that the nand size was very
small, like 32K, seems that its something like the block size of
nand.



In reg information:

reg = <0 0 1000000>;    // nor-flash
reg = <1 0 4000000>;    // nand-flash

Dont know if its correct. The third argument i used the size,
but the second i dont know what value use.



In other post by Anton, i saw something like these:

       upm@1,0 {		
		flash {		
	           ...
        	};
       };


Should i use it?

I must confess, im really confuse about all this stuffs.
I read linux/Documentation/powerpc/booting-without-of.txt but didnt
clarify so much.

Cheers,

--
Alemao

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

* Re: NAND Flash, Localbus and UPM
  2008-07-14 14:47 NAND Flash, Localbus and UPM Alemao
@ 2008-07-15  6:38 ` Marco Stornelli
  0 siblings, 0 replies; 2+ messages in thread
From: Marco Stornelli @ 2008-07-15  6:38 UTC (permalink / raw)
  To: Alemao; +Cc: linuxppc-embedded

Alemao ha scritto:
> Hi all,
> 
> Im trying to use a NAND flash (NAND512W3A, from ST) in MPC8360
> localbus, with UPM.
> My board is based on the mpc8360erdk. I also have a NOR flash
> connected in the localbus.
> 
> But I have some doubts in how to put this information at the DTS file.
> Im doing this way:
> 
>        soc8360@e0000000 {
>               .
>               .
>               .
>        };
> 
>        localbus@e0005000 {
>                 compatible = "fsl,mpc8360-localbus";
>                 #address-cells = <2>;
>                 #size-cells = <1>;
>                 reg = <e0005000 d8>;
> 
>                 ranges = <0 0 ff800000   1000000      // nor flash,  16 MB
>                                   1 0 60000000 4000000>;   // nand
> flash, 64 MB (512 Mb)
> 
>                 nor-flash@0,0 {
>                         compatible = "amd,s29glxxx", "cfi-flash";
>                         reg = <0 0 40000>;
>                         bank-width = <2>;
>                         device-width = <1>;
>                 };
> 
>                 nand-flash@1,0 {
>                         compatible = "stmicro,NAND512W3A", "fsl,upm-nand";
>                         reg = <1 0 4000000>;   //reg = <1 0 1>;
>                         width = <1>;
>                         upm = "A";
>                         upm-addr-offset = <16>;
>                         upm-cmd-offset = <8>;
>                         gpios = <4 18>;
>                         gpio-parent = <&qe_pio>;
>                         wait-pattern;
>                         wait-write;
>                 };
>        };
> 

Maybe it'd be better:

          NOR: flash@0,0 {
                  compatible = "amd,s29glxxx", "cfi-flash";
                  reg = <0 0 40000>;
                  bank-width = <2>;
                  device-width = <1>;
          };

          NAND: flash@1,0 {
                  compatible = "stmicro,NAND512W3A", fsl,upm-nand";
                  reg = <1 0 4000000>;   //reg = <1 0 1>;
                  width = <1>;
                  upm = "A";
                  upm-addr-offset = <16>;
                  upm-cmd-offset = <8>;
                  gpios = <4 18>;

> 
> 
> In range information:
> 
> ranges = <0 0 ff800000 1000000         // nor flash,  16 MB
>                    1 0 60000000 4000000>;   // nand flash, 64 MB (512 Mb)
> 
> i dont know what ff800000 and 60000000 means,

They are the physical addresses. You have to write the addresses 
according to your memory map.

> i got those values from some posts in the mail-list. I also searched
> the datasheet and didnt find anything about those values.
> 
> The size values, 1000000 and 4000000, im using the memory density.
> Is this correct? Cause i read some posts that the nand size was very
> small, like 32K, seems that its something like the block size of
> nand.
> 

Ok the last value is the size.

> 
> 
> In reg information:
> 
> reg = <0 0 1000000>;    // nor-flash
> reg = <1 0 4000000>;    // nand-flash
> 
> Dont know if its correct. The third argument i used the size,
> but the second i dont know what value use.
> 

Ok, right. The second value is simply an offset.

> 
> 
> In other post by Anton, i saw something like these:
> 
>        upm@1,0 {		
> 		flash {		
> 	           ...
>         	};
>        };
> 
> 
> Should i use it?

No I think it's not needed, however, follow the instruction of 
booting-without-of.txt. In this guide you can find all the nodes you can 
use.

> 
> I must confess, im really confuse about all this stuffs.
> I read linux/Documentation/powerpc/booting-without-of.txt but didnt
> clarify so much.
> 
> Cheers,
> 
> --
> Alemao
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 


-- 
Marco Stornelli
Embedded Software Engineer
CoRiTeL - Consorzio di Ricerca sulle Telecomunicazioni
http://www.coritel.it

marco.stornelli@coritel.it
+39 06 72582838

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

end of thread, other threads:[~2008-07-15  6:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-14 14:47 NAND Flash, Localbus and UPM Alemao
2008-07-15  6:38 ` Marco Stornelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).