The PROGRAMn and DONE pins on the LatticeXP2 can be either dedicated for device configuration, or they can become General Purpose I/O (GPIO). The CFG0 input pin to the FPGA controls how these pins behave. You can find full details in LatticeXP2 sysCONFIG Usage Guide under the CFG[1:0] header.