See Sir J. G. Frazer, Adonis, Attis, Osiris (1907, new ed. 1961).
Attis was originally a local semi-deity of Phrygia, associated with the great Phrygian trading city of Pessinos, which lay under the lee of Mount Agdistis. The mountain was personified as a daemon, whom foreigners associated with the Great Mother Cybele.
The story of his origins from Agdistis, as told to the traveller Pausanias, have some distinctly non-Greek elements: Pausanias was told that the daemon Agdistis initially bore both male and female attributes. But the Olympian gods, fearing Agdistis, cut off the male organ and cast it away. There grew up from it an almond-tree, and when its fruit was ripe, Nana who was a daughter of the river Sangarios picked an almond and laid it in her bosom. The almond disappeared, and she became pregnant. Nana abandoned the baby (Attis). The infant was tended by a he-goat. As Attis grew, his long-haired beauty was godlike, and Agdistis as Cybele, then fell in love with him. But the foster parents of Attis sent him to Pessinos, where he was to wed the king's daughter. According to some versions the King of Pessinos was Midas. Just as the marriage-song was being sung, Agdistis/Cybele appeared in her transcendent power, and Attis went mad and cut off his genitals. Attis' father-in-law-to-be, the king who was giving his daughter in marriage, followed suit, prefiguring the self-castrating corybantes who devoted themselves to Cybele. But Agdistis repented and saw to it that the body of Attis should neither rot at all nor decay.
Attis was reborn as the evergreen pine. At the temple of Cybele/Rhea in Pessinos, the mother of the gods was still called Agdistis, the geographer Strabo recounted.
As neighboring Lydia came to control Phrygia, the cult of Attis was given a Lydian context too. Attis is said to have introduced to Lydia the cult of the Mother Goddess Cybele, incurring the jealousy of Zeus, who sent a boar to destroy the Lydian crops. Then certain Lydians, with Attis himself, were killed by the boar. Pausanias adds, to corroborate this story, that the Gauls who inhabited Pessinos abstained from pork. This myth element may have been invented solely to explain the unusual dietary laws of the Lydian Gauls. In Rome, the eunuch followers of Cybele were known as Galli ("Gauls").
As the orgiastic cult of Cybele spread from Anatolia to Greece and eventually to Rome in the time of Claudius, the cult of Attis, her reborn eunuch consort, accompanied her. The first literary reference to Attis is the subject of one of the most famous poems by Catullus. but it appears that the cult of Attis at Rome was not attached to the earlier-established cult of Cybele until the early Empire.
A marble bas-relief of Cybele in her chariot and Attis, from Magna Graecia, is in the archaeological museum, Venice. A finely executed silvery brass Attis that had been ritually consigned to the Mosel was recovered during construction in 1963 and is kept at the Rheinisches Landesmuseum of Trier (see link for illustration). It shows the typically Anatolian costume of the god: trousers fastened together down the front of the legs with toggles and the Phrygian cap.
In 2007, in the ruins of Herculaneum a wooden throne was discovered adorned with a relief of Attis beneath a sacred pine tree, gathering cones. Historical records indicate that the cult of Attis was popular in Herculaneum at the time of the eruption of Vesuvius in 79 AD.