linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: minor progress with plb_temac v3.00a, EDK 8.2, & 2.6.18.1
@ 2006-11-04 15:02 robert corley
  2006-11-04 23:20 ` David H. Lynch Jr.
  0 siblings, 1 reply; 8+ messages in thread
From: robert corley @ 2006-11-04 15:02 UTC (permalink / raw)
  To: Pradeep Sampath; +Cc: linux linuxppc-embedded

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

Pradeep;

Booting with a ramdisk is a matter of putting the appropriate image in the arch/ppc/boot/images directory (I obtained mine from the gsrd design files), adding the root=/dev/ram rw on the command-line boot options, making the .config changes for ram disk support and initrd usage, and issuing a make zImage.initrd command.

Beware when upgrading to 2.6.18.1 as you may have difficulties with the adapter.c you obtained previously.  The adapter.c in EDK 8.2 is not as easy to find.  Using the EDK to generate software components for linux will not expose the proper adapter.c.  I had to use the path that Rick Moleres posted earlier to retrieve the adapter.c which I used for 2.6.18.1 and in my notes.

-cy

----- Original Message ----
From: Pradeep Sampath <pradeepsampath@yahoo.com>
To: robert corley <rdcorle@yahoo.com>
Sent: Thursday, November 2, 2006 7:57:25 PM
Subject: Re: minor progress with plb_temac v3.00a, EDK 8.2, & 2.6.18.1

This is great! I played around for a while with the Sysace CF driver patches and got it to work. Since you are booting with ramdisk image would you be kind enough to add more text on how to do that? I see that you are using UART Lite? Does it require any special setting for the boot logs to show up on the standard hyperterminal. 
   
  I am planning on rebuilding the whole system using EDK 8.2 and linux kernel 2.6.18.1.
   
  -Pradeep

robert corley <rdcorle@yahoo.com> wrote:
  For those interested, I have acheived some measure of success with the plb_temac driver.

I have attached a txt file of what I had to do to get it working under 2.6.18.1

I am using the plb_temac in DMA mode 3

Below you will see the boot dump.

For those able to help, can
 anyone provide insight as to the failure of setting PHY link speed?

-cy



====================
----------------------------------------------------------------------
2.6.18.1 kernel with all patches
11/02/2006 15:30
plb_temac v3.00a
hard_temac v3.00b


loaded at: 00400000 009F1138
board data at: 009EF120 009EF138
relocated to: 004040B4 004040CC
zimage at: 00404EC7 0057C1F2
initrd at: 0057D000 009EE6FE
avail ram: 009F2000 04000000


Linux/PPC load: console=ttyUL0 single ip=192.168.1.100:192.168.1.144:192.168.1.1:255.255.255.0:nab:: ramdisk_size=4660000 root=/dev/ram rw

Uncompressing Linux...done.

Now booting the kernel

[ 0.000000] Linux version 2.6.18.1 (rdcorle@athena) (gcc version 3.4.2) #2 Thu Nov 2 21:56:32 UTC 2006
[ 0.000000] Xilinx ML403 Reference System (Virtex-4 FX)
[ 0.000000] Built 1 zonelists. Total pages: 16384
[ 0.000000] Kernel command line: console=ttyUL0 single
 ip=192.168.1.100:192.168.1.144:192.168.1.1:255.255.255.0:nab:: ramdisk_size=4660000 root=/dev/ram rw
[ 0.000000] Xilinx INTC #0 at 0xD1000FC0 mapped to 0xFDFFFFC0
[ 0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
[ 0.000158] Console: colour dummy device 80x25
[ 0.000568] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.001277] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.012895] Memory: 57060k available (2548k kernel code, 640k data, 96k init, 0k highmem)
[ 0.104378] Mount-cache hash table entries: 512
[ 0.106721] checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
[ 2.414242] Freeing initrd memory: 4549k freed
[ 2.418712] NET: Registered protocol family 16
[ 2.427313] NET: Registered protocol family 2
[ 2.464244] IP route cache hash table entries: 512 (order: -1, 2048 bytes)
[ 2.465037] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[
 2.465205] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 2.465296] TCP: Hash tables configured (established 2048 bind 1024)
[ 2.465324] TCP reno registered
[ 2.474633] NTFS driver 2.1.27 [Flags: R/O].
[ 2.475046] JFS: nTxBlock = 481, nTxLock = 3854
[ 2.477623] SGI XFS with no debug enabled
[ 2.479001] io scheduler noop registered
[ 2.479109] io scheduler anticipatory registered
[ 2.479197] io scheduler deadline registered
[ 2.479402] io scheduler cfq registered (default)
[ 2.517627] uartlite.0: ttyUL0 at MMIO 0xa0000000 (irq = 1) is a uartlite
[ 2.691029] RAMDISK driver initialized: 16 RAM disks of 4660000K size 1024 blocksize
[ 2.703933] loop: loaded (max 8 devices)
[ 2.709698] XTemac: using sgDMA mode.
[ 2.713493] XTemac: using TxDRE mode
[ 2.717081] XTemac: using RxDRE mode
[ 2.720678] XTemac: buffer descriptor size: 32768 (0x8000)
[ 2.726622] XTemac: (buffer_descriptor_init) phy: 0x580000, virt: 0xff100000,
 size: 0x8000
[ 2.741073] eth0: Xilinx TEMAC #0 at 0x60000000 mapped to 0xC5050000, irq=0
[ 2.748080] eth0: XTemac id 1.0f, block id 5, type 8
[ 2.753636] mice: PS/2 mouse device common for all mice
[ 2.759529] TCP bic registered
[ 3.264317] eth0: XTemac: Options: 0xb8f2
[ 15.227339] eth0: XTemac: Not able to set the speed to 1000 (status: 0x148)
[ 25.200394] eth0: XTemac: Not able to set the speed to 100 (status: 0x148)
[ 35.173357] eth0: XTemac: Not able to set the speed to 10 (status: 0x148)
[ 35.180122] eth0: XTemac: could not negotiate speed
[ 35.187740] eth0: XTemac: Send Threshold = 16, Receive Threshold = 2
[ 35.194116] eth0: XTemac: Send Wait bound = 1, Receive Wait bound = 1
[ 36.205399] IP-Config: Complete:
[ 36.208459] device=eth0, addr=192.168.1.100, mask=255.255.255.0, gw=192.168.1.1,
[ 36.216339] host=nab, domain=, nis-domain=(none),
[ 36.221487] bootserver=192.168.1.144, rootserver=192.168.1.144, rootpath=
[
 36.229826] RAMDISK: Compressed image found at block 0
[ 37.200498] eth0: XTemac: PHY Link carrier lost.
[ 39.097820] VFS: Mounted root (ext2 filesystem).
[ 39.102751] Freeing unused kernel memory: 96k init
[ 39.108356] ulite_startup: UART status = 0x0014
[ 39.124619] ulite_startup: UART status = 0x0014
[ 39.134313] ulite_startup: UART status = 0x0014


BusyBox v1.00-pre9 (2004.04.18-19:53+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

-sh: can't access tty; job control turned off


steps for plb_temac drivers under EDK 8.2.02i (w/SP2.4+0)
Using plb_temac v3.00a & hard_temac v3.00b

Generate s/w libraries

1. copy or ftp the following files from C:\EDK\sw\ThirdParty\bsp\linux_2_6_v1_00_a\linux\
to the base directory of the linux source tree

USED:
arch\ppc\platforms\4xx\xparameters\xparameters.h

**
 UNUSED
arch\ppc\platforms\4xx\virtex.c
arch\ppc\boot\simple\embed_config.c
include\linux\xilinx_devices.h

2. copy C:\EDK\sw\ThirdParty\bsp\linux_2_6_v1_00_a\drivers\temac_linux_2_6_v2_00_b\src\adapter.c to
../drivers/net/xilinx_temac/adapter.c

3. copy or ftp ..\linux\arch\ppc\platforms\xilinx_ocp => drivers/xilinx_edk
Note: Remove all old files first *except* Kconfig, xio.h

4. modify drivers/xilinx_edk/Makefile with the following to look like this:

# Linux file to EXPORT_SYMBOL all of the Xilinx entries.
obj-$(CONFIG_XILINX_EDK) += xilinx_syms.o
#
# # The Xilinx OS independent code.
xilinx_syms-objs := xbasic_types.o \
xdmav3.o xdmav3_intr.o xdmav3_selftest.o xdmav3_simple.o xdmav3_sg.o \
xipif_v1_23_b.o \
xpacket_fifo_l_v2_00_a.o xpacket_fifo_v2_00_a.o \
xversion.o

5. Modify your copied xparameters_ml403.h (see notes below) as follows:
add these lines after #define
 XPAR_PLB_TEMAC_0_INCLUDE_RX_CSUM

#define XPAR_TEMAC_0_IPIF_RDFIFO_DEPTH XPAR_PLB_TEMAC_0_RXFIFO_DEPTH
#define XPAR_TEMAC_0_IPIF_WRFIFO_DEPTH XPAR_PLB_TEMAC_0_TXFIFO_DEPTH
#define XPAR_TEMAC_0_MAC_FIFO_DEPTH XPAR_PLB_TEMAC_0_MAC_FIFO_DEPTH
#define XPAR_TEMAC_0_TEMAC_DCR_HOST 0
#define XPAR_TEMAC_0_INCLUDE_DRE 1


6. (optional) modify arch/ppc/platforms/virtex.h to accomodate RX_CSUM XPAR

struct xtemac_platform_data {
#ifdef XPAR_TEMAC_0_INCLUDE_RX_CSUM
u8 tx_dre;
u8 rx_dre;
u8 tx_csum;
u8 rx_csum;
u8 phy_type;
#endif
u8 dma_mode;
u32 rx_pkt_fifo_depth;
u32 tx_pkt_fifo_depth;
u16 mac_fifo_depth;
u8 dcr_host;
u8 dre;
u8 mac_addr[6];
};

7. Modify ../drivers/net/xilinx_temac/adapter.c to remove #include and
add #include 
add #include
 

____________________________________________________________________________________
NOTES:
1. Don't forget to copy EDK-generated xparameters.h to ../arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h



=====================================================
Files in latest patch:
../drivers/net/xilinx_temac =
Makefile
adapter.c
xtemac.c
xtemac_control.c
xtemac_fifo.c
xtemac_intr.c
xtemac_intr_fifo.c
xtemac_intr_sgdma.c
xtemac_l.c
xtemac_sgdma.c
xtemac.h
xtemac_i.h
xtemac_l.h

Files in ..\linux\drivers\net\xilinx_temac => (** = new
 files)

Makefile
adapter.c
xtemac.c
xtemac_control.c
xtemac_fifo.c
xtemac_g.c**
xtemac_intr.c
xtemac_intr_fifo.c
xtemac_intr_sgdma.c
xtemac_l.c
xtemac_selftest.c**
xtemac_sgdma.c
xtemac_sinit.c**
xtemac_stats.c**
xtemac.h
xtemac_i.h
xtemac_l.h

============================================================
Files in ../drivers/xilinx_edk =>

Kconfig
Makefile
xbasic_types.c
xdmav2.c
xdmav2_intr.c
xdmav2_sg.c
xdmav2_simple.c
xilinx_syms.c
xpacket_fifo_l_v2_00_a.c
xpacket_fifo_v2_00_a.c
xbasic_types.h
xdmabdv2.h
xdmav2.h
xdmav2_l.h
xio.h
xpacket_fifo_l_v2_00_a.h
xpacket_fifo_v2_00_a.h
xstatus.h

Files in
 ..\linux\arch\ppc\platforms\xilinx_ocp=>
Makefile
xbasic_types.c
xutil_memtest.c
xpacket_fifo_v2_00_a.c
xdmav3.c
xpacket_fifo_l_v2_00_a.c
xdmav3_intr.c
xipif_v1_23_b.c
xdmav3_selftest.c
xdmav3_sg.c
xdmav3_simple.c
xversion.c
xenv.h
xenv_none.h
xenv_vxworks.h
xdmav3_l.h
xipif_v1_23_b.h
xdmav3.h
xpacket_fifo_l_v2_00_a.h
xdmabdv3.h
xpacket_fifo_v2_00_a.h
xparameters_ml300.h
xstatus.h
xutil.h
xbasic_types.h
xenv_linux.h
xversion.h
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded




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

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: minor progress with plb_temac v3.00a, EDK 8.2, & 2.6.18.1
@ 2006-11-10 19:53 robert corley
  0 siblings, 0 replies; 8+ messages in thread
From: robert corley @ 2006-11-10 19:53 UTC (permalink / raw)
  To: linux linuxppc-embedded

Rimas;=0A=0AGood call on the PHY address.  I thought that I was on to somet=
hing when=0AI saw that a week or so ago; however, after I checked the datas=
heet on the=0AMARVELL 88E1111 PHY chip and its connection on the ML403 boar=
d, I=0Afound that it is addressed to 0b00000.=0A=0AIt does appear that acce=
ss to the mgmt registers is working, albeit not completely=0Aas expected (s=
ee boot dump, below) with regards to the PHY ID.=0A=0AThe initialization pr=
ocess is pretty simple:=0A=0A1.   Query the PHY [using  XTemac_PhyRead(...)=
] and see what speed it's set to:=0A=0A    [    5.358347] XTemac(set_mac_sp=
eed): PHY Speed from XTemac_PhyRead() =3D 0M, where 2=3D1000M, 1=3D100M, an=
d 0=3D10M=0A=0A=0A2.    Set the MAC to the same speed (in a switch statemen=
t):=0A            XTemac_SetOperatingSpeed(&lp->Emac, 10);=0A=0AI suspect t=
hat the problem is with the first step as it is reporting a different speed=
 than what the LED's on the board show.=0A=0AAny thoughts?=0A =0ARobert Cor=
ley (rdcorle@yahoo.com)=0A=0A=0A=0A=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0Apartial boot dump fol=
lows...=0A=0A=0A[    2.706547] XTemac (xtenet_probe): Device initialized to=
:=0A[    2.712064]     Device ID    0=0A[    2.714595]     Base Addr    0x6=
0000000=0A[    2.717918]     Rx FIFO    131072=0A[    2.720723]     Tx FIFO=
    131072=0A[    2.723508]     MAC FIFO    64=0A[    2.726052]     DMA mod=
e    3=0A[    2.728514]     TX Dre    2=0A[    2.730782]     Rx Dre    2=0A=
[    2.733067]     Tx CSUM    0=0A[    2.735421]     Rx CSUM    0=0A[    2.=
737792]     Phy Type    1=0A[    2.740268] XTemac (xtenet_probe): MAC initi=
alized to: 00:0A:35:00:22:00=0A[    2.746964] XTemac: using sgDMA mode.=0A[=
    2.750637] XTemac: using TxDRE mode=0A[    2.754221] XTemac: using RxDRE=
 mode=0A[    2.757815] XTemac: buffer descriptor size: 32768 (0x8000)=0A[  =
  2.763779] XTemac: (buffer_descriptor_init) phy: 0x978000, virt: 0xff10000=
0, size: 0x8000=0A[    2.777432] eth0: Dropping NETIF_F_SG since no checksu=
m feature.=0A[    2.784323] eth0: Xilinx TEMAC #0 at 0x60000000 mapped to 0=
xC5050000, irq=3D0=0A[    2.791327] eth0: XTemac id 1.0f, block id 5, type =
8=0A[    2.796886] mice: PS/2 mouse device common for all mice=0A[    2.802=
782] TCP bic registered=0A[    3.308299] eth0: XTemac: Options: 0xb8f2=0A[ =
   5.306282] XTemac(marvell_reset): Marvell 88E1111 reset.=0A[    5.311715]=
 XTemac: (set_mac_speed) Marvell 88E1111 basic-mode status register(#1) =3D=
 0x0148=0A[    5.320083] XTemac: (set_mac_speed) Marvell 88E1111 PHY ID 1 =
=3D 0x0000=0A[    5.326547] XTemac: (set_mac_speed) Marvell 88E1111 PHY ID =
2 =3D 0x0400=0A[    5.333009] XTemac: (set_mac_speed) Marvell 88E1111 1000B=
ASE-T status register(#10) =3D 0x0000=0A[    5.341466] XTemac: (set_mac_spe=
ed) Marvell 88E1111 extended status register(#15) =3D 0x0000=0A[    5.34975=
2] XTemac: (set_mac_speed) Marvell 88E1111 PHY specific status register(#17=
) =3D 0x0000=0A[    5.358347] XTemac(set_mac_speed): PHY Speed from XTemac_=
PhyRead() =3D 0M, where 2=3D1000M, 1=3D100M, and 0=3D10M=0A[    5.367887] e=
th0: XTemac: EMAC speed set to 10Mb/s=0A[    5.372666] XTemac (set_mac_spee=
d): verifying speed settings.  Expect 10M=0A[    5.379480] XTemac: (set_mac=
_speed) Marvell 88E1111 PHY specific status register(#17) =3D 0x0900=0A[   =
 5.388074] eth0: XTemac: PHY Speed from XTemac_PhyRead() =3D 0M, where 2=3D=
1000M, 1=3D100M, and 0=3D10M=0A[    5.396839] eth0: XTemac: EMAC Speed from=
 XTemac_GetOperatingSpeed() =3D 10M=0A[    5.405544] eth0: XTemac: Send Thr=
eshold =3D 16, Receive Threshold =3D 2=0A[    5.411917] eth0: XTemac: Send =
Wait bound =3D 1, Receive Wait bound =3D 1=0A[    6.420309] IP-Config: Comp=
lete:=0A[    6.423375]       device=3Deth0, addr=3D192.168.1.100, mask=3D25=
5.255.255.0, gw=3D192.168.1.1,=0A[    6.431272]      host=3Dnab, domain=3D,=
 nis-domain=3D(none),=0A[    6.436422]      bootserver=3D192.168.1.144, roo=
tserver=3D192.168.1.144, rootpath=3D=0A=0A=0A=0A=0A=0A

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: minor progress with plb_temac v3.00a, EDK 8.2, & 2.6.18.1
@ 2006-11-10  1:55 rimas
  0 siblings, 0 replies; 8+ messages in thread
From: rimas @ 2006-11-10  1:55 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: robert corley

i had problems getting the plb_temac driver to work at speeds higher  
than 10 mbps until i modified the adapter.c
file to have the correct PHY address for my setup (i am using the  
avnet V4FX12 mini-module board and the correct value was 4).
the phy address is usually determined by pullup/pulldowns on certain  
pins on the gig phy chip.

this was under 2.4, but i looked at the adapter.c for the 2.6  
xilinx_temac driver and it appears to just set this value to 0

look at line 2905 of adapter.c:

	/* Assume the PHY to be at address 0x00 */
	lp->gmii_addr = 0;

you should change that to reflect the address of your hardware setup.

hope this helps

-rimas

> Pradeep;
>
> I found the process of "uprading" the xapp902 reference design to  
> be troublesome when I removed the GMII loop-back; as
> such, I aborted the process and just started from scratch.
>
> I am currently debugging my design and have a functional plb_temac  
> but only at 10Mbps speeds.
>
> -R. Corley
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: minor progress with plb_temac v3.00a, EDK 8.2, & 2.6.18.1
@ 2006-11-07 18:37 robert corley
  2006-11-08  8:44 ` Pradeep Sampath
  0 siblings, 1 reply; 8+ messages in thread
