Daniel Hellstrom | 9d7c6b2 | 2008-03-28 09:47:00 +0100 | [diff] [blame] | 1 | /* machines.h: Defines for taking apart the machine type value in the |
| 2 | * idprom and determining the kind of machine we are on. |
| 3 | * |
| 4 | * Taken from the SPARC port of Linux. |
| 5 | * |
| 6 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) |
| 7 | * Copyright (C) 2007 Daniel Hellstrom (daniel@gaisler.com) |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | #ifndef __SPARC_MACHINES_H__ |
| 27 | #define __SPARC_MACHINES_H__ |
| 28 | |
| 29 | struct Sun_Machine_Models { |
| 30 | char *name; |
| 31 | unsigned char id_machtype; |
| 32 | }; |
| 33 | |
| 34 | /* Current number of machines we know about that has an IDPROM |
| 35 | * machtype entry including one entry for the 0x80 OBP machines. |
| 36 | */ |
| 37 | #define NUM_SUN_MACHINES 16 |
| 38 | |
| 39 | extern struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES]; |
| 40 | |
| 41 | /* The machine type in the idprom area looks like this: |
| 42 | * |
| 43 | * --------------- |
| 44 | * | ARCH | MACH | |
| 45 | * --------------- |
| 46 | * 7 4 3 0 |
| 47 | * |
| 48 | * The ARCH field determines the architecture line (sun4, sun4c, etc). |
| 49 | * The MACH field determines the machine make within that architecture. |
| 50 | */ |
| 51 | |
| 52 | #define SM_ARCH_MASK 0xf0 |
| 53 | #define SM_SUN4 0x20 |
| 54 | #define M_LEON2 0x30 |
| 55 | #define SM_SUN4C 0x50 |
| 56 | #define SM_SUN4M 0x70 |
| 57 | #define SM_SUN4M_OBP 0x80 |
| 58 | |
| 59 | #define SM_TYP_MASK 0x0f |
| 60 | /* Sun4 machines */ |
| 61 | #define SM_4_260 0x01 /* Sun 4/200 series */ |
| 62 | #define SM_4_110 0x02 /* Sun 4/100 series */ |
| 63 | #define SM_4_330 0x03 /* Sun 4/300 series */ |
| 64 | #define SM_4_470 0x04 /* Sun 4/400 series */ |
| 65 | |
| 66 | /* Leon machines */ |
| 67 | #define M_LEON2_SOC 0x01 /* Leon2 SoC */ |
| 68 | |
| 69 | /* Sun4c machines Full Name - PROM NAME */ |
| 70 | #define SM_4C_SS1 0x01 /* Sun4c SparcStation 1 - Sun 4/60 */ |
| 71 | #define SM_4C_IPC 0x02 /* Sun4c SparcStation IPC - Sun 4/40 */ |
| 72 | #define SM_4C_SS1PLUS 0x03 /* Sun4c SparcStation 1+ - Sun 4/65 */ |
| 73 | #define SM_4C_SLC 0x04 /* Sun4c SparcStation SLC - Sun 4/20 */ |
| 74 | #define SM_4C_SS2 0x05 /* Sun4c SparcStation 2 - Sun 4/75 */ |
| 75 | #define SM_4C_ELC 0x06 /* Sun4c SparcStation ELC - Sun 4/25 */ |
| 76 | #define SM_4C_IPX 0x07 /* Sun4c SparcStation IPX - Sun 4/50 */ |
| 77 | |
| 78 | /* Sun4m machines, these predate the OpenBoot. These values only mean |
| 79 | * something if the value in the ARCH field is SM_SUN4M, if it is |
| 80 | * SM_SUN4M_OBP then you have the following situation: |
| 81 | * 1) You either have a sun4d, a sun4e, or a recently made sun4m. |
| 82 | * 2) You have to consult OpenBoot to determine which machine this is. |
| 83 | */ |
| 84 | #define SM_4M_SS60 0x01 /* Sun4m SparcSystem 600 */ |
| 85 | #define SM_4M_SS50 0x02 /* Sun4m SparcStation 10 */ |
| 86 | #define SM_4M_SS40 0x03 /* Sun4m SparcStation 5 */ |
| 87 | |
| 88 | /* Sun4d machines -- N/A */ |
| 89 | /* Sun4e machines -- N/A */ |
| 90 | /* Sun4u machines -- N/A */ |
| 91 | |
| 92 | #endif /* !(_SPARC_MACHINES_H) */ |