Failing to make a favorable impression in Southern China, Bodhidharma is said to have traveled to the northern Chinese kingdom of Wei to the Shaolin Monastery.
After either being refused entry to the temple or being ejected after a short time, he lived in a nearby cave, where he "faced a wall for nine years, not speaking for the entire time".
The biographical tradition is littered with apocryphal tales about Bodhidharma's life and circumstances. In one version of the story, he is said to have fallen asleep seven years into his nine years of wall-gazing. Becoming angry with himself, he cut off his eyelids to prevent it from happening again. According to the legend, as his eyelids hit the floor the first tea plants sprang up; and thereafter tea would provide a stimulant to help keep students of Chán awake during meditation.
The most popular account relates that Bodhidharma was admitted into the Shaolin temple after nine years in the cave and taught there for some time. However, other versions report that he "passed away, seated upright"; or that he disappeared, leaving behind the Yi Jin Jing; or that his legs atrophied after nine years of sitting, which is why Japanese Bodhidharma dolls have no legs.