Davinci 8xx: Move common functions to share code