Re: slow MMC over SPI

2008-06-02 Thread Fabio Tosetto

Hello,

I am trying to enable the SD over SPI on a emebedded system with one
processor powerpc mpc5200b; you have enabled mmc over spi into a native 
spi or psc spi?


regards,
Fabio

Andre Schwarz ha scritto:

All,

has anybody made some investigations about performance of a SD/MMC card
on SPI ?

Actually I'm using various cards (different speed classes) on an SPI bus
of a MPC8343 cpu.
Everything is working fine basically, i.e. card is detected properly and
block device can be mounted and used.

SPI clock is adjusted to the card's capabilities and is running quite
fast (>30MHz).

But between consecutive reads/writes there's a fixed gap of 2us thus
yielding a poor performance of approx. 300KBytes/sec.
The spi bus is utilized only ~10%.

Any ideas where this comes from ?
Ist it a fixed delay regarding to some kind of spec or is it possibly a
spi driver/mmc layer issue ?


regards,
Andre Schwarz

MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler  - Registergericht: 
Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev
.

  


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


SD-MMC over SPI on PSC6

2008-05-22 Thread Fabio Tosetto
Hello, I have an embedded system with an on-board processor powerpc 
MPC5200B

and Linux kernel 2.6.22,
I must turn over to MMC SPI on the PSC6.

The MMC over SPI is connected to MPC5200b, here's how:

 MPC5200B

  
| 
|--
PSC1_2 |--->Chip_Select (out)-|  
  
| |
  |
| SD CARD

ETH_17 |---SPI_TXD (out)---|
  | 
   |
  | 
   |

PSC6_3 |--->SPI_CLK (out)---|
  
| 
|--



Now on the menuconfig enabling these options:

$ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- menuconfig

Platform support  --->
  [*] MPC5200 (L25R) bugfix support
  [*] Freescale Lite5200 Eval Board

Device Drivers  ---> SPI Support --->
  [*] SPI support
 <*> Freescale MPC52xx PSC SPI controller

Now I have applied those patch:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg00150.html

Now on the menuconfig enabling these options:

$ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- menuconfig

Device Drivers  --->  MMC/SD card support --->
[*] MMC debugging
<*> MMC block device driver
<*> MMC host test driver
<*> MMC/SD over SPI

Is correct applied those patch and enable those options into menuconfig?

thanks Fabio
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: MPC5200b MMC over SPI into PSC6

2008-05-12 Thread Fabio Tosetto

Hello,

in uboot i have setting the bootargs variable:

=> bootargs debug console=ttyPSC0,115200 root=/dev/ram
=> saveenv

If I'm not wrong, the right sequence of commands should be the following:

$ make ARCH=powerpc mpc5200_defconfig
$ make ARCH=powerpc menuconfig
.. [customizations]...
$ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- cuImage.lite5200b

and this is the output:
..
 CHK include/linux/version.h
 CHK include/linux/utsrelease.h
 CALLscripts/checksyscalls.sh
 CHK include/linux/compile.h
 CALLarch/powerpc/kernel/systbl_chk.sh
 WRAParch/powerpc/boot/cuImage.lite5200b
DTC: dts->dtb  on file
"/home/ftosetto/linux-2.6.25.2-lite5200/arch/powerpc/boot/dts/lite5200b.dts"
Image Name:   Linux-2.6.25.2
Created:  Mon May  12 10:29:40 2008
Image Type:   PowerPC Linux Kernel Image (gzip compressed)
Data Size:1518744 Bytes = 1483.15 kB = 1.45 MB
Load Address: 0x0040
Entry Point:  0x00400550


At this point I've loaded the cuImage and rootfs.uimage on the board:

=> usb start
=> usb scan
=> fatload usb 0 0x0300 cuImage.lite5200b
=> fatload usb 0 0x0400 rootfs.uimage
=> bootm 0x0300 0x0400

but it still hangs after this:

## Booting image at 0300 
...   
  Image Name:   
Linux-2.6.25.2
  Created:  2008-05-12   7:39:07 
UTC  
  Image Type:   PowerPC Linux Kernel Image (gzip 
compressed)  
  Data Size:1589091 Bytes =  1.5 
MB   
  Load Address: 
0040  
  Entry Point:  
00400550  
  Verifying Checksum ... 
OK   
  Uncompressing Kernel Image ... 
OK   
## Loading RAMDisk Image at 0400 
...   
  Image Name:   RamDisk Image 
RadioNav
  Created:  2007-10-24  15:48:39 
UTC  
  Image Type:   PowerPC Linux RAMDisk Image (gzip 
compressed) 
  Data Size:1839123 Bytes =  1.8 
MB   
  Load Address: 
  
  Entry Point:  
  
  Verifying Checksum ... 
OK   
  Loading Ramdisk to 0fd89000, end 0ff4a013 ... 
