linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* MPC5200B MMC over SPI into PSC6
@ 2008-04-16 11:26 tosettofabio83
  0 siblings, 0 replies; 15+ messages in thread
From: tosettofabio83 @ 2008-04-16 11:26 UTC (permalink / raw)
  To: linuxppc-embedded

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
		spi@2c00 {		// 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 Tosetto

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

* MPC5200b MMC over SPI into PSC6
@ 2008-05-05 18:12 Fabio Tosetto
  2008-05-06 15:36 ` Grant Likely
  0 siblings, 1 reply; 15+ messages in thread
From: Fabio Tosetto @ 2008-05-05 18:12 UTC (permalink / raw)
  To: linuxppc-dev

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
spi@2c00 { // 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

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-05 18:12 MPC5200b MMC over SPI into PSC6 Fabio Tosetto
@ 2008-05-06 15:36 ` Grant Likely
  2008-05-07 12:49   ` Fabio Tosetto
  0 siblings, 1 reply; 15+ messages in thread
From: Grant Likely @ 2008-05-06 15:36 UTC (permalink / raw)
  To: Fabio Tosetto; +Cc: linuxppc-dev

On Mon, May 5, 2008 at 12:12 PM, Fabio Tosetto <tosettofabio83@libero.it> 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

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-06 15:36 ` Grant Likely
@ 2008-05-07 12:49   ` Fabio Tosetto
  2008-05-07 16:34     ` Grant Likely
  0 siblings, 1 reply; 15+ messages in thread
From: Fabio Tosetto @ 2008-05-07 12:49 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 2001 bytes --]

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

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

ori    r11,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 <tosettofabio83@libero.it> 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
>
>   


