Ethernet driver for Linux kernel 2.6 running on ML403
Hi,
I'm able to boot Linux 2.6 on ML403 board (with a ramdisk file system).
However, during the kernel booting, it complains that "No network devices available," So I figured I probably didn't enable the ethernet driver in the kernel.
Quoted 1 line
From doing "make menuconfig", under "Device Drivers" --> "Network device
support" --> "Ethernet(10 or 100Mbit)", I checked the box of both "Ethernet (10 or 100Mbit)" and "PowerPC 4xx on-chip Ethernet support." I then save/exit the menuconfig to compile the kernel again. I've attached the error output at the bottom.
The problem is that I don't have any define in my .config file that matches "CONFIG_405GP", "CONFIG_405GPR" or "CONFIG_405EP" in the /drivers/net/ibm_emac/ibm_emac.h file, so it complains that I might not have correct defines.
1st question: Which one of the CONFIG_405xxx should I use? I was searching around but couldn't find an answer, but my intuition tells me that it should probably be CONFIG_405GP.
2nd question: So I decided to try with CONFIG_405GP just to see what happens. However, some compilation errors were still there. And it complains about "dereferencing pointer to incomplete type". Does anyone have any experience working with this driver and perhaps found that there's an error in the kernel for this driver?
Thanks,
Aleck
------------------------------------------------------------------------
In file included from drivers/net/ibm_emac/ibm_emac_core.h:28,
from drivers/net/ibm_emac/ibm_emac_mal.c:33:drivers/net/ibm_emac/ibm_emac.h:31:2: error: #error "Unknown SoC. Please, check chip user manual and make sure EMAC defines are OK"
In file included from drivers/net/ibm_emac/ibm_emac_core.h:32,
from drivers/net/ibm_emac/ibm_emac_mal.c:33:drivers/net/ibm_emac/ibm_emac_mal.h:42:2: error: #error "Unknown SoC, please check chip manual and choose MAL 'version'" drivers/net/ibm_emac/ibm_emac_mal.h:53:5: warning: "MAL_VERSION" is not defineddrivers/net/ibm_emac/ibm_emac_mal.h:61:7: warning: "MAL_VERSION" is not defineddrivers/net/ibm_emac/ibm_emac_mal.h:72:2: error: #error "Unknown MAL version"drivers/net/ibm_emac/ibm_emac_mal.h:88:5: warning: "MAL_VERSION" is not defineddrivers/net/ibm_emac/ibm_emac_mal.h:91:7: warning: "MAL_VERSION" is not defineddrivers/net/ibm_emac/ibm_emac_mal.h:99:2: error: #error "Unknown MAL version"drivers/net/ibm_emac/ibm_emac_mal.h:107:5: warning: "MAL_VERSION" is not defineddrivers/net/ibm_emac/ibm_emac_mal.h:110:7: warning: "MAL_VERSION" is not defineddrivers/net/ibm_emac/ibm_emac_mal.h:116:2: error: #error "Unknown MAL version"drivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_register_commac':drivers/net/ibm_emac/ibm_emac_mal.c:50: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_set_rcbs':drivers/net/ibm_emac/ibm_emac_mal.c:80: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:81: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:81: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:81: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:89: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_tx_bd_offset':drivers/net/ibm_emac/ibm_emac_mal.c:99: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:100: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:100: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:100: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_rx_bd_offset':drivers/net/ibm_emac/ibm_emac_mal.c:106: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:107: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:107: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:107: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:108: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_serr':drivers/net/ibm_emac/ibm_emac_mal.c:196: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:204: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_txde':drivers/net/ibm_emac/ibm_emac_mal.c:250: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_reset':drivers/net/ibm_emac/ibm_emac_mal.c:359: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_dump_regs':drivers/net/ibm_emac/ibm_emac_mal.c:372: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:375: error: 'MAL_VERSION' undeclared (first use in this function) drivers/net/ibm_emac/ibm_emac_mal.c:375: error: (Each undeclared identifier is reported only oncedrivers/net/ibm_emac/ibm_emac_mal.c:375: error: for each function it appears in.)drivers/net/ibm_emac/ibm_emac_mal.c:376: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:378: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:379: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_probe':drivers/net/ibm_emac/ibm_emac_mal.c:411: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:414: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:422: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:425: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:426: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:441: error: 'MAL_CFG_DEFAULT' undeclared (first use in this function) drivers/net/ibm_emac/ibm_emac_mal.c:447: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:447: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:447: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:447: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:447: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:447: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:448: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:448: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:448: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:448: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:448: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:448: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:450: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:451: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:453: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:458: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:464: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:469: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:474: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:477: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:480: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:483: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:486: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:491: error: 'MAL_IER_SOC_EVENTS' undeclared (first use in this function) drivers/net/ibm_emac/ibm_emac_mal.c:494: warning: implicit declaration of function 'ocp_set_drvdata' drivers/net/ibm_emac/ibm_emac_mal.c:499: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:499: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:499: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:503: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:505: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:507: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:509: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:511: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_remove':drivers/net/ibm_emac/ibm_emac_mal.c:519: warning: implicit declaration of function 'ocp_get_drvdata' drivers/net/ibm_emac/ibm_emac_mal.c:519: warning: initialization makes pointer from integer without a cast drivers/net/ibm_emac/ibm_emac_mal.c:520: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:534: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:539: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:540: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:541: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:542: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:543: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:549: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:551: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c:552: error: dereferencing pointer to incomplete typedrivers/net/ibm_emac/ibm_emac_mal.c: At top level:drivers/net/ibm_emac/ibm_emac_mal.c:559: error: array type has incomplete element typedrivers/net/ibm_emac/ibm_emac_mal.c:560: error: field name not in record or union initializerdrivers/net/ibm_emac/ibm_emac_mal.c:560: error: (near initialization for 'mal_ids')drivers/net/ibm_emac/ibm_emac_mal.c:560: error: field name not in record or union initializerdrivers/net/ibm_emac/ibm_emac_mal.c:560: error: (near initialization for 'mal_ids')drivers/net/ibm_emac/ibm_emac_mal.c:561: error: field name not in record or union initializerdrivers/net/ibm_emac/ibm_emac_mal.c:561: error: (near initialization for 'mal_ids')drivers/net/ibm_emac/ibm_emac_mal.c:564: error: variable 'mal_driver' has initializer but incomplete type drivers/net/ibm_emac/ibm_emac_mal.c:565: error: unknown field 'name' specified in initializer drivers/net/ibm_emac/ibm_emac_mal.c:565: warning: excess elements in struct initializerdrivers/net/ibm_emac/ibm_emac_mal.c:565: warning: (near initialization for 'mal_driver')drivers/net/ibm_emac/ibm_emac_mal.c:566: error: unknown field 'id_table' specified in initializer drivers/net/ibm_emac/ibm_emac_mal.c:566: warning: excess elements in struct initializerdrivers/net/ibm_emac/ibm_emac_mal.c:566: warning: (near initialization for 'mal_driver')drivers/net/ibm_emac/ibm_emac_mal.c:568: error: unknown field 'probe' specified in initializer drivers/net/ibm_emac/ibm_emac_mal.c:568: warning: excess elements in struct initializerdrivers/net/ibm_emac/ibm_emac_mal.c:568: warning: (near initialization for 'mal_driver')drivers/net/ibm_emac/ibm_emac_mal.c:569: error: unknown field 'remove' specified in initializer drivers/net/ibm_emac/ibm_emac_mal.c:569: warning: excess elements in struct initializerdrivers/net/ibm_emac/ibm_emac_mal.c:569: warning: (near initialization for 'mal_driver')drivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_init':drivers/net/ibm_emac/ibm_emac_mal.c:575: warning: implicit declaration of function 'ocp_register_driver' drivers/net/ibm_emac/ibm_emac_mal.c: In function 'mal_exit':drivers/net/ibm_emac/ibm_emac_mal.c:581: warning: implicit declaration of function 'ocp_unregister_driver'
make[3]: *** [drivers/net/ibm_emac/ibm_emac_mal.o] Error 1 make[2]: *** [drivers/net/ibm_emac] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2
---------------------------------------------------------------------------
Quoted 8 lines · Aleck Lin
Hi,
I'm able to boot Linux 2.6 on ML403 board (with a ramdisk file system).
However, during the kernel booting, it complains that "No network devices available," So I figured I probably didn't enable the ethernet driver in the kernel.
Quoted 5 lines
Quoted 1 line
From doing "make menuconfig", under "Device Drivers" --> "Network device
support" --> "Ethernet(10 or 100Mbit)", I checked the box of both "Ethernet (10 or 100Mbit)" and "PowerPC 4xx on-chip Ethernet support." I then save/exit the menuconfig to compile the kernel again. I've attached the error output at the bottom.
The virtex eth device is not the same as 4xx on-chip Ethernet, so CONFIG_IBM_EMAC will not work. You need the xilinx_enet driver (which is not in mainline). It might be in MontaVista's 2.6 tree.
I think people have posted patches for it to this list, so try searching the archives. (I don't have a link off the top of my head.)
Signature · 4 lines
Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. [email protected] (403) 399-0195
Quoted 14 lines · Aleck Lin
Hi,
I'm able to boot Linux 2.6 on ML403 board (with a ramdisk file system).
However, during the kernel booting, it complains that "No network devices available," So I figured I probably didn't enable the ethernet driver in the kernel.
Quoted 1 line
From doing "make menuconfig", under "Device Drivers" --> "Network device
support" --> "Ethernet(10 or 100Mbit)", I checked the box of both "Ethernet (10 or 100Mbit)" and "PowerPC 4xx on-chip Ethernet support." I then save/exit the menuconfig to compile the kernel again. I've attached the error output at the bottom.
Quoted 4 lines
The problem is that I don't have any define in my .config file that matches "
CONFIG_405GP", "CONFIG_405GPR" or "CONFIG_405EP" in the /drivers/net/ibm_emac/ibm_emac.h file, so it complains that I might not have correct defines.
Yes, I put that check there exactly to prevent people from using my driver on non-compatible hardware :).
Quoted 3 lines
1st question: Which one of the
CONFIG_405xxxshould I use? I was searching around but couldn't find an answer, but my intuition tells me that it should probably beCONFIG_405GP.
No.
Quoted 5 lines
2nd question: So I decided to try with
CONFIG_405GPjust to see what happens. However, some compilation errors were still there. And it complains about "dereferencing pointer to incomplete type". Does anyone have any experience working with this driver and perhaps found that there's an error in the kernel for this driver?
This driver isn't for your chip and simply cannot work.
Signature · 1 line
Eugene
Quoted 17 lines · Grant Likely
Quoted 8 lines · Aleck Lin
Hi,
I'm able to boot Linux 2.6 on ML403 board (with a ramdisk file system).
However, during the kernel booting, it complains that "No network devices available," So I figured I probably didn't enable the ethernet driver in the kernel.
Quoted 6 lines
Quoted 1 line
From doing "make menuconfig", under "Device Drivers" --> "Network device
support" --> "Ethernet(10 or 100Mbit)", I checked the box of both "Ethernet (10 or 100Mbit)" and "PowerPC 4xx on-chip Ethernet support." I then save/exit the menuconfig to compile the kernel again. I've attached the error output at the bottom.
Quoted 7 lines
The virtex eth device is not the same as 4xx on-chip Ethernet, so
CONFIG_IBM_EMACwill not work. You need thexilinx_enetdriver (which is not in mainline). It might be in MontaVista's 2.6 tree.I think people have posted patches for it to this list, so try searching the archives. (I don't have a link off the top of my head.)
The MV 2.6 Xilinx_edk based TEMAC driver has been posted to this
list several times.
As of the last incarnation I tried it had no MII/PHY support and you
had to manully change the speed of the driver 10/100/1000 by editing the code.
Otherwise it worked with the PLB FIFO TEMAC, that I am using, and
should with others.
I have a polled driver that works with the LL TEMAC.
I am nearly finished a PLB FIFO TEMAC driver that includes working
autonegotiation and does not use the Xilinx_edk.
But right now it has a receive problem - packets come in they look
good but linux silently discards them.
I have virtually the same code working under GHS Integrity.
Signature · 8 lines
Dave Lynch DLA Systems Software Development: Embedded Linux 717.627.3770 [email protected] 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
Quoted 7 lines
Quoted 7 lines
The virtex eth device is not the same as 4xx on-chip Ethernet, so
CONFIG_IBM_EMACwill not work. You need thexilinx_enetdriver (which is not in mainline). It might be in MontaVista's 2.6 tree.I think people have posted patches for it to this list, so try searching the archives. (I don't have a link off the top of my head.)
Quoted 6 lines
The MV 2.6
Xilinx_edkbased TEMAC driver has been posted to this
list several times.As of the last incarnation I tried it had no MII/PHY support and you
had to manully change the speed of the driver 10/100/1000 by editing the code.
It is also worth noting that as released in MVL pro 4.0.1 it only supports hard_temac 1.00.a and plb_temac 2.00.a, both of which are tagged as deprecated in the current version (8.2.01i) of Xilinx's EDK. The current version of {plb,hard}_temac (3.00.a) goes to great lengths to break compatibility with older versions. This will presumably be fixed next month when it is rumored that wonderful new things will come from Xilinx. In the mean-time it is possible, though neither simple, nor fun, to create Virtex4 designs with the older IP.
-michael
Quoted 8 lines · Michael Galassi
It is also worth noting that as released in MVL pro 4.0.1 it only supports
hard_temac1.00.a andplb_temac2.00.a, both of which are tagged as deprecated in the current version (8.2.01i) of Xilinx's EDK. The current version of {plb,hard}_temac (3.00.a) goes to great lengths to break compatibility with older versions. This will presumably be fixed next month when it is rumored that wonderful new things will come from Xilinx. In the mean-time it is possible, though neither simple, nor fun, to create Virtex4 designs with the older IP.
So what direction do we (as the community) want to go for supporting Xilinx IP in the Linux kernel?
IIRC, Xilinx intends to get drivers submitted into mainline. (Based on their cross-platform driver support code). It is unknown which and how many drivers for different IP versions will be submitted.
However, the xilinx driver code is verbose and does not match well with the rest of the Linux code base. (due to the cross platform support) Plus, the Xilinx tool work flow is geared towards the EDK tool overwriting the driver code in the kernel tree with code for the generated design. In which case, does it even make sense to accept Xilinx drivers into the Linux tree when they are just going to get overwritten by the toolchain anyway? Unfortunately, regenerating drivers has it's own problems considering that the license on the generated code is not GPL compatible at the moment.
If we reject the Xilinx driver code, then we either have to do without Xilinx support in mainline, or we need to write new drivers that address the above issues (support multiple IP versions, etc). The Xilinx support in mainline right now does not use any Xilinx code. (Xilinx PIC and UART).
Thoughts?
g.
Signature · 4 lines
Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. [email protected] (403) 399-0195
Grant,
You bring up excellent points, and I am having to deal with these issues in my 2.4.x kernel and U-Boot ports to VirtexII Pro FPGAs as well.
Quoted 9 lines · Michael Galassi
Quoted 8 lines
It is also worth noting that as released in MVL pro 4.0.1 it only supports
hard_temac1.00.a andplb_temac2.00.a, both of which are tagged as deprecated in the current version (8.2.01i) of Xilinx's EDK. The current version of {plb,hard}_temac (3.00.a) goes to great lengths to break compatibility with older versions. This will presumably be fixed next month when it is rumored that wonderful new things will come from Xilinx. In the mean-time it is possible, though neither simple, nor fun, to create Virtex4 designs with the older IP.
I think the general case is that Xilinx IP will be constantly evolving, and
Xilinx driver code, when released under the GPL, will appear sporadically. Maybe it's best to resign ourselves to the fact that this situation probably won't change, and then try to deal with it in a way that does not depend so heavily on Xilinx drivers.
Quoted 3 lines
So what direction do we (as the community) want to go for supporting Xilinx IP in the Linux kernel?
I don't know about anyone else, but running Linux on Virtex FPGAs is something I simply have to be able to do. With or without Xilinx drivers, I think the kernel needs to support Xilinx hardware.
Quoted 4 lines
IIRC, Xilinx intends to get drivers submitted into mainline. (Based on their cross-platform driver support code). It is unknown which and how many drivers for different IP versions will be submitted.
That's part of the problem: we seem to get support for some IP cores, but not all. Xilinx takes a piecemeal approach to releasing drivers under the GPL.
Quoted 10 lines
However, the xilinx driver code is verbose and does not match well with the rest of the Linux code base. (due to the cross platform support) Plus, the Xilinx tool work flow is geared towards the EDK tool overwriting the driver code in the kernel tree with code for the generated design. In which case, does it even make sense to accept Xilinx drivers into the Linux tree when they are just going to get overwritten by the toolchain anyway? Unfortunately, regenerating drivers has it's own problems considering that the license on the generated code is not GPL compatible at the moment.
Same complaints apply for Xilinx drivers in the U-Boot bootloader. It is proving very difficult to get Xilinx code into U-Boot which means BSPs that use the code are hard to get submitted as well.
The Xilinx approach of overwriting the source tree just feels wrong, and no one seems to want to do it that way.
Quoted 8 lines
If we reject the Xilinx driver code, then we either have to do without Xilinx support in mainline, or we need to write new drivers that address the above issues (support multiple IP versions, etc). The Xilinx support in mainline right now does not use any Xilinx code. (Xilinx PIC and UART).
Thoughts?
As painful as it may be, maybe we just write drivers from scratch and try to track changes in the IP.
Regards,
Keith Outwater
Quoted 7 lines · Keith J Outwater
Quoted 3 lines
So what direction do we (as the community) want to go for supporting Xilinx IP in the Linux kernel?
I don't know about anyone else, but running Linux on Virtex FPGAs is something I simply have to be able to do. With or without Xilinx drivers, I think the kernel needs to support Xilinx hardware.
ditto
Quoted 8 lines
Quoted 8 lines
If we reject the Xilinx driver code, then we either have to do without Xilinx support in mainline, or we need to write new drivers that address the above issues (support multiple IP versions, etc). The Xilinx support in mainline right now does not use any Xilinx code. (Xilinx PIC and UART).
Quoted 4 lines
Quoted 1 line
Thoughts?
As painful as it may be, maybe we just write drivers from scratch and try to track changes in the IP.
That's kind of the direction I'm leaning too.
Signature · 4 lines
Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. [email protected] (403) 399-0195
Quoted 10 lines · Michael Galassi
It is also worth noting that as released in MVL pro 4.0.1 it only supports
hard_temac1.00.a andplb_temac2.00.a, both of which are tagged as deprecated in the current version (8.2.01i) of Xilinx's EDK. The current version of {plb,hard}_temac (3.00.a) goes to great lengths to break compatibility with older versions. This will presumably be fixed next month when it is rumored that wonderful new things will come from Xilinx. In the mean-time it is possible, though neither simple, nor fun, to create Virtex4 designs with the older IP.
Fortunately, I have little to do with the firmware. Unfortunately, after the firmware is in the product, I am the guy
who has to make the drivers work.
I am also not straight - though I am somewhat clearer, on exactly
what any given flavor of TEMAC is.
As best as I can tell, the V4 FX chipsets contain some dedicated
hardware that forms the basis for the TEMAC.
(or possibly several TEMAC's depending on how it is built).
Separately Xilinx provides a plethora of wrapper logic, that allows
you to implement a slew of different incarnations.
All similar yet different at the same time. Ranging from the Local
Link TEMAC which is the simplest to the
PLB SG DMA driven TEMAC which is probably the most complex.
Then there is an assortment of PDF's from Xilinx, none of which
quite match whatever you might have.
And at the risk of Goring somebodies Ox, the MV/EDK based drivers
may/may not have the attribute of
being portable accross multiple OS's, but they seem to pretty much
deliberately violate almost every style
quideline for Linux drivers. Linux is written in C, not preprocessor
Macros.
For anyone at MV I have ticked off - Sorry, I am sure it is
brilliantly written preprocessor Macros.
Quoted 2 lines
-michael
Signature · 8 lines
Dave Lynch DLA Systems Software Development: Embedded Linux 717.627.3770 [email protected] 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
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"GL" == Grant Likely <[email protected]> writes:
Hi,
GL> So what direction do we (as the community) want to go for GL> supporting Xilinx IP in the Linux kernel?
GL> IIRC, Xilinx intends to get drivers submitted into mainline. GL> (Based on their cross-platform driver support code). It is GL> unknown which and how many drivers for different IP versions will GL> be submitted.
Yes, that's also what I hear from the Xilinx guys - But action speaks louder than words. It's not like the V2P is new technology anymore.
GL> However, the xilinx driver code is verbose and does not match well GL> with the rest of the Linux code base.
Yeah, the Xilinx stuff/flow definately doesn't fit the kernel.
GL> If we reject the Xilinx driver code, then we either have to do GL> without Xilinx support in mainline, or we need to write new GL> drivers that address the above issues (support multiple IP GL> versions, etc). The Xilinx support in mainline right now does not GL> use any Xilinx code. (Xilinx PIC and UART).
I think the best option is to simply forget about the Xilinx code, see the FPGAs as any other PPC system and write normal device drivers for it. Your platform bus stuff and my (to-be-mainlined) uartlite driver is a first step in this direction..
Signature · 1 line
Bye, Peter Korsgaard
Quoted 11 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"GL" == Grant Likely <[email protected]> writes:
GL> If we reject the Xilinx driver code, then we either have to do GL> without Xilinx support in mainline, or we need to write new GL> drivers that address the above issues (support multiple IP GL> versions, etc). The Xilinx support in mainline right now does not GL> use any Xilinx code. (Xilinx PIC and UART).
I think the best option is to simply forget about the Xilinx code, see the FPGAs as any other PPC system and write normal device drivers for it. Your platform bus stuff and my (to-be-mainlined) uartlite driver is a first step in this direction..
Too bad platform bus is sooo last year. :p
Time to hack device trees.
g.
Signature · 4 lines
Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. [email protected] (403) 399-0195
Quoted 8 lines · Grant Likely
Quoted 7 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"GL" == Grant Likely <[email protected]> writes:
GL> If we reject the Xilinx driver code, then we either have to do GL> without Xilinx support in mainline, or we need to write new GL> drivers that address the above issues (support multiple IP GL> versions, etc). The Xilinx support in mainline right now does not GL> use any Xilinx code. (Xilinx PIC and UART).
Quoted 8 lines
Quoted 4 lines
I think the best option is to simply forget about the Xilinx code, see the FPGAs as any other PPC system and write normal device drivers for it. Your platform bus stuff and my (to-be-mainlined) uartlite driver is a first step in this direction..
Too bad platform bus is sooo last year. :p
Time to hack device trees.
Avast! After getting quizzed on IRC about this off-the-cuff comment, I should probably clarify. Since the Xilinx IP could be wired up to a ublaze core or an off-chip processor, the drivers still need to use a platform bus attachment to keep it all cross platform.
So, replace above comment with the following:
Populating the platform device with static code during initialization is sooo last year.
Time to hack device trees to populate it instead.
:)
g.
Signature · 4 lines
Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. [email protected] (403) 399-0195
Quoted 7 lines · Grant Likely
Avast! After getting quizzed on IRC about this off-the-cuff comment, I should probably clarify. Since the Xilinx IP could be wired up to a ublaze core or an off-chip processor, the drivers still need to use a platform bus attachment to keep it all cross platform.
Quoted 7 lines
So, replace above comment with the following:
Populating the platform device with static code during initialization is sooo last year.
Time to hack device trees to populate it instead.
So I got another X V4 board. I hacked in the Platform device stuff
from you ml403 code with changes needed for my hardware.
and my brain is slowly begining to actually grasp what is going on
- I am begining to grasp the platform devices big picture (over a mountain through a spyglass in the fog)
Where do I begin with Device Trees ?
The vague Picture I have is the have something to do with some
datastructure that Mac's typically create at or prior to boot. And that for embedded systems we are building them
externally compiling them and then attaching the compiled device
tree to our project.
I got a Xilinv V4 device currently with a Pic, UartLite, TEMAC,
Flash and Keyhole (pseuodo serial host interface). Of those it is only certain that the flash will always be there.
We have bit images with Keyhole only, Uartlite only TEMAC only,
Sometimes we have a Pic sometimes not. I was trying to get to the point were I could dynamically add what was there
to Platform devices during initialization.
If Device trees are static, then do they even apply to what I have
to deal with ?
Please pardon my ignorance.
Signature · 8 lines
Dave Lynch DLA Systems Software Development: Embedded Linux 717.627.3770 [email protected] 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
Quoted 15 lines · David H. Lynch Jr.
Grant Likely wrote:
Avast! After getting quizzed on IRC about this off-the-cuff comment,
I should probably clarify. Since the Xilinx IP could be wired up to a ublaze core or an off-chip processor, the drivers still need to use a platform bus attachment to keep it all cross platform.So, replace above comment with the following:
Populating the platform device with static code during initialization is sooo last year.
Time to hack device trees to populate it instead.
Quoted 7 lines
So I got another X V4 board. I hacked in the Platform device stuff from
you ml403 code with changes needed for my hardware.
and my brain is slowly begining to actually grasp what is going on - I
am begining to grasp the platform devices big picture (over a mountain through a spyglass in the fog)Where do I begin with Device Trees ?
Step 1: run away
Step 2: don't look back.
Just kidding. Unless you want to help move Virtex support from arch/ppc to arch/powerpc, you don't really need to worry about device trees for a while.
If you are interested, look at Documentation/powerpc/booting-without-of.txt. Then start poking Matt Porter about when he's going to get 4xx ported to arch/powerpc.
I've been half heartedly looking at what needs to be done to generate a device tree based on either system.mhs or xparameters.h. I'm probably going to write a tiny C program that is compiled against xparameters.h and spits out a valid dts file. The dts file can then be run through the device tree compiler to produce the flattened device tree structure.
Quoted 6 lines
The vague Picture I have is the have something to do with some
datastructure that Mac's typically create at or prior to boot. And that for embedded systems we are building them
externally compiling them and then attaching the compiled device tree
to our project.
That right. You don't compile device base addresses, irqs, etc into the kernel. You pass them in at boot time with a data structure.
Quoted 11 lines
I got a Xilinv V4 device currently with a Pic, UartLite, TEMAC, Flash
and Keyhole (pseuodo serial host interface). Of those it is only certain that the flash will always be there.
We have bit images with Keyhole only, Uartlite only TEMAC only,
Sometimes we have a Pic sometimes not. I was trying to get to the point were I could dynamically add what was there
to Platform devices during initialization.If Device trees are static, then do they even apply to what I have to
deal with ?
Device trees don't have to be static. They can be generated/modified on the fly if the bootloader supports it. Or you can pass a different tree depending on what IP you have on the board.
Cheers,
g.
Signature · 4 lines
Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. [email protected] (403) 399-0195
Quoted 3 lines · Grant Likely
Step 1: run away
Step 2: don't look back.
There are days.
Quoted 8 lines
Just kidding. Unless you want to help move Virtex support from
arch/ppctoarch/powerpc, you don't really need to worry about device trees for a while.If you are interested, look at
Documentation/powerpc/booting-without-of.txt. Then start poking Matt Porter about when he's going to get 4xx ported toarch/powerpc.
That depends. I am a consultant. My works is primarily paid for by
my clients, clients.
I tinker when I am not otherwise busy. But I am very busy, despite
being short on work !?
Quoted 7 lines
I've been half heartedly looking at what needs to be done to generate a device tree based on either system.mhs or
xparameters.h. I'm probably going to write a tiny C program that is compiled againstxparameters.hand spits out a valid dts file. The dts file can then be run through the device tree compiler to produce the flattened device tree structure.
That sounds somewhat interesting.
But as was somewhat raised elsewhere - what about partial
reprogramming the FPGA on the fly ?
One of the fundimental issues I am facing, is that I have to deal
with a system where nothing is certain except that there is a
ppc405 present. There will always be more than that - but there is
not another component that MUST be present.
As things go forward, more optional components get added. Pico is not yet doing partial FPGA reprogramming on the fly - but I
am certain it is coming. It fits perfectly with the goals and objectives
of the company and its clients.
For the moment the problem is fairly small. But it is only going to
get worse with time. The decisions I make now, will either make my life pleasant or horrible later.
Better to work towards where we are going now.
I guess I need to digestDocumentation/powerpc/booting-without-of.txt. now. At the moment things are busy
Quoted 24 lines
Quoted 9 lines
The vague Picture I have is the have something to do with some
datastructure that Mac's typically create at or prior to boot. And that for
embedded systems we are building them
externally compiling them and then attaching the compiled device
tree
to our project.That right. You don't compile device base addresses, irqs, etc into the kernel. You pass them in at boot time with a data structure.
Quoted 11 lines
I got a Xilinv V4 device currently with a Pic, UartLite, TEMAC,
Flash
and Keyhole (pseuodo serial host interface). Of those it is only certain that the flash will always be there.
We have bit images with Keyhole only, Uartlite only TEMAC only,
Sometimes we have a Pic sometimes not. I was trying to get to the point were
I could dynamically add what was there
to Platform devices during initialization.
Quoted 7 lines
Quoted 3 lines
If Device trees are static, then do they even apply to what I
have to
deal with ?Device trees don't have to be static. They can be generated/modified on the fly if the bootloader supports it. Or you can pass a different tree depending on what IP you have on the board.
Can you populate the tree dynamically inside the Linux setup code ?
Quoted 4 lines
Cheers,
g.
Signature · 8 lines
Dave Lynch DLA Systems Software Development: Embedded Linux 717.627.3770 [email protected] 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
Quoted 10 lines · David H. Lynch Jr.
Quoted 6 lines
I've been half heartedly looking at what needs to be done to generate a device tree based on either system.mhs or
xparameters.h. I'm probably going to write a tiny C program that is compiled againstxparameters.hand spits out a valid dts file. The dts file can then be run through the device tree compiler to produce the flattened device tree structure.That sounds somewhat interesting.
But as was somewhat raised elsewhere - what about partial
reprogramming the FPGA on the fly ?
Then you'll need to register/unregister devices from the platform bus on the fly (assuming the FPGA is reprogrammed after control is passed to Linux). The device tree is primarily for passing information from the boot loader to linux. Once linux is booted and the fdt is used to populate the platform buss, you can safely ignore it.
Quoted 4 lines
Quoted 3 lines
Device trees don't have to be static. They can be generated/modified on the fly if the bootloader supports it. Or you can pass a different tree depending on what IP you have on the board.
Can you populate the tree dynamically inside the Linux setup code ?
Yes; there is a common library that is being developed to generate/modify the device tree from anywhere; boot loader, inside the kernel (like for kexec), etc. Search the mailing list.
Signature · 4 lines
Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. [email protected] (403) 399-0195