A general construction of permutation polynomials of Fq2