Just noticed that I have the following in the startup.S file which is generated by the s32ds:
;# Init any other CPU register which might be stacked (before being used).
mtspr 1, r1 ;#XER
mtcrf 0xFF, r1
mtspr CTR, r1
mtspr 272, r1 ;#SPRG0
mtspr 273, r1 ;#SPRG1
mtspr 274, r1 ;#SPRG2
mtspr 275, r1 ;#SPRG3
mtspr 58, r1 ;#CSRR0
mtspr 59, r1 ;#CSRR1
mtspr 570, r1 ;#MCSRR0
mtspr 571, r1 ;#MCSRR1
mtspr 61, r1 ;#DEAR
mtspr 63, r1 ;#IVPR
mtspr 256, r1 ;#USPRG0
mtspr 62, r1 ;#ESR
mtspr 8,r31 ;#LR
When removing the init my SPR value is (not surprisingly) saved during reset so my question now is: Is there any risk with not initializing these registers and is there another way to it?
Thanks,
Cecilia