re :PCI support on the ML310 (Linux 2.4/2.6)

Huang, Bin bhuang2 at uncc.edu
Wed Aug 6 02:48:29 EST 2008


As far as I know, only MVista has complete PCI support for ML310. I have  
been migrating their PCI stuff to 2.6 kernel for couple of months so I might  
understand what you are suffering here. 

If your system hangs just after "Xilinx ML310 Board-Specific  
Initialization:", then probably there is something wrong with your OPB-PCI  
core on virtex-2 FPGA. I highly recommend you double check the value of  
"C_BRIDGE_IDSEL_ADDR_BIT" within your system.mhs file. 

When the 2.4/2.6 kernel tries to initialize pci core, it has to do self- 
configuration first. If the wrong address is assigned in pci_init(), then  
the kernel could not proceed any more. 

Here is what you need to take care of: 

for C_BRIDGE_IDSEL_ADDR_BIT = 24, use 
pci_init()
{
    /* self-configuration */
    WR32(PCI_CONFIG_ADDR, htole32(0x80004004)); // address
    WR32(PCI_CONFIG_DATA, htole32(0xffff0147)); // data
    /* max latency timer on bridge */
    WR32(PCI_CONFIG_ADDR, htole32(0x8000400c)); // address
    WR32(PCI_CONFIG_DATA, htole32(0x0000ff00)); // data
    /* max bus number */
    WR32(PCI_CONFIG_ADDR+8, htole32(0xff000000));
};

for C_BRIDGE_IDSEL_ADDR_BIT = 16, use 
pci_init()
{
    /* self-configuration */
    WR32(PCI_CONFIG_ADDR, htole32(0x80000004)); // address
    WR32(PCI_CONFIG_DATA, htole32(0xffff0147)); // data
    /* max latency timer on bridge */
    WR32(PCI_CONFIG_ADDR, htole32(0x8000000c)); // address
    WR32(PCI_CONFIG_DATA, htole32(0x0000ff00)); // data
    /* max bus number */
    WR32(PCI_CONFIG_ADDR+8, htole32(0xff000000));
};

You may check Xilinx's user guide 241 for more details. 

Porting BSP from EDK9.1 to MVista 2.4 should be quite straightforward, but  
porting them to 2.6 virtex is a little bit vague. If you are trying to use IDE  
southbridge, I could recommend you start from 2.6.10 rather than 2.6 virtex  
because driver/ide/pci/alim15x3.c has been updated a lot and I  
hate to say that a none-disclosure agreement on alim15x3 makes it time consuming  
to understand super I/O on ml310. If you just need PCI bus function, then life
will much more easier but you still need be care of about opb-pci core parameters

Bin





-----Original Message-----
From: linuxppc-embedded-bounces+bhuang2=uncc.edu at ozlabs.org 代表 linuxppc-embedded-request at ozlabs.org
Sent: 8/4/2008 (星期一) 22:00
To: linuxppc-embedded at ozlabs.org
Subject: Linuxppc-embedded Digest, Vol 48, Issue 5
 
Send Linuxppc-embedded mailing list submissions to
	linuxppc-embedded at ozlabs.org

To subscribe or unsubscribe via the World Wide Web, visit
	https://ozlabs.org/mailman/listinfo/linuxppc-embedded
or, via email, send a message with subject or body 'help' to
	linuxppc-embedded-request at ozlabs.org

You can reach the person managing the list at
	linuxppc-embedded-owner at ozlabs.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linuxppc-embedded digest..."


Today's Topics:

   1. PCI support on the ML310 (Linux 2.4/2.6) (Juliana Su)
   2. Re: Creating a wrapped zImage.initrd -- can't start the
      trampoline? (Grant Likely)
   3. Re: suffisant space for U-Boot,	Linux and an initrd image ?
      (4MB SDRAM) (Wolfgang Denk)


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

Message: 1
Date: Mon, 04 Aug 2008 16:08:33 -0400
From: Juliana Su <js084 at bucknell.edu>
Subject: PCI support on the ML310 (Linux 2.4/2.6)
To: linuxppc-embedded at ozlabs.org
Message-ID: <489761C1.8030805 at bucknell.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi,

I am trying to get PCI support on the ML310. I was able to port Linux 
2.6 (linux-2.6-virtex from Secret Lab) onto the board, but unfortunately 
there is no PCI support in the kernel. When I enabled PCI support, I got 
the same errors (see below) that were reported on the Secret Lab Wiki.


  CC      arch/ppc/syslib/ppc4xx_setup.o
arch/ppc/syslib/ppc4xx_setup.c: In function `ppc4xx_map_io':
arch/ppc/syslib/ppc4xx_setup.c:118: error: `PPC4xx_PCI_IO_VADDR' 
undeclared (first use in this function)
arch/ppc/syslib/ppc4xx_setup.c:118: error: (Each undeclared identifier 
is reported only once
arch/ppc/syslib/ppc4xx_setup.c:118: error: for each function it appears in.)
arch/ppc/syslib/ppc4xx_setup.c:119: error: `PPC4xx_PCI_IO_PADDR' 
undeclared (first use in this function)
arch/ppc/syslib/ppc4xx_setup.c:119: error: `PPC4xx_PCI_IO_SIZE' 
undeclared (first use in this function)
arch/ppc/syslib/ppc4xx_setup.c:120: error: `PPC4xx_PCI_CFG_VADDR' 
undeclared (first use in this function)
arch/ppc/syslib/ppc4xx_setup.c:121: error: `PPC4xx_PCI_CFG_PADDR' 
undeclared (first use in this function)
arch/ppc/syslib/ppc4xx_setup.c:121: error: `PPC4xx_PCI_CFG_SIZE' 
undeclared (first use in this function)
arch/ppc/syslib/ppc4xx_setup.c:122: error: `PPC4xx_PCI_LCFG_VADDR' 
undeclared (first use in this function)
arch/ppc/syslib/ppc4xx_setup.c:123: error: `PPC4xx_PCI_LCFG_PADDR' 
undeclared (first use in this function)
arch/ppc/syslib/ppc4xx_setup.c:123: error: `PPC4xx_PCI_LCFG_SIZE' 
undeclared (first use in this function)
make[1]: *** [arch/ppc/syslib/ppc4xx_setup.o] Error 1
make: *** [arch/ppc/syslib] Error 2