[-- Attachment #2: Type: text/html, Size: 3552 bytes --]

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-07 12:49   ` Fabio Tosetto
@ 2008-05-07 16:34     ` Grant Likely
  2008-05-08 15:10       ` Fabio Tosetto
  0 siblings, 1 reply; 15+ messages in thread
From: Grant Likely @ 2008-05-07 16:34 UTC (permalink / raw)
  To: Fabio Tosetto; +Cc: linuxppc-dev

On Wed, May 7, 2008 at 6:49 AM, Fabio Tosetto <tosettofabio83@libero.it> 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 "<vendor>,<boardname>") 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
>
>  /*ori    r11,r11,BL_128M<<2|0x2    set up BAT registers for 604 */
>
>  ori    r11,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.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-07 16:34     ` Grant Likely
@ 2008-05-08 15:10       ` Fabio Tosetto
  2008-05-08 15:32         ` Grant Likely
  0 siblings, 1 reply; 15+ messages in thread
From: Fabio Tosetto @ 2008-05-08 15:10 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev

Ok, maybe it's better to start from the beginning.
Now I'm using a Lite5200b board, just to avoid problems with my 
hardware, and I'm trying to have a bootable kernel.

With kernel version 2.6.24.6 I do the following commands

$ make ARCH=powerpc lite5200_defconfig
$ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- uImage

then I copy the arch/powerpc/boot/uImage and a rootfs.uimage on the 
board, but uBoot stops at the beginning:

============================================
U-Boot 1.3.0-g98e2867c-dirty (Feb  7 2008 - 
13:26:28)                          
                                                                                

CPU:   MPC5200B v2.2, Core v1.4 at 198 
MHz                                     
       Bus 132 MHz, IPB 132 MHz, PCI 33 
MHz                                    
Board: Freescale 
Lite5200B                                                     
I2C:   85 kHz, 
ready                                                           
DRAM:  256 
MB                                                                  
FLASH: 32 
MB                                                                   
PCI:   Bus Dev VenId DevId Class 
Int                                           
        00  1a  1057  5809  0680  
00                                           
In:    
serial                                                                  
Out:   
serial                                                                  
Err:   
serial                                                                  
Net:   FEC 
ETHERNET                                                            
IDE:   Bus 0: 
OK                                                               
  Device 0: not 
available                                                      
  Device 1: not 
available                                                      
                                                                                

Type "run flash_nfs" to mount root filesystem over 
NFS                         
                                                                                

Hit any key to stop autoboot:  
0                                               
=>

=> usb 
start                                                                   
(Re)start 
USB...                                                               
USB:   scanning bus for devices... 2 USB Device(s) 
found                       
       scanning bus for storage devices... 1 Storage Device(s) 
found           
=> usb 
scan                                                                    
  NOTE: this command is obsolete and will be phased 
out                        
  please use 'usb storage' for USB storage devices 
information                 
                                                                                

  Device 0: Vendor: USB 2.0  Prod.: Flash Disk       Rev: 
0.00                 
            Type: Removable Hard 
Disk                                          
            Capacity: 963.9 MB = 0.9 GB (1974271 x 
512)                        
=> fatload usb 0 0x03000000 
uImage                                             
reading 
uImage                                                                 
................................................................................
..........................                                                      

                                                                                

1091680 bytes 
read                                                             
=> fatload usb 0 0x04000000 
rootfs.uimage                                      
reading 
rootfs.uimage                                                          
................................................................................
.......... 
924722 bytes read
=> bootm 0x03000000 0x04000000

---------------------
## Booting image at 03000000 
...                                               
   Image Name:   
Linux-2.6.24.4                                                
   Created:      2008-05-08  14:21:24 
UTC                                      
   Image Type:   PowerPC Linux Kernel Image (gzip 
compressed)                  
   Data Size:    1091616 Bytes =  1 
MB                                         
   Load Address: 
00000000                                                      
   Entry Point:  
00000000                                                      
   Verifying Checksum ... 
OK                                                   
   Uncompressing Kernel Image ... 
OK                                           
## Loading RAMDisk Image at 04000000 
...                                       
   Image Name:   RamDisk Image 
RadioNav                                        
   Created:      2007-12-14  16:18:56 
UTC                                      
   Image Type:   PowerPC Linux RAMDisk Image (gzip 
compressed)                 
   Data Size:    924658 Bytes = 903 
kB                                         
   Load Address: 
00000000                                                      
   Entry Point:  
00000000                                                      
   Verifying Checksum ... 
OK                                                   
   Loading Ramdisk to 0fe68000, end 0ff49bf2 ... OK
============================================


So I tried using the deprecated ppc

$ make ARCH=ppc lite5200_defconfig
$ make ARCH=ppc CROSS_COMPILE=powerpc-linux-gnu- uImage

It still doesn't work, but it goes a little further:

=> bootm 0x03000000 
0x04000000                                                 
## Booting image at 03000000 
...                                               
   Image Name:   
Linux-2.6.24.6                                                
   Created:      2008-05-08  14:39:04 
UTC                                      
   Image Type:   PowerPC Linux Kernel Image (gzip 
compressed)                  
   Data Size:    776322 Bytes = 758.1 
kB                                       
   Load Address: 
00000000                                                      
   Entry Point:  
00000000                                                      
   Verifying Checksum ... 
OK                                                   
   Uncompressing Kernel Image ... 
OK                                           
## Loading RAMDisk Image at 04000000 
...                                       
   Image Name:   RamDisk Image 
RadioNav                                        
   Created:      2007-12-14  16:18:56 
UTC                                      
   Image Type:   PowerPC Linux RAMDisk Image (gzip 
compressed)                 
   Data Size:    924658 Bytes = 903 
kB                                         
   Load Address: 
00000000                                                      
   Entry Point:  
00000000                                                      
   Verifying Checksum ... 
OK                                                   
   Loading Ramdisk to 0fe68000, end 0ff49bf2 ... 
OK                            
id mach(): 
done                                                                
MMU:enter                                                                       

MMU:hw 
init                                                                    
MMU:mapin                                                                       

MMU:setio                                                                       

MMU:exit                                                                        

setup_arch: 
enter                                                              
setup_arch: 
bootmem                                                            
arch: exit

============================================

The only way I was able to get something working, even though it sounds 
a little strange to me, is loading the config from powerpc folder but 
compiling in ppc

$ make ARCH=powerpc lite5200_defconfig
$ make ARCH=ppc CROSS_COMPILE=powerpc-linux-gnu- uImage


=> bootm 0x03000000 
0x04000000                                                 
## Booting image at 03000000 
...                                               
   Image Name:   
Linux-2.6.24.4                                                
   Created:      2008-05-08  14:03:26 
UTC                                      
   Image Type:   PowerPC Linux Kernel Image (gzip 
compressed)                  
   Data Size:    1073349 Bytes =  1 
MB                                         
   Load Address: 
00000000                                                      
   Entry Point:  
00000000                                                      
   Verifying Checksum ... 
OK                                                   
   Uncompressing Kernel Image ... 
OK                                           
## Loading RAMDisk Image at 04000000 
...                                       
   Image Name:   RamDisk Image 
RadioNav                                        
   Created:      2007-12-14  16:18:56 
UTC                                      
   Image Type:   PowerPC Linux RAMDisk Image (gzip 
compressed)                 
   Data Size:    924658 Bytes = 903 
kB                                         
   Load Address: 
00000000                                                      
   Entry Point:  
00000000                                                      
   Verifying Checksum ... 
OK                                                   
   Loading Ramdisk to 0fe68000, end 0ff49bf2 ... 
OK                            
id mach(): 
done                                                                
MMU:enter                                                                       

MMU:hw 
init                                                                    
MMU:mapin                                                                       

MMU:setio                                                                       

MMU:exit                                                                        

setup_arch: 
enter                                                              
setup_arch: 
bootmem                                                            
arch: 
exit                                                                     
[    0.000000] Linux version 2.6.24.4 (ftosetto@osstlab-build1) (gcc 
version 4.1
.2 (Sourcery G++ Lite 4.1-51)) #3 Thu May 8 16:03:21 CEST 
2008                 
[    0.000000] Zone PFN 
ranges:                                                
[    0.000000]   DMA             0 ->    
65536                                 
[    0.000000]   Normal      65536 ->    
65536                                 
[    0.000000] Movable zone start PFN for each 
node                            
[    0.000000] early_node_map[1] active PFN 
ranges                             
[    0.000000]     0:        0 ->    
65536                                     
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  
Total pag
es: 
65024                                                                      
[    0.000000] Kernel command 
line:                                            
[    0.000000] 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 <tosettofabio83@libero.it> 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 "<vendor>,<boardname>") 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
>>
>>  /*ori    r11,r11,BL_128M<<2|0x2    set up BAT registers for 604 */
>>
>>  ori    r11,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.
>
>   

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-08 15:10       ` Fabio Tosetto
@ 2008-05-08 15:32         ` Grant Likely
  2008-05-09 13:40           ` Fabri
  0 siblings, 1 reply; 15+ messages in thread
From: Grant Likely @ 2008-05-08 15:32 UTC (permalink / raw)
  To: Fabio Tosetto; +Cc: linuxppc-dev

On Thu, May 8, 2008 at 9:10 AM, Fabio Tosetto <tosettofabio83@libero.it> wrote:
> Ok, maybe it's better to start from the beginning.
>  Now I'm using a Lite5200b board, just to avoid problems with my hardware,
> and I'm trying to have a bootable kernel.
>
>  With kernel version 2.6.24.6 I do the following commands
>
>  $ make ARCH=powerpc lite5200_defconfig
>  $ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- uImage
>
>  then I copy the arch/powerpc/boot/uImage and a rootfs.uimage on the board,
> but uBoot stops at the beginning:

Right; some concepts need to be explained now...  There is a major
difference between arch/ppc and arch/powerpc.  In arch/ppc, the kernel
is hard coded with the list of devices in the system.  In
arch/powerpc, the list of devices is captured in a data structure
called the Flattened Device Tree (FDT).  fdt data structures are
generated from the .dts (device tree source) files in
arch/powerpc/boot/dts/.

When you build a uImage with arch/ppc, you get a hard coded kernel
that works with u-boot:  "bootm <kernel_addr> <ramdisk_addr>"

When you build a uImage with arch/powerpc, you get a dynamic kernel
that needs to be passed the device tree blob on boot.  Newer u-boot
supports dts booting: "bootm <kernel_addr> <ramdisk_addr> <dt_addr>"
or "bootm <kernel_addr> - <dt_addr>" if you're not using a ramdisk.

However, if you've got an older u-boot version installed on your
board, you need to create an image that binds the device tree into the
kernel image.  This is called a "cuImage".  So, instead of doing "make
ARCH=powerpc uImage", you should do "make ARCH=powerpc
cuImage.<boardname>".  This 'wraps' the kernel with a boot wrapper
that includes the device tree blob but maintains compatibility with
the old style uImage format.

For example, use "make ARCH=powerpc cuImage.lite5200b" to build an
image for the lite5200b board.  The build scripts will use the
lite5200b.dts file in the dts directory for building the image.  If
you add "fabios-fantastic-board.dts" to arch/powerpc/boot/dts, then
you can build "cuImage.fabios-fantastic-board".  :-)

>  The only way I was able to get something working, even though it sounds a
> little strange to me, is loading the config from powerpc folder but
> compiling in ppc
>
>  $ make ARCH=powerpc lite5200_defconfig
>  $ make ARCH=ppc CROSS_COMPILE=powerpc-linux-gnu- uImage

ARCH=ppc and ARCH=powerpc are completely different beasts.  Forget
that you even know about ARCH=ppc for this entire exercise.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-08 15:32         ` Grant Likely
@ 2008-05-09 13:40           ` Fabri
  2008-05-09 13:51             ` Fabri
  0 siblings, 1 reply; 15+ messages in thread
