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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/sysdev/mpic_msi.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/powerpc/sysdev/mpic_msi.c (Architecture ppc) and /arch/m68k/sysdev/mpic_msi.c (Architecture m68k)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 
  2 /*                                                
  3  * Copyright 2006-2007, Michael Ellerman, IBM     
  4  */                                               
  5                                                   
  6 #include <linux/irq.h>                            
  7 #include <linux/irqdomain.h>                      
  8 #include <linux/of_irq.h>                         
  9 #include <linux/bitmap.h>                         
 10 #include <linux/msi.h>                            
 11 #include <asm/mpic.h>                             
 12 #include <asm/hw_irq.h>                           
 13 #include <asm/ppc-pci.h>                          
 14 #include <asm/msi_bitmap.h>                       
 15                                                   
 16 #include <sysdev/mpic.h>                          
 17                                                   
 18 void mpic_msi_reserve_hwirq(struct mpic *mpic,    
 19 {                                                 
 20         /* The mpic calls this even when there    
 21         if (!mpic->msi_bitmap.bitmap)             
 22                 return;                           
 23                                                   
 24         msi_bitmap_reserve_hwirq(&mpic->msi_bi    
 25 }                                                 
 26                                                   
 27 #ifdef CONFIG_MPIC_U3_HT_IRQS                     
 28 static int __init mpic_msi_reserve_u3_hwirqs(s    
 29 {                                                 
 30         irq_hw_number_t hwirq;                    
 31         const struct irq_domain_ops *ops = mpi    
 32         struct device_node *np;                   
 33         int flags, index, i;                      
 34         struct of_phandle_args oirq;              
 35                                                   
 36         pr_debug("mpic: found U3, guessing msi    
 37                                                   
 38         /* Reserve source numbers we know are     
 39          *                                        
 40          * This is a bit of a mix of U3 and U4    
 41          * to work fine, we have plenty enough    
 42          * mark anything we don't like reserve    
 43          */                                       
 44         for (i = 0;   i < 8;   i++)               
 45                 msi_bitmap_reserve_hwirq(&mpic    
 46                                                   
 47         for (i = 42;  i < 46;  i++)               
 48                 msi_bitmap_reserve_hwirq(&mpic    
 49                                                   
 50         for (i = 100; i < 105; i++)               
 51                 msi_bitmap_reserve_hwirq(&mpic    
 52                                                   
 53         for (i = 124; i < mpic->num_sources; i    
 54                 msi_bitmap_reserve_hwirq(&mpic    
 55                                                   
 56                                                   
 57         np = NULL;                                
 58         while ((np = of_find_all_nodes(np))) {    
 59                 pr_debug("mpic: mapping hwirqs    
 60                                                   
 61                 index = 0;                        
 62                 while (of_irq_parse_one(np, in    
 63                         ops->xlate(mpic->irqho    
 64                                                   
 65                         msi_bitmap_reserve_hwi    
 66                 }                                 
 67         }                                         
 68                                                   
 69         return 0;                                 
 70 }                                                 
 71 #else                                             
 72 static int __init mpic_msi_reserve_u3_hwirqs(s    
 73 {                                                 
 74         return -1;                                
 75 }                                                 
 76 #endif                                            
 77                                                   
 78 int __init mpic_msi_init_allocator(struct mpic    
 79 {                                                 
 80         int rc;                                   
 81                                                   
 82         rc = msi_bitmap_alloc(&mpic->msi_bitma    
 83                               irq_domain_get_o    
 84         if (rc)                                   
 85                 return rc;                        
 86                                                   
 87         rc = msi_bitmap_reserve_dt_hwirqs(&mpi    
 88         if (rc > 0) {                             
 89                 if (mpic->flags & MPIC_U3_HT_I    
 90                         rc = mpic_msi_reserve_    
 91                                                   
 92                 if (rc) {                         
 93                         msi_bitmap_free(&mpic-    
 94                         return rc;                
 95                 }                                 
 96         }                                         
 97                                                   
 98         return 0;                                 
 99 }                                                 
100                                                   

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