From: robert corley @ 2006-11-07 18:37 UTC (permalink / raw)
  To: Pradeep Sampath; +Cc: linux linuxppc-embedded

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

Pradeep;

I found the process of "uprading" the xapp902 reference design to be troublesome when I removed the GMII loop-back; as
such, I aborted the process and just started from scratch.

I am currently debugging my design and have a functional plb_temac but only at 10Mbps speeds.

-R. Corley

----- Original Message ----
From: Pradeep Sampath <pradeepsampath@yahoo.com>
To: David H. Lynch Jr. <dhlii@dlasys.net>; robert corley <rdcorle@yahoo.com>
Cc: linux linuxppc-embedded <linuxppc-embedded@ozlabs.org>
Sent: Tuesday, November 7, 2006 1:05:08 PM
Subject: Re: minor progress with plb_temac v3.00a, EDK 8.2, & 2.6.18.1

Hello,
   
  I was able to get the booting with a ramdisk working and also  David B./Peter's uartlite patches to work. Now I see the linux command line without any kernel panics. Thanks to everybody out there.
   
  Next step is to get the PLB TEMAC 3.00.a working...
   
  Question 1: I have started with the xapp902 reference design. I replaced the existing plb_temac_0 and hard_temac_0 instances with the plb_temac_0 (version 3.00.a) and hard_temac_0 (version 3.00.b). When I "generate libraries and BSP" I get the following error.
  
