Merge lp:~lulu-masse/ocsinventory-unix-agent/Solaris into lp:ocsinventory-unix-agent

Proposed by luluM
Status: Needs review
Proposed branch: lp:~lulu-masse/ocsinventory-unix-agent/Solaris
Merge into: lp:ocsinventory-unix-agent
Diff against target: 14067 lines (+13559/-175)
13 files modified
contrib/install.sh (+198/-0)
contrib/memconf (+8244/-0)
contrib/sneep (+4162/-0)
contrib/update_info.sh (+56/-0)
lib/Ocsinventory/Agent/Backend/OS/HPUX/Networks.pm (+79/-16)
lib/Ocsinventory/Agent/Backend/OS/Solaris/Bios.pm (+76/-52)
lib/Ocsinventory/Agent/Backend/OS/Solaris/CPU.pm (+159/-31)
lib/Ocsinventory/Agent/Backend/OS/Solaris/Mem.pm (+4/-2)
lib/Ocsinventory/Agent/Backend/OS/Solaris/Memory.pm (+81/-15)
lib/Ocsinventory/Agent/Backend/OS/Solaris/Networks.pm (+440/-52)
lib/Ocsinventory/Agent/Backend/OS/Solaris/Packages.pm (+25/-0)
lib/Ocsinventory/Agent/Backend/OS/Solaris/Slots.pm (+23/-2)
lib/Ocsinventory/Agent/XML/Inventory.pm (+12/-5)
To merge this branch: bzr merge lp:~lulu-masse/ocsinventory-unix-agent/Solaris
Reviewer Review Type Date Requested Status
OCS Inventory Dev Team Pending
Review via email: mp+26419@code.launchpad.net

Description of the change

Changement Solaris

To post a comment you must log in.
962. By luluM

Ajout fonction addCPU

963. By luluM

Modification Bug sur Network.pm de l'agent HPUX et ajout d ela fonction addCPU dans inventory.pm

964. By luluM

.

965. By luluM

fonction AddCPU modifiée

Unmerged revisions

965. By luluM

fonction AddCPU modifiée

964. By luluM

.

963. By luluM

Modification Bug sur Network.pm de l'agent HPUX et ajout d ela fonction addCPU dans inventory.pm

962. By luluM

Ajout fonction addCPU

961. By luluM

Ajout contribution pour agent solaris

960. By luluM

