There is an ID, and it is different for each chip variation.....but...it is only accessible via JTAG (for the external debugger to read). It's not accessible by the RZ/A CPU. Trust me, it drives the Renesas SW guys crazy.
So, unfortunately you're stuck doing it the hard way: See if the memory addresses above 5MB is Read/Write.