ERROR:MDT - intc () - Internal error: Number of interrupt inputs on opb_intc_0
   (1) is not the same as length of total number of interrupt sources (2). If
   any interrupt source is a vector then libgen does not support this use case
       while
 executing
   "error "Internal error: Number of interrupt inputs on $periph_name
   ($num_intr_inputs) is not the same as length of total number of interrupt.....
  .....
   ARG: C_PHY_TYPE VALUE: 1
ERROR:MDT - Error while running "generate" for processor ppc405_0...
   
  Or is it better to generate the EDK design from start rather than using the reference design?
   
  Question 2: For the adapter.c for TEMAC, I am using the C:\EDK\sw\ThirdParty\bsp\linux_2_6_v1_00_a\drivers\temac_linux_2_6_v2_00_b\src\adapter.c as indicated by Rick Moleres. Can I use it as is or it requires further tweaking? If yes, then what are the changes.
   
  Question 3: Are the files under linux\arch\ppc\platforms\xilinx_ocp required? I thought the files in ../drivers/xilinx_edk => should take care of all the dma stuff?

  Could someone provide
 some insight into all these questions?
  -Pradeep
  

"David H. Lynch Jr." <dhlii@dlasys.net> wrote:
  robert corley wrote:           Pradeep;

Booting with a ramdisk is a matter of putting the appropriate image in the arch/ppc/boot/images directory (I obtained mine from the gsrd design files), adding the root=/dev/ram rw on the command-line boot options, making the .config changes for ram disk support and initrd usage, and issuing a make zImage.initrd command.

