Since this commit the kernel exposes scratch0-2 registers (when enabled RTC_NVMEM and RTC_DRV_OMAP configs). To read/write to these registers you can simple use file _/sys/bus/nvmem/devices/omap_rtcscratch0/nvmem (all 12 bytes are accessible by this file). But you still need to do the logic with magic number on your own, tho.
Since this commit the kernel exposes scratch0-2 registers (when enabled RTC_NVMEM and RTC_DRV_OMAP configs). To read/write to these registers you can simple use file _/sys/bus/nvmem/devices/omap_rtcscratch0/nvmem (all 12 bytes are accessible by this file). But you still need to do the logic with magic number on your own, tho.