Modification agent solaris

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'contrib/install.sh'
--- contrib/install.sh 1970-01-01 00:00:00 +0000
+++ contrib/install.sh 2010-06-21 09:39:28 +0000
@@ -0,0 +1,198 @@
1#!/bin/ksh
2set -x
3REP_BASE=/opt
4REP_OCS=/opt/ocsinventory-agent/
5REP_PERL_SUN=/net/SUNOS/opt/perl/bin/perl
6REP_PERL_HP=/opt/perl-5.10
7REP_LIB_PERL_SUN=/net/SUNOS/opt/perl/lib:/opt/ocsinventory-agent/lib/
8REP_LIB_PERL_HP=$REP_PERL_HP/lib:/opt/ocsinventory-agent/lib/
9REP_LIB_OCS=/var/lib/ocsinventory-agent/
10REP_ETC_OCS=/etc/ocsinventory/
11REP_SIS=/var/sis/
12
13#SERVEUR_OCS=xxx.xxx.xxx.xxx
14SERVEUR_OCS=xxx.xxx.xxx.xxx
15SERVEUR_NFS=xxx.xxx.xxx.xxx
16PARTAGE_NFS=/net/SUNOS/partage/ocs/
17LOG_FILE=${REP_OCS}install_ocs.log
18MYHOSTNAME=`/bin/hostname`
19MYPERL=`which perl`
20MYCRONTAB=`which crontab`
21PWD=`/bin/pwd`
22LOG=/tmp/ocsinventory-agent.log
23OSTYPE=`/sbin/uname`
24OSLEVEL=`/sbin/uname -r`
25export PATH=$PATH:$REP_OCS
26echo_message()
27{
28 #if [ $1 -ne 0 -a $1 -ne 3 ]
29 if [ $1 -ne 0 ]
30 then
31 echo $2 : $3
32 else
33 echo $2
34 fi
35}
36
37case "$OSTYPE" in
38 "SunOS")
39 case "$OSLEVEL" in
40 "5.8")
41 PERL_BIN=$REP_PERL_SUN;PERL5LIB=$PERL5LIB:$REP_LIB_PERL_SUN;LIBRARY_PATH=$LIBRARY_PATH:$REP_LIB_PERL_SUN;LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$REP_LIB_PERL_SUN;PATH=$PATH:$REP_OCS;;
42 "5.10")
43 PERL_BIN=$REP_PERL_SUN;PERL5LIB=$PERL5LIB:$REP_LIB_PERL_SUN;LIBRARY_PATH=$LIBRARY_PATH:$REP_LIB_PERL_SUN;LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$REP_LIB_PERL_SUN;PATH=$PATH:$REP_OCS;;
44 esac;;
45 "HP-UX")
46 PERL_BIN=$REP_PERL_HP;PERL5LIB=$PERL5LIB:$REP_LIB_PERL_HP;LIBRARY_PATH=$LIBRARY_PATH:$REP_LIB_PERL_HP;LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$REP_LIB_PERL_HP;PATH=$PATH:$REP_OCS;;
47 "Linux")
48 PERL_BIN=$MYPERL;;
49esac
50
51#case "$OSTYPE" in
52 #"SunOS")
53 # case "$OSLEVEL" in
54 # "5.8")
55 # PERL_BIN=$REP_PERL;PERL5LIB=$PERL5LIB:$REP_LIB_PERL;LIBRARY_PATH=$LIBRARY_PATH:$REP_LIB_PERL;LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$REP_LIB_PERL;;
56 # "5.10")
57 # PERL_BIN=$REP_PERL;PERL5LIB=$PERL5LIB:/opt/ocsinventory-agent/lib;LIBRARY_PATH=$LIBRARY_PATH:/opt/ocsinventory-agent/lib;LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ocsinventory-agent/lib;;
58 # esac;;
59 #"HP-UX")
60 #PERL_BIN=/usr/contrib/bin/perl ;;
61 #"Linux")
62 # PERL_BIN=$MYPERL;;
63#esac
64
65
66export PERL5LIB
67export LIBRARY_PATH
68export LD_LIBRARY_PATH
69export PATH
70
71echo "Execution d OCS ... "
72if [ -d $REP_BASE ]
73then
74 echo_message $? "Pas de repertoire $REP_BASE a creer\n "
75else
76 /bin/mkdir $REP_BASE > $LOG 2>&1
77 echo_message $? "Creation du repertoire $REP_BASE" "ERREUR"
78fi
79
80
81if [ -d $REP_OCS ]
82then
83 echo_message $? "Pas de repertoire $REP_OCS a creer\n "
84 /bin/rm /opt/ocsinventory-agent
85 /bin/rm -R $REP_OCS
86 /bin/mkdir ${REP_OCS}
87else
88 /bin/mkdir $REP_OCS > $LOG 2>&1
89 echo_message $? "Creation du repertoire $REP_OCS" "ERREUR"
90fi
91
92if [ -d /var/lib ]
93then
94 echo_message $? "Pas de repertoire /var/lib a creer \n "
95else
96 /bin/mkdir /var/lib > $LOG 2>&1
97 echo_message $? "Creation du repertoire /var/lib" "ERREUR"
98fi
99
100if [ -d $REP_LIB_OCS ]
101then
102 echo_message $? "Pas de repertoire $REP_LIB_OCS a creer "
103else
104 /bin/mkdir $REP_LIB_OCS > $LOG 2>&1
105 echo_message $? "Creation du repertoire $REP_LIB_OCS" "ERREUR"
106fi
107
108if [ -d $REP_ETC_OCS ]
109then
110 echo_message $? "le repertoire $REP_ETC_OCS existe déja...\n "
111else
112 /bin/mkdir $REP_ETC_OCS > $LOG 2>&1
113 echo_message $? "Creation du repertoire $REP_ETC_OCS ...\n "
114fi
115
116/bin/cp -R ocsinventory-agent lib memconf update_info.sh sneep $REP_OCS
117/bin/chmod +x ${REP_OCS}ocsinventory-agent
118/bin/chmod +x ${REP_OCS}memconf
119/bin/chmod +x ${REP_OCS}update_info.sh
120/bin/chmod +x ${REP_OCS}sneep
121
122#if [ -d $REP_SIS ]
123#then
124 # echo_message $? "le repertoire $REP_SIS existe déja...\n "
125#else
126 /bin/mkdir $REP_SIS > $LOG 2>&1
127 echo_message $? "Creation du repertoire $REP_SIS ...\n "
128 echo "Recherche des fichiers de signature"
129 /bin/find /opt -name "*.SIS" -exec cp {} $REP_SIS \; | grep -v /zones
130 if [ -d /oracle ]
131 then
132 touch $PARTAGE_NFS$MYHOSTNAME.ORACLE
133 /bin/find /oracle -name "*.SIS" -exec cp {} $REP_SIS \; | grep -v /zones >> $PARTAGE_NFS$MYHOSTNAME.ORACLE
134 /bin/find /oracle -name "*.SIS" -exec echo {} \; >> $PARTAGE_NFS$MYHOSTNAME.ORACLE
135 /bin/ls -ltr /oracle/product >> $PARTAGE_NFS$MYHOSTNAME.ORACLE
136 fi
137 if [ -d /sybase ]
138 then
139 touch $PARTAGE_NFSMYHOSTNAME.SYBASE
140 /bin/find /sybase -name "*.SIS" -exec cp {} $REP_SIS \; | grep -v /zones >> $PARTAGE_NFS$MYHOSTNAME.SYBASE
141 /bin/find /sybase -name "*.SIS" -exec echo {} \; >> $PARTAGE_NFS$MYHOSTNAME.SYBASE
142 /bin/ls -ltr /sybase >> $PARTAGE_NFS$MYHOSTNAME.SYBASE
143 fi
144#fi
145
146
147
148echo "Mise a jour du cron"
149#INFOCRONTAB=`$MYCRONTAB -l | grep ocsinventory-agent`
150INFOCRONTAB=
151if [ "1${INFOCRONTAB}" = "1" ]
152then
153 echo_message $? "MAJ du cron"
154 $MYCRONTAB -l > ${REP_OCS}ocscrontab.bak
155 $MYCRONTAB -l > ${REP_OCS}ocscrontab
156vi - ${REP_OCS}/ocscrontab << FILE
157:/ocsinventory-agent/d
158:wq!
159FILE
160
161heure=$(($RANDOM % 24))
162
163if [ ${#heure} = "1" ]
164then
165heure="0$heure";
166fi
167min1=$(($RANDOM % 6 ))
168min2=$(($RANDOM % 10 ))
169echo "$min1$min2 $heure * * 1 cd ${REP_OCS};./update_info.sh > /dev/null 2>&1" >> $REP_OCS/ocscrontab
170$MYCRONTAB $REP_OCS/ocscrontab
171
172else
173
174 echo_message $? "Pas de MAJ du cron"
175
176fi
177
178
179#cp $REP_OCS/etc/ocsinventory-agent.cfg $REP_ETC_OCS
180#cp $REP_OCS/etc/modules.conf $REP_ETC_OCS
181
182
183echo "Info OCS "
184$PERL_BIN -I ${REP_OCS}lib/ -MXML::SAX -e "XML::SAX->add_parser('XML::SAX::PurePerl')->save_parsers()"
185echo "Recuperation des infos ... $PERL_BIN $REP_OCS/ocsinventory-agent --devlib ./lib --server http://$SERVEUR_OCS/ocsinventory -f -i -debug --force "
186#$PERL_BIN ${REP_OCS}ocsinventory-agent --devlib ./lib -l /opt/ocsinventory-agent -i --debug --force
187echo "Changement de repertoire : $REP_OCS "
188#cd $REP_OCS
189#$PERL_BIN $REP_OCS/ocsinventory-agent --devlib ./lib --server http://$SERVEUR_OCS/ocsinventory --debug --force
190$PERL_BIN ${REP_OCS}ocsinventory-agent --devlib ./lib --server http://$SERVEUR_OCS/ocsinventory --debug --force
191#perl ocsinventory-agent --devlib ./lib --debug --force
192
193
194
195echo "Backup des infos\n"
196#/usr/bin/cp $REP_OCS/*.ocs $PARTAGE_NFS
197
198
0199
=== added file 'contrib/memconf'
--- contrib/memconf 1970-01-01 00:00:00 +0000
+++ contrib/memconf 2010-06-21 09:39:28 +0000
@@ -0,0 +1,8244 @@
1#!/usr/bin/env perl
2#
3# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4# MODIFY THE LOCATION OF PERL ABOVE IF NECESSARY
5# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6#
7# @(#) memconf - Identify sizes of memory modules installed on a
8# @(#) Solaris, Linux, FreeBSD or HP-UX workstation or server.
9# @(#) Micron Technology, Inc. - Tom Schmidt 29-Sep-2009 V2.11
10#
11# Maintained by Tom Schmidt (tschmidt@micron.com)
12#
13# Check my website at http://www.4schmidts.com/unix.html to get the latest
14# version of memconf.
15#
16# If memconf does not recognize a system, then please run 'memconf -D' to
17# have it automatically E-mail me the information I need to enhanced to
18# recognize it. If the unrecognized system is a Sun clone, please also send
19# any hardware documentation on the memory layout that you may have.
20#
21# Usage: memconf [ -v | -D | -h ] [explorer_dir]
22# -v verbose mode
23# -D E-mail results to memconf maintainer
24# -h print help
25# explorer_dir Sun Explorer output directory
26#
27# memconf reports the size of each SIMM/DIMM memory module installed in a
28# system. It also reports the system type and any empty memory sockets.
29# In verbose mode, it also reports the following information if available:
30# - banner name, model and CPU/system frequencies
31# - address range and bank numbers for each module
32#
33# memconf is Y2K compliant. There are no date calls in the program. Your
34# Operating System or Perl version may not be Y2K compliant.
35#
36# memconf is free software; you can redistribute it and/or modify it under
37# the terms of the GNU General Public License as published by the Free
38# Software Foundation; either version 2 of the License, or (at your option)
39# any later version.
40#
41# Original version based on SunManagers SUMMARY by Howard Modell
42# (h.modell@ieee.org) on 29-Jan-1997.
43#
44# Tested to work on:
45# - Solaris 10 6/06 or later on x86 with /usr/platform/i86pc/sbin/prtdiag
46# - Linux on SPARC with sparc-utils and /dev/openprom
47# - Linux/FreeBSD on x86 with kernel-utils or pmtools for /usr/sbin/dmidecode
48# - most HP-UX systems with Support Tools Manager (cstm)
49# - Solaris (SunOS 4.X or 5.X) on the following SPARC systems
50# - sun4c Sun SS1, SS2, IPC, IPX, ELC with Open Boot PROM V2.X
51# - sun4m Sun 4/6x0, SS4, SS5, SS10, SS20, LX/ZX, Classic, Voyager, JavaEngine1
52# - sun4d Sun SPARCserver-1000, 1000E, SPARCcenter-2000, 2000E
53# - sun4u Sun Ultra 1, 2, 5, 10, 30, 60, 450
54# - sun4u Sun Ultra 80, Ultra Enterprise 420R, and Netra t1400/1405.
55# - sun4u Sun Ultra Enterprise 220R, 250, 450
56# - sun4u Sun Ultra Enterprise 3000, 3500, 4000/5000, 4500/5500, 6000, 6500
57# - sun4u1 Sun Ultra Enterprise 10000
58# - sun4u Sun StorEdge N8400 and N8600 Filer
59# - sun4u Sun SPARCengine Ultra AX, AXi, AXmp, AXmp+, AXe
60# - sun4u Sun SPARCengine CP 1400, CP 1500, CP2140
61# - sun4u Sun Netra t1 100/105, t1120/1125, ft1800, X1, T1 200, AX1105-500, 120
62# - sun4u Sun Netra 20 (Netra T4)
63# - sun4u Sun Netra ct800
64# - sun4u Sun Blade 100, 150, 1000, 1500, 2000, 2500
65# - sun4u Sun Fire 280R
66# - sun4u Sun Fire 3800, 4800, 4810, 6800
67# - sun4u Sun Fire V100, V120, V210, V240, V250, V440
68# - sun4u Sun Netra 210, 240, 440
69# - sun4u Sun Fire V125, V215, V245, V445
70# - sun4u Sun Fire V480, V490, V880, V880z, V890
71# - sun4u Sun Fire 12000, 15000, E20K, E25K
72# - sun4u Sun Fire V1280, Netra 1280 (Netra T12)
73# - sun4u Sun Fire E2900, E4900, E6900
74# - sun4u Sun Fire B100s Blade Server
75# - sun4u Sun Ultra 25 Workstation
76# - sun4u Sun Ultra 45 Workstation
77# - sun4u Sun/Fujitsu Siemens SPARC Enterprise M3000, M4000, M5000, M8000 Server
78# - sun4v Sun Fire T2000, T1000, Netra T2000
79# - sun4v Sun Blade T6300, T6320
80# - sun4v Sun SPARC Enterprise T2000, T1000 Server
81# - sun4v Sun SPARC Enterprise T5120, T5140, T5220, T5240 Server, Netra T5220
82# - sun4v Sun SPARC Enterprise T5440 Server
83# - sun4m Tatung COMPstation 5, 10, 20AL, 20S and 20SL clones
84# - sun4m transtec SPARCstation 20I clone
85# - sun4m Rave Axil-255 SPARCstation 5 clone
86# - sun4m Rave Axil-245, 311 and 320 clones (no verbose output)
87# - sun4u AXUS Ultra 250
88# - sun4u Tatung COMPstation U2, U60 and U80D clones
89# - Force Computers SPARC clones (no verbose output)
90# - Tadpole SPARCbook 3 and RDI PowerLite-170 (no verbose output)
91# - Tadpole VoyagerIIi
92# - Tadpole (Cycle) 3200 CycleQUAD Ultra 2 upgrade motherboard
93# - Tadpole (Cycle) UP-520-IIi SPARCstation 5/20 upgrade motherboard
94# - Tadpole SPARCle
95# - Auspex 7000/650 (no verbose output)
96# - Fujitsu S-4/10H, S-4/20L and S-4/20H clones (no verbose output)
97# - Fujitsu GP7000, GP7000F
98# - Fujitsu Siemens PrimePower 200, 400, 600, 800, 1000, 2000
99# - Fujitsu Siemens PrimePower 250, 450, 650, 850
100# - Fujitsu Siemens PrimePower 900, 1500, 2500, HPC2500
101# - Twinhead TWINstation 5G, 20G
102# - Detects VSIMMs for SX graphics on SS10SX/SS20 (1st VSIMM only)
103# - Detects Prestoserve NVSIMMs on SS10/SS20/SS1000/SC2000
104#
105# Untested systems that should work:
106# - sun4c Sun SS1+ with Open Boot PROM V2.X
107# - sun4m Tatung COMPstation 20A clone
108# - sun4u Sun Netra ct400, ct410, ct810
109# - sun4u Sun SPARCengine CP2040, CP2060, CP2080, CP2160
110# - sun4u Sun/Fujitsu Siemens SPARC Enterprise M9000 Server
111# - May not work properly on Sun clones
112#
113# Won't work on:
114# - SPARC systems without /dev/openprom
115# - sun4c Sun SS1, SS1+, SLC, IPC with Open Boot PROM V1.X (no 'memory' lines
116# in devinfo/prtconf output)
117# - sun4 kernel architecture, and sun3 and older systems
118# - Perl 5.001 is known to have problems with hex number conversions
119# - Does not detect unused VSIMMs (another FB installed) or second VSIMM
120#
121# To Do list and Revision History can be found on the maintainers web site at
122# http://www.4schmidts.com/unix.html
123
124# Uncomment for debugging (perl 5 only)
125#use diagnostics;
126$^W=1; # Enables -w warning switch, put here for SunOS4 compatibility.
127
128$version="V2.11";
129$version_date="29-Sep-2009";
130$URL="http://www.4schmidts.com/unix.html";
131
132$newpath="/usr/sbin:/bin:/usr/bin:/usr/ucb:/usr/local/bin:/var/local/bin";
133$ENV{PATH}=(defined($ENV{PATH})) ? "$newpath:$ENV{PATH}" : $newpath;
134# Force C locale so that output is in English
135$ENV{LC_ALL}="C";
136$_=$];
137($PERL_VERSION_MAJOR)=/(\d).*/;
138if ($PERL_VERSION_MAJOR < 5) {
139 ($PERL_VERS)=/(\d\.\d)/;
140 ($PERL_PATCH)=/(\d*)$/;
141 $PERL_PATCH="0$PERL_PATCH" if ($PERL_PATCH < 10);
142 $PERL_VERSION="$PERL_VERS$PERL_PATCH";
143} else {
144 ($PERL_VERSION)=/(\d\.\d{3}).*/;
145}
146
147$uname="/usr/bin/uname";
148$uname="/bin/uname" if (-x '/bin/uname');
149if (-x $uname) {
150 $hostname=&mychomp(`$uname -n`);
151 $machine=&mychomp(`$uname -m`);
152 $os=&mychomp(`$uname`);
153 $os="Linux" if ("$os" eq "FreeBSD");
154 $osrel=&mychomp(`$uname -r`);
155 $kernver=&mychomp(`$uname -v`);
156 $platform=$machine;
157} else {
158 $hostname="";
159 $machine="";
160 $os="this unsupported";
161 $osrel="";
162 $kernver="";
163}
164$osrelease="";
165$prtdiag_cmd="";
166$prtdiag_exec="";
167$have_prtdiag_data=0;
168$prtdiag_checked=0;
169$prtfru_cmd="";
170$have_prtfru_data=0;
171$prtpicl_cmd="";
172$have_prtpicl_data=0;
173$psrinfo_cmd="";
174$have_psrinfo_data=0;
175$use_psrinfo_data=1;
176$psrinfo_checked=0;
177$cfgadm_cmd="";
178$have_cfgadm_data=0;
179$ipmitool_cmd="";
180$have_ipmitool_data=0;
181$ipmi_cpu_cnt=0;
182$ipmi_cputype="";
183@ipmi_mem=("");
184$smbios_cmd="";
185$have_smbios_data=0;
186@smbios_mem=("");
187$ldm_cmd="";
188$have_ldm_data=0;
189$ldm_memory=0;
190$free_cmd="";
191$have_free_data=0;
192$have_x86_devname=0;
193if (-d '/usr/platform') {
194 $platform=&mychomp(`$uname -i`);
195 if (-x "/usr/platform/$platform/sbin/prtdiag") {
196 $prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag";
197 } elsif (-x "/usr/platform/$machine/sbin/prtdiag") {
198 $prtdiag_cmd="/usr/platform/$machine/sbin/prtdiag";
199 } elsif (-x "/usr/sbin/prtdiag") {
200 $prtdiag_cmd="/usr/sbin/prtdiag";
201 }
202} elsif (-x '/usr/kvm/prtdiag') {
203 $platform=$machine;
204 $prtdiag_cmd='/usr/kvm/prtdiag';
205} elsif (-x "/usr/sbin/prtdiag") {
206 $platform=$machine;
207 $prtdiag_cmd="/usr/sbin/prtdiag";
208}
209if ($prtdiag_cmd ne "") {
210 if (-x $prtdiag_cmd) {
211 $prtdiag_exec="$prtdiag_cmd";
212 }
213}
214$buffer="";
215$filename="";
216$installed_memory=0;
217$failed_memory=0;
218$spare_memory=0;
219$failing_memory=0;
220$failed_fru="";
221$ultra=0;
222$simmbanks=0;
223$simmspergroup=1;
224$bankcnt=0;
225$slot0=0;
226$smallestsimm=16777216;
227$largestsimm=0;
228$found8mb=0;
229$found16mb=0;
230$found32mb=0;
231$found10bit=0;
232$found11bit=0;
233$foundbank1or3=0;
234$sxmem=0;
235$nvmem=0;
236$nvmem1=0;
237$nvmem2=0;
238$memtype="SIMM";
239$sockettype="socket";
240$verbose=0;
241$DEBUG=0;
242$starttime=time;
243$recognized=1;
244$untested=1;
245$untested_type="";
246$perlhexbug=0;
247$exitstatus=0;
248$meg=1048576;
249@socketstr=("");
250@socketlabelstr=("");
251@orderstr=("");
252@groupstr=("");
253@bankstr=("");
254@banksstr=("");
255$bankname="banks";
256@bytestr=("");
257@slotstr=("");
258$simmrangex=0;
259$simmrange=1;
260$showrange=1;
261$start1x="";
262$stop1x="";
263@simmsizes=(0,16777216);
264@simmsizesfound=();
265@memorylines=("");
266$socket="";
267$socketlabel="";
268$order="";
269$group="";
270$slotnum="";
271$bank="";
272$dualbank=0;
273$byte="";
274$gotmemory="";
275$gotmodule="";
276$gotmodulenames="";
277$gotcpunames="";
278$gotcpuboards="";
279$slotname0="";
280@boards_cpu="";
281@boards_mem="";
282$empty_banks="";
283$banks_used="";
284$nvsimm_banks="";
285$boardslot_cpu=" ";
286$boardslot_cpus=" ";
287@boardslot_cpus=();
288$boardslot_mem=" ";
289$boardslot_mems=" ";
290@boardslot_mems=();
291$boardfound_cpu=0;
292$boardfound_mem=0;
293$prtdiag_has_mem=0;
294$prtdiag_banktable_has_dimms=0;
295$prtdiag_failed=0;
296$prtconf_warn="";
297$flag_cpu=0;
298$flag_mem=0;
299$flag_rewrite_prtdiag_mem=0;
300$format_cpu=0;
301$format_mem=0;
302$foundname=0;
303$sockets_used="";
304$sockets_empty="";
305$sortslots=1;
306$devtype="";
307$interleave=0;
308$stacked=0;
309$freq=0;
310$sysfreq=0;
311$cpufreq=0;
312$cputype="";
313$cputype_prtconf="";
314$cputype_psrinfo="";
315@cpucnt=();
316$cpucntfrom="";
317$cpucntflag=0;
318@diagcpucnt=();
319$diagthreadcnt=0;
320$psrcpucnt=0;
321$foundpsrinfocpu=0;
322$ncpu=0; # remains 0 if using prtdiag output only
323$ndcpu=0;
324$npcpu=0;
325$nvcpu=0;
326$threadcnt=0;
327$corecnt=1;
328$hyperthread=0;
329$header_shown=0;
330$romver="";
331$romvernum="";
332$SUNWexplo=0;
333$banner="";
334$bannermore="";
335$cpubanner="";
336$diagbanner="";
337$model="";
338$modelmore="";
339$model_checked=0;
340$BSD=0; # Initially assume SunOS 5.X
341$config_cmd="/usr/sbin/prtconf -vp";
342$config_command="prtconf";
343$config_permission=0;
344$permission_error="";
345$dmidecode_error="";
346$freephys=0;
347$isX86=0;
348$HPUX=0;
349$devname=""; # Sun internal development code name
350$familypn=""; # Sun family part number (system code)
351$clone=0;
352$totmem=0;
353$LnxDMI=0;
354$latest_dmidecode_ver="2.10";
355$dmidecode_ver="0";
356$dmidecodeURL="http://www.nongnu.org/dmidecode/";
357$cpuarr=-1;
358$memarr=-1;
359$release="";
360$waitshown=0;
361$helpers_defined=0;
362$picl_foundmemory=0;
363@picl_mem_pn=();
364@picl_mem_bank=();
365@picl_mem_dimm=();
366$linebreak="----------------------------------------------------\n";
367$uid=&mychomp(`id`);
368$uid=~s/uid=//;
369$uid=~s/\(.*//;
370
371#
372# Parse options
373#
374foreach $name (@ARGV) {
375 if ($name eq "-v") {
376 # verbose mode
377 $verbose=1;
378 } elsif ($name eq "-d") {
379 # more verbose debug mode
380 $verbose=2;
381 } elsif ($name eq "-debug") {
382 # most verbose debug mode
383 $DEBUG=1;
384 } elsif ($name eq "-D") {
385 # E-mail information of system to maintainer
386 $verbose=3;
387 open(MAILFILE, ">/tmp/memconf.output") || die "can't open /tmp/memconf.output: $!";
388 print MAILFILE "Output from 'memconf -d' on $hostname\n";
389 print MAILFILE "$linebreak";
390 close(MAILFILE);
391 open(STDOUT, "| tee -a /tmp/memconf.output") || die "can't open /tmp/memconf.output: $!";
392 print "Gathering memconf data to E-mail to maintainer. This may take a few minutes.\nPlease wait...\n";
393 } elsif (-f "$name/sysconfig/prtconf-vp.out") {
394 # Sun Explorer output
395 $SUNWexplo=1;
396 # Special case for regression testing Sun Explorer data
397 $os="SunOS";
398 open(FILE, "<$name/sysconfig/prtconf-vp.out");
399 @config=<FILE>;
400 close(FILE);
401 if (-f "$name/sysconfig/prtdiag-v.out") {
402 open(FILE, "<$name/sysconfig/prtdiag-v.out");
403 @prtdiag=<FILE>;
404 $have_prtdiag_data=1;
405 $prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag";
406 $prtdiag_exec="$prtdiag_cmd";
407 close(FILE);
408 }
409 if (-f "$name/fru/prtfru_-x.out") {
410 open(FILE, "<$name/fru/prtfru_-x.out");
411 @prtfru=<FILE>;
412 $have_prtfru_data=1;
413 $prtfru_cmd='/usr/sbin/prtfru';
414 close(FILE);
415 }
416 if (-f "$name/sysconfig/prtpicl-v.out") {
417 open(FILE, "<$name/sysconfig/prtpicl-v.out");
418 @prtpicl=<FILE>;
419 $have_prtpicl_data=1;
420 $prtpicl_cmd='/usr/sbin/prtpicl';
421 close(FILE);
422 }
423 if (-f "$name/sysconfig/psrinfo-v.out") {
424 open(FILE, "<$name/sysconfig/psrinfo-v.out");
425 @psrinfo=<FILE>;
426 $have_psrinfo_data=1;
427 $psrinfo_cmd='/usr/sbin/psrinfo';
428 close(FILE);
429 }
430 # Sun Explorer does not include "psrinfo -p" or
431 # "psrinfo -p -v" data yet.
432 if (-f "$name/sysconfig/cfgadm-alv.out") {
433 open(FILE, "<$name/sysconfig/cfgadm-alv.out");
434 @cfgadm=<FILE>;
435 $have_cfgadm_data=1;
436 $cfgadm_cmd='/usr/sbin/cfgadm';
437 close(FILE);
438 }
439 if (-f "$name/sysconfig/uname-a.out") {
440 open(FILE, "<$name/sysconfig/uname-a.out");
441 $uname=&mychomp(<FILE>);
442 close(FILE);
443 @unamearr=split(/\s/, $uname);
444 $hostname=$unamearr[1];
445 $machine=$unamearr[4];
446 $osrel=$unamearr[2];
447 $platform=$unamearr[6];
448 $prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag";
449 $prtdiag_exec="$prtdiag_cmd";
450 } else {
451 if ($config[0] =~ /System Configuration:/) {
452 @machinearr=split(/\s+/, $config[0]);
453 $machine=$machinearr[4];
454 }
455 $osrel="";
456 $hostname="";
457 }
458 if (-f "$name/sysconfig/prtconf-V.out") {
459 open(FILE, "<$name/sysconfig/prtconf-V.out");
460 $romver=&mychomp(<FILE>);
461 close(FILE);
462 }
463 $filename="$name";
464 } elsif (-f $name) {
465 # Regression test file with prtconf/dmidecode output
466 open(FILE, "<$name");
467 @config=<FILE>;
468 close(FILE);
469 # Regression test file may also have prtdiag, etc.
470 @prtdiag=@config;
471 @prtfru=@config;
472 $have_prtfru_data=1;
473 @prtpicl=@config;
474 $have_prtpicl_data=1;
475 @psrinfo=@config;
476 $have_psrinfo_data=1;
477 @cfgadm=@config;
478 $have_cfgadm_data=1;
479 @ipmitool=@config;
480 $have_ipmitool_data=1;
481 @ldm=@config;
482 $have_ldm_data=1;
483 @free=@config;
484 $have_free_data=1;
485 @smbios=@config;
486 $have_smbios_data=1;
487 @machinfo=@config;
488 $hostname="";
489 $osrel="";
490 for ($val=0; $val < 10; $val++) {
491 if ($config[$val]) {
492 if ($config[$val] =~ /System Configuration:/) {
493 # Special case for regression testing SunOS prtconf files
494 $os="SunOS";
495 @machinearr=split(/\s+/, $config[$val]);
496 $machine=$machinearr[4];
497 $machine="" if (! defined($machine));
498 last;
499 } elsif ($config[$val] =~ / dmidecode / || $config[$val] =~ /DMI .* present/) {
500 # Special case for regression testing Linux dmidecode files
501 $os="Linux";
502 $LnxDMI=1;
503 if ($config[$val] =~ / dmidecode /) {
504 $dmidecode_ver=&mychomp($config[$val]);
505 $dmidecode_ver=~s/.* dmidecode //;
506 }
507 $machine="";
508 $platform="";
509 last;
510 }
511 }
512 }
513 # Special case for regression testing SunOS4 files
514 if ($name =~ /devinfo\./) {
515 $os="SunOS";
516 $BSD=1;
517 }
518 # Special case for regression testing Linux SPARC files
519 $os="Linux" if ($name =~ /prtconf\.Linux/);
520 $filename="$name";
521 } else {
522 &show_help;
523 }
524}
525&linux_dmi if ($LnxDMI);
526if ($filename eq "") {
527 if ("$os" eq "HP-UX") {
528 $HPUX=1;
529 if (-x '/usr/sbin/cstm') {
530 &hpux_cstm;
531 } else {
532 &show_header;
533 &show_supported;
534 }
535 } elsif ("$os" eq "Linux") {
536 &linux_release if ("$release" eq "");
537 &find_helpers;
538 &linux_dmi if ($config_cmd =~ /dmidecode/);
539 if ("$machine" =~ /.86/ || ! -e '/dev/openprom') {
540 &show_header;
541 &show_supported;
542 }
543 } elsif ("$os" ne "SunOS") {
544 &show_header;
545 &show_supported;
546 }
547 if (-f '/vmunix') {
548 # SunOS 4.X (Solaris 1.X)
549 $BSD=1;
550 if (! -x '/usr/etc/devinfo') {
551 print "ERROR: no 'devinfo' command. Aborting.\n";
552 exit 1;
553 }
554 $config_cmd="/usr/etc/devinfo -pv";
555 $config_command="devinfo";
556 } else {
557 # Solaris 2.X or later
558 $BSD=0;
559 if (! -x '/usr/sbin/prtconf') {
560 print "ERROR: no 'prtconf' command. Aborting.\n";
561 exit 1;
562 }
563 $config_cmd="/usr/sbin/prtconf -vp";
564 $config_command="prtconf";
565 }
566}
567$kernbit="";
568$hasprtconfV=0;
569$solaris="";
570$solaris="1.0" if ($osrel eq "4.1.1");
571$solaris="1.0.1" if ($osrel eq "4.1.2");
572$solaris="1.1" if ($osrel =~ /4.1.3/);
573$solaris="1.1.1" if ($osrel eq "4.1.3_U1");
574$solaris="1.1.2" if ($osrel eq "4.1.4");
575if ($osrel =~ /^5./) {
576 $osminor=$osrel;
577 $osminor=~s/5.//;
578 if ($SUNWexplo) {
579 if (-f "$filename/etc/release") {
580 open(FILE, "<$filename/etc/release");
581 $release=<FILE>;
582 close(FILE);
583 }
584 } else {
585 if (-f '/etc/release') {
586 open(FILE, "</etc/release");
587 $release=<FILE>;
588 close(FILE);
589 }
590 }
591 if ($release =~ "Solaris") {
592 $release=~s/\s+//;
593 $release=&mychomp($release);
594 $solaris="$release";
595 }
596 if ($osminor =~ /[7-9]|1[0-9]/) {
597 $hasprtconfV=1;
598 $solaris=$osminor if ($solaris eq "");
599 $kernbit=32;
600 if ($SUNWexplo) {
601 $cpuarch="";
602 if (-f "$filename/sysconfig/isainfo.out") {
603 open(FILE, "<$filename/sysconfig/isainfo.out");
604 $cpuarch=<FILE>;
605 close(FILE);
606 } elsif (-f "$filename/sysconfig/isainfo-kv.out") {
607 open(FILE, "<$filename/sysconfig/isainfo-kv.out");
608 $cpuarch=<FILE>;
609 close(FILE);
610 }
611 $kernbit=64 if ($cpuarch =~ /sparcv9/ || $cpuarch =~ /amd64/);
612 } elsif (-x '/bin/isainfo') {
613 $kernbit=&mychomp(`/bin/isainfo -b`);
614 }
615 } elsif ($osminor =~ /[4-6]/) {
616 $hasprtconfV=1;
617 $solaris="2.$osminor" if ($solaris eq "");
618 } else {
619 $solaris="2.$osminor";
620 }
621 if ("$machine" eq "i86pc" && $osminor =~ /[0-5]/) {
622 # x86 Solaris 2.5.1 and earlier has different syntax than SPARC
623 $hasprtconfV=0;
624 $config_cmd="/usr/sbin/prtconf -v";
625 }
626}
627if ($filename eq "") {
628 @config=&run("$config_cmd");
629 if ($hasprtconfV) {
630 # Solaris 2.4 or later
631 $romver=&mychomp(`/usr/sbin/prtconf -V 2>&1`);
632 if ($romver eq "Cannot open openprom device") {
633 $prtconf_warn="ERROR: $romver";
634 $romver="";
635 } else {
636 @romverarr=split(/\s/, $romver);
637 $romvernum=$romverarr[1];
638 }
639 } else {
640 # Solaris 2.3 or older
641 # Try to use sysinfo if installed to determine the OBP version.
642 # sysinfo is available from http://www.MagniComp.com/sysinfo/
643 close(STDERR);
644 $romver=`sysinfo -show romver 2>/dev/null | tail -1`;
645 open(STDERR);
646 if ($romver eq "") {
647 # Assume it is old
648 $romver="2.X" if ($machine =~ /sun4/);
649 } else {
650 $romver=&mychomp($romver);
651 @romverarr=split(/\s/, $romver);
652 $romver=$romverarr[$#romverarr];
653 }
654 $romvernum=$romver;
655 }
656}
657
658sub please_wait {
659 return if ($waitshown);
660 $waitshown=1;
661 print "Gathering data for memconf. This may take over a minute. Please wait...\n";
662}
663
664sub find_helpers {
665 return if ($helpers_defined);
666 $helpers_defined=1;
667 if ("$os" eq "HP-UX") {
668 $config_cmd="echo 'selclass qualifier cpu;info;wait;selclass qualifier memory;info;wait;infolog'|/usr/sbin/cstm";
669 } elsif ("$os" eq "Linux") {
670 if (defined($ENV{DMIDECODE}) && -x $ENV{DMIDECODE}) {
671 # this may be a setuid-root version of dmidecode
672 $config_cmd=$ENV{DMIDECODE};
673 } else {
674 foreach $bin ('/usr/local/sbin','/usr/local/bin','/usr/sbin','/usr/bin','/bin') {
675 if (-x "$bin/dmidecode") {
676 $config_cmd="$bin/dmidecode";
677 last;
678 }
679 }
680 }
681 } elsif (-x '/usr/sbin/prtconf') {
682 # Solaris 2.X or later
683 $config_cmd="/usr/sbin/prtconf -vp";
684 $prtfru_cmd='/usr/sbin/prtfru' if (-x '/usr/sbin/prtfru');
685 $prtpicl_cmd='/usr/sbin/prtpicl' if (-x '/usr/sbin/prtpicl');
686 $psrinfo_cmd='/usr/sbin/psrinfo' if (-x '/usr/sbin/psrinfo');
687 $cfgadm_cmd='/usr/sbin/cfgadm' if (-x '/usr/sbin/cfgadm');
688 $smbios_cmd='/usr/sbin/smbios' if (-x '/usr/sbin/smbios');
689 $ldm_cmd='/opt/SUNWldm/bin/ldm' if (-x '/opt/SUNWldm/bin/ldm');
690 }
691 if ("$os" eq "Linux") {
692 $free_cmd='/usr/bin/free -m';
693 }
694 if ("$os" eq "SunOS" || "$os" eq "Linux") {
695 if (defined($ENV{IPMITOOL}) && -x $ENV{IPMITOOL}) {
696 # this may be a setuid-root version of ipmitool
697 $ipmitool_cmd=$ENV{IPMITOOL};
698 } else {
699 foreach $bin ('/usr/sfw/bin','/usr/local/sbin','/usr/local/bin','/usr/sbin','/usr/bin','/bin') {
700 if (-x "$bin/ipmitool") {
701 $ipmitool_cmd="$bin/ipmitool";
702 last;
703 }
704 }
705 }
706 }
707}
708
709sub show_helpers {
710 $s=shift;
711 print "$s$config_cmd\n";
712 if ("$os" eq "SunOS") {
713 print "$s$prtdiag_cmd -v\n" if ($prtdiag_exec ne "");
714 print "$s$prtfru_cmd -x\n" if ($prtfru_cmd ne "");
715 print "$s$prtpicl_cmd -v\n" if ($prtpicl_cmd ne "");
716 if ($psrinfo_cmd ne "") {
717 print "$s$psrinfo_cmd -v\n";
718 $tmp=&mychomp(`$psrinfo_cmd -p 2>/dev/null`);
719 if ($tmp ne "") {
720 print "$s$psrinfo_cmd -p\n";
721 print "$s$psrinfo_cmd -p -v\n";
722 }
723 }
724 print "$s$cfgadm_cmd -al\n" if ($cfgadm_cmd ne "");
725 print "$s$smbios_cmd\n" if ($smbios_cmd ne "");
726 print "$s$ldm_cmd list-devices -a -p\n" if ($ldm_cmd ne "");
727 }
728 if ("$os" eq "Linux") {
729 print "$s$free_cmd\n" if ($free_cmd ne "");
730 }
731 if ("$os" eq "SunOS" || "$os" eq "Linux") {
732 print "$s$ipmitool_cmd fru\n" if ($ipmitool_cmd ne "");
733 }
734 if ("$os" eq "HP-UX") {
735 print "$s/usr/contrib/bin/machinfo\n" if (-x '/usr/contrib/bin/machinfo');
736 }
737}
738
739sub show_help {
740 &find_helpers;
741 $config_cmd="dmidecode" if ("$os" eq "Linux" && $config_cmd =~ /prtconf/);
742 print "Usage: memconf [ -v | -D | -h ] [explorer_dir]\n";
743 print " -v verbose mode\n";
744 print " -D E-mail results to memconf maintainer\n";
745 print " -h print help\n";
746 print " explorer_dir Sun Explorer output directory\n";
747 print "\nThis is memconf, $version $version_date\n\nCheck my website ";
748 print "at $URL to get the latest\nversion of memconf.\n\n";
749 &show_supported if ("$os" ne "SunOS" && "$os" ne "HP-UX" && "$os" ne "Linux");
750 print "Please send bug reports and enhancement requests along with ";
751 print "the output of the\nfollowing commands to tschmidt\@micron.com ";
752 print "as E-mail attachments so that memconf\nmay be enhanced. ";
753 print "You can do this using the 'memconf -D' command if this system\n";
754 print "can E-mail to the Internet.\n";
755 &show_helpers(" ");
756 exit;
757}
758
759sub cpubanner {
760 print &runtime . "in cpubanner, corecnt=$corecnt, npcpu=$npcpu, nvcpu=$nvcpu, cputype=$cputype\n" if ($DEBUG);
761 if ($modelmore =~ /(Solaris x86 machine)/ && $cpubanner eq "" && $cputype ne "x86") {
762 $modelmore="";
763 while (($cf,$cnt)=each(%cpucnt)) {
764 $cf=~/^(.*) (\d+)$/;
765 $cputype=$1;
766 $cpufreq=$2;
767 }
768 &x86multicorecnt($cputype);
769 $ncpu=$cpucnt{"$cputype $cpufreq"};
770 if ($cpucntflag == 0 && $npcpu == 0) {
771 for $tmp (2,3,4,6,8,12) {
772 $ncpu /= $tmp if ($corecnt == $tmp && $ncpu % $tmp == 0);
773 }
774 }
775 $ncpu=$npcpu if ($npcpu != 0);
776 $cpubanner .= "$ncpu X " if ($ncpu > 1);
777 $cpubanner .= "Dual Core " if ($corecnt == 2 && $cputype !~ /Dual.Core/i);
778 $cpubanner .= "Triple Core " if ($corecnt == 3 && $cputype !~ /Triple.Core/i);
779 $cpubanner .= "Quad Core " if ($corecnt == 4 && $cputype !~ /Quad.Core/i);
780 $cpubanner .= "Hex Core " if ($corecnt == 6 && $cputype !~ /Hex.Core/i);
781 $cpubanner .= "Octal Core " if ($corecnt == 8 && $cputype !~ /Octal.Core/i);
782 $cpubanner .= "Twelve Core " if ($corecnt == 12 && $cputype !~ /Twelve.Core/i);
783 $cpubanner .= "hyperthreaded " if ($hyperthread);
784 $cpubanner .= "$cputype";
785 $cpubanner .= " x86" if ($cputype eq "AMD");
786 $cpubanner .= " ${cpufreq}MHz" if ($cpufreq ne "" && $cpufreq ne "0" && $cputype !~ /Hz$/);
787 $cpubanner=~s/-Core/ Core/;
788 }
789}
790
791sub show_header {
792 return if ($header_shown);
793 print &runtime . "cpucntfrom=$cpucntfrom\n" if ($DEBUG);
794 &cpubanner;
795 $header_shown=1;
796 undef %saw;
797 @saw{@simmsizesfound}=();
798 @simmsizesfound=sort numerically keys %saw;
799 print "memconf: $version $version_date $URL\n" if ($verbose);
800 print "hostname: $hostname\n" if ($hostname);
801 if ($filename) {
802 if ($SUNWexplo) {
803 print "Sun Explorer directory: $filename\n";
804 } else {
805 print "filename: $filename\n";
806 }
807 }
808 if ($diagthreadcnt && $cpucntfrom eq "prtdiag") {
809 # Replace @cpucnt with @diagcpucnt
810 while (($cf,$tmp)=each(%cpucnt)) {
811 delete $cpucnt{"$cf"};
812 $cpucnt{"$cf"}=$diagcpucnt{"$cf"};
813 }
814 }
815 if ($banner) {
816 # See if banner includes CPU information
817 if ($banner !~ /\(.*SPARC/ && $banner !~ /MHz/) {
818 @cputypecnt=keys(%cpucnt);
819 $x=0;
820 while (($cf,$cnt)=each(%cpucnt)) {
821 $x++;
822 $cf=~/^(.*) (\d*)$/;
823 $ctype=$1;
824 $cfreq=$2;
825 &multicore_cpu_cnt("");
826 $cpubanner .= "$cnt X " if ($cnt > 1);
827 if ($ctype =~ /390Z5/) {
828 $cpubanner .= "SuperSPARC";
829 $cpubanner .= "-II" if ($cfreq > 70);
830 } elsif ($ctype =~ /MB86907/) {
831 $cpubanner .= "TurboSPARC-II";
832 } elsif ($ctype =~ /MB86904/ || $ctype =~ /390S10/) {
833 $cpubanner .= "microSPARC";
834 $cpubanner .= "-II" if ($cfreq > 70);
835 } elsif ($ctype =~ /L2A0925/) {
836 $cpubanner .= "microSPARC-IIep";
837 } elsif ($ctype =~ /,RT62[56]/) {
838 $cpubanner .= "hyperSPARC";
839 } else {
840 $cpubanner .= "$ctype";
841 }
842 $cpubanner .= " ${cfreq}MHz" if ($cfreq ne "" && $cpubanner !~ /Hz$/);
843 $cpubanner .= ", " if ($x < scalar(@cputypecnt));
844 }
845 } elsif ($banner =~ /\(/ && $banner !~ /MHz/) {
846 # CPU listed without speed
847 while (($cf,$cnt)=each(%cpucnt)) {
848 $cf=~/^(.*) (\d*)$/;
849 $cfreq=$2;
850 $banner=~s/\)/ ${cfreq}MHz\)/g if ($cfreq);
851 }
852 }
853 }
854 $modelmore="" if ($modelmore =~ /(Solaris x86 machine)/ && $model ne "i86pc");
855 if ($verbose) {
856 if ($banner) {
857 print "banner: $banner";
858 print " $bannermore" if ($bannermore);
859 print " ($cpubanner)" if ($cpubanner);
860 print "\n";
861 }
862 print "manufacturer: $manufacturer\n" if ($manufacturer);
863 if ($model) {
864 print "model: $model";
865 print " $modelmore" if ($modelmore);
866 print " $realmodel" if ($realmodel);
867 print " ($cpubanner)" if ($cpubanner ne "" && $banner eq "");
868 print "\n";
869 }
870 print "Sun development codename: $devname\n" if ($devname ne "" && ! $clone);
871 print "Sun Family Part Number: $familypn\n" if ($familypn ne "" && ! $clone);
872 if ($filename eq "" || $SUNWexplo) {
873 if ($solaris) {
874 print "Solaris " if ($solaris !~ /Solaris/);
875 print "$solaris, ";
876 print "${kernbit}-bit kernel, " if ($kernbit);
877 }
878 if ("$os" eq "Linux" && "$release" ne "") {
879 print "$release\n";
880 } else {
881 print "$os $osrel";
882 print " ($osrelease)" if ($osrelease ne "");
883 print ", ${kernbit}" if ($kernbit && $HPUX);
884 print "\n";
885 }
886 } elsif ($HPUX) {
887 print "$os";
888 print " $osrel" if ($osrel ne "");
889 print " ($osrelease)" if ($osrelease ne "");
890 print ", ${kernbit}" if ($kernbit);
891 print "\n";
892 } elsif ("$os" eq "Linux") {
893 if ("$release" ne "") {
894 print "$release\n";
895 } elsif ($LnxDMI) {
896 print "Linux x86\n";
897 } elsif (-e '/dev/openprom' || $filename =~ /prtconf\.Linux/) {
898 print "Linux SPARC\n";
899 }
900 } elsif ($BSD) {
901 print "Solaris 1.X, SunOS 4.X\n";
902 } else {
903 print "Solaris 2.X, SunOS 5.X\n";
904 }
905 $ncpu=1 if ($ncpu == 0); # Assume it has at least 1 CPU
906 if ($cpuarr == -1) {
907 @cputypecnt=keys(%cpucnt);
908 $x=0;
909 while (($cf,$cnt)=each(%cpucnt)) {
910 if ($cpucntflag == 0 && $npcpu == 0 && $cpucntfrom ne "prtdiag") {
911 for $tmp (2,3,4,6,8,12) {
912 $cnt /= $tmp if ($corecnt == $tmp && $cnt % $tmp == 0);
913 }
914 $cpucntflag=1;
915 }
916 if ($npcpu != 0) {
917 $cnt=$npcpu;
918 } else {
919 $cnt=$ndcpu if ($ndcpu != 0);
920 }
921 $x++;
922 $cf=~/^(.*) (\d*)$/;
923 $ctype=$1;
924 $ctype=$cf if (! $ctype);
925 $cfreq=$2;
926 &checkX86;
927 if ($isX86) {
928 $ctype="hyperthreaded $ctype" if ($hyperthread);
929 $ctype="Dual Core $ctype" if ($corecnt == 2 && $ctype !~ /Dual.Core/i);
930 $ctype="Triple Core $ctype" if ($corecnt == 3 && $ctype !~ /Triple.Core/i);
931 $ctype="Quad Core $ctype" if ($corecnt == 4 && $ctype !~ /Quad.Core/i);
932 $ctype="Hex Core $ctype" if ($corecnt == 6 && $ctype !~ /Hex.Core/i);
933 $ctype="Octal Core $ctype" if ($corecnt == 8 && $ctype !~ /Octal.Core/i);
934 $ctype="Twelve Core $ctype" if ($corecnt == 12 && $ctype !~ /Twelve.Core/i);
935 $ctype=~s/-Core/ Core/;
936 }
937 &multicore_cpu_cnt("");
938 print "$cnt $ctype";
939 if ($cfreq) {
940 print " ${cfreq}MHz" if ($cfreq > 0 && $ctype !~ /Hz$/);
941 }
942 print " cpu";
943 print "s" if ($cnt > 1);
944 print ", " if ($x < scalar(@cputypecnt));
945 }
946 if ($x > 0) {
947 if ($sysfreq) {
948 print ", ";
949 } else {
950 print "\n";
951 }
952 }
953 }
954 print "system freq: ${sysfreq}MHz\n" if ($sysfreq);
955 } else {
956 $modelbuf="";
957 if ($manufacturer) {
958 $modelbuf .= "$manufacturer " if ($banner !~ /^$manufacturer/ && $model !~ /^$manufacturer/ && ($banner ne "" || $model ne ""));
959 }
960 if ($banner ne "" && $bannermore ne "") {
961 $modelbuf .= "$banner $bannermore";
962 } elsif ($modelmore) {
963 $modelbuf .= "$model $modelmore";
964 } elsif ($banner) {
965 $modelbuf .= "$banner";
966 } elsif ($diagbanner) {
967 $modelbuf .= "$diagbanner";
968 } elsif ($model) {
969 $modelbuf .= "$model";
970 }
971 $modelbuf .= " ($cpubanner)" if ($cpubanner);
972 $modelbuf .= " $realmodel" if ($realmodel);
973 print "$modelbuf\n" if ($modelbuf);
974 }
975 # debug output
976 if ($verbose > 1) {
977 if ($banner) {
978 print "banner = $banner\n";
979 } else {
980 print "diagbanner = $diagbanner\n" if ($diagbanner);
981 }
982 print "cpubanner = $cpubanner\n" if ($cpubanner);
983 print "bannermore = $bannermore\n" if ($bannermore);
984 print "model = $model\n" if ($model);
985 print "modelmore = $modelmore\n" if ($modelmore);
986 print "machine = $machine\n" if ($machine);
987 print "platform = $platform\n" if ($platform);
988 print "ultra = $ultra\n" if ($ultra);
989 if ($ultra eq "AXi") {
990 print "found10bit = $found10bit\n";
991 print "found11bit = $found11bit\n";
992 }
993 print "motherboard = $motherboard\n" if ($motherboard);
994 print "romver = $romver\n" if ($romver);
995 print "freephys = $freephys\n" if ($freephys);
996 print "perl version: " . &mychomp($]) . "\n";
997 print "memory line: $gotmemory\n" if ($gotmemory);
998 print "module info: $gotmodule\n" if ($gotmodule);
999 print "dmidecode version: $dmidecode_ver\n" if ($dmidecode_ver);
1000
1001 # Fujitsu GP7000F and PrimePower systems
1002 print "cpu name info: $gotcpunames\n" if ($gotcpunames);
1003 print "cpu board info: $gotcpuboards\n" if ($gotcpuboards);
1004 print "module name info: $gotmodulenames\n" if ($gotmodulenames);
1005
1006 print "simmsizes = @simmsizes\n" if ($simmsizes[0] > 0);
1007 print "simmsizesfound = @simmsizesfound\n" if ($simmsizesfound[0]);
1008 }
1009 if (($verbose >= 1) && $boardfound_cpu) {
1010 if ($format_cpu == 1) {
1011 print "CPU Units: Frequency Cache-Size Version\n" if ($model =~ /-Enterprise/ || $ultra eq "e");
1012 } else {
1013 print "CPU Units:\n" if (! $ldm_memory);
1014 }
1015 if ($model ne "SPARCserver-1000" && $model ne "SPARCcenter-2000") {
1016 print @boards_cpu if (! $ldm_memory);
1017 print "Memory Units:\n";
1018 }
1019 }
1020 if ($interleave) {
1021 print "Memory Interleave Factor: $interleave";
1022 print "-way" if ($interleave =~/^\d+$/);
1023 print "\n";
1024 }
1025}
1026
1027sub show_unrecognized {
1028 if ($perlhexbug) {
1029 print " This is most likely because Perl V$PERL_VERSION";
1030 print " is buggy in hex number\n conversions. Please";
1031 print " upgrade your perl release to Perl V5.002 or later\n";
1032 print " for best results.\n";
1033 } else {
1034 print " This is most likely because memconf $version";
1035 print " does not completely\n";
1036 print " recognize this $os $osrel $platform system.\n";
1037 &show_request if ($untested == 0);
1038 }
1039}
1040
1041sub show_untested {
1042 if ($untested_type eq "OS") {
1043 print "WARNING: This is an untested $os $osrel operating";
1044 } elsif ($untested_type eq "OBP") {
1045 print "ERROR: This is an untested $os $osrel OBP $romvernum";
1046 } elsif ($untested_type eq "CPU") {
1047 print "ERROR: This is an untested CPU type on this $os $osrel";
1048 } else {
1049 print "ERROR: This is an untested $os $osrel";
1050 }
1051 print " system by memconf $version\n";
1052 print " Please let the author know how it works.\n";
1053 $exitstatus=1;
1054 &show_request;
1055}
1056
1057sub show_request {
1058 print " Check my website at $URL\n";
1059 print " for a newer version of memconf that may recognize this ";
1060 print "system better.\n";
1061 print " Please run 'memconf -D' if this system can E-mail to ";
1062 print "the Internet\n or send the output of the following ";
1063 print "commands manually to Tom Schmidt\n (tschmidt\@micron.com)";
1064 print " so that memconf $version may be enhanced to\n properly ";
1065 print "recognize this system:\n";
1066 print " memconf -d\n";
1067 &show_helpers(" ");
1068 if ($untested) {
1069 print " If this system is a Sun clone, ";
1070 print "please also send any hardware\n documentation ";
1071 print "on the memory layout that you may have.\n";
1072 }
1073}
1074
1075sub show_supported {
1076 print "memconf: $version $version_date $URL\n" if (! $verbose);
1077 print "ERROR: memconf $version is not supported on this $os";
1078 print" $osrel $machine system.\n memconf is supported on:\n";
1079 print " Solaris (SunOS 4.X or 5.X) on SPARC\n";
1080 print " Solaris 10 6/06 or later on x86 with /usr/platform/i86pc/sbin/prtdiag\n";
1081 print " Linux on SPARC with sparc-utils and /dev/openprom\n";
1082 print " Linux on x86 with kernel-utils or pmtools for /usr/sbin/dmidecode\n";
1083 print " most HP-UX systems with Support Tools Manager (cstm)\n";
1084 if ("$os" eq "Linux") {
1085 print "NOTICE: This may be corrected by installing the ";
1086 if ("$machine" =~ /.86/) {
1087 print "kernel-utils or pmtools";
1088 } else {
1089 print "sparc-utils";
1090 }
1091 print "\n package if available for this $machine system.\n";
1092 }
1093 print " memconf may be able to process Sun Explorer data on this";
1094 print " machine.\n";
1095 print " Check my website at $URL\n";
1096 print " for a newer version of memconf that may recognize this ";
1097 print "system better.\n";
1098 exit 1;
1099}
1100
1101sub show_memory {
1102 $mem=shift;
1103 print "${mem}MB";
1104 print " (", $mem / 1024, "GB)" if ($mem > 1023);
1105 print "\n";
1106}
1107
1108sub show_memory_label {
1109 $mem=shift;
1110 return if (! defined($mem));
1111 return "$mem" if ($mem =~ /[MG]B/);
1112 return $mem / 1024 . "GB" if ($mem >= 1024);
1113 return "${mem}MB";
1114}
1115
1116sub check_model {
1117 print &runtime . "in check_model, model=$model\n" if ($DEBUG);
1118 &find_helpers;
1119 if ($filename) {
1120 $platform=$model;
1121 $platform="SUNW,Ultra-5_10" if ($diagbanner =~ /Sun Ultra 5\/10/);
1122 $platform="SUNW,Sun-Fire" if ($diagbanner =~ /Sun Fire [346]8[01]0\b/ || $diagbanner =~ /Sun Fire E[246]900\b/);
1123 $platform="SUNW,Sun-Fire-15000" if ($diagbanner =~ /Sun Fire E2[05]K\b/);
1124 $platform=~s/-S$// if ($model =~ /Sun-Blade-[12]500-S\b/);
1125 $prtdiag_cmd="/usr/platform/$platform/sbin/prtdiag" if ($prtdiag_cmd =~ /platform/);
1126 }
1127 $model=~s/.*SUNW,//g;
1128 $model=~s/TWS,//g;
1129 $model=~s/CYCLE,//g;
1130 $model=~s/Tadpole_//g;
1131 $model=~s/ASPX,//g;
1132 $model=~s/PFU,//g;
1133 $model=~s/FJSV,//g;
1134 $model=~s/CompuAdd //g;
1135 $model=~s/RDI,//g;
1136 $model=~s/\s+$//;
1137 $ultra="ultra" if ($ultra eq 0 && ($model =~ /Ultra/ || $model =~ /Blade/ || $model =~ /Fire/));
1138 if ($model =~ /Fire[- ]X/i || $model =~ /Fire[- ]B[12]00x/i) {
1139 # Sun Fire X??00 Servers, i86pc
1140 # Sun B100x or B200x Blade Servers, i86pc
1141 $ultra="";
1142 $machine="x86" if ($machine ne "i86pc");
1143 $untested=1;
1144 &x86_devname;
1145 }
1146 $ultra="sparc64" if ($model =~ /SPARC64/);
1147 $ultra="e" if ($model =~ /-Enterprise/ && $model !~ /SPARC-Enterprise/);
1148 $ultra=1 if ($model =~ /Ultra-1\b/);
1149 $ultra=2 if ($model =~ /Ultra-2\b/);
1150 $ultra=5 if ($model =~ /Ultra-5\b/);
1151 $ultra="5_10" if ($model =~ /Ultra-5_10\b/);
1152 $ultra=30 if ($model =~ /Ultra-30\b/);
1153 $ultra=60 if ($model =~ /Ultra-60\b/);
1154 $ultra=80 if ($model =~ /Ultra-80\b/);
1155 $ultra=250 if ($model =~ /Ultra-250\b/);
1156 $ultra=450 if ($model =~ /Ultra-4\b/);
1157 $ultra="Netra t1" if ($banner =~ /Netra t1\b/);
1158 if ($model =~ /Ultra-4FT\b/) {
1159 $ultra="Netra ft1800";
1160 $bannermore="(Netra ft1800)";
1161 $modelmore="(Netra ft1800)";
1162 }
1163 $ultra="Sun Blade 1000" if ($model =~ /Ultra-100\b/); # prototype
1164 $ultra="Sun Blade 1000" if ($model =~ /Sun-Blade-1000\b/);
1165 $ultra="Sun Blade 2000" if ($model =~ /Sun-Blade-2000\b/);
1166 $ultra="Netra 20" if ($model =~ /Netra-20\b/);
1167 $ultra="Netra 20" if ($model =~ /Netra-T4\b/);
1168 # E2900/E4900 also use Netra-T12
1169 $ultra="Netra T12" if ($model =~ /Netra-T12\b/ && $ultra !~ /Sun Fire/);
1170 $ultra="Sun Blade 100" if ($model =~ /Grover\b/); # prototype
1171 $ultra="Sun Blade 100" if ($model =~ /Sun-Blade-100\b/);
1172 $ultra="Sun Fire 280R" if ($model =~ /Enterprise-820R\b/); # prototype
1173 $ultra="Sun Fire 280R" if ($model =~ /Sun-Fire-280R\b/);
1174 $ultra="Sun Fire" if ($model =~ /Serengeti\b/); # prototype
1175 $ultra="Sun Fire" if ($model eq "Sun-Fire" || $model =~ /Sun-Fire-[346]8[01]0\b/);
1176 $ultra="Sun Fire V480" if ($model =~ /Sun-Fire-480R\b/);
1177 $ultra="Sun Fire V490" if ($model =~ /Sun-Fire-V490\b/);
1178 $ultra="Sun Fire V880" if ($model =~ /Sun-Fire-880\b/);
1179 $ultra="Sun Fire V890" if ($model =~ /Sun-Fire-V890\b/);
1180 # Sun Fire 12K, E25K, etc. systems identifies itself as Sun Fire 15K
1181 $ultra="Sun Fire 15K" if ($model =~ /Sun-Fire-15000\b/ && $ultra !~ /Sun Fire /);
1182 $ultra="Sun Fire 12K" if ($model =~ /Sun-Fire-12000\b/);
1183 $ultra="Serverblade1" if ($model =~ /Serverblade1\b/);
1184 # UltraSPARC-IIIi (Jalapeno) systems
1185 $ultra="Enchilada" if ($model =~ /Enchilada\b/); # prototype
1186 $ultra="Enchilada" if ($model =~ /Sun-Fire-V210\b/);
1187 $ultra="Enchilada" if ($model =~ /Netra-210\b/);
1188 $ultra="Enchilada" if ($model =~ /Sun-Fire-V240\b/);
1189 $ultra="Enchilada" if ($model =~ /Netra-240\b/);
1190 $ultra="Sun Fire V440" if ($model =~ /Sun-Fire-V440\b/);
1191 $ultra="Netra 440" if ($model =~ /Netra-440\b/);
1192 $ultra="Sun Fire V250" if ($model =~ /Sun-Fire-V250\b/);
1193 $ultra="Sun Blade 1500" if ($model =~ /Sun-Blade-1500\b/);
1194 $ultra="Sun Blade 2500" if ($model =~ /Sun-Blade-2500\b/);
1195 if ($model =~ /Sun-Blade-[12]500-S\b/) {
1196 $model=~s/-S$//;
1197 $modelmore="(Silver)" if ($banner !~ /\(Silver\)/);
1198 }
1199 $ultra="Sun Ultra 45 Workstation" if ($model =~ /Sun-Ultra-45-Workstation\b/ || $model eq "A70");
1200 $ultra="Sun Ultra 25 Workstation" if ($model =~ /Sun-Ultra-25-Workstation\b/ || $model eq "Ultra-25");
1201 $ultra="Sun Ultra 45 or Ultra 25 Workstation" if ($model =~ /Sun-Ultra-45-or-Ultra-25-Workstation\b/);
1202 $ultra="Sun Fire V125" if ($model =~ /Sun-Fire-V125\b/);
1203 $ultra="Seattle" if ($model =~ /Sun-Fire-V215\b/);
1204 $ultra="Seattle" if ($model =~ /Sun-Fire-V245\b/);
1205 $ultra="Boston" if ($model =~ /Sun-Fire-V445\b/);
1206 # UltraSPARC-IV (Jaguar) or UltraSPARC-IV+ (Panther) systems
1207 $ultra="Sun Fire E2900" if ($model =~ /Sun-Fire-E2900\b/);
1208 $ultra="Sun Fire E4900" if ($model =~ /Sun-Fire-E4900\b/);
1209 $ultra="Sun Fire E6900" if ($model =~ /Sun-Fire-E6900\b/);
1210 $ultra="Sun Fire E20K" if ($model =~ /Sun-Fire-E20K\b/ || $model =~ /Sun-Fire-Enterprise-20K\b/);
1211 $ultra="Sun Fire E25K" if ($model =~ /Sun-Fire-E25K\b/ || $model =~ /Sun-Fire-Enterprise-25K\b/);
1212 # SPARC64-VI or SPARC64-VII systems
1213 $ultra=$banner if ($banner =~ /SPARC Enterprise M[34589]000 Server/);
1214 # UltraSPARC-T1 (Niagara) systems
1215 if ($model =~ /Sun-Fire-T200\b/) {
1216 $ultra="T2000";
1217 $modelmore="(Sun Fire T2000)";
1218 }
1219 $ultra="T2000" if ($model =~ /Sun-Fire-T2000\b/ || $model =~ /SPARC-Enterprise-T2000/ || $banner =~ /SPARC Enterprise T2000/ || $model =~ /Netra-T2000\b/ || $banner =~ /Netra T2000\b/);
1220 $ultra="T1000" if ($model =~ /Sun-Fire-T1000\b/ || $model =~ /SPARC-Enterprise-T1000/ || $banner =~ /SPARC Enterprise T1000/);
1221 $ultra="T6300" if ($model =~ /Sun-Blade-T6300\b/ || $banner =~ /\bT6300\b/);
1222 # UltraSPARC-T2 (Niagara-II) systems
1223 $ultra="T5120" if ($model =~ /SPARC-Enterprise-T5120/ || $banner =~ /\bT5120\b/);
1224 $ultra="T5220" if ($model =~ /SPARC-Enterprise-T5220/ || $model =~ /Netra-T5220/ || $banner =~ /\bT5220\b/);
1225 $ultra="T6320" if ($model =~ /Sun-Blade-T6320\b/ || $banner =~ /\bT6320\b/);
1226 $ultra="T6340" if ($model =~ /Sun-Blade-T6340\b/ || $banner =~ /\bT6340\b/);
1227 # UltraSPARC-T2+ (Victoria Falls) systems
1228 $ultra="T5140" if ($model =~ /SPARC-Enterprise-T5140/ || $banner =~ /\bT5140\b/);
1229 $ultra="T5240" if ($model =~ /SPARC-Enterprise-T5240/ || $banner =~ /\bT5240\b/ || $model =~ /SPARC-USBRDT-5240/);
1230 $ultra="T5440" if ($model =~ /SPARC-Enterprise-T5440/ || $model =~ /Netra-T5440/ || $banner =~ /\bT5440\b/ || $model =~ /SPARC-USBRDT-5440/);
1231 # Older SPARCstations
1232 $modelmore="SPARCstation SLC" if ($model eq "Sun 4/20");
1233 $modelmore="SPARCstation ELC" if ($model eq "Sun 4/25");
1234 $modelmore="SPARCstation IPC" if ($model eq "Sun 4/40");
1235 $modelmore="SPARCstation IPX" if ($model eq "Sun 4/50");
1236 $modelmore="SPARCstation 1" if ($model eq "Sun 4/60");
1237 $modelmore="SPARCstation 1+" if ($model eq "Sun 4/65");
1238 $modelmore="SPARCstation 2" if ($model eq "Sun 4/75");
1239 $modelmore="(SPARCsystem 600)" if ($model =~ /Sun.4.600/ && $banner !~ /SPARCsystem/);
1240 $modelmore="Sun 4/30" if ($model =~ /SPARCstation-LX/);
1241 $modelmore="Sun 4/15" if ($model =~ /SPARCclassic/);
1242 $modelmore="Sun 4/10" if ($model =~ /SPARCclassic-X/);
1243 $modelmore="(SPARCstation 10SX)" if ($model =~ /Premier-24/);
1244 if ($model eq "S240") {
1245 $manufacturer="Sun Microsystems, Inc.";
1246 $modelmore="SPARCstation Voyager";
1247 }
1248 # x86
1249 &checkX86;
1250 if ($isX86) {
1251 $modelmore="(Solaris x86 machine)";
1252 $cputype="x86";
1253 $machine=$model;
1254 $ultra=0;
1255 $cpucntfrom="prtconf" if ($cpucntfrom eq "");
1256 return if ($model_checked);
1257 &check_prtdiag if ($use_psrinfo_data == 2);
1258 &check_psrinfo;
1259 &cpubanner;
1260 $cpucnt{"$cputype $cpufreq"}++;
1261 }
1262 # Clones
1263 if ($banner =~ /\bMP-250[(\b]/) {
1264 $ultra="axus250";
1265 $bannermore="Ultra-250";
1266 $modelmore="(Ultra-250)";
1267 }
1268 $manufacturer="AXUS" if ($ultra =~ /axus/);
1269 $manufacturer="Force Computers" if ($model =~ /SPARC CP/);
1270 if ($model eq "S3GX") {
1271 $bannermore="(SPARCbook 3GX)";
1272 $modelmore="(SPARCbook 3GX)";
1273 }
1274 if ($model eq "S3XP") {
1275 $bannermore="(SPARCbook 3XP)";
1276 $modelmore="(SPARCbook 3XP)";
1277 }
1278 $manufacturer="Sun Microsystems, Inc." if ($banner !~ /Axil/ && (
1279 $model =~ /^SPARCstation/ || $model =~ /^SPARCsystem/ ||
1280 $model =~ /^SPARCclassic/ || $model =~ /^SPARCserver/ ||
1281 $model =~ /^SPARCcenter/ || $model =~ /Enterprise/ ||
1282 $model =~ /Premier 24/ || $model =~ /Netra/ ||
1283 $model =~ /Sun.Fire/ || $model =~ /Sun.Blade/ ||
1284 $model =~ /Serverblade1/));
1285 if ($model =~ /Auspex/) {
1286 $manufacturer="Auspex";
1287 $model=~s/Auspex //g;
1288 $bannermore="Netserver";
1289 $modelmore="Netserver";
1290 }
1291 $manufacturer="Fujitsu" if ($banner =~ /Fujitsu/);
1292 $manufacturer="Fujitsu Siemens" if ($banner =~ /Fujitsu Siemens/);
1293 $manufacturer="Fujitsu Siemens Computers" if ($banner =~ /Fujitsu Siemens Computers/);
1294 if ($model =~ /S-4/ || $model eq "GP" || $model =~ /^GPU[SZU]/) {
1295 $manufacturer="Fujitsu" if ($manufacturer !~ /^Fujitsu/);
1296 $model=~s,_,/,g;
1297 $untested=1 if ($model =~ /^GPUSC-L/);
1298 $untested=1 if ($model =~ /^GPUU/);
1299 }
1300 if ($model =~ /PowerLite-/) {
1301 $bannermore=$model;
1302 $bannermore=~s/PowerLite-//g;
1303 }
1304 $model_checked=1;
1305}
1306
1307sub check_banner {
1308 print &runtime . "in check_banner, banner=$banner, ultra=$ultra\n" if ($DEBUG);
1309 $ultra="ultra" if ($ultra eq 0 && ($banner =~ /Ultra/ || $banner =~ /Blade/ || $banner =~ /Fire/));
1310 $ultra="sparc64" if ($banner =~ /SPARC64/);
1311 $ultra=5 if ($banner =~ /Ultra 5\b/);
1312 $ultra="5_10" if ($banner =~ /Ultra 5\/10\b/);
1313 $ultra=10 if ($banner =~ /Ultra 10\b/);
1314 $ultra="220R" if ($banner =~ /Enterprise 220R\b/);
1315 $ultra=80 if ($banner =~ /Ultra 80\b/);
1316 # E410 is prototype name of E420R, but may still be in the
1317 # banner as "Sun Ultra 80/Enterprise 410 UPA/PCI"
1318 $ultra="420R" if ($banner =~ /Enterprise 410\b/);
1319 $ultra="420R" if ($banner =~ /Enterprise 420R\b/);
1320 $ultra="Netra t140x" if ($banner =~ /Netra t 1400\/1405\b/);
1321 $ultra="CP1400" if ($banner =~ /Ultra CP 1400\b/);
1322 $ultra="CP1500" if ($banner =~ /Ultra CP 1500\b/);
1323 $ultra="CP2000" if ($banner =~ /\bCP2000\b/);
1324 $ultra="CP2040" if ($banner =~ /\bCP2000 model 40\b/);
1325 $ultra="CP2060" if ($banner =~ /\bCP2000 model 60\b/);
1326 $ultra="CP2080" if ($banner =~ /\bCP2000 model 80\b/);
1327 $ultra="CP2140" if ($banner =~ /\bCP2000 model 140\b/);
1328 $ultra="CP2160" if ($banner =~ /\bCP2000 model 160\b/);
1329 $ultra="Sun Blade 1000" if ($banner =~ /Sun Excalibur\b/); # prototype
1330 $ultra="Sun Blade 2000" if ($banner =~ /Sun Blade 2000\b/);
1331 $ultra="Netra ct400" if ($banner =~ /Netra ct400\b/);
1332 $ultra="Netra ct410" if ($banner =~ /Netra ct410\b/);
1333 $ultra="Netra ct800" if ($banner =~ /Netra ct800\b/);
1334 $ultra="Netra ct810" if ($banner =~ /Netra ct810\b/);
1335 $ultra="Sun Blade 150" if ($banner =~ /Sun Blade 150\b/);
1336 # Sun Fire 12K, E25K, etc. systems identifies itself as Sun Fire 15K
1337 $ultra="Sun Fire 12K" if ($banner =~ /Sun Fire 12000\b/ || $banner =~ /Sun Fire 12K\b/);
1338 if ($banner =~ /Ultra 4FT\b/) {
1339 $ultra="Netra ft1800";
1340 $bannermore="(Netra ft1800)";
1341 $modelmore="(Netra ft1800)";
1342 }
1343 # UltraSPARC-IIIi (Jalapeno) systems
1344 $ultra="Sun Ultra 45 Workstation" if ($banner =~ /Sun Ultra 45 Workstation\b/);
1345 $ultra="Sun Ultra 25 Workstation" if ($banner =~ /Sun Ultra 25 Workstation\b/);
1346 # UltraSPARC-IV (Jaguar) or UltraSPARC-IV+ (Panther) systems
1347 $ultra="Sun Fire E2900" if ($banner =~ /Sun Fire E2900\b/);
1348 $ultra="Sun Fire E4900" if ($banner =~ /Sun Fire E4900\b/);
1349 $ultra="Sun Fire E6900" if ($banner =~ /Sun Fire E6900\b/);
1350 $ultra="Sun Fire E20K" if ($banner =~ /Sun Fire E20K\b/);
1351 $ultra="Sun Fire E25K" if ($banner =~ /Sun Fire E25K\b/);
1352 # SPARC64-VI or SPARC64-VII systems
1353 $ultra=$banner if ($banner =~ /SPARC Enterprise M[34589]000 Server/);
1354 # Clones
1355 if ($banner =~ /\bMP-250[(\b]/) {
1356 $ultra="axus250";
1357 $bannermore="Ultra-250";
1358 $modelmore="(Ultra-250)";
1359 }
1360 $manufacturer="AXUS" if ($ultra =~ /\baxus\b/);
1361 $manufacturer="Rave" if ($banner =~ /Axil/);
1362 $manufacturer="Tadpole/Cycle" if ($banner =~ /Cycle/ || $banner =~ /\bUP-20\b/ || $banner =~ /\b520IIi\b/);
1363 $manufacturer="Tadpole" if ($banner =~ /Tadpole/ || $banner =~ /\bRDI\b/ || $banner =~ /\bVoyagerIIi\b/ || $banner =~ /\bSPARCLE\b/);
1364 $manufacturer="Tatung" if ($banner =~ /COMPstation/);
1365 $manufacturer="Twinhead" if ($banner =~ /TWINstation/);
1366 $manufacturer="Fujitsu" if ($banner =~ /Fujitsu/);
1367 $manufacturer="Fujitsu Siemens" if ($banner =~ /Fujitsu Siemens/);
1368 $manufacturer="Fujitsu Siemens Computers" if ($banner =~ /Fujitsu Siemens Computers/);
1369}
1370
1371sub check_for_prtdiag {
1372 return if ("$prtdiag_exec" eq "" && $filename eq "");
1373 return if ($have_prtdiag_data);
1374 &find_helpers;
1375 # Check for LDOMs
1376 if ($ldm_cmd ne "" && $have_ldm_data == 0) {
1377 # Warn that ldm and prtdiag may take a while to run
1378 &please_wait;
1379 @ldm=&run("$ldm_cmd list-devices -a -p");
1380 $have_ldm_data=1;
1381 foreach $line (@ldm) {
1382 $line=&dos2unix($line);
1383 $line=&mychomp($line);
1384 &check_LDOM;
1385 }
1386 }
1387 @prtdiag=&run("$prtdiag_exec") if ($filename eq "");
1388 $have_prtdiag_data=1;
1389 foreach $line (@prtdiag) {
1390 $line=&dos2unix($line);
1391 # Some Solaris prtdiag outputs have malformed header, so
1392 # handle them also.
1393 if ($line =~ /^System Configuration: +/ || $line =~ /.BIOS Configuration: / || $line =~ /Sun Microsystems *Sun Fire X/i || $line =~ /Sun Microsystems *Sun Blade X/i || $line =~ /Sun Microsystems .*Memory size: / || ($line =~ /Sun Microsystems *Sun Ultra / && $machine eq i86pc)) {
1394 $line=&mychomp($line);
1395 $tmp=$line;
1396 $line=~s/System Configuration: +//g;
1397 $line=~s/BIOS Configuration: .*//g;
1398 if ($line =~ /^Sun Microsystems/i) {
1399 $manufacturer="Sun Microsystems, Inc.";
1400 } elsif ($line =~ /Inc\./) {
1401 $manufacturer=$line;
1402 $manufacturer=~s/^(.* Inc\.).*/$1/;
1403 if ($tmp !~ /BIOS Configuration: / && $model eq "" && $machine eq "i86pc") {
1404 $diagbanner=$line;
1405 $diagbanner=~s/^.* Inc\. *(.*)/$1/;
1406 }
1407 } elsif ($line =~ /Corporation/) {
1408 $manufacturer=$line;
1409 $manufacturer=~s/^(.* Corporation).*/$1/;
1410 if ($tmp !~ /BIOS Configuration: / && $model eq "" && $machine eq "i86pc") {
1411 $diagbanner=$line;
1412 $diagbanner=~s/^.* Corporation *(.*)/$1/;
1413 }
1414 } else {
1415 $manufacturer=$line;
1416 $manufacturer=~s/^(\w+)[ \/].*/$1/;
1417 }
1418 if ($line =~ /^Sun Microsystems +sun\w+ +/) {
1419 $diagbanner=$line;
1420 $diagbanner=~s/Sun Microsystems +sun\w+ +//g;
1421 $diagbanner=~s/Memory size: .*$//g;
1422 } elsif ($line =~ /^Sun Microsystems *Sun +/i) {
1423 $diagbanner=$line;
1424 $diagbanner=~s/Sun Microsystems *Sun/Sun/ig;
1425 $diagbanner=~s/Memory size: .*$//g;
1426 $diagbanner=~s/ BLADE / Blade /g;
1427 $diagbanner=~s/ FIRE / Fire /g;
1428 $diagbanner=~s/ SERVER / Server /g;
1429 } elsif ($line =~ /^Sun Microsystems, Inc. *Sun +/i) {
1430 $diagbanner=$line;
1431 $diagbanner=~s/Sun Microsystems, Inc. *Sun/Sun/ig;
1432 $diagbanner=~s/Memory size: .*$//g;
1433 $diagbanner=~s/ BLADE / Blade /g;
1434 $diagbanner=~s/ FIRE / Fire /g;
1435 $diagbanner=~s/ SERVER / Server /g;
1436 } elsif ($line =~ /^Sun Microsystems.*Ultra/) {
1437 $diagbanner=$line;
1438 $diagbanner=~s/Sun Microsystems.*Ultra/Ultra/g;
1439 $diagbanner=~s/Memory size: .*$//g;
1440 }
1441 }
1442 $prtdiag_failed=1 if ($line =~ /Prtdiag Failed/i);
1443 # prtdiag only works on the global zone (container), so find out
1444 # if we are in a Solaris zone. solaris8 brand container shows
1445 # kernel version of "Generic_Virtual"
1446 $prtdiag_failed=2 if ($line =~ /prtdiag can only be run in the global /i || $kernver eq "Generic_Virtual");
1447 }
1448 if ($psrinfo_cmd ne "" && $have_psrinfo_data == 0) {
1449 @psrinfo=&run("$psrinfo_cmd -v");
1450 $tmp=&mychomp(`$psrinfo_cmd -p 2>/dev/null`); # physical CPUs
1451 if ($tmp ne "") {
1452 push(@psrinfo, "#psrinfo -p\n$tmp\n");
1453 $tmp=&mychomp(`$psrinfo_cmd -p -v 2>/dev/null`);
1454 push(@psrinfo, "#psrinfo -p -v\n$tmp\n");
1455 }
1456 $have_psrinfo_data=1;
1457 }
1458 if ($ipmitool_cmd ne "" && $have_ipmitool_data == 0) {
1459 @ipmitool=&run("$ipmitool_cmd fru");
1460 $have_ipmitool_data=1;
1461 }
1462 if ($smbios_cmd ne "" && $have_smbios_data == 0) {
1463 @smbios=&run("$smbios_cmd");
1464 $have_smbios_data=1;
1465 }
1466 if (($filename eq "") && ($verbose == 3)) {
1467 # Only run the following commands if E-mailing maintainer since
1468 # this data is used by memconf only for some systems
1469 if ($prtfru_cmd ne "" && $have_prtfru_data == 0) {
1470 @prtfru=&run("$prtfru_cmd -x");
1471 $have_prtfru_data=1;
1472 }
1473 if ($prtpicl_cmd ne "" && $have_prtpicl_data == 0) {
1474 @prtpicl=&run("$prtpicl_cmd -v");
1475 $have_prtpicl_data=1;
1476 }
1477 if ($cfgadm_cmd ne "" && $have_cfgadm_data == 0) {
1478 @cfgadm=&run("$cfgadm_cmd -al");
1479 $have_cfgadm_data=1;
1480 }
1481 if ($ldm_cmd ne "" && $have_ldm_data == 0) {
1482 @ldm=&run("$ldm_cmd list-devices -a -p");
1483 $have_ldm_data=1;
1484 }
1485 }
1486}
1487
1488sub check_prtdiag {
1489 return if ($prtdiag_checked);
1490 print &runtime . "in check_prtdiag\n" if ($DEBUG);
1491 $prtdiag_checked=1;
1492 return if ("$prtdiag_exec" eq "" && $filename eq "");
1493 &check_for_prtdiag;
1494 foreach $line (@prtdiag) {
1495 $line=&dos2unix($line);
1496 if ($line =~ /====/) {
1497 $flag_cpu=0; # End of CPU section
1498 $flag_mem=0; # End of memory section
1499 }
1500 if ($line =~ /Memory Units: Group Size/) {
1501 # Start of CPU and memory section on SS1000/SC2000
1502 $flag_cpu=1;
1503 $flag_mem=1;
1504 }
1505 $line="Memory $line" if ($line =~ /^Segment Table:/);
1506 if (($flag_mem >= 1) && ($line !~ /^\s*\n$/)) {
1507 $boardfound_mem=1;
1508 $boardfound_mem=0 if ($line =~ /Cannot find/);
1509 @linearr=split(' ', $line);
1510 if ($linearr[0] =~ /^0x/ && $ultra =~ /Sun Blade 1[05]0\b/ && ($linearr[$#linearr] eq "chassis/system-board" || $linearr[$#linearr] eq "-")) {
1511 # Sometimes socket is unlabeled on prtdiag
1512 # output on Sun Blade 100/150
1513 $socket=$socketstr[0] if ($linearr[0] =~ /^0x0/);
1514 if ($simmrangex eq "00000400") {
1515 $socket=$socketstr[1] if ($linearr[0] =~ /^0x4/);
1516 $socket=$socketstr[2] if ($linearr[0] =~ /^0x8/);
1517 $socket=$socketstr[3] if ($linearr[0] =~ /^0xc/);
1518 } else {
1519 $socket=$socketstr[1] if ($linearr[0] =~ /^0x2/);
1520 $socket=$socketstr[2] if ($linearr[0] =~ /^0x4/);
1521 $socket=$socketstr[3] if ($linearr[0] =~ /^0x6/);
1522 }
1523 if ($linearr[$#linearr] eq "-") {
1524 $line=~s/-$/$socket/g;
1525 $linearr[$#linearr]=$socket;
1526 } else {
1527 $line=~s/-board/-board\/$socket/g;
1528 $linearr[$#linearr]="chassis/system-board/$socket";
1529 }
1530 }
1531 push(@boards_mem, "$line");
1532 $flag_rewrite_prtdiag_mem=1 if ($line =~ /^MB\/CMP[0-3]\/BR[0-3]\/CH[01]\/D[01]/);
1533 if ($#linearr >= 2) {
1534 if ($linearr[2] =~ /\bU\d\d\d\d\b/) {
1535 # Sun Ultra-250 format
1536 $sockets_used .= " $linearr[2]";
1537 } elsif ($linearr[2] =~ /\b\d\d\d\d\b/) {
1538 # Sun Ultra-4 format
1539 $sockets_used .= " U$linearr[2]";
1540 }
1541 }
1542 if ($#linearr >= 3) {
1543 if ($linearr[3] ne "BankIDs" && $linearr[3] ne "GroupID" && $line !~ /^0x\d[\d ]+\d.+ +\d +-$/) {
1544 if ($linearr[1] =~ /\b\d+MB\b/) {
1545 # Sun Blade 100/1000 format
1546 $simmsize=$linearr[1];
1547 $simmsize=~s/MB//g;
1548 push(@simmsizesfound, "$simmsize");
1549 } elsif ($linearr[1] =~ /\b\d+GB\b/) {
1550 # Sun Blade 1000 format
1551 $simmsize=$linearr[1];
1552 $simmsize=~s/GB//g;
1553 $simmsize *= 1024;
1554 push(@simmsizesfound, "$simmsize");
1555 }
1556 }
1557 if ($model eq "Ultra-250" || $ultra eq 250 || $model eq "Ultra-4" || $ultra eq 450 || $model eq "Ultra-4FT" || $ultra eq "Netra ft1800") {
1558 if ($linearr[3] =~ /\b\d+\b/) {
1559 $simmsize=$linearr[3];
1560 push(@simmsizesfound, "$simmsize");
1561 }
1562 }
1563 }
1564 if ($linearr[$#linearr] =~ /\bDIMM\d/ || $linearr[$#linearr] =~ /\b[UJ]\d\d\d\d[\b,]/ || ($linearr[$#linearr - 1] eq "Label" && $linearr[$#linearr] eq "-")) {
1565 $sockets_used .= " $linearr[$#linearr]";
1566 # May be multiple sockets separated by ","
1567 $sockets_used=~s/,/ /g;
1568 } elsif ($#linearr >= 2) {
1569 if ($linearr[2] =~ /MB\/P[01]\/B[01]\/D[01]/ || $linearr[2] =~ /C[0-3]\/P[01]\/B[01]\/D[01]/) {
1570 $sockets_used .= " $linearr[2]";
1571 # May be multiple sockets separated by ","
1572 $sockets_used=~s/,/ /g;
1573 }
1574 }
1575 if ($linearr[0] !~ /^0x/ && ($linearr[$#linearr] eq "-" || $linearr[$#linearr] =~ /^-,/)) {
1576 # unlabeled sockets
1577 $sockets_used .= " $linearr[$#linearr]";
1578 # May be multiple sockets separated by ","
1579 $sockets_used=~s/,/ /g;
1580 }
1581 if ($linearr[$#linearr] =~ /\/J\d\d\d\d$/) {
1582 $linearr[$#linearr]=~s/.+\///g;
1583 $sockets_used .= " $linearr[$#linearr]";
1584 }
1585 if ($ultra eq "Sun Fire 280R") {
1586 if ($line =~ / CA +0 +[0-3] .+4-way/) {
1587 $sockets_used="J0100 J0202 J0304 J0406 J0101 J0203 J0305 J0407";
1588 } elsif ($line =~ / CA +0 +[02] /) {
1589 $sockets_used .= " J0100 J0202 J0304 J0406" if ($sockets_used !~ / J0100 /);
1590 } elsif ($line =~ / CA +[01] +[13] /) {
1591 $sockets_used .= " J0101 J0203 J0305 J0407" if ($sockets_used !~ / J0101 /);
1592 }
1593 }
1594 # Memory on Sun Fire systems
1595 if ($line =~ /^\/N\d\/SB\d\/P\d\/B\d\b/) {
1596 $boardslot_mem=substr($line,0,13);
1597 push(@boardslot_mems, "$boardslot_mem");
1598 $boardslot_mems .= $boardslot_mem . " ";
1599 } elsif ($line =~ /^\/N\d\/SB\d\d\/P\d\/B\d\b/) {
1600 $boardslot_mem=substr($line,0,14);
1601 push(@boardslot_mems, "$boardslot_mem");
1602 $boardslot_mems .= $boardslot_mem . " ";
1603 } elsif ($line =~ /^\/SB\d\d\/P\d\/B\d\b/) {
1604 $boardslot_mem=substr($line,0,11);
1605 push(@boardslot_mems, "$boardslot_mem");
1606 $boardslot_mems .= $boardslot_mem . " ";
1607 } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b,/) {
1608 $boardslot_mem=substr($line,24,51);
1609 push(@boardslot_mems, "$boardslot_mem");
1610 $boardslot_mems .= $boardslot_mem . " ";
1611 } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b/) {
1612 $boardslot_mem=substr($line,24,12);
1613 push(@boardslot_mems, "$boardslot_mem");
1614 $boardslot_mems .= $boardslot_mem . " ";
1615 }
1616 if (($ultra =~ /Sun Fire/) && ($#linearr >= 5)) {
1617 if ($linearr[5] =~ /\d+MB/) {
1618 $simmsize=$linearr[5];
1619 $simmsize=~s/MB//g;
1620 push(@simmsizesfound, "$simmsize");
1621 }
1622 }
1623 if ($ultra =~ /Sun Fire V[48][89]0\b/) {
1624 # Fire V480, V490, V880, V890
1625 $bankname="groups";
1626 if ($banks_used ne "A0 A1 B0 B1") {
1627 $banks_used="A0 B0" if ($line =~ /^ ?[ABCD] .+ 4-way /);
1628 $banks_used="A0 A1 B0 B1" if ($line =~ /^ ?[ABCD] .+ 8-way /);
1629 }
1630 }
1631 if ($linearr[$#linearr] =~ /MB\/CMP0\/CH[0-3]\/R[01]\/D[01]/) {
1632 # UltraSPARC-T1 systems
1633 if ($#linearr >= 5) {
1634 if ($linearr[5] eq "MB") {
1635 $simmsize=$linearr[4];
1636 $simmsize=~s/MB//g;
1637 $simmsize /= 2;
1638 push(@simmsizesfound, "$simmsize");
1639 } elsif ($linearr[5] eq "GB") {
1640 $simmsize=$linearr[4];
1641 $simmsize=~s/GB//g;
1642 $simmsize *= 512;
1643 push(@simmsizesfound, "$simmsize");
1644 }
1645 }
1646 $sockets_used .= " $linearr[$#linearr]";
1647 }
1648 if ($linearr[$#linearr] =~ /MB\/CMP[0-3]\/BR[0-3]\/CH[01]\/D[01]/ || $linearr[$#linearr] =~ /MB\/CMP[01]\/MR[01]\/BR[01]\/CH[01]\/D[23]/) {
1649 # UltraSPARC-T2 systems: T5120, T5220, T6320
1650 # UltraSPARC-T2+ systems: T5140, T5240
1651 $sockets_used .= " $linearr[$#linearr]";
1652 }
1653 if ($linearr[$#linearr] =~ /MB\/CPU[01]\/CMP[01]\/BR[01]\/CH[01]\/D[01]/ || $linearr[$#linearr] =~ /MB\/MEM[01]\/CMP[01]\/BR[01]\/CH[01]\/D[01]/) {
1654 $sockets_used .= " $linearr[$#linearr]";
1655 }
1656 }
1657 if ($line =~ /CPU Units:/) {
1658 $flag_cpu=1; # Start of CPU section
1659 $flag_mem=0; # End of memory section
1660 $format_cpu=1;
1661 }
1662 if ($line =~ /==== CPU/ || $line =~ /==== Processor Sockets / || $line =~ /==== Virtual CPU/) {
1663 $flag_cpu=1; # Start of CPU section
1664 $flag_mem=0; # End of memory section
1665 $format_cpu=2;
1666 }
1667 if ($line =~ /Memory Units:/ || $line =~ /==== Memory / || $line =~ /==== Physical Memory / || $line =~ /Used Memory:/) {
1668 $flag_cpu=0; # End of CPU section
1669 $flag_mem=1; # Start of memory section
1670 }
1671 if ($line =~ /CPU Units:/ && $line =~ /Memory Units:/) {
1672 $flag_cpu=1; # Start of CPU section
1673 $flag_mem=1; # Start of memory section
1674 }
1675 if (($flag_cpu >= 1) && ($line !~ /^\s*\n$/)) {
1676 if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) {
1677 $newline=$line;
1678 $newline=~s/^ //g if ($line !~ /Run Ecache CPU CPU/);
1679 push(@boards_cpu, "$newline");
1680 } else {
1681 push(@boards_cpu, "$line");
1682 }
1683 $boardfound_cpu=1;
1684 &checkX86;
1685 if (($flag_cpu == 2) && $isX86) {
1686 # Solaris x86 CPU type found in prtdiag
1687 $cputype2=&mychomp($line);
1688 $cputype2=~s/\s\s+.*//;
1689 $cputype2=~s/(^.* Processor \d+) .*/$1/;
1690 $cputype2=~s/ CPU / /;
1691 $cputype2=~s/\s+/ /g;
1692 $cputype2=~s/^\s+//;
1693 $cputype2=~s/\s+$//;
1694 &x86multicorecnt($cputype2);
1695 # rewrite %cpucnt $cputype2
1696 $cfreq=0;
1697 while (($cf,$cnt)=each(%cpucnt)) {
1698 $cf=~/^(.*) (\d+)$/;
1699 if (! defined($2)) {
1700 delete $cpucnt{"$cf"};
1701 } else {
1702 $cfreq=$2;
1703 delete $cpucnt{"$1 $2"};
1704 }
1705 }
1706 $ndcpu++;
1707 if ($cpucntfrom ne "psrinfo") {
1708 $cpucntfrom="prtdiag";
1709 $cpucntflag=1;
1710 $ncpu++ if ($filename);
1711 }
1712 $cputype=$cputype2 if ($cputype2 ne "");
1713 $cputype=$cputype_prtconf if ($cputype eq "AMD" && $cputype_prtconf ne "");
1714 $cputype=$cputype_psrinfo if ($cputype_psrinfo ne "");
1715 $cpucnt{"$cputype $cfreq"}=$ncpu;
1716 }
1717 # CPUs on Sun Fire systems
1718 if ($line =~ /^\/N\d\/SB\d\/P\d\b/) {
1719 $boardslot_cpu=substr($line,0,10);
1720 push(@boardslot_cpus, "$boardslot_cpu");
1721 $boardslot_cpus .= $boardslot_cpu . " ";
1722 } elsif ($line =~ /^\/N\d\/SB\d\d\/P\d\b/) {
1723 $boardslot_cpu=substr($line,0,11);
1724 push(@boardslot_cpus, "$boardslot_cpu");
1725 $boardslot_cpus .= $boardslot_cpu . " ";
1726 } elsif ($line =~ /^\/SB\d\d\/P\d\b/) {
1727 $boardslot_cpu=substr($line,0,8);
1728 push(@boardslot_cpus, "$boardslot_cpu");
1729 $boardslot_cpus .= $boardslot_cpu . " ";
1730 &prtdiag_threadcount(1);
1731 } elsif ($line =~ /^ SB\d\/P\d\b/) {
1732 $boardslot_cpu=substr($line,4,6);
1733 push(@boardslot_cpus, "$boardslot_cpu");
1734 $boardslot_cpus .= $boardslot_cpu . " ";
1735 # prtdiag does not show cpuid or cputype
1736 } elsif ($line =~ / SB\d\/P\d$/) {
1737 $boardslot_cpu=substr($line,length($line)-7,6);
1738 push(@boardslot_cpus, "$boardslot_cpu");
1739 $boardslot_cpus .= $boardslot_cpu . " ";
1740 &prtdiag_threadcount(0);
1741 }
1742 }
1743 if ($flag_cpu && $line =~ /------/) {
1744 # Next lines are the CPUs on each system board
1745 $flag_cpu=2;
1746 }
1747 if ($flag_mem && $line =~ /------/) {
1748 # Next lines are the memory on each system board
1749 $flag_mem=2;
1750 }
1751 if ($filename && $use_psrinfo_data) {
1752 # May have "psrinfo -v" output in regression test file
1753 if ($line =~ /.+ operates at \d+ MHz/) {
1754 $cpufreq=&mychomp($line);
1755 $cpufreq=~s/.+ operates at //;
1756 $cpufreq=~s/ MHz.+//;
1757 $cpucntfrom="psrinfo" if ($cpucntfrom ne "ldm");
1758 $cpucntflag="0"; # reset flag
1759 $psrcpucnt++;
1760 # rewrite %cpucnt $cputype with frequency
1761 while (($cf,$cnt)=each(%cpucnt)) {
1762 $cf=~/^(.*) (\d+)$/;
1763 $tmp=$1;
1764 if (defined($tmp)) {
1765 delete $cpucnt{"$1 $2"} if ($2 == 0);
1766 }
1767 }
1768 if (defined($tmp)) {
1769 $cpucnt{"$tmp $cpufreq"}=$psrcpucnt;
1770 $ncpu=$psrcpucnt;
1771 }
1772 }
1773 # May have "psrinfo -p -v" output in regression test
1774 # file that has more detailed information about the
1775 # CPUs. Assumes all CPUs are same.
1776 $foundpsrinfocpu=1 if ($line =~ /.+ \d+ virtual processor/);
1777 if ($foundpsrinfocpu && (($line =~ /.+Hz$/ && $line !~ /Speed: / && $line !~ / PCI/) || $line =~ /\bAMD .* Processor /) && $line !~ / x86 /) {
1778 $cputype=&mychomp($line);
1779 $cputype=~s/ CPU / /;
1780 $cputype=~s/\s+/ /g;
1781 $cputype=~s/^\s+//;
1782 $cputype=~s/\s+$//;
1783 $cputype=~s/^Version:\s+//;
1784 # rewrite %cpucnt $cputype with cputype
1785 while (($cf,$cnt)=each(%cpucnt)) {
1786 $cf=~/^(.*) (\d+)$/;
1787 $cpufreq=$2;
1788 delete $cpucnt{"$1 $2"};
1789 }
1790 $cpucnt{"$cputype $cpufreq"}=$psrcpucnt;
1791 }
1792 }
1793 }
1794
1795 # Rewrite prtdiag output to include DIMM information on SB1X00, SB2X00,
1796 # Enchilada, Chalupa (Sun Fire V440), Netra T12, Seattle and Boston
1797 # systems
1798 @new_boards_mem="";
1799 $grpcnt=0;
1800 $intcnt=0;
1801 if ($ultra =~ /Sun Blade [12][05]00\b/ || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20" || $ultra eq "Sun Fire V250" || $ultra eq "Netra T12") {
1802 foreach $line (@boards_mem) {
1803 $line=&mychomp($line);
1804 $newline=$line;
1805 if (($line eq "-----------------------------------------------------------") && ($prtdiag_banktable_has_dimms == 0)) {
1806 $newline=$line . "------";
1807 } elsif ($line eq "--------------------------------------------------") {
1808 $newline=$line . "-----------";
1809 } elsif (($line =~ /ControllerID GroupID Size/) && ($prtdiag_banktable_has_dimms == 0)) {
1810 $newline="ID ControllerID GroupID Size DIMMs Interleave Way";
1811 } elsif ($line =~ /ControllerID GroupID Labels Status/) {
1812 $newline=$line . " DIMMs";
1813 } elsif ($line =~ /ControllerID GroupID Labels/) {
1814 $newline=$line . " DIMMs";
1815 } elsif ($line =~ /ControllerID GroupID Size Labels/) {
1816 $newline=$line . " DIMMs";
1817 } elsif ($line =~ /^\d[\d ] \d[\d ] \d /) {
1818 &read_prtdiag_bank_table;
1819 } elsif ($line =~ /^0x\d[\d ]+\d.+ +\d +-$/ || $line =~ / GroupID \d[\d ]$/) {
1820 &read_prtdiag_memory_segment_table;
1821 } elsif ($line =~ /J0100,/) {
1822 $sz=$grpsize{0,0};
1823 if (defined($sz)) {
1824 $sz=~s/ //g;
1825 $newline=$line . " 4x$sz";
1826 }
1827 } elsif ($line =~ /J0101,/) {
1828 $sz=$grpsize{0,1};
1829 if (defined($sz)) {
1830 $sz=~s/ //g;
1831 $newline=$line . " 4x$sz";
1832 }
1833 } elsif ($line =~ /\/J0[1-4]0[0246]\b/) {
1834 $sz=$grpsize{0,0};
1835 if (defined($sz)) {
1836 $sz=~s/ //g;
1837 $newline=$line . " $sz";
1838 }
1839 } elsif ($line =~ /\/J0[1-4]0[1357]\b/) {
1840 $sz=$grpsize{0,1};
1841 if (defined($sz)) {
1842 $sz=~s/ //g;
1843 $newline=$line . " $sz";
1844 }
1845 } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d,/) {
1846 $tmp=substr($line,0,2);
1847 $tmp=~s/ //g;
1848 $sz=$grpsize{$tmp,substr($line,15,1)};
1849 $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
1850 if (defined($sz)) {
1851 $sz=~s/ //g;
1852 $newline=$line . " 4x$sz";
1853 }
1854 } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b/) {
1855 $tmp=substr($line,0,2);
1856 $tmp=~s/ //g;
1857 $sz=$grpsize{$tmp,substr($line,15,1)};
1858 $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
1859 if (defined($sz)) {
1860 $sz=~s/ //g;
1861 $newline=$line . " $sz";
1862 }
1863 } elsif ($line =~ / MB\/DIMM\d,/) {
1864 $sz=$grpsize{0,substr($line,15,1)};
1865 $newline=$line . " 2x$sz" if (defined($sz));
1866 } elsif ($line =~ /DIMM\d,DIMM\d/) {
1867 @linearr=split(' ', $line);
1868 if ($linearr[2] =~ /\d+[MG]B/) {
1869 $sz=$linearr[2];
1870 if ($sz =~ /\dGB/) {
1871 $sz=~s/GB//g;
1872 $sz *= 512;
1873 } else {
1874 $sz=~s/MB//g;
1875 $sz /= 2;
1876 }
1877 $sz=&show_memory_label($sz);
1878 }
1879 $newline=$line . " 2x$sz" if (defined($sz));
1880 if ($line =~ /DIMM[13],DIMM[24]/ && $ultra eq "Sun Blade 1500") {
1881 # prototype has sockets DIMM1-DIMM4
1882 @socketstr=("DIMM1".."DIMM4");
1883 }
1884 if ($line =~ /DIMM[1357],DIMM[2468]/ && $ultra eq "Sun Blade 2500") {
1885 # prototype has sockets DIMM1-DIMM8
1886 if ($line =~ /DIMM[13],DIMM[24]/) {
1887 @socketstr=("DIMM1".."DIMM4");
1888 } elsif ($line =~ /DIMM[57],DIMM[68]/) {
1889 push(@socketstr, "DIMM5".."DIMM8");
1890 }
1891 }
1892 }
1893 push(@new_boards_mem, "$newline\n") if ($newline ne "");
1894 }
1895 @boards_mem=@new_boards_mem;
1896 } elsif ($ultra eq "Enchilada" || $ultra eq "Sun Fire V440" || $ultra eq "Netra 440" || $ultra =~ /Sun Ultra [24]5 .*Workstation/ || $ultra eq "Sun Fire V125" || $ultra eq "Seattle" || $ultra eq "Boston" || $banner =~ /Sun Fire E[24]900\b/ || $diagbanner =~ /Sun Fire E[24]900/) {
1897 foreach $line (@boards_mem) {
1898 $line=&mychomp($line);
1899 $newline=$line;
1900 if (($line eq "-----------------------------------------------------------") && ($prtdiag_banktable_has_dimms == 0)) {
1901 $newline=$line . "------";
1902 } elsif ($line eq "--------------------------------------------------") {
1903 $newline=$line . "-----------";
1904 } elsif (($line =~ /ControllerID GroupID Size/) && ($prtdiag_banktable_has_dimms == 0)) {
1905 $newline="ID ControllerID GroupID Size DIMMs Interleave Way";
1906 } elsif ($line =~ /ControllerID GroupID Labels Status/) {
1907 $newline=$line . " DIMMs";
1908 } elsif ($line =~ /ControllerID GroupID Labels/) {
1909 $newline=$line . " DIMMs";
1910 } elsif ($line =~ /^\d[\d ] \d[\d ] \d /) {
1911 &read_prtdiag_bank_table;
1912 } elsif ($line =~ /^0x\d[\d ]+\d.+ +\d +-$/ || $line =~ / GroupID \d[\d ]$/) {
1913 &read_prtdiag_memory_segment_table;
1914 } elsif ($line =~ / MB\/P[01]\/B[01]\/D[01],/ || $line =~ /C[0-3]\/P[01]\/B[01]\/D[01],/) {
1915 $sz=$grpsize{substr($line,0,1),substr($line,15,1)};
1916 $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
1917 if (defined($sz)) {
1918 $newline=$line . " 2x$sz";
1919 } else {
1920 $newline=$line . " Failing";
1921 $failing_memory=1;
1922 }
1923 } elsif ($line =~ / MB\/P[01]\/B[01]\/D[01]\b/ || $line =~ /C[0-3]\/P[01]\/B[01]\/D[01]\b/) {
1924 $sz=$grpsize{substr($line,0,1),substr($line,15,1)};
1925 $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
1926 if (defined($sz)) {
1927 $sz=~s/ //g;
1928 $sz=&show_memory_label($sz);
1929 }
1930 $space=" ";
1931 $space="" if ($line =~ / okay/);
1932 if ($line =~ / failed/) {
1933 if (defined($sz)) {
1934 $failed_memory += $sz;
1935 } else {
1936 $failing_memory=1;
1937 }
1938 }
1939 if (defined($sz)) {
1940 # If interleave factor is 16, then print 4x$sz
1941 if (defined($grpinterleave{substr($line,28,1),0})) {
1942 if (($grpinterleave{substr($line,28,1),0} eq "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15") && ($prtdiag_banktable_has_dimms == 0)) {
1943 $newline=$line . "$space 4x$sz";
1944 } else {
1945 $newline=$line . "$space $sz";
1946 }
1947 } else {
1948 $newline=$line . "$space $sz";
1949 }
1950 }
1951 } elsif ($line =~ / MB\/DIMM[0-7]\b/) {
1952 $sz=$grpsize{substr($line,0,1),substr($line,15,1)};
1953 $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
1954 $newline=$line . " $sz" if (defined($sz));
1955 } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d,/) {
1956 $tmp=substr($line,0,2);
1957 $tmp=~s/ //g;
1958 $sz=$grpsize{$tmp,substr($line,15,1)};
1959 $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
1960 if (defined($sz)) {
1961 $sz=~s/ //g;
1962 $newline=$line . " 4x$sz";
1963 }
1964 } elsif ($line =~ /\bSB\d\/P\d\/B\d\/D\d\b/) {
1965 $tmp=substr($line,0,2);
1966 $tmp=~s/ //g;
1967 $sz=$grpsize{$tmp,substr($line,15,1)};
1968 $sz=$grpsize{0,substr($line,15,1)} if (! defined($sz));
1969 if (defined($sz)) {
1970 $sz=~s/ //g;
1971 $newline=$line . " $sz";
1972 }
1973 }
1974 push(@new_boards_mem, "$newline\n") if ($newline ne "");
1975 }
1976 @boards_mem=@new_boards_mem;
1977 }
1978 # Rewrite prtdiag output to exclude redundant labels
1979 @new_boards_mem="";
1980 $flag_group=0;
1981 foreach $line (@boards_mem) {
1982 $line=&mychomp($line);
1983 $newline=$line;
1984 $flag_group++ if ($line =~ /Memory Module Groups:/);
1985 if ($flag_group ge 2) {
1986 $newline="" if ($line =~ /Memory Module Groups:/ || $line =~ "--------------------------------------------------" || $line =~ /ControllerID GroupID/);
1987 }
1988 push(@new_boards_mem, "$newline\n") if ($newline ne "");
1989 }
1990 if (($ultra eq "T5120" || $ultra eq "T5220" || $ultra eq "T6320" || $ultra eq "T5140" || $ultra eq "T5240" || $ultra eq "T5440") && $sockets_used ne "") {
1991 if ($prtpicl_cmd ne "" && $have_prtpicl_data == 0) {
1992 # Warn that prtpicl may take a while to run
1993 &please_wait;
1994 @prtpicl=&run("$prtpicl_cmd -v");
1995 $have_prtpicl_data=1;
1996 }
1997 &check_prtpicl if ($have_prtpicl_data);
1998 if ($picl_foundmemory) {
1999 @new_boards_mem="";
2000 $bank_cnt=scalar(keys %picl_mem_bank);
2001 if (scalar(keys %picl_mem_dimm) == 1 || $bank_cnt > 1) {
2002 $pn_cnt=scalar(keys %picl_mem_pn);
2003 while (($socket,$simmsize)=each(%picl_mem_bank)) {
2004 if ($pn_cnt == $bank_cnt * 2 || $interleave == 8) {
2005 # CH1 was not listed
2006 $simmsize /= 2;
2007 $picl_mem_dimm{"$socket"}=$simmsize;
2008 $socket=~s/CH0/CH1/g;
2009 $picl_mem_dimm{"$socket"}=$simmsize;
2010 $sockets_used .= " $socket" if ($sockets_used !~ /$socket/);
2011 } else {
2012 $picl_mem_dimm{"$socket"}=$simmsize;
2013 }
2014 }
2015 }
2016 while (($socket,$simmsize)=each(%picl_mem_dimm)) {
2017 $pn=$picl_mem_pn{"$socket"};
2018 $sz=&show_memory_label($simmsize);
2019 $newline="socket $socket has a ";
2020 $newline .= $pn . " " if (defined($pn));
2021 $newline .= $sz . " " if (defined($sz));
2022 $newline .= "$memtype";
2023 push(@new_boards_mem, "$newline\n");
2024 push(@simmsizesfound, $simmsize) if (defined($sz));
2025 }
2026 @new_boards_mem=sort @new_boards_mem;
2027 } elsif ($flag_rewrite_prtdiag_mem) {
2028 # Hack: Rewrite prtdiag output better than original
2029 if ($sockets_used =~ /MB\/CMP[01]\/BR[0-3]\/CH[01]\/D1/) {
2030 # All 16 DIMMs are installed
2031 @new_boards_mem="";
2032 if ($sockets_used !~ /MB\/CMP[01]\/BR[0-3]\/CH1\/D[01]/) {
2033 foreach $line (@boards_mem) {
2034 $line=&mychomp($line);
2035 $newline=$line;
2036 if ($line =~ /MB\/CMP[01]\/BR[0-3]\/CH0\/D[01]/) {
2037 $line=~s/\s+$//;
2038 $tmp=$line;
2039 $tmp=~s/^.*(MB\/CMP.*)/$1/;
2040 $tmp=~s/CH0/CH1/g;
2041 $space="";
2042 $space=" " if ($line =~ /^MB\/CMP/);
2043 $newline="$space$line,$tmp";
2044 }
2045 push(@new_boards_mem, "$newline\n") if ($newline ne "");
2046 }
2047 }
2048 $sockets_used="";
2049 for ($cnt=0; $cnt <= $#socketstr; $cnt++) {
2050 $sockets_used .= " $socketstr[$cnt]";
2051 }
2052 $simmsize=$installed_memory / 16;
2053 } else {
2054 # 8-DIMMs or 4-DIMMs are installed.
2055 # Hack: assume 4-DIMM configuration since
2056 # 8-DIMM has prtpicl output.
2057 @new_boards_mem="";
2058 foreach $line (@boards_mem) {
2059 $line=&mychomp($line);
2060 $newline=$line;
2061 if ($line =~ /MB\/CMP[01]\/BR[0-3]\/CH0\/D[01]/) {
2062 $line=~s/\s+$//;
2063 $space="";
2064 $space=" " if ($line =~ /^MB\/CMP/);
2065 $newline="$space$line";
2066 }
2067 push(@new_boards_mem, "$newline\n") if ($newline ne "");
2068 }
2069 $simmsize=$installed_memory / 4;
2070 }
2071 # Round up DIMM value
2072 $simmsize=int(($simmsize + 128) / 1024) * 1024;
2073 push(@simmsizesfound, $simmsize);
2074 } else {
2075 $tmp=0;
2076 foreach $socket (sort split(' ', $sockets_used)) {
2077 $tmp++;
2078 }
2079 if ($tmp) {
2080 $simmsize=$installed_memory / $tmp;
2081 # Round up DIMM value
2082 $simmsize=int(($simmsize + 128) / 1024) * 1024;
2083 push(@simmsizesfound, $simmsize);
2084 }
2085 }
2086 }
2087
2088 @boards_mem=@new_boards_mem;
2089}
2090
2091sub prtdiag_threadcount {
2092 $arg=shift;
2093 $diagthreadcnt++;
2094 $tmp=$line;
2095 $tmp=~s/,\s+/,/;
2096 @linearr=split(' ', $tmp);
2097 if ($line =~ /\bUS-/) {
2098 $cputype=$linearr[4];
2099 $cputype=~s/US-/UltraSPARC-/;
2100 $cputype=~s/UltraSPARC-IV/dual-core UltraSPARC-IV/;
2101 $cpufreq=$linearr[2];
2102 }
2103 $diagcpucnt{"$cputype $cpufreq"}++;
2104 if ($linearr[$arg] =~ /,/) {
2105 $tmp=$linearr[$arg];
2106 @linearr=split(',', $tmp);
2107 $diagthreadcnt += $#linearr;
2108 }
2109 $cpucntfrom="prtdiag";
2110}
2111
2112sub check_prtpicl {
2113 print &runtime . "in check_prtpicl\n" if ($DEBUG);
2114 $flag_mem_seg=0;
2115 $flag_mem_bank=0;
2116 $flag_mem_chan=0;
2117 $flag_mem_mod=0;
2118 $cpumembrd="";
2119 foreach $line (@prtpicl) {
2120 $line=&dos2unix($line);
2121 $line=&mychomp($line);
2122 $line=~s/\s+$//;
2123 if ($line =~ /^\s+:Label\s+CPU[01]/ || $line =~ /^\s+:Label\s+MEM[01]/) {
2124 $cpumembrd=$line;
2125 $cpumembrd=~s/^.*:Label\s+(.*)$/$1/;
2126 $cpumembrd .= "/";
2127 }
2128 if ($line =~ /^\s+:Label\s+CMP[0-3]/) {
2129 $cmp=$line;
2130 $cmp=~s/^.*:Label\s+(.*)$/$1/;
2131 }
2132 if ($line =~ /\s+:name\s/) {
2133 $flag_mem_seg=0;
2134 if ($flag_mem_mod) {
2135 $socket="MB/$cpumembrd$cmp/$mem_branch/$mem_channel/$mem_dimm";
2136 $flag_mem_mod=0; # End of memory module section
2137 $sockets_used .= " $socket" if ($sockets_used !~ /$socket/);
2138 $picl_mem_pn{"$socket"}="$mem_mfg $mem_model";
2139 if ($sockets_used =~ /\/CH1\//) {
2140 $picl_mem_dimm{"$socket"}=$bank_size / 2;
2141 } else {
2142 $picl_mem_dimm{"$socket"}=$bank_size;
2143 }
2144 }
2145 if ($flag_mem_bank && ! $flag_mem_mod) {
2146 if ($bank_nac) {
2147 $socket="$bank_nac" if ($bank_nac ne "");
2148 }
2149 $flag_mem_bank=0; # End of memory bank section
2150 $sockets_used .= " $socket" if ($sockets_used !~ /$socket/);
2151 $picl_mem_bank{"$socket"}=$bank_size;
2152 }
2153 }
2154 if ($line =~ /^\s+memory-segment\s/) {
2155 $flag_mem_seg=1; # Start of memory segment section
2156 }
2157 if ($flag_mem_seg) {
2158 if ($line =~ /^\s+:InterleaveFactor\s/) {
2159 $interleave=$line;
2160 $interleave=~s/^.*:InterleaveFactor\s+(.*)$/$1/;
2161 $interleave=hex($interleave) if ($interleave =~ /^0x\d/);
2162 }
2163 if ($line =~ /^\s+:Size\s/) {
2164 $segment_size=$line;
2165 $segment_size=~s/^.*:Size\s+(.*)$/$1/;
2166 if ($segment_size =~ /^0x\d/) {
2167 $segment_size=~s/^(.*)00000$/$1/;
2168 $segment_size=hex($segment_size);
2169 } else {
2170 $segment_size /= $meg;
2171 }
2172 }
2173 }
2174 if ($line =~ /^\s+memory-bank\s/) {
2175 $flag_mem_bank=1; # Start of memory bank section
2176 }
2177 if ($flag_mem_bank) {
2178 if ($line =~ /^\s+:Label\s/) {
2179 $bank_label=$line;
2180 $bank_label=~s/^.*:Label\s+(.*)$/$1/;
2181 }
2182 if ($line =~ /^\s+:nac\s/) {
2183 $bank_nac=$line;
2184 $bank_nac=~s/^.*:nac\s+(.*)$/$1/;
2185 }
2186 if ($line =~ /^\s+:Size\s/) {
2187 $bank_size=$line;
2188 $bank_size=~s/^.*:Size\s+(.*)$/$1/;
2189 if ($bank_size =~ /^0x\d/) {
2190 $bank_size=~s/^(.*)00000$/$1/;
2191 $bank_size=hex($bank_size);
2192 } else {
2193 $bank_size=$segment_size / $meg;
2194 }
2195 }
2196 }
2197 if ($line =~ /^\s+memory-module\s/ && $flag_mem_bank) {
2198 $flag_mem_mod=1; # Start of memory module section
2199 }
2200 if ($flag_mem_mod) {
2201 if ($line =~ /^\s+:nac\s/) {
2202 $mem_dimm=$line;
2203 $mem_dimm=~s/^.*:nac\s+(.*)$/$1/;
2204 }
2205 }
2206 if ($line =~ /^\s+BR\d\s/) {
2207 $flag_mem_chan=0;
2208 $mem_branch=$line;
2209 $mem_branch=~s/^.*(BR\d).*/$1/;
2210 }
2211 if ($line =~ /^\s+CH\d\s/) {
2212 $flag_mem_chan=1; # Start of memory channel section
2213 $mem_channel=$line;
2214 $mem_channel=~s/^.*(CH\d).*/$1/;
2215 }
2216 if ($flag_mem_chan && $line =~ /^\s+D\d\s/) {
2217 $flag_mem_mod=1; # Start of memory module section
2218 $picl_foundmemory=1;
2219 $mem_dimm=$line;
2220 $mem_dimm=~s/^.*(D\d).*/$1/;
2221 }
2222 if ($flag_mem_mod) {
2223 if ($line =~ /\s+:ModelName\s/) {
2224 $mem_model=$line;
2225 $mem_model=~s/^.*:ModelName\s+(.*)$/$1/;
2226 }
2227 if ($line =~ /\s+:MfgName\s/) {
2228 $mem_mfg=$line;
2229 $mem_mfg=~s/^.*:MfgName\s+(.*)$/$1/;
2230 }
2231 }
2232 }
2233}
2234
2235sub multicore_cpu_cnt {
2236 $arg=shift;
2237# return if ($isX86);
2238 &check_psrinfo;
2239 print &runtime . "in multicore_cpu_cnt, cputype=$cputype\n" if ($DEBUG);
2240 if ($cputype =~ /UltraSPARC-T1\b/) {
2241 $cputype="UltraSPARC-T1";
2242 # Count 4-thread (4, 6, or 8 core) Niagara CPUs as 1 CPU
2243 if ($npcpu && ! $have_ldm_data) {
2244 $ncpu=$npcpu;
2245 } else {
2246 # Assume each CPU has 8 cores max (32 threads)
2247 $ncpu=int(($threadcnt - 1) / 32) + 1;
2248 }
2249 if (defined($arg)) {
2250 $cnt=$ncpu;
2251 return;
2252 }
2253 $cputype=$threadcnt / 4 / $ncpu . "-core quad-thread $cputype";
2254 $cpucnt{"$cputype $cpufreq"}=$ncpu;
2255 } elsif ($cputype =~ /UltraSPARC-T2\+/) {
2256 $cputype="UltraSPARC-T2+";
2257 # Count 8-thread (4, 6, or 8 core) Victoria Falls CPUs as 1 CPU
2258 if ($npcpu && ! $have_ldm_data) {
2259 $ncpu=$npcpu;
2260 } else {
2261 # Assume there are no single-cpu systems with the US-T2+
2262 $ncpu=2;
2263 # Valid configurations:
2264 # T5140,T5240: 2 x 4-core (64 threads), 2 x 6-core
2265 # (96 threads), 2 x 8-core (128 threads)
2266 # T5440: 4 x 4-core (128 threads), 4 x 8-core
2267 # (256 threads)
2268 if ($ultra eq "T5140" || $ultra eq "T5240") {
2269 $ncpu=2;
2270 } elsif ($ultra eq "T5440") {
2271 $ncpu=4;
2272 }
2273 }
2274 if (defined($arg)) {
2275 $cnt=$ncpu;
2276 return;
2277 }
2278 $cputype=$threadcnt / 8 / $ncpu . "-core 8-thread $cputype";
2279 $cpucnt{"$cputype $cpufreq"}=$ncpu;
2280 } elsif ($cputype =~ /UltraSPARC-T2\b/) {
2281 $cputype="UltraSPARC-T2";
2282 # Count 8-thread (4 or 8 core) Niagara-II CPUs as 1 CPU
2283 if ($npcpu && ! $have_ldm_data) {
2284 $ncpu=$npcpu;
2285 } else {
2286 # Assume each CPU has 8 cores max (64 threads)
2287 $ncpu=int(($threadcnt - 1) / 64) + 1;
2288 }
2289 if (defined($arg)) {
2290 $cnt=$ncpu;
2291 return;
2292 }
2293 $cputype=$threadcnt / 8 / $ncpu . "-core 8-thread $cputype";
2294 $cpucnt{"$cputype $cpufreq"}=$ncpu;
2295 } elsif ($cputype =~ /SPARC64-VI\b/) {
2296 # Count dual-core dual-thread Olympus-C SPARC64-VI CPUs as 1 CPU
2297 $ncpu=$threadcnt / 4;
2298 $cputype="dual-core dual-thread SPARC64-VI";
2299 if (defined($arg)) {
2300 $cnt=$ncpu;
2301 return;
2302 }
2303 $cpucnt{"$cputype $cpufreq"}=$ncpu;
2304 } elsif ($cputype =~ /SPARC64-VII\b/) {
2305 # Count quad-core dual-thread Jupiter SPARC64-VII CPUs as 1 CPU
2306 $ncpu=$threadcnt / 8;
2307 $cputype="quad-core dual-thread SPARC64-VII";
2308 if (defined($arg)) {
2309 $cnt=$ncpu;
2310 return;
2311 }
2312 $cpucnt{"$cputype $cpufreq"}=$ncpu;
2313 } elsif ($cputype =~ /SPARC64-VII\+\b/) {
2314 # Count quad-core dual-thread Jupiter+ SPARC64-VII+ CPUs as 1 CPU
2315 $ncpu=$threadcnt / 8;
2316 $cputype="quad-core dual-thread SPARC64-VII+";
2317 if (defined($arg)) {
2318 $cnt=$ncpu;
2319 return;
2320 }
2321 $cpucnt{"$cputype $cpufreq"}=$ncpu;
2322 } elsif ($cputype =~ /SPARC64-VIII\b/) {
2323 # Guess on the Venus SPARC64-VIII name ???
2324 # Count 8-core dual-thread Venus SPARC64-VIII CPUs as 1 CPU
2325 $ncpu=$threadcnt / 16;
2326 $cputype="8-core dual-thread SPARC64-VIII";
2327 if (defined($arg)) {
2328 $cnt=$ncpu;
2329 return;
2330 }
2331 $cpucnt{"$cputype $cpufreq"}=$ncpu;
2332 }
2333}
2334
2335sub x86multicorecnt {
2336 $_=shift;
2337 return if (! defined($_));
2338 $corecnt=2 if (/\bDual.Core/i || /\bTwo.Core/i);
2339 $corecnt=3 if (/\bTriple.Core/i || /\bThree.Core/i);
2340 $corecnt=4 if (/\bQuad.Core/i || /\bFour.Core/i);
2341 $corecnt=6 if (/\bHex.Core/i || /\bSix.Core/i);
2342 $corecnt=8 if (/\bOctal.Core/i || /\bEight.Core/i);
2343 $corecnt=12 if (/\bTwelve.Core/i);
2344}
2345
2346sub checkX86 {
2347 $isX86=1 if ($model eq "i86pc" || $machine eq "i86pc" || $model eq "i86xpv" || $machine eq "i86xpv");
2348 # Use CPU count from prtdiag (ndcpu) and thread count from psrinfo to
2349 # get core count per cpu for i86xpv
2350 $use_psrinfo_data=2 if ($model eq "i86xpv" || $machine eq "i86xpv");
2351}
2352
2353sub check_psrinfo {
2354 return if ($psrinfo_checked);
2355 print &runtime . "in check_psrinfo, ndcpu=$ndcpu, npcpu=$npcpu, nvcpu=$nvcpu\n" if ($DEBUG);
2356 $psrinfo_checked=1;
2357 return if ($nvcpu);
2358 return if (! $use_psrinfo_data);
2359 if ($filename) {
2360 $npcpu=0;
2361 foreach $line (@psrinfo) {
2362 $line=&dos2unix($line);
2363 # May have "psrinfo -p -v" output in regression test
2364 # file that has number of virtual CPUs. Assumes all
2365 # CPUs are same.
2366 if ($line =~ /.+ \d+ virtual processor/) {
2367 $nvcpu=&mychomp($line);
2368 $nvcpu=~s/.+ processor has //;
2369 $nvcpu=~s/ virtual processor.+//;
2370 $corecnt=$nvcpu if ($nvcpu >= 2);
2371 $corecnt /= 2 if ($hyperthread);
2372 if ($use_psrinfo_data == 2 && $ndcpu > 1) {
2373 $corecnt /= $ndcpu;
2374 $npcpu=$ndcpu;
2375 } else {
2376 $npcpu++;
2377 }
2378 $cpucntfrom="psrinfo" if ($cpucntfrom ne "ldm");
2379 $cpucntflag="0"; # reset flag
2380 }
2381 }
2382 } elsif ($psrinfo_cmd ne "") {
2383 $ncpu=&mychomp(`$psrinfo_cmd | wc -l`); # physical & virtual CPUs
2384 $ncpu=~s/\s+//;
2385 $npcpu=&mychomp(`$psrinfo_cmd -p 2>/dev/null`); # physical CPUs
2386 if ($npcpu eq "") {
2387 $npcpu=$ncpu;
2388 $nvcpu=1;
2389 } else {
2390 # Find number of virtual CPUs
2391 @tmp=`$psrinfo_cmd -p -v`;
2392 foreach $line (@tmp) {
2393 $line=&dos2unix($line);
2394 if ($line =~ /.+ \d+ virtual processor/) {
2395 $nvcpu=&mychomp($line);
2396 $nvcpu=~s/.+ processor has //;
2397 $nvcpu=~s/ virtual processor.+//;
2398 $corecnt=$nvcpu if ($nvcpu >= 2);
2399 $corecnt /= 2 if ($hyperthread);
2400 if ($use_psrinfo_data == 2 && $ndcpu > 1) {
2401 $corecnt /= $ndcpu;
2402 $npcpu=$ndcpu;
2403 }
2404 }
2405 }
2406 if ($cputype eq "x86") {
2407 if ($tmp[2] =~ /.+Hz/ || $tmp[2] =~ /\bAMD .* Processor /) {
2408 $cputype=&mychomp($tmp[2]);
2409 $cputype=~s/ CPU / /;
2410 $cputype=~s/\s+/ /g;
2411 $cputype=~s/^\s+//;
2412 $cputype=~s/\s+$//;
2413 $cputype_psrinfo=$cputype;
2414 }
2415 }
2416 }
2417 @tmp=`$psrinfo_cmd -v`;
2418 if ($tmp[2] =~ /MHz/) {
2419 $cpufreq=&mychomp($tmp[2]);
2420 $cpufreq=~s/.+ operates at //;
2421 $cpufreq=~s/ MHz.+//;
2422 }
2423 $cpucntfrom="psrinfo" if ($cpucntfrom ne "ldm");
2424 $have_psrinfo_data=1;
2425 }
2426}
2427
2428sub get_mfg {
2429 $_=shift;
2430 return "" if (! defined($_));
2431 s/Manufacturer: *//ig;
2432 if (/JEDEC ID:/) {
2433 s/JEDEC ID://g;
2434 s/ //g;
2435 }
2436 s/^\s*//;
2437 s/^0x//;
2438 return "" if (/^$/ || /^\r$/ || /^FFFFFFFFFFFF/i || /Manufacturer\d/i);
2439 # Based on JEDEC JEP106-X
2440 return "AMD" if (/^01/ || /^8001/);
2441 return "AMI" if (/^02/ || /^8002/);
2442 return "Fujitsu" if (/^04/ || /^8004/ || /Fujitsu/i);
2443 return "Elpida" if (/^0500/ || /Elpida/i); # Hack
2444 return "Hitachi" if (/^07/ || /^8007/ || /Hitachi/i);
2445 return "Inmos" if (/^08/ || /^8008/ || /Inmos/i);
2446 return "Intersil" if (/^0B/i || /^800B/i || /Intersil/i);
2447 return "Mostek" if (/^0D/i || /^800D/i || /Mostek/i);
2448 return "Freescale (Motorola)" if (/^0E/i || /^800E/i || /Freescale/i || /Motorola/i);
2449 return "NEC" if (/^10/ || /^8010/);
2450 return "Conexant (Rockwell)" if (/^13/ || /^8013/ || /Conexant/i || /Rockwell/i);
2451 return "NXP (Philips Semi, Signetics)" if (/^15/ || /^8015/ || /Philips Semi/i || /Signetics/i);
2452 return "Synertek" if (/^16/ || /^8016/ || /Synertek/i);
2453 return "Xicor" if (/^19/ || /^8019/ || /Xicor/i);
2454 return "Zilog" if (/^1A/i || /^801A/i || /Zilog/i);
2455 return "Mitsubishi" if (/^1C/i || /^801C/i || /Mitsubishi/i);
2456 return "Micron Technology" if (/^2C/i || /^802C/i || /Micron Technology/i);
2457 return "ProMOS/Mosel Vitelic" if (/^40/ || /^8040/ || /ProMOS/i || /Mosel Vitelic/i);
2458 return "Goldenram" if (/^6A/i || /^806A/i || /Goldenram/i);
2459 return "Nanya Technology" if (/^7F7F7F0B/i || /^830B/i || /Nanya/i); # Hack
2460 return "Fairchild" if (/^83/ || /^8083/ || /Fairchild/i);
2461 return "Numonyx (Intel)" if (/^89/ || /^8089/ || /Numonyx/i || /Intel/i);
2462 return "DATARAM" if (/^91/ || /^8091/);
2463 return "Toshiba" if (/^98/ || /^8098/ || /Toshiba/i);
2464 return "IBM" if (/^A4/i || /^80A4/);
2465 return "Hynix Semiconductor (Hyundai Electronics)" if (/^AD/i || /^80AD/i || /Hynix/i || /Hyundai/i);
2466 return "Infineon (Siemens)" if (/^C1/i || /^80C1/ || /^7F7F7F7F7F51/i || /Infineon/i || /Siemens/i);
2467 return "Samsung" if (/^CE/i || /^80CE/i || /Samsung/i);
2468 return "Winbond Electronics" if (/^DE/i || /^80DE/i || /Winbond/i);
2469 return "LG Semiconductor (Goldstar)" if (/^E0/i || /^80E0/i || /LG Semi/i || /Goldstar/i);
2470 return "Micron CMS" if (/^7F45/i || /Micron CMS/i);
2471 return "Kingston" if (/^7F98/i || /Kingston/i);
2472 return "Ramaxel Technology" if (/^7F7F7F7F43/i || /Ramaxel/i); # Hack
2473 return &mychomp($_);
2474}
2475
2476# See if CPUs and memory modules are listed in "ipmitool fru" output
2477sub check_ipmitool {
2478 print &runtime . "in check_ipmitool\n" if ($DEBUG);
2479 return if ("$ipmitool_cmd" eq "" && $filename eq "");
2480 $cputype2="";
2481 $mem_mfg="";
2482 $mem_model="";
2483 foreach $line (@ipmitool) {
2484 $line=&dos2unix($line);
2485 $line=&mychomp($line);
2486 if ($line =~ /^ *$/) {
2487 # store cpu and memory modules in hash
2488 if ($flag_cpu) {
2489 if ($cputype2 ne "") {
2490 $cputype2=~s/DUAL.CORE/Dual Core/;
2491 $cputype2=~s/QUAD.CORE/Quad Core/;
2492 $cputype2=~s/-Core/ Core/;
2493 $cputype2=~s/OPTERON\(TM\) PROCESSOR/Opteron\(tm\) Processor/;
2494 $ipmi_cputype="$cputype2";
2495 $ipmi_cpu_cnt++;
2496 }
2497 }
2498 if ($flag_mem && $socket ne "") {
2499 $ipmi_mem{"$socket"}=("$mem_mfg$mem_model" ne "") ? "$mem_mfg $mem_model" : "";
2500 }
2501 $flag_cpu=0; # End of CPU section
2502 $flag_mem=0; # End of memory section
2503 $cputype2="";
2504 $mem_mfg="";
2505 $mem_model="";
2506 }
2507 if ($line =~ / cpu\d+\.vpd / || $line =~ / p\d+\.fru /) {
2508 $flag_cpu=1; # Start of CPU section
2509 $socket=$line;
2510 $socket=~s/^.*: +(.*\S)\.[vf][pr][du].*$/$1/;
2511 }
2512 if ($flag_cpu && ($line =~ / Product Name /)) {
2513 $cputype2=$line;
2514 $cputype2=~s/^.*: +(.*\S) *$/$1/;
2515 &x86multicorecnt($cputype2);
2516 }
2517 if ($line =~ / cpu\d+\.mem\d+\.vpd / || $line =~ / p\d+\.d\d+\.fru /) {
2518 $flag_mem=1; # Start of memory module section
2519 $socket=$line;
2520 $socket=~s/^.*: +(.*\S)\.[vf][pr][du].*$/$1/;
2521 }
2522 if ($flag_mem && ($line =~ / Product Manufacturer /)) {
2523 $mem_mfg=$line;
2524 $mem_mfg=~s/^.*: +(.*\S) *$/$1/;
2525 $mem_mfg=&get_mfg($mem_mfg);
2526 }
2527 if ($flag_mem && ($line =~ / Product Name /)) {
2528 $mem_model=$line;
2529 $mem_model=~s/^.*: +(.*\S) *$/$1/;
2530 $mem_model=~s/ ADDRESS\/COMMAND//;
2531 $mem_model=~s/PARITY/Parity/;
2532 }
2533 }
2534 # Is ipmitool CPU count better?
2535# print &runtime . "ipmi_cpu_cnt=$ipmi_cpu_cnt\n" if ($DEBUG);
2536 if ($ncpu != $ipmi_cpu_cnt && $npcpu == 0 && $ipmi_cpu_cnt != 0) {
2537 $ncpu=$ipmi_cpu_cnt;
2538 $npcpu=$ipmi_cpu_cnt;
2539 $cpucntfrom="ipmitool";
2540 $cpucnt{"$cputype $cpufreq"}=$ipmi_cpu_cnt;
2541 }
2542 # Did ipmitool find a better cputype?
2543 if (&lc($cputype) ne &lc($ipmi_cputype) && $ipmi_cputype ne "") {
2544 # rewrite %cpucnt $cputype with cputype
2545 while (($cf,$cnt)=each(%cpucnt)) {
2546 $cf=~/^(.*) (\d+)$/;
2547 $cpufreq=$2;
2548 delete $cpucnt{"$1 $2"};
2549 }
2550 $cpucnt{"$ipmi_cputype $cpufreq"}=$ipmi_cpu_cnt;
2551 }
2552}
2553
2554# Check for logical domains
2555sub check_for_LDOM {
2556 print &runtime . "in check_for_LDOM\n" if ($DEBUG);
2557 # Handle control domain on UltraSPARC-T1 and UltraSPARC-T2 systems
2558 if ($ldm_cmd ne "" && $have_ldm_data == 0) {
2559 @ldm=&run("$ldm_cmd list-devices -a -p");
2560 $have_ldm_data=1;
2561 }
2562 if ($have_ldm_data) {
2563 $threadcnt=0;
2564 foreach $line (@ldm) {
2565 $line=&dos2unix($line);
2566 $line=&mychomp($line);
2567 &check_LDOM;
2568 # Count virtual CPUs
2569 $threadcnt++ if ($line =~ /^\|pid=\d/);
2570 if ($line =~ /^\|pa=\d.*\|size=\d/) {
2571 # Add up total memory found in ldm output
2572 $sz=$line;
2573 $sz=~s/^.*size=(\d*).*/$1/;
2574 $ldm_memory += $sz;
2575 }
2576 }
2577 if ($threadcnt > 0) {
2578 # VCPUs found in ldm output
2579 delete $cpucnt{"$cputype $cpufreq"};
2580 print &runtime . "ldm: ncpu=$ncpu, npcpu=$npcpu\n" if ($DEBUG);
2581 $cpucntfrom="ldm";
2582 &multicore_cpu_cnt;
2583 }
2584 $installed_memory=$ldm_memory / $meg if ($ldm_memory > 0);
2585 }
2586 # Handle guest domains on UltraSPARC-T1 and UltraSPARC-T2 systems
2587 if ($cfgadm_cmd ne "" && $have_cfgadm_data == 0) {
2588 @cfgadm=&run("$cfgadm_cmd -al");
2589 $have_cfgadm_data=1;
2590 }
2591 if ($have_cfgadm_data) {
2592 foreach $line (@cfgadm) {
2593 $line=&dos2unix($line);
2594 if ($line =~ /Configuration administration not supported/) {
2595 # Hack: Assume cfgadm fails on guest domains.
2596 &found_guest_LDOM;
2597 exit 1;
2598 }
2599 }
2600 }
2601}
2602
2603sub check_LDOM {
2604 if ($line =~ /Authorization failed/i || $line =~ /Connection refused/i) {
2605 if ($uid eq "0") {
2606 # No LDOMs configured
2607 $ldm_cmd="";
2608 $have_ldm_data=0;
2609 } else {
2610 &found_guest_LDOM("");
2611 print "ERROR: ldm: $line\n";
2612 print " This user does not have permission to run '/opt/SUNWldm/bin/ldm'.\n";
2613 print " Run memconf as a privileged user like root on the control domain.\n";
2614 exit 1;
2615 }
2616 }
2617}
2618
2619sub found_guest_LDOM {
2620 # Rewrite cputype and cpucnt hash since I don't
2621 # know how many cores the guest domain host has
2622 if ($cputype =~ /UltraSPARC-T1\b/) {
2623 delete $cpucnt{"$cputype $cpufreq"};
2624 $cputype="UltraSPARC-T1";
2625 $cpucnt{"$cputype $cpufreq"}=1;
2626 } elsif ($cputype =~ /UltraSPARC-T2\+/) {
2627 delete $cpucnt{"$cputype $cpufreq"};
2628 $cputype="UltraSPARC-T2+";
2629 $cpucnt{"$cputype $cpufreq"}=1;
2630 } elsif ($cputype =~ /UltraSPARC-T2\b/) {
2631 delete $cpucnt{"$cputype $cpufreq"};
2632 $cputype="UltraSPARC-T2";
2633 $cpucnt{"$cputype $cpufreq"}=1;
2634 }
2635 &show_header;
2636 $arg=shift;
2637 return if (defined($arg));
2638 print "ERROR: Guest Logical Domain (LDOM) detected.\n";
2639 print " Run memconf on the control domain. It will not work on guest domains.\n";
2640}
2641
2642sub check_smbios {
2643 print &runtime . "in check_smbios\n" if ($DEBUG);
2644 $flag_smb_memdevice=0;
2645 foreach $line (@smbios) {
2646 $line=&dos2unix($line);
2647 $line=&mychomp($line);
2648 if ($line =~ /SMB_TYPE_MEMDEVICE/) {
2649 $mem_mfg="";
2650 $socket="";
2651 $pn="";
2652 $simmsize=0;
2653 $memtype="";
2654 $formfactor="";
2655 $flag_smb_memdevice=1;
2656 }
2657 if ($flag_smb_memdevice) {
2658 if ($line =~ /Manufacturer:/) {
2659 $mem_mfg=$line;
2660 $mem_mfg=~s/^ *Manufacturer: *//g;
2661 $mem_mfg=&get_mfg($mem_mfg);
2662 $mem_mfg .= " " if ($mem_mfg ne "");
2663 }
2664 if ($line =~ /Location Tag:/) {
2665 $socket=$line;
2666 $socket=~s/^ *Location Tag: *//g;
2667 }
2668 if ($line =~ /Part Number:/) {
2669 $pn=$line;
2670 $pn=~s/^ *Part Number: *//g;
2671 $pn=~s/\s*$//g;
2672 $pn="" if ($pn =~ /^0xFF/ || $pn =~ /PartNum\d/i);
2673 $pn .= " " if ($pn ne "");
2674 }
2675 if ($line =~ /Size:/) {
2676 $simmsize=$line;
2677 $simmsize=~s/^ *Size: //g;
2678 $simmsize=~s/ bytes//g;
2679 $simmsize=0 if ($simmsize =~ /Not Populated/);
2680 $simmsize /= $meg;
2681 }
2682 if ($line =~ /Memory Type:/) {
2683 $memtype=$line;
2684 $memtype=~s/^ *Memory Type:.*\((.*)\).*/$1/g;
2685 $memtype="" if ($memtype =~ /Memory Type:/);
2686 $memtype .= " " if ($formfactor ne "");
2687 }
2688 if ($line =~ /Form Factor:/) {
2689 $formfactor=$line;
2690 $formfactor=~s/^ *Form Factor:.*\((.*)\).*/$1/g;
2691 $formfactor="" if ($formfactor =~ /Form Factor:/);
2692 }
2693 if ($line =~ /Bank Locator:/ || $line =~ /^ *ID *SIZE *TYPE/) {
2694 $bank_label=$line;
2695 $bank_label=~s/^ *Bank Locator: *//g;
2696 $bank_label="BANK $bank_label" if ($bank_label =~ /^.$/);
2697 $bank_label="" if ($bank_label eq $socket);
2698 $bank_label=", $bank_label" if ($bank_label ne "");
2699 $flag_smb_memdevice=0;
2700 if ($socket ne "") {
2701 $smbios_mem{"$socket"}=($simmsize) ? "$mem_mfg${simmsize}MB $pn$memtype$formfactor$bank_label" : "";
2702 $sockets_used="";
2703 }
2704 }
2705 }
2706 }
2707 $tmp=scalar(keys %smbios_mem);
2708 if (defined($tmp)) {
2709 if ($tmp > 0) {
2710 &show_header;
2711 for (sort keys %smbios_mem) {
2712 if ($smbios_mem{$_} eq "") {
2713 $sockets_empty .= "," if ($sockets_empty ne "");
2714 $sockets_empty .= " $_";
2715 } else {
2716 print "socket $_: $smbios_mem{$_}\n";
2717 }
2718 }
2719 $totmem=$installed_memory;
2720 &print_empty_memory("memory sockets");
2721 &finish;
2722 exit;
2723 }
2724 }
2725}
2726
2727sub found_empty_bank {
2728 $empty_banks .= "," if ($empty_banks ne "");
2729 $boardslot_mem=~s/[: ]//g;
2730 $empty_banks .= " Board $boardslot_mem @_";
2731}
2732
2733sub print_empty_memory {
2734 $s=shift;
2735 print "empty $s:";
2736 if ($sockets_empty ne "") {
2737 print "$sockets_empty\n";
2738 } else {
2739 print " None\n";
2740 }
2741}
2742
2743sub found_nvsimm_bank {
2744 $nvsimm_banks .= ", Board $boardslot_mem @_";
2745}
2746
2747sub recommend_prtdiag_patch {
2748 # Sun BugID 4664349
2749 print " This may be corrected by installing ";
2750 if ($osrel eq "5.9") {
2751 print "Sun patch 113221-03 or 118558-06 or later.\n";
2752 } elsif ($osrel eq "5.8") {
2753 print "Sun patch 109873-26 or 111792-11 or later.\n";
2754 } else {
2755 print "a Sun patch on this system.\n";
2756 }
2757}
2758
2759sub numerically {
2760 $a <=> $b;
2761}
2762
2763sub lc {
2764 $s=shift;
2765 return "" if (! defined($s));
2766 $s=~tr/[A-Z]/[a-z]/;
2767 return $s;
2768}
2769
2770sub dos2unix {
2771 # Convert "CR LF" or "CR" to "LF"
2772 $s=shift;
2773 $s=~s/\r\n/\n/g;
2774 $s=~s/\r/\n/g;
2775 return $s;
2776}
2777
2778sub convert_freq {
2779 ($freqx)=@_;
2780 if ($isX86) {
2781 $freq=int(hex("0x$freqx") / 10000 + 0.5);
2782 } else {
2783 if ($freqx =~ /'/) {
2784 $freqpack=$freqx;
2785 $freqpack=~s/'//g;
2786 @frequnpack=unpack("C*",$freqpack);
2787 $freqx="";
2788 foreach $field (@frequnpack) {
2789 $freqx.=sprintf("%02lx", $field);
2790 }
2791 if ($#frequnpack < 3) {
2792 $freqx.="00";
2793 }
2794 }
2795 $freq=int(hex("0x$freqx") / 1000000 + 0.5);
2796 }
2797 return $freq;
2798}
2799
2800sub mychomp {
2801 # Used instead of chop or chomp for compatibility with perl4 and perl5
2802 ($a)=@_;
2803 return "" if (! defined($a));
2804 $a=~s,$/$,,g;
2805 return $a;
2806}
2807
2808sub run {
2809 print &runtime . "Running @_\n" if ($DEBUG);
2810 `@_ 2>&1`;
2811}
2812
2813sub runtime {
2814 return "DEBUG time " . (time - $starttime) . ": ";
2815}
2816
2817sub read_prtdiag_bank_table {
2818 # prtdiag Bank Table
2819 $simmsize=substr($line,33,5);
2820 if ($simmsize =~ /\dGB/) {
2821 $simmsize=~s/GB//g;
2822 $simmsize *= 1024;
2823 } else {
2824 $simmsize=~s/MB//g;
2825 }
2826 if (($prtdiag_banktable_has_dimms == 0) || ($line =~ / 0$/)) {
2827 # Interleave Way = 0
2828 $simmsize /= 2;
2829 }
2830 if (($prtdiag_banktable_has_dimms == 1) && ($line =~ / 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15/)) {
2831 # Interleave Way = 16
2832 $simmsize *= 4;
2833 $intcnt=1;
2834 push(@simmsizesfound, "$simmsize");
2835 } elsif ($intcnt > 0) {
2836 # Interleave Way = 16
2837 $intcnt++;
2838 $simmsize *= 4;
2839 }
2840 $a=substr($line,9,2);
2841 $a=~s/ //g;
2842 $b=substr($line,23,1);
2843 $sz=&show_memory_label($simmsize);
2844 $grpsize{$a,$b}=$sz;
2845 $memlength=length($line);
2846 if ($memlength > 49) {
2847 $grpinterleave{$a,$b}=substr($line,49,40) if (substr($line,49,40) ne "");
2848 }
2849 if ($intcnt == 0) {
2850 push(@simmsizesfound, "$simmsize");
2851 $simmsize=&show_memory_label($simmsize) . " ";
2852 if ($prtdiag_banktable_has_dimms == 0) {
2853 $newline=substr($line,0,38) . " 2x" . substr($simmsize,0,5);
2854 $newline .= substr($line,42,20) if ($memlength > 38);
2855 }
2856 }
2857 $intcnt=1 if (($prtdiag_banktable_has_dimms == 1) && ($line =~ / 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15/));
2858 $intcnt=0 if ($intcnt == 16);
2859}
2860
2861sub read_prtdiag_memory_segment_table {
2862 # prtdiag Memory Segment Table
2863 $simmsize=($line =~ /\dGB/) ? substr($line,19,1) * 512 : substr($line,19,3) / 2;
2864 $grp=substr($line,-2,2);
2865 $grp=~s/ //g;
2866 if ($grp eq "-") {
2867 $grp=$grpcnt;
2868 $grpcnt++;
2869 }
2870 push(@simmsizesfound, "$simmsize");
2871 $simmsize=&show_memory_label($simmsize);
2872 $grpsize{0,$grp}=$simmsize;
2873}
2874
2875$motherboard="";
2876$realmodel="";
2877$manufacturer="";
2878$i=0;
2879# May not have had permission to run prtconf, so see if prtdiag works
2880&check_for_prtdiag;
2881if ($diagbanner) {
2882 $diagbanner=~s/\s+$//;
2883 if ($filename eq "" || $SUNWexplo) {
2884 $model=$platform;
2885 $model=~s/SUNW,//g;
2886 } else {
2887 $model=$diagbanner;
2888 $model=~s/ /-/g;
2889 # define $model for systems with $diagbanner != $model
2890 $model="Ultra-4" if ($diagbanner =~ /Sun.Enterprise.450\b/);
2891 $model="Sun-Blade-1000" if ($diagbanner =~ /Sun.Blade.1000\b/);
2892 $model="Sun-Fire-280R" if ($diagbanner =~ /Sun.Fire.280R\b/);
2893 $model="Netra t1" if ($diagbanner =~ /Netra.t1\b/);
2894 $model="Netra-T4" if ($diagbanner =~ /Netra.T4\b/);
2895 $model="Sun-Blade-100" if ($diagbanner =~ /Sun.Blade.1[05]0\b/);
2896 $model="Netra-T12" if ($diagbanner =~ /Sun.Fire.V1280\b/);
2897 $model="Serverblade1" if ($diagbanner =~ /Serverblade1\b/);
2898 $model="Ultra-Enterprise" if ($diagbanner =~ /Enterprise.E?[3-6][05]00\b/ || $diagbanner =~ /Enterprise.10000\b/);
2899 }
2900 # Check model and banner here in case we don't have prtconf data
2901 &check_model;
2902 &check_banner;
2903}
2904foreach $line (@config) {
2905 $line=&dos2unix($line);
2906 $line=&mychomp($line);
2907 $config_permission=1 if ($line =~ /Node /);
2908 if ($line =~ /Permission denied/i) {
2909 $permission_error="ERROR: $line" if ($diagbanner eq "" || ! $prtdiag_has_mem);
2910 }
2911 &hpux_cstm if ($line =~ /cstm.*selclass qualifier /); # for HP-UX regression test file
2912 if ($line =~ /banner-name:/ && $banner eq "") {
2913 $banner=$line;
2914 $banner=~s/\s+banner-name:\s+//;
2915 $banner=~s/'//g;
2916 $banner=~s/SUNW,//g;
2917 $banner=~s/TWS,//g;
2918 $banner=~s/CYCLE,//g;
2919 &check_banner;
2920 }
2921 if ($line =~ /model:.*AXUS/) {
2922 # AXUS clones with their name on OBP
2923 $manufacturer="AXUS";
2924 }
2925 if (($line =~ /SUNW,Ultra-/ || $line =~ /SUNW,SPARC/ || $line =~ /Sun.4/ ||
2926 $line =~ /SUNW,S240/ || $line =~ /SUNW,JavaEngine1/ ||
2927 $line =~ /SUNW,Ultra.*[Ee]ngine/ || $line =~ /SUNW,Ultra.*Netra*/ ||
2928 $line =~ /SUNW,Premier-24/ || $line =~ /SUNW,UltraAX-/ ||
2929 $line =~ /SUNW,Netra/ || $line =~ /\s+name:.*SUNW,Sun-/ ||
2930 $line =~ /SUNW,Grover/ || $line =~ /SUNW,Enchilada/ ||
2931 $line =~ /SUNW,Serverblade1/ || $line =~ /SUNW,Enterprise/ ||
2932 $line =~ /SUNW,A[0-9]/ || $line =~ /SUNW,T[0-9]/ ||
2933 $line =~ /\s+name:.*'i86pc'/ || $line =~ /^i86pc/ || $line =~ /^i86xpv/ ||
2934 $line =~ /model:\s+'SPARC CPU-/ || $line =~ /model:\s+'SPARC CPCI-/ ||
2935 $line =~ /SUNW,Axil-/ || $line =~ /\s+name:.*COMPstation/ ||
2936 $line =~ /\s+name:.*Tadpole/ || $line =~ /\s+name:.*Auspex/ ||
2937 $line =~ /\s+name:.*S-4/ || $line =~ /\s+name:.*FJSV,GP/ ||
2938 $line =~ /\s+name:.*CompuAdd/ || $line =~ /\s+name:.*RDI,/) &&
2939 $line !~ /\s+:Description\s+/ && $line !~ /\s+:*whoami:*\s+/ &&
2940 $line !~ /\s+:*impl-arch-name:*\s+/ && $line !~ /Sun 4x Quad/i) {
2941 $model=$line;
2942 $model=~s/\s+name:\s+//;
2943 $model=~s/\s+model:\s+//;
2944 $model=~s/\s+:binding-name\s+//;
2945 $model=~s/\s+:PlatformName\s+//;
2946 $model=~s/'//g;
2947 $model=~s/\s+$//;
2948 &check_model;
2949 if ($line =~ /CompuAdd/) {
2950 $manufacturer="CompuAdd";
2951 if ($model eq "SS-2") {
2952 $banner=$model if ($banner eq "");
2953 $bannermore="SPARCstation 2";
2954 $modelmore="SPARCstation 2";
2955 }
2956 }
2957 }
2958 $foundname=1 if ($line =~ /\s+name:\s+/);
2959 if (($line =~ /\s+model:\s+'.+,/) && ($foundname == 0)) {
2960 # Ultra 5/10 motherboard is 375-xxxx part number
2961 # SS10/SS20 motherboard is Sxx,501-xxxx part number
2962 if ($line =~ /,375-/ || $line =~ /,500-/ || $line =~ /,501-/) {
2963 $motherboard=$line;
2964 $motherboard=~s/\s+model:\s+//;
2965 $motherboard=~s/'//g;
2966 }
2967 }
2968 if ($line =~ /\sname:\s+'memory'/) {
2969 $j=$i - 2;
2970 if ($config[$j] =~ /\sreg:\s/) {
2971 $gotmemory=&mychomp($config[$j]);
2972 } elsif ($config[$j - 1] =~ /\sreg:\s/) {
2973 $gotmemory=&mychomp($config[$j - 1]);
2974 } elsif ($config[$j + 1] =~ /\sreg:\s/) {
2975 $gotmemory=&mychomp($config[$j + 1]);
2976 }
2977 }
2978 if ($line =~ /\sdevice_type:\s+'memory-bank'/) {
2979 $j=$i - 3;
2980 if ($config[$j] =~ /\sreg:\s/ && $config[$j] !~ /.00000000$/) {
2981 $config[$j]=~s/\s+reg:\s+//;
2982 $gotmemory=($gotmemory) ? "$gotmemory.$config[$j]" : $config[$j];
2983 $gotmemory=&mychomp($gotmemory);
2984 }
2985 }
2986 # The following is not used yet
2987 #if ($line =~ /\sdevice_type:\s+'memory-module'/) {
2988 # if ($config[$i - 2] =~ /\sreg:\s/) {
2989 # $config[$i - 3]=~s/\s+socket-name:\s+//;
2990 # if ($gotmodule) {
2991 # $gotmodule .= ".$config[$i - 3]";
2992 # } else {
2993 # $gotmodule=$config[$i - 3];
2994 # }
2995 # $gotmodule=&mychomp($gotmodule);
2996 # $config[$i - 2]=~s/\s+reg:\s+//;
2997 # @module=split(/\./, $config[$i - 2]);
2998 # $gotmodule .= ".$module[3]";
2999 # $gotmodule=&mychomp($gotmodule);
3000 # $config[$i + 1]=~s/\s+name:\s+//;
3001 # $config[$i + 1] =~ y/[a-z]/[A-Z]/;
3002 # $gotmodule .= ".$config[$i + 1]";
3003 # $gotmodule=&mychomp($gotmodule);
3004 # $gotmodule=~s/'//g;
3005 # }
3006 #}
3007 if ($line =~ /\ssimm-use:\s+/) {
3008 # DIMM usage on Fujitsu GP7000
3009 $gotmodule=&mychomp($config[$i]);
3010 $gotmodule=~s/\s+simm-use:\s+//;
3011 $slotname0="SLOT0" if ($banner =~ /GP7000\b/);
3012 }
3013 if ($line =~ /\scomponent-name:\s+'.*CPU.*'/) {
3014 # CPUs on Fujitsu GP7000F and PrimePower systems
3015 $slotname=$line;
3016 $slotname=~s/\s+component-name:\s+//;
3017 $slotname=~s/'//g;
3018 $gotcpunames=($gotcpunames) ? "$gotcpunames $slotname" : $slotname;
3019 $boardname=$slotname;
3020 $boardname=~s/-.*//g;
3021 if ($boardname ne $slotname) {
3022 if ($gotcpuboards) {
3023 $gotcpuboards .= " $boardname" if ($gotcpuboards !~ /\b$boardname\b/);
3024 } else {
3025 $gotcpuboards=$boardname;
3026 }
3027 }
3028 }
3029 if ($line =~ /\sdevice_type:\s+'memory-module'/) {
3030 # DIMM usage on Fujitsu GP7000F and PrimePower systems
3031 $slotname="";
3032 if ($config[$i - 3] =~ /\scomponent-name:\s/) {
3033 $slotname=$config[$i - 3];
3034 }
3035 if ($config[$i - 4] =~ /\scomponent-name:\s/) {
3036 $slotname=$config[$i - 4];
3037 }
3038 if ($slotname ne "") {
3039 $slotname=~s/\s+component-name:\s+//;
3040 $slotname=~s/'//g;
3041 $slotname=&mychomp($slotname);
3042 $gotmodulenames=($gotmodulenames) ? "$gotmodulenames.$slotname" : $slotname;
3043 $slotname0=$slotname if (! $slotname0);
3044 $config[$i - 1]=~s/\s+reg:\s+//;
3045 @module=split(/\./, $config[$i - 1]);
3046 $gotmodulenames .= ".$module[1]";
3047 $gotmodulenames=&mychomp($gotmodulenames);
3048 }
3049 }
3050 if ($line =~ /\sname:\s+'cgfourteen'/) {
3051 # Determine size of VSIMM
3052 # Currently assumes only one VSIMM is installed
3053 if ($config[$i - 2] =~ /\sreg:\s/) {
3054 $sx_line=&mychomp($config[$i - 2]);
3055 } elsif ($config[$i - 3] =~ /\sreg:\s/) {
3056 $sx_line=&mychomp($config[$i - 3]);
3057 }
3058 @sxline=split(/\./, $sx_line);
3059 $sxmem=hex("0x$sxline[5]") / $meg;
3060 }
3061 if ($line =~ /501-2197/) {
3062 # 1MB Prestoserve NVSIMMs (SS1000/SC2000)
3063 if ($config[$i + 1] =~ /\sreg:\s/) {
3064 $nv_line=&mychomp($config[$i + 1]);
3065 } elsif ($config[$i + 2] =~ /\sreg:\s/) {
3066 $nv_line=&mychomp($config[$i + 2]);
3067 }
3068 @nvline=split(/\./, $nv_line);
3069 $nvmem += hex("0x$nvline[2]") / $meg;
3070 }
3071 if ($line =~ /501-2001/) {
3072 # 2MB Prestoserve NVSIMMs (SS10/SS20)
3073 if ($config[$i + 1] =~ /\sreg:\s/) {
3074 $nv_line=&mychomp($config[$i + 1]);
3075 } elsif ($config[$i + 2] =~ /\sreg:\s/) {
3076 $nv_line=&mychomp($config[$i + 2]);
3077 }
3078 @nvline=split(/\./, $nv_line);
3079 $nvmem += hex("0x$nvline[2]") / $meg;
3080 $nvmem1=1 if ($nvline[1] eq "10000000");
3081 $nvmem2=1 if ($nvline[1] eq "14000000" || $nvline[1] eq "1c000000");
3082 }
3083 if (($line =~ /Memory size:\s/) && ($installed_memory == 0)) {
3084 $installed_memory=$line;
3085 $installed_memory=~s/^.*size: *(\d*[GM]*[Bb]*).*/$1/;
3086 if ($installed_memory =~ /GB/) {
3087 $installed_memory=~s/GB//g;
3088 $installed_memory *= 1024;
3089 } else {
3090 $installed_memory=~s/MB//ig;
3091 }
3092 # prtconf sometimes reports incorrect total memory
3093 # 32MB is minimum for sun4u machines
3094 if (($installed_memory < 32) && ($machine eq "sun4u")) {
3095 $prtconf_warn="Incorrect total installed memory (${installed_memory}MB) was reported by prtconf.";
3096 $installed_memory=0;
3097 }
3098 # Round up some odd-number total memory values
3099 $installed_memory++ if (sprintf("%3d", ($installed_memory + 1) / 2 ) * 2 != $installed_memory && $installed_memory >= 1023);
3100 $BSD=0; # prtconf and prtdiag only have this output
3101 $config_cmd="/usr/sbin/prtconf -vp" if ($config_cmd !~ /prtconf/);
3102 $config_command="prtconf";
3103 }
3104 if (($sysfreq == 0) && ($freq > 0)) {
3105 $sysfreq=$freq;
3106 $freq=0;
3107 }
3108 if ($devtype eq "cpu" || $line =~ /compatible: 'FJSV,SPARC64-/) {
3109 if ($cputype =~ /SPARC64-/) {
3110 $cpufreq=$freq if ($freq > $cpufreq);
3111 } else {
3112 $cpufreq=$freq;
3113 }
3114 $cpuline=$line;
3115 $j=$i - 3;
3116 while ($cpuline !~ /^$/ && $cpuline !~ /^\r$/) {
3117 if ($cpuline =~ /clock-frequency:/) {
3118 @freq_line=split(' ', $cpuline);
3119 $cpufreq=&convert_freq($freq_line[1]);
3120 $sysfreq=$freq if (($sysfreq == 0) && ($freq > 0));
3121 } elsif (($cpuline =~ /\sname:\s/ || $cpuline =~ /\scompatible:\s/) && $cpuline !~ /Sun 4/ && $cpuline !~ /SPARCstation/ && $cpuline !~ /CompuAdd/ && $cpuline !~ /'cpu/ && $cpuline !~ /'core'/) {
3122 $cputype=&mychomp($cpuline);
3123 $cputype=~s/\s+name:\s+//;
3124 $cputype=~s/\s+compatible:\s+//;
3125 $cputype=~s/'//g;
3126 $cputype=~s/SUNW,//g;
3127 $cputype=~s/FJSV,//g;
3128 $cputype=~s/ .*//g;
3129 }
3130 $j++;
3131 $cpuline=($config[$j]) ? $config[$j] : "";
3132 }
3133 $freq=0;
3134 $cpufreq=$sysfreq if ($sysfreq >= $cpufreq);
3135 print &runtime . "Checking cputype=$cputype, ncpu=$ncpu\n" if ($DEBUG);
3136 if ($cputype eq "") {
3137 $cputype=$machine;
3138 $cputype="SPARC" if ($cputype =~ /^sun4/ || $model =~ /Sun 4\//);
3139 @bannerarr=split(/\s/, $banner);
3140 foreach $field (@bannerarr) {
3141 if ($field =~ /SPARC/ && $field !~ /SPARCstation/) {
3142 $cputype=$field;
3143 } elsif ($field =~ /390Z5/) {
3144 $field="TI,TMS$field" if ($field =~ /^390Z5/);
3145 $cputype=($cpufreq > 70) ? "SuperSPARC-II $field" : "SuperSPARC $field";
3146 } elsif ($field =~ /RT62[56]/) {
3147 $cputype="hyperSPARC $field";
3148 $machine="sun4m";
3149 }
3150 }
3151 $cputype=~s/[()]//g;
3152 } elsif ($cputype =~ /MB86907/) {
3153 $cputype="TurboSPARC-II $cputype";
3154 } elsif ($cputype =~ /MB86904/ || $cputype =~ /390S10/) {
3155 $cputype=($cpufreq > 70) ? "microSPARC-II $cputype" : "microSPARC $cputype";
3156 } elsif ($cputype =~ /,RT62[56]/) {
3157 $cputype="hyperSPARC $cputype";
3158 $machine="sun4m";
3159 } elsif ($cputype =~ /UltraSPARC-IV/) {
3160 # Count dual-core US-IV & US-IV+ as 1 CPU
3161 $cputype="dual-core $cputype";
3162 $machine="sun4u";
3163 $threadcnt++;
3164 $threadcnt=0 if ($threadcnt == 2);
3165 # CPU count is better from prtdiag than psrinfo for
3166 # US-IV & US-IV+ dual-core processors.
3167 $use_psrinfo_data=0;
3168 } elsif ($cputype =~ /UltraSPARC-T1\b/) {
3169 # Count 4-thread (4, 6, or 8 core) Niagara CPUs as 1 CPU
3170 $machine="sun4v";
3171 $threadcnt++;
3172 # Number of cores & CPUs counted outside this loop below
3173 } elsif ($cputype =~ /UltraSPARC-T2\+/) {
3174 # Count 8-thread (4, 6, or 8 core) Victoria Falls CPUs as 1 CPU
3175 $machine="sun4v";
3176 $threadcnt++;
3177 # Number of cores & CPUs counted outside this loop below
3178 } elsif ($cputype =~ /UltraSPARC-T2\b/) {
3179 # Count 8-thread (4 or 8 core) Niagara-II CPUs as 1 CPU
3180 $machine="sun4v";
3181 $threadcnt++;
3182 # Number of cores & CPUs counted outside this loop below
3183 } elsif ($cputype =~ /SPARC64-VI\b/ && $devtype eq "cpu") {
3184 # Count dual-core dual-thread as 1 CPU
3185 $machine="sun4u";
3186 $threadcnt++;
3187 # Number of cores & CPUs counted outside this loop below
3188 } elsif ($cputype =~ /SPARC64-VII\b/ && $devtype eq "cpu") {
3189 # Count quad-core dual-thread as 1 CPU
3190 $machine="sun4u";
3191 $threadcnt++;
3192 # Number of cores & CPUs counted outside this loop below
3193 } elsif ($cputype =~ /SPARC64-VII\+\b/ && $devtype eq "cpu") {
3194 # Count quad-core dual-thread as 1 CPU
3195 $machine="sun4u";
3196 $threadcnt++;
3197 # Number of cores & CPUs counted outside this loop below
3198 } elsif ($cputype eq "SPARC64-VIII" && $devtype eq "cpu") {
3199 # Guess on the Venus SPARC64-VIII name ???
3200 # Count 8-core dual-thread as 1 CPU
3201 $machine="sun4u";
3202 $threadcnt++;
3203 # Number of cores & CPUs counted outside this loop below
3204 }
3205 if ($threadcnt == 0 && $devtype eq "cpu") {
3206 $ncpu++;
3207 $cpucnt{"$cputype $cpufreq"}++;
3208 $cpucntfrom="prtconf";
3209 }
3210 $devtype="";
3211 }
3212 if ($line =~ /device_type:/) {
3213 @dev_line=split(/\'/, $line);
3214 $devtype=$dev_line[1];
3215 }
3216 if ($line =~ /clock-frequency:/) {
3217 @freq_line=split(' ', $line);
3218 $freq=&convert_freq($freq_line[1]);
3219 }
3220 if ($line =~ /\sversion:\s+'OBP/ && $romver eq "") {
3221 $romver=$line;
3222 $romver=~s/\s+version:\s+//;
3223 $romver=~s/'//g;
3224 @romverarr=split(/\s/, $romver);
3225 $romvernum=$romverarr[1];
3226 }
3227 if ($line =~ /compatible:\s+'sun4.'/ && $osrel eq "") {
3228 @compatible_line=split(/\'/, $line);
3229 $machine=$compatible_line[1];
3230 }
3231 if ($line =~ /value='.*AMD Opteron/ && $cputype eq "x86") {
3232 $cputype_prtconf=$line;
3233 $cputype_prtconf=~s/.*='//;
3234 $cputype_prtconf=~s/'//g;
3235 }
3236 $i++;
3237}
3238&multicore_cpu_cnt;
3239if ($osrel eq "") {
3240 if ($BSD) {
3241 $osrel="4.X";
3242 $config_cmd="/usr/etc/devinfo -pv";
3243 $config_command="devinfo";
3244 } else {
3245 $osrel="5.X";
3246 $solaris="2.X";
3247 $config_cmd="/usr/sbin/prtconf -vp";
3248 $config_command="prtconf";
3249 }
3250}
3251#$sysfreq=$freq if ($sysfreq == 0 && $freq > 0);
3252#$cpufreq=$sysfreq if ($sysfreq > $cpufreq && $ncpu > 0);
3253
3254@romverarr=split(/\./, $romvernum) if ($romver);
3255$romvermajor=($romverarr[0]) ? $romverarr[0] : 2;
3256$romverminor=($romverarr[1]) ? $romverarr[1] : 0;
3257$romverminor=0 if ($romverminor eq "" || $romverminor eq "X");
3258if ($banner =~ /^ \(/) {
3259 # banner-name does not include the eeprom banner name. This happens
3260 # sometimes when OBP 3.23 is installed on Ultra-60/E220R and
3261 # Ultra-80/E420R systems.
3262 $bannermore="Ultra 60 or Enterprise 220R" if ($model eq "Ultra-60");
3263 $bannermore="Ultra 80, Enterprise 420R or Netra t 1400/1405" if ($model eq "Ultra-80");
3264}
3265#
3266# SPARCengine systems
3267#
3268$ultra="AX" if ($motherboard =~ /501-3043/);
3269$ultra="AX-300" if ($motherboard =~ /501-5037/);
3270$ultra="AXi" if ($motherboard =~ /501-4559/);
3271$ultra="AXmp" if ($banner =~ /UltraAX-MP/ || $model =~ /UltraAX-MP/ || $motherboard =~ /501-5296/ || $motherboard =~ /501-5487/ || $motherboard =~ /501-5670/);
3272$ultra="AXmp+" if ($banner =~ /UltraAX-MP\+/ || $model =~ /UltraAX-MP\+/ || $motherboard =~ /501-4324/);
3273$ultra="AXe" if ($banner =~ /UltraAXe\b/ || $model =~ /UltraAX-e\b/ || $motherboard =~ /375-0088/);
3274$ultra="AX-e2" if ($banner =~ /Netra AX1105-500\b/ || $model =~ /UltraAX-e2\b/ || $motherboard =~ /375-0128/);
3275$ultra="Netra X1" if ($banner =~ /Netra X1\b/ || $motherboard =~ /375-3015/);
3276$ultra="Netra T1 200" if ($banner =~ /Netra T1 200\b/ || $motherboard =~ /375-0132/);
3277$ultra="Sun Fire V100" if ($banner =~ /Sun Fire V100\b/);
3278# Sun Fire V120/Netra 120 can use motherboard 375-0132 like Netra T1 200 above
3279$ultra="Sun Fire V120" if ($banner =~ /Sun Fire V120\b/);
3280$ultra="Netra 120" if ($banner =~ /Netra 120\b/);
3281if ($ultra =~ /AX/) {
3282 if ($banner !~ /SPARCengine.*Ultra/) {
3283 $tmp="(SPARCengine Ultra $ultra)";
3284 $bannermore=($bannermore) ? "$tmp $bannermore" : $tmp;
3285 }
3286}
3287if ($model =~ /Ultra-5_10\b/) {
3288 if ($banner =~ /\bVoyagerIIi\b/) {
3289 # Tadpole Voyager IIi has 8 DIMM slots, but prtconf reports
3290 # it as an Ultra 5/10
3291 $model="VoyagerIIi";
3292 $ultra="VoyagerIIi";
3293 }
3294}
3295$ultra="Sun Blade 150" if ($banner =~ /Sun Blade 150\b/ || $diagbanner =~ /Sun Blade 150\b/);
3296$ultra="UP-20" if ($banner =~ /\bUP-20\b/); # untested ???
3297$ultra="UP-520IIi" if ($motherboard =~ /501-4559/ && $banner =~ /\b520IIi\b/);
3298
3299$need_obp2=0;
3300if ($model eq "Sun 4/20" || $model eq "Sun 4/25" || $model eq "Sun 4/40" || $model eq "Sun 4/50" || $model eq "Sun 4/60" || $model eq "Sun 4/65" || $model eq "Sun 4/75" || $model eq "SS-2") {
3301 $machine="sun4c";
3302 $need_obp2=1 if ($model eq "Sun 4/40" || $model eq "Sun 4/60" || $model eq "Sun 4/65");
3303}
3304
3305&check_prtdiag if ($isX86);
3306if ($isX86) {
3307 # Round up Solaris x86 memory (may have 128MB or more reserved)
3308 $installed_memory=&roundup_memory($installed_memory);
3309}
3310
3311
3312if ($gotmemory eq "" && $ultra eq 0 && $machine ne "sun4d" && $boardfound_mem eq 0) {
3313 &check_prtdiag;
3314 &show_header;
3315 if ($installed_memory) {
3316 print "total memory = ";
3317 &show_memory($installed_memory);
3318 }
3319 print "$permission_error\n" if ($permission_error);
3320 print "$prtconf_warn\n" if ($prtconf_warn ne "");
3321 if ($prtdiag_failed == 2) {
3322 # non-global zone (container)
3323 print "WARNING: More details can be reported if memconf is run in the global zone.\n";
3324 } else {
3325 print "ERROR: no 'memory' line in \"$config_cmd\" output.\n" if ($model ne "i86pc");
3326 if (! $config_permission && $machine =~ /sun4/ && $prtconf_warn eq "") {
3327 print " This user ";
3328 if ($permission_error) {
3329 print "does";
3330 } else {
3331 print "may";
3332 }
3333 print " not have permission to run $config_command.\n";
3334 print " Try running memconf as a privileged user like root.\n" if ($uid ne "0");
3335 } elsif ($need_obp2) {
3336 print " Upgrading from Open Boot PROM V1.X to V2.X will ";
3337 print "allow memconf to\n detect the memory installed.\n";
3338 } elsif ($prtconf_warn =~ /openprom/) {
3339 print " Please correct the problem with the openprom device.\n" if ($model ne "i86pc");
3340 } else {
3341 print " This is an unsupported system by memconf.\n" if ($model ne "i86pc");
3342 }
3343 }
3344 &show_supported if ($machine !~ /sun4/);
3345 $exitstatus=1;
3346 &mailmaintainer if ($verbose == 3);
3347 exit $exitstatus;
3348}
3349
3350$gotmemory=~s/\s+reg:\s+//;
3351$gotmemory=~s/'//g;
3352@slots=split(/\./, $gotmemory);
3353$slot=1;
3354if ($manufacturer ne "" && $manufacturer !~ /^Sun\b/ && $ultra !~ /SPARC Enterprise M[34589]000 Server/) {
3355 $bannermore=($bannermore) ? "$bannermore clone" : "clone" if ($manufacturer ne "Force Computers");
3356 $modelmore=($modelmore) ? "$modelmore clone" : "clone";
3357 $clone=1;
3358}
3359# DIMMs are installed in pairs on Ultra 1, 5 and 10; quads on
3360# Ultra 2, 60, 80, 220R, 420R, 450; 8's in Ultra Enterprise
3361#
3362# On 64-bit systems, prtconf format is AAAAAAAA.AAAAAAAA.SSSSSSSS.SSSSSSSS
3363# and on 32-bit systems, prtconf format is AAAAAAAA.AAAAAAAA.SSSSSSSS
3364# where A is for Address, S is for Size.
3365# Minimum module size is 1MB (0x00100000), so strip off last 5 hex digits of LSB
3366# and prepend last 5 digits of MSB, which allows recognizing up to 4500TB!
3367#
3368if ($ultra) {
3369 $val0=3; # simmsize is in 3rd and 4th fields
3370 $valaddr=2; # address is 2 fields before simmsize
3371 $valinc=4; # fields per simm
3372 $memtype="DIMM";
3373} else {
3374 $val0=2; # simmsize is in 3rd field
3375 $valaddr=1; # address is 1 field before simmsize
3376 $valinc=3; # fields per simm
3377}
3378
3379#
3380# Define memory layout for specific systems
3381#
3382if ($model eq "Sun 4/20") {
3383 # SLC accepts 4MB SIMMs on motherboard
3384 # 501-1676 (4MB 100ns), 501-1698 (4MB 80ns)
3385 # 33-bit 72-pin Fast Page Mode (36-bit work also)
3386 # Does not support Open Boot PROM V2.X, so devinfo/prtconf output will
3387 # not have memory lines.
3388 $devname="OffCampus";
3389 $untested=1;
3390 $simmrangex="00000010";
3391 $simmbanks=4;
3392 $simmsperbank=1;
3393 @simmsizes=(4);
3394 @socketstr=("U0502","U0501","U0602","U0601");
3395}
3396if ($model eq "Sun 4/25") {
3397 # ELC accepts 4MB or 16MB SIMMs on motherboard
3398 # 501-1698 or 501-1812 (4MB 80ns), 501-1822 (16MB 80ns)
3399 # 33-bit 72-pin Fast Page Mode (36-bit work also)
3400 $devname="NodeWarrior";
3401 $untested=0;
3402 $simmrangex="00000010";
3403 $simmbanks=4;
3404 $simmsperbank=1;
3405 @simmsizes=(4,16);
3406 @socketstr=("U0407".."U0410");
3407 @bankstr=("MEM1".."MEM4");
3408}
3409if ($model eq "Sun 4/40") {
3410 # IPC accepts 1MB or 4MB SIMMs on motherboard
3411 # 501-1697 (1MB 80ns), 501-1625 (4MB 100ns), 501-1739 (4MB 80ns)
3412 # Does not show memory with Open Boot PROM V1.X, but does with OBP V2.X
3413 $devname="Phoenix";
3414 $untested=0;
3415 $simmrangex="00000010";
3416 $simmbanks=3;
3417 $simmsperbank=4;
3418 @simmsizes=(1,4);
3419 @socketstr=("U0588","U0587","U0586","U0585","U0584","U0591","U0590","U0589","U0678","U0676","U0683","U0677");
3420 @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2);
3421 @bytestr=(0..3,0..3,0..3);
3422}
3423if ($model eq "Sun 4/50") {
3424 # IPX accepts 4MB or 16MB SIMMs on motherboard
3425 # 501-1812 (4MB 80ns), 501-1915 or 501-1822 (16MB 80ns)
3426 # 33-bit 72-pin Fast Page Mode (36-bit work also)
3427 $devname="Hobbes";
3428 $untested=0;
3429 $simmrangex="00000010";
3430 $simmbanks=4;
3431 $simmsperbank=1;
3432 @simmsizes=(4,16);
3433 @socketstr=("U0310","U0309","U0308","U0307");
3434 @bankstr=(0..3);
3435}
3436if ($model eq "Sun 4/60" || $model eq "Sun 4/65") {
3437 # SS1 and SS1+ accepts 1MB or 4MB SIMMs on motherboard
3438 # 501-1408 (1MB 100ns), 501-1697 (SS1+ only) (1MB 80ns),
3439 # 501-1625 (4MB 100ns), 501-1739 (4MB 80ns)
3440 # Does not show memory with Open Boot PROM V1.X, but does with OBP V2.X
3441 if ($model eq "Sun 4/60") {
3442 $devname="Campus";
3443 $untested=0;
3444 } else {
3445 $devname="CampusB, Campus+";
3446 $untested=1;
3447 }
3448 $simmrangex="00000010";
3449 $simmbanks=4;
3450 $simmsperbank=4;
3451 @simmsizes=(1,4);
3452 @socketstr=("U0588","U0587","U0586","U0585","U0584","U0591","U0590","U0589","U0678","U0676","U0683","U0677","U0682","U0681","U0680","U0679");
3453 @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
3454 @bytestr=(0..3,0..3,0..3,0..3);
3455}
3456if ($model eq "Sun 4/75" || $model eq "SS-2") {
3457 # SS2 accepts 4MB SIMMs on motherboard and 32MB or 64MB SBus expansion
3458 # card (501-1823 Primary and 501-1824 Secondary)
3459 # 501-1739 (4MB 80ns)
3460 $devname="Calvin";
3461 $untested=0;
3462 $simmrangex="00000010";
3463 $simmbanks=4;
3464 $simmsperbank=4;
3465 @simmsizes=(4);
3466 @socketstr=("U0311","U0309","U0307","U0322","U0312","U0310","U0308","U0321","U0313","U0314","U0315","U0320","U0319","U0318","U0317","U0316");
3467 @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
3468 @bytestr=(0..3,0..3,0..3,0..3);
3469}
3470if ($model =~ /SPARCclassic/ || $model =~ /SPARCstation-LX/) {
3471 # Classic-X (4/10) accepts 1MB, 2MB, 4MB and 16MB SIMMs on motherboard
3472 # Classic (4/15) and LX (4/30) accepts 4MB and 16MB SIMMs on motherboard
3473 # Can accept 32MB SIMMs in bank 1, allowing 128MB total (2x32, 4x16)
3474 # Possibly accepts 8MB SIMMs in bank 1
3475 # 501-2289 (1MB), 501-2433 (2MB) on Classic-X only
3476 # 501-1991 (4MB), 501-2059 (16MB)
3477 # 36-bit 72-pin 60ns Fast Page Mode
3478 $devname="Sunergy";
3479 if ($model =~ /SPARCclassic-X/) {
3480 $untested=1;
3481 @simmsizes=(1,2,4,8,16,32);
3482 } else {
3483 $untested=0;
3484 @simmsizes=(4,8,16,32);
3485 }
3486 $simmrangex="00000020";
3487 $simmbanks=3;
3488 $simmsperbank=2;
3489 @socketstr=("U0304","U0303","U0301","U0302","U0402","U0401");
3490 @bankstr=(1,1,2,2,3,3);
3491}
3492if ($model eq "S240") {
3493 # Voyager has 16MB on motherboard, plus accepts one or two 16MB or 32MB
3494 # Memory cards (501-2327 32MB, 501-2366 16MB)
3495 # Motherboard, address 0x00000000-0x007fffff, 0x01000000-0x017fffff
3496 # Lower slot=Mem 1, address 0x02000000-0x07ffffff
3497 # Upper slot=Mem 2, address 0x0a000000-0x0fffffff
3498 $devname="Gypsy";
3499 $untested=0;
3500 $memtype="memory card";
3501 $sockettype="slot";
3502 $simmrangex="00000020";
3503 $simmbanks=8; # Count the skipped address range
3504 $simmsperbank=1;
3505 @simmsizes=(16,32);
3506 @socketstr=("motherboard","Mem 1","Mem 1","Mem 1","?","Mem 2","Mem 2","Mem 2");
3507 @orderstr=("","lower slot","lower slot","lower slot","?","upper slot","upper slot","upper slot");
3508}
3509if ($model eq "JavaEngine1") {
3510 # Accepts 8MB, 16MB and 32MB EDO DIMMs
3511 $devname="Bali";
3512 $untested=0;
3513 $memtype="DIMM";
3514 $simmrangex="00000020";
3515 $simmbanks=2;
3516 $simmsperbank=1;
3517 @simmsizes=(8,16,32);
3518 @socketstr=("J0501","J0502");
3519 @bankstr=(0,1);
3520}
3521if ($model eq "SPARCstation-4") {
3522 # Accepts 8MB and 32MB SIMMs on motherboard
3523 # 501-2470 (8MB), 501-2471 (32MB)
3524 # 168-pin 60ns Fast Page Mode
3525 $devname="Perigee";
3526 $untested=0;
3527 $simmrangex="00000020";
3528 $simmbanks=5;
3529 $simmsperbank=1;
3530 @simmsizes=(8,32);
3531 @socketstr=("J0301".."J0305");
3532 @bankstr=(0..4);
3533}
3534if ($model eq "SPARCstation-5" || $model eq "micro COMPstation 5" || $model =~ /Axil-255/ || $banner =~ /TWINstation 5G\b/) {
3535 # Accepts 8MB and 32MB SIMMs on motherboard
3536 # 501-2470 (8MB), 501-2471 (32MB)
3537 # 168-pin 60ns Fast Page Mode
3538 $devname="Aurora" if ($model eq "SPARCstation-5");
3539 $untested=0;
3540 $simmrangex="00000020";
3541 $simmbanks=8;
3542 $simmsperbank=1;
3543 @simmsizes=(8,32);
3544 @socketstr=("J0300".."J0303","J0400".."J0403");
3545 @bankstr=(0..7);
3546 if ($banner =~ /TWINstation 5G\b/) {
3547 $simmbanks=6;
3548 @socketstr=(0..5);
3549 }
3550 if ($model ne "SPARCstation-5") {
3551 $bannermore="SPARCstation 5 clone";
3552 $modelmore="SPARCstation 5 clone";
3553 }
3554}
3555if ($model =~ /SPARCstation-10/ || $model eq "Premier-24" || $motherboard eq "SUNW,S10,501-2365") {
3556 # Accepts 16MB and 64MB SIMMs on motherboard
3557 # 501-1785 or 501-2273 (16MB 80ns), 501-2479 (16MB 60ns),
3558 # 501-2622 (32MB 60ns), 501-1930 (64MB 80ns), 501-2480 (64MB 60ns)
3559 # 200-pin 60ns or 80ns Fast Page Mode ECC
3560 # 32MB SIMMs not supported according to Sun, but appears to work fine
3561 # depending on the OBP revision. OBP 2.12 and older detects the 32MB
3562 # SIMM as 16MB, OBP 2.19 and later properly detects the 32MB SIMM.
3563 $devname="Campus2" if ($model =~ /SPARCstation-10/);
3564 $devname="Campus2+" if ($model =~ /Premier-24/);
3565 $untested=0;
3566 $simmrangex="00000040";
3567 $simmbanks=8;
3568 $simmsperbank=1;
3569 $romvernum="2.X" if ($romvernum eq "");
3570 $romverminor=0 if ($romverminor eq "" || $romverminor eq "X");
3571 @simmsizes=(($romvermajor eq 2) && ($romverminor >= 19)) ? (16,32,64) : (16,64);
3572 @socketstr=("J0201","J0203","J0302","J0304","J0202","J0301","J0303","J0305");
3573 @orderstr=("1st","3rd","4th","2nd","8th","6th","5th","7th");
3574 @bankstr=(0..7);
3575}
3576if ($model =~ /SPARCstation-20/ || $model =~ /COMPstation-20S/ || $banner =~ /TWINstation 20G\b/) {
3577 # Accepts 16MB, 32MB and 64MB SIMMs on motherboard
3578 # 501-2479 (16MB), 501-2622 (32MB), 501-2480 (64MB)
3579 # 200-pin 60ns Fast Page Mode ECC
3580 $devname="Kodiak" if ($model eq "SPARCstation-20");
3581 $untested=0;
3582 $simmrangex="00000040";
3583 $simmbanks=8;
3584 $simmsperbank=1;
3585 @simmsizes=(16,32,64);
3586 @socketstr=("J0201","J0303","J0202","J0301","J0305","J0203","J0302","J0304");
3587 @orderstr=("1st","2nd","3rd","4th","5th","6th","7th","8th");
3588 @bankstr=(0..7);
3589 if ($model !~ /SPARCstation-20/) {
3590 $bannermore="SPARCstation 20 clone";
3591 $modelmore="SPARCstation 20 clone";
3592 }
3593 if ($model eq "SPARCstation-20I") {
3594 $bannermore="(SPARCstation-20I) clone";
3595 $modelmore="clone";
3596 }
3597 if ($banner =~ /TWINstation 20G\b/) {
3598# @socketstr=("J0201","J0303","J0202","J0301","J0305","J0203","J0302","J0304");
3599# @orderstr=("1st","6th","2nd","4th","8th","3rd","5th","7th");
3600 @socketstr=(0..7);
3601 @orderstr=("");
3602 }
3603}
3604if ($model eq "SPARCsystem-600" || $model =~ /Sun.4.600/) {
3605 # Accepts 4MB or 16MB SIMMs on motherboard
3606 # Accepts 1MB, 4MB or 16MB SIMMs on VME expansion cards
3607 # A memory bank is 16 SIMMs of the same size and speed
3608 # Minimum memory configuration is 16 SIMMs in Bank 0 on the motherboard
3609 # Motherboard Bank 1 must be populated before adding expansion cards
3610 # Up to two VME memory expansion cards can be added
3611 # Use 4MB SIMM 501-1739-01 or 501-2460-01
3612 # Use 16MB SIMM 501-2060-01
3613 $devname="Galaxy";
3614 $untested=0;
3615 $simmrangex="00000100";
3616 $simmbanks=2; # 2 banks on CPU board, 4 banks on each expansion cards
3617 $simmsperbank=16;
3618 @simmsizes=(4,16);
3619 # Sockets, banks and bytes on motherboard
3620 @socketstr=("U1107","U1307","U1105","U1305","U1103","U1303","U1101","U1301","U1207","U1407","U1205","U1405","U1203","U1403","U1201","U1401","U1108","U1308","U1106","U1306","U1104","U1304","U1102","U1302","U1208","U1408","U1206","U1406","U1204","U1404","U1202","U1402");
3621 @bankstr=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
3622 @banksstr=("Motherboard bank 0","Motherboard bank 1");
3623 @bytestr=("0L0","0L1","1L0","1L1","2L0","2L1","3L0","3L1","4L0","4L1","5L0","5L1","6L0","6L1","7L0","7L1","0H0","0H1","1H0","1H1","2H0","2H1","3H0","3H1","4H0","4H1","5H0","5H1","6H0","6H1","7H0","7H1");
3624 # Sockets, banks and bytes on VME expansion cards
3625 @socketstr_exp=("U1501","U1503","U1505","U1507","U1601","U1603","U1605","U1607","U1701","U1703","U1705","U1707","U1801","U1803","U1805","U1807","U1502","U1504","U1506","U1508","U1602","U1604","U1606","U1608","U1702","U1704","U1706","U1708","U1802","U1804","U1806","U1808","U1901","U1903","U1905","U1907","U2001","U2003","U2005","U2007","U2101","U2103","U2105","U2107","U2201","U2203","U2205","U2207","U1902","U1904","U1906","U1908","U2002","U2004","U2006","U2008","U2102","U2104","U2106","U2108","U2202","U2204","U2206","U2208");
3626 @bankstr_exp=("B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B0","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B1","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B2","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3","B3");
3627 @bytestr_exp=("0L0","0L1","1L0","1L1","2L0","2L1","3L0","3L1","4L0","4L1","5L0","5L1","6L0","6L1","7L0","7L1","0H0","0H1","1H0","1H1","2H0","2H1","3H0","3H1","4H0","4H1","5H0","5H1","6H0","6H1","7H0","7H1","8L0","8L1","9L0","9L1","aL0","aL1","bL0","bL1","cL0","cL1","dL0","dL1","eL0","eL1","fL0","fL1","8H0","8H1","9H0","9H1","aH0","aH1","bH0","bH1","cH0","cH1","dH0","dH1","eH0","eH1","fH0","fH1");
3628}
3629if ($model eq "Ultra-1" || $ultra eq 1) {
3630 # Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
3631 # 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB),
3632 # 501-3136 (128MB)
3633 # 200-pin 60ns Fast Page Mode ECC
3634 $devname="Neutron (Ultra 1), Electron (Ultra 1E), Dublin (Ultra 150)";
3635 $familypn="A11 (Ultra 1), A12 (Ultra 1E)";
3636 $untested=0;
3637 $simmrangex="00000100";
3638 $simmbanks=4;
3639 $simmsperbank=2;
3640 @simmsizes=(16,32,64,128);
3641 @socketstr=("U0701","U0601","U0702","U0602","U0703","U0603","U0704","U0604");
3642 @bankstr=("0L","0H","1L","1H","2L","2H","3L","3H");
3643 @bytestr=("00-15","16-31","00-15","16-31","00-15","16-31","00-15","16-31");
3644}
3645if ($model eq "Ultra-2" || $ultra eq 2) {
3646 # Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
3647 $devname="Pulsar";
3648 $familypn="A14";
3649 $untested=0;
3650 $simmrangex="00000200";
3651 $simmbanks=4;
3652 $simmsperbank=4;
3653 @simmsizes=(16,32,64,128);
3654 @socketstr=("U0501","U0401","U0701","U0601","U0502","U0402","U0702","U0602","U0503","U0403","U0703","U0603","U0504","U0404","U0704","U0604");
3655 @groupstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
3656 @bankstr=("0L","0H","1L","1H","0L","0H","1L","1H","0L","0H","1L","1H","0L","0H","1L","1H");
3657 @bytestr=("00-15","16-31","32-47","48-63","00-15","16-31","32-47","48-63","00-15","16-31","32-47","48-63","00-15","16-31","32-47","48-63");
3658}
3659if ($model eq "Ultra-30" || $ultra eq 30) {
3660 # Also Netra t 1100
3661 # Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
3662 # 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB),
3663 # 501-3136 (128MB)
3664 # 200-pin 60ns Fast Page Mode ECC
3665 # Two DIMMs form a pair, two pairs of DIMMs form a quad.
3666 # Minumum requirements is two DIMMs in any adjacent pair.
3667 # DIMMs can be installed in any order of pairs.
3668 # Interleaving requires a fully populated quad.
3669 # Each quad addresses 512MB of memory.
3670 $devname="Quark (Ultra-30), Lightweight (Netra t 1100)";
3671 $familypn="A16 (Ultra-30), N01 (Netra t 1100)";
3672 $untested=0;
3673 # simmrangex, simmbanks, and simmsperbank set later after determining
3674 # if interleaving banks using quads rather than pairs
3675 @simmsizes=(16,32,64,128);
3676 @socketstr=("U0701","U0801","U0901","U1001","U0702","U0802","U0902","U1002","U0703","U0803","U0903","U1003","U0704","U0804","U0904","U1004");
3677 @bankstr=("Quad 0 Pair 0","Quad 0 Pair 0","Quad 0 Pair 1","Quad 0 Pair 1","Quad 1 Pair 0","Quad 1 Pair 0","Quad 1 Pair 1","Quad 1 Pair 1","Quad 2 Pair 0","Quad 2 Pair 0","Quad 2 Pair 1","Quad 2 Pair 1","Quad 3 Pair 0","Quad 3 Pair 0","Quad 3 Pair 1","Quad 3 Pair 1");
3678}
3679if ($model eq "Ultra-5_10" || $ultra eq "5_10" || $ultra eq 5 || $ultra eq 10) {
3680 # Accepts 16MB, 32MB, 64MB, 128MB or 256MB DIMMs on motherboard
3681 # 16MB DIMM uses 10-bit column addressing and was not sold
3682 # 32, 64, 128 and 256MB DIMMs use 11-bit column addressing
3683 # Do not mix 16MB DIMMs with other sizes
3684 # 256MB DIMM not supported in Ultra 5 according to Sun documentation,
3685 # but they do work as long as you use low-profile DIMMs or take out the
3686 # floppy drive.
3687 # Memory speed is 60ns if 50ns and 60ns DIMMs are mixed
3688 # 2-way interleaving supported with four identical sized DIMMs
3689 # 50ns DIMMs supported on 375-0066 & 375-0079 motherboards
3690 # Bank 0 DIMM1/DIMM2 0x00000000-0x0fffffff, 0x20000000-0x2fffffff
3691 # Bank 1 DIMM3/DIMM4 0x10000000-0x1fffffff, 0x30000000-0x3fffffff
3692 $devname="Darwin/Otter (Ultra 5), Darwin/SeaLion (Ultra 10)";
3693 $familypn="A21 (Ultra 5), A22 (Ultra 10)";
3694 $untested=0;
3695 $simmrangex="00000100";
3696 $simmbanks=2;
3697 $simmsperbank=2;
3698 @simmsizes=(16,32,64,128,256);
3699 @socketstr=("DIMM1".."DIMM4");
3700 @bankstr=("0L","0H","1L","1H");
3701 $sortslots=0;
3702}
3703if ($model eq "Ultra-60" || $ultra eq 60 || $ultra eq "220R") {
3704 # Also Netra t1120/1125
3705 # Accepts 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
3706 # 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB),
3707 # 501-3136 (128MB)
3708 # 200-pin 60ns Fast Page Mode ECC
3709 # U1001-U1004 bank 3 address 0xa0000000-0xbfffffff
3710 # U0901-U0904 bank 2 address 0x80000000-0x9fffffff
3711 # U0801-U0804 bank 1 address 0x20000000-0x3fffffff
3712 # U0701-U0704 bank 0 address 0x00000000-0x1fffffff
3713 if ($model eq "Ultra-60" || $ultra eq 60) {
3714 $devname="Deuterium (Ultra-60), Lightweight 2 (Netra t112x)";
3715 $familypn="A23 (Ultra-60), N02/N04 (Netra t1120), N03 (Netra t1125)";
3716 }
3717 if ($ultra eq "220R") {
3718 $devname="Razor";
3719 $familypn="A34";
3720 }
3721 $untested=0;
3722 $simmrangex="00000200";
3723 $simmbanks=6; # Count the skipped address range
3724 $simmsperbank=4;
3725 @simmsizes=(16,32,64,128);
3726 @socketstr=("U0701".."U0704","U0801".."U0804","?","?","?","?","?","?","?","?","U0901".."U0904","U1001".."U1004");
3727 @bankstr=(0,0,0,0,1,1,1,1,"?","?","?","?","?","?","?","?",2,2,2,2,3,3,3,3);
3728}
3729
3730#
3731# SPARCengine systems
3732#
3733if ($banner =~ /Netra t1\b/ || $ultra eq "Netra t1" || $model eq "Netra t1" || $banner =~ /Ultra CP 1500\b/ || $ultra eq "CP1500" || $ultra eq "Netra ct400" || $ultra eq "Netra ct410" || $ultra eq "Netra ct800" || $ultra eq "Netra ct810") {
3734 # Netra t1 100/105, Netra ct400/410/800/810, SPARCengine CP1500
3735 # Accepts 1 or 2 64MB, 128MB, 256MB or 512MB mezzanine memory cards
3736 # Netra ct400/800 use the Netra ct1600 DC chassis (N08)
3737 # Netra ct410/810 use the Netra ct1600 AC chassis (N09)
3738 # Also used in Sun Fire 12K & Sun Fire 15K
3739 # Install the highest capacity memory board first
3740 # The 370-4155 was sold for use in the Netra t1 100/105
3741 # Up to four 370-4155 256MB memory boards can be installed
3742 # Only one 370-4155 can be mixed with any other memory boards
3743 # Cannot distinguish between 4 370-4155 256MB and 2 512MB memory boards
3744 # Maximum memory: 768MB for 270MHz/33MHz, 1GB for 360MHz/440MHz systems
3745 #
3746 # Top slot -> 64MB 64MB 128MB 128MB 256MB 256MB 512MB
3747 # Bottom slot SSF SS DSF SS SSF SS DSF SS DSF DS DSF SS DSF DS
3748 # |
3749 # v ------ ------ ------ ------ ------ ------ ------
3750 # 64MB SSF SS Y N Y N N Y N
3751 # 64MB DSF SS Y Y Y Y Y Y Y
3752 # 128MB SSF SS Y N Y N N Y N
3753 # 128MB DSF SS Y Y Y Y Y Y Y
3754 # 256MB DSF SS Y Y Y Y Y Y Y
3755 # 512MB DSF DS Y/N * Y/N * Y/N * Y/N * Y/N * Y/N * Y/N *
3756 #
3757 # SSF=single-sided fab, DSF=double-sided fab
3758 # SS=stuffed on one side, DS=stuffed on both sides
3759 # * 512MB DSF DS board is supported on 360MHz and 440MHz systems,
3760 # 512MB DSF DS board is not supported on 270MHz and 333MHz systems
3761 # Lower board, address 0x00000000-0x0fffffff, 0x20000000-0x2fffffff
3762 # upper board, address 0x10000000-0x1fffffff, 0x30000000-0x3fffffff
3763 if ($banner =~ /Netra t1\b/ || $ultra eq "Netra t1" || $model eq "Netra t1") {
3764 $devname="Flyweight (Model 100), Flapjack (Model 105)";
3765 $familypn="N07 (Model 100), N06 (Model 105)";
3766 }
3767 $devname="Tonga" if ($ultra eq "Netra ct400");
3768 $devname="Monte Carlo" if ($ultra eq "Netra ct800");
3769 $familypn="N08" if ($ultra =~ /Netra ct[48]00/);
3770 if ($ultra =~ /Netra ct[48]10/) {
3771 $devname="Makaha";
3772 $familypn="N09";
3773 }
3774 $untested=0;
3775 $untested=1 if ($ultra eq "Netra ct400" || $ultra =~ /Netra ct[48]10/);
3776 $memtype="memory card";
3777 $sockettype="";
3778 $simmrangex="00000100";
3779 $simmbanks=2;
3780 $simmsperbank=1;
3781 @simmsizes=(64,128,256,512);
3782 @socketstr=("base mezzanine board","additional mezzanine board");
3783 @orderstr=("lower board","upper board");
3784 $sortslots=0;
3785}
3786if ($banner =~ /Ultra CP 1400\b/ || $ultra eq "CP1400") {
3787 # Accepts 1 or 2 64MB, 128MB, 256MB or 512MB mezzanine memory cards
3788 # Has 64MB on-board memory on motherboard
3789 # Maximum memory: 832MB (64MB motherboard, 512MB bottom, 256MB top)
3790 #
3791 # Top slot -> 64MB 64MB 128MB 128MB 256MB 512MB
3792 # Bottom slot SSF SS DSF SS SSF SS DSF SS DSF SS DSF DS
3793 # |
3794 # v ------ ------ ------ ------ ------ ------
3795 # 64MB SSF SS Y N Y N Y N
3796 # 64MB DSF SS Y Y Y Y Y N
3797 # 128MB SSF SS Y N Y N Y N
3798 # 128MB DSF SS Y Y Y Y Y N
3799 # 256MB DSF SS Y Y Y Y Y N
3800 # 512MB DSF DS Y Y Y Y Y N
3801 #
3802 # SSF=single-sided fab, DSF=double-sided fab
3803 # SS=stuffed on one side, DS=stuffed on both sides
3804 # 512MB DSF DS board is only supported in bottom slot
3805 #
3806 # Motherboard, address 0x00000000-0x03ffffff
3807 # Upper board, address 0x08000000-0xffffffff, 0x28000000-0x2fffffff
3808 # Lower board, address 0x10000000-0x17ffffff, 0x30000000-0x37ffffff
3809 $devname="Casanova";
3810 $untested=0;
3811 $memtype="memory card";
3812 $sockettype="";
3813 $simmrangex="00000080";
3814 $simmbanks=3;
3815 $simmsperbank=1;
3816 @simmsizes=(64,128,256,512);
3817 @socketstr=("motherboard","additional mezzanine board","base mezzanine board");
3818 @orderstr=("","upper board","lower board");
3819 $sortslots=0;
3820}
3821if ($ultra eq "AX" || $ultra eq "AX-300") {
3822 # SPARCengine Ultra AX and AX-300
3823 # Accepts 8MB, 16MB, 32MB or 64MB DIMMs on motherboard
3824 # AX-300 also accepts 128MB DIMMs on motherboard
3825 $devname="Photon";
3826 $untested=0; # unsure if socket order is correct
3827 $simmrangex="00000200";
3828 $simmbanks=2;
3829 $simmsperbank=4;
3830 @simmsizes=(8,16,32,64,128);
3831 @socketstr=("U0301".."U0304","U0401".."U0404");
3832 @bankstr=(0,0,0,0,1,1,1,1);
3833}
3834if ($ultra eq "AXi") {
3835 # SPARCengine Ultra AXi
3836 # Accepts 8MB, 16MB, 32MB, 64MB or 128MB single or dual bank 10-bit
3837 # column address type DIMMs on motherboard in all socket pairs
3838 # Accepts 8MB, 16MB, 32MB, 64MB, 128MB or 256MB dual bank 11-bit
3839 # column address type DIMMs on motherboard in Pairs 0 & 2
3840 # (leave Pairs 1 & 3 empty)
3841 # DIMMs should be chosen as all 10-bit or all 11-bit column address type
3842 # Use 60ns DIMMs only
3843 #$devname="unknown";
3844 $untested=0;
3845 $simmrangex="00000100";
3846 $simmbanks=4;
3847 $simmsperbank=2;
3848 @simmsizes=(8,16,32,64,128,256);
3849 @socketstr=("U0404","U0403","U0304","U0303","U0402","U0401","U0302","U0301");
3850 @bankstr=(0,0,2,2,1,1,3,3);
3851 $sortslots=0;
3852}
3853if ($ultra eq "AXmp" || $ultra eq "AXmp+") {
3854 # SPARCengine Ultra AXmp
3855 # Accepts 8MB, 16MB, 32MB, 64MB or 128MB DIMMs on motherboard
3856 # Accepts 256MB dual-bank DIMMs in bank 0 or 1 (not both)
3857 # Can't distinguish dual-bank DIMMs from two banks of single bank DIMMs
3858 # SPARCengine Ultra AXmp+
3859 # Accepts 8MB, 16MB, 32MB, 64MB, 128MB or 256MB DIMMs on motherboard
3860 # Accepts dual-bank DIMMs in both bank 0 and 1
3861 # Can't distinguish dual-bank DIMMs from two banks of single bank DIMMs
3862 $devname="Crichton";
3863 $untested=0;
3864 $simmbanks=2;
3865 $simmsperbank=8;
3866 if ($ultra eq "AXmp+") {
3867 $simmrangex="00000400";
3868 @simmsizes=(8,16,32,64,128,256);
3869 } else {
3870 $simmrangex="00000800";
3871 @simmsizes=(8,16,32,64,128);
3872 }
3873 @socketstr=("U0701".."U0704","U0801".."U0804","U0901".."U0904","U1001".."U1004");
3874 @bankstr=(0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1);
3875 $sortslots=0;
3876}
3877if ($ultra eq "AXe") {
3878 # SPARCengine Ultra AXe
3879 # Accepts 32MB, 64MB, 128MB or 256MB single or dual bank DIMMs
3880 # DIMMs should be chosen as all 10-bit or all 11-bit column address type
3881 $devname="Topdog";
3882 $untested=0;
3883 $simmrangex="00000100";
3884 $simmbanks=2;
3885 $simmsperbank=2;
3886 @simmsizes=(32,64,128,256);
3887 @socketstr=("DIMM3","DIMM4","DIMM1","DIMM2");
3888 @bankstr=(0,0,1,1);
3889 # Assume stacked DIMMs like AXi since only 128MB DIMMs have been tested
3890 $sortslots=0;
3891}
3892if ($ultra eq "AX-e2") {
3893 # Netra AX1105-500
3894 # Accepts up to 4 64MB, 128MB, 256MB or 512MB registered SDRAM PC133
3895 # DIMMs; 128MB Minimum, 2GB Maximum
3896 # DIMM0 & DIMM1 form Bank 0, DIMM2 & DIMM3 form Bank 1
3897 # DIMMs don't have to be installed as pairs
3898 $devname="Birdsnest Lite";
3899 $untested=0;
3900 $simmrangex="00000200";
3901 $simmbanks=4;
3902 $simmsperbank=1;
3903 @simmsizes=(64,128,256,512);
3904 @socketstr=("DIMM0".."DIMM3");
3905 @bankstr=(0,0,1,1);
3906}
3907if ($ultra eq "Netra X1" || $ultra eq "Sun Fire V100") {
3908 # Netra X1, Sun Fire V100, UltraAX-i2
3909 # Accepts up to 4 128MB or 256MB PC133 DIMMs for 1GB maximum
3910 # 500MHz model also accepts up to 4 512MB PC133 DIMMs for 2GB maximum
3911 # Have seen slower models also work with 512MB DIMMs for 2GB maximum
3912 # Sun Fire V100 is 500MHz only
3913 # The memory installation sequence is Slot 3, 2, 1, and 0.
3914 # Each DIMM slot addresses 512MB with 400MHz UltraSPARC IIe
3915 # Each DIMM slot addresses 1GB with >= 550MHz UltraSPARC IIe
3916 # Memory is SDRAM PC133 CL=3 ECC registered
3917 # When equal size DIMMs are installed, the lowest slot number is
3918 # mapped to the lowest address range.
3919 # When mixed size DIMMs are installed, the slot number with the largest
3920 # size DIMM is mapped to the lowest address range.
3921 $devname="Flapjack-lite" if ($ultra eq "Netra X1");
3922 $devname="Flapjack-liteCD500" if ($ultra eq "Sun Fire V100");
3923 $familypn="N19";
3924 $untested=0;
3925 $simmrangex=($cpufreq > 520) ? "00000400" : "00000200";
3926 $simmbanks=4;
3927 $simmsperbank=1;
3928 @simmsizes=(128,256,512);
3929 @socketstr=("DIMM0".."DIMM3");
3930}
3931if ($ultra eq "Netra T1 200" || $ultra eq "Sun Fire V120" || $ultra eq "Netra 120") {
3932 # Netra T1 200, Sun Fire V120, Netra 120, UltraAX-i2
3933 # Accepts up to 4 256MB, 512MB or 1GB PC133 DIMMs for 4GB maximum
3934 # Sun Fire V120 is 550MHz or 650MHz
3935 # Netra 120 is same platform as Sun Fire V120, but is 650MHz only
3936 # Memory is SDRAM PC133 CL=3 ECC registered
3937 # The minimum memory requirement is one DIMM in Slot 0
3938 # The memory installation sequence is Slot 0, 1, 2, 3
3939 # Each DIMM slot addresses 512MB of memory with 500MHz UltraSPARC IIe
3940 # Each DIMM slot addresses 1GB of memory with >= 550MHz UltraSPARC IIe
3941 # When equal size DIMMs are installed, the lowest slot number is
3942 # mapped to the lowest address range.
3943 # When mixed size DIMMs are installed, the slot number with the largest
3944 # size DIMM is mapped to the lowest address range.
3945 if ($ultra eq "Netra T1 200") {
3946 $devname="Flapjack2";
3947 $familypn="N21";
3948 }
3949 if ($ultra eq "Sun Fire V120" || $ultra eq "Netra 120") {
3950 $devname="Flapjack2+";
3951 $familypn="N25";
3952 }
3953 $untested=0;
3954 $simmrangex=($cpufreq > 520) ? "00000400" : "00000200";
3955 $simmbanks=4;
3956 $simmsperbank=1;
3957 @simmsizes=(256,512,1024);
3958 @socketstr=("DIMM0".."DIMM3");
3959}
3960if ($banner =~ /\bCP2000\b/ || $ultra =~ /^CP2[01]\d0$/) {
3961 # Netra CP2000/CP2100 Series CompactPCI Boards (UltraSPARC-IIe)
3962 # CP2040 (SUNW,UltraSPARC-IIe-NetraCT-40) supports 256MB, 512MB, and 1GB
3963 # CP2060 (SUNW,UltraSPARC-IIe-NetraCT-60) has non-expandable 512MB
3964 # CP2080 (SUNW,UltraSPARCengine_CP-80) supports 256MB, 512MB, and 1GB
3965 # CP2140 (SUNW,UltraSPARCengine_CP-40) supports 512MB, 1GB and 2GB
3966 # CP2160 (SUNW,UltraSPARCengine_CP-60) supports 1GB and 2GB
3967 # 256MB Single-Wide module 375-3024
3968 # 512MB Single-Wide module 375-3025
3969 # 1GB Double-Wide module 375-3026
3970 # 1GB Single-Wide module 375-3125
3971 # 2GB Double-Wide module 375-3114
3972 # Max number of stacked memory boards is two
3973 # Install double wide memory first, then single wide memory
3974 $devname="Othello" if ($ultra eq "CP2040");
3975 $devname="Sputnik Bluesky" if ($ultra eq "CP2060");
3976 $devname="Sputnik Orion" if ($ultra eq "CP2080");
3977 $devname="Othello+" if ($ultra eq "CP2140");
3978 $devname="Sputnik+" if ($ultra eq "CP2160");
3979 $untested=1;
3980 $untested=0 if ($ultra eq "CP2140");
3981 if ($ultra eq "CP2060") {
3982 $memtype="embedded memory";
3983 $sockettype="";
3984 $simmrangex="00001000";
3985 $simmbanks=1;
3986 $simmsperbank=1;
3987 @simmsizes=(512);
3988 } else {
3989 $memtype="memory card";
3990 $sockettype="";
3991 $simmrangex="00001000";
3992 $simmbanks=2;
3993 $simmsperbank=1;
3994 if ($ultra eq "CP2140") {
3995 @simmsizes=(512,1024,2048);
3996 } elsif ($ultra eq "CP2160") {
3997 @simmsizes=(1024,2048);
3998 } else {
3999 @simmsizes=(256,512,1024);
4000 }
4001 @socketstr=("base mezzanine board","additional mezzanine board");
4002 @orderstr=("lower board","upper board");
4003 $sortslots=0;
4004 }
4005}
4006
4007#
4008# Clones: most do not have verbose output since I don't have any socket data
4009# on them
4010#
4011if ($ultra eq "axus250" || $modelmore =~ /Ultra-250/) {
4012 # AXUS Microsystems, Inc. http://www.axus.com.tw
4013 # AXUS 250 clone
4014 # accepts up to 128MB DIMMs on motherboard
4015 $untested=0;
4016 $simmrangex="00000200";
4017 $simmbanks=4;
4018 $simmsperbank=4;
4019 @simmsizes=(8,16,32,64,128);
4020 @socketstr=("U0501","U0601","U0701","U0801","U0502","U0602","U0702","U0802","U0503","U0603","U0703","U0803","U0504","U0604","U0704","U0804");
4021 @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
4022}
4023if ($model =~ /SPARC CPU-/ || $model =~ /SPARC CPCI-/) {
4024 # Force Computers, http://www.forcecomputers.com
4025 # model format: "SPARC CPU-5V/64-110-X" for 64MB w/ 110MHz CPU
4026 $untested=1;
4027 $untested=0 if ($model =~ /SPARC CPU-/);
4028 if ($model =~ /\/${installed_memory}-/) {
4029 $totmem=$installed_memory;
4030 push(@simmsizesfound, "$totmem");
4031 $buffer="motherboard contains ${totmem}MB on-board memory\n";
4032 &finish;
4033 }
4034}
4035if ($model =~ /Axil/) {
4036 # RAVE Computer Association, http://rave.com
4037 $untested=1;
4038 $untested=0 if ($model =~ /Axil-245/);
4039 $untested=0 if ($model =~ /Axil-255/);
4040 $untested=0 if ($model =~ /Axil-311/);
4041 $untested=0 if ($model =~ /Axil-320/);
4042}
4043if ($manufacturer =~ /Tadpole/) {
4044 # Tadpole RDI, http://www.tadpole.com
4045 $untested=1;
4046 $untested=0 if ($banner =~ /Tadpole S3/);
4047 $untested=0 if ($model =~ /PowerLite-170/);
4048 $untested=0 if ($banner =~ /\bVoyagerIIi\b/);
4049 $untested=0 if ($banner =~ /\bCycleQUAD\b/);
4050 if ($ultra eq "UP-20") {
4051 # Cycle UP-20 to upgrade SPARCstation 5/20 motherboards
4052 # Accepts 16MB, 32MB and 64MB SIMMs from SPARCstation 20
4053 # Install SIMMs in pairs to form each bank
4054 $untested=1;
4055 $simmrangex="00000040";
4056 $simmbanks=4;
4057 $simmsperbank=2;
4058 @simmsizes=(16,32,64);
4059 @bankstr=(0,0,1,1,2,2,3,3);
4060 }
4061 if ($ultra eq "UP-520IIi") {
4062 # Cycle UP-520-IIi to upgrade SPARCstation 5/20 motherboards
4063 # Accepts 8MB, 16MB, 32MB, 64MB, 128MB and 256MB DIMMs
4064 $untested=0;
4065 $simmrangex="00000200";
4066 $simmbanks=4;
4067 $simmsperbank=2;
4068 @simmsizes=(8,16,32,64,128,256);
4069 @socketstr=("J301".."J304");
4070 @bankstr=(0,0,1,1);
4071 }
4072 if ($banner =~ /\bSPARCLE\b/) {
4073 # UltraSPARC-IIe at 440MHz, 500MHz, or 650MHz
4074 # 256MB - 2GB ECC SDRAM, two slots, PC-133, 144-pin SO-DIMMs
4075 $untested=0;
4076 $simmbanks=2;
4077 $simmsperbank=1;
4078 @simmsizes=(128,256,512,1024);
4079 @socketstr=("DIMM0","DIMM1");
4080 $memtype="SO-DIMM";
4081 }
4082}
4083if ($manufacturer eq "Auspex") {
4084 # Auspex Netserver, http://www.auspex.com
4085 $memtype="Memory Module";
4086 $untested=1;
4087 $untested=0 if ($model eq "SPARC Processor");
4088 if ($osrel =~ /^5./) {
4089 $untested=1; # Untested with Solaris 2.X
4090 $untested_type="OS";
4091 }
4092}
4093if ($manufacturer =~ /Fujitsu/) {
4094 # Hal Computer Systems, a Fujitsu Company, http://www.hal.com
4095 # Fujitsu Siemens, http://www.fujitsu-siemens.com
4096 $untested=1;
4097 $untested=0 if ($model =~ /S-4\/10H/ || $model =~ /S-4\/20[ABLH]/);
4098 if ($banner =~ /GP7000\b/ || $banner =~ /GP7000F\b/) {
4099 $untested=0;
4100 if ($slotname0 =~ /SLOT[0-9]/) {
4101 # M200
4102 # Up to 4GB of memory
4103 # System board has 16 DIMM slots, #00 - #15
4104 # Banks - 0,0,1,1,2,2,2,2,3,3,3,3,4,4,4,4
4105 # First Modules installed in Bank 0, slots 0-1
4106 # Second Modules Installed in Bank 1, slots 2-3
4107 # Modules in Bank 0 and 1 must be same size
4108 # Subsequent memory expansion installed in sets of four
4109 # modules in Bank 2 - 4 (Slots 4-7, 8-11, 12-15)
4110 @socketstr=("SLOT0".."SLOT9","SLOT10".."SLOT15");
4111 }
4112 if ($slotname0 =~ /SLOT[AB][0-9]/) {
4113 # M400 and M600
4114 # Up to 4GB of memory
4115 # System board has 32 DIMM slots, #00 - #15 Group A & B
4116 # Banks - 0,0,1,1,2,2,2,2,3,3,3,3,4,4,4,4
4117 # First Modules installed in Bank 0 Group A, slots 0-1
4118 # Second Modules installed in Bank 0 Group B, slots 0-1
4119 # Modules in Group A and B must be same size
4120 # Next memory expansion installs in Bank 1 Group A & B,
4121 # slots 2-3 using modules of same size as Bank 0
4122 # Subsequent memory expansion installed in sets of eight
4123 # modules in Bank 2 - 4 (Slots 4-7, 8-11, 12-15) in
4124 # both Group A and B
4125 @socketstr=("SLOTA0".."SLOTA9","SLOTA10".."SLOTA15","SLOTB0".."SLOTB9","SLOTB10".."SLOTB15");
4126 }
4127 }
4128 if ($banner =~ /PRIMEPOWER *100N?\b/) {
4129 # PRIMEPOWER100N, 1U rack mount
4130 # Up to 2GB of memory
4131 # 4 memory module slots
4132 # 100MHz SDRAM ECC
4133 # Mount memory modules in order from memory module slot 0
4134 $untested=1;
4135 }
4136 if ($banner =~ /PRIMEPOWER *[246]00\b/) {
4137 # Up to 8GB of memory
4138 # Each system board has 16 DIMM slots, #00 - #15
4139 # Four banks of 4 (0-3,4-7,8-11,12-15)
4140 # PrimePower 200 and 400 use 1 system board
4141 # PrimePower 600 uses 2 system boards (00, 01)
4142 $untested=0;
4143 foreach $brd ("00","01") {
4144 if ($gotcpuboards =~ /\b$brd\b/) {
4145 if ($gotmodulenames =~ /${brd}-SLOT[0-9]/) {
4146 foreach $i (0..15) {
4147 push(@socketstr, ("${brd}-SLOT$i"));
4148 }
4149 }
4150 }
4151 }
4152 }
4153 if ($banner =~ /PRIMEPOWER *800\b/ || $banner =~ /PRIMEPOWER *1000\b/ || $banner =~ /PRIMEPOWER *2000\b/) {
4154 # 1-4 SPARC64 GP CPUs / system board
4155 # PrimePower 800 can have 4 system boards per system
4156 # PrimePower 1000 can have 8 system boards per system
4157 # PrimePower 2000 can have 32 system boards per system
4158 # Minimum Memory: 1GB / system board, 2GB / system
4159 # Maximum Memory: 8GB / system board, 32GB / system
4160 # 32 or 16 memory modules per system board, installed in quads
4161 $untested=0;
4162 @simmsizes=(128,256,512);
4163 foreach $brd ("00".."77") {
4164 if ($gotcpuboards =~ /\b$brd\b/) {
4165 if ($gotmodulenames =~ /${brd}-SLOT#[AB][0-9]/) {
4166 foreach $j ("A","B") {
4167 foreach $i ("00".."03","10".."13","20".."23","30".."33") {
4168 push(@socketstr, ("${brd}-SLOT#$j$i"));
4169 }
4170 }
4171 }
4172 }
4173 }
4174 }
4175 if ($banner =~ /PRIMEPOWER *250\b/) {
4176 # Pedestal, 2U or 4U rack mount
4177 # 1-2 SPARC64 V processors at 1.1GHz, 1.32GHz, 1.87GHz
4178 # 1GB-16GB DDR-SDRAM memory with ECC, 2-way, 8 DIMM slots
4179 $untested=0;
4180 @simmsizes=(256,512,1024,2048);
4181 foreach $i ("00".."07") {
4182 push(@socketstr, ("SLOT#$i"));
4183 }
4184 }
4185 if ($banner =~ /PRIMEPOWER *450\b/) {
4186 # Pedestal, 4U or 7U rack mount
4187 # 1-4 SPARC64 V processors at 1.1GHz, 1.32GHz, 1.87GHz
4188 # 1GB-32GB DDR-SDRAM memory with ECC, 4-way, 16 DIMM slots
4189 $untested=0;
4190 @simmsizes=(256,512,1024,2048);
4191 foreach $i ("00".."15") {
4192 push(@socketstr, ("SLOT#$i"));
4193 }
4194 }
4195 if ($banner =~ /PRIMEPOWER *[68]50\b/) {
4196 # PrimePower 650: 2-8 SPARC64 V processors at 1.1GHz or faster
4197 # 2GB-64GB memory, 8-way, 1 system board, 8U rack mount
4198 # PrimePower 850: 4-16 SPARC64 V processors at 1.1GHz or faster
4199 # 2GB-128GB memory, 16-way, 2 system boards, 16U rack mount
4200 # Uses DDR SDRAM ECC memory in 256MB, 512MB and 1GB sizes
4201 # Each system board has 32 memory module slots, layed out
4202 # with 4 DIMMs on 8 DIMM riser cards.
4203 $untested=0;
4204 @simmsizes=(256,512,1024,2048);
4205 foreach $brd ("C0S00","C0S01") {
4206 if ($gotcpuboards =~ /\b$brd\b/) {
4207 if ($gotmodulenames =~ /${brd}-SLOT#[A-D][0-9]/) {
4208 foreach $j ("A".."D") {
4209 foreach $i ("00".."07") {
4210 push(@socketstr, ("${brd}-SLOT#$j$i"));
4211 }
4212 }
4213 }
4214 }
4215 }
4216 }
4217 if ($banner =~ /PRIMEPOWER *HPC2500\b/ || $banner =~ /PRIMEPOWER *900\b/ || $banner =~ /PRIMEPOWER *[12]500\b/) {
4218 # SPARC64 V CPUs at 1.3GHz or 1.89GHz
4219 # PRIMEPOWER HPC2500 / 2500
4220 # 2-8 CPUs / system board, 64-128 / system
4221 # Up to 16 8-way system boards / system
4222 # Up to 1024GB DDR-SDRAM memory with ECC, 128-way
4223 # Minimum Memory: 4GB / system board, 4GB / system
4224 # Maximum Memory: 64GB / system board, 1024GB / system
4225 # PRIMEPOWER 900
4226 # 17U rack mount
4227 # 1-8 CPUs / system board, 1-16 / system
4228 # Up to 2 8-way system boards / system
4229 # Up to 128GB DDR-SDRAM memory with ECC, 8-way
4230 # Minimum Memory: 2GB / system board, 2GB / system
4231 # Maximum Memory: 64GB / system board, 128GB / system
4232 # PRIMEPOWER 1500
4233 # 1-8 CPUs / system board, 1-32 / system
4234 # Up to 4 8-way system boards / system
4235 # Up to 256GB DDR-SDRAM memory with ECC, 8-way
4236 # Minimum Memory: 2GB / system board, 2GB / system
4237 # Maximum Memory: 64GB / system board, 256GB / system
4238 $untested=0;
4239 @simmsizes=(256,512,1024,2048);
4240 foreach $cab ("C0S","C1S") {
4241 foreach $brd ("00".."07") {
4242 if ($gotcpuboards =~ /\b$cab$brd\b/) {
4243 foreach $j ("A","B") {
4244 foreach $i ("00".."15") {
4245 push(@socketstr, ("$cab${brd}-SLOT#$j$i"));
4246 }
4247 }
4248 }
4249 }
4250 }
4251 }
4252}
4253if ($model =~ /COMPstation.10/) {
4254 # Tatung Science and Technology, http://www.tsti.com
4255 # Accepts 16MB and 64MB SIMMs on motherboard
4256 # Bank 0 must be filled first
4257 # Layout is like SPARCstation-10, but I don't know if it can accept
4258 # 32MB SIMMs or NVSIMMs
4259 $untested=0;
4260 $simmrangex="00000040";
4261 $simmbanks=8;
4262 $simmsperbank=1;
4263 @simmsizes=(16,64);
4264 @socketstr=("J0201","J0203","J0302","J0304","J0202","J0301","J0303","J0305");
4265 @bankstr=(0,2,4,6,1,3,5,7);
4266}
4267if ($model =~ /COMPstation-20A\b/) {
4268 # Tatung Science and Technology, http://www.tsti.com
4269 # Accepts 16MB, 32MB and 64MB SIMMs on motherboard
4270 $untested=1;
4271 $simmrangex="00000040";
4272 $simmbanks=8;
4273 $simmsperbank=1;
4274 @simmsizes=(16,32,64);
4275 @socketstr=("J0201","J0304","J0203","J0302","J0303","J0301","J0305","J0202");
4276 @orderstr=("1st","2nd","3rd","4th","5th","6th","7th","8th");
4277 @bankstr=(1..8);
4278}
4279if ($model =~ /COMPstation-20AL/) {
4280 # Tatung Science and Technology, http://www.tsti.com
4281 # Accepts 16MB, 32MB and 64MB SIMMs on motherboard
4282 $untested=0;
4283 $simmrangex="00000040";
4284 $simmbanks=8;
4285 $simmsperbank=1;
4286 @simmsizes=(16,32,64);
4287 @socketstr=("J0201","J0203","J0302","J0304","J0202","J0301","J0303","J0305");
4288 @orderstr=("1st","2nd","3rd","4th","5th","6th","7th","8th");
4289 @bankstr=(0..7);
4290}
4291if ($banner =~ /COMPstation_U60_Series/ || $banner =~ /COMPstation_U80D_Series/) {
4292 # Tatung Science and Technology, http://www.tsti.com
4293 # Accepts 16MB, 32MB, 64MB, 128MB or 256MB DIMMs on motherboard
4294 # 4 banks with 4 DIMMs per bank
4295 $untested=0;
4296 if ($banner =~ /COMPstation_U60_Series/) {
4297 $simmrangex="00000200"; # use "00000400" with 256MB DIMMs
4298 $simmbanks=6; # Count the skipped address range
4299 } else {
4300 $simmrangex="00000400";
4301 $simmbanks=4;
4302 }
4303 $simmsperbank=4;
4304 @simmsizes=(16,32,64,128,256);
4305}
4306if ($model =~ /\bVoyagerIIi\b/) {
4307 # Tadpole Voyager IIi has 8 DIMM slots, but otherwise appears
4308 # to look like an Ultra 5. It allows 256MB to 1GB of memory.
4309 $untested=0;
4310 $simmrangex="00000100";
4311 $simmbanks=4;
4312 $simmsperbank=2;
4313 @simmsizes=(16,32,64,128);
4314 @socketstr=("DIMM1","DIMM2","DIMM5","DIMM6","DIMM3","DIMM4","DIMM7","DIMM8");
4315 $sortslots=1;
4316}
4317
4318#
4319# systems below may have memory information available in prtdiag output
4320#
4321if ($model eq "SPARCserver-1000" || $model eq "SPARCcenter-2000") {
4322 $devname="Scorpion" if ($model eq "SPARCserver-1000");
4323 $devname="Scorpion+" if ($banner =~ "1000E");
4324 $devname="Dragon" if ($model eq "SPARCcenter-2000");
4325 $devname="Dragon+" if ($banner =~ "2000E");
4326 # Accepts 8MB and 32MB SIMMs on motherboard
4327 $untested=0;
4328 @simmsizes=(8,32);
4329 $prtdiag_has_mem=1;
4330 &check_prtdiag;
4331 if ($boardfound_mem) {
4332 foreach $line (@boards_mem) {
4333 if ($line =~ /Board/) {
4334 $boardslot_mem=substr($line,5,1);
4335 $simmsize=int substr($line,46,3) / 4;
4336 if ($simmsize == 0) {
4337 &found_empty_bank("Group 0");
4338 } elsif ($simmsize == 1) {
4339 &found_nvsimm_bank("Group 0");
4340 } else {
4341 push(@simmsizesfound, "$simmsize");
4342 }
4343 $simmsize=int substr($line,54,3) / 4;
4344 if ($simmsize == 0) {
4345 &found_empty_bank("Group 1");
4346 } elsif ($simmsize == 1) {
4347 &found_nvsimm_bank("Group 1");
4348 } else {
4349 push(@simmsizesfound, "$simmsize");
4350 }
4351 $simmsize=int substr($line,62,3) / 4;
4352 if ($simmsize == 0) {
4353 &found_empty_bank("Group 2");
4354 } elsif ($simmsize == 1) {
4355 &found_nvsimm_bank("Group 2");
4356 } else {
4357 push(@simmsizesfound, "$simmsize");
4358 }
4359 $simmsize=int substr($line,70,3) / 4;
4360 if ($simmsize == 0) {
4361 &found_empty_bank("Group 3");
4362 } elsif ($simmsize == 1) {
4363 &found_nvsimm_bank("Group 3");
4364 } else {
4365 push(@simmsizesfound, "$simmsize");
4366 }
4367 }
4368 }
4369 &show_header;
4370 print @boards_mem;
4371 print "Each memory unit group is comprised of 4 SIMMs\n";
4372 $empty_banks=" None" if ($empty_banks eq "");
4373 print "empty memory groups:$empty_banks\n";
4374 } else {
4375 &show_header;
4376 $recognized=0;
4377 }
4378 $totmem=$installed_memory;
4379 &finish;
4380 exit;
4381}
4382if ($model eq "Ultra-4" || $ultra eq 450 || $model eq "Ultra-4FT" || $ultra eq "Netra ft1800") {
4383 # Accepts 32MB, 64MB, 128MB or 256MB DIMMs on motherboard
4384 # 16MB DIMMs are not supported and may cause correctable ECC errors
4385 # 501-2622 (32MB), 501-2480 or 501-5691 (64MB), 501-3136 (128MB),
4386 # 501-4743 or 501-5896 (256MB)
4387 # 200-pin 60ns Fast Page Mode ECC
4388 # Netra ft1800 is based on Ultra 450
4389 $devname="Tazmo (Tazmax/Tazmin)";
4390 $familypn="A20, A25";
4391 $familypn="N05" if ($model eq "Ultra-4FT" || $ultra eq "Netra ft1800");
4392 $untested=0;
4393 $simmrangex="00000400";
4394 $simmbanks=4;
4395 $simmsperbank=4;
4396 @simmsizes=(16,32,64,128,256);
4397 @socketstr=("U1901".."U1904","U1801".."U1804","U1701".."U1704","U1601".."U1604");
4398 @groupstr=("A","A","A","A","B","B","B","B","C","C","C","C","D","D","D","D");
4399 @bankstr=(2,2,2,2,3,3,3,3,0,0,0,0,1,1,1,1);
4400}
4401if ($model eq "Ultra-250" || $ultra eq 250) {
4402 # Accepts 16MB, 32MB, 64MB, or 128MB DIMMs on motherboard
4403 # 501-2479 (16MB), 501-2622 (32MB), 501-2480 or 501-5691 (64MB),
4404 # 501-3136 (128MB)
4405 # 200-pin 60ns Fast Page Mode ECC
4406 $devname="Javelin";
4407 $familypn="A26";
4408 $untested=0;
4409 $simmrangex="00000200";
4410 $simmbanks=4;
4411 $simmsperbank=4;
4412 @simmsizes=(16,32,64,128);
4413 @socketstr=("U0701","U0801","U0901","U1001","U0702","U0802","U0902","U1002","U0703","U0803","U0903","U1003","U0704","U0804","U0904","U1004");
4414 @bankstr=("A","A","A","A","B","B","B","B","C","C","C","C","D","D","D","D");
4415}
4416if ($model eq "Ultra-80" || $ultra eq 80 || $ultra eq "420R" || $ultra eq "Netra t140x") {
4417 # Accepts 64MB or 256MB DIMMs
4418 # 501-5691 (64MB), 501-4743 501-5936 501-6005 501-6056 (256MB)
4419 # 200-pin 60ns 5V Fast Page Mode ECC, 576 bits data width
4420 # 64MB DIMMs same as in Ultra-60, 256MB DIMMs same as in Enterprise-450
4421 # U0403,U0404,U1403,U1404 bank 3 address 0xc0000000-0xffffffff
4422 # U0303,U0304,U1303,U1304 bank 2 address 0x80000000-0xbfffffff
4423 # U0401,U0402,U1401,U1402 bank 1 address 0x40000000-0x7fffffff
4424 # U0301,U0302,U1301,U1302 bank 0 address 0x00000000-0x3fffffff
4425 # The minimum requirement is four DIMMs in any bank. The recommended
4426 # installation sequence is Bank 0,2,1,3. DIMMs are required on both the
4427 # Riser Board (U0[34]0?) and the System Board (U1[34]0?). Two-way and
4428 # four-way memory bank interleaving is supported. Memory is 2-way
4429 # interleaved when the same size DIMMs are installed in Banks 0 and 1.
4430 # Memory is 4-way interleaved when the same size DIMMs are installed in
4431 # Banks 0, 1, 2 and 3.
4432 #
4433 # prtconf does not reliably show the size of DIMMs in each slot when
4434 # 1GB of total memory is installed. It shows this:
4435 # reg: 00000000.00000000.00000000.40000000
4436 # A system with 1GB is reported as having 4 256MB DIMMs, but may be
4437 # using 16 64MB DIMMs in a 4-way interleave.
4438 # This is an issue that Sun could fix in the OBP.
4439 # It is broken with OBP 3.33.0 2003/10/07 (patch 109082-06) and older.
4440 # prtfru (Solaris 8 and later) also does not work.
4441 #
4442 # Sun shipped U80 1GB configurations w/ 4x256MB DIMMs
4443 # Sun shipped U80 256MB configurations w/ 4x64MB DIMMs
4444 # Sun shipped E420R with 501-5936 256MB DIMMs
4445 # 64MB DIMM 501-2480 and 128MB DIMM 501-3136 are not supported.
4446 # 16MB and 32MB DIMMs are not sold for the Ultra 80.
4447 #
4448 $devname="Quasar (U80), Quahog (420R), Lightweight 3 (Netra t140x)";
4449 $familypn="A27 (U80), A33 (420R), N14 (Netra t1405), N15 (Netra t1400)";
4450 if ($ultra eq 80) {
4451 $devname="Quasar";
4452 $familypn="A27";
4453 }
4454 if ($ultra eq "420R") {
4455 $devname="Quahog";
4456 $familypn="A33";
4457 }
4458 if ($ultra eq "Netra t140x") {
4459 $devname="Lightweight 3";
4460 $familypn="N14 (Netra t1405), N15 (Netra t1400)";
4461 }
4462 $untested=0;
4463 $simmrangex="00000400";
4464 $simmbanks=4;
4465 $simmsperbank=4;
4466 @simmsizes=(64,256); # Sun only supports 64MB and 256MB DIMMs
4467 @socketstr=("U0301","U0302","U1301","U1302","U0401","U0402","U1401","U1402","U0303","U0304","U1303","U1304","U0403","U0404","U1403","U1404");
4468 @bankstr=(0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3);
4469}
4470if ($ultra eq "Sun Blade 1000" || $ultra eq "Sun Blade 2000" || $ultra eq "Sun Fire 280R" || $ultra eq "Netra 20") {
4471 # Accepts up to 8 128MB, 256MB, 512MB, 1GB or 2GB DIMMs installed in
4472 # groups of four DIMMs per bank on motherboard
4473 # Uses 232-pin 3.3V ECC 7ns SDRAM
4474 # J0407 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff
4475 # J0406 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff
4476 # J0305 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff
4477 # J0304 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff
4478 # J0203 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff
4479 # J0202 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff
4480 # J0101 Group 1 Bank 1/3 address 0x0fa000000 - 0x1f3ffffff
4481 # J0100 Group 0 Bank 0/2 address 0x000000000 - 0x0f9ffffff
4482 # The minimum memory requirement is four DIMMs in any Group
4483 # DIMMs can be installed in any group order
4484 # Each group addresses 4GB of memory
4485 # Memory slots (Jxxxx) map to same-numbered DIMMs (Uxxxx)
4486 # For maximum 4-way interleaving, install 8 DIMMs of identical sizes
4487 $devname="Excalibur (Sun Blade 1000), Littleneck (Sun Fire 280R), Lightweight 2+ (Netra 20/Netra T4), Sun Blade 2000 (Sun Blade 2000)";
4488 $familypn="A28 (Sun Blade 1000), A35 (Sun Fire 280R), N28 (Netra 20/Netra T4), A29 (Sun Blade 2000)";
4489 if ($ultra eq "Sun Blade 1000") {
4490 $devname="Excalibur (Sun Blade 1000), Sun Blade 2000 (Sun Blade 2000)";
4491 $familypn="A28 (Sun Blade 1000), A29 (Sun Blade 2000)";
4492 }
4493 if ($ultra eq "Sun Fire 280R") {
4494 $devname="Littleneck";
4495 $familypn="A35";
4496 }
4497 if ($ultra eq "Netra 20") {
4498 $devname="Lightweight 2+";
4499 $familypn="N28";
4500 }
4501 if ($ultra eq "Sun Blade 2000") {
4502 $devname="Sun Blade 2000";
4503 $familypn="A29";
4504 }
4505 $untested=0;
4506 # SB1000/2000 uses 501-4143, 501-5938, 501-6230 or 501-6560 motherboards
4507 # SB1000 can use 600, 750 and 900MHz UltraSPARC-III CPUs
4508 # SB1000 can use 900MHz and faster UltraSPARC-III+ Cu CPUs
4509 # SB2000 only shipped with 900MHz and faster UltraSPARC-III+ Cu CPUs
4510 # SB2000 can use any of the SB1000 motherboards
4511 if ($ultra eq "Sun Blade 1000") {
4512 $modelmore=$banner;
4513 $modelmore=~s/Sun-Blade-1000/or Sun-Blade-2000/g;
4514 while (($cf,$cnt)=each(%cpucnt)) {
4515 $cf=~/^(.*) (\d*)$/;
4516 $cfreq=$2;
4517 $modelmore=~s/\)/ ${cfreq}MHz\)/g if ($cfreq);
4518 }
4519 }
4520 $prtdiag_has_mem=1;
4521 $simmrangex="00001000";
4522 $simmbanks=2;
4523 $simmsperbank=4;
4524 @simmsizes=(128,256,512,1024,2048);
4525 @socketstr=("J0100","J0202","J0304","J0406","J0101","J0203","J0305","J0407");
4526 @bankstr=(0,0,0,0,1,1,1,1);
4527}
4528if ($model eq "Sun-Blade-100" || $ultra eq "Sun Blade 100" || $ultra eq "Sun Blade 150") {
4529 # Accepts 128MB, 256MB or 512MB DIMMs on motherboard
4530 # Uses 168-pin 3.3V ECC PC133 CL=3 SDRAM
4531 # U5 DIMM3 address 0x60000000 - 0x7fffffff or 0xc0000000 - 0xffffffff
4532 # U4 DIMM2 address 0x40000000 - 0x5fffffff or 0x80000000 - 0xbfffffff
4533 # U3 DIMM1 address 0x20000000 - 0x3fffffff or 0x40000000 - 0x7fffffff
4534 # U2 DIMM0 address 0x00000000 - 0x1fffffff or 0x00000000 - 0x3fffffff
4535 # The minimum memory requirement is one DIMM in U2
4536 # The memory installation sequence is U2, U3, U4, U5
4537 # Each bank addresses 512MB of memory with 500MHz UltraSPARC
4538 # Each bank addresses 1GB of memory with >= 550MHz UltraSPARC
4539 if ($model eq "Sun-Blade-100" || $ultra eq "Sun Blade 100") {
4540 $devname="Grover";
4541 $familypn="A36";
4542 }
4543 if ($ultra eq "Sun Blade 150") {
4544 $devname="Grover+";
4545 $familypn="A41";
4546 }
4547 $untested=0;
4548 $prtdiag_has_mem=1;
4549 $simmrangex=($cpufreq > 520) ? "00000400" : "00000200";
4550 $simmbanks=4;
4551 $simmsperbank=1;
4552 @simmsizes=(128,256,512);
4553 @socketstr=("DIMM0".."DIMM3");
4554 @bankstr=(0..3);
4555}
4556if ($ultra eq "Sun Fire" || $ultra eq "Sun Fire 15K" || $ultra eq "Sun Fire 12K" || $ultra =~ /Sun Fire [346]8[01]0\b/ || $ultra =~ /Sun Fire E[246]900\b/ || $ultra =~ /Sun Fire E2[05]K\b/) {
4557 # Sun Fire 3800 system
4558 # 2-8 UltraSPARC-III processors
4559 # Up to 2 CPU/Memory boards
4560 # Sun Fire 4800, 4810 and 6800 system
4561 # 2-12 UltraSPARC-III processors
4562 # Up to 3 CPU/Memory boards
4563 # Sun Fire 6800 system
4564 # 2-24 UltraSPARC-III processors
4565 # Up to 6 CPU/Memory boards
4566 # Sun Fire 15K system
4567 # 16-106 UltraSPARC-III+, IV or IV+ processors
4568 # Up to 18 CPU/Memory boards
4569 # Sun Fire 12K system
4570 # up to 56 UltraSPARC-III+, IV or IV+ processors and 288GB memory
4571 # Sun Fire E2900 & E4900 system
4572 # 4, 8, or 12 UltraSPARC-IV or IV+ processors, up to 3 Uniboards
4573 # E4900 adds dynamic system domains when compared to E2900
4574 # Sun Fire E6900 system
4575 # 4-24 UltraSPARC-IV or IV+ processors, up to 6 Uniboards
4576 # Sun Fire E20K system
4577 # 4-36 UltraSPARC-IV or IV+ processors, up to 9 Uniboards
4578 # Sun Fire E25K system
4579 # Up to 72 UltraSPARC-IV or IV+ processors, up to 18 Uniboards
4580 # Each CPU/Memory board holds up to 4 processors and up to 32GB memory
4581 # (32 DIMMs per board, 8 banks of 4 DIMMs)
4582 # Accepts 256MB, 512MB or 1GB DIMMs
4583 # 1GB DIMM not supported at 750MHz
4584 # 256MB DIMM only supported on US-III
4585 # 2GB DIMMs supported on 48x0/6800/E2900/E4900/E6900/E20K/E25K
4586 # System Board slots are labeled SB0 and higher
4587 # A populated DIMM bank requires an UltraSPARC CPU.
4588 # DIMMs are 232-pin 3.3V ECC 7ns SDRAM
4589 # prtdiag output shows the memory installed.
4590 #
4591 # CPU1 and CPU0 Memory CPU3 and CPU2 Memory
4592 # -------------------- --------------------
4593 # Socket CPU Bank DIMM Socket CPU Bank DIMM
4594 # ------ --- ---- ---- ------ --- ---- ----
4595 # J14600 P1 B0 D3 J16600 P3 B0 D3
4596 # J14601 P1 B1 D3 J16601 P3 B1 D3
4597 # J14500 P1 B0 D2 J16500 P3 B0 D2
4598 # J14501 P1 B1 D2 J16501 P3 B1 D2
4599 # J14400 P1 B0 D1 J16400 P3 B0 D1
4600 # J14401 P1 B1 D1 J16401 P3 B1 D1
4601 # J14300 P1 B0 D0 J16300 P3 B0 D0
4602 # J14301 P1 B1 D0 J16301 P3 B1 D0
4603 # J13600 P0 B0 D3 J15600 P2 B0 D3
4604 # J13601 P0 B1 D3 J15601 P2 B1 D3
4605 # J13500 P0 B0 D2 J15500 P2 B0 D2
4606 # J13501 P0 B1 D2 J15501 P2 B1 D2
4607 # J13400 P0 B0 D1 J15400 P2 B0 D1
4608 # J13401 P0 B1 D1 J15401 P2 B1 D1
4609 # J13300 P0 B0 D0 J15300 P2 B0 D0
4610 # J13301 P0 B1 D0 J15301 P2 B1 D0
4611 #
4612 $devname="Serengeti" if ($ultra eq "Sun Fire");
4613 if ($banner =~ /Sun Fire 3800\b/ || $diagbanner =~ /Sun Fire 3800\b/) {
4614 $devname="Serengeti8, SF3800 or SP";
4615 $familypn="F3800";
4616 }
4617 if ($banner =~ /Sun Fire 4800\b/ || $diagbanner =~ /Sun Fire 4800\b/) {
4618 $devname="Serengeti12, SF4800 or MD";
4619 $familypn="F4800";
4620 }
4621 if ($banner =~ /Sun Fire 4810\b/ || $diagbanner =~ /Sun Fire 4810\b/) {
4622 $devname="Serengeti12i, SF4810 or ME";
4623 $familypn="F4810";
4624 }
4625 if ($banner =~ /Sun Fire 6800\b/ || $diagbanner =~ /Sun Fire 6800\b/) {
4626 $devname="Serengeti24, SF6800 or DC";
4627 $familypn="F6800";
4628 }
4629 if ($ultra eq "Sun Fire 15K") {
4630 $devname="Starcat, Serengeti72";
4631 $familypn="F15K";
4632 }
4633 $devname="Starkitty" if ($ultra eq "Sun Fire 12K");
4634 if ($banner =~ /Sun Fire E2900\b/ || $diagbanner eq "Sun Fire E2900") {
4635 $devname="Amazon 2";
4636 $familypn="E29";
4637 }
4638 if ($banner =~ /Sun Fire E4900\b/ || $diagbanner eq "Sun Fire E4900") {
4639 $devname="Amazon 4";
4640 $familypn="E49";
4641 }
4642 $devname="Amazon 6" if ($banner =~ /Sun Fire E6900\b/ || $diagbanner eq "Sun Fire E6900");
4643 $devname="Amazon 20" if ($banner =~ /Sun Fire E20K\b/ || $diagbanner eq "Sun Fire E20K");
4644 $devname="Amazon 25" if ($banner =~ /Sun Fire E25K\b/ || $diagbanner eq "Sun Fire E25K");
4645 $untested=0;
4646 $prtdiag_has_mem=1;
4647 @simmsizes=(256,512,1024);
4648 @simmsizes=(256,512,1024,2048) if ($ultra =~ /Sun Fire [46]8[01]0\b/ || $ultra =~ /Sun Fire E[246]900\b/ || $ultra =~ /Sun Fire E2[05]K\b/);
4649}
4650if ($ultra eq "Sun Fire V880") {
4651 # Accepts 128MB, 256MB, 512MB or 1GB DIMMs in groups of four per CPU
4652 # 128MB DIMMs only supported on 750MHz CPU/memory boards
4653 # 1GB DIMMs only supported on 900MHz or faster CPU/memory boards
4654 # 2-8 UltraSPARC-III processors, 750MHz or faster
4655 # Up to 64GB memory, 8GB max per CPU, 4 DIMMs per CPU, 2 CPUs per board
4656 # DIMMs must be added four-at-a-time within the same group of DIMM
4657 # slots; every fourth slot belongs to the same DIMM group.
4658 # Each CPU/Memory board must be populated with a minimum of eight DIMMs,
4659 # installed in groups A0 and B0.
4660 # For 1050MHz and higher system boards, each CPU/Memory board must be
4661 # populated with all sixteen DIMMs, installed in groups A0,A1,B0,B1.
4662 # Each group used must have four identical DIMMs installed (all four
4663 # DIMMs must be from the same manufacturing vendor and must have the
4664 # same capacity).
4665 # DIMMs are 232-pin 3.3V ECC 7ns SDRAM
4666 # Uses 128-bit-wide path to memory, 150MHz DIMMs, 2.4GB/sec
4667 # bandwidth to processor and an aggregate memory bw of 9.6GB/sec
4668 # prtdiag output shows the memory installed.
4669 #
4670 # CPU CPU/Memory Slot Associated DIMM Group
4671 # --- --------------- ---------------------
4672 # 0 Slot A A0,A1
4673 # 2 Slot A B0,B1
4674 # 1 Slot B A0,A1
4675 # 3 Slot B B0,B1
4676 # 4 Slot C A0,A1
4677 # 6 Slot C B0,B1
4678 # 5 Slot D A0,A1
4679 # 7 Slot D B0,B1
4680 #
4681 $devname="Daktari (V880), Nandi (V880z)";
4682 $familypn="A30 (V880), A47 (V880z)";
4683 $untested=0;
4684 @simmsizes=($cpufreq < 800) ? (128,256,512) : (256,512,1024,2048);
4685 @banksstr=("A0","A1","B0","B1");
4686 $prtdiag_has_mem=1;
4687}
4688if ($ultra eq "Sun Fire V480") {
4689 # Accepts 256MB, 512MB or 1GB DIMMs in groups of four per CPU
4690 # 2 or 4 UltraSPARC-III processors, 900MHz or faster
4691 # Up to 32GB memory, 8GB max per CPU, 4 DIMMs per CPU, 2 CPUs per board
4692 # Smaller version of Sun Fire V880 above
4693 $devname="Cherrystone";
4694 $familypn="A37";
4695 $untested=0;
4696 @simmsizes=(256,512,1024,2048);
4697 @banksstr=("A0","A1","B0","B1");
4698 $prtdiag_has_mem=1;
4699}
4700if ($ultra eq "Sun Fire V490" || $ultra eq "Sun Fire V890") {
4701 # Accepts 512MB or 1GB DIMMs in groups of four per CPU
4702 # 2 or 4 UltraSPARC-III, IV or IV+ processors, 1050MHz or faster
4703 # Up to 32GB memory, 8GB max per CPU, 4 DIMMs per CPU, 2 CPUs per board
4704 # Similar memory contraints as Sun Fire V880 above
4705 if ($ultra eq "Sun Fire V490") {
4706 $devname="Sebring";
4707 $familypn="A52";
4708 }
4709 if ($ultra eq "Sun Fire V890") {
4710 $devname="Silverstone";
4711 $familypn="A53";
4712 }
4713 $untested=0;
4714 @simmsizes=(512,1024,2048);
4715 @banksstr=("A0","A1","B0","B1");
4716 $prtdiag_has_mem=1;
4717}
4718if ($ultra eq "Netra T12") {
4719 # Sun Fire V1280, Netra 1280
4720 # Essentially the same as a Sun Fire 4810, but is marketed as a low cost
4721 # single domain system.
4722 # 2-12 UltraSPARC-IIIcu processors using up to 3 CPU/Memory boards
4723 # Each CPU/Memory board holds up to 4 processors and up to 32GB memory
4724 # (32 DIMMs per board, 8 banks of 4 DIMMs)
4725 # Accepts 256MB, 512MB, 1GB or 2GB DIMMs
4726 # System Board slots are labeled SB0 and higher
4727 # A populated DIMM bank requires an UltraSPARC III CPU.
4728 # DIMMs are 232-pin 3.3V ECC 7ns SDRAM
4729 # prtdiag output shows the memory installed.
4730 $devname="Lightweight 8";
4731 $familypn="A40 (Sun Fire V1280), N40 (Netra 1280)";
4732 $untested=0;
4733 $prtdiag_has_mem=1;
4734 @simmsizes=(256,512,1024,2048);
4735}
4736if ($ultra eq "Enchilada") {
4737 # Sun Fire V210, V240, Netra 210, 240
4738 # 1-2 UltraSPARC-IIIi (Jalapeno) processors
4739 # UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs.
4740 # UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs.
4741 # DDR-1 SDRAM PC2100 DIMMs, 8 DIMM slots, 4 DIMMs per processor,
4742 # 2 banks per processor, 2 DIMMs per bank
4743 # V210 accepts 1GB & 2GB DIMMs by installing Fan Upgrade Kit, X7418A
4744 # Mixing DIMM sizes and capacities is not supported.
4745 # prtdiag output can show the memory installed.
4746 $devname="Enchilada"; # Enxs
4747 if ($banner =~ /Sun Fire V210\b/ || $model =~ /Sun-Fire-V210/) {
4748 $devname="Enchilada 1U";
4749 $familypn="N31";
4750 }
4751 if ($model =~ /Netra-210\b/) {
4752 $devname="Salsa 19";
4753 $familypn="N79";
4754 }
4755 if ($banner =~ /Sun Fire V240\b/ || $model =~ /Sun-Fire-V240/) {
4756 $devname="Enchilada 2U";
4757 $familypn="N32";
4758 }
4759 if ($model =~ /Netra-240\b/) {
4760 $devname="Enchilada 19";
4761 $familypn="N54";
4762 }
4763 $untested=0 if ($banner =~ /Sun Fire V210\b/ || $model =~ /Sun-Fire-V210/ || $model =~ /Netra-210\b/ || $banner =~ /Sun Fire 240\b/ || $model =~ /Sun-Fire-V240/ || $model =~ /Netra-240\b/);
4764 $prtdiag_has_mem=1;
4765 $prtdiag_banktable_has_dimms=1;
4766 $simmrangex="00002000";
4767 # Count the skipped address range for dual CPU
4768 $simmbanks=($ncpu > 1) ? 10 : 2;
4769 $simmsperbank=2;
4770 @simmsizes=(128,256,512,1024,2048);
4771 @socketstr=("MB/P0/B0/D0","MB/P0/B0/D1","MB/P0/B1/D0","MB/P0/B1/D1","?","?","?","?","?","?","?","?","?","?","?","?");
4772 push(@socketstr, "MB/P1/B0/D0","MB/P1/B0/D1","MB/P1/B1/D0","MB/P1/B1/D1") if ($ncpu > 1);
4773}
4774if ($ultra eq "Sun Fire V440" || $ultra eq "Netra 440") {
4775 # 1-4 UltraSPARC-IIIi (Jalapeno) processors
4776 # UltraSPARC IIIi supports 128MB to 1GB single bank DIMMs.
4777 # UltraSPARC IIIi supports 256MB to 2GB dual bank DIMMs.
4778 # DDR-1 SDRAM PC2100 DIMMs, 16 DIMM slots, 4 DIMMs per processor,
4779 # 2 banks per processor, 2 DIMMs per bank
4780 # prtdiag output can show the memory installed.
4781 $devname="Chalupa";
4782 $familypn="A42";
4783 if ($ultra eq "Netra 440") {
4784 $devname="Chalupa 19";
4785 $familypn="N42";
4786 }
4787 $untested=0;
4788 $prtdiag_has_mem=1;
4789 $prtdiag_banktable_has_dimms=1;
4790 $simmrangex="00002000";
4791 $simmbanks=26; # Count the skipped address range for each CPU
4792 $simmsperbank=2;
4793 @simmsizes=(128,256,512,1024,2048);
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches