Sun Microsystems Netra CP3010 Programming Manual
Sun Microsystems Netra CP3010 Programming Manual

Sun Microsystems Netra CP3010 Programming Manual

For the netra ct 900 server

Advertisement

Quick Links

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

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Netra CP3010 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

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 3: Table Of Contents

    Contents Preface ix Environmental Monitoring 1 Power Requirements 2 Inlet, Exhaust, and CPU Temperatures 2 Flash Device Driver 5 Software Requirements 6 Storing Data and Applications 6 Switch Settings 6 OpenBoot PROM Device Tree and Properties 7 Flash Device Files 7 Interface (Header) File 8 Flash Memory 8 Accessing the Flash Device 8...
  • Page 4 Example Block Erase Program 15 Example Flash Application Program 17 Index 23 Netra CP3010 Board Programming Guide • January 2006...
  • Page 5 Tables Hardware Environmental Monitoring Functions 2 TABLE 1-1 Flash Node Properties 7 TABLE 2-1 System Calls 8 TABLE 2-2 Structure Errors 10 TABLE 2-3...
  • 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...
  • Page 9: Preface

    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...
  • Page 13: Environmental Monitoring

    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”...
  • Page 14: 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...
  • Page 17: Flash Device Driver

    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”...
  • Page 18: 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.
  • Page 19: Openboot Prom Device Tree And Properties

    00 08 00 00 00 08 00 00 boot-window 00 00 00 00 00 08 00 00 bank-size 00080000 version OBP 4.21.0 2005/11/22 16:48 Netra CP3010 OBDIAG 4.x.0 2005/11/22 17:00 POST 4.50.48 2005/11/22 17:12 name flashprom compatible isa-flashprom 00000002 00000000 00100000...
  • Page 20: Interface (Header) File

    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 ■...
  • Page 21: Using Structures In Ioctl Arguments

    The following ioctl commands are supported: #define UIOCIBLK (uflashIOC|0) /* identify */ #define UIOCQBLK (uflashIOC|1) /* query a block */ #define UIOCLBLK (uflashIOC|2) /* lock a block */ #define UIOCCLCK (uflashIOC|4) /* clear all locks */ #define UIOCEBLK (uflashIOC|5) /* erase a block */ The following ioctl commands are not supported: #define UIOCMLCK (uflashIOC|3) /* master lock */...
  • Page 22: Resolving Structure Errors

    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...
  • Page 23: Developing Programs

    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...
  • Page 25: Example Write Program

    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>...
  • Page 32 (ioctl(fd, UIOCIBLK, &uflash_if) == -1) goto getout; fprintf(stderr, "manufacturer id = 0x%x, device id =\ 0x%x\n# of blks = %d, blk size = 0x%x\n", uflash_if.info.mfr_id & 0xFF, uflash_if.info.dev_id & 0xFF, uflash_if.info.blk_num, uflash_if.info.blk_size); break; Netra CP3010 Board Programming Guide • January 2006...
  • Page 33 Flash Application Program (Continued) CODE EXAMPLE 2-6 case ’1’: /* write to user flash PROM */ fprintf(stderr, "Enter PROM offset[0, 0xXX,XXXX]> "); scanf ("%x", &offset); fprintf(stderr, "Enter number of bytes[hex]> "); scanf ("%x", &size); fprintf(stderr, "Enter data pattern[0, 0xFF]> "); scanf ("%x", &pat);...
  • Page 34 ("\nuser data buffer:\n"); for (i = 0; i < size; i++) { printf("%2x ", r_buf[i] & 0xff); printf("\n"); default: continue; /* exit */ getout: close(fd0); return; } /* end of main() */ Netra CP3010 Board Programming Guide • January 2006...
  • Page 35 Index Symbols erase feature, 6 erase programs, 11 ,Filename | Command>ioctl commands, 9 error messages, 10 exhaust sensor, 3 address range, 8 air temperature, local, 3 flash chip, 8 alarm and shutdown temperatures, 2 flash device applications, storing data, 6 accessing, 8 driver, 5 files, 7...
  • Page 36 user flash address, 8 user parameters, 10 lock feature, 6 logical blocks, 6 voltage, 1 voltage controller, 2 OpenBoot PROM and user flash, 7 voltage monitoring circuit, 2 OpenBoot PROM device node, 7 OpenBoot PROM image, storing copies, 8 write programs, 11 partitions, flash memory, 8 power requirements, 2 processing data, 6...

Table of Contents