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

TOMOYO Linux Cross Reference
Linux/arch/nios2/kernel/setup.c

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/nios2/kernel/setup.c (Version linux-6.12-rc7) and /arch/sparc/kernel/setup.c (Version linux-5.11.22)


  1 /*                                                  1 
  2  * Nios2-specific parts of system setup           
  3  *                                                
  4  * Copyright (C) 2010 Tobias Klauser <tklauser    
  5  * Copyright (C) 2004 Microtronix Datacom Ltd.    
  6  * Copyright (C) 2001 Vic Phillips <vic@microt    
  7  *                                                
  8  * This file is subject to the terms and condi    
  9  * License. See the file "COPYING" in the main    
 10  * for more details.                              
 11  */                                               
 12                                                   
 13 #include <linux/export.h>                         
 14 #include <linux/kernel.h>                         
 15 #include <linux/mm.h>                             
 16 #include <linux/sched.h>                          
 17 #include <linux/sched/task.h>                     
 18 #include <linux/console.h>                        
 19 #include <linux/memblock.h>                       
 20 #include <linux/initrd.h>                         
 21 #include <linux/of_fdt.h>                         
 22                                                   
 23 #include <asm/mmu_context.h>                      
 24 #include <asm/sections.h>                         
 25 #include <asm/setup.h>                            
 26 #include <asm/cpuinfo.h>                          
 27                                                   
 28 unsigned long memory_start;                       
 29 EXPORT_SYMBOL(memory_start);                      
 30                                                   
 31 unsigned long memory_end;                         
 32 EXPORT_SYMBOL(memory_end);                        
 33                                                   
 34 static struct pt_regs fake_regs = { 0, 0, 0, 0    
 35                                         0, 0,     
 36                                         0};       
 37                                                   
 38 /* Copy a short hook instruction sequence to t    
 39 static inline void copy_exception_handler(unsi    
 40 {                                                 
 41         unsigned int start = (unsigned int) ex    
 42         volatile unsigned int tmp = 0;            
 43                                                   
 44         if (start == addr) {                      
 45                 /* The CPU exception address a    
 46                 return;                           
 47         }                                         
 48                                                   
 49         __asm__ __volatile__ (                    
 50                 "ldw    %2,0(%0)\n"               
 51                 "stw    %2,0(%1)\n"               
 52                 "ldw    %2,4(%0)\n"               
 53                 "stw    %2,4(%1)\n"               
 54                 "ldw    %2,8(%0)\n"               
 55                 "stw    %2,8(%1)\n"               
 56                 "flushd 0(%1)\n"                  
 57                 "flushd 4(%1)\n"                  
 58                 "flushd 8(%1)\n"                  
 59                 "flushi %1\n"                     
 60                 "addi   %1,%1,4\n"                
 61                 "flushi %1\n"                     
 62                 "addi   %1,%1,4\n"                
 63                 "flushi %1\n"                     
 64                 "flushp\n"                        
 65                 : /* no output registers */       
 66                 : "r" (start), "r" (addr), "r"    
 67                 : "memory"                        
 68         );                                        
 69 }                                                 
 70                                                   
 71 /* Copy the fast TLB miss handler */              
 72 static inline void copy_fast_tlb_miss_handler(    
 73 {                                                 
 74         unsigned int start = (unsigned int) fa    
 75         unsigned int end = (unsigned int) fast    
 76         volatile unsigned int tmp = 0;            
 77                                                   
 78         __asm__ __volatile__ (                    
 79                 "1:\n"                            
 80                 "       ldw     %3,0(%0)\n"       
 81                 "       stw     %3,0(%1)\n"       
 82                 "       flushd  0(%1)\n"          
 83                 "       flushi  %1\n"             
 84                 "       flushp\n"                 
 85                 "       addi    %0,%0,4\n"        
 86                 "       addi    %1,%1,4\n"        
 87                 "       bne     %0,%2,1b\n"       
 88                 : /* no output registers */       
 89                 : "r" (start), "r" (addr), "r"    
 90                 : "memory"                        
 91         );                                        
 92 }                                                 
 93                                                   
 94 /*                                                
 95  * save args passed from u-boot, called from h    
 96  *                                                
 97  * @r4: NIOS magic                                
 98  * @r5: initrd start                              
 99  * @r6: initrd end or fdt                         
100  * @r7: kernel command line                       
101  */                                               
102 asmlinkage void __init nios2_boot_init(unsigne    
103                                        unsigne    
104 {                                                 
105         unsigned dtb_passed = 0;                  
106         char cmdline_passed[COMMAND_LINE_SIZE]    
107                                                   
108 #if defined(CONFIG_NIOS2_PASS_CMDLINE)            
109         if (r4 == 0x534f494e) { /* r4 is magic    
110 #if defined(CONFIG_BLK_DEV_INITRD)                
111                 if (r5) { /* initramfs */         
112                         initrd_start = r5;        
113                         initrd_end = r6;          
114                 }                                 
115 #endif /* CONFIG_BLK_DEV_INITRD */                
116                 dtb_passed = r6;                  
117                                                   
118                 if (r7)                           
119                         strscpy(cmdline_passed    
120         }                                         
121 #endif                                            
122                                                   
123         early_init_devtree((void *)dtb_passed)    
124                                                   
125 #ifndef CONFIG_CMDLINE_FORCE                      
126         if (cmdline_passed[0])                    
127                 strscpy(boot_command_line, cmd    
128 #ifdef CONFIG_NIOS2_CMDLINE_IGNORE_DTB            
129         else                                      
130                 strscpy(boot_command_line, CON    
131 #endif                                            
132 #endif                                            
133                                                   
134         parse_early_param();                      
135 }                                                 
136                                                   
137 static void __init find_limits(unsigned long *    
138                                unsigned long *    
139 {                                                 
140         *max_low = PFN_DOWN(memblock_get_curre    
141         *min = PFN_UP(memblock_start_of_DRAM()    
142         *max_high = PFN_DOWN(memblock_end_of_D    
143 }                                                 
144                                                   
145 void __init setup_arch(char **cmdline_p)          
146 {                                                 
147         console_verbose();                        
148                                                   
149         memory_start = memblock_start_of_DRAM(    
150         memory_end = memblock_end_of_DRAM();      
151                                                   
152         setup_initial_init_mm(_stext, _etext,     
153         init_task.thread.kregs = &fake_regs;      
154                                                   
155         /* Keep a copy of command line */         
156         *cmdline_p = boot_command_line;           
157                                                   
158         find_limits(&min_low_pfn, &max_low_pfn    
159         max_mapnr = max_low_pfn;                  
160                                                   
161         memblock_reserve(__pa_symbol(_stext),     
162 #ifdef CONFIG_BLK_DEV_INITRD                      
163         if (initrd_start) {                       
164                 memblock_reserve(virt_to_phys(    
165                                 initrd_end - i    
166         }                                         
167 #endif /* CONFIG_BLK_DEV_INITRD */                
168                                                   
169         early_init_fdt_reserve_self();            
170         early_init_fdt_scan_reserved_mem();       
171                                                   
172         unflatten_and_copy_device_tree();         
173                                                   
174         setup_cpuinfo();                          
175                                                   
176         copy_exception_handler(cpuinfo.excepti    
177                                                   
178         mmu_init();                               
179                                                   
180         copy_fast_tlb_miss_handler(cpuinfo.fas    
181                                                   
182         /*                                        
183          * Initialize MMU context handling her    
184          * needed for this.                       
185          */                                       
186         mmu_context_init();                       
187                                                   
188         /*                                        
189          * get kmalloc into gear                  
190          */                                       
191         paging_init();                            
192 }                                                 
193                                                   

~ [ 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