[U-Boot-Users] RFC: Some improvements for the FPGA subsystem

Bruce_Leonard at selinc.com Bruce_Leonard at selinc.com
Mon Nov 12 23:55:58 CET 2007


Matthias,

Matthias Fuchs <matthias.fuchs at esd-electronics.com> wrote on 11/11/2007 
08:45:02 AM:

< snip > 

> 5) Add post() and pre() callback for Spartan2/3 FPGAs inslave serial 
mode.

Only comment I have is to point out that one of the things we talked about 
last summer.  The Spartan 3 code in particular (and I think all of the 
Xilinx/Altera code in general) makes the pre()/post() function calls 
optional.  However, the relocation code doesn't check to see if the 
pre()/post() functions exist and therefore incorrectly "relocates" them 
even if they don't exist.  This causes problems later because they now 
appear to exist since they no longer have a NULL address.  One of the 
things we talked about was makeing the FPGA relocation code smart enough 
to detect NULL addresses for these functions and not relocate them.

Now it may not be an issue anymore.  I made the changes to the code, but 
when stepping through 1.3.0-rc3 of the code, I noticed that gd->reloc_off 
= 0 which ment that the relocation_offset passed to the FPGA relocation 
code was zero and therefore nothing actually got relocated.  So a NULL 
pointer is still NULL when zero is added to it.  Now, I'm not sure why 
gd->reloc_off = 0, it may be my setup, it may be I'm broken, it may be 
that it's no longer used for some reason I don't know about.  But it seems 
to me that the FPGA relocation code should still deal with non-existant 
pre()/post() functions, just in case gd->reloc_off is not zero in someone 
else's circumstances.

My 2 cents worth and thanks for making these changes.  I'm looking forward 
to them all.

Bruce
 





More information about the U-Boot mailing list