Jhanas and past lives I always thought that the remembrance of the past lives and the vision of the mechanism of the kamma were the fruits of the jhanas.
BUT, it is said that the Tathagata learnt the (8) jhanas from two teachers. it is also said that he remembered his past lives during  the famous seven days, after he decided to gain what he would call nibbana.

Do we know whether the Tathagata had access to his previous lives or to the karmic mechanism before the week of accessing nibbana ?

if no, does this mean that only the dhamma --- instead of the practice from hinduism,  jainism and perhaps others doctrines --- permits to see the past lives, or the karmic mechanism ?
I don't think the Buddha knew his past lives long before he attained nirvana -- the descriptions I know of him accessing his past lives were during his final struggle.

To the best of my knowledge, past lives recollection is about concentration -- not necessarily samma samadhi as known in the sutras. The sutras imply that yogis could and have obtained such abilities and that it is not something the Buddha introduced.

The Buddha is said to have learned specific concentration practices (aka the arupa jhanas) from previous teachers before reaching nirvana, but it's not clear if he (or his teachers) knew any of the actual 4 jhana (as described in the sutras, with their factors and all). The interesting passage is the one he describes remembering reaching the 1st jhana state when he was a kid and that is when he "gets back on track" towards nirvana -- and that happened after training with his teachers. This suggests that his teachers did not teach or knew how to reach the 1st (and arguably any of the four) jhanas, and thus, opens up the possibility that samma samadhi could have been an original practice introduced or at least systematized by the Buddha.

Knowlege of previous lives is not unlocked with nirvana according to the sutras as such a person can still be bound to wrong view / ignorance (which nirvana is supposed to end). But it is presented as part of a path towards nirvana.