Sun Microsystems, Inc.www.sun.comSubmit comments about this document at: http://www.sun.com/hwdocs/feedbackNetra™CP2500 BoardProgramming GuideFor the
x Netra CP2500 Board Programming Guide • March 2007
xiPrefaceThe Netra CP2500 Board Programming Guide is written for program developers andusers who want to program the Netra™CP2500 board in order to de
xii Netra CP2500 Board Programming Guide • March 2007Using UNIX CommandsThis document may not contain information on basic UNIX®commands andprocedures
Preface xiiiShell PromptsRelated DocumentationOnline documents are available at:http://www.sun.com/documentationShell PromptC shell machine-name%C she
xiv Netra CP2500 Board Programming Guide • March 2007Documentation, Support, and TrainingThird-Party Web SitesSun is not responsible for the availabil
1CHAPTER1Watchdog TimerThe system management controller (SMC) on the Netra CP2500 implements awatchdog service that captures catastrophic faults in th
2 Netra CP2500 Board Programming Guide • March 2007PICL Plug-In ModuleThe watchdog subsystem is managed by a platform information and control library(
Chapter 1 Watchdog Timer 3PICL interfaces for the watchdog plug-in module include the nodes watchdog-controller and watchdog-timer. SeeTABLE 1-1, TABL
4 Netra CP2500 Board Programming Guide • March 2007To identify current settings of watchdog-controller, issue the commandprtpicl -v as shown in the sa
Chapter 1 Watchdog Timer 5Watchdog Node Management CodeCODE EXAMPLE 1-1 contains an example of the code used for managing the watchdogtimer nodes. Thi
Copyright 2007 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.Sun Microsystems, Inc. has intel
6 Netra CP2500 Board Programming Guide • March 2007#define EM_INIT 1#define EM_GETROOT 2#define EM_GETPVALBYNAME 3
Chapter 1 Watchdog Timer 7#define WATCHDOG_DISARMED "disarmed"/* * data structure that will be passed as argument to * picl_wa
8 Netra CP2500 Board Programming Guide • March 2007 } return (-1);}static voidprint_errmsg(char *message, ...){ va_list ap;
Chapter 1 Watchdog Timer 9 /* read the property value */ if ((err = picl_get_propval(proph, *vbuf, pinfo.size)) !=
10 Netra CP2500 Board Programming Guide • March 2007 */static picl_errno_tprint_watchdog_node_props(picl_nodehdl_t nodeh){ int32_t *timeout = N
Chapter 1 Watchdog Timer 11 wdadm_args_t *wd_arg = NULL; picl_nodehdl_t childh, peerh; char cntrl_name[PICL_PROPNAMELEN_MAX];
12 Netra CP2500 Board Programming Guide • March 2007 if (wd_arg == NULL || print) { if (count == 0) {
Chapter 1 Watchdog Timer 13 } return (err);}/* * This function is the callback function that gets called * due to picl_walk_tree_by_clas
14 Netra CP2500 Board Programming Guide • March 2007 if (strncmp(cntrl_name, wd_arg->name, (ptr - wd_arg->name)) != 0) { r
Chapter 1 Watchdog Timer 15 if (wd_arg->action) if ((err = wdadm_set_picl_prop(peerh, WATCHDOG_ACTION
iiiContentsPreface xi1. Watchdog Timer 1Overview 1PICL Plug-In Module 2Watchdog Node Management Code 5OpenBoot PROM Interface 212. Environmental Monit
16 Netra CP2500 Board Programming Guide • March 2007 ptr = strchr(wd_name, ’:’); if (ptr == NULL) { /* invalid format */
Chapter 1 Watchdog Timer 17 print_errmsg(gettext(err_msg[EM_GETPVALBYNAME]), picl_strerror(err)); ret
18 Netra CP2500 Board Programming Guide • March 2007 return (err);}intmain(int argc, char **argv){ int err; int
Chapter 1 Watchdog Timer 19 tflg = 1; (void) strlcpy(timeout, optarg, PICL_CL
20 Netra CP2500 Board Programming Guide • March 2007 rc = print_wd_info(argc, argv, optind); (void) picl_shutdown();
Chapter 1 Watchdog Timer 21OpenBoot PROM InterfaceThere is no user interface to the watchdog timer at the OpenBoot™PROM level.When the Netra CP2500 bo
22 Netra CP2500 Board Programming Guide • March 2007
23CHAPTER2Environmental MonitoringThe Netra CP2500 board uses an intelligent fault detection environmentalmonitoring system that increases uptime and
24 Netra CP2500 Board Programming Guide • March 2007Environmental Monitoring ComponentCompatibilityTABLE 2-1 lists the compatible environmental monito
Chapter 2 Environmental Monitoring 25FIGURE 2-1 Typical Environmental Monitoring Application Block DiagramTransition card(OEM supplied)I2CnodeRackmidp
iv Netra CP2500 Board Programming Guide • March 2007Warning Temperature Response at OpenBoot PROM 33Critical Temperature Response at OpenBoot PROM 33U
26 Netra CP2500 Board Programming Guide • March 2007The Netra CP2500 monitors its CPU diode temperature and issues warnings at boththe OpenBoot PROM a
Chapter 2 Environmental Monitoring 27Protection at the operating system level takes place when the PICL environmentalmonitoring program (envmond) is r
28 Netra CP2500 Board Programming Guide • March 2007Hardware Environmental MonitoringFunctionsThis section summarizes the hardware environmental monit
Chapter 2 Environmental Monitoring 29FIGURE 2-2 Location of Environmental Monitoring Hardware on the Netra CP2500 Board – Top SideFIGURE 2-3 is a bloc
30 Netra CP2500 Board Programming Guide • March 2007FIGURE 2-3 Netra CP2500 Board Environmental Monitoring Functional Block DiagramPICLapplicationprog
Chapter 2 Environmental Monitoring 31Switching Power On and OffThe on-board voltage controller allows power to the CPU of the Netra CP2500 onlywhen th
32 Netra CP2500 Board Programming Guide • March 2007The CPU diode temperature can be used to prevent damage to the board by shuttingthe board down if
Chapter 2 Environmental Monitoring 33Note – If you have developed an application that uses the environmentalmonitoring software to monitor the tempera
34 Netra CP2500 Board Programming Guide • March 2007Using the show-sensors Command at theOpenBoot PROMThe show-sensors command at OpenBoot PROM displa
Chapter 2 Environmental Monitoring 35The environmental monitoring parameter values in the application program applywhen the system is running at the S
vFiguresFIGURE 2-1 Typical Environmental Monitoring Application Block Diagram 25FIGURE 2-2 Location of Environmental Monitoring Hardware on the Netra
36 Netra CP2500 Board Programming Guide • March 2007Using a Configuration File for Sensor InformationOn the Netra CP2500, you can enable or disable se
Chapter 2 Environmental Monitoring 37Sample Application ProgramThis section presents a sample environmental monitoring (envmond) applicationthat monit
38 Netra CP2500 Board Programming Guide • March 2007 *resulth = childh; return (PICL_SUCCESS);
Chapter 2 Environmental Monitoring 39 if (picl_get_propval_by_name(nodeh, LO_SHUTDOWN_THRESHOLD, &threshold, sizeof (thresho
40 Netra CP2500 Board Programming Guide • March 2007 return (1); } if (get_child_by_name(platformh, sensor, &childh)
Chapter 2 Environmental Monitoring 41Reading the CPU Temperature andEnvironmental LimitsYou can access the CPU temperature sensor current readings and
42 Netra CP2500 Board Programming Guide • March 2007TABLE 2-5 shows which Solaris commands correspond to the environmentalmonitoring warning that runs
43CHAPTER3User FlashThis chapter describes the user flash driver for the onboard flash PROM and how touse it. The Netra CP2500 is equipped with user f
44 Netra CP2500 Board Programming Guide • March 2007User Flash DriverThe uflash is the device driver for the flash PROM device on the Netra CP2500.Acc
Chapter 3 User Flash 45User Flash Device FilesThe user flash device file is /dev/uflash0.Interface (Header) FileThe user flash header file is located
vi Netra CP2500 Board Programming Guide • March 2007
46 Netra CP2500 Board Programming Guide • March 2007The ioctl supported commands are listed below:Note that these ioctl commands are not supported:Str
Chapter 3 User Flash 47User Flash User Interface StructureThe user flash user interface structure holds user parameters to commands such aserase.Error
48 Netra CP2500 Board Programming Guide • March 2007 Write Block EraseRead Example ProgramCODE EXAMPLE 3-3 contains the Read Action on the user flas
Chapter 3 User Flash 49Write Example ProgramCODE EXAMPLE 3-4 contains the Write Action on the user flash device. printf("number of blocks = 0x
50 Netra CP2500 Board Programming Guide • March 2007int ufd0;uflash_if_t ufif0;char *buf0;char *module;static intuflash_init() { char *buf0 = malloc(
Chapter 3 User Flash 51Block Erase Example ProgramCODE EXAMPLE 3-5 contains the Block Erase Action on the user flash device.}main() { int ret;module
52 Netra CP2500 Board Programming Guide • March 2007 printf("manfacturer id = 0x%p\n", ufif0.info.mfr_id); printf("device id = 0x
Chapter 3 User Flash 53Sample User Flash Application ProgramYou can use the following program to test the user flash device and driver. Thisprogram al
54 Netra CP2500 Board Programming Guide • March 2007 #if 1 #define PROM_SIZE 0x700000 /* 7 MBytes */ #endifstatic char *help[14] = {
Chapter 3 User Flash 55 if ((fd0 = open(devname0, O_RDWR)) < 0) { fprintf(stderr, "couldn’t open device: %s\n", devname0)
viiTablesTABLE 1-1 Watchdog Plug-In Interfaces for Netra CP2500 Board Software 3TABLE 1-2 Properties Under watchdog-controller Node 3TABLE 1-3 Propert
56 Netra CP2500 Board Programming Guide • March 2007 case ’4’: /* lock flash PROM block */ /* on certain PROMs */
Chapter 3 User Flash 57 case ’1’: /* write to user flash PROM */ fprintf(stderr, "Ent
58 Netra CP2500 Board Programming Guide • March 2007 } printf ("\nuser data buffer:\n"); fo
59IndexBboot, Solaris OS, 21Ccommandsprtdiag, 41, 42prtpicl, 4, 35, 41, 42show-sensors,34critical-temperature parameter, 33Ddevice node, 44dip switch,
60 Netra CP2500 Board Programming Guide • March 2007device, 45device files, 45driver, 43header file, 45interface structure, 47node properties, 44Vvoltag
viii Netra CP2500 Board Programming Guide • March 2007
ixCode SamplesCODE EXAMPLE 1-1 System Watchdog Node Management Code Example 5CODE EXAMPLE 2-1 Sample envmond Application Program 37CODE EXAMPLE 3-1 PR
Kommentare zu diesen Handbüchern