linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Support for S29JL064 in MPC8272ADS?
@ 2009-10-09 14:14 Roberto Guerra
  2009-10-09 17:04 ` Scott Wood
  0 siblings, 1 reply; 9+ messages in thread
From: Roberto Guerra @ 2009-10-09 14:14 UTC (permalink / raw)
  To: linuxppc-dev

Hello,
My uboot can read my flash chip, finding the uImage and the initramfs,
and booting the kernel fine. However, I'd like the Linux kernel to
read my flash chip so that it can update files in it.
My flash chip is the Spansion S29JL064H (AMD), 16 bit wide, 64 Mbit.
The chip is mapped from FF800000 to FFFFFFFF. The rootfs.jffs2 was
written on 0XFF990000 and is 0x390000 long.
I know that the JFFS is written correctly, because it is detected by uboot:

=> fsinfo
### filesystem type is JFFS2
Scanning JFFS2 FS: ....... done.
Compression: NONE
        frag count: 523
        compressed sum: 138074
        uncompressed sum: 138074
Compression: ZERO
        frag count: 0
        compressed sum: 0
        uncompressed sum: 0
Compression: RTIME
        frag count: 1
        compressed sum: 48
        uncompressed sum: 52
Compression: RUBINMIPS
        frag count: 0
        compressed sum: 0
        uncompressed sum: 0
Compression: COPY
        frag count: 0
        compressed sum: 0
        uncompressed sum: 0
Compression: DYNRUBIN
        frag count: 0
        compressed sum: 0
        uncompressed sum: 0
Compression: ZLIB
        frag count: 2031
        compressed sum: 3370991
        uncompressed sum: 7598685

=> flinfo

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 8 MB in 142 Sectors
  AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x7E0201
  Erase timeout: 8192 ms, write timeout: 1 ms

  Sector Start Addresses:
  FF800000        FF802000        FF804000        FF806000        FF808000
  FF80A000        FF80C000        FF80E000        FF810000        FF820000
  FF830000        FF840000        FF850000        FF860000        FF870000
  FF880000        FF890000        FF8A0000        FF8B0000        FF8C0000
  FF8D0000        FF8E0000        FF8F0000        FF900000        FF910000
  FF920000        FF930000        FF940000        FF950000        FF960000
  FF970000        FF980000        FF990000        FF9A0000        FF9B0000
  FF9C0000        FF9D0000        FF9E0000        FF9F0000        FFA00000
  FFA10000        FFA20000        FFA30000        FFA40000        FFA50000
  FFA60000        FFA70000        FFA80000        FFA90000        FFAA0000
  FFAB0000        FFAC0000        FFAD0000        FFAE0000        FFAF0000
  FFB00000        FFB10000        FFB20000        FFB30000        FFB40000
  FFB50000        FFB60000        FFB70000        FFB80000        FFB90000
  FFBA0000        FFBB0000        FFBC0000        FFBD0000        FFBE0000
  FFBF0000        FFC00000        FFC10000        FFC20000        FFC30000
  FFC40000        FFC50000        FFC60000        FFC70000        FFC80000
  FFC90000        FFCA0000        FFCB0000        FFCC0000        FFCD0000
  FFCE0000        FFCF0000        FFD00000        FFD10000        FFD20000
  FFD30000        FFD40000        FFD50000        FFD60000        FFD70000
  FFD80000        FFD90000        FFDA0000        FFDB0000        FFDC0000
  FFDD0000        FFDE0000        FFDF0000        FFE00000        FFE10000
  FFE20000        FFE30000        FFE40000        FFE50000        FFE60000
  FFE70000        FFE80000        FFE90000        FFEA0000        FFEB0000
  FFEC0000        FFED0000        FFEE0000        FFEF0000        FFF00000   RO
  FFF10000   RO   FFF20000   RO   FFF30000   RO   FFF40000   RO   FFF50000   RO
  FFF60000   RO   FFF70000   RO   FFF80000        FFF90000        FFFA0000
  FFFB0000        FFFC0000        FFFD0000        FFFE0000        FFFF0000
  FFFF2000        FFFF4000        FFFF6000        FFFF8000        FFFFA000
  FFFFC000        FFFFE000

My bootargs are:
bootargs=console=ttyCPM0,115200 root=/dev/mtdblock1 rw
mtdparts=phys:1600K(ROM)ro,6M(root),512K(U-Boot)ro,512K(unused)

However, the kernel does not detect any flash chip (nor there's any
indication that a CFI probe is being performed).

My flash kconfig section:

#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
# CONFIG_MTD_CFI_NOSWAP is not set
# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
CONFIG_MTD_CFI_LE_BYTE_SWAP=y
# CONFIG_MTD_CFI_GEOMETRY is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_OTP is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CFI_AMDSTD=y
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=y
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set

#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PHYSMAP is not set
# CONFIG_MTD_PHYSMAP_OF is not set
# CONFIG_MTD_INTEL_VR_NOR is not set
# CONFIG_MTD_PLATRAM is not set

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set

Roberto Guerra

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

* Re: Support for S29JL064 in MPC8272ADS?
  2009-10-09 14:14 Support for S29JL064 in MPC8272ADS? Roberto Guerra
@ 2009-10-09 17:04 ` Scott Wood
  2009-10-09 17:59   ` Roberto Guerra
  0 siblings, 1 reply; 9+ messages in thread
From: Scott Wood @ 2009-10-09 17:04 UTC (permalink / raw)
  To: Roberto Guerra; +Cc: linuxppc-dev

On Fri, Oct 09, 2009 at 10:14:56AM -0400, Roberto Guerra wrote:
> Hello,
> My uboot can read my flash chip, finding the uImage and the initramfs,
> and booting the kernel fine. However, I'd like the Linux kernel to
> read my flash chip so that it can update files in it.

Have you described your flash chip in the device tree?

> However, the kernel does not detect any flash chip (nor there's any
> indication that a CFI probe is being performed).

The stock device tree for mpc8272ads only specifies it as a JEDEC
flash, not CFI.

-Scott

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

* Re: Support for S29JL064 in MPC8272ADS?
  2009-10-09 17:04 ` Scott Wood
