C H A P T E R 2 |
User Flash |
This chapter describes the user flash driver for the onboard flash PROMs and how to use it. The Netra CP2000/CP2100 series boards are equipped with user flash memory. This chapter includes the following sections:
The customer can use the flash memory for various purposes such as storage for RTOS, user data storage, OpenBoot PROM information or to store dropins. Dropins simplify customizing a system for the user.
When OpenBoot PROM in system flash is corrupted, and if a backup copy of OpenBoot PROM is stored in user flash, you can switch the SMC switch to boot the OpenBoot PROM from the user flash and then use flash update to get a good OpenBoot PROM image back into the system flash.
A user flash switch SW2501 determines whether the user flash is detected during OpenBoot PROM boot and whether or not it is write-enabled. See Switch Settings for more information.
The user flash includes flash PROM chips that can be programmed by users (see TABLE 2-1).
The address range for 1 x 4MB user flash : 0x1ff.f040.0000 to 0x1ff.f07f.ffff.
The address range for 1 X 8MB flash: 0x1ff.f040.0000 to 0x1ff.f0bf.ffff
TABLE 2-2 lists the compatible releases that support the user flash driver.
The uflash is the device driver for flash PROM devices on the Netra CP2000/CP2100 series boards. Access to the driver is carried out through open, read, write, pread, pwrite and ioctl system interfaces.
Depending on the platform, one or more of these devices are supported. There is one logical device file for each physical device that can be accessed from applications. Users can use these devices for storing applications and data.
When multiple user flash devices are supported by the system, an instance of the driver is loaded per 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 independently of the others. All read and write operations are supported at this time.
Access to the device normally happens a byte at a time. Devices support buffers to speed up writes. The driver automatically switches to the buffer mode, when the feature is available and the request is of sufficient size.
Devices also support erase and lock features. Applications can use them through the IOCTL interface. Devices are 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.
The user flash modules on the Netra boards are write enabled by default. The user flash is detected during OpenBoot PROM boot by default.
See the following documents for more details on switch settings:
This section provides information on the user flash OpenBoot PROM device node and its properties.
User flash OpenBoot PROM device node:
/pci@1f,0/pci@1,1/ebus@1/flashprom@10,800000/pci@1f,0/pci@1,1/ebus@1/flashprom@10,400000
See TABLE 2-3 for the user flash node properties.
The user flash packages are as follows:
These packages are available with the rest of the software on the CP2000 Supplemental CD 4.0 for Solaris 8.
The user flash device files are as follows:
The user flash header file is located in the following path:
/usr/include/sys/uflash_if.h
Access to the user flash device from the Solaris operating environment is through a C program. No command-line tool is available. User programs open these device files and then issue read, write, or ioctl commands to use the user flash device.
The systems calls are listed below in TABLE 2-4.
The ioctl commands are listed below.
The PROM information structure holds device information returned by the driver in response to an identify command.
The user flash user interface structure holds user parameters to commands such as erase.
Example programs are provided in this section for the following actions on user flash device:
CODE EXAMPLE 2-3 contains the Read Action on the user flash device.
CODE EXAMPLE 2-4 contains the Write Action on the user flash device.
CODE EXAMPLE 2-5 contains the Erase Action on the User Flash Device.
CODE EXAMPLE 2-6 contains the Block Erase Action on the user flash device.
You can use the following program to test the user flash device and driver. This program also demonstrates how this device can be used.
Copyright © 2004, Sun Microsystems, Inc. All Rights Reserved.