Revert "Revert "Just a commit to diff mach ux500 stuff. Revert ASAP""

This reverts commit ee463cdea4f581d2cc1f1f1c3e3932fd81cdfa24.
Fix some build errors