Beware when upgrading to 2.6.18.1 as
 you may have difficulties with the adapter.c you obtained previously.  The adapter.c in EDK 8.2 is not as easy to find.  Using the EDK to generate software components for linux will not expose the proper adapter.c.  I had to use the path that Rick Moleres posted earlier to retrieve the adapter.c which I used for 2.6.18.1 and in my notes.

-cy



    I am booting with a ramdisk using initramfs. Aside from its being somewhat harder to find documentation I beleive it is actually easier.
    
    In the simplest form, create a directory on your host that contains exactly what you want on the ramdisk.
    Enable CONFIG_INITRAMFS
    and point the CONFIG_INITRAMFS_SOURCE  to that directory.

    It is pretty much that simple. The linux build process creates a kernel - I use zImage.elf that has the ramdisk compressed
 and concatentated.
    Nothing except the Linux kernel itself has to make any accomidations for the ramdisk. The bootloader does not have to deal with another file, or pass pointers to it to Linux, ....
    It took some time to get it working - mostly because I did nto know what I was doing, but in hindsight it is really easy.



        ----- Original Message ----
From: Pradeep Sampath <pradeepsampath@yahoo.com>
To: robert corley <rdcorle@yahoo.com>
Sent: Thursday, November 2, 2006 7:57:25 PM
Subject: Re: minor progress with plb_temac v3.00a, EDK 8.2, & 2.6.18.1

  This is great! I played around for a while with the Sysace CF driver patches and got it to work. Since you are booting with ramdisk image would you be kind enough to add more text on how to do that? I see that you are using UART Lite? Does it require any special setting for the boot logs to show up on the standard hyperterminal. 
   
  I am planning on rebuilding the whole system using EDK 8.2 and linux kernel 2.6.18.1.
   
  -Pradeep

