
Legend of Tirumala

Tirumala Sri Venkateswara Temple at Tirupati in the Indian state of Andhra Pradesh is the most famous Vaishnavite temple in the world. The presiding deity of Vishnu here is referred to as Venkateswara. There are many legends regarding this temple.
"Sri Venkatachala Mahatyam" is the most accepted legend among these, which provides the history of the temple across the various yugas.
This place had also been mentioned in many puranas. It has been said as "Venkatadri samasthanam Brahmande nasti kinchana, Venkatesha samodevo na bhuto na bhavishyati" which literally translates as There is no place in the entire Universe which is equal to Tirumala and there is no other God equal to Venkatesha in the past, present or will be in the future.
Tirumala as Varaha Kshetra.
As per Varaha Purana, during Satya Yuga, Vishnu rescued Earth which was taken over by Hiranyaksha to Patala Loka (underworld) in the form of Adi Varaha – a wild boar with tusks. He fought a fierce duel with Hiranyaksa and killed him. He then slashed the water and brought up the Earth on his tusks. Brahma, the Devas and the sages extolled Adi Varaha's virtues, by chanting the Vedic mantras. They prayed to Him to re-establish the Earth as before. Adi Varaha obliged them, and called upon Brahma to recreate the world. He expressed his desire to reside on the Earth to protect its people. He commanded his vahana, Garuda to fetch Kridachala (an extensive natural hill with lofty peaks, embedded with gold and precious stones, and which resembled Adisesha in shape) from Vaikuntam. Garuda brought Kridachala and deposited it on a sacred spot (to the East of Swami Pushkarini) chosen by Adi Varaha. Brahma and the other holy personages requested the fearsome-looking Adi Varaha to assume a tranquil and composed look, and rest on the hill to protect men and grant boons to people unable to reach God through Dhyana Yoga (meditation) and Karma Yoga (doing one's own duty). Adi Varaha appeared with four arms and a white face. He was adorned with jewels and accompanied by Bhudevi. He resolved to stay at Venkatadri, under a divya vimana, to grant the prayers of devotees.
Legend of the Seshachalam Hills.
It is believed that the origins of the Tirumala Hills(Seshachalam Hills) lies in a contest between Vayu (the wind god) and Adisesha (the first serpent). During Dvapara Yuga, Adisesha blocked Vayu from entering Vaikuntam as Lord Vishnu was in the company of his consort, Lakshmi. An incensed Vayu challenged Adisesha to a fight to decide the stronger between them, Vayu was tasked with trying to blow off Adisesha from the holy Meru mountain while adisesha was asked to protect the peak with his hood. After a long time, Vayu appeared to stop and Adisesha lifted his hoods assuming that he had won the contest. Then, all of a sudden, Vayu then blew away one of the peaks. The peak landed near the Swarnamukhi river. Adisesha landed here and merged here with the hill. This hill is now known as Seshachalam Hills. A variant to the legend is that the contest created pandemonium on earth and Brahma, Indra and other gods pleaded with Adisesha to relent. When Adisesha accepted the plead, the peak (Ananda hill) and Adisesha were blown off (from) Meru and landed near the banks of river Swarnamukhi. When Adisesha was dejected and sad with his defeat, the Gods converted Adisesha into the seven hills with the hood named as "Seshadri" hill or "Seshachalam" hill or "Venkatadri" hill. Another variant to the story is: Adisesha, fatigued by the contest was instructed by Lord Vishnu to rest on Earth in a place that he chose for his stay in Kali Yuga. That place is known as Tirupati.
Legend of Venkateswara.
Lakshmi leaving Vaikuntam.
In the Kali Yuga, rishis performing "yagna" sought the advise of celestial sage Narada on which of the Trimurti should be selected for offering the fruits of the yagna. Narada suggested that the wise sage Bhrigu should be allowed to decide after he met the Trimurtis. The sage who had an extra eye in the sole of his foot visited Lord Brahma and Lord Shiva and went un-noticed in both these locations. He cursed Brahma that no temple sans one will worship Brahma and cursed Shiva that temples on Earth will worship him as Lingam.
When Sage Bhrigu visited Lord Vishnu who was in a private meeting with His wife Goddess Lakshmi, He failed to immediately receive and honour the sage and the sage felt humiliated and angry by this act. Sage Bhrigu kicked Lord Vishnu on the chest, to which Vishnu did not react and instead apologized to the sage by massaging his feet. During this act, he squashed the extra eye that was present in the sole of Bhrigu's foot. The extra eye is believed to represent the sage's false egotism. The sage then realised his grave mistake and begged forgiveness from Lord Vishnu.
Lord Vishnu's chest is significant as the abode of Goddess Lakshmi. The Goddess felt highly insulted at the sage's misdemeanour and Lord Vishnu's silence at the act, and left Lord Vishnu's heavenly abode (Vaikunta).
Goddess Lakshmi on leaving the Vaikuntham comes to Varaha Kshetra and does intense penance for 12 years. The Gods, terrified with her intensity, mollified her into returning to Vaikuntam with the promise that the site of her penance would bear Goddess Padmavati ("Alamelu Manga Devi") as an incarnation of Goddess Lakshmi during the rule of Akasa Raja.
Vishnu leaving vaikuntam.
After the departure of Goddess Lakshmi, Lord Vishnu left Vaikuntham and took his abode in an ant-hill on the Venkata Hill under a tamarind tree beside a Pushkarini. Lord Brahma and Shiva, taking pity on the condition of Vishnu, made up their mind to assume the forms of a cow and calf to serve him. Surya – Sun God informed Lakshmi of this and requested her to sell the cow and calf to the king of the Chola country assuming the form of a cowherdess.
Curse of chola king.
The Chola king sent the cow and its calf to graze on the Venkata Hill along with his herd of cattle. Discovering Lord Vishnu in the ant-hill, the cow every day emptied her udder over the ant-hill and thus fed the Lord. Over a period of time, the queen noticed that the cow did not yield any milk and chastised the cowherd severely.
The cowherd investigating the cause, followed the cow and discovered the cow emptying her udder over the ant-hill. In his anger, the cowherd aimed a blow with his axe on the head of the cow but struck God who rose from the ant-hill to receive the blow and save the cow. On seeing Lord Vishnu bleeding, the cowherd fell down and died. On the death of the cowherd, the cow returned to the king with blood stains on her body, bellowing in the presence of the Chola King. An anxious king followed the cow to the scene of the incident. Near an ant-hill, the King found the cowherd lying dead on the ground.
While the King stood wondering how it had happened, the Lord rose from the ant-hill and cursed the king to become an Rakshasa (Demon) for the fault of his servant. Entreated by the king who pleaded innocence, the Lord blessed him by saying that His curse would end when He was adorned with the Kireetam (crown) presented by Akasa Raja at the time of His marriage with Sri Padmavati. To atone the sins of raising the axe against the Lord, the cowherd's "atma" (spirit) received the boon that he and his descendants would have the pleasure of opening the door in the Lord's temple in due time.
Goddess Padmavati.
In due time, the Chola king was reborn as Akasa Raja and though he ruled well, he had no children born to him. When he conducted yagna and was tilling the ground, he found a baby in a lotus flower and named her Padmavati (possessing Lotuses) and adopted her as his daughter. Lord Vishnu reincarnated as Srinivasa (or presented himself after penance in the ant-hill) as the son of elderly woman-saint
Vakula Devi. Vakula Devi was Yashoda in her previous birth, Lord Krishna's foster-mother and was unhappy in that life for not seeing his marriage (also she worried that Krishna was not born to her, it's a variant). As per the boon received from Krishna that he will be with her as a son for her entire life in the next birth, she was reborn as Vakula Devi and Krishna as Venketshwara stayed with her as her son.
In course of time Princess Padmavati grew up into a beautiful maiden and was visited by Saint Narada. On reading her palm, he foretold that she was destined to be the spouse of Lord Vishnu himself. In due time, Lord Srinivasa on a hunting trip was chasing a wild elephant in the forest. The elephant led him into a garden where Princess Padmavati and her maids were present .The sight of the elephant frightened them and their Princess. When Lord Srinivasa appeared in front of the Elephant, it immediately turned round, saluted the Lord and disappeared into the forest. Lord Srinivasa noticed princess Padmavati and enquired about her from her maids. Enthralled by her, Lord Srinivasa lost interest in other activities and confided in Vakula Devi on his love for Padmavati. He also revealed his identity as Lord Vishnu as well as told her about her past life as his foster-mother Yasodha.
Marriage of Srinivasa & Padmavati.
Vakula devi leaves her hermitage to approach Akasa Raja with her proposal of marriage between Lord Srinivasa and Padmavati. In the meantime, the restless Lord came to the city in the disguise of a fortune-teller. Princess Padmavati also fell in love with Lord Srinivasa and fell ill after returning to the Palace. Unable to diagnose her ill-health, the maids invited the fortune-teller into the palace to foretell the future of the princess. When the fortune-teller revealed that Padmavati was born to marry Lord Vishnu in his current avatar as Lord Srinivasa, she recovered. As the king heard of this news, Vakula announced herself to the King and asked for his daughter's hand in marriage to her son, Lord Srinivasa. The overjoyed king agreed and his advisor Bhrihaspati wrote the invitation for the wedding between the two avatars.
Lord Srinivasa called for a conference of the Gods to win their consent for His marriage with Princess Padmavati. The Lord also obtained a heavy loan from Kubera, god of wealth towards expenses for the wedding as well as provide proof of his wealth.
Srinivasa turns into Venkateswara.
In about 6 months after this celestial marriage, MahaLakshmi comes to know that her husband married again and comes to see him in disbelief. It is said that the Lord turns into Stone right when he is encountered by Mahalakshmi and Padmavati. Lord Brahma and Shiva appear before the confused queens and explain the main purpose behind all this – The Lord's desire to be on the 7 hills for the emancipation of mankind from the perpetual troubles of Kali Yuga. Goddesses Lakshmi and Padmavati also turn into stone idols expressing their wish to be with their Lord always. Lakshmi stays with Him on His Chest on the left side while Padmavati rests on His Chest's right side.
Rangadasa was a staunch devotee of Vishnu and in the course of his pilgrimage, joined Sage Vaikhanasa Gopinatha, who was going up the Tirumala Hill for the worship of the Lord. This was after the Lord had settled the Adivaraha region. After bathing in the Swami Pushkarini, Rangadasa viewed Lord Vishnu beneath a tamarind tree. However Lord Vishnu was exposed to the sun, wind and rain and was only protected by the extended wings of Garuda. Rangadasa raised a rough wall of stones around the deity, and started supplying flowers to Gopinatha every day for Vishnu's worship. One day, Rangadasa was distracted by a Gandharva king and his ladies and forgot to supply flowers to Gopinatha for Vishnu's worship. The Lord then revealed Himself and told Rangadasa that he had not been steadfast and had succumbed to temptation. However, in acceptance of Rangadasa's devoted service to Him till then, the Lord blessed Rangadasa that he would be reborn as an affluent ruler of a province and would enjoy the earthly pleasures. He would continue to serve the Lord, construct a beautiful temple with a vimana and high surrounding walls, and thereby earn eternal glory.
Soon the site was forgotten and an ant-hill formed over the temple. This is reputed to be the same ant-hill in which Lord Srinivasa resided later after descending from Vaikuntam.
Temple for Venkateswara.
Rangadasa was reborn as Tondaman, the son of the royal couple, Suvira and Nandini. Tondaman enjoyed a pleasurable life as a young man. One day, he set out on a hunting expedition on the Tirumala Hill, and with the help of a cow-herd, saw Vishnu under the tamarind tree. Tondaman returned home, deeply affected by the vision of Vishnu. Tondaman later inherited his father's kingdom, Tondamandalam. In accordance with the directions given by Adivaraha to a forester, Tondaman constructed a "prakaram"(closed precincts of a temple) and dvara gopura, and arranged for regular worship of the Lord as per Vaikhanasa Agama.
Lord Venkateswara appeared in the dream of Thondaman and asks him to build a temple for him where he turned into stone. So comes into being the temple for Venkateswara on the seventh hill, named Venkatadri (Venkata Hill) at present day Tirumala-Tirupati.
Mention in Vedas.
Discovery of the Venkateswara deity is described as an act of divine providence: There was a huge anthill at Tirupati, and one day a local farmer heard a voice from the heavens asking him to feed the ants. By chance the local king heard the voice and began supplying milk for the ants himself. His compassion resulted in the liquid uncovering the magnificent idol of Venkateswara hidden within the anthill. 
Srivaishnavite tradition opines that the Rig Veda verse X.155.1 makes an indirect reference to the temple. One such translation goes as: 
Thondaiman, ruler of Thondaimandalam(present day Kanchipuram and the surroundings), is believed to have first built the temple after visualizing Lord Vishnu in his dream. He built the Gopuram and the Prakhara, and arranged for regular prayers to be conducted in the temple. Later on, the Chola dynasty vastly improved the temple and gave rich endowments. To date, the various scripts are still seen inscribed upon the temple prakara walls. The Sangam literature such as that of Silapadikaram and Satanar Manimekalai, dated between 500BC and 300AD, mentions Thiruvengadam (now named Tirupati) by the appellation "Nediyon Kunram" as the northernmost frontier of the Tamil kingdoms. In fact, a fairly detailed description of the deity is given in lines 41 to 51 of Book 11 of the Silapadikaram. Again, the appellation "Nediyon" for the deity occurs in the following verses:
Puranic literature which was composed roughly around the post-Mauryan and early-Gupta era also mentions Tirupati as the Aadhi Varaha Kshetra. The Puranas associate the site with Lord Varaha, a Dashavatara of Lord Vishnu. The Varaha shrine holds great importance in Tirupati and is said to be older than the main sanctum of Venkateswara. There is also the Ranga Mandapam, which is to the left side of the temple as one enters.
Srivari Brahmotsavams.
Srivari Brahmotsavam is the most important annual festival celebrated at Sri Venkateswara Temple. The event is conducted for nine days during Hindu Calendar month of Āśvina which falls in between the English months September and October. As per the legend it is believed that Lord Brahma will descend to the earth to conduct this festival and hence the festival got the name Brahmotsavams, meaning an utsavam(festival) performed by Brahma. "Sri Venkteswara Sahasranamastotra" has references to Brahma performing the festival. To resemble this even now a small empty chariot will move ahead of the processions of the Venkateswara's processional deity Malayappa.