From: Angelo Subject: R: Question on flash node on device tree source Date: Wed, 9 Sep 2009 07:38:34 +0000 (GMT) Message-ID: <918437.52044.qm@web23104.mail.ird.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2022459606597305903==" Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org, david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org List-Id: devicetree@vger.kernel.org --===============2022459606597305903== Content-Type: multipart/alternative; boundary="0-807376884-1252481914=:52044" --0-807376884-1252481914=:52044 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Thanks for info! Ok I have to modify some things, but anyway: 1- dts is an old version (I know that and this isn't a problem because kern= el is an old version too 2.6.x) 2- The main mistake is that I'm tring to use the NAND flash, but the DTS no= de that i've modified refers to NOR flash. So i think that I must modify the following part of code: =A0=A0=A0 nfc@40000000 { =A0=A0=A0 =A0=A0=A0 compatible =3D "fsl,mpc5121rev2-nfc"; =A0=A0=A0 =A0=A0=A0 reg =3D <40000000 100000>;=A0=A0=A0 // 1M at 0x40000000 =A0=A0=A0 =A0=A0=A0 interrupts =3D <6 8>; =A0=A0=A0 =A0=A0=A0 interrupt-parent =3D < &ipic >; =A0=A0=A0 =A0=A0=A0 #address-cells =3D <1>; =A0=A0=A0 =A0=A0=A0 #size-cells =3D <1>; =A0=A0=A0 =A0=A0=A0 bank-width =3D <1>; =A0=A0=A0 =A0=A0=A0 write-size =3D <800>; =A0=A0=A0 =A0=A0=A0 spare-size =3D <40>; =A0=A0=A0 =A0=A0=A0 // ADS has two Hynix 512MB Nand flash chips in a single =A0=A0=A0 =A0=A0=A0 // stacked package . =A0=A0=A0 =A0=A0=A0 chips =3D <2>; =A0=A0=A0 =A0=A0=A0 // UBIFS works fine on large partitions so use all of i= t =A0=A0=A0 =A0=A0=A0 nand@0 { =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 label =3D "nand"; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 reg =3D <00000000 40000000>; =A0=A0=A0 // Ent= ire 1G (512M + 512M) =A0=A0=A0 =A0=A0=A0 }; =A0=A0=A0 =A0=A0=A0 // JFFS2 really doesn't do large partitions well use UB= IFS instead =A0=A0=A0 =A0=A0=A0 //nand0@0 { =A0=A0=A0 =A0=A0=A0 //=A0=A0=A0 label =3D "nand0"; =A0=A0=A0 =A0=A0=A0 //=A0=A0=A0 reg =3D <00000000 02000000>; =A0=A0=A0 // f= irst 32 MB of chip 0 =A0=A0=A0 =A0=A0=A0 //}; =A0=A0=A0 =A0=A0=A0 //nand1@20000000 { =A0=A0=A0 =A0=A0=A0 //=A0=A0=A0 label =3D "nand1"; =A0=A0=A0 =A0=A0=A0 //=A0=A0=A0 reg =3D <20000000 02000000>; =A0=A0=A0 // f= irst 32 MB of chip 1 =A0=A0=A0 =A0=A0=A0 //}; =A0=A0=A0 }; This part of device tree concern nand flash controller od ads5121ev board. In your opinion kernel obtains all flash info from device tree? or I must m= odify some part of kernel code? It seems like that nand flash controller could mangae two banks of nand fla= sh: // JFFS2 really doesn't do large partitions well use UBIFS instead //nand0@0 { //=A0=A0=A0 label =3D "nand0"; //=A0=A0=A0 reg =3D <00000000 02000000>; =A0=A0=A0 // first 32 MB of chip 0 //}; //nand1@20000000 { //=A0=A0=A0 label =3D "nand1"; //=A0=A0=A0 reg =3D <20000000 02000000>; =A0=A0=A0 // first 32 MB of chip = 1 //}; What do you think? It could could be an hard work!? Thanks in advance @s --- Mar 8/9/09, Angelo ha scritto: Da: Angelo Oggetto: Question on flash node on device tree source A: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org Data: Marted=EC 8 settembre 2009, 14:18 Hi all. I need some info about device tree blob. I'm testing a powerpc board (very similar to mpc512xev) with the following = feature: =A0- 256MB flash (only 1 bank) Changes some lines of device tree source about flash localbus@80000020 { =A0=A0=A0 =A0=A0=A0 compatible =3D "fsl,mpc5121ads-localbus"; =A0=A0=A0 =A0=A0=A0 #address-cells =3D <2>; =A0=A0=A0 =A0=A0=A0 #size-cells =3D <1>; =A0=A0=A0 =A0=A0=A0 reg =3D <0000020 40>; =A0=A0=A0 =A0=A0=A0 ranges =3D <0 0 fc000000 04000000 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0 2 0 82000000 00008000>; =A0=A0=A0 =A0=A0=A0 flash@0,0 { =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 device_type =3D=0A "rom"; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 compatible =3D "direct-mapped"; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 probe-type =3D "CFI"; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 reg =3D <0 0 4000000>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 #address-cells =3D <1>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 #size-cells =3D <1>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 bank-width =3D <4>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 device-width =3D <2>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 partitions =3D <00000000 00040000=A0=A0=A0 = =A0=A0=A0 // first sector is protected =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0 00040000 03c00000= =A0=A0=A0 =A0=A0=A0 // 60 Mb for=0A filesystem =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0 03c40000 00280000= =A0=A0=A0 =A0=A0=A0 // 2.5 Mb for kernel =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0 03ec0000 00040000= =A0=A0=A0 =A0=A0=A0 // one sector for device tree =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0 03f00000 00100000>;= =A0=A0=A0 // one Mb for u-boot =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 partition-names =3D "protected", "filesystem"= , "kernel", "device-tree", "u-boot"; =A0=A0=A0 =A0=A0=A0 }; ..... with these changes: ..... =A0=A0=A0 =A0=A0=A0 flash@0,0 { =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 device_type =3D "rom"; =A0=A0=A0 =A0=A0=A0=0A =A0=A0=A0 compatible =3D "direct-mapped"; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 probe-type =3D "CFI"; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 reg =3D <0 0 1000000>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 #address-cells =3D <1>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 #size-cells =3D <1>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 bank-width =3D <1>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 device-width =3D <1>; =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 partitions =3D <300000 200000=A0=A0=A0 =A0=A0= =A0 //uimage =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 400000 3200000>= ;=A0=A0=A0 // fs =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 partition-names =3D "uimage",=0A "fs"; =A0=A0=A0 =A0=A0=A0 }; ..... The problem is that on bootstrap stage, kernel truncate the flash memory to= 16MB, so i cannot access to the whole flash. kernel messages: mtd: partition "fs" extends=A0 beyond the end of device "60000000.flash" si= ze truncated to 0xc00000. I'd like to know if i have to specify into the dtb file the size of flash m= em. What about nand flash controller and its functionality?=20 If you have more info about this, please write to me. Thanks in advance, @s =0A=0A=0A=0A =0A=0A=0A --0-807376884-1252481914=:52044 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks for info!
Ok I have to= modify some things, but anyway:
1- dts is an old version (I know that a= nd this isn't a problem because kernel is an old version too 2.6.x)
2- T= he main mistake is that I'm tring to use the NAND flash, but the DTS node t= hat i've modified refers to NOR flash.

So i think that I must modify= the following part of code:

    nfc@40000000 {
&n= bsp;       compatible =3D "fsl,mpc5121rev2-nfc";        reg =3D <40000000 100000>;&nb= sp;   // 1M at 0x40000000
       = ; interrupts =3D <6 8>;
        inte= rrupt-parent =3D < &ipic >;
      &nb= sp; #address-cells =3D <1>;
        = #size-cells =3D <1>;
        bank-width =3D <1&g= t;;
        write-size =3D <800>;        spare-size =3D <40>;
 =        // ADS has two Hynix 512MB Nand flash chips= in a single
        // stacked package .<= br>        chips =3D <2>;
 &nbs= p;      // UBIFS works fine on large partitions so use = all of it
        nand@0 {
  =           label =3D "nand";
 &nb= sp;          reg =3D <00000000 400000= 00>;     // Entire 1G (512M + 512M)
   =     };
        // JFFS2 re= ally doesn't do large partitions well use UBIFS instead
  &nbs= p;     //nand0@0 {
        //=     label =3D "nand0";
      &nb= sp; //    reg =3D <00000000 02000000>;   &nb= sp; // first 32 MB of chip 0
        //};<= br>        //nand1@20000000 {
  =       //    label =3D "nand1";
 =        //    reg =3D <20000000 0= 2000000>;     // first 32 MB of chip 1
  &nb= sp;     //};
    };

This part of de= vice tree concern nand flash controller od ads5121ev board.
In your opin= ion kernel obtains all flash info from device tree? or I must modify some p= art of kernel code?
It seems like that nand flash controller could manga= e two banks of nand flash:

// JFFS2 really doesn't do large partitions well use UBIFS instead
//nand0@0 {
//    l= abel =3D "nand0";
//    reg =3D <00000000 02000000>= ;     // first 32 MB of chip 0
//};
//nand1@20000000= {
//    label =3D "nand1";
//    reg= =3D <20000000 02000000>;     // first 32 MB of chip 1=
//};

What do you think? It could could be an hard work!?
Thanks in advance
@s

--- Mar 8/9/09, Angelo <s104259@ya= hoo.it> ha scritto:

Da: Angelo &= lt;s104259-whZMOeQn8C0@public.gmane.org>
Oggetto: Question on flash node on device tree s= ource
A: devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org
Data: Marted=EC 8 settembre 20= 09, 14:18

Hi all.

I need some info about device tree blob.
I'm= testing a powerpc board (very similar to mpc512xev) with the following fea= ture:
 - 256MB flash (only 1 bank)

Changes some lines of dev= ice tree source about flash

localbus@80000020 {
   = ;     compatible =3D "fsl,mpc5121ads-localbus";
 &nb= sp;      #address-cells =3D <2>;
  &= nbsp;     #size-cells =3D <1>;
    &= nbsp;   reg =3D <0000020 40>;

    &nb= sp;   ranges =3D <0 0 fc000000 04000000
    =           2 0 82000000 00008000>;
=
        flash@0,0 {
            device_type =3D=0A "rom";
 &= nbsp;          compatible =3D "direct-ma= pped";
            probe-ty= pe =3D "CFI";
            r= eg =3D <0 0 4000000>;
         =    #address-cells =3D <1>;
     &nbs= p;      #size-cells =3D <1>;
   = ;         bank-width =3D <4>;
 =            device-width =3D <2&g= t;;
            partitions = =3D <00000000 00040000        // first sec= tor is protected
           = ;           00040000 03c00000 =        // 60 Mb for=0A filesystem
  &= nbsp;               =     03c40000 00280000        /= / 2.5 Mb for kernel
          &n= bsp;           03ec0000 00040000&nb= sp;       // one sector for device tree
 &= nbsp;               =      03f00000 00100000>;    // one Mb= for u-boot
            par= tition-names =3D "protected", "filesystem", "kernel", "device-tree", "u-boo= t";
        };
....
with these chang= es:
....
        flash@0,0 {
 &= nbsp;          device_type =3D "rom";       =0A     compatible =3D= "direct-mapped";
          &nbs= p; probe-type =3D "CFI";
         &nb= sp;  reg =3D <0 0 1000000>;
      &n= bsp;     #address-cells =3D <1>;
   =         #size-cells =3D <1>;
 =            bank-width =3D <1>= ;
            device-width = =3D <1>;
            = partitions =3D <300000 200000        //uim= age
              = ;          400000 3200000>; &nbs= p;  // fs
            = partition-names =3D "uimage",=0A "fs";
      &n= bsp; };
....

The problem is that on bootstrap stage, kernel trunc= ate the flash memory to 16MB, so i cannot access to the whole flash. kernel= messages:

mtd: partition "fs" extends  beyond the end of devic= e "60000000.flash" size truncated to 0xc00000.

I'd like to know if i= have to specify into the dtb file the size of flash mem. What about nand f= lash controller and its functionality?
If you have more info about this= , please write to me.

Thanks in advance,
@s


=0A=0A=0A=0A

= =0A=0A=0A=0A --0-807376884-1252481914=:52044-- --===============2022459606597305903== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org https://lists.ozlabs.org/listinfo/devicetree-discuss --===============2022459606597305903==--