@ 2009-10-09 17:59   ` Roberto Guerra
  2009-10-09 18:16     ` Scott Wood
  0 siblings, 1 reply; 9+ messages in thread
From: Roberto Guerra @ 2009-10-09 17:59 UTC (permalink / raw)
  To: linuxppc-dev

No. I did not. My FDT was simplified from the stock MPC8272ADS:
=> fdt list
/ {
        model = "pq2fads";
        compatible = "fsl,pq2fads";
        #address-cells = <0x00000001>;
        #size-cells = <0x00000001>;
        cpus {
        };
        memory {
        };
        soc@f0000000 {
        };
        chosen {
        };
};
I am searching how I could add the mtd branch between the "soc" and
the "chosen".

On Fri, Oct 9, 2009 at 1:04 PM, Scott Wood <scottwood@freescale.com> wrote:
> On Fri, Oct 09, 2009 at 10:14:56AM -0400, Roberto Guerra wrote:
>> Hello,
>> My uboot can read my flash chip, finding the uImage and the initramfs,
>> and booting the kernel fine. However, I'd like the Linux kernel to
>> read my flash chip so that it can update files in it.
>
> Have you described your flash chip in the device tree?
>
>> However, the kernel does not detect any flash chip (nor there's any
>> indication that a CFI probe is being performed).
>
> The stock device tree for mpc8272ads only specifies it as a JEDEC
> flash, not CFI.
>
> -Scott
>

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

* Re: Support for S29JL064 in MPC8272ADS?
  2009-10-09 17:59   ` Roberto Guerra
@ 2009-10-09 18:16     ` Scott Wood
  2009-10-14 21:34       ` Roberto Guerra
  0 siblings, 1 reply; 9+ messages in thread
From: Scott Wood @ 2009-10-09 18:16 UTC (permalink / raw)
  To: Roberto Guerra; +Cc: linuxppc-dev

On Fri, Oct 09, 2009 at 01:59:58PM -0400, Roberto Guerra wrote:
> No. I did not. My FDT was simplified from the stock MPC8272ADS:
> => fdt list
> / {
>         model = "pq2fads";
>         compatible = "fsl,pq2fads";
>         #address-cells = <0x00000001>;
>         #size-cells = <0x00000001>;
>         cpus {
>         };
>         memory {
>         };
>         soc@f0000000 {
>         };
>         chosen {
>         };
> };

You need more than that.  What happened to all the content of those nodes?

> I am searching how I could add the mtd branch between the "soc" and
> the "chosen".

Look at the localbus node on the mpc8272ads dts.

Look at (and use) a recent upstream kernel, if you're not already.

-Scott

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

* Re: Support for S29JL064 in MPC8272ADS?
  2009-10-09 18:16     ` Scott Wood
