The bulk, surface and corner free energies of the square lattice Ising model