d2: Fix and consolidate persistent_ram code

 * Move persistent_ram back to the end of lowmem. For some reason it is
   getting clobbered randomly at it's current location.
 * Also consolidate the code into devices-8960 where it can be shared.