Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ip22-nvram.c File Reference
#include <linux/module.h>
#include <asm/sgi/hpc3.h>
#include <asm/sgi/ip22.h>

Go to the source code of this file.

Macros

#define EEPROM_READ   0xc000 /* serial memory read */
 
#define EEPROM_WEN   0x9800 /* write enable before prog modes */
 
#define EEPROM_WRITE   0xa000 /* serial memory write */
 
#define EEPROM_WRALL   0x8800 /* write all registers */
 
#define EEPROM_WDS   0x8000 /* disable all programming */
 
#define EEPROM_PRREAD   0xc000 /* read protect register */
 
#define EEPROM_PREN   0x9800 /* enable protect register mode */
 
#define EEPROM_PRCLEAR   0xffff /* clear protect register */
 
#define EEPROM_PRWRITE   0xa000 /* write protect register */
 
#define EEPROM_PRDS   0x8000 /* disable protect register, forever */
 
#define EEPROM_EPROT   0x01 /* Protect register enable */
 
#define EEPROM_CSEL   0x02 /* Chip select */
 
#define EEPROM_ECLK   0x04 /* EEPROM clock */
 
#define EEPROM_DATO   0x08 /* Data out */
 
#define EEPROM_DATI   0x10 /* Data in */
 
#define delay()
 
#define eeprom_cs_on(ptr)
 
#define eeprom_cs_off(ptr)
 
#define BITS_IN_COMMAND   11
 

Functions

unsigned short ip22_eeprom_read (unsigned int *ctrl, int reg)
 
 EXPORT_SYMBOL (ip22_eeprom_read)
 
unsigned short ip22_nvram_read (int reg)
 
 EXPORT_SYMBOL (ip22_nvram_read)
 

Macro Definition Documentation

#define BITS_IN_COMMAND   11

Definition at line 49 of file ip22-nvram.c.

#define delay (   void)
Value:
({ \
int x; \
for (x=0; x<100000; x++) __asm__ __volatile__(""); })

Definition at line 30 of file ip22-nvram.c.

#define eeprom_cs_off (   ptr)
Value:
({ \
__raw_writel(__raw_readl(ptr) & ~EEPROM_ECLK, ptr); \
__raw_writel(__raw_readl(ptr) & ~EEPROM_CSEL, ptr); \
__raw_writel(__raw_readl(ptr) | EEPROM_EPROT, ptr); \
__raw_writel(__raw_readl(ptr) | EEPROM_ECLK, ptr); })

Definition at line 43 of file ip22-nvram.c.

#define eeprom_cs_on (   ptr)
Value:
({ \
__raw_writel(__raw_readl(ptr) & ~EEPROM_DATO, ptr); \
__raw_writel(__raw_readl(ptr) & ~EEPROM_ECLK, ptr); \
__raw_writel(__raw_readl(ptr) & ~EEPROM_EPROT, ptr); \
delay(); \
__raw_writel(__raw_readl(ptr) | EEPROM_CSEL, ptr); \
__raw_writel(__raw_readl(ptr) | EEPROM_ECLK, ptr); })

Definition at line 34 of file ip22-nvram.c.

#define EEPROM_CSEL   0x02 /* Chip select */

Definition at line 24 of file ip22-nvram.c.

#define EEPROM_DATI   0x10 /* Data in */

Definition at line 27 of file ip22-nvram.c.

#define EEPROM_DATO   0x08 /* Data out */

Definition at line 26 of file ip22-nvram.c.

#define EEPROM_ECLK   0x04 /* EEPROM clock */

Definition at line 25 of file ip22-nvram.c.

#define EEPROM_EPROT   0x01 /* Protect register enable */

Definition at line 23 of file ip22-nvram.c.

#define EEPROM_PRCLEAR   0xffff /* clear protect register */

Definition at line 19 of file ip22-nvram.c.

#define EEPROM_PRDS   0x8000 /* disable protect register, forever */

Definition at line 21 of file ip22-nvram.c.

#define EEPROM_PREN   0x9800 /* enable protect register mode */

Definition at line 18 of file ip22-nvram.c.

#define EEPROM_PRREAD   0xc000 /* read protect register */

Definition at line 17 of file ip22-nvram.c.

#define EEPROM_PRWRITE   0xa000 /* write protect register */

Definition at line 20 of file ip22-nvram.c.

#define EEPROM_READ   0xc000 /* serial memory read */

Definition at line 12 of file ip22-nvram.c.

#define EEPROM_WDS   0x8000 /* disable all programming */

Definition at line 16 of file ip22-nvram.c.

#define EEPROM_WEN   0x9800 /* write enable before prog modes */

Definition at line 13 of file ip22-nvram.c.

#define EEPROM_WRALL   0x8800 /* write all registers */

Definition at line 15 of file ip22-nvram.c.

#define EEPROM_WRITE   0xa000 /* serial memory write */

Definition at line 14 of file ip22-nvram.c.

Function Documentation

EXPORT_SYMBOL ( ip22_eeprom_read  )
EXPORT_SYMBOL ( ip22_nvram_read  )
unsigned short ip22_eeprom_read ( unsigned int ctrl,
int  reg 
)

Definition at line 76 of file ip22-nvram.c.

unsigned short ip22_nvram_read ( int  reg)

Definition at line 106 of file ip22-nvram.c.