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

TOMOYO Linux Cross Reference
Linux/arch/mips/fw/arc/identify.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This file is subject to the terms and conditions of the GNU General Public
  3  * License.  See the file "COPYING" in the main directory of this archive
  4  * for more details.
  5  *
  6  * identify.c: identify machine by looking up system identifier
  7  *
  8  * Copyright (C) 1998 Thomas Bogendoerfer
  9  *
 10  * This code is based on arch/mips/sgi/kernel/system.c, which is
 11  *
 12  * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
 13  */
 14 #include <linux/bug.h>
 15 #include <linux/init.h>
 16 #include <linux/kernel.h>
 17 #include <linux/types.h>
 18 #include <linux/string.h>
 19 
 20 #include <asm/sgialib.h>
 21 #include <asm/bootinfo.h>
 22 
 23 struct smatch {
 24         char *arcname;
 25         char *liname;
 26         int flags;
 27 };
 28 
 29 static struct smatch mach_table[] = {
 30         {
 31                 .arcname        = "SGI-IP22",
 32                 .liname         = "SGI Indy",
 33                 .flags          = PROM_FLAG_ARCS,
 34         }, {
 35                 .arcname        = "SGI-IP28",
 36                 .liname         = "SGI IP28",
 37                 .flags          = PROM_FLAG_ARCS,
 38         }, {
 39                 .arcname        = "SGI-IP30",
 40                 .liname         = "SGI Octane",
 41                 .flags          = PROM_FLAG_ARCS,
 42         }, {
 43                 .arcname        = "SGI-IP32",
 44                 .liname         = "SGI O2",
 45                 .flags          = PROM_FLAG_ARCS,
 46         }, {
 47                 .arcname        = "Microsoft-Jazz",
 48                 .liname         = "Jazz MIPS_Magnum_4000",
 49                 .flags          = 0,
 50         }, {
 51                 .arcname        = "PICA-61",
 52                 .liname         = "Jazz Acer_PICA_61",
 53                 .flags          = 0,
 54         }, {
 55                 .arcname        = "RM200PCI",
 56                 .liname         = "SNI RM200_PCI",
 57                 .flags          = PROM_FLAG_DONT_FREE_TEMP,
 58         }, {
 59                 .arcname        = "RM200PCI-R5K",
 60                 .liname         = "SNI RM200_PCI-R5K",
 61                 .flags          = PROM_FLAG_DONT_FREE_TEMP,
 62         }
 63 };
 64 
 65 int prom_flags;
 66 
 67 static struct smatch * __init string_to_mach(const char *s)
 68 {
 69         int i;
 70 
 71         for (i = 0; i < ARRAY_SIZE(mach_table); i++) {
 72                 if (!strcmp(s, mach_table[i].arcname))
 73                         return &mach_table[i];
 74         }
 75 
 76         panic("Yeee, could not determine architecture type <%s>", s);
 77 }
 78 
 79 char *system_type;
 80 
 81 const char *get_system_type(void)
 82 {
 83         return system_type;
 84 }
 85 
 86 static pcomponent * __init ArcGetChild(pcomponent *Current)
 87 {
 88         return (pcomponent *) ARC_CALL1(child_component, Current);
 89 }
 90 
 91 void __init prom_identify_arch(void)
 92 {
 93         pcomponent *p;
 94         struct smatch *mach;
 95         const char *iname;
 96 
 97         /*
 98          * The root component tells us what machine architecture we have here.
 99          */
100         p = ArcGetChild(PROM_NULL_COMPONENT);
101         if (p == NULL) {
102                 iname = "Unknown";
103         } else
104                 iname = (char *) (long) p->iname;
105 
106         printk("ARCH: %s\n", iname);
107         mach = string_to_mach(iname);
108         system_type = mach->liname;
109 
110         prom_flags = mach->flags;
111 }
112 

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