Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
rtas_flash.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/proc_fs.h>
#include <linux/reboot.h>
#include <asm/delay.h>
#include <asm/uaccess.h>
#include <asm/rtas.h>

Go to the source code of this file.

Data Structures

struct  flash_block
 
struct  flash_block_list
 
struct  rtas_update_flash_t
 
struct  rtas_manage_flash_t
 
struct  rtas_validate_flash_t
 

Macros

#define MODULE_VERS   "1.0"
 
#define MODULE_NAME   "rtas_flash"
 
#define FIRMWARE_FLASH_NAME   "firmware_flash"
 
#define FIRMWARE_UPDATE_NAME   "firmware_update"
 
#define MANAGE_FLASH_NAME   "manage_flash"
 
#define VALIDATE_FLASH_NAME   "validate_flash"
 
#define RTAS_RC_SUCCESS   0
 
#define RTAS_RC_HW_ERR   -1
 
#define RTAS_RC_BUSY   -2
 
#define FLASH_AUTH   -9002 /* RTAS Not Service Authority Partition */
 
#define FLASH_NO_OP   -1099 /* No operation initiated by user */
 
#define FLASH_IMG_SHORT   -1005 /* Flash image shorter than expected */
 
#define FLASH_IMG_BAD_LEN   -1004 /* Bad length value in flash list block */
 
#define FLASH_IMG_NULL_DATA   -1003 /* Bad data value in flash list block */
 
#define FLASH_IMG_READY   0 /* Firmware img ready for flash on reboot */
 
#define MANAGE_AUTH   -9002 /* RTAS Not Service Authority Partition */
 
#define MANAGE_ACTIVE_ERR   -9001 /* RTAS Cannot Overwrite Active Img */
 
#define MANAGE_NO_OP   -1099 /* No operation initiated by user */
 
#define MANAGE_PARAM_ERR   -3 /* RTAS Parameter Error */
 
#define MANAGE_HW_ERR   -1 /* RTAS Hardware Error */
 
#define VALIDATE_AUTH   -9002 /* RTAS Not Service Authority Partition */
 
#define VALIDATE_NO_OP   -1099 /* No operation initiated by the user */
 
#define VALIDATE_INCOMPLETE   -1002 /* User copied < VALIDATE_BUF_SIZE */
 
#define VALIDATE_READY   -1001 /* Firmware image ready for validation */
 
#define VALIDATE_PARAM_ERR   -3 /* RTAS Parameter Error */
 
#define VALIDATE_HW_ERR   -1 /* RTAS Hardware Error */
 
#define VALIDATE_TMP_UPDATE   0 /* Validate Return Status */
 
#define VALIDATE_FLASH_AUTH   1 /* Validate Return Status */
 
#define VALIDATE_INVALID_IMG   2 /* Validate Return Status */
 
#define VALIDATE_CUR_UNKNOWN   3 /* Validate Return Status */
 
#define VALIDATE_TMP_COMMIT_DL   4 /* Validate Return Status */
 
#define VALIDATE_TMP_COMMIT   5 /* Validate Return Status */
 
#define VALIDATE_TMP_UPDATE_DL   6 /* Validate Return Status */
 
#define RTAS_REJECT_TMP_IMG   0
 
#define RTAS_COMMIT_TMP_IMG   1
 
#define VALIDATE_BUF_SIZE   4096
 
#define RTAS_MSG_MAXLEN   64
 
#define RTAS_BLKLIST_LENGTH   4096
 
#define RTAS_BLK_SIZE   4096
 
#define FLASH_BLOCKS_PER_NODE   ((RTAS_BLKLIST_LENGTH - 16) / sizeof(struct flash_block))
 
#define FLASH_BLOCK_LIST_VERSION   (1UL)
 

Functions

void rtas_block_ctor (void *ptr)
 
 module_init (rtas_flash_init)
 
 module_exit (rtas_flash_cleanup)
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define FIRMWARE_FLASH_NAME   "firmware_flash"

Definition at line 28 of file rtas_flash.c.

#define FIRMWARE_UPDATE_NAME   "firmware_update"

Definition at line 29 of file rtas_flash.c.

#define FLASH_AUTH   -9002 /* RTAS Not Service Authority Partition */

Definition at line 39 of file rtas_flash.c.

#define FLASH_BLOCK_LIST_VERSION   (1UL)

Definition at line 103 of file rtas_flash.c.

#define FLASH_BLOCKS_PER_NODE   ((RTAS_BLKLIST_LENGTH - 16) / sizeof(struct flash_block))

Definition at line 91 of file rtas_flash.c.

#define FLASH_IMG_BAD_LEN   -1004 /* Bad length value in flash list block */

