gma500: The 2D code is now also device independent