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

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-vt8500/vt8500.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/arm/mach-vt8500/vt8500.c (Version linux-6.12-rc7) and /arch/sparc64/mach-vt8500/vt8500.c (Version linux-5.19.17)


  1 // SPDX-License-Identifier: GPL-2.0-or-later        1 
  2 /*                                                
  3  *  arch/arm/mach-vt8500/vt8500.c                 
  4  *                                                
  5  *  Copyright (C) 2012 Tony Prisk <linux@prisk    
  6  */                                               
  7                                                   
  8 #include <linux/io.h>                             
  9 #include <linux/pm.h>                             
 10 #include <linux/reboot.h>                         
 11                                                   
 12 #include <asm/mach-types.h>                       
 13 #include <asm/mach/arch.h>                        
 14 #include <asm/mach/time.h>                        
 15 #include <asm/mach/map.h>                         
 16                                                   
 17 #include <linux/of.h>                             
 18 #include <linux/of_address.h>                     
 19 #include <linux/of_irq.h>                         
 20                                                   
 21 #define LEGACY_GPIO_BASE        0xD8110000        
 22 #define LEGACY_PMC_BASE         0xD8130000        
 23                                                   
 24 /* Registers in GPIO Controller */                
 25 #define VT8500_GPIO_MUX_REG     0x200             
 26                                                   
 27 /* Registers in Power Management Controller */    
 28 #define VT8500_HCR_REG          0x12              
 29 #define VT8500_PMSR_REG         0x60              
 30                                                   
 31 static void __iomem *pmc_base;                    
 32                                                   
 33 static void vt8500_restart(enum reboot_mode mo    
 34 {                                                 
 35         if (pmc_base)                             
 36                 writel(1, pmc_base + VT8500_PM    
 37 }                                                 
 38                                                   
 39 static struct map_desc vt8500_io_desc[] __init    
 40         /* SoC MMIO registers */                  
 41         [0] = {                                   
 42                 .virtual        = 0xf8000000,     
 43                 .pfn            = __phys_to_pf    
 44                 .length         = 0x00390000,     
 45                 .type           = MT_DEVICE       
 46         },                                        
 47 };                                                
 48                                                   
 49 static void __init vt8500_map_io(void)            
 50 {                                                 
 51         iotable_init(vt8500_io_desc, ARRAY_SIZ    
 52 }                                                 
 53                                                   
 54 static void vt8500_power_off(void)                
 55 {                                                 
 56         local_irq_disable();                      
 57         writew(5, pmc_base + VT8500_HCR_REG);     
 58         asm("mcr p15, 0, %0, c7, c0, 4" : : "r    
 59 }                                                 
 60                                                   
 61 static void __init vt8500_init(void)              
 62 {                                                 
 63         struct device_node *np;                   
 64 #if defined(CONFIG_FB_VT8500) || defined(CONFI    
 65         struct device_node *fb;                   
 66         void __iomem *gpio_base;                  
 67 #endif                                            
 68                                                   
 69 #ifdef CONFIG_FB_VT8500                           
 70         fb = of_find_compatible_node(NULL, NUL    
 71         if (fb) {                                 
 72                 np = of_find_compatible_node(N    
 73                 if (np) {                         
 74                         gpio_base = of_iomap(n    
 75                                                   
 76                         if (!gpio_base)           
 77                                 pr_err("%s: of    
 78                                                   
 79                                                   
 80                         of_node_put(np);          
 81                 } else {                          
 82                         gpio_base = ioremap(LE    
 83                         if (!gpio_base)           
 84                                 pr_err("%s: io    
 85                                                   
 86                 }                                 
 87                 if (gpio_base) {                  
 88                         writel(readl(gpio_base    
 89                                 gpio_base + VT    
 90                         iounmap(gpio_base);       
 91                 } else                            
 92                         pr_err("%s: Could not     
 93                                                   
 94                 of_node_put(fb);                  
 95         }                                         
 96 #endif                                            
 97                                                   
 98 #ifdef CONFIG_FB_WM8505                           
 99         fb = of_find_compatible_node(NULL, NUL    
100         if (fb) {                                 
101                 np = of_find_compatible_node(N    
102                 if (!np)                          
103                         np = of_find_compatibl    
104                                                   
105                 if (np) {                         
106                         gpio_base = of_iomap(n    
107                                                   
108                         if (!gpio_base)           
109                                 pr_err("%s: of    
110                                                   
111                                                   
112                         of_node_put(np);          
113                 } else {                          
114                         gpio_base = ioremap(LE    
115                         if (!gpio_base)           
116                                 pr_err("%s: io    
117                                                   
118                 }                                 
119                 if (gpio_base) {                  
120                         writel(readl(gpio_base    
121                                 0x80000000, gp    
122                         iounmap(gpio_base);       
123                 } else                            
124                         pr_err("%s: Could not     
125                                                   
126                 of_node_put(fb);                  
127         }                                         
128 #endif                                            
129                                                   
130         np = of_find_compatible_node(NULL, NUL    
131         if (np) {                                 
132                 pmc_base = of_iomap(np, 0);       
133                                                   
134                 if (!pmc_base)                    
135                         pr_err("%s:of_iomap(pm    
136                                                   
137                 of_node_put(np);                  
138         } else {                                  
139                 pmc_base = ioremap(LEGACY_PMC_    
140                 if (!pmc_base)                    
141                         pr_err("%s:ioremap(pow    
142         }                                         
143         if (pmc_base)                             
144                 pm_power_off = &vt8500_power_o    
145         else                                      
146                 pr_err("%s: PMC Hibernation re    
147 }                                                 
148                                                   
149 static const char * const vt8500_dt_compat[] =    
150         "via,vt8500",                             
151         "wm,wm8650",                              
152         "wm,wm8505",                              
153         "wm,wm8750",                              
154         "wm,wm8850",                              
155         NULL                                      
156 };                                                
157                                                   
158 DT_MACHINE_START(WMT_DT, "VIA/Wondermedia SoC     
159         .dt_compat      = vt8500_dt_compat,       
160         .map_io         = vt8500_map_io,          
161         .init_machine   = vt8500_init,            
162         .restart        = vt8500_restart,         
163 MACHINE_END                                       
164                                                   
165                                                   

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