From: Fabri @ 2008-05-09 13:40 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Fabio Tosetto

Hello!
I've seen you guys are playing with a Lite5200b board, so I've decided
to do another attempt with mine.

On Thu, May 8, 2008 at 5:32 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> For example, use "make ARCH=powerpc cuImage.lite5200b" to build an
> image for the lite5200b board.  The build scripts will use the
> lite5200b.dts file in the dts directory for building the image.

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
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  CALL    arch/powerpc/kernel/systbl_chk.sh
  WRAP    arch/powerpc/boot/cuImage.lite5200b
DTC: dts->dtb  on file
"/home/fgaretto/linux-2.6.25.2-lite5200/arch/powerpc/boot/dts/lite5200b.dts"
Image Name:   Linux-2.6.25.2
Created:      Fri May  9 14:46:22 2008
Image Type:   PowerPC Linux Kernel Image (gzip compressed)
Data Size:    1518744 Bytes = 1483.15 kB = 1.45 MB
Load Address: 0x00400000
Entry Point:  0x00400550

At this point I've loaded the cuImage and rootfs.uimage on the board:
=> usb start
=> usb scan
=> fatload usb 0 0x03000000 cuImage.lite5200b
=> fatload usb 0 0x04000000 rootfs.uimage
=> bootm 0x03000000 0x04000000

