misc code to interface with soc hardware