I have been putting together a project lately that puts together a software framwork that allows same device driver libraries to be used across multiple SoC platforms. Currently I have been working with atmega328p, AT91SAM3 arm and STM32 arm chips.
My framework operates in three levels:
level 0) SoC architechture interface with speciffic code for every architecture
level 1) External peripheral drivers (displays, ethernet chips etc) that use SoC interface to communicate with devices that are part of same project
level 2) Application code
The level 0 code is basically code that consists of macros and simple functions that provide a generice interface to various on chip interfaces. This code uses for the most part vendor speciffic libraries to set up clocks, registers, memory, etc. This code provides library functions for higher level drivers so that they can be kept portable across many different platforms.
The level 1 drivers are responsible for talking to devices like radio modules, accelerometers, motors etc. This level is intended to be chip independent for the most part. It should use standard macros and methods defined in level0 to talk to devices outside of the chip.
The application is then built in such way that it uses services defined primarily in the board driver to do stuff like changing speed of motors, reading radio receiver etc. The framework is designed to free applicaiton from all hardware specific register manipulation so that programmer can just focus on developing appliation specific code.
To make it all highly configurable, menuconfig is used. It is basically a gui where you can configure which interfaces you will be using and what hardware you want to compile against. This configuration utility automatically determines which drivers you can use and which ones you can't use depending on the hardware you have chosen.
Since I have started with the atmega328p architecture, many drivers are originally written for avr. But I am currently working on making them completely portable across both avr and arm. I want to be able to use the same code on both avr, stm32 and sam3.
Here is a screenshot of the config utility (run: "make menuconfig"):
Here is an example project for a multiwii board based flight controller: https://github.com/mkschreder/bettercopter
Here is the source code of the framework: https://github.com/mkschreder/martink
The closest thing to what I'm working on is probably the u-boot project: http://www.denx.de/wiki/U-Boot/ However, u-boot only works on much higher level chips that boot from sd card and have external ram and lots of resources. I have not been able to find an equivalent framwork for simple controllers like the AVR. Uboot does not run on avr.. So I decided to build a software framwork for bare metal software development on chips that u-boot does not support.