robert corley <rdcorle@yahoo.com> wrote:
  For those interested, I have
 acheived some measure of success with the plb_temac driver.

I have attached a txt file of what I had to do to get it working under 2.6.18.1

I am using the plb_temac in DMA mode 3

Below you will see the boot dump.

For those able to help, can anyone provide insight as to the failure of setting PHY link speed?

-cy



====================
----------------------------------------------------------------------
2.6.18.1 kernel with all patches
11/02/2006 15:30
plb_temac v3.00a
hard_temac v3.00b


loaded at: 00400000 009F1138
board data at: 009EF120 009EF138
relocated to: 004040B4 004040CC
zimage at: 00404EC7 0057C1F2
initrd at: 0057D000 009EE6FE
avail ram: 009F2000 04000000


Linux/PPC load: console=ttyUL0 single ip=192.168.1.100:192.168.1.144:192.168.1.1:255.255.255.0:nab:: ramdisk_size=4660000 root=/dev/ram rw

Uncompressing Linux...done.

Now booting the kernel

[
 0.000000] Linux version 2.6.18.1 (rdcorle@athena) (gcc version 3.4.2) #2 Thu Nov 2 21:56:32 UTC 2006
[ 0.000000] Xilinx ML403 Reference System (Virtex-4 FX)
[ 0.000000] Built 1 zonelists. Total pages: 16384
[ 0.000000] Kernel command line: console=ttyUL0 single ip=192.168.1.100:192.168.1.144:192.168.1.1:255.255.255.0:nab:: ramdisk_size=4660000 root=/dev/ram rw
[ 0.000000] Xilinx INTC #0 at 0xD1000FC0 mapped to 0xFDFFFFC0
[ 0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
[ 0.000158] Console: colour dummy device 80x25
[ 0.000568] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.001277] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.012895] Memory: 57060k available (2548k kernel code, 640k data, 96k init, 0k highmem)
[ 0.104378] Mount-cache hash table entries: 512
[ 0.106721] checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
[ 2.414242] Freeing initrd memory:
 4549k freed
[ 2.418712] NET: Registered protocol family 16
[ 2.427313] NET: Registered protocol family 2
[ 2.464244] IP route cache hash table entries: 512 (order: -1, 2048 bytes)
[ 2.465037] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[ 2.465205] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 2.465296] TCP: Hash tables configured (established 2048 bind 1024)
[ 2.465324] TCP reno registered
[ 2.474633] NTFS driver 2.1.27 [Flags: R/O].
[ 2.475046] JFS: nTxBlock = 481, nTxLock = 3854
[ 2.477623] SGI XFS with no debug enabled
[ 2.479001] io scheduler noop registered
[ 2.479109] io scheduler anticipatory registered
[ 2.479197] io scheduler deadline registered
[ 2.479402] io scheduler cfq registered (default)
[ 2.517627] uartlite.0: ttyUL0 at MMIO 0xa0000000 (irq = 1) is a uartlite
[ 2.691029] RAMDISK driver initialized: 16 RAM disks of 4660000K size 1024 blocksize
[ 2.703933] loop: loaded (max 8
 devices)
[ 2.709698] XTemac: using sgDMA mode.
[ 2.713493] XTemac: using TxDRE mode
[ 2.717081] XTemac: using RxDRE mode
[ 2.720678] XTemac: buffer descriptor size: 32768 (0x8000)
[ 2.726622] XTemac: (buffer_descriptor_init) phy: 0x580000, virt: 0xff100000, size: 0x8000
[ 2.741073] eth0: Xilinx TEMAC #0 at 0x60000000 mapped to 0xC5050000, irq=0
[ 2.748080] eth0: XTemac id 1.0f, block id 5, type 8
[ 2.753636] mice: PS/2 mouse device common for all mice
[ 2.759529] TCP bic registered
[ 3.264317] eth0: XTemac: Options: 0xb8f2
[ 15.227339] eth0: XTemac: Not able to set the speed to 1000 (status: 0x148)
[ 25.200394] eth0: XTemac: Not able to set the speed to 100 (status: 0x148)
[ 35.173357] eth0: XTemac: Not able to set the speed to 10 (status: 0x148)
[ 35.180122] eth0: XTemac: could not negotiate speed
[ 35.187740] eth0: XTemac: Send Threshold = 16, Receive Threshold = 2
[ 35.194116] eth0: XTemac: Send Wait bound = 1, Receive
 Wait bound = 1
[ 36.205399] IP-Config: Complete:
[ 36.208459] device=eth0, addr=192.168.1.100, mask=255.255.255.0, gw=192.168.1.1,
[ 36.216339] host=nab, domain=, nis-domain=(none),
[ 36.221487] bootserver=192.168.1.144, rootserver=192.168.1.144, rootpath=
[ 36.229826] RAMDISK: Compressed image found at block 0
[ 37.200498] eth0: XTemac: PHY Link carrier lost.
[ 39.097820] VFS: Mounted root (ext2 filesystem).
[ 39.102751] Freeing unused kernel memory: 96k init
[ 39.108356] ulite_startup: UART status = 0x0014
[ 39.124619] ulite_startup: UART status = 0x0014
[ 39.134313] ulite_startup: UART status = 0x0014


