There is scholarly agreement that there was worship of the male generative organ in the Indus Valley civilization. Both archaeological remains and explicit references to “worshippers of the phallus” in the Rigveda support such an interpretation. However one interprets Siva‘s origin—as from the Indus Valley, from tribal religion, within the Aryan clans, or any combination of these—use of the linga to represent Siva was indisputable in the Epics and Puranas. Three myths will suffice: one of self-castration, another about an attempted curse, and then one about the consequence of a curse.
In the Siva Purana Brahma, Vishnu, and Rudra ((Siva) were arguing over creation. When Brahma and Vishnu told Siva that he was the lord of everything and for him to create as he wished, SSiva dove into the cosmic waters for more than a thousand celestial years. Brahma and Vishnu decided not to wait for creation any longer, so Vishnu gave Brahma enough energy (sakti) to bring everything into being. Just when Brahma had finished his creation, Siva emerged from the water and angrily destroyed everything by fire. The frightened Brahma worshiped Shiva lavishly, whereupon the pleased Shiva granted Brahma a boon. Brahma asked that everything be restored. Siva restored Brahma’s creation, discovered that he had no use for all the creative energy he had stored up, and tore off his linga. The discarded linga extended deeper into the cosmic waters than Vishnu could dive and higher into the cosmos than Brahma could soar. So they instituted worship of the linga with heart and mind focused upon Shiva, because all desires would be fulfilled by Shiva.
In the Brahmanda Purana the seven great sages (sapta-rishis), primordial maharishis (great sages) led by Bhrigu, were visited by Siva in the pine forest on the slopes of Himalaya. Despite all their asceticism and orthodox living they were unable to recognize the god of gods, Mahadeva himself. He was smeared
Siva sitting in front of the Siva Linga in this common representation
with ash, naked, his linga decorated with red and white chalk, howling and dancing. He excited their wives, so the sages used all their ascetic powers (siddhis) to curse him—but to no avail. Their curses had been effective against all the other gods: Brahma’s sacrifice was destroyed; Vishnu’s incarnations were made miserable by Bhrigu’s curse; Indra was castrated by Gautama’s curse; the Vasus were imprisoned as embryos; Nahusha was cursed to be a serpent; the Milky Ocean was made undrinkable; Dharma-deva was cursed by Mandavya. So again they tried, cursing Siva’s ling to fall off. Even then they failed. But Siva chose to disappear, cutting off his own linga and leaving the world without any light or energy. So the sages raced in panic to Brahma and learned that they had been dealing with the lord of the universe. They learned from Brahma how to propitiate him with an image of the ling as they worshipped and praised Shiva. Finally, Shiva revealed himself to them and taught them the supreme yoga so that they would be purified.
In the Padma Purana the great sages wanted to know who was the supreme lord and deserved their worship. Bhrigu was selected to test each of the Trimurti, the Hindu Triad. Bhrigu went to Kailasa and demanded to see Siva. But Nandi, Shiva’s bull, rudely prevented him from going into SSiva’s palace because SSiva was making love and was not to be disturbed by anyone. After many days of waiting, Bhrigu cursed SSiva: because he was so addicted to lovemaking, he would only be worshipped as a linga and yoni (female generative symbol). Bhrigu further declared that no twice-born (orthoprax Hindus of the upper three castes, but in this story, seemingly just brahmins) would worship SSiva. Next Bhrigu traveled to Brahmaloka and again was not welcomed. Brahma sat on his lotus flower full of passion (rajas). So Bhrigu cursed him: Brahma would cease to be worshipped by anyone. Finally, Bhrigu went to the northern shore of the Milky Ocean and found Vishnu sleeping on his serpent, Ananta (eternity). When Vishnu did not wake up immediately, Bhrigu became angry at his lack of courtesy and kicked Vishnu. isvara awoke, saw Bhrigu, and welcomed him in the highest manner expected by a brahmin—even thanking him for kicking him with feet whose dust caused good fortune. The proud brahmin had finally found a god who was worthy of worship by brahmins. So he returned to the great sages and reported that only Vishnu could be worshipped by the twice-born. Then he bragged about his curse: thanks to him, in the future SSiva would only be worshipped in a despicable form—the linga.