diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2010-07-12 16:53:28 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-27 05:42:38 -0400 |
commit | 1dbd30e9890fd69e50b17edd70ca583546b0fe4e (patch) | |
tree | 5b5ab74c1792a81340478f7bbccd053e60a23a5e /Documentation/arm/tcm.txt | |
parent | 07d2a5c721c6aa2bd69812a74c8b3b116abf3e56 (diff) |
ARM: 6225/1: make TCM allocation static and common for all archs
This changes the TCM handling so that a fixed area is reserved at
0xfffe0000-0xfffeffff for TCM. This areas is used by XScale but
XScale does not have TCM so the mechanisms are mutually exclusive.
This change is needed to make TCM detection more dynamic while
still being able to compile code into it, and is a must for the
unified ARM goals: the current TCM allocation at different places
in memory for each machine would be a nightmare if you want to
compile a single image for more than one machine with TCM so it
has to be nailed down in one place.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'Documentation/arm/tcm.txt')
-rw-r--r-- | Documentation/arm/tcm.txt | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Documentation/arm/tcm.txt b/Documentation/arm/tcm.txt index 77fd9376e6d7..7c15871c1885 100644 --- a/Documentation/arm/tcm.txt +++ b/Documentation/arm/tcm.txt | |||
@@ -19,8 +19,8 @@ defines a CPUID_TCM register that you can read out from the | |||
19 | system control coprocessor. Documentation from ARM can be found | 19 | system control coprocessor. Documentation from ARM can be found |
20 | at http://infocenter.arm.com, search for "TCM Status Register" | 20 | at http://infocenter.arm.com, search for "TCM Status Register" |
21 | to see documents for all CPUs. Reading this register you can | 21 | to see documents for all CPUs. Reading this register you can |
22 | determine if ITCM (bit 0) and/or DTCM (bit 16) is present in the | 22 | determine if ITCM (bits 1-0) and/or DTCM (bit 17-16) is present |
23 | machine. | 23 | in the machine. |
24 | 24 | ||
25 | There is further a TCM region register (search for "TCM Region | 25 | There is further a TCM region register (search for "TCM Region |
26 | Registers" at the ARM site) that can report and modify the location | 26 | Registers" at the ARM site) that can report and modify the location |
@@ -35,7 +35,15 @@ The TCM memory can then be remapped to another address again using | |||
35 | the MMU, but notice that the TCM if often used in situations where | 35 | the MMU, but notice that the TCM if often used in situations where |
36 | the MMU is turned off. To avoid confusion the current Linux | 36 | the MMU is turned off. To avoid confusion the current Linux |
37 | implementation will map the TCM 1 to 1 from physical to virtual | 37 | implementation will map the TCM 1 to 1 from physical to virtual |
38 | memory in the location specified by the machine. | 38 | memory in the location specified by the kernel. Currently Linux |
39 | will map ITCM to 0xfffe0000 and on, and DTCM to 0xfffe8000 and | ||
40 | on, supporting a maximum of 32KiB of ITCM and 32KiB of DTCM. | ||
41 | |||
42 | Newer versions of the region registers also support dividing these | ||
43 | TCMs in two separate banks, so for example an 8KiB ITCM is divided | ||
44 | into two 4KiB banks with its own control registers. The idea is to | ||
45 | be able to lock and hide one of the banks for use by the secure | ||
46 | world (TrustZone). | ||
39 | 47 | ||
40 | TCM is used for a few things: | 48 | TCM is used for a few things: |
41 | 49 | ||
@@ -65,18 +73,18 @@ in <asm/tcm.h>. Using this interface it is possible to: | |||
65 | memory. Such a heap is great for things like saving | 73 | memory. Such a heap is great for things like saving |
66 | device state when shutting off device power domains. | 74 | device state when shutting off device power domains. |
67 | 75 | ||
68 | A machine that has TCM memory shall select HAVE_TCM in | 76 | A machine that has TCM memory shall select HAVE_TCM from |
69 | arch/arm/Kconfig for itself, and then the | 77 | arch/arm/Kconfig for itself. Code that needs to use TCM shall |
70 | rest of the functionality will depend on the physical | 78 | #include <asm/tcm.h> |
71 | location and size of ITCM and DTCM to be defined in | ||
72 | mach/memory.h for the machine. Code that needs to use | ||
73 | TCM shall #include <asm/tcm.h> If the TCM is not located | ||
74 | at the place given in memory.h it will be moved using | ||
75 | the TCM Region registers. | ||
76 | 79 | ||
77 | Functions to go into itcm can be tagged like this: | 80 | Functions to go into itcm can be tagged like this: |
78 | int __tcmfunc foo(int bar); | 81 | int __tcmfunc foo(int bar); |
79 | 82 | ||
83 | Since these are marked to become long_calls and you may want | ||
84 | to have functions called locally inside the TCM without | ||
85 | wasting space, there is also the __tcmlocalfunc prefix that | ||
86 | will make the call relative. | ||
87 | |||
80 | Variables to go into dtcm can be tagged like this: | 88 | Variables to go into dtcm can be tagged like this: |
81 | int __tcmdata foo; | 89 | int __tcmdata foo; |
82 | 90 | ||