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

TOMOYO Linux Cross Reference
Linux/arch/m68k/coldfire/nettel.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/coldfire/nettel.c (Version linux-6.12-rc7) and /arch/sparc/coldfire/nettel.c (Version linux-4.14.336)


  1 // SPDX-License-Identifier: GPL-2.0                 1 
  2 /*********************************************    
  3                                                   
  4 /*                                                
  5  *      nettel.c -- startup code support for t    
  6  *                                                
  7  *      Copyright (C) 2009, Greg Ungerer (gerg    
  8  */                                               
  9                                                   
 10 /*********************************************    
 11                                                   
 12 #include <linux/kernel.h>                         
 13 #include <linux/param.h>                          
 14 #include <linux/init.h>                           
 15 #include <linux/io.h>                             
 16 #include <linux/platform_device.h>                
 17 #include <asm/coldfire.h>                         
 18 #include <asm/mcfsim.h>                           
 19 #include <asm/nettel.h>                           
 20                                                   
 21 /*********************************************    
 22                                                   
 23 /*                                                
 24  * Define the IO and interrupt resources of th    
 25  */                                               
 26 #define NETTEL_SMC0_ADDR        0x30600300        
 27 #define NETTEL_SMC0_IRQ         29                
 28                                                   
 29 #define NETTEL_SMC1_ADDR        0x30600000        
 30 #define NETTEL_SMC1_IRQ         27                
 31                                                   
 32 /*                                                
 33  * We need some access into the SMC9196 regist    
 34  * we will need here (including the smc91x.h d    
 35  * in a simple form).                             
 36  */                                               
 37 #define SMC91xx_BANKSELECT      14                
 38 #define SMC91xx_BASEADDR        2                 
 39 #define SMC91xx_BASEMAC         4                 
 40                                                   
 41 /*********************************************    
 42                                                   
 43 static struct resource nettel_smc91x_0_resourc    
 44         {                                         
 45                 .start          = NETTEL_SMC0_    
 46                 .end            = NETTEL_SMC0_    
 47                 .flags          = IORESOURCE_M    
 48         },                                        
 49         {                                         
 50                 .start          = NETTEL_SMC0_    
 51                 .end            = NETTEL_SMC0_    
 52                 .flags          = IORESOURCE_I    
 53         },                                        
 54 };                                                
 55                                                   
 56 static struct resource nettel_smc91x_1_resourc    
 57         {                                         
 58                 .start          = NETTEL_SMC1_    
 59                 .end            = NETTEL_SMC1_    
 60                 .flags          = IORESOURCE_M    
 61         },                                        
 62         {                                         
 63                 .start          = NETTEL_SMC1_    
 64                 .end            = NETTEL_SMC1_    
 65                 .flags          = IORESOURCE_I    
 66         },                                        
 67 };                                                
 68                                                   
 69 static struct platform_device nettel_smc91x[]     
 70         {                                         
 71                 .name                   = "smc    
 72                 .id                     = 0,      
 73                 .num_resources          = ARRA    
 74                 .resource               = nett    
 75         },                                        
 76         {                                         
 77                 .name                   = "smc    
 78                 .id                     = 1,      
 79                 .num_resources          = ARRA    
 80                 .resource               = nett    
 81         },                                        
 82 };                                                
 83                                                   
 84 static struct platform_device *nettel_devices[    
 85         &nettel_smc91x[0],                        
 86         &nettel_smc91x[1],                        
 87 };                                                
 88                                                   
 89 /*********************************************    
 90                                                   
 91 static u8 nettel_macdefault[] __initdata = {      
 92         0x00, 0xd0, 0xcf, 0x00, 0x00, 0x01,       
 93 };                                                
 94                                                   
 95 /*                                                
 96  * Set flash contained MAC address into SMC919    
 97  * MAC address is sane, and not an empty flash    
 98  * Bay default MAC address instead.               
 99  */                                               
100                                                   
101 static void __init nettel_smc91x_setmac(unsign    
102 {                                                 
103         u16 *macp;                                
104                                                   
105         macp = (u16 *) flashaddr;                 
106         if ((macp[0] == 0xffff) && (macp[1] ==    
107                 macp = (u16 *) &nettel_macdefa    
108                                                   
109         writew(1, NETTEL_SMC0_ADDR + SMC91xx_B    
110         writew(macp[0], ioaddr + SMC91xx_BASEM    
111         writew(macp[1], ioaddr + SMC91xx_BASEM    
112         writew(macp[2], ioaddr + SMC91xx_BASEM    
113 }                                                 
114                                                   
115 /*********************************************    
116                                                   
117 /*                                                
118  * Re-map the address space of at least one of    
119  * parts. Both parts power up decoding the sam    
120  * need to move one of them first, before doin    
121  */                                               
122                                                   
123 static void __init nettel_smc91x_init(void)       
124 {                                                 
125         writew(0x00ec, MCFSIM_PADDR);             
126         mcf_setppdata(0, 0x0080);                 
127         writew(1, NETTEL_SMC0_ADDR + SMC91xx_B    
128         writew(0x0067, NETTEL_SMC0_ADDR + SMC9    
129         mcf_setppdata(0x0080, 0);                 
130                                                   
131         /* Set correct chip select timing for     
132         writew(0x1180, MCFSIM_CSCR3);             
133                                                   
134         /* Set the SMC interrupts to be auto-v    
135         mcf_autovector(NETTEL_SMC0_IRQ);          
136         mcf_autovector(NETTEL_SMC1_IRQ);          
137                                                   
138         /* Set MAC addresses from flash for bo    
139         nettel_smc91x_setmac(NETTEL_SMC0_ADDR,    
140         nettel_smc91x_setmac(NETTEL_SMC1_ADDR,    
141 }                                                 
142                                                   
143 /*********************************************    
144                                                   
145 static int __init init_nettel(void)               
146 {                                                 
147         nettel_smc91x_init();                     
148         platform_add_devices(nettel_devices, A    
149         return 0;                                 
150 }                                                 
151                                                   
152 arch_initcall(init_nettel);                       
153                                                   
154 /*********************************************    
155                                                   

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