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

Subscribers

People subscribed via source and target branches