Sun Microsystems CP2500 manual User Flash Driver, OpenBoot Prom Device Tree and Properties

Page 58

User Flash Driver

The uflash is the device driver for the flash PROM device on the Netra CP2500. Access to the driver is carried out through open, read, write, pread, pwrite and ioctl system interfaces.

On the Netra CP2500, one device is supported. There is one logical device file for the physical device that can be accessed from applications. Users can use this device for storing applications and data.

An instance of the driver is loaded for the device. The driver blocks any reads to the device while a write is in progress. Multiple, concurrent reads can go through to the same device at the same time. Writes to a device occur one at a time. All read and write operations are supported at this time.

The device also supports erase and lock features. Applications can use them through the IOCTL interface. The device is divided into logical blocks. Applications that issue these operations also supply a block number or a range of blocks that are a target of these operations. Locks are preserved across reboots. Locking a block prevents an erase or write operation on that block.

OpenBoot PROM Device Tree and Properties

This section provides information on the user flash OpenBoot PROM device node and its properties.

The user flash OpenBoot PROM device node is

/pci@1e,600000/isa@7/flashprom@2,0.

See TABLE 3-1for the user flash node properties.

TABLE 3-1User Flash Node Properties

Property

Description/Value

 

 

sunw,location

U38

system-banks

00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 03

flash-banks

00 00 00 00 00 00 00 1f

write-window

00 08 00 00 00 08 00 00

boot-banks

00 00 00 00 00 00 00 02 00 00 00 04 00 00 00 06

boot-window

00 00 00 00 00 08 00 00

 

 

44 Netra CP2500 Board Programming Guide • March 2007

Image 58
Contents Netra CP2500 Board Programming Guide Page Contents User Flash Figures Vi Netra CP2500 Board Programming Guide March Tables Viii Netra CP2500 Board Programming Guide March Code Samples Netra CP2500 Board Programming Guide March Preface How This Book Is OrganizedUsing Unix Commands Typographic ConventionsShell Prompts Related DocumentationThird-Party Web Sites Documentation, Support, and TrainingSun Welcomes Your Comments Watchdog Timer OverviewPicl Plug-In Module 1Watchdog Plug-In Interfaces for Netra CP2500 Board Software 2Properties Under watchdog-controllerNode3Properties Under watchdog-timerNode HEALTHY#Watchdog Node Management Code Code Example 1-1System Watchdog Node Management Code ExampleCode Example 1-1System Watchdog Node Management Code Example Usagestr Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Null Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Code Example 1-1System Watchdog Node Management Code Example Notreached Code Example 1-1System Watchdog Node Management Code Example OpenBoot Prom Interface Netra CP2500 Board Programming Guide March Environmental Monitoring Typical Environmental Monitoring System Application Environmental Monitoring Component Compatibility1Compatible Environmental Monitoring Components I2C Typical Cycle From Power Up to Shutdown Environmental Monitoring Protection at the OpenBoot PromPost Shutdown Recovery Hardware Environmental Monitoring Functions 3I2C ComponentsEnvironmental Monitoring CPU Switching Power On and Off Inlet, Exhaust, and CPU Temperature MonitoringNetra CP2500 Board Programming Guide March OpenBoot Prom Environmental Monitoring Critical Temperature Response at OpenBoot PromUsing the show-sensorsCommand at OpenBoot Prom Environmental Monitoring Application ProgrammingReading Temperature Sensor States Using 4PICL Temperature Sensor Class Node PropertiesUsing a Configuration File for Sensor Information Solaris Driver InterfaceSample Application Program Code Example 2-1Sample envmond Application ProgramCode Example 2-1Sample envmond Application Program Code Example 2-1Sample envmond Application Program Code Example 2-1Sample envmond Application Program Reading the CPU Temperature Environmental Limits Prtdiag command example5Description of Values Displayed by Solaris Commands User Flash User Flash Usage and ImplementationUser Flash Driver OpenBoot Prom Device Tree and Properties1User Flash Node Properties Interface Header File Application Programming InterfaceUser Flash Device Files 2System CallsStructures to Use in Ioctl Arguments Code Example 3-1PROM Information StructureExample Programs ErrorsCode Example 3-2User Flash Interface Structure Read Example Program Code Example 3-3Read Action on User Flash DeviceWrite Example Program Code Example 3-4Write Action on User Flash DeviceCode Example 3-4Write Action on User Flash Device Block Erase Example Program Code Example 3-5Block Erase Action on User Flash DeviceCode Example 3-5Block Erase Action on User Flash Device Sample User Flash Application Program Code Example 3-6Sample User Flash Application ProgramCode Example 3-6Sample User Flash Application Program Code Example 3-6Sample User Flash Application Program Code Example 3-6Sample User Flash Application Program Code Example 3-6Sample User Flash Application Program Code Example 3-6Sample User Flash Application Program Index PiclWatchdog-controller, 3 Watchdog-timer, 3