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

TOMOYO Linux Cross Reference
Linux/arch/mips/loongson2ef/common/cs5536/cs5536_ehci.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/loongson2ef/common/cs5536/cs5536_ehci.c (Architecture i386) and /arch/alpha/loongson2ef/common/cs5536/cs5536_ehci.c (Architecture alpha)


  1 // SPDX-License-Identifier: GPL-2.0-or-later        1 
  2 /*                                                
  3  * the EHCI Virtual Support Module of AMD CS55    
  4  *                                                
  5  * Copyright (C) 2007 Lemote, Inc.                
  6  * Author : jlliu, liujl@lemote.com               
  7  *                                                
  8  * Copyright (C) 2009 Lemote, Inc.                
  9  * Author: Wu Zhangjin, wuzhangjin@gmail.com      
 10  */                                               
 11                                                   
 12 #include <cs5536/cs5536.h>                        
 13 #include <cs5536/cs5536_pci.h>                    
 14                                                   
 15 void pci_ehci_write_reg(int reg, u32 value)       
 16 {                                                 
 17         u32 hi = 0, lo = value;                   
 18                                                   
 19         switch (reg) {                            
 20         case PCI_COMMAND:                         
 21                 _rdmsr(USB_MSR_REG(USB_EHCI),     
 22                 if (value & PCI_COMMAND_MASTER    
 23                         hi |= PCI_COMMAND_MAST    
 24                 else                              
 25                         hi &= ~PCI_COMMAND_MAS    
 26                                                   
 27                 if (value & PCI_COMMAND_MEMORY    
 28                         hi |= PCI_COMMAND_MEMO    
 29                 else                              
 30                         hi &= ~PCI_COMMAND_MEM    
 31                 _wrmsr(USB_MSR_REG(USB_EHCI),     
 32                 break;                            
 33         case PCI_STATUS:                          
 34                 if (value & PCI_STATUS_PARITY)    
 35                         _rdmsr(SB_MSR_REG(SB_E    
 36                         if (lo & SB_PARE_ERR_F    
 37                                 lo = (lo & 0x0    
 38                                 _wrmsr(SB_MSR_    
 39                         }                         
 40                 }                                 
 41                 break;                            
 42         case PCI_BAR0_REG:                        
 43                 if (value == PCI_BAR_RANGE_MAS    
 44                         _rdmsr(GLCP_MSR_REG(GL    
 45                         lo |= SOFT_BAR_EHCI_FL    
 46                         _wrmsr(GLCP_MSR_REG(GL    
 47                 } else if ((value & 0x01) == 0    
 48                         _rdmsr(USB_MSR_REG(USB    
 49                         lo = value;               
 50                         _wrmsr(USB_MSR_REG(USB    
 51                                                   
 52                         value &= 0xfffffff0;      
 53                         hi = 0x40000000 | ((va    
 54                         lo = 0x000fffff | ((va    
 55                         _wrmsr(GLIU_MSR_REG(GL    
 56                 }                                 
 57                 break;                            
 58         case PCI_EHCI_LEGSMIEN_REG:               
 59                 _rdmsr(USB_MSR_REG(USB_EHCI),     
 60                 hi &= 0x003f0000;                 
 61                 hi |= (value & 0x3f) << 16;       
 62                 _wrmsr(USB_MSR_REG(USB_EHCI),     
 63                 break;                            
 64         case PCI_EHCI_FLADJ_REG:                  
 65                 _rdmsr(USB_MSR_REG(USB_EHCI),     
 66                 hi &= ~0x00003f00;                
 67                 hi |= value & 0x00003f00;         
 68                 _wrmsr(USB_MSR_REG(USB_EHCI),     
 69                 break;                            
 70         default:                                  
 71                 break;                            
 72         }                                         
 73 }                                                 
 74                                                   
 75 u32 pci_ehci_read_reg(int reg)                    
 76 {                                                 
 77         u32 conf_data = 0;                        
 78         u32 hi, lo;                               
 79                                                   
 80         switch (reg) {                            
 81         case PCI_VENDOR_ID:                       
 82                 conf_data =                       
 83                     CFG_PCI_VENDOR_ID(CS5536_E    
 84                 break;                            
 85         case PCI_COMMAND:                         
 86                 _rdmsr(USB_MSR_REG(USB_EHCI),     
 87                 if (hi & PCI_COMMAND_MASTER)      
 88                         conf_data |= PCI_COMMA    
 89                 if (hi & PCI_COMMAND_MEMORY)      
 90                         conf_data |= PCI_COMMA    
 91                 break;                            
 92         case PCI_STATUS:                          
 93                 conf_data |= PCI_STATUS_66MHZ;    
 94                 conf_data |= PCI_STATUS_FAST_B    
 95                 _rdmsr(SB_MSR_REG(SB_ERROR), &    
 96                 if (lo & SB_PARE_ERR_FLAG)        
 97                         conf_data |= PCI_STATU    
 98                 conf_data |= PCI_STATUS_DEVSEL    
 99                 break;                            
100         case PCI_CLASS_REVISION:                  
101                 _rdmsr(USB_MSR_REG(USB_CAP), &    
102                 conf_data = lo & 0x000000ff;      
103                 conf_data |= (CS5536_EHCI_CLAS    
104                 break;                            
105         case PCI_CACHE_LINE_SIZE:                 
106                 conf_data =                       
107                     CFG_PCI_CACHE_LINE_SIZE(PC    
108                                             PC    
109                 break;                            
110         case PCI_BAR0_REG:                        
111                 _rdmsr(GLCP_MSR_REG(GLCP_SOFT_    
112                 if (lo & SOFT_BAR_EHCI_FLAG) {    
113                         conf_data = CS5536_EHC    
114                             PCI_BASE_ADDRESS_S    
115                         lo &= ~SOFT_BAR_EHCI_F    
116                         _wrmsr(GLCP_MSR_REG(GL    
117                 } else {                          
118                         _rdmsr(USB_MSR_REG(USB    
119                         conf_data = lo & 0xfff    
120                 }                                 
121                 break;                            
122         case PCI_CARDBUS_CIS:                     
123                 conf_data = PCI_CARDBUS_CIS_PO    
124                 break;                            
125         case PCI_SUBSYSTEM_VENDOR_ID:             
126                 conf_data =                       
127                     CFG_PCI_VENDOR_ID(CS5536_E    
128                 break;                            
129         case PCI_ROM_ADDRESS:                     
130                 conf_data = PCI_EXPANSION_ROM_    
131                 break;                            
132         case PCI_CAPABILITY_LIST:                 
133                 conf_data = PCI_CAPLIST_USB_PO    
134                 break;                            
135         case PCI_INTERRUPT_LINE:                  
136                 conf_data =                       
137                     CFG_PCI_INTERRUPT_LINE(PCI    
138                 break;                            
139         case PCI_EHCI_LEGSMIEN_REG:               
140                 _rdmsr(USB_MSR_REG(USB_EHCI),     
141                 conf_data = (hi & 0x003f0000)     
142                 break;                            
143         case PCI_EHCI_LEGSMISTS_REG:              
144                 _rdmsr(USB_MSR_REG(USB_EHCI),     
145                 conf_data = (hi & 0x3f000000)     
146                 break;                            
147         case PCI_EHCI_FLADJ_REG:                  
148                 _rdmsr(USB_MSR_REG(USB_EHCI),     
149                 conf_data = hi & 0x00003f00;      
150                 break;                            
151         default:                                  
152                 break;                            
153         }                                         
154                                                   
155         return conf_data;                         
156 }                                                 
157                                                   

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