''Shivalinga ''symbolizes trinity gods, cosmos and male -female energy

Shiva lingam embodies trinity gods. quora.com/

A lingamwith 1001 carved lingam.wikipedia.org

The worship of Linga or Lingam is an integral part of  the Hinduism  and has been around since  the time of the Upanishads. The worship is wide spread across  India and there are countless historical Hindu temples dedicated to God Shiva who is worshipped in the form of Linga. In southern India, especially Tanil Nadu,  the Chola and Pandya dynasties  patronized Shiva worship. So were many rulers in Karnataka and Andhra. There is a large community in Karnataka known as Lingayats who worship mainly God Shiva and it is mandatory for them to  wear   small Linga  image as a garland or mala. Founded by social reformer Sri Basava (12th century), to the Lingayats, Shiva is a formless  entity (ishta linga). 

A typical lingamen.wikipedia.org

Linga or Lingam is an abstract or aniconic representation of the Hindu God Shiva  mainly worshiped  by Shaivites - followers of Shaivism.  Used for worship in temples  where it is a natural object or self-manifested natural object, it is a word derived from Sanskrit ''linga''and is symbolic of energy and potential. The object is more often than not looked upon as an object of spiritual iconography. The lingam is often cast in a Yoni  within the disc shaped platform or base called ''Pitha'' symbol of male  energy and over all potential.  

On the other hand ''Yoni'' is simply a representation of Goddess (feminine power) Shakti,  the creative force that permeates through out the universe and the concept of ''Linga'' itself  is about the merging of two cosmos - macro and micro entities involving creation and recreation. As a whole linga represents the natural  and eternal process of creation, recreation  and destruction (denudation),thus  balancing the creative and destructive forces - "the totality of all existence". The  interlocking of two aniconic forms implies the interdependent union of the feminine and masculine energies for creation and destruction of existence. It is a mutual dependence between Shakti and Shiva, if one is missing, the other  can not exist. The Trinity gods are represented in the Linga-  God Brahma (Creator) in the root, Vishnu (Sustainer) in the middle and Rudra (Shiva -Destroyer) at the top. The shape itself has philosophical connotation implying that God  has no ''Aathi and  no Antham''- no beginning and no end (formless) - omnipresent, the divinity is every where. He is the absolute reality, the timeless, formless and space less.

The word lingam is not found in  the Rigveda and other Vedas we do not find any reference to Lingam. However  the  Rudra (proto-Shiva) is mentioned the Vedic literature. It is mentioned in the early Upanishads. The oldest lingam dating back to  the 3rd-century BCE or the 2nd century BCE that is still being worshipped is in the Parashurameshwara temple, Gudimallam, in a hilly wooded place about 20 km (12 mi) east of Tirupati in Andhra Pradesh. 

The lingam iconography has many forms and their  design  is described in the Agama Sasatras and the material it is made of. It includes many forms based on carved faces. Ashtottara-sata linga with 108 miniature lingas  carved on thepujabhaga (main linga), Sahasra linga with 1001 miniature lingas carved on the main linga, Both of them follow certain specified geometric pattern.  The famous one being being Lingodbhavamurti in which Shiva is seen emerging as a flame. Its representation can be seen on the western wall of the sanctum/gribagriha  of most Shiva temples. Karthigai Deepam festival is associated with Shiva who is associated with fire. It is a major temple festival at Arunachaleswar temple, Thiruvannamalai, Tamil Nadu. An Ekmukha Lingam with a single face is the main deity in the sanctum of most temples across India.  Panchamukha Lingam  lingam has five faces, presumably representing Pancha Bootha - five elements essential for survival f life on earth.

A lingam is normally made of stone and there are idols made  of clay, metal, wood or mineral (spatika - pure quartz). The  Shaiva Agama texts explain the construction of Shiva - proportion and size As for the pit in the center, Yoni or Pindika symbolizing female energy, Shakti,  the shape may be  circular, square, octagonal, hexagonal,  triangular, etc.  In Kadavul Temple, Hawaii, USA has a rare  700-pound, 3-foot-tall, naturally formed Spatika (quartz) lingam is installed - it is the largest known spatika self formed (Swayambhu) lingams.in the world being managed by  Kadavuel Hindu Monastery. Spatikam is the highest form of Shiva lingam.

According to Wendy Doniger,  researcher for many Hindus, the lingam is not a "male sexual organ", rather it is a spiritual icon exemplifying the coexistence of male and female power; it is like the Christians' cross, a symbol of Christ, of faith and compassion.  It is foolish to look upon it as  an "instrument of execution", The unique aspect about Lingam is in most of the Hindu temples, the idol /murthi  is  anthropomorphic ( carries human traits). The aniconic Shiva Linga is an important exception  and does not show any  human traits, according to  Anthropologist Christopher John Fuller.   But the images of goddess in such temples exhibit human trait.

Countries like  Vietnam, Cambodia,Thailand  and Indonesia have historic stone temples with Shiv Linga in  panel reliefs and images.