BusyBox v1.00-pre9 (2004.04.18-19:53+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

-sh: can't access tty; job control turned off


steps for plb_temac drivers under EDK 8.2.02i (w/SP2.4+0)
Using plb_temac v3.00a & hard_temac v3.00b

Generate s/w libraries

1. copy
 or ftp the following files from C:\EDK\sw\ThirdParty\bsp\linux_2_6_v1_00_a\linux\
to the base directory of the linux source tree

USED:
arch\ppc\platforms\4xx\xparameters\xparameters.h

** UNUSED
arch\ppc\platforms\4xx\virtex.c
arch\ppc\boot\simple\embed_config.c
include\linux\xilinx_devices.h

2. copy C:\EDK\sw\ThirdParty\bsp\linux_2_6_v1_00_a\drivers\temac_linux_2_6_v2_00_b\src\adapter.c to
../drivers/net/xilinx_temac/adapter.c

3. copy or ftp ..\linux\arch\ppc\platforms\xilinx_ocp => drivers/xilinx_edk
Note: Remove all old files first *except* Kconfig, xio.h

4. modify drivers/xilinx_edk/Makefile with the following to look like this:

# Linux file to EXPORT_SYMBOL all of the Xilinx entries.
obj-$(CONFIG_XILINX_EDK) += xilinx_syms.o
#
# # The Xilinx OS independent code.
xilinx_syms-objs := xbasic_types.o \
xdmav3.o xdmav3_intr.o xdmav3_selftest.o xdmav3_simple.o xdmav3_sg.o \
xipif_v1_23_b.o
 \
xpacket_fifo_l_v2_00_a.o xpacket_fifo_v2_00_a.o \
xversion.o

5. Modify your copied xparameters_ml403.h (see notes below) as follows:
add these lines after #define XPAR_PLB_TEMAC_0_INCLUDE_RX_CSUM

#define XPAR_TEMAC_0_IPIF_RDFIFO_DEPTH XPAR_PLB_TEMAC_0_RXFIFO_DEPTH
#define XPAR_TEMAC_0_IPIF_WRFIFO_DEPTH XPAR_PLB_TEMAC_0_TXFIFO_DEPTH
#define XPAR_TEMAC_0_MAC_FIFO_DEPTH XPAR_PLB_TEMAC_0_MAC_FIFO_DEPTH
#define XPAR_TEMAC_0_TEMAC_DCR_HOST 0
#define XPAR_TEMAC_0_INCLUDE_DRE 1


6. (optional) modify arch/ppc/platforms/virtex.h to accomodate RX_CSUM XPAR

struct xtemac_platform_data {
#ifdef XPAR_TEMAC_0_INCLUDE_RX_CSUM
u8 tx_dre;
u8 rx_dre;
u8 tx_csum;
u8 rx_csum;
u8 phy_type;
#endif
u8 dma_mode;
u32 rx_pkt_fifo_depth;
u32 tx_pkt_fifo_depth;
u16 mac_fifo_depth;
u8 dcr_host;
u8 dre;
u8 mac_addr[6];
};

7. Modify ../drivers/net/xilinx_temac/adapter.c to remove #include and
add
 #include 
add #include 

____________________________________________________________________________________
NOTES:
1. Don't forget to copy EDK-generated xparameters.h to ../arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h



=====================================================
Files in latest patch:
../drivers/net/xilinx_temac =
Makefile
adapter.c
xtemac.c
xtemac_control.c
xtemac_fifo.c
xtemac_intr.c
xtemac_intr_fifo.c
xtemac_intr_sgdma.c
xtemac_l.c
xtemac_sgdma.c
xtemac.h
xtemac_i.h
xtemac_l.h

Files in ..\linux\drivers\net\xilinx_temac => (** = new
 files)

Makefile
adapter.c
xtemac.c
xtemac_control.c
xtemac_fifo.c
xtemac_g.c**
xtemac_intr.c
xtemac_intr_fifo.c
xtemac_intr_sgdma.c
xtemac_l.c
xtemac_selftest.c**
xtemac_sgdma.c
xtemac_sinit.c**
xtemac_stats.c**
xtemac.h
xtemac_i.h
xtemac_l.h

============================================================
Files in ../drivers/xilinx_edk =>

Kconfig
Makefile
xbasic_types.c
xdmav2.c
xdmav2_intr.c
xdmav2_sg.c
xdmav2_simple.c
xilinx_syms.c
xpacket_fifo_l_v2_00_a.c
xpacket_fifo_v2_00_a.c
xbasic_types.h
xdmabdv2.h
xdmav2.h
xdmav2_l.h
xio.h
xpacket_fifo_l_v2_00_a.h
xpacket_fifo_v2_00_a.h
xstatus.h

Files in
 ..\linux\arch\ppc\platforms\xilinx_ocp=>
Makefile
xbasic_types.c
xutil_memtest.c
xpacket_fifo_v2_00_a.c
xdmav3.c
xpacket_fifo_l_v2_00_a.c
xdmav3_intr.c
xipif_v1_23_b.c
xdmav3_selftest.c
xdmav3_sg.c
xdmav3_simple.c
xversion.c
xenv.h
xenv_none.h
xenv_vxworks.h
xdmav3_l.h
xipif_v1_23_b.h
xdmav3.h
xpacket_fifo_l_v2_00_a.h
xdmabdv3.h
xpacket_fifo_v2_00_a.h
xparameters_ml300.h
xstatus.h
xutil.h
xbasic_types.h
xenv_linux.h
xversion.h
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded




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

--   Dave Lynch             DLA Systems  Software Development:               Embedded Linux  717.627.3770         dhlii@dlasys.net    http://www.dlasys.net  fax: 1.253.369.9244               Cell: 1.717.587.7774  Over 25 years' experience in platforms, languages, and technologies too numerous to list.    "Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite
 direction."  Albert Einstein  




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

^ permalink raw reply	[flat|nested] 8+ messages in thread
* minor progress with plb_temac v3.00a, EDK 8.2, & 2.6.18.1
@ 2006-11-02 22:20 robert corley
  0 siblings, 0 replies; 8+ messages in thread
From: robert corley @ 2006-11-02 22:20 UTC (permalink / raw)
  To: linux linuxppc-embedded

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

For those interested, I have acheived some measure of success with the plb_temac driver.

I have attached a txt file of what I had to do to get it working under 2.6.18.1

I am using the plb_temac in DMA mode 3

Below you will see the boot dump.

For those able to help, can anyone provide insight as to the failure of setting PHY link speed?

-cy



====================
----------------------------------------------------------------------
2.6.18.1 kernel with all patches
11/02/2006    15:30
plb_temac v3.00a
hard_temac v3.00b


loaded at:     00400000 009F1138
board data at: 009EF120 009EF138
relocated to:  004040B4 004040CC
zimage at:     00404EC7 0057C1F2
initrd at:     0057D000 009EE6FE
avail ram:     009F2000 04000000


Linux/PPC load: console=ttyUL0 single ip=192.168.1.100:192.168.1.144:192.168.1.1:255.255.255.0:nab:: ramdisk_size=4660000 root=/dev/ram rw

Uncompressing Linux...done.

Now booting the kernel

[    0.000000] Linux version 2.6.18.1 (rdcorle@athena) (gcc version 3.4.2) #2 Thu Nov 2 21:56:32 UTC 2006
[    0.000000] Xilinx ML403 Reference System (Virtex-4 FX)
[    0.000000] Built 1 zonelists.  Total pages: 16384
[    0.000000] Kernel command line: console=ttyUL0 single ip=192.168.1.100:192.168.1.144:192.168.1.1:255.255.255.0:nab:: ramdisk_size=4660000 root=/dev/ram rw
[    0.000000] Xilinx INTC #0 at 0xD1000FC0 mapped to 0xFDFFFFC0
[    0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
[    0.000158] Console: colour dummy device 80x25
[    0.000568] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.001277] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.012895] Memory: 57060k available (2548k kernel code, 640k data, 96k init, 0k highmem)
[    0.104378] Mount-cache hash table entries: 512
[    0.106721] checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
[    2.414242] Freeing initrd memory: 4549k freed
[    2.418712] NET: Registered protocol family 16
[    2.427313] NET: Registered protocol family 2
[    2.464244] IP route cache hash table entries: 512 (order: -1, 2048 bytes)
[    2.465037] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    2.465205] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    2.465296] TCP: Hash tables configured (established 2048 bind 1024)
[    2.465324] TCP reno registered
[    2.474633] NTFS driver 2.1.27 [Flags: R/O].
[    2.475046] JFS: nTxBlock = 481, nTxLock = 3854
[    2.477623] SGI XFS with no debug enabled
[    2.479001] io scheduler noop registered
[    2.479109] io scheduler anticipatory registered
[    2.479197] io scheduler deadline registered
[    2.479402] io scheduler cfq registered (default)
[    2.517627] uartlite.0: ttyUL0 at MMIO 0xa0000000 (irq = 1) is a uartlite
[    2.691029] RAMDISK driver initialized: 16 RAM disks of 4660000K size 1024 blocksize
[    2.703933] loop: loaded (max 8 devices)
[    2.709698] XTemac: using sgDMA mode.
[    2.713493] XTemac: using TxDRE mode
[    2.717081] XTemac: using RxDRE mode
[    2.720678] XTemac: buffer descriptor size: 32768 (0x8000)
[    2.726622] XTemac: (buffer_descriptor_init) phy: 0x580000, virt: 0xff100000, size: 0x8000
[    2.741073] eth0: Xilinx TEMAC #0 at 0x60000000 mapped to 0xC5050000, irq=0
[    2.748080] eth0: XTemac id 1.0f, block id 5, type 8
[    2.753636] mice: PS/2 mouse device common for all mice
[    2.759529] TCP bic registered
[    3.264317] eth0: XTemac: Options: 0xb8f2
[   15.227339] eth0: XTemac: Not able to set the speed to 1000 (status: 0x148)
[   25.200394] eth0: XTemac: Not able to set the speed to 100 (status: 0x148)
[   35.173357] eth0: XTemac: Not able to set the speed to 10 (status: 0x148)
[   35.180122] eth0: XTemac: could not negotiate speed
[   35.187740] eth0: XTemac: Send Threshold = 16, Receive Threshold = 2
[   35.194116] eth0: XTemac: Send Wait bound = 1, Receive Wait bound = 1
[   36.205399] IP-Config: Complete:
[   36.208459]       device=eth0, addr=192.168.1.100, mask=255.255.255.0, gw=192.168.1.1,
[   36.216339]      host=nab, domain=, nis-domain=(none),
[   36.221487]      bootserver=192.168.1.144, rootserver=192.168.1.144, rootpath=
[   36.229826] RAMDISK: Compressed image found at block 0
[   37.200498] eth0: XTemac: PHY Link carrier lost.
[   39.097820] VFS: Mounted root (ext2 filesystem).
[   39.102751] Freeing unused kernel memory: 96k init
[   39.108356] ulite_startup: UART status = 0x0014
[   39.124619] ulite_startup: UART status = 0x0014
[   39.134313] ulite_startup: UART status = 0x0014


