This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to enter Secure mode

Note: This was originally posted on 29th July 2011 at http://forums.arm.com

Hi all,
I want to use TCM in ARM1176ZJF-S core. It will be accessed in Non-secure world (cause I don't use TrustZone) but by default it's configured as secure TCM. So, it's not visible.  I need to change it to non-secure TCM which is indicated by the NS bit. According to the Ref, if I want to change the NS bit, I need to enter Secure privileged mode first.
My question is how can I enter that mode?
I tried the following, according to ARM1176JZF-S tech ref,

             asm("str     lr,[sp, #-4]!");
             asm("smc     #0");
             asm("mrc     p15, 0, %0, c9, c1, 2" 
                 : "=r" (tcm_secure));
             tcm_secure |= 1;
             asm("mcr     p15, 0, %0, c9, c1, 2"   /* set DTCM NS bit to 1 */
                 :
                 : "r" (tcm_secure));
             asm("movs    pc, lr");
             asm("ldr     lr, [sp, #0]!");


It doesn't work, however. Compiler says SMC is supported.
Please help, TCM troubles me for weeks.

Thanks for any input
Zova
Parents
  • Note: This was originally posted on 31st July 2011 at http://forums.arm.com


    It is  also worth noting that the "typical" user model is that the bootstrap  (running in secure) sets up the platform, assigning periphals, TCM, etc  to the correct worlds, and the proceeds with the boot of the higher  levels of the system.

    It is unusual to want to re-partition resources after this point, especially things like TCM, so can't your bootloader do this?


    Thanks isogen74!

    The "typical" user model is really good since it give me a overall pic, which helps me in understanding the booting process.
    The  boot loader is u-boot for s3c6410 board. I do find some TCM  configurations in the code, however, the TCM there seems not the same  TCM descriped in User Manual.
    TCM in uboot consists of one 8K ITCM or  stepping stone, and a 16K D-TCM and they are used for bootstrapping,  and in the UM it's 16K I/D-TCM. So, I guess TCM here is not one that's  used to hold those "performance critical code/data". If I'm wrong, please correct me.

    Thanks,
    Zova
Reply
  • Note: This was originally posted on 31st July 2011 at http://forums.arm.com


    It is  also worth noting that the "typical" user model is that the bootstrap  (running in secure) sets up the platform, assigning periphals, TCM, etc  to the correct worlds, and the proceeds with the boot of the higher  levels of the system.

    It is unusual to want to re-partition resources after this point, especially things like TCM, so can't your bootloader do this?


    Thanks isogen74!

    The "typical" user model is really good since it give me a overall pic, which helps me in understanding the booting process.
    The  boot loader is u-boot for s3c6410 board. I do find some TCM  configurations in the code, however, the TCM there seems not the same  TCM descriped in User Manual.
    TCM in uboot consists of one 8K ITCM or  stepping stone, and a 16K D-TCM and they are used for bootstrapping,  and in the UM it's 16K I/D-TCM. So, I guess TCM here is not one that's  used to hold those "performance critical code/data". If I'm wrong, please correct me.

    Thanks,
    Zova
Children
No data