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

TOMOYO Linux Cross Reference
Linux/arch/mips/ralink/rt3883.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/mips/ralink/rt3883.c (Version linux-6.12-rc7) and /arch/alpha/ralink/rt3883.c (Version linux-6.2.16)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 
  2 /*                                                
  3  *                                                
  4  * Parts of this file are based on Ralink's 2.    
  5  *                                                
  6  * Copyright (C) 2008 Imre Kaloz <kaloz@openwr    
  7  * Copyright (C) 2008-2011 Gabor Juhos <juhosg    
  8  * Copyright (C) 2013 John Crispin <john@phroz    
  9  */                                               
 10                                                   
 11 #include <linux/kernel.h>                         
 12 #include <linux/init.h>                           
 13 #include <linux/slab.h>                           
 14 #include <linux/sys_soc.h>                        
 15                                                   
 16 #include <asm/mipsregs.h>                         
 17 #include <asm/mach-ralink/ralink_regs.h>          
 18 #include <asm/mach-ralink/rt3883.h>               
 19                                                   
 20 #include "common.h"                               
 21                                                   
 22 static struct ralink_soc_info *soc_info_ptr;      
 23                                                   
 24 static unsigned int __init rt3883_get_soc_name    
 25 {                                                 
 26         return __raw_readl(RT3883_SYSC_BASE +     
 27 }                                                 
 28                                                   
 29 static unsigned int __init rt3883_get_soc_name    
 30 {                                                 
 31         return __raw_readl(RT3883_SYSC_BASE +     
 32 }                                                 
 33                                                   
 34 static bool __init rt3883_soc_valid(void)         
 35 {                                                 
 36         if (rt3883_get_soc_name0() == RT3883_C    
 37             rt3883_get_soc_name1() == RT3883_C    
 38                 return true;                      
 39         else                                      
 40                 return false;                     
 41 }                                                 
 42                                                   
 43 static const char __init *rt3883_get_soc_name(    
 44 {                                                 
 45         if (rt3883_soc_valid())                   
 46                 return "RT3883";                  
 47         else                                      
 48                 return "invalid";                 
 49 }                                                 
 50                                                   
 51 static unsigned int __init rt3883_get_soc_id(v    
 52 {                                                 
 53         return __raw_readl(RT3883_SYSC_BASE +     
 54 }                                                 
 55                                                   
 56 static unsigned int __init rt3883_get_soc_ver(    
 57 {                                                 
 58         return (rt3883_get_soc_id() >> RT3883_    
 59 }                                                 
 60                                                   
 61 static unsigned int __init rt3883_get_soc_rev(    
 62 {                                                 
 63         return (rt3883_get_soc_id() & RT3883_R    
 64 }                                                 
 65                                                   
 66 static int __init rt3883_soc_dev_init(void)       
 67 {                                                 
 68         struct soc_device *soc_dev;               
 69         struct soc_device_attribute *soc_dev_a    
 70                                                   
 71         soc_dev_attr = kzalloc(sizeof(*soc_dev    
 72         if (!soc_dev_attr)                        
 73                 return -ENOMEM;                   
 74                                                   
 75         soc_dev_attr->family = "Ralink";          
 76         soc_dev_attr->soc_id = rt3883_get_soc_    
 77                                                   
 78         soc_dev_attr->data = soc_info_ptr;        
 79                                                   
 80         soc_dev = soc_device_register(soc_dev_    
 81         if (IS_ERR(soc_dev)) {                    
 82                 kfree(soc_dev_attr);              
 83                 return PTR_ERR(soc_dev);          
 84         }                                         
 85                                                   
 86         return 0;                                 
 87 }                                                 
 88 device_initcall(rt3883_soc_dev_init);             
 89                                                   
 90 void __init prom_soc_init(struct ralink_soc_in    
 91 {                                                 
 92         if (rt3883_soc_valid())                   
 93                 soc_info->compatible = "ralink    
 94         else                                      
 95                 panic("rt3883: unknown SoC, n0    
 96                       rt3883_get_soc_name0(),     
 97                                                   
 98         snprintf(soc_info->sys_type, RAMIPS_SY    
 99                 "Ralink %s ver:%u eco:%u",        
100                 rt3883_get_soc_name(),            
101                 rt3883_get_soc_ver(),             
102                 rt3883_get_soc_rev());            
103                                                   
104         soc_info->mem_base = RT3883_SDRAM_BASE    
105         soc_info->mem_size_min = RT3883_MEM_SI    
106         soc_info->mem_size_max = RT3883_MEM_SI    
107                                                   
108         ralink_soc = RT3883_SOC;                  
109         soc_info_ptr = soc_info;                  
110 }                                                 
111                                                   

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