I went back to Linux 2.4 (v2.4.20_mvl31-ml300), but the system hangs 
during ml310_init( ), specifically when it gets to pci_init( ), in 
ml310.c. I put some print statements in ml310.c to debug and found out 
that it gets pass the first two lines in pci_init( ) before hanging. 
Basically, all I get on my screen is:


Xilinx ML310 Board-Specific Initialization:


ml310_init( ) looks like this:


void
ml310_init()
{
    prints("\n\n");
    prints("Xilinx ML310 Board-Specific Initialization:\n");
    prints("\n");


    pci_init();
    ppb_init(9);
    pci_scan();
    sio_init();
    sbr_init();
};


and pci_init( ) looks like this:


void
pci_init()
{
    /* self-configuration */
    WR32(PCI_CONFIG_ADDR, htole32(0x80004004)); // address
    WR32(PCI_CONFIG_DATA, htole32(0xffff0147)); // data
    /* max latency timer on bridge */
    WR32(PCI_CONFIG_ADDR, htole32(0x8000400c)); // address
    WR32(PCI_CONFIG_DATA, htole32(0x0000ff00)); // data
    /* max bus number */
    WR32(PCI_CONFIG_ADDR+8, htole32(0xff000000));
};


ml310.c was generated when I made the BSP in Xilinx EDK 9.1. I copied 
it, along with the other files from the BSP, into the kernel source. I 
am using a Crosstool cross-compiler, gcc-3.4.1-glibc-2.3.3. I have also 
tried the linuxppc-2.4 and mvistappc_2_4_devel kernels from 
source.mvista.com, but those both crashed with similar (and several) 
errors concerning ide-taskfile.c during compilation.

Is anybody aware of how to manually map the PCI constants in 2.6 and 
willing to help me map them? Does anybody have an idea why pci_init( ) 
is getting stuck? Any suggestions, in general, would be greatly appreciated.

Let me know if I need to provide more information or code. Thanks!


-Juliana



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

Message: 2
Date: Mon, 4 Aug 2008 15:30:07 -0600
From: "Grant Likely" <grant.likely at secretlab.ca>
Subject: Re: Creating a wrapped zImage.initrd -- can't start the
	trampoline?
To: paul at mad-scientist.us
Cc: Linuxppc-embedded at ozlabs.org
Message-ID:
	<fa686aa40808041430q2d81f2a9i600e9ae17f658d01 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Aug 4, 2008 at 1:43 PM, Paul Smith <paul at mad-scientist.us> wrote:
> On Mon, 2008-08-04 at 11:25 -0600, Grant Likely wrote:
>> Take a look at Documentation/powerpc/bootwrapper.txt
>> You probably want the 'simpleImage.%' target.  It also binds in a copy
>> of the device tree blob.
>
> Hm.  I'm using 2.6.25.14 and I don't see any bootwrapper.txt file in
> Documentation/powerpc (or anywhere else).  I also can't see any target
> simpleImage in any makefile.  Is this something new in 2.6.26?  :-(
>
> Any help for folks still using 2.6.25?

It's new in .26, but it is relevant for .25 also.

Here's a link to it:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/powerpc/bootwrapper.txt;h=d60fced5e1cc69169d9bbf1b49faacb41ef8db9c;hb=8f616cd5249e03c9e1b371623d85e76d4b86bbc1

> I think I need some basic instruction on how bootloaders etc. work, with
> a concentration on embedded PPC if possible.  Anyone have any pointers
> that would be worth investigating?

The document above should help.
Documentation/powerpc/booting-without-of.txt has some useful
information also.

g.

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


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

Message: 3
Date: Tue, 05 Aug 2008 00:59:57 +0200
From: Wolfgang Denk <wd at denx.de>
Subject: Re: suffisant space for U-Boot,	Linux and an initrd image ?
	(4MB SDRAM)
To: Fabien Oriede <fabien.oriede at yahoo.fr>
Cc: linuxppc-embedded at ozlabs.org
Message-ID: <20080804225958.0827524848 at gemini.denx.de>
Content-Type: text/plain; charset=ISO-8859-1

In message <789365.58211.qm at web27401.mail.ukl.yahoo.com> you wrote:
>
> I would like to know if this is possible to port U-Boot, Linux and an initrd?image on a?board with 4MB of SDRAM ?

In Theory it may be possible, but just for very tiny demo
applications. Probably not for a useful device.

> When Linux try to boot, there is this line on the terminal :
> "Memory : 2036k available (1036k kernel code, 256k data, 80k init, 0k highmem)"
> So I have 2036k?memory available?for my initrd image?but I don't know if this is suffisant.

Note that a ramdisk is NOT an efficient way to use memory. See fro
example http://www.denx.de/wiki/view/DULG/RootFileSystemSelection
which shows that for example a cramfs image is not only faster to boot
but also needs less RAM.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Keep your head and your heart going in the right  direction  and  you
will not have to worry about your feet.


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

_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded at ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

End of Linuxppc-embedded Digest, Vol 48, Issue 5
************************************************

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 8457 bytes
Desc: not available
URL: <http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20080805/f9fbef7c/attachment-0001.bin>


More information about the Linuxppc-embedded mailing list