OK
Memory <- <0x0 0x1000> 
(256MB) 
CPU clock-frequency <- 0xbcd3d80 
(198MHz)  
CPU timebase-frequency <- 0x1f78a40 
(33MHz)
CPU bus-frequency <- 0x7de2900 
(132MHz)
   

zImage starting: loaded at 0x0040 (sp: 
0x0ff4a958) 
Allocating 0x34d42c bytes for kernel 
...   
gunzipping (0x <- 0x0040d000:0x007510f0)...done 0x32d150 
bytes 
Using loader supplied ramdisk at 
0xfd89000-0xff4a013   
initrd head: 
0x1f8b0808
   


Linux/PowerPC load: debug console=ttyPSC0,115200 root=/dev/ram
Finalizing device tree... flat tree at 0x75e300

Where is the problem? The problem is the my rootfs.uimage?

Do you have any idea?
Best regards,
Fabio

Grant Likely ha scritto:

On Fri, May 9, 2008 at 9:02 AM, Fabri <[EMAIL PROTECTED]> wrote:
  

Thanks for the patches, now some more rows are printed after RamDisk loading:

  Verifying Checksum ... OK
  Loading Ramdisk to 0fe68000, end 0ff49bf2 ... OK
Memory <- <0x0 0x1000> (256MB)
CPU clock-frequency <- 0xbcd3d80 (198MHz)
CPU timebase-frequency <- 0x1f78a40 (33MHz)
CPU bus-frequency <- 0x7de2900 (132MHz)

zImage starting: loaded at 0x0040 (sp: 0x0ff4a958)
Allocating 0x32d410 bytes for kernel ...
gunzipping (0x <- 0x0040d000:0x00730fd4)...done 0x30d150 bytes
Using loader supplied ramdisk at 0xfe68000-0xff49bf2
initrd head: 0x1f8b0808

Linux/PowerPC load:


  ^^

Doesn't look like you are passing a kernel parameters line.  The
kernel probably is booting, but doesn't know where to output the
console.  Try adding "console=ttyPSC0,115200".

Cheers,
g.

  

  


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: MPC5200b MMC over SPI into PSC6

2008-05-08 Thread Fabio Tosetto
  

MMU:exit

setup_arch: 
enter  
setup_arch: 
bootmem
arch: 
exit 
[0.00] Linux version 2.6.24.4 ([EMAIL PROTECTED]) (gcc 
version 4.1
.2 (Sourcery G++ Lite 4.1-51)) #3 Thu May 8 16:03:21 CEST 
2008 
[0.00] Zone PFN 
ranges:
[0.00]   DMA 0 ->
65536 
[0.00]   Normal  65536 ->
65536 
[0.00] Movable zone start PFN for each 
node
[0.00] early_node_map[1] active PFN 
ranges 
[0.00] 0:0 ->
65536 
[0.00] Built 1 zonelists in Zone order, mobility grouping on.  
Total pag
es: 
65024  
[0.00] Kernel command 
line:
[0.00] PID hash table entries: 1024 (order: 10, 4096 
bytes)
[   91.768263] console [ttyPSC0] enabled  
...



Do you have any idea about how to make it working doing all the stuff 
with ARCH=powerpc?


Best regards,
Fabio



Grant Likely ha scritto:

On Wed, May 7, 2008 at 6:49 AM, Fabio Tosetto <[EMAIL PROTECTED]> wrote:
  

 I've tried to port my exesting configurations to the powerpc tree but some
configurations files are missing.



First, create a new .dts file for your board in arch/powerpc/boot/dts.
(just copy the lite5200.dts file).  Modify the .dts to have your
board's name (in the form ",") in the compatible
and model properties.

Next, add your boards name to the list of boards in
arch/powerpc/platforms/52xx/mpc5200_simple.c.

  

 I need to set PSC3 - PSC4 in uart mode:
 before in file *arch/ppc/platforms/lite5200.c* I added

 struct mpc52xx_psc_func mpc52xx_psc_functions[] = {
 {   .id = 3,
 .func   = "uart",
 },
 {   .id = 4,
 .func   = "uart",
 },
 {   .id = -1,   /* End entry */
 .func   = NULL,
 }
 };



Edit your boards .dts file and uncomment PSCs 3 and 4.  Comment out
PSC1 if you aren't using it.

  

 I need to set PSC4 as a low level debug: *
 *before in file  *arch/ppc/platforms/lite5200.h *I added

 #define MPC52xx_PF_CONSOLE_PORT 4/* PSC4 */



I don't think we have any early debug enabled yet in arch/powerpc for
the mpc5200.

  

 Finally I need to set  the virtual memory translation on a range of 128 MB:
 before in file *arch/ppc/kernel/head.S *I added

 /*orir11,r11,BL_128M<<2|0x2set up BAT registers for 604 */

 orir11,r11,BL_128M<<2|0x2/* set up BAT registers for 604 */

 could you please explain me how to do the same operations in powerpc tree??



