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

TOMOYO Linux Cross Reference
Linux/arch/m68k/sun3/idprom.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/m68k/sun3/idprom.c (Architecture alpha) and /arch/sparc/sun3/idprom.c (Architecture sparc)


  1 // SPDX-License-Identifier: GPL-2.0                 1 
  2 /*                                                
  3  * idprom.c: Routines to load the idprom into     
  4  *           interpret the data contained with    
  5  *                                                
  6  * Copyright (C) 1995 David S. Miller (davem@c    
  7  * Sun3/3x models added by David Monro (davidm    
  8  */                                               
  9                                                   
 10 #include <linux/module.h>                         
 11 #include <linux/kernel.h>                         
 12 #include <linux/types.h>                          
 13 #include <linux/init.h>                           
 14 #include <linux/string.h>                         
 15                                                   
 16 #include <asm/oplib.h>                            
 17 #include <asm/idprom.h>                           
 18 #include <asm/machines.h>  /* Fun with Sun rel    
 19                                                   
 20 #include "sun3.h"                                 
 21                                                   
 22 struct idprom *idprom;                            
 23 EXPORT_SYMBOL(idprom);                            
 24                                                   
 25 static struct idprom idprom_buffer;               
 26                                                   
 27 /* Here is the master table of Sun machines wh    
 28  * of the Sparc CPU and have a meaningful IDPR    
 29  * know about.  See asm-sparc/machines.h for e    
 30  */                                               
 31 static struct Sun_Machine_Models Sun_Machines[    
 32 /* First, Sun3's */                               
 33     { .name = "Sun 3/160 Series",       .id_ma    
 34     { .name = "Sun 3/50",               .id_ma    
 35     { .name = "Sun 3/260 Series",       .id_ma    
 36     { .name = "Sun 3/110 Series",       .id_ma    
 37     { .name = "Sun 3/60",               .id_ma    
 38     { .name = "Sun 3/E",                .id_ma    
 39 /* Now, Sun3x's */                                
 40     { .name = "Sun 3/460 Series",       .id_ma    
 41     { .name = "Sun 3/80",               .id_ma    
 42 /* Then, Sun4's */                                
 43 // { .name = "Sun 4/100 Series",        .id_ma    
 44 // { .name = "Sun 4/200 Series",        .id_ma    
 45 // { .name = "Sun 4/300 Series",        .id_ma    
 46 // { .name = "Sun 4/400 Series",        .id_ma    
 47 /* And now, Sun4c's */                            
 48 // { .name = "Sun4c SparcStation 1",    .id_ma    
 49 // { .name = "Sun4c SparcStation IPC",  .id_ma    
 50 // { .name = "Sun4c SparcStation 1+",   .id_ma    
 51 // { .name = "Sun4c SparcStation SLC",  .id_ma    
 52 // { .name = "Sun4c SparcStation 2",    .id_ma    
 53 // { .name = "Sun4c SparcStation ELC",  .id_ma    
 54 // { .name = "Sun4c SparcStation IPX",  .id_ma    
 55 /* Finally, early Sun4m's */                      
 56 // { .name = "Sun4m SparcSystem600",    .id_ma    
 57 // { .name = "Sun4m SparcStation10/20", .id_ma    
 58 // { .name = "Sun4m SparcStation5",     .id_ma    
 59 /* One entry for the OBP arch's which are sun4    
 60 // { .name = "Sun4M OBP based system",  .id_ma    
 61 };                                                
 62                                                   
 63 static void __init display_system_type(unsigne    
 64 {                                                 
 65         register int i;                           
 66                                                   
 67         for (i = 0; i < NUM_SUN_MACHINES; i++)    
 68                 if(Sun_Machines[i].id_machtype    
 69                         if (machtype != (SM_SU    
 70                                 pr_info("TYPE:    
 71                         else {                    
 72 #if 0                                             
 73                                 char sysname[1    
 74                                                   
 75                                 prom_getproper    
 76                                                   
 77                                 pr_info("TYPE:    
 78 #endif                                            
 79                         }                         
 80                         return;                   
 81                 }                                 
 82         }                                         
 83                                                   
 84         prom_printf("IDPROM: Bogus id_machtype    
 85         prom_halt();                              
 86 }                                                 
 87                                                   
 88 void sun3_get_model(char *model)                  
 89 {                                                 
 90         register int i;                           
 91                                                   
 92         for (i = 0; i < NUM_SUN_MACHINES; i++)    
 93                 if(Sun_Machines[i].id_machtype    
 94                         strcpy(model, Sun_Mach    
 95                         return;                   
 96                 }                                 
 97         }                                         
 98 }                                                 
 99                                                   
100                                                   
101                                                   
102 /* Calculate the IDPROM checksum (xor of the d    
103 static unsigned char __init calc_idprom_cksum(    
104 {                                                 
105         unsigned char cksum, i, *ptr = (unsign    
106                                                   
107         for (i = cksum = 0; i <= 0x0E; i++)       
108                 cksum ^= *ptr++;                  
109                                                   
110         return cksum;                             
111 }                                                 
112                                                   
113 /* Create a local IDPROM copy, verify integrit    
114 void __init idprom_init(void)                     
115 {                                                 
116         prom_get_idprom((char *) &idprom_buffe    
117                                                   
118         idprom = &idprom_buffer;                  
119                                                   
120         if (idprom->id_format != 0x01)  {         
121                 prom_printf("IDPROM: Unknown f    
122                 prom_halt();                      
123         }                                         
124                                                   
125         if (idprom->id_cksum != calc_idprom_ck    
126                 prom_printf("IDPROM: Checksum     
127                             idprom->id_cksum,     
128                 prom_halt();                      
129         }                                         
130                                                   
131         display_system_type(idprom->id_machtyp    
132                                                   
133         pr_info("Ethernet address: %pM\n", idp    
134 }                                                 
135                                                   

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