~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-mvebu/coherency_ll.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/arm/mach-mvebu/coherency_ll.S (Architecture sparc) and /arch/alpha/mach-mvebu/coherency_ll.S (Architecture alpha)


  1 /* SPDX-License-Identifier: GPL-2.0-only */       
  2 /*                                                
  3  * Coherency fabric: low level functions          
  4  *                                                
  5  * Copyright (C) 2012 Marvell                     
  6  *                                                
  7  * Gregory CLEMENT <gregory.clement@free-electr    
  8  *                                                
  9  * This file implements the assembly function     
 10  * coherency fabric. This function is called b    
 11  * CPUs during their early boot in an SMP kern    
 12  * function have to callable from assembly. It    
 13  * primary CPU from C code during its boot.       
 14  */                                               
 15                                                   
 16 #include <linux/linkage.h>                        
 17 #define ARMADA_XP_CFB_CTL_REG_OFFSET 0x0          
 18 #define ARMADA_XP_CFB_CFG_REG_OFFSET 0x4          
 19                                                   
 20 #include <asm/assembler.h>                        
 21 #include <asm/cp15.h>                             
 22                                                   
 23         .arch armv7-a                             
 24         .text                                     
 25 /*                                                
 26  * Returns the coherency base address in r1 (r    
 27  * the coherency fabric is not enabled.           
 28  */                                               
 29 ENTRY(ll_get_coherency_base)                      
 30         mrc     p15, 0, r1, c1, c0, 0             
 31         tst     r1, #CR_M @ Check MMU bit enab    
 32         bne     1f                                
 33                                                   
 34         /*                                        
 35          * MMU is disabled, use the physical a    
 36          * base address, (or 0x0 if the cohere    
 37          */                                       
 38         adr     r1, 3f                            
 39         ldr     r3, [r1]                          
 40         ldr     r1, [r1, r3]                      
 41         b       2f                                
 42 1:                                                
 43         /*                                        
 44          * MMU is enabled, use the virtual add    
 45          * base address.                          
 46          */                                       
 47         ldr     r1, =coherency_base               
 48         ldr     r1, [r1]                          
 49 2:                                                
 50         ret     lr                                
 51 ENDPROC(ll_get_coherency_base)                    
 52                                                   
 53 /*                                                
 54  * Returns the coherency CPU mask in r3 (r0 is    
 55  * coherency CPU mask can be used with the coh    
 56  * configuration and control registers. Note t    
 57  * endian-swapped as appropriate so that the c    
 58  * have to care about endianness issues while     
 59  * fabric registers                               
 60  */                                               
 61 ENTRY(ll_get_coherency_cpumask)                   
 62         mrc     p15, 0, r3, cr0, cr0, 5           
 63         and     r3, r3, #15                       
 64         mov     r2, #(1 << 24)                    
 65         lsl     r3, r2, r3                        
 66 ARM_BE8(rev     r3, r3)                           
 67         ret     lr                                
 68 ENDPROC(ll_get_coherency_cpumask)                 
 69                                                   
 70 /*                                                
 71  * ll_add_cpu_to_smp_group(), ll_enable_cohere    
 72  * ll_disable_coherency() use the strex/ldrex     
 73  * MMU can be disabled. The Armada XP SoC has     
 74  * that tracks transactions to Device and/or S    
 75  * that, exclusive transactions are functional    
 76  * disabled.                                      
 77  */                                               
 78                                                   
 79 ENTRY(ll_add_cpu_to_smp_group)                    
 80         /*                                        
 81          * As r0 is not modified by ll_get_coh    
 82          * ll_get_coherency_cpumask(), we use     
 83          * and avoid it being modified by the     
 84          * calls. This function is used very e    
 85          * CPU boot, and no stack is available    
 86          */                                       
 87         mov     r0, lr                            
 88         bl      ll_get_coherency_base             
 89         /* Bail out if the coherency is not en    
 90         cmp     r1, #0                            
 91         reteq   r0                                
 92         bl      ll_get_coherency_cpumask          
 93         mov     lr, r0                            
 94         add     r0, r1, #ARMADA_XP_CFB_CFG_REG    
 95 1:                                                
 96         ldrex   r2, [r0]                          
 97         orr     r2, r2, r3                        
 98         strex   r1, r2, [r0]                      
 99         cmp     r1, #0                            
100         bne     1b                                
101         ret     lr                                
102 ENDPROC(ll_add_cpu_to_smp_group)                  
103                                                   
104 ENTRY(ll_enable_coherency)                        
105         /*                                        
106          * As r0 is not modified by ll_get_coh    
107          * ll_get_coherency_cpumask(), we use     
108          * and avoid it being modified by the     
109          * calls. This function is used very e    
110          * CPU boot, and no stack is available    
111          */                                       
112         mov r0, lr                                
113         bl      ll_get_coherency_base             
114         /* Bail out if the coherency is not en    
115         cmp     r1, #0                            
116         reteq   r0                                
117         bl      ll_get_coherency_cpumask          
118         mov lr, r0                                
119         add     r0, r1, #ARMADA_XP_CFB_CTL_REG    
120 1:                                                
121         ldrex   r2, [r0]                          
122         orr     r2, r2, r3                        
123         strex   r1, r2, [r0]                      
124         cmp     r1, #0                            
125         bne     1b                                
126         dsb                                       
127         mov     r0, #0                            
128         ret     lr                                
129 ENDPROC(ll_enable_coherency)                      
130                                                   
131 ENTRY(ll_disable_coherency)                       
132         /*                                        
133          * As r0 is not modified by ll_get_coh    
134          * ll_get_coherency_cpumask(), we use     
135          * and avoid it being modified by the     
136          * calls. This function is used very e    
137          * CPU boot, and no stack is available    
138          */                                       
139         mov     r0, lr                            
140         bl      ll_get_coherency_base             
141         /* Bail out if the coherency is not en    
142         cmp     r1, #0                            
143         reteq   r0                                
144         bl      ll_get_coherency_cpumask          
145         mov     lr, r0                            
146         add     r0, r1, #ARMADA_XP_CFB_CTL_REG    
147 1:                                                
148         ldrex   r2, [r0]                          
149         bic     r2, r2, r3                        
150         strex   r1, r2, [r0]                      
151         cmp     r1, #0                            
152         bne     1b                                
153         dsb                                       
154         ret     lr                                
155 ENDPROC(ll_disable_coherency)                     
156                                                   
157         .align 2                                  
158 3:                                                
159         .long   coherency_phys_base - .           
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php