cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jpl@xiphos.ca
Adventurer
Adventurer
7,569 Views
Registered: ‎10-28-2007

Problem Building Linux with PCI for Microblaze

Jump to solution

Gidday there,

 

I'm successfully building and booting linux-2.6-xlnx from git on a microblaze running on a Virtex-4.

 

I've enabled PCI in the kernel menuconfig and I get the following error.

 

 

... LD net/ipv4/built-in.o LD net/built-in.o LD vmlinux.o MODPOST vmlinux.o WARNING: modpost: Found 4 section mismatch(es). To see full details build your kernel with: 'make CONFIG_DEBUG_SECTION_MISMATCH=y' GEN .version CHK include/generated/compile.h UPD include/generated/compile.h CC init/version.o LD init/built-in.o LD .tmp_vmlinux1 drivers/built-in.o: In function `pci_create_sysfs_dev_files': /home/jpl/Work/ExNet/Q6/xilinx/linux-2.6-xlnx/drivers/pci/pci-sysfs.c:1061: relocation truncated to fit: R_MICROBLAZE_32_PCREL_LO against symbol `pcibios_add_platform_entries' defined in .text section in arch/microblaze/pci/built-in.o make: *** [.tmp_vmlinux1] Error 1 [jpl@elmer linux-2.6-xlnx]$

 

Has anyone seen this before?

 

Thanks

 

Joshua

 

0 Kudos
1 Solution

Accepted Solutions
jpl@xiphos.ca
Adventurer
Adventurer
9,064 Views
Registered: ‎10-28-2007

I have found the cause of the problem, but I'm not sure of the most appropriate fix.  It appears as if the microblaze compiler is not doing a good job of handling the "weak" attribute of gcc.  Within drivers/pci/pci-sysfs.c, there is a simple implementation of pcibios_add_platform_entries as follows.

 

 

int __attribute__ ((weak)) pcibios_add_platform_entries(struct pci_dev *dev)
{
        return 0;
}

 

 

According to the ((weak)) attribute, this should be overridden by 'user' code, such as the implementation provided in arch/microblaze/pci/pci-common.c.  However, something doesn't appear to handle this correctly in the mb-linux-gcc/ld as distributed by git.xilinx.com.

 

The current solution; comment out the pcibios_add_platform_entries function in drivers/pci/pci-sysfs.c.

 

At some point, I'll try to make a non-kernel example of using ((weak)) and see if this problem persists.

 

Joshua

 

 

View solution in original post

0 Kudos
7 Replies
jpl@xiphos.ca
Adventurer
Adventurer
7,522 Views
Registered: ‎10-28-2007

I recently saw a few things updated with a 'git pull', but I'm still getting the same error with version g1743154.

 

Is anyone using PCI on microblaze with Linux?

0 Kudos
jpl@xiphos.ca
Adventurer
Adventurer
9,065 Views
Registered: ‎10-28-2007

I have found the cause of the problem, but I'm not sure of the most appropriate fix.  It appears as if the microblaze compiler is not doing a good job of handling the "weak" attribute of gcc.  Within drivers/pci/pci-sysfs.c, there is a simple implementation of pcibios_add_platform_entries as follows.

 

 

int __attribute__ ((weak)) pcibios_add_platform_entries(struct pci_dev *dev)
{
        return 0;
}

 

 

According to the ((weak)) attribute, this should be overridden by 'user' code, such as the implementation provided in arch/microblaze/pci/pci-common.c.  However, something doesn't appear to handle this correctly in the mb-linux-gcc/ld as distributed by git.xilinx.com.

 

The current solution; comment out the pcibios_add_platform_entries function in drivers/pci/pci-sysfs.c.

 

At some point, I'll try to make a non-kernel example of using ((weak)) and see if this problem persists.

 

Joshua

 

 

View solution in original post

0 Kudos
linnj
Xilinx Employee
Xilinx Employee
7,441 Views
Registered: ‎09-10-2008

Yes we know that's a problem with the tools.  It's being fixed in a new version of the tools.

 

For now, we have hacked around the problem.

 

Sorry.

0 Kudos
ltovey
Observer
Observer
6,559 Views
Registered: ‎03-01-2010

John,

 

Can you explain the hack?  Thanks.

0 Kudos
linnj
Xilinx Employee
Xilinx Employee
6,539 Views
Registered: ‎09-10-2008

Hi,

 

Seems like I just hacked out the weak was the only hack to work around it. I'm having a hard time remembering. Have you searched this forum as I think it came up before several times.

 

Sorry for not being more helpful.

0 Kudos
ltovey
Observer
Observer
6,535 Views
Registered: ‎03-01-2010

John,

 

It looks like commenting out those lines made it stop complaining.  A previous message in the thread actually said to to comment it out, I just had not read it carfully enough.  Thank you though.

 

I noticed that the Linux Wiki says that the PCI support is only for the PPC.  Is there any reason it won't work on a microblaze system?  This thread also seemed to talk about that also, but no one answered that part.

 

-L. Tovey

0 Kudos
linnj
Xilinx Employee
Xilinx Employee
6,528 Views
Registered: ‎09-10-2008

I don't think that Microblaze with PCI was ever completely tested at Xilinx was the issue.

 

I think PCI is in the mainline already as I'm sure that Petalogix is using it, and I sort of remember patches going in.

 

Thanks.

 

0 Kudos