limitation, theseintellectual propertyrights mayinclude oneor more ofthe U.S.patents listedat http://www.sun.com/patentsand oneor
more additionalpatents orpending patentapplications inthe U.S.and inother countries.
This documentand theproduct towhich itpertains are distributedunder licensesrestricting theiruse, copying,distribution, and
decompilation. Nopart ofthe productor ofthis documentmay bereproducedin anyform byany meanswithout priorwritten authorizationof
Sun andits licensors,if any.
Third-party software, includingfont technology,is copyrightedand licensedfrom Sun suppliers.
Parts ofthe productmay bederived from BerkeleyBSD systems,licensed fromthe Universityof California.UNIX isa registered trademarkin
the U.S.and inother countries,exclusively licensedthrough X/OpenCompany, Ltd.
Sun, Sun Microsystems,the Sunlogo, AnswerBook2,docs.sun.com, Netra,OpenBoot, andSolaris are trademarksor registered trademarksof
Sun Microsystems,Inc. inthe U.S.and inother countries.
All SPARCtrademarks areused underlicense andare trademarks or registered trademarksof SPARCInternational, Inc.in theU.S. andin other
countries. Productsbearing SPARCtrademarks are basedupon anarchitecture developed by Sun Microsystems,Inc.
The OPENLOOK andSun™ GraphicalUser Interfacewas developedby SunMicrosystems, Inc.for itsusers andlicensees. Sun acknowledges
the pioneeringefforts ofXerox in researchingand developingthe conceptof visualor graphicaluser interfacesfor thecomputer industry.Sun
holds anon-exclusive licensefrom Xerox tothe XeroxGraphical UserInterface, whichlicense alsocovers Sun’slicensees whoimplement OPEN
LOOK GUIsand otherwisecomply withSun’s writtenlicense agreements.
U.S. GovernmentRights—Commercial use.Government usersare subject to the Sun Microsystems, Inc.standard licenseagreement and
applicable provisionsof theFAR andits supplements.
DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
INCLUDING ANYIMPLIED WARRANTY OFMERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSEOR NON-INFRINGEMENT,
ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
Copyright 2007Sun Microsystems,Inc., 4150Network Circle, SantaClara, Californie95054, Etats-Unis.Tous droitsréservés.
Sun Microsystems,Inc. ales droits depropriété intellectuelsrelatants à la technologie qui est décritdans ce document. Enparticulier,et sansla
limitation, cesdroits depropriété intellectuels peuvent inclure unou plusdes brevetsaméricains énumérésà http://www.sun.com/patents et
un oules brevetsplus supplémentaires oules applicationsde breveten attentedans lesEtats-Unis etdans lesautrespays.
Ce produitou documentest protégé parun copyrightet distribuéavec deslicences quien restreignent l’utilisation,la copie,la distribution,et la
décompilation. Aucunepartie dece produitou documentne peutêtre reproduite sousaucune forme,par quelquemoyen quece soit,sans
l’autorisation préalableet écritede Sunet deses bailleursde licence,s’il yena.
Toutes lesmarques SPARC sont utilisées sous licence et sont des marques defabrique oudes marquesdéposées deSPARC International,Inc.
aux Etats-Uniset dansd’autres pays.Les produits portantles marquesSPARC sont baséssur unearchitecture développéepar Sun
Microsystems, Inc.
L’interfaced’utilisation graphiqueOPEN LOOKet Sun™a étédéveloppée parSun Microsystems, Inc.pour sesutilisateurs etlicenciés. Sun
reconnaît lesefforts de pionniers de Xeroxpour larecherche et le développement du concept des interfaces d’utilisation visuelle ou graphique
pour l’industriede l’informatique.Sun détientune licensenon exclusivede Xeroxsur l’interfaced’utilisation graphiqueXerox,cette licence
couvrant égalementles licenciéesde Sunqui mettenten placel’interface d’utilisation graphiqueOPEN LOOKet quien outrese conforment
aux licencesécrites deSun.
LA DOCUMENTATION EST FOURNIE "EN L’ÉTAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES
OU TACITES SONT FORMELLEMENTEXCLUES, DANSLA MESUREAUTORISEE PARLA LOIAPPLICABLE, YCOMPRIS NOTAMMENT
TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L’APTITUDE A UNE UTILISATION PARTICULIERE OU A
L’ABSENCE DE CONTREFAÇON.
TABLE 2-4PICL Temperature Sensor Class Node Properties 35
TABLE 2-5Description of Values Displayed by Solaris Commands 42
TABLE 3-1User Flash Node Properties 44
TABLE 3-2System Calls 45
vii
viiiNetra CP2500 Board Programming Guide • March 2007
Code Samples
CODE EXAMPLE 1-1System Watchdog Node Management Code Example 5
CODE EXAMPLE 2-1Sample envmond Application Program 37
CODE EXAMPLE 3-1PROM Information Structure 46
CODE EXAMPLE 3-2User Flash Interface Structure 47
CODE EXAMPLE 3-3Read Action on User Flash Device 48
CODE EXAMPLE 3-4Write Action on User Flash Device 49
CODE EXAMPLE 3-5Block Erase Action on User Flash Device 51
CODE EXAMPLE 3-6Sample User Flash Application Program 53
ix
xNetra CP2500 Board Programming Guide • March 2007
Preface
The Netra CP2500 Board Programming Guide is written for program developers and
users who want to program the Netra
equipment manufacturer (OEM) systems, supply additional capability to an existing
compatible system, or work in a laboratory environment for experimental purposes.
You are required to have a basic knowledge of computers and digital logic
programming to fully use the information in this document.
The Netra CP2500 can be used by network equipment providers (NEPs) and carriers
to scale and improve the availability of next-generation, carrier-grade systems. The
Netra CP2500 functions as a node board in a cPSB system rack or as a CPU board in
the Netra CT 810 or 410 cPCI server.
™
CP2500 board in order to design original
How This Book Is Organized
Chapter 1 provides details on the Netra CP2500 watchdog timer driver and its
operation.
Chapter 2 describes the specific environmental monitoring functions of the Netra
CP2500.
Chapter 3 describes the user flash driver for the Netra CP2500 on-board flash
PROMs and how to use it.
xi
Using UNIX Commands
This document may not contain information on basic UNIX®commands and
procedures such as shutting down the system, booting the system, and configuring
devices.
See one or more of the following for this information:
■ Solaris Handbook for Sun Peripherals
■ Solaris
™
Operating System (Solaris OS) documentation, which is at:
http://docs.sun.com
■ Other software documentation that you received with your system
Typographic Conventions
*
Typeface
AaBbCc123The names of commands, files,
AaBbCc123What you type, when contrasted
AaBbCc123Book titles, new words or terms,
* The settings on your browser might differ from these settings.
MeaningExamples
Edit your.login file.
and directories; on-screen
computer output
with on-screen computer output
words to be emphasized.
Replace command-line variables
with real names or values.
Use ls -a to list all files.
% You have mail.
su
%
Password:
Read Chapter 6 in the User’s Guide.
These are called class options.
Yo u must be superuser to do this.
To delete a file, type rm filename.
xii Netra CP2500 Board Programming Guide • March 2007
Shell Prompts
ShellPrompt
C shellmachine-name%
C shell superusermachine-name#
Bourne shell and Korn shell$
Bourne shell and Korn shell superuser#
Related Documentation
Online documents are available at:
http://www.sun.com/documentation
TitlePart Number
Netra CP2500 Board Release Notes819-1748
Netra CP2500 Board Installation and Technical Reference
Manual
Netra CP2500 Board Programming Guide819-1749
Netra CP2500 Board Safety and Compliance Manual819-1750
Netra CP2500 Rear Transition Module Installation and
Technical Reference Manual
Important Safety Information for Sun Hardware Systems816-7190
819-1747
819-1753
Prefacexiii
Documentation, Support, and Training
Sun FunctionURL
Documentation
Support
Training
http://www.sun.com/documentation/
http://www.sun.com/support/
http://www.sun.com/training/
Third-Party Web Sites
Sun is not responsible for the availability of third-party web sites mentioned in this
document. Sun does not endorse and is not responsible or liable for any content,
advertising, products, or other materials that are available on or through such sites
or resources. Sun will not be responsible or liable for any actual or alleged damage
or loss caused by or in connection with the use of or reliance on any such content,
goods, or services that are available on or through such sites or resources.
Sun Welcomes Your Comments
Sun is interested in improving its documentation and welcomes your comments and
suggestions. You can submit your comments by going to:
http://www.sun.com/hwdocs/feedback
Please include the title and part number of your document with your feedback:
Netra CP2500 Board Programming Guide, part number 819-1749-11
xiv Netra CP2500 Board Programming Guide • March 2007
CHAPTER
1
Watchdog Timer
The system management controller (SMC) on the Netra CP2500 implements a
watchdog service that captures catastrophic faults in the Solaris OS running on the
CPU board. The watchdog service reports such faults to the baseboard management
controller (BMC) by means of either an IPMI message or by a de-assertion of the
CPU’s HEALTHY# signal.
This chapter contains the following sections:
■ “Overview” on page 1
■ “PICL Plug-In Module” on page 2
■ “Watchdog Node Management Code” on page 5
■ “OpenBoot PROM Interface” on page 21
Overview
The Netra CP2500 SMC provides two watchdog timers: the watchdog level 2 (WD2)
timer and the watchdog level 1 (WD1) timer. Management applications (for example,
the Managed Object Hierarchy on the Netra CT 810/410 server or a third-party
application on a cPSB server) start the timers, and the Solaris OS periodically pats
the timers before they expire. If the WD2 timer expires, the watchdog function of the
WD2 timer forces the SPARC
WD2 is 255 seconds.
The WD1 timer is typically set to a shorter interval than the WD2 timer.
Management applications can examine the expiration status of the WD1 timer to get
advance warning if the main timer, WD2, is about to expire. The management
application has to start WD1 before it can start WD2. If WD1 expires, then WD2
starts only if enabled. The maximum range for WD1 is 6553.5 seconds.
The Solaris PICL module provides interfaces to the watchdog timer in SMC.
®
processor to optionally reset. The maximum range for
1
PICL Plug-In Module
The watchdog subsystem is managed by a platform information and control library
(PICL) plug-in module. This PICL plug-in module provides a set of PICL properties
to the system, which enables a Solaris PICL client to specify the attributes of the
watchdog system.
To use the PICL API to set the watchdog properties, your application must follow
the following sequence:
Note – The following instructions are not server-specific. Check your server
documentation for additional software configuration that might be needed with the
watchdog timer.
1. If the watchdog timer is running, stop it by disabling the primary HEALTHY#
signal monitoring for the CPU card on which the watchdog timer is to be
changed.
2. In your application, use the PICL API to disarm, set, and arm the active watchdog
timer.
Refer to the picld(1M), libpicl(3LIB), and libpicltree(3LIB) man pages for
a complete description of the PICL architecture and programming interface.
Develop your application to use the PICL programming interface to do the
following:
■ Disarm the active watchdog timer.
■ Change the watchdog timer PICL properties to the required values.
■ Re-arm the watchdog timer. The properties of watchdog-controller and
watchdog-timer are defined in
TABLE 1-1, TABLE 1-2, and TABLE 1-3.
3. Re-enable the primary HEALTHY# signal monitoring on the CPU card in the
specified slot.
2Netra CP2500 Board Programming Guide • March 2007
PICL interfaces for the watchdog plug-in module include the nodes watchdogcontroller and watchdog-timer. See
TABLE 1-1, TABLE 1-2, and TABLE 1-3 for
descriptions of the properties of these nodes.
TABLE 1-1Watchdog Plug-In Interfaces for Netra CP2500 Board Software
PICL ClassPropertyMeaning
watchdogcontroller
watchdog-timerStateRepresents a watchdog timer hardware that belongs to its
TABLE 1-2Properties Under watchdog-controller Node
PropertyOperationsDescription
WdOparmActivates all timers under the controller with values already set for
WdOpRepresents a watchdog subsystem.
controller. Each timer depends on the status of its peers to
be activated or deactivated.
WdTimeoutTimeout for the watchdog timer.
WdActionAction to be taken after the watchdog expires.
WdTimeout and WdAction.
disarmAll active timers under the controller will be stopped.
Chapter 1 Watchdog Timer3
TABLE 1-3Properties Under watchdog-timer Node
PropertyValuesDescription
StatearmedIndicates timer is armed or running. Cleared by disarm.
expiredIndicates timer has expired. Cleared by
disarm.
disarmedDefault value set at startup time. Indicates timer is disarmed or
stopped.
WdTimeout
WdAction
*
\
Varies by system
and timer level
Indicates the timer initial countdown value. Should be set prior
to arming the timer.
noneDefault value. No action is taken.
alarmSends notifications to system alarm hardware by means of
HEALTHY#.
resetPerforms a soft or hard reset of the system (implementation
4Netra CP2500 Board Programming Guide • March 2007
:_classwatchdog-timer
:name watchdog-level2
Watchdog Node Management Code
CODE EXAMPLE 1-1 contains an example of the code used for managing the watchdog
timer nodes. This code can be used to change watchdog timer action and timeout
values and also to arm and disarm the watchdog controller.
CODE EXAMPLE 1-1System Watchdog Node Management Code Example
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "@(#)wdadm.c 1.6 03/10/16 SMI"
/*
* This program is used to manage the system watchdog nodes.
* Please refer to libpicl(3LIB) for information on picl APIs
* To compile:
* cc -o wdadm -lpicl wdadm.c
*/
#define DETAILED_HELP"wdadm- System Watchdog Controller Administration\n"\
"Description:\n"\
"The operations include displaying status (-l), modifying the values (-m)\n"\
"and executing commands on the watchdog controller (-c).\n"\
"This utility must be run with super user permissions.\n"\
"OPTIONS\n"\
" -l list all the watchdog timer nodes.\n"\
" Each Timer node is denoted as controller:timer\n"\
" Example:\n"\
" wdadm -l - lists all the nodes\n"\
" wdadm -l c1:t1 c1:t2 - lists c:t1 and c:t2 nodes\n"\
" c1 - controller name\n"\
" t1 - timer name\n"\
" -m modify the timeout and action parameters for a timer node.\n"\
" Example:\n"\
" wdadm -m c1:t1 -t <timeout in ms> -a <action>\n"\
" wdadm -m c1:t1 -t <timeout in ms>\n"\
" wdadm -m c1:t1 -a <action>\n"\
" Note: Before using this option, the controller must be\n"\
" disarmed (using -c option).\n"\
" -c Execute commands on the watchdog controller node\n"\
" Commands supported are : arm, disarm\n"\
" Example:\n"\
" wdadm -c controller -o arm\n"\
" arms the watchdog controller node called controller\n"
6Netra CP2500 Board Programming Guide • March 2007
CODE EXAMPLE 1-1System Watchdog Node Management Code Example (Continued)
#define WATCHDOG_DISARMED "disarmed"
/*
* data structure that will be passed as argument to
* picl_walk_tree_by_class callback function
*/
typedef struct {
int start_index;
int max_index;
char **list;
char *name;
char *action;
char *op;
int32_t timeout;
int error_code;
} wdadm_args_t;
/*
* This function is used to read picl property. The value is copied
* into vbuf.
* memory allocated for vbuf must be free’d by caller
*/
static picl_errno_t
wdadm_get_picl_prop(picl_nodehdl_t nodeh, const char *prop_name, void **vbuf)
{
picl_errno_t err;
picl_propinfo_t pinfo;
picl_prophdl_t proph;
/* get the information about the property */
if ((err = picl_get_propinfo_by_name(nodeh, prop_name,
&pinfo, &proph)) != PICL_SUCCESS) {
return (err);
}
*vbuf = malloc(pinfo.size);
if (vbuf == NULL)
return (PICL_NOSPACE);
8Netra CP2500 Board Programming Guide • March 2007
CODE EXAMPLE 1-1System Watchdog Node Management Code Example (Continued)
/* read the property value */
if ((err = picl_get_propval(proph, *vbuf, pinfo.size)) !=
PICL_SUCCESS) {
return (err);
}
return (PICL_SUCCESS);
}
/*
* This function is used to set the value of a picl property
*/
static picl_errno_t
wdadm_set_picl_prop(picl_nodehdl_t nodeh, const char *prop_name,
void *vbuf, int size)
{
picl_errno_t err;
picl_propinfo_t pinfo;
picl_prophdl_t proph;
void *tmp_buf;