New file is arch/powerpc/kernel/head_32.S.  I don't think that is the
cleanest way to do it though.  Why do you need to change the BAT
mapping from 256 to 128?

Cheers,
g.

  


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: MPC5200b MMC over SPI into PSC6

2008-05-07 Thread Fabio Tosetto
I've tried to port my exesting configurations to the powerpc tree but 
some configurations files are missing.


I need to set PSC3 - PSC4 in uart mode:
before in file *arch/ppc/platforms/lite5200.c* I added

struct mpc52xx_psc_func mpc52xx_psc_functions[] = {
   {   .id = 3,
   .func   = "uart",
   },
   {   .id = 4,
   .func   = "uart",
   },
   {   .id = -1,   /* End entry */
   .func   = NULL,
   }
};

I need to set PSC4 as a low level debug: *
*before in file  *arch/ppc/platforms/lite5200.h *I added

#define MPC52xx_PF_CONSOLE_PORT 4/* PSC4 */


Finally I need to set  the virtual memory translation on a range of 128 MB:
before in file *arch/ppc/kernel/head.S *I added

/*orir11,r11,BL_128M<<2|0x2set up BAT registers for 604 */

orir11,r11,BL_128M<<2|0x2/* set up BAT registers for 604 */

could you please explain me how to do the same operations in powerpc tree??

thanks Fabio

Grant Likely ha scritto:

On Mon, May 5, 2008 at 12:12 PM, Fabio Tosetto <[EMAIL PROTECTED]> wrote:
  

Hello, I have an embedded system with an on-board processor powerpc MPC5200B
 and Linux kernel 2.6.22,
 I must turn over to MMC SPI on the PSC6.

 First, I
 have enabled PSC6:

 in ../arch/ppc/platforms/lite5200.c added PSC6 in SPI mode



You're using arch/ppc which is depreciated.  You should move to using
arch/powerpc (set ARCH=powerpc when compiling).  Devices are then
enabled in the device tree source file
arch/powerpc/boot/dts/lite5200b.dts.

Many things have changed with MPC5200 support in the last year, you
should also use the latest kernel release (2.6.25.2 when it is
released.  If you use 2.6.25.1, then there is a trivial bug in the psc
serial port driver that you'll need to fix.  I'll include the link to
the patch below)

Cheers,
g.

http://ozlabs.org/pipermail/linuxppc-dev/2008-April/055495.html

  


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

MMC ove SPI PSC6 in MPC5200b

2008-05-05 Thread Fabio Tosetto

Hello,

I am trying to enable the SD over SPI on a emebedded system with one
processor powerpc mpc5200b,

has someone patches for the Linux 2.6.22 versions?

Thanks Fabio.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


MPC5200b MMC over SPI into PSC6

2008-05-05 Thread Fabio Tosetto
Hello, I have an embedded system with an on-board processor powerpc 
MPC5200B

and Linux kernel 2.6.22,
I must turn over to MMC SPI on the PSC6.

First, I
have enabled PSC6:

in ../arch/ppc/platforms/lite5200.c added PSC6 in SPI mode


struct mpc52xx_psc_func mpc52xx_psc_functions[] = {
{   .id = 3,

.func   = "uart",
},
{   .id = 4,

.func   = "uart",
},
{   .id = 5,

.func   = "spi",
},
};

in ..
/arch/powerpc/boot/dts/lite5200b.dts enabled PSC6 in SPI mode

  
// PSC6 in spi mode example

[EMAIL PROTECTED] { // PSC6
device_type = "spi";

compatible = "mpc5200b-psc-spi\0mpc5200-psc-spi";
cell-index = <5>;
reg =
<2c00 100>;
interrupts = <2 4 0>;
interrupt-parent = <&mpc5200_pic>;
};


Now on the menuconfig enabling these options:

$ make ARCH=powerpc
CROSS_COMPILE=powerpc-linux-gnu- menuconfig

Platform support  --->
   [*]
MPC5200 (L25R) bugfix support
   [*] Freescale Lite5200 Eval Board

Device
Drivers  ---> SPI Support --->
   [*] SPI support
  <*> Freescale MPC52xx
PSC SPI controller

this options settings the CONFIG_SPI_MPC52xx_PSC=y variable
into .config

When linux booting, if I debug ../driver/spi/mpc52xx_psc_spi.c,
see that:

bus platform: add driver mpc52xx-psc-
spi



bus platform: remove driver mpc52xx-psc-spi
drivers/spi/mpc52xx_psc_spi.c:
of_register_platform_driver failed (-19)

why??
any idea??

Someone knows how
to enable mmc over spi on PSC6?


thanks Fabio
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev