linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* MTD map drivers (FSL UPM NAND)
@ 2008-10-09 21:04 Alemao
  2008-10-09 21:17 ` Scott Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Alemao @ 2008-10-09 21:04 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

Im trying to use a physmap driver for NOR and NAND flash devices.

With NOR, everything ok. It uses CFI driver.

The problem is with NAND, cause it is connected at Freescale
LocalBus UPM, and at a first look, the UPM driver is loading after the
physmap (lines 14-15 in kernel output)

Here some outputs from the board:

Bootloader (U-Boot 1.2.0):

CPU:   e300c1, MPC8360E, Rev: 21 at 499.999 MHz, CSB:  333 MHz
Board: MPC8360KTX
I2C:   ready
DDR RAM: 128 MB
FLASH: 16 MB
NAND:  64 MiB
In:    serial
Out:   serial
Err:   serial


Kernel (linux-2.6.17):

1               physmap nor flash device: 1000000 at ff000000
2               NOR flash: Found 1 x16 devices at 0x0 in 16-bit bank
3                Amd/Fujitsu Extended Query Table at 0x0040
4                number of CFI chips: 1
5               Using physmap partition definition
6               Creating 6 MTD partitions on "NOR flash":
7               0x00000000-0x00040000 : "u-boot"
8               0x00040000-0x00060000 : "env."
9               0x00060000-0x00080000 : "sys"
10              0x00080000-0x000c0000 : "logs"
11              0x000c0000-0x00860000 : "admin"
12              0x00860000-0x01000000 : "users"
13
14              physmap nand flash device: 4000000 at 60000000
15              UPM: User-Programmable Machine NAND driver


Device Tree Source:

localbus@e0005000 {
  compatible = "fsl,board-localbus";
  #address-cells = <2>;
  #size-cells = <1>;
  reg = <e0005000 d8>;    // BRx, ORx, etc

  ranges = <0 0 ff000000 1000000     // nor flash,  16 MB
                    1 0 60000000 4000000>;   // nand flash, 64 MB

  flash@0,0 {
      compatible = "atmel,29LV256", "cfi-flash";
      reg = <0 0 1000000>;
      bank-width = <2>;
      device-width = <1>;
  };

  nand@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;
  };
};

The CFI driver is at linux/drivers/mtd/chips
The UPM driver is at linux/drivers/mtd/nand

So, how can I load the UPM driver before physmap?

Thanks in advance,

--
Alemao

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

* Re: MTD map drivers (FSL UPM NAND)
  2008-10-09 21:04 MTD map drivers (FSL UPM NAND) Alemao
@ 2008-10-09 21:17 ` Scott Wood
  2008-10-10 12:58   ` Alemao
  0 siblings, 1 reply; 4+ messages in thread
From: Scott Wood @ 2008-10-09 21:17 UTC (permalink / raw)
  To: Alemao; +Cc: linuxppc-embedded

Alemao wrote:
> Hi all,
> 
> Im trying to use a physmap driver for NOR and NAND flash devices.

You can't use physmap with NAND.

>   ranges = <0 0 ff000000 1000000     // nor flash,  16 MB
>                     1 0 60000000 4000000>;   // nand flash, 64 MB

Is your NAND window really that large?  I'm not too familiar with UPM, 
but typically it'd only be a few KiB.

> So, how can I load the UPM driver before physmap?

Just stop pointing physmap at the NAND.

-Scott

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

* Re: MTD map drivers (FSL UPM NAND)
  2008-10-09 21:17 ` Scott Wood
@ 2008-10-10 12:58   ` Alemao
  2008-10-10 15:44     ` Scott Wood
  0 siblings, 1 reply; 4+ messages in thread
From: Alemao @ 2008-10-10 12:58 UTC (permalink / raw)
  To: linuxppc-embedded

>>
>> Hi all,
>>
>> Im trying to use a physmap driver for NOR and NAND flash devices.
>
> You can't use physmap with NAND.
>

