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

TOMOYO Linux Cross Reference
Linux/arch/mips/loongson2ef/common/pci.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/pci.c (Version linux-6.12-rc7) and /arch/i386/loongson2ef/common/pci.c (Version linux-4.11.12)


  1 // SPDX-License-Identifier: GPL-2.0-or-later        1 
  2 /*                                                
  3  * Copyright (C) 2007 Lemote, Inc. & Institute    
  4  * Author: Fuxin Zhang, zhangfx@lemote.com        
  5  */                                               
  6 #include <linux/pci.h>                            
  7                                                   
  8 #include <pci.h>                                  
  9 #include <loongson.h>                             
 10                                                   
 11 static struct resource loongson_pci_mem_resour    
 12         .name   = "pci memory space",             
 13         .start  = LOONGSON_PCI_MEM_START,         
 14         .end    = LOONGSON_PCI_MEM_END,           
 15         .flags  = IORESOURCE_MEM,                 
 16 };                                                
 17                                                   
 18 static struct resource loongson_pci_io_resourc    
 19         .name   = "pci io space",                 
 20         .start  = LOONGSON_PCI_IO_START,          
 21         .end    = IO_SPACE_LIMIT,                 
 22         .flags  = IORESOURCE_IO,                  
 23 };                                                
 24                                                   
 25 static struct pci_controller  loongson_pci_con    
 26         .pci_ops        = &loongson_pci_ops,      
 27         .io_resource    = &loongson_pci_io_res    
 28         .mem_resource   = &loongson_pci_mem_re    
 29         .mem_offset     = 0x00000000UL,           
 30         .io_offset      = 0x00000000UL,           
 31 };                                                
 32                                                   
 33 static void __init setup_pcimap(void)             
 34 {                                                 
 35         /*                                        
 36          * local to PCI mapping for CPU access    
 37          * CPU address space [256M,448M] is wi    
 38          * we set pcimap_lo[0,1,2] to map it t    
 39          *                                        
 40          * pcimap: PCI_MAP2  PCI_Mem_Lo2 PCI_M    
 41          *           [<2G]   [384M,448M] [320M    
 42          */                                       
 43         LOONGSON_PCIMAP = LOONGSON_PCIMAP_PCIM    
 44                 LOONGSON_PCIMAP_WIN(2, LOONGSO    
 45                 LOONGSON_PCIMAP_WIN(1, LOONGSO    
 46                 LOONGSON_PCIMAP_WIN(0, 0);        
 47                                                   
 48         /*                                        
 49          * PCI-DMA to local mapping: [2G,2G+25    
 50          */                                       
 51         LOONGSON_PCIBASE0 = 0x80000000ul;   /*    
 52         /* size: 256M, burst transmission, pre    
 53         LOONGSON_PCI_HIT0_SEL_L = 0xc000000cul    
 54         LOONGSON_PCI_HIT0_SEL_H = 0xfffffffful    
 55         LOONGSON_PCI_HIT1_SEL_L = 0x00000006ul    
 56         LOONGSON_PCI_HIT1_SEL_H = 0x00000000ul    
 57         LOONGSON_PCI_HIT2_SEL_L = 0x00000006ul    
 58         LOONGSON_PCI_HIT2_SEL_H = 0x00000000ul    
 59                                                   
 60         /* avoid deadlock of PCI reading/writi    
 61         LOONGSON_PCI_ISR4C = 0xd2000001ul;        
 62                                                   
 63         /* can not change gnt to break pci tra    
 64         deassert for some broken device */        
 65         LOONGSON_PXARB_CFG = 0x00fe0105ul;        
 66                                                   
 67 #ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG             
 68         /*                                        
 69          * set cpu addr window2 to map CPU add    
 70          */                                       
 71         LOONGSON_ADDRWIN_CPUTOPCI(ADDRWIN_WIN2    
 72                 LOONGSON_PCI_MEM_DST, MMAP_CPU    
 73 #endif                                            
 74 }                                                 
 75                                                   
 76 static int __init pcibios_init(void)              
 77 {                                                 
 78         setup_pcimap();                           
 79                                                   
 80         loongson_pci_controller.io_map_base =     
 81         register_pci_controller(&loongson_pci_    
 82                                                   
 83                                                   
 84         return 0;                                 
 85 }                                                 
 86                                                   
 87 arch_initcall(pcibios_init);                      
 88                                                   

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