Summary of Contents for Sun Microsystems Netra CP3010
Page 1
Netra CP3010 Board ™ Programming Guide For the Netra CT 900 Server Sun Microsystems, Inc. www.sun.com Part No. 819-1185-10 January 2006, Revision A Submit comments about this document at: http://www.sun.com/hwdocs/feedback...
Page 2
Copyright 2006 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, Californie 95054, Etats-Unis. Tous droits réservés. Sun Microsystems, Inc. a les droits de propriété intellectuels relatants à la technologie qui est décrit dans ce document. En particulier, et sans la limitation, ces droits de propriété...
Page 6
Netra CP3010 Board Programming Guide • January 2006...
Page 7
Code Examples PROM Information Structure 9 CODE EXAMPLE 2-1 Flash User Interface Structure 10 CODE EXAMPLE 2-2 Read Action on Flash Device 11 CODE EXAMPLE 2-3 Write Action on Flash Device 13 CODE EXAMPLE 2-4 Block Erase Action on Flash Device 15 CODE EXAMPLE 2-5 Flash Application Program 17 CODE EXAMPLE 2-6...
Page 8
Netra CP3010 Board Programming Guide • January 2006...
This Netra CP3010 Board Programming Guide is written for program developers and users who want to program this board to design original equipment manufacturer (OEM) systems, supply additional capability to an existing compatible system, or work in a laboratory environment for experimental purposes.
Page 10
How This Book Is Organized Chapter 1 describes environmental monitoring of the Netra CP3010 board. Chapter 2 describes the user flash driver device for the Netra CP3010 onboard flash PROMs and how to use the device. Using UNIX Commands ®...
Page 11
Netra CP3010 Board Getting Started Guide 819-1182-xx Netra CP3010 Board User’s Guide 819-1183-xx Netra CP3010 Board Software Installation Guide 819-1184-xx Netra CP3010 Board Transition Card Getting Started Guide 819-1186-xx Netra CP3010 Board Transition Card User’s Guide 819-1187-xx Important Safety Information for Sun Hardware Systems 817-7190-10...
Page 12
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 CP3010 Board Programming Guide, part number 819-1185-10 xii Netra CP3010 Board Programming Guide • January 2006...
The Netra CP3010 board uses an intelligent fault detection environmental monitoring system that increases uptime and manageability of the board. Through an Intelligent Platform Management Controller (IPMC) and system management software, the Netra CP3010 board monitors voltage, temperature, and power on sensors. This chapter contains the following topics: “Power Requirements”...
Power Requirements The onboard voltage controller allows power to the CPU of the Netra CP3010 board only when the following conditions are met: VDD core-1.7-volt supply voltage is greater than 1.53 volts (within 10 percent of ■ nominal) 12-volt supply voltage is greater than 10.8 volts (within 10 percent of nominal) ■...
Page 15
A sudden drop of all temperature sensors close to or near room ambient temperature can mean loss of power to one or more Netra CP3010 boards. A gradual increase in the delta temperature from inlet to outlet can be due to dust clogging system filters.
Page 16
Netra CP3010 Board Programming Guide • January 2006...
C H A P T E R Flash Device Driver The Netra CP3010 board is equipped with flash memory. This chapter introduces the flash device driver for the onboard flash PROM and describes how to use the device. This chapter contains the following topics: “Software Requirements”...
■ Storing Data and Applications The Solaris OS uflash is the device driver for the flash device on the Netra CP3010 board. On the Netra CP3010 board, one driver is supported. Users can use this device driver for storing data and applications.
The flash header file is located in the following path: /usr/platform/SUNW,Netra-CP3010/include/sys/uflash_if.h Flash Memory The Netra CP3010 board has a 16-megabyte flash chip that is logically divided into two partitions: 2-megabyte system flash for storing copies of the OpenBoot PROM image. Users ■...
An error was encountered when copying arguments between the EFAULT application and driver (kernel) space. The system was low on memory when the driver attempted to ENOMEM acquire it. Netra CP3010 Board Programming Guide • January 2006...
Developing Programs You can use the programs that follow as examples when you develop programs for the following actions on the flash device: Read ■ Write ■ Erase ■ Block Erase ■ Example Read Program contains the Read Action on the flash device. CODE EXAMPLE 2-3 Read Action on Flash Device CODE EXAMPLE 2-3...
Page 24
{ /* read block 0 of user flash */ if (pread(ufd0, buf0, ufif0.info.blk_size, 0) != ufif0.info.blk_size) perror("uflash0:read"); return(0); main() { int ret; module = argv[0]; ret = uflash_init(); if (!ret) uflash_read(); uflash_uninit(); Netra CP3010 Board Programming Guide • January 2006...
Example Write Program contains the Write Action on the flash device. CODE EXAMPLE 2-4 Write Action on Flash Device CODE EXAMPLE 2-4 * uflash_write.c * An example that shows how to write flash #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h>...
Page 26
*((int *) (buf0 + i)) = 0xDEADBEEF; /* write block 0 of user flash */ if (pwrite(ufd0, buf0, ufif0.info.blk_size, 0) != ufif0.info.blk_size) perror("uflash0:write"); return(0); main() { int ret; module = argv[0]; ret = uflash_init(); if (!ret) uflash_write(); uflash_uninit(); Netra CP3010 Board Programming Guide • January 2006...
Page 27
Example Block Erase Program contains the Block Erase Action on the flash device. CODE EXAMPLE 2-5 Block Erase Action on Flash Device CODE EXAMPLE 2-5 * uflash_blockerase.c * An example that shows how to erase block(s) of flash #include <sys/types.h> #include <sys/stat.h>...
Page 28
(ufd0 && ioctl(ufd0, UIOCEBLK, &ufif0) == -1 ) { perror("ioctl(ufd0, UIOCEBLK): "); return(-1); printf("\nblockerase successful on %s\n", uflash0); return(0); main() { int ret; module = argv[0]; ret = uflash_init(); if (!ret) uflash_blockerase(); uflash_uninit(); Netra CP3010 Board Programming Guide • January 2006...
Page 29
Example Flash Application Program You can use the following program to test the flash device driver. This program demonstrates how the device can be used. Flash Application Program CODE EXAMPLE 2-6 This application program demonstrates the user program interface to the Flash PROM driver. One can read or write a number of bytes up to the size of the user PROM by means of pread() and pwrite() calls.
Page 30
/* returned from pread/pwrite */ size, offset, pat; fd0, h, i; fd, prom_id; uflash_if_t uflash_if; caddr_t r_buf, w_buf; char *devname0 = "/dev/uflash0"; char r_buf = (caddr_t)malloc(PROM_SIZE); w_buf = (caddr_t)malloc(PROM_SIZE); * Open the user flash PROM. Netra CP3010 Board Programming Guide • January 2006...
Page 31
Flash Application Program (Continued) CODE EXAMPLE 2-6 if ((fd0 = open(devname0, O_RDWR)) < 0) { fprintf(stderr, "couldn’t open device: %s\n", devname0); exit(1); /* set the default PROM */ prom_id = 0; fd = fd0; /* let them know about the help menu */ fprintf(stderr, "Enter <h>...
Need help?
Do you have a question about the Netra CP3010 and is the answer not in the manual?
Questions and answers