This was part of the technology swapping deal announced a few years back, which also includes the 'sports car' Supra / Z4 development work as well.
BMW supply diesel engine tech to Toyota in exchange for hydrogen-fuel cell tech from them, plus engineers collaborating on a number of projects.
You can expect to see the diesels (and versions / parts of) coming through on other Toyota models as well.