BusyBox v1.00-pre9 (2004.04.18-19:53+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

-sh: can't access tty; job control turned off



[-- Attachment #2: kernel 2.6.18 and the plb_temac.txt --]
[-- Type: text/plain, Size: 3950 bytes --]

steps for plb_temac drivers under EDK 8.2.02i (w/SP2.4+0)
Using plb_temac v3.00a & hard_temac v3.00b

Generate s/w libraries

1.	copy or ftp the following files from C:\EDK\sw\ThirdParty\bsp\linux_2_6_v1_00_a\linux\
	to the base directory of the linux source tree

	USED:
	arch\ppc\platforms\4xx\xparameters\xparameters.h

	** UNUSED
	arch\ppc\platforms\4xx\virtex.c
	arch\ppc\boot\simple\embed_config.c
	include\linux\xilinx_devices.h

2.	copy C:\EDK\sw\ThirdParty\bsp\linux_2_6_v1_00_a\drivers\temac_linux_2_6_v2_00_b\src\adapter.c to
	../drivers/net/xilinx_temac/adapter.c

3.	copy or ftp ..\linux\arch\ppc\platforms\xilinx_ocp => drivers/xilinx_edk
	Note: Remove all old files first *except* Kconfig, xio.h

4.	modify drivers/xilinx_edk/Makefile with the following to look like this:

# Linux file to EXPORT_SYMBOL all of the Xilinx entries.
obj-$(CONFIG_XILINX_EDK) += xilinx_syms.o
#
# # The Xilinx OS independent code.
xilinx_syms-objs := xbasic_types.o \
                    xdmav3.o xdmav3_intr.o xdmav3_selftest.o xdmav3_simple.o xdmav3_sg.o \
                    xipif_v1_23_b.o \
                    xpacket_fifo_l_v2_00_a.o xpacket_fifo_v2_00_a.o \
                    xversion.o

5.	Modify your copied xparameters_ml403.h (see notes below) as follows:
	add these lines after #define XPAR_PLB_TEMAC_0_INCLUDE_RX_CSUM

	#define XPAR_TEMAC_0_IPIF_RDFIFO_DEPTH  XPAR_PLB_TEMAC_0_RXFIFO_DEPTH
	#define XPAR_TEMAC_0_IPIF_WRFIFO_DEPTH  XPAR_PLB_TEMAC_0_TXFIFO_DEPTH
	#define XPAR_TEMAC_0_MAC_FIFO_DEPTH     XPAR_PLB_TEMAC_0_MAC_FIFO_DEPTH
	#define XPAR_TEMAC_0_TEMAC_DCR_HOST     0
	#define XPAR_TEMAC_0_INCLUDE_DRE        1


6.	(optional) modify arch/ppc/platforms/virtex.h to accomodate RX_CSUM XPAR

struct xtemac_platform_data {
#ifdef XPAR_TEMAC_0_INCLUDE_RX_CSUM
      u8 tx_dre;
      u8 rx_dre;
      u8 tx_csum;
      u8 rx_csum;
      u8 phy_type;
#endif
      u8 dma_mode;
      u32 rx_pkt_fifo_depth;
      u32 tx_pkt_fifo_depth;
      u16 mac_fifo_depth;
      u8 dcr_host;
      u8 dre;
      u8 mac_addr[6];
};

7.	Modify ../drivers/net/xilinx_temac/adapter.c to remove #include <linux/xilinx_devices.h> and
	add #include <linux/platform_device.h>
	add #include <platforms/4xx/virtex.h>

____________________________________________________________________________________
NOTES:
1.	Don't forget to copy EDK-generated xparameters.h to ../arch/ppc/platforms/4xx/xparameters/xparameters_ml403.h



=====================================================
Files in latest patch:
../drivers/net/xilinx_temac =
Makefile
adapter.c
xtemac.c
xtemac_control.c
xtemac_fifo.c
xtemac_intr.c
xtemac_intr_fifo.c
xtemac_intr_sgdma.c
xtemac_l.c
xtemac_sgdma.c
xtemac.h
xtemac_i.h
xtemac_l.h

Files in ..\linux\drivers\net\xilinx_temac =>  (** = new files)

Makefile
adapter.c
xtemac.c
xtemac_control.c
xtemac_fifo.c
xtemac_g.c**
xtemac_intr.c
xtemac_intr_fifo.c
xtemac_intr_sgdma.c
xtemac_l.c
xtemac_selftest.c**
xtemac_sgdma.c
xtemac_sinit.c**
xtemac_stats.c**
xtemac.h
xtemac_i.h
xtemac_l.h

============================================================
Files in ../drivers/xilinx_edk =>

Kconfig
Makefile
xbasic_types.c
xdmav2.c
xdmav2_intr.c
xdmav2_sg.c
xdmav2_simple.c
xilinx_syms.c
xpacket_fifo_l_v2_00_a.c
xpacket_fifo_v2_00_a.c
xbasic_types.h
xdmabdv2.h
xdmav2.h
xdmav2_l.h
xio.h
xpacket_fifo_l_v2_00_a.h
xpacket_fifo_v2_00_a.h
xstatus.h

Files in ..\linux\arch\ppc\platforms\xilinx_ocp=>
Makefile
xbasic_types.c
xutil_memtest.c
xpacket_fifo_v2_00_a.c
xdmav3.c
xpacket_fifo_l_v2_00_a.c
xdmav3_intr.c
xipif_v1_23_b.c
xdmav3_selftest.c
xdmav3_sg.c
xdmav3_simple.c
xversion.c
xenv.h
xenv_none.h
xenv_vxworks.h
xdmav3_l.h
xipif_v1_23_b.h
xdmav3.h
xpacket_fifo_l_v2_00_a.h
xdmabdv3.h
xpacket_fifo_v2_00_a.h
xparameters_ml300.h
xstatus.h
xutil.h
xbasic_types.h
xenv_linux.h
xversion.h

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

end of thread, other threads:[~2006-11-10 19:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-04 15:02 minor progress with plb_temac v3.00a, EDK 8.2, & 2.6.18.1 robert corley
2006-11-04 23:20 ` David H. Lynch Jr.
2006-11-07 18:05   ` Pradeep Sampath
  -- strict thread matches above, loose matches on Subject: below --
2006-11-10 19:53 robert corley
2006-11-10  1:55 rimas
2006-11-07 18:37 robert corley
2006-11-08  8:44 ` Pradeep Sampath
2006-11-02 22:20 robert corley

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