The stories associated with Merlin and the Treasures of Britain can be traced to Welsh poets who lived in the 6th Century. Works by two of them Aneirin and Taliesin have survived. The Historia Brittonum written by Nennius in 800 AD refers to Aneirin.
Aneirin wrote a long ballad "Y Gododdin" about an ill fated expedition sent by Mynyddawg Mwynfawr from Gododdin (near Edinburgh) to Catraeth (Catterick in North Yorkshire) to oppose the Saxons who had occupied the old Roman fortress. The Saxons were victorious and the war band of 300 men was totally destroyed. Y Gododdin is thought to be the earliest extant Welsh work and is preserved in a manuscript known as the "Book of Aneirin written about 1250 AD.
Taliesin wrote ballads (awdlau) in praise of his warrior king, Urien of Rheged, a kingdom spanning southwest Scotland and Northwest England, bordering on North Yorkshire. Taliesin is linked with Myrddin Wyllt better known as Merlin who may for a time have been Taliesin's mentor.
Merlin in some texts is described as a wild man of the woods who went mad at the sight of battle. It was not unknown for "holy men" to enter some form of trance prior to a battle as they sought to impress foes with their power. Merlin was said to have the gift of prophecy and there is some suggestion that this gift was passed to Taliesen who is depicted in a folk tale dating from around 850 AD as the central prophetic figure. Fragments of the story are preserved in the "Book of Taliesin" and to some extent in late texts of "Hanes Taliesin" (Story of Taliesin).