but it still hangs after this:

## Booting image at 03000000 ...
   Image Name:   RadioNav-Linux 2.6.22.1
   Created:      2008-05-09  13:11:43 UTC
   Image Type:   PowerPC Linux Kernel Image (uncompressed)
   Data Size:    1518808 Bytes =  1.4 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
OK
## Loading RAMDisk Image at 04000000 ...
   Image Name:   RamDisk Image Lite5200b
   Created:      2008-03-04  11:28:40 UTC
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    1135278 Bytes = 1109 kB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Ramdisk to 0fe68000, end 0ff7d2ae ... OK


I've looked at Load Address and Entry Point of the cuImage and it
sounds a little strange to me that these values are not zero, so I've
manually changed them both to  0x00000000 using mkimage, but the
result is always the same: no boot at all.

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-09 13:40           ` Fabri
@ 2008-05-09 13:51             ` Fabri
  2008-05-09 14:06               ` Grant Likely
  0 siblings, 1 reply; 15+ messages in thread
From: Fabri @ 2008-05-09 13:51 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Fabio Tosetto

Errage corrige: Excuse me, bad cut and paste :)
This is the right output of the first try

## Booting image at 03000000 ...
   Image Name:   Linux-2.6.25.2
   Created:      2008-05-09  12:46:22 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1518744 Bytes =  1.4 MB
   Load Address: 00400000
   Entry Point:  00400550
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at 04000000 ...
  Image Name:   RamDisk Image Lite5200b
  Created:      2008-03-04  11:28:40 UTC
  Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
  Data Size:    1135278 Bytes = 1109 kB
  Load Address: 00000000
  Entry Point:  00000000
  Verifying Checksum ... OK
  Loading Ramdisk to 0fe68000, end 0ff7d2ae ... OK

By the way, Grant, you seem to be very expert in making a kernel with
ARCH=powerpc. Can you tell me how to find some docs to improve my
knowledge in this field? I've found something interesting in
Documentation/powerpc, but they are not too explicative about the
differences between PPC/Powerpc building, and about how to make the
last one.

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-09 13:51             ` Fabri
@ 2008-05-09 14:06               ` Grant Likely
  2008-05-09 15:02                 ` Fabri
  0 siblings, 1 reply; 15+ messages in thread
