[U-Boot-Users] Some RFCs about U-Boot's the generic FPGA support

Laurent Pinchart laurentp at cse-semaphore.com
Tue Aug 21 13:33:01 CEST 2007


On Tuesday 21 August 2007 12:46, Matthias Fuchs wrote:
> Laurent,
>
> now things are getting clearer.
> All this sounds to me that the shift direction in
> slave serial mode is not compatible to the parallel download
> code. When we say that fpga_load (and the fpga load command) should only
> work for promgen files with mirrored bits and fpga_loadbitstream()
> (and the fpga loadb command) should be used for .bit files, I
> would like to get rid of the mirroring at least for slave serial mode
> because changing the shift order is much more efficient.

If I understand things well, you would like to get rid of the bit mirroring 
code to optimize slave serial loading (where changing the shift direction has 
no performance impact).

> Bruce suggested a CONFIG option to turn on/off mirroring. This is
> not the right way. It should be handled by the FPGA subsystem.

Agreed.

> What about passing a bitorder flag down to the load functions?
> So we get rid of the huge malloc in loadbitstream and we can
> just swap bits in parallel mode just before writing it to the
> FPGA port.

Would it have an impact on slave parallel performances ? Mirroring each byte 
separately in the slave parallel code might slow things down. I personally 
don't use the bitstream mirroring code (I use PROM files, so the bitstream is 
mirrored on the host before loading it to the target flash memory), but it 
might affect other users.

> For Slave serial mode the _load funtion can use 
> the correct shift direction and so swapping is needed.

I suppose you mean "swapping is not needed", as the load function would choose 
the shift direction depending on the bitorder flag.

it seemed cleaner to me to handler mirroring at the high level, so lower-level 
layers wouldn't have to care about it. If you want to optimize performances, 
why don't you use a PROM file instead of a .bit file ?

Laurent Pinchart

> On Tuesday 21 August 2007 10:59, Laurent Pinchart wrote:
> > > So what option are you using for and which bitsteam format/file are you
> > > using?
> >
> > I'm calling fpga_load directly from board-specific code, using PROMgen
> > generated data (with bit mirroring applied).
> >
> > Bit mirroring might not be needed in slave serial mode, but is needed in
> > slave parallel mode. Bytes in the .bit file are stored with the LSB on
> > the left side. The bytes must then be reversed before being written in
> > slave parallel mode, as the FPGA expects the LSB on D0, not on D7.
> >
> > In slave serial mode, you can choose the shift direction, so mirroring is
> > not required.
> >
> > > I still vote for removing the bit mirror :-)
> >
> > Without mirroring, bitstreams won't load in slave parallel mode. You
> > should keep mirroring, and change the slave serial code to shift bits the
> > other way around.
> >
> > > Are you using .bit Images, PROM files and which fpga command option
> > > do you use? load or loadb?
> >
> > I don't use the fpga commands, but call fpga_load() directly from board
> > specific code. This is roughly equivalent to "fpga load". The data come
> > from a bit-mirrored PROM file. I used to use a .bit file, which required
> > "fpga loadb" to be loaded correctly.

-- 
Laurent Pinchart
CSE Semaphore Belgium

Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium

T +32 (2) 387 42 59
F +32 (2) 387 42 75




More information about the U-Boot mailing list