Definition at line 42 of file rtas_flash.c.

#define FLASH_IMG_NULL_DATA   -1003 /* Bad data value in flash list block */

Definition at line 43 of file rtas_flash.c.

#define FLASH_IMG_READY   0 /* Firmware img ready for flash on reboot */

Definition at line 44 of file rtas_flash.c.

#define FLASH_IMG_SHORT   -1005 /* Flash image shorter than expected */

Definition at line 41 of file rtas_flash.c.

#define FLASH_NO_OP   -1099 /* No operation initiated by user */

Definition at line 40 of file rtas_flash.c.

#define MANAGE_ACTIVE_ERR   -9001 /* RTAS Cannot Overwrite Active Img */

Definition at line 48 of file rtas_flash.c.

#define MANAGE_AUTH   -9002 /* RTAS Not Service Authority Partition */

Definition at line 47 of file rtas_flash.c.

#define MANAGE_FLASH_NAME   "manage_flash"

Definition at line 30 of file rtas_flash.c.

#define MANAGE_HW_ERR   -1 /* RTAS Hardware Error */

Definition at line 51 of file rtas_flash.c.

#define MANAGE_NO_OP   -1099 /* No operation initiated by user */

Definition at line 49 of file rtas_flash.c.

#define MANAGE_PARAM_ERR   -3 /* RTAS Parameter Error */

Definition at line 50 of file rtas_flash.c.

#define MODULE_NAME   "rtas_flash"

Definition at line 26 of file rtas_flash.c.

#define MODULE_VERS   "1.0"

Definition at line 25 of file rtas_flash.c.

#define RTAS_BLK_SIZE   4096

Definition at line 78 of file rtas_flash.c.

#define RTAS_BLKLIST_LENGTH   4096

Definition at line 77 of file rtas_flash.c.

#define RTAS_COMMIT_TMP_IMG   1

Definition at line 70 of file rtas_flash.c.

#define RTAS_MSG_MAXLEN   64

Definition at line 74 of file rtas_flash.c.

#define RTAS_RC_BUSY   -2

Definition at line 36 of file rtas_flash.c.

#define RTAS_RC_HW_ERR   -1

Definition at line 35 of file rtas_flash.c.

#define RTAS_RC_SUCCESS   0

Definition at line 34 of file rtas_flash.c.

#define RTAS_REJECT_TMP_IMG   0

Definition at line 69 of file rtas_flash.c.

#define VALIDATE_AUTH   -9002 /* RTAS Not Service Authority Partition */

Definition at line 54 of file rtas_flash.c.

#define VALIDATE_BUF_SIZE   4096

Definition at line 73 of file rtas_flash.c.

#define VALIDATE_CUR_UNKNOWN   3 /* Validate Return Status */

Definition at line 63 of file rtas_flash.c.

#define VALIDATE_FLASH_AUTH   1 /* Validate Return Status */

Definition at line 61 of file rtas_flash.c.

#define VALIDATE_FLASH_NAME   "validate_flash"

Definition at line 31 of file rtas_flash.c.

#define VALIDATE_HW_ERR   -1 /* RTAS Hardware Error */

Definition at line 59 of file rtas_flash.c.

#define VALIDATE_INCOMPLETE   -1002 /* User copied < VALIDATE_BUF_SIZE */

Definition at line 56 of file rtas_flash.c.

#define VALIDATE_INVALID_IMG   2 /* Validate Return Status */

Definition at line 62 of file rtas_flash.c.

#define VALIDATE_NO_OP   -1099 /* No operation initiated by the user */

Definition at line 55 of file rtas_flash.c.

#define VALIDATE_PARAM_ERR   -3 /* RTAS Parameter Error */

Definition at line 58 of file rtas_flash.c.

#define VALIDATE_READY   -1001 /* Firmware image ready for validation */

Definition at line 57 of file rtas_flash.c.

#define VALIDATE_TMP_COMMIT   5 /* Validate Return Status */

Definition at line 65 of file rtas_flash.c.

#define VALIDATE_TMP_COMMIT_DL   4 /* Validate Return Status */

Definition at line 64 of file rtas_flash.c.

#define VALIDATE_TMP_UPDATE   0 /* Validate Return Status */

Definition at line 60 of file rtas_flash.c.

#define VALIDATE_TMP_UPDATE_DL   6 /* Validate Return Status */

Definition at line 66 of file rtas_flash.c.

Function Documentation

module_exit ( rtas_flash_cleanup  )
module_init ( rtas_flash_init  )
MODULE_LICENSE ( "GPL"  )
void rtas_block_ctor ( void ptr)

Definition at line 272 of file rtas_flash.c.