Xilinx ML310
From SecretLab
Below are some observations that I wish to share that took me some time to figure when compiling Linux 2.6 for the Xilinx ML310.
Contents |
Xilinx SystemACE Driver
After some experimentation with the latest source code, I had problems using the new Xilinx SystemACE driver (the ones that are in the mainline kernel, xsysace.c). What I found after debugging a kernel hang at boot is that the bus width is hardcoded to 16 bits in the xsysace.c file.
The following patch will make the SystemACE block driver work on the ML310. Sooner or later, this modification will not be required since its possible to include a configuration parameter for the kernel which will handle the various bus width (8 or 16 bits) for this driver.
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 82effce..0f696f8 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -79,6 +79,7 @@
*/
#undef DEBUG
+#define DEBUG
#include <linux/module.h>
#include <linux/ctype.h>
@@ -1126,7 +1127,7 @@ static void __devexit ace_free(struct device *dev)
static int __devinit ace_probe(struct platform_device *dev)
{
unsigned long physaddr = 0;
- int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */
+ int bus_width = ACE_BUS_WIDTH_8; /* FIXME: should not be hard coded */
int id = dev->id;
int irq = NO_IRQ;
int i;
You may want to ignore the definition of DEBUG if you don't want to see all the details about the system ACE at boot.
PCI Bridge
At this point, I could not get the PCI bridge working with Linux 2.6.
Its a bit sad because it means no networking, USB ports, etc... A lot of the peripherals on the ML310 are accessible via the PCI bus.
Xilinx has confirmed that the PCI bridge is working on a 2.6 Kernel with a Montavista Linux distribution. You will get an error similar to this when compiling the Secret Lab's kernel if you enable PCI support:
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
It basically means that some of the PCI constants related to the various address range re-mapping are not being exported correctly by the EDK tool. I did not yet try to do the mapping manually and see if that works or not.
Other Notes
Lack of network
Having no networking is not fun, but I can still update my .ACE files via the serial console. Here is the recipe for updating the .ACE file without having to swap the Compact Flash card to your workstation:
- You will need to have a root filesystem running that you install via your workstation on the CompactFlash card. I use Busybox compiled with uClibc.
- Then cross-compile the LRZSZ serial file transfer program. I had to take off foreign language support (a configuration option) and do some manual editing of the Makefiles generated to point the compiler to my powerpc gcc.
- Install the two binary files lrz and lsz (to send and receive) in your root file system.
- Then you can use minicom to send your systemAce (.ACE) file from your serial console to your ML-301 compactflash card. Since the serial link is slow, I use bzip2 to compress the .ACE before sending. It takes approximately 1.5 minutes to send the compressed file over (at 115200 bauds).
- My FAT16 file system from the CompactFlash card is mounted and I simply decompress and replace the ACE file on the disk and reboot.