From: Grant Likely @ 2008-05-09 14:06 UTC (permalink / raw)
  To: Fabri; +Cc: linuxppc-dev, Fabio Tosetto

See if this patch makes any difference for you:

diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite520
index 8505e97..70d9a8e 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -342,4 +342,8 @@
                          0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
                          0x01000000 0 0x00000000 0xb0000000 0 0x01000000>;
        };
+
+       chosen {
+               linux,stdout-path = "/soc5200@f0000000/serial@2000";
+       };
 };


Oh, and the fix I told you about (fixing the unterminated list) didn't
make it into 2.6.25.2.  You still need to manually apply it.  It
should be in 2.6.25.3.

Cheers,
g.

On Fri, May 9, 2008 at 7:51 AM, Fabri <rider4ever@gmail.com> wrote:
> Errage corrige: Excuse me, bad cut and paste :)
> This is the right output of the first try
>
> ## Booting image at 03000000 ...
>   Image Name:   Linux-2.6.25.2
>   Created:      2008-05-09  12:46:22 UTC
>   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>   Data Size:    1518744 Bytes =  1.4 MB
>   Load Address: 00400000
>   Entry Point:  00400550
>   Verifying Checksum ... OK
>   Uncompressing Kernel Image ... OK
> ## Loading RAMDisk Image at 04000000 ...
>  Image Name:   RamDisk Image Lite5200b
>  Created:      2008-03-04  11:28:40 UTC
>  Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
>  Data Size:    1135278 Bytes = 1109 kB
>  Load Address: 00000000
>  Entry Point:  00000000
>  Verifying Checksum ... OK
>  Loading Ramdisk to 0fe68000, end 0ff7d2ae ... OK
>
> By the way, Grant, you seem to be very expert in making a kernel with
> ARCH=powerpc. Can you tell me how to find some docs to improve my
> knowledge in this field? I've found something interesting in
> Documentation/powerpc, but they are not too explicative about the
> differences between PPC/Powerpc building, and about how to make the
> last one.
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-09 14:06               ` Grant Likely
@ 2008-05-09 15:02                 ` Fabri
  2008-05-09 15:20                   ` Grant Likely
  0 siblings, 1 reply; 15+ messages in thread
From: Fabri @ 2008-05-09 15:02 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Fabio Tosetto

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 0x10000000> (256MB)
CPU clock-frequency <- 0xbcd3d80 (198MHz)
CPU timebase-frequency <- 0x1f78a40 (33MHz)
CPU bus-frequency <- 0x7de2900 (132MHz)

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

Linux/PowerPC load:
Finalizing device tree... flat tree at 0x73d300

-----------------------------------------------------------------------------------------------------

and then it stops. Maybe are there some problems related to my rootfs.uimage?

On Fri, May 9, 2008 at 4:06 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> See if this patch makes any difference for you:
>
> diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite520
> index 8505e97..70d9a8e 100644
> --- a/arch/powerpc/boot/dts/lite5200b.dts
> +++ b/arch/powerpc/boot/dts/lite5200b.dts
> @@ -342,4 +342,8 @@
>                          0x02000000 0 0xa0000000 0xa0000000 0 0x10000000
>                          0x01000000 0 0x00000000 0xb0000000 0 0x01000000>;
>        };
> +
> +       chosen {
> +               linux,stdout-path = "/soc5200@f0000000/serial@2000";
> +       };
>  };
>
>
> Oh, and the fix I told you about (fixing the unterminated list) didn't
> make it into 2.6.25.2.  You still need to manually apply it.  It
> should be in 2.6.25.3.
>
> Cheers,
> g.
>
> On Fri, May 9, 2008 at 7:51 AM, Fabri <rider4ever@gmail.com> wrote:
>> Errage corrige: Excuse me, bad cut and paste :)
>> This is the right output of the first try
>>
>> ## Booting image at 03000000 ...
>>   Image Name:   Linux-2.6.25.2
>>   Created:      2008-05-09  12:46:22 UTC
>>   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>>   Data Size:    1518744 Bytes =  1.4 MB
>>   Load Address: 00400000
>>   Entry Point:  00400550
>>   Verifying Checksum ... OK
>>   Uncompressing Kernel Image ... OK
>> ## Loading RAMDisk Image at 04000000 ...
>>  Image Name:   RamDisk Image Lite5200b
>>  Created:      2008-03-04  11:28:40 UTC
>>  Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
>>  Data Size:    1135278 Bytes = 1109 kB
>>  Load Address: 00000000
>>  Entry Point:  00000000
>>  Verifying Checksum ... OK
>>  Loading Ramdisk to 0fe68000, end 0ff7d2ae ... OK
>>
>> By the way, Grant, you seem to be very expert in making a kernel with
>> ARCH=powerpc. Can you tell me how to find some docs to improve my
>> knowledge in this field? I've found something interesting in
>> Documentation/powerpc, but they are not too explicative about the
>> differences between PPC/Powerpc building, and about how to make the
>> last one.
>>
>
>
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-09 15:02                 ` Fabri
@ 2008-05-09 15:20                   ` Grant Likely
  2008-05-09 20:01                     ` Fabri
                                       ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Grant Likely @ 2008-05-09 15:20 UTC (permalink / raw)
  To: Fabri; +Cc: linuxppc-dev, Fabio Tosetto

