initial import of firmware code (i've been bad so you don't get the fork/modifications diff from the mainline until I can find it)