We consider functions of p2-valued logic (p is prime) that may be implemented by polynomials over the ring ℤp2, and describe all closed classes that contain linear functions. It turns out that the set of these classes is countable. We also construct the lattice of such classes with respect to inclusion.