Please check the wiki,
http://nioswiki.jot.com/wikihome/operatingsystems/epcsguide (
http://nioswiki.jot.com/wikihome/operatingsystems/epcsguide)
http://nioswiki.jot.com/wikihome/operating...flashprogrammer (
http://nioswiki.jot.com/wikihome/operatingsystems/flashprogrammer)
You will setup the epcs as a mtd block devices, with mtd map file.
Then you can update epcs by open, write, read, to the block device.
I think the altera epcs bootloader works fine.
You can study the altera supplied epcs bootloader code, then you will know how to compute the size of fpga configuration data. Or you may update both of them together.