--- Quote Start ---
Do I also have to add these offsets in custom_fpga.h or is it only necessary in these commands?
--- Quote End ---
Don't modify custom_fpga.h, just use the correct addresses in the commands. Drivers will use the addresses in custom_fpga.h and ioremap() them as appropriate.
--- Quote Start ---
Do I have to add this offset( 0xc0000000) in the command sof2flash for the EPCS?
--- Quote End ---
I don't know much about programming EPCS, but this is what I do to program in the FPGA configuration image:
sof2flash --activeparallel --offset=0x20000 --input=/data/nios/myfpga.sof --output=myfpga.flash
nios2-flash-programmer --base=0xe4000000 myfpga.flash --instance 1
My guess is for EPCS you just replace --activeparallel with --epcs
--- Quote Start ---
I don't know where to add --mmu option, could it be this place?
nios2-flash-programmer --mmu --base=0x08800000 ext_flash.flash
--- Quote End ---
That looks right.