One of Studio Ghibli's (excellent) films, named Princess Mononoke, has depictions of kodama:

In Japanese folklore, kodama are tree spirits that inhabit trees that are older than 100 years.

In the collection of yōkai depictions, the Gazu Hyakki Yagyō by Toriyama Sekien, under the title 木魅 ("kodama"), an aged man and woman are depicted standing alongside the trees, and here it is stated that when a tree has passed a hundred years of age, a divine spirit would come dwell inside it, and show its appearance.[6]

This depiction mentioned here is this:

What the Wikipedia article does not answer, possibly doesn't even touch on, is the origin of the kodama. I have two very related questions on this matter:

What myth (if there is one) first describes or talks about kodama?

Is there a myth that talks about where the kodama came from? If so, what is their origin?

In essence, what is the original myth? and where did they come from?