Add private header to libgrate

Move common structure definitions to a private header in order to share
them across source files.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
Add copyright notices

Most of the work is based on Erik Faye-Lund's reverse-engineering
efforts and some testing was done on devices at Avionic Design.

Signed-off-by: Thierry Reding <thierry@gilfi.de>
Fix build-order
Add a function to setup the viewport registers