@ 2009-10-14 21:34       ` Roberto Guerra
  2009-10-14 21:40         ` Scott Wood
  0 siblings, 1 reply; 9+ messages in thread
From: Roberto Guerra @ 2009-10-14 21:34 UTC (permalink / raw)
  To: linuxppc-dev, Scott Wood

On Fri, Oct 9, 2009 at 2:16 PM, Scott Wood <scottwood@freescale.com> wrote:
> On Fri, Oct 09, 2009 at 01:59:58PM -0400, Roberto Guerra wrote:
>> No. I did not. My FDT was simplified from the stock MPC8272ADS:
>> =3D> fdt list
>> / {
>> =A0 =A0 =A0 =A0 model =3D "pq2fads";
>> =A0 =A0 =A0 =A0 compatible =3D "fsl,pq2fads";
>> =A0 =A0 =A0 =A0 #address-cells =3D <0x00000001>;
>> =A0 =A0 =A0 =A0 #size-cells =3D <0x00000001>;
>> =A0 =A0 =A0 =A0 cpus {
>> =A0 =A0 =A0 =A0 };
>> =A0 =A0 =A0 =A0 memory {
>> =A0 =A0 =A0 =A0 };
>> =A0 =A0 =A0 =A0 soc@f0000000 {
>> =A0 =A0 =A0 =A0 };
>> =A0 =A0 =A0 =A0 chosen {
>> =A0 =A0 =A0 =A0 };
>> };
>
> You need more than that. =A0What happened to all the content of those nod=
es?
>
>> I am searching how I could add the mtd branch between the "soc" and
>> the "chosen".
>
> Look at the localbus node on the mpc8272ads dts.
>
> Look at (and use) a recent upstream kernel, if you're not already.
>
> -Scott
>

