Greenaway helped the Doctor defeat a sea creature that threatened to invade his village. In the attack, Greenaway lost his legs. A third of his skull was replaced with metal. His mind couldn't accept this and he became trapped in his mind.
Greenaway was visited telepathically by several incarnations of the Doctor, all of whom tried to convince him to come out of himself.
On his last visit, the Doctor told Greenaway that the machinery could no longer keep him alive. The Doctor had come to tell him goodbye. When the Doctor left, he turned off the machine.