diff options
| -rw-r--r-- | arch/arm/mach-mvebu/coherency_ll.S | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/arch/arm/mach-mvebu/coherency_ll.S b/arch/arm/mach-mvebu/coherency_ll.S index 311442ae128b..510c29e079ca 100644 --- a/arch/arm/mach-mvebu/coherency_ll.S +++ b/arch/arm/mach-mvebu/coherency_ll.S | |||
| @@ -49,15 +49,22 @@ ENTRY(ll_get_coherency_base) | |||
| 49 | mov pc, lr | 49 | mov pc, lr |
| 50 | ENDPROC(ll_get_coherency_base) | 50 | ENDPROC(ll_get_coherency_base) |
| 51 | 51 | ||
| 52 | /* Returns the CPU ID in r3 (r0 is untouched) */ | 52 | /* |
| 53 | ENTRY(ll_get_cpuid) | 53 | * Returns the coherency CPU mask in r3 (r0 is untouched). This |
| 54 | * coherency CPU mask can be used with the coherency fabric | ||
| 55 | * configuration and control registers. Note that the mask is already | ||
| 56 | * endian-swapped as appropriate so that the calling functions do not | ||
| 57 | * have to care about endianness issues while accessing the coherency | ||
| 58 | * fabric registers | ||
| 59 | */ | ||
| 60 | ENTRY(ll_get_coherency_cpumask) | ||
| 54 | mrc 15, 0, r3, cr0, cr0, 5 | 61 | mrc 15, 0, r3, cr0, cr0, 5 |
| 55 | and r3, r3, #15 | 62 | and r3, r3, #15 |
| 56 | mov r2, #(1 << 24) | 63 | mov r2, #(1 << 24) |
| 57 | lsl r3, r2, r3 | 64 | lsl r3, r2, r3 |
| 58 | ARM_BE8(rev r3, r3) | 65 | ARM_BE8(rev r3, r3) |
| 59 | mov pc, lr | 66 | mov pc, lr |
| 60 | ENDPROC(ll_get_cpuid) | 67 | ENDPROC(ll_get_coherency_cpumask) |
| 61 | 68 | ||
| 62 | /* | 69 | /* |
| 63 | * ll_add_cpu_to_smp_group(), ll_enable_coherency() and | 70 | * ll_add_cpu_to_smp_group(), ll_enable_coherency() and |
| @@ -71,14 +78,14 @@ ENDPROC(ll_get_cpuid) | |||
| 71 | ENTRY(ll_add_cpu_to_smp_group) | 78 | ENTRY(ll_add_cpu_to_smp_group) |
| 72 | /* | 79 | /* |
| 73 | * As r0 is not modified by ll_get_coherency_base() and | 80 | * As r0 is not modified by ll_get_coherency_base() and |
| 74 | * ll_get_cpuid(), we use it to temporarly save lr and avoid | 81 | * ll_get_coherency_cpumask(), we use it to temporarly save lr |
| 75 | * it being modified by the branch and link calls. This | 82 | * and avoid it being modified by the branch and link |
| 76 | * function is used very early in the secondary CPU boot, and | 83 | * calls. This function is used very early in the secondary |
| 77 | * no stack is available at this point. | 84 | * CPU boot, and no stack is available at this point. |
| 78 | */ | 85 | */ |
| 79 | mov r0, lr | 86 | mov r0, lr |
| 80 | bl ll_get_coherency_base | 87 | bl ll_get_coherency_base |
| 81 | bl ll_get_cpuid | 88 | bl ll_get_coherency_cpumask |
| 82 | mov lr, r0 | 89 | mov lr, r0 |
| 83 | add r0, r1, #ARMADA_XP_CFB_CFG_REG_OFFSET | 90 | add r0, r1, #ARMADA_XP_CFB_CFG_REG_OFFSET |
| 84 | 1: | 91 | 1: |
| @@ -93,14 +100,14 @@ ENDPROC(ll_add_cpu_to_smp_group) | |||
| 93 | ENTRY(ll_enable_coherency) | 100 | ENTRY(ll_enable_coherency) |
| 94 | /* | 101 | /* |
| 95 | * As r0 is not modified by ll_get_coherency_base() and | 102 | * As r0 is not modified by ll_get_coherency_base() and |
| 96 | * ll_get_cpuid(), we use it to temporarly save lr and avoid | 103 | * ll_get_coherency_cpumask(), we use it to temporarly save lr |
| 97 | * it being modified by the branch and link calls. This | 104 | * and avoid it being modified by the branch and link |
| 98 | * function is used very early in the secondary CPU boot, and | 105 | * calls. This function is used very early in the secondary |
| 99 | * no stack is available at this point. | 106 | * CPU boot, and no stack is available at this point. |
| 100 | */ | 107 | */ |
| 101 | mov r0, lr | 108 | mov r0, lr |
| 102 | bl ll_get_coherency_base | 109 | bl ll_get_coherency_base |
| 103 | bl ll_get_cpuid | 110 | bl ll_get_coherency_cpumask |
| 104 | mov lr, r0 | 111 | mov lr, r0 |
| 105 | add r0, r1, #ARMADA_XP_CFB_CTL_REG_OFFSET | 112 | add r0, r1, #ARMADA_XP_CFB_CTL_REG_OFFSET |
| 106 | 1: | 113 | 1: |
| @@ -117,14 +124,14 @@ ENDPROC(ll_enable_coherency) | |||
| 117 | ENTRY(ll_disable_coherency) | 124 | ENTRY(ll_disable_coherency) |
| 118 | /* | 125 | /* |
| 119 | * As r0 is not modified by ll_get_coherency_base() and | 126 | * As r0 is not modified by ll_get_coherency_base() and |
| 120 | * ll_get_cpuid(), we use it to temporarly save lr and avoid | 127 | * ll_get_coherency_cpumask(), we use it to temporarly save lr |
| 121 | * it being modified by the branch and link calls. This | 128 | * and avoid it being modified by the branch and link |
| 122 | * function is used very early in the secondary CPU boot, and | 129 | * calls. This function is used very early in the secondary |
| 123 | * no stack is available at this point. | 130 | * CPU boot, and no stack is available at this point. |
| 124 | */ | 131 | */ |
| 125 | mov r0, lr | 132 | mov r0, lr |
| 126 | bl ll_get_coherency_base | 133 | bl ll_get_coherency_base |
| 127 | bl ll_get_cpuid | 134 | bl ll_get_coherency_cpumask |
| 128 | mov lr, r0 | 135 | mov lr, r0 |
| 129 | add r0, r1, #ARMADA_XP_CFB_CTL_REG_OFFSET | 136 | add r0, r1, #ARMADA_XP_CFB_CTL_REG_OFFSET |
| 130 | 1: | 137 | 1: |
