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.

Change-Id: Ie81670df15591b4c7505b0b356d04fca63bcac9e

Signed-off-by: task650 <task650@gmail.com>