I've been learning how to modify the dts from
http://www.mjmwired.net/kernel/Documentation/powerpc/dts-bindings/mtd-physm=
ap.txt#49
The original mpc8272ads.dts represents four 8-bit JEDEC Sharp flash
chips in 1 SIMM module:
[snip]        localbus@f0010100 {
                compatible =3D "fsl,mpc8280-localbus",
                             "fsl,pq2-localbus";
                #address-cells =3D <2>;
                #size-cells =3D <1>;
                reg =3D <f0010100 60>;

                ranges =3D <0 0 fe000000 00800000
                          1 0 f4500000 00008000
                          8 0 f8200000 00008000>;

                flash@0,0 {
                        compatible =3D "jedec-flash";
                        reg =3D <0 0 800000>;
                        bank-width =3D <4>;
                        device-width =3D <1>;
                };
[snip]
My board (based on the PQ2FADS, using the MPC8272ADS BSP) uses one
16-bit Spansion (AMD) CFI chip at addresses FF800000 through FFFFFFFF.
It probably needs to be represented this way (I've only made changes
to the "flash" section.
[snip]
                flash@0,0 {
                        compatible =3D "amd, s29jl064h", "cfi-flash";
                        reg =3D <0 0 800000>;
                        bank-width =3D <2>;
                        device-width =3D <2>;
                };
[snip]
However, I don't know what would be the correct addresses to type
after "localbus", "flash" and "reg". Is this enough information to
define my dts?
Thanks,
Roberto

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

* Re: Support for S29JL064 in MPC8272ADS?
  2009-10-14 21:34       ` Roberto Guerra
@ 2009-10-14 21:40         ` Scott Wood
  2009-10-16 15:37           ` Roberto Guerra
  0 siblings, 1 reply; 9+ messages in thread
From: Scott Wood @ 2009-10-14 21:40 UTC (permalink / raw)
  To: Roberto Guerra; +Cc: linuxppc-dev

Roberto Guerra wrote:
> I've been learning how to modify the dts from
> http://www.mjmwired.net/kernel/Documentation/powerpc/dts-bindings/mtd-physmap.txt#49
> The original mpc8272ads.dts represents four 8-bit JEDEC Sharp flash
> chips in 1 SIMM module:
> [snip]        localbus@f0010100 {
>                 compatible = "fsl,mpc8280-localbus",
>                              "fsl,pq2-localbus";
>                 #address-cells = <2>;
>                 #size-cells = <1>;
>                 reg = <f0010100 60>;
> 
>                 ranges = <0 0 fe000000 00800000
>                           1 0 f4500000 00008000
>                           8 0 f8200000 00008000>;
> 
>                 flash@0,0 {
>                         compatible = "jedec-flash";
>                         reg = <0 0 800000>;
>                         bank-width = <4>;
>                         device-width = <1>;
>                 };
> [snip]
> My board (based on the PQ2FADS, using the MPC8272ADS BSP)

Don't base anything on the BSPs, unless there's something in them that you 
really need that isn't upstream.  There is pq2fads support in current upstream 
kernels.

> uses one
> 16-bit Spansion (AMD) CFI chip at addresses FF800000 through FFFFFFFF.
> It probably needs to be represented this way (I've only made changes
> to the "flash" section.
> [snip]
>                 flash@0,0 {
>                         compatible = "amd, s29jl064h", "cfi-flash";
>                         reg = <0 0 800000>;
>                         bank-width = <2>;
>                         device-width = <2>;
>                 };
> [snip]
> However, I don't know what would be the correct addresses to type
> after "localbus", "flash" and "reg". Is this enough information to
> define my dts?

The flash node looks good, other than that there shouldn't be a space after "amd,".

In the localbus node, change fe000000 to ff800000.  Remove or change the other 
ranges entries if they don't describe your board's chipselects.

If your IMMR is somewhere other than 0xf0000000, update the f0010100 to match.

-Scott

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

* Re: Support for S29JL064 in MPC8272ADS?
  2009-10-14 21:40         ` Scott Wood
@ 2009-10-16 15:37           ` Roberto Guerra
  2009-10-16 15:55             ` Roberto Guerra
  2009-10-16 16:18             ` Scott Wood
  0 siblings, 2 replies; 9+ messages in thread
From: Roberto Guerra @ 2009-10-16 15:37 UTC (permalink / raw)
  To: Scott Wood, linuxppc-dev

In the last few days, I made this progress (<snip> indicates where I
cropped the file to the relevant sections):

$ cat myboard.dts
<snip>
        localbus@f0010100 {
                compatible =3D "fsl,mpc8280-localbus",
                             "fsl,pq2-localbus";
                #address-cells =3D <2>;
                #size-cells =3D <1>;
                reg =3D <f0010100 60>;

                ranges =3D <0 0 ffe00000 00800000>;

                flash@0,0 {
                        compatible =3D "cfi-flash";
                        reg =3D <0 0 800000>;
                        bank-width =3D <2>;
                        device-width =3D <2>;
                };
        };
<snip>

$ cat linux/.config
<snip>
#
# Generic Driver Options
#
CONFIG_MTD=3Dy
CONFIG_MTD_DEBUG=3Dy
CONFIG_MTD_DEBUG_VERBOSE=3D3
# CONFIG_MTD_CONCAT is not set
CONFIG_MTD_PARTITIONS=3Dy
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=3Dy
# CONFIG_MTD_OF_PARTS is not set
#
# User Modules And Translation Layers
#
# CONFIG_MTD_CHAR is not set
# CONFIG_MTD_BLKDEVS is not set
# CONFIG_MTD_BLOCK is not set
# CONFIG_MTD_BLOCK_RO is not set
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set
# CONFIG_RFD_FTL is not set
# CONFIG_SSFDC is not set
# CONFIG_MTD_OOPS is not set
#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=3Dy
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=3Dy
CONFIG_MTD_CFI_ADV_OPTIONS=3Dy
# CONFIG_MTD_CFI_NOSWAP is not set
# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
CONFIG_MTD_CFI_LE_BYTE_SWAP=3Dy
CONFIG_MTD_CFI_GEOMETRY=3Dy
# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
CONFIG_MTD_MAP_BANK_WIDTH_2=3Dy
# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=3Dy
# CONFIG_MTD_CFI_I2 is not set
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_OTP is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CFI_AMDSTD=3Dy
# CONFIG_MTD_CFI_STAA is not set
CONFIG_MTD_CFI_UTIL=3Dy
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
#
# Mapping drivers for chip access
#
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
CONFIG_MTD_PHYSMAP=3Dy
CONFIG_MTD_PHYSMAP_START=3D0xff800000
CONFIG_MTD_PHYSMAP_LEN=3D0x800000
CONFIG_MTD_PHYSMAP_BANKWIDTH=3D2
# CONFIG_MTD_PHYSMAP_OF is not set
# CONFIG_MTD_INTEL_VR_NOR is not set
# CONFIG_MTD_PLATRAM is not set
#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set
<snip>

=3D> tftpboot 200000 uImage
=3D> tftpboot 400000 myboard.dtb
=3D> echo $bootargs
console=3DttyCPM0,115200 root=3D/dev/mtdblock1 rw
mtdparts=3Dphys:1600K(ROM)ro,6M(root),512K(U-Boot)ro,512K(unused)
rootfstype=3Djffs2
=3D> bootm 200000 - 400000
<snip>
physmap platform flash device: 00800000 at ff800000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
physmap-flash.0: CFI does not contain boot bank location. Assuming
top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code
brokenness.
RedBoot partition parsing not available
mtd: Giving out device 0 to physmap-flash.0
mice: PS/2 mouse device common for all mice
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
MTDSB: dev_name "/dev/root"
MTDSB: path_lookup() returned 0, inode c1400aa0
List of all partitions:
0100       4096 ram0 (driver?)
0101       4096 ram1 (driver?)
0102       4096 ram2 (driver?)
0103       4096 ram3 (driver?)
0104       4096 ram4 (driver?)
0105       4096 ram5 (driver?)
0106       4096 ram6 (driver?)
0107       4096 ram7 (driver?)
0108       4096 ram8 (driver?)
0109       4096 ram9 (driver?)
010a       4096 ram10 (driver?)
010b       4096 ram11 (driver?)
010c       4096 ram12 (driver?)
010d       4096 ram13 (driver?)
010e       4096 ram14 (driver?)
010f       4096 ram15 (driver?)
No filesystem could mount root, tried:  jffs2
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(2,0)
Rebooting in 180 seconds..

The key change in my kernel config was the BIG_ENDIAN=3DY.
The kernel probes the AMD chip, but it can't see the partitions.
I guess now I will have to define my mtd partitions in either FDT or
in the kernel arguments.
Which is the best way to define them? If the partitions are defined in
both FDT and bootargs, which one takes precedence?

-Roberto


On Wed, Oct 14, 2009 at 5:40 PM, Scott Wood <scottwood@freescale.com> wrote=
:
> Roberto Guerra wrote:
>>
>> I've been learning how to modify the dts from
>>
>> http://www.mjmwired.net/kernel/Documentation/powerpc/dts-bindings/mtd-ph=
ysmap.txt#49
>> The original mpc8272ads.dts represents four 8-bit JEDEC Sharp flash
>> chips in 1 SIMM module:
>> [snip] =A0 =A0 =A0 =A0localbus@f0010100 {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "fsl,mpc8280-localbus",
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "fsl,pq2-localbu=
s";
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <2>;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <1>;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <f0010100 60>;
>>
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ranges =3D <0 0 fe000000 00800000
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01 0 f4500000 00008000
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A08 0 f8200000 00008000=
>;
>>
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flash@0,0 {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "jedec-fla=
sh";
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0 800000>;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bank-width =3D <4>;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0device-width =3D <1>;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
>> [snip]
>> My board (based on the PQ2FADS, using the MPC8272ADS BSP)
>
> Don't base anything on the BSPs, unless there's something in them that yo=
u
> really need that isn't upstream. =A0There is pq2fads support in current
> upstream kernels.
>
>> uses one
>> 16-bit Spansion (AMD) CFI chip at addresses FF800000 through FFFFFFFF.
>> It probably needs to be represented this way (I've only made changes
>> to the "flash" section.
>> [snip]
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flash@0,0 {
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "amd, s29j=
l064h", "cfi-flash";
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0 800000>;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bank-width =3D <2>;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0device-width =3D <2>;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
>> [snip]
>> However, I don't know what would be the correct addresses to type
>> after "localbus", "flash" and "reg". Is this enough information to
>> define my dts?
>
> The flash node looks good, other than that there shouldn't be a space aft=
er
> "amd,".
>
> In the localbus node, change fe000000 to ff800000. =A0Remove or change th=
e
> other ranges entries if they don't describe your board's chipselects.
>
> If your IMMR is somewhere other than 0xf0000000, update the f0010100 to
> match.
>
> -Scott
>
>

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

* Re: Support for S29JL064 in MPC8272ADS?
  2009-10-16 15:37           ` Roberto Guerra
@ 2009-10-16 15:55             ` Roberto Guerra
  2009-10-16 16:18             ` Scott Wood
  1 sibling, 0 replies; 9+ messages in thread
From: Roberto Guerra @ 2009-10-16 15:55 UTC (permalink / raw)
  To: Scott Wood, linuxppc-dev

Sorry I made a typo: LITTLE endian byte swap is enabled for Flash Chip driv=
ers:
CONFIG_MTD_CFI_LE_BYTE_SWAP=3Dy

On Fri, Oct 16, 2009 at 11:37 AM, Roberto Guerra
<roberto.j.guerra@gmail.com> wrote:
> In the last few days, I made this progress (<snip> indicates where I
> cropped the file to the relevant sections):
>
> $ cat myboard.dts
> <snip>
> =A0 =A0 =A0 =A0localbus@f0010100 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "fsl,mpc8280-localbus",
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "fsl,pq2-localbus=
";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <2>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <1>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <f0010100 60>;
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ranges =3D <0 0 ffe00000 00800000>;
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flash@0,0 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "cfi-flash"=
;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0 800000>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bank-width =3D <2>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0device-width =3D <2>;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
> =A0 =A0 =A0 =A0};
> <snip>
>
> $ cat linux/.config
> <snip>
> #
> # Generic Driver Options
> #
> CONFIG_MTD=3Dy
> CONFIG_MTD_DEBUG=3Dy
> CONFIG_MTD_DEBUG_VERBOSE=3D3
> # CONFIG_MTD_CONCAT is not set
> CONFIG_MTD_PARTITIONS=3Dy
> # CONFIG_MTD_REDBOOT_PARTS is not set
> CONFIG_MTD_CMDLINE_PARTS=3Dy
> # CONFIG_MTD_OF_PARTS is not set
> #
> # User Modules And Translation Layers
> #
> # CONFIG_MTD_CHAR is not set
> # CONFIG_MTD_BLKDEVS is not set
> # CONFIG_MTD_BLOCK is not set
> # CONFIG_MTD_BLOCK_RO is not set
> # CONFIG_FTL is not set
> # CONFIG_NFTL is not set
> # CONFIG_INFTL is not set
> # CONFIG_RFD_FTL is not set
> # CONFIG_SSFDC is not set
> # CONFIG_MTD_OOPS is not set
> #
> # RAM/ROM/Flash chip drivers
> #
> CONFIG_MTD_CFI=3Dy
> # CONFIG_MTD_JEDECPROBE is not set
> CONFIG_MTD_GEN_PROBE=3Dy
> CONFIG_MTD_CFI_ADV_OPTIONS=3Dy
> # CONFIG_MTD_CFI_NOSWAP is not set
> # CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
> CONFIG_MTD_CFI_LE_BYTE_SWAP=3Dy
> CONFIG_MTD_CFI_GEOMETRY=3Dy
> # CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
> CONFIG_MTD_MAP_BANK_WIDTH_2=3Dy
> # CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
> # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
> # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
> # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
> CONFIG_MTD_CFI_I1=3Dy
> # CONFIG_MTD_CFI_I2 is not set
> # CONFIG_MTD_CFI_I4 is not set
> # CONFIG_MTD_CFI_I8 is not set
> # CONFIG_MTD_OTP is not set
> # CONFIG_MTD_CFI_INTELEXT is not set
> CONFIG_MTD_CFI_AMDSTD=3Dy
> # CONFIG_MTD_CFI_STAA is not set
> CONFIG_MTD_CFI_UTIL=3Dy
> # CONFIG_MTD_RAM is not set
> # CONFIG_MTD_ROM is not set
> # CONFIG_MTD_ABSENT is not set
> #
> # Mapping drivers for chip access
> #
> # CONFIG_MTD_COMPLEX_MAPPINGS is not set
> CONFIG_MTD_PHYSMAP=3Dy
> CONFIG_MTD_PHYSMAP_START=3D0xff800000
> CONFIG_MTD_PHYSMAP_LEN=3D0x800000
> CONFIG_MTD_PHYSMAP_BANKWIDTH=3D2
> # CONFIG_MTD_PHYSMAP_OF is not set
> # CONFIG_MTD_INTEL_VR_NOR is not set
> # CONFIG_MTD_PLATRAM is not set
> #
> # Self-contained MTD device drivers
> #
> # CONFIG_MTD_PMC551 is not set
> # CONFIG_MTD_SLRAM is not set
> # CONFIG_MTD_PHRAM is not set
> # CONFIG_MTD_MTDRAM is not set
> # CONFIG_MTD_BLOCK2MTD is not set
> <snip>
>
> =3D> tftpboot 200000 uImage
> =3D> tftpboot 400000 myboard.dtb
> =3D> echo $bootargs
> console=3DttyCPM0,115200 root=3D/dev/mtdblock1 rw
> mtdparts=3Dphys:1600K(ROM)ro,6M(root),512K(U-Boot)ro,512K(unused)
> rootfstype=3Djffs2
> =3D> bootm 200000 - 400000
> <snip>
> physmap platform flash device: 00800000 at ff800000
> physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
> =A0Amd/Fujitsu Extended Query Table at 0x0040
> physmap-flash.0: CFI does not contain boot bank location. Assuming
> top.
> number of CFI chips: 1
> cfi_cmdset_0002: Disabling erase-suspend-program due to code
> brokenness.
> RedBoot partition parsing not available
> mtd: Giving out device 0 to physmap-flash.0
> mice: PS/2 mouse device common for all mice
> TCP cubic registered
> NET: Registered protocol family 1
> NET: Registered protocol family 17
> RPC: Registered udp transport module.
> RPC: Registered tcp transport module.
> Root-NFS: No NFS server available, giving up.
> VFS: Unable to mount root fs via NFS, trying floppy.
> MTDSB: dev_name "/dev/root"
> MTDSB: path_lookup() returned 0, inode c1400aa0
> List of all partitions:
> 0100 =A0 =A0 =A0 4096 ram0 (driver?)
> 0101 =A0 =A0 =A0 4096 ram1 (driver?)
> 0102 =A0 =A0 =A0 4096 ram2 (driver?)
> 0103 =A0 =A0 =A0 4096 ram3 (driver?)
> 0104 =A0 =A0 =A0 4096 ram4 (driver?)
> 0105 =A0 =A0 =A0 4096 ram5 (driver?)
> 0106 =A0 =A0 =A0 4096 ram6 (driver?)
> 0107 =A0 =A0 =A0 4096 ram7 (driver?)
> 0108 =A0 =A0 =A0 4096 ram8 (driver?)
> 0109 =A0 =A0 =A0 4096 ram9 (driver?)
> 010a =A0 =A0 =A0 4096 ram10 (driver?)
> 010b =A0 =A0 =A0 4096 ram11 (driver?)
> 010c =A0 =A0 =A0 4096 ram12 (driver?)
> 010d =A0 =A0 =A0 4096 ram13 (driver?)
> 010e =A0 =A0 =A0 4096 ram14 (driver?)
> 010f =A0 =A0 =A0 4096 ram15 (driver?)
> No filesystem could mount root, tried: =A0jffs2
> Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(2,0)
> Rebooting in 180 seconds..
>
> The key change in my kernel config was the BIG_ENDIAN=3DY.
> The kernel probes the AMD chip, but it can't see the partitions.
> I guess now I will have to define my mtd partitions in either FDT or
> in the kernel arguments.
> Which is the best way to define them? If the partitions are defined in
> both FDT and bootargs, which one takes precedence?
>
> -Roberto
>
>
> On Wed, Oct 14, 2009 at 5:40 PM, Scott Wood <scottwood@freescale.com> wro=
te:
>> Roberto Guerra wrote:
>>>
>>> I've been learning how to modify the dts from
>>>
>>> http://www.mjmwired.net/kernel/Documentation/powerpc/dts-bindings/mtd-p=
hysmap.txt#49
>>> The original mpc8272ads.dts represents four 8-bit JEDEC Sharp flash
>>> chips in 1 SIMM module:
>>> [snip] =A0 =A0 =A0 =A0localbus@f0010100 {
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "fsl,mpc8280-localbus",
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "fsl,pq2-localb=
us";
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#address-cells =3D <2>;
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0#size-cells =3D <1>;
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <f0010100 60>;
>>>
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ranges =3D <0 0 fe000000 00800000
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A01 0 f4500000 0000800=
0
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A08 0 f8200000 0000800=
0>;
>>>
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flash@0,0 {
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "jedec-fl=
ash";
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0 800000>;
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bank-width =3D <4>;
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0device-width =3D <1>;
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
>>> [snip]
>>> My board (based on the PQ2FADS, using the MPC8272ADS BSP)
>>
>> Don't base anything on the BSPs, unless there's something in them that y=
ou
>> really need that isn't upstream. =A0There is pq2fads support in current
>> upstream kernels.
>>
>>> uses one
>>> 16-bit Spansion (AMD) CFI chip at addresses FF800000 through FFFFFFFF.
>>> It probably needs to be represented this way (I've only made changes
>>> to the "flash" section.
>>> [snip]
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0flash@0,0 {
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "amd, s29=
jl064h", "cfi-flash";
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0 800000>;
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0bank-width =3D <2>;
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0device-width =3D <2>;
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0};
>>> [snip]
>>> However, I don't know what would be the correct addresses to type
>>> after "localbus", "flash" and "reg". Is this enough information to
>>> define my dts?
>>
>> The flash node looks good, other than that there shouldn't be a space af=
ter
>> "amd,".
>>
>> In the localbus node, change fe000000 to ff800000. =A0Remove or change t=
he
>> other ranges entries if they don't describe your board's chipselects.
>>
>> If your IMMR is somewhere other than 0xf0000000, update the f0010100 to
>> match.
>>
>> -Scott
>>
>>
>

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

* Re: Support for S29JL064 in MPC8272ADS?
  2009-10-16 15:37           ` Roberto Guerra
  2009-10-16 15:55             ` Roberto Guerra
@ 2009-10-16 16:18             ` Scott Wood
  1 sibling, 0 replies; 9+ messages in thread
From: Scott Wood @ 2009-10-16 16:18 UTC (permalink / raw)
  To: Roberto Guerra; +Cc: linuxppc-dev

Roberto Guerra wrote:
> mtdparts=phys:1600K(ROM)ro,6M(root),512K(U-Boot)ro,512K(unused)
> rootfstype=jffs2
> => bootm 200000 - 400000
> <snip>
> physmap platform flash device: 00800000 at ff800000
> physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
>  Amd/Fujitsu Extended Query Table at 0x0040
> physmap-flash.0: CFI does not contain boot bank location. Assuming
> top.

Hmm, you seem to be using physmap rather than physmap_of -- so it won't 
even be looking at your device tree node.

> List of all partitions:
> 0100       4096 ram0 (driver?)
> 0101       4096 ram1 (driver?)
> 0102       4096 ram2 (driver?)
> 0103       4096 ram3 (driver?)
> 0104       4096 ram4 (driver?)
> 0105       4096 ram5 (driver?)
> 0106       4096 ram6 (driver?)
> 0107       4096 ram7 (driver?)
> 0108       4096 ram8 (driver?)
> 0109       4096 ram9 (driver?)
> 010a       4096 ram10 (driver?)
> 010b       4096 ram11 (driver?)
> 010c       4096 ram12 (driver?)
> 010d       4096 ram13 (driver?)
> 010e       4096 ram14 (driver?)
> 010f       4096 ram15 (driver?)

Where are all these coming from?

> The key change in my kernel config was the BIG_ENDIAN=Y.
> The kernel probes the AMD chip, but it can't see the partitions.

Even without partiitons, you should see the whole flash device...

> I guess now I will have to define my mtd partitions in either FDT or
> in the kernel arguments.
> Which is the best way to define them?

If you're defining a standard layout for the platform that's unlikely to 
change, I'd go with the device tree.  Otherwise, I'd go with whatever's 
most convenient.

> If the partitions are defined in
> both FDT and bootargs, which one takes precedence?

The command line takes precedence.

-Scott

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

end of thread, other threads:[~2009-10-16 16:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-09 14:14 Support for S29JL064 in MPC8272ADS? Roberto Guerra
2009-10-09 17:04 ` Scott Wood
2009-10-09 17:59   ` Roberto Guerra
2009-10-09 18:16     ` Scott Wood
2009-10-14 21:34       ` Roberto Guerra
2009-10-14 21:40         ` Scott Wood
2009-10-16 15:37           ` Roberto Guerra
2009-10-16 15:55             ` Roberto Guerra
2009-10-16 16:18             ` 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).