more generic code - still needs SoC dependant setup