Bu I have here physmap with NAND working,
but not using UPM

>>  ranges = <0 0 ff000000 1000000     // nor flash,  16 MB
>>                    1 0 60000000 4000000>;   // nand flash, 64 MB
>
> Is your NAND window really that large?  I'm not too familiar with UPM, but
> typically it'd only be a few KiB.
>

I always thought here was the memory size... =)

But how can I calculate the window size?

I think the concept of window size is not so clear to me...

>> So, how can I load the UPM driver before physmap?
>
> Just stop pointing physmap at the NAND.
>
> -Scott
>

Here is an output from someone using it:

-----

070500 U-Boot 1.1.2 (May 30 2007 - 20:20:09)

Motorola PowerPC
Board: GDA Technologies CSC-PP MPC8560 [PowerQUICC III]
CPU: 660 MHz
CCB: 330 MHz
DDR: 165 MHz

Creating 7 MTD partitions on "CSC flash":
0x00f80000-0x01000000 : "uboot"
0x00d00000-0x00e00000 : "kernel0"
0x00e00000-0x00f00000 : "kernel1"
0x00700000-0x00d00000 : "app"
0x00000000-0x00380000 : "root0"
0x00380000-0x00700000 : "root1"
0x00f00000-0x00f80000 : "env"

NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca
Scanning device for bad blocks
Bad eraseblock 1780 at 0x0de80000
Creating 1 MTD partitions on "NAND 256MiB 3,3V 16-bit":
0x00000000-0x10000000 : "NAND Partition"

-----

Thats exactly what I want to do. If you say not to use physmap with
NAND, how he is doing this? Through the device tree source?


Huge thanks,

--
Alemao

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

* Re: MTD map drivers (FSL UPM NAND)
  2008-10-10 12:58   ` Alemao
@ 2008-10-10 15:44     ` Scott Wood
  0 siblings, 0 replies; 4+ messages in thread
From: Scott Wood @ 2008-10-10 15:44 UTC (permalink / raw)
  To: Alemao; +Cc: linuxppc-embedded

Alemao wrote:
> Here is an output from someone using it:
> 
> -----
> 
> 070500 U-Boot 1.1.2 (May 30 2007 - 20:20:09)
> 
> Motorola PowerPC
> Board: GDA Technologies CSC-PP MPC8560 [PowerQUICC III]
> CPU: 660 MHz
> CCB: 330 MHz
> DDR: 165 MHz
> 
> Creating 7 MTD partitions on "CSC flash":
> 0x00f80000-0x01000000 : "uboot"
> 0x00d00000-0x00e00000 : "kernel0"
> 0x00e00000-0x00f00000 : "kernel1"
> 0x00700000-0x00d00000 : "app"
> 0x00000000-0x00380000 : "root0"
> 0x00380000-0x00700000 : "root1"
> 0x00f00000-0x00f80000 : "env"
> 
> NAND device: Manufacturer ID: 0x2c, Chip ID: 0xca
> Scanning device for bad blocks
> Bad eraseblock 1780 at 0x0de80000
> Creating 1 MTD partitions on "NAND 256MiB 3,3V 16-bit":
> 0x00000000-0x10000000 : "NAND Partition"
> 
> -----
> 
> Thats exactly what I want to do. If you say not to use physmap with
> NAND, how he is doing this? Through the device tree source?

I see nothing in that output to suggest that physmap is being used for NAND.

NAND is not directly mapped like NOR is; you cannot just give an address 
range with no knowledge of the controller and expect it to work.

Note that if you look in drivers/mtd/maps/physmap.c, the supported probe 
types are CFI, JEDEC, and ROM.

-Scott

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

end of thread, other threads:[~2008-10-10 15:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-09 21:04 MTD map drivers (FSL UPM NAND) Alemao
2008-10-09 21:17 ` Scott Wood
2008-10-10 12:58   ` Alemao
2008-10-10 15:44     ` Scott Wood

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).