On Fri, May 9, 2008 at 9:02 AM, Fabri <rider4ever@gmail.com> 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 0x10000000> (256MB)
> CPU clock-frequency <- 0xbcd3d80 (198MHz)
> CPU timebase-frequency <- 0x1f78a40 (33MHz)
> CPU bus-frequency <- 0x7de2900 (132MHz)
>
> zImage starting: loaded at 0x00400000 (sp: 0x0ff4a958)
> Allocating 0x32d410 bytes for kernel ...
> gunzipping (0x00000000 <- 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.

>

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-09 15:20                   ` Grant Likely
@ 2008-05-09 20:01                     ` Fabri
  2008-05-12  8:51                     ` Fabio Tosetto
  2008-05-22 14:28                     ` Fabri
  2 siblings, 0 replies; 15+ messages in thread
From: Fabri @ 2008-05-09 20:01 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Fabio Tosetto

Nice to hear that, next week I'll try and let you know.

Thank you again for your support,
Fabrizio

On Fri, May 9, 2008 at 5:20 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Fri, May 9, 2008 at 9:02 AM, Fabri <rider4ever@gmail.com> 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 0x10000000> (256MB)
>> CPU clock-frequency <- 0xbcd3d80 (198MHz)
>> CPU timebase-frequency <- 0x1f78a40 (33MHz)
>> CPU bus-frequency <- 0x7de2900 (132MHz)
>>
>> zImage starting: loaded at 0x00400000 (sp: 0x0ff4a958)
>> Allocating 0x32d410 bytes for kernel ...
>> gunzipping (0x00000000 <- 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.
>
>>
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-09 15:20                   ` Grant Likely
  2008-05-09 20:01                     ` Fabri
@ 2008-05-12  8:51                     ` Fabio Tosetto
  2008-05-22 14:28                     ` Fabri
  2 siblings, 0 replies; 15+ messages in thread
From: Fabio Tosetto @ 2008-05-12  8:51 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Fabri

[-- Attachment #1: Type: text/plain, Size: 4762 bytes --]

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
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  CALL    arch/powerpc/kernel/systbl_chk.sh
  WRAP    arch/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: 0x00400000
Entry Point:  0x00400550


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

=> usb start
=> usb scan
=> fatload usb 0 0x03000000 cuImage.lite5200b
=> fatload usb 0 0x04000000 rootfs.uimage
=> bootm 0x03000000 0x04000000

but it still hangs after this:

## Booting image at 03000000 
...                                               
   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: 
00400000                                                      
   Entry Point:  
00400550                                                      
   Verifying Checksum ... 
OK                                                   
   Uncompressing Kernel Image ... 
OK                                           
## Loading RAMDisk Image at 04000000 
...                                       
   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: 
00000000                                                      
   Entry Point:  
00000000                                                      
   Verifying Checksum ... 
OK                                                   
   Loading Ramdisk to 0fd89000, end 0ff4a013 ... 
OK                            
Memory <- <0x0 0x10000000> 
(256MB)                                             
CPU clock-frequency <- 0xbcd3d80 
(198MHz)                                      
CPU timebase-frequency <- 0x1f78a40 
(33MHz)                                    
CPU bus-frequency <- 0x7de2900 
(132MHz)                                        
                                                                                

zImage starting: loaded at 0x00400000 (sp: 
0x0ff4a958)                         
Allocating 0x34d42c bytes for kernel 
...                                       
gunzipping (0x00000000 <- 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 <rider4ever@gmail.com> 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 0x10000000> (256MB)
>> CPU clock-frequency <- 0xbcd3d80 (198MHz)
>> CPU timebase-frequency <- 0x1f78a40 (33MHz)
>> CPU bus-frequency <- 0x7de2900 (132MHz)
>>
>> zImage starting: loaded at 0x00400000 (sp: 0x0ff4a958)
>> Allocating 0x32d410 bytes for kernel ...
>> gunzipping (0x00000000 <- 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.
>
>   
>
>   


[-- Attachment #2: Type: text/html, Size: 12231 bytes --]

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

* Re: MPC5200b MMC over SPI into PSC6
  2008-05-09 15:20                   ` Grant Likely
  2008-05-09 20:01                     ` Fabri
  2008-05-12  8:51                     ` Fabio Tosetto
@ 2008-05-22 14:28                     ` Fabri
  2 siblings, 0 replies; 15+ messages in thread
From: Fabri @ 2008-05-22 14:28 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, Fabio Tosetto

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

Hi Grant,
I've tried to add that with this commands

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

but the result is not so different. It still stops after printing these lines

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

What should I see after that, in case of successful boot?
Thanks for your help.

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

end of thread, other threads:[~2008-05-22 14:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-05 18:12 MPC5200b MMC over SPI into PSC6 Fabio Tosetto
2008-05-06 15:36 ` Grant Likely
2008-05-07 12:49   ` Fabio Tosetto
2008-05-07 16:34     ` Grant Likely
2008-05-08 15:10       ` Fabio Tosetto
2008-05-08 15:32         ` Grant Likely
2008-05-09 13:40           ` Fabri
2008-05-09 13:51             ` Fabri
2008-05-09 14:06               ` Grant Likely
2008-05-09 15:02                 ` Fabri
2008-05-09 15:20                   ` Grant Likely
2008-05-09 20:01                     ` Fabri
2008-05-12  8:51                     ` Fabio Tosetto
2008-05-22 14:28                     ` Fabri
  -- strict thread matches above, loose matches on Subject: below --
2008-04-16 11:26 MPC5200B " tosettofabio83

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