Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
n2rng.h File Reference

Go to the source code of this file.

Data Structures

struct  n2rng_unit
 
struct  n2rng
 

Macros

#define RNG_CTL_WAIT   0x0000000001fffe00ULL /* Minimum wait time */
 
#define RNG_CTL_WAIT_SHIFT   9
 
#define RNG_CTL_BYPASS   0x0000000000000100ULL /* VCO voltage source */
 
#define RNG_CTL_VCO   0x00000000000000c0ULL /* VCO rate control */
 
#define RNG_CTL_VCO_SHIFT   6
 
#define RNG_CTL_ASEL   0x0000000000000030ULL /* Analog MUX select */
 
#define RNG_CTL_ASEL_SHIFT   4
 
#define RNG_CTL_LFSR   0x0000000000000008ULL /* Use LFSR or plain shift */
 
#define RNG_CTL_ES3   0x0000000000000004ULL /* Enable entropy source 3 */
 
#define RNG_CTL_ES2   0x0000000000000002ULL /* Enable entropy source 2 */
 
#define RNG_CTL_ES1   0x0000000000000001ULL /* Enable entropy source 1 */
 
#define HV_FAST_RNG_GET_DIAG_CTL   0x130
 
#define HV_FAST_RNG_CTL_READ   0x131
 
#define HV_FAST_RNG_CTL_WRITE   0x132
 
#define HV_FAST_RNG_DATA_READ_DIAG   0x133
 
#define HV_FAST_RNG_DATA_READ   0x134
 
#define HV_RNG_STATE_UNCONFIGURED   0
 
#define HV_RNG_STATE_CONFIGURED   1
 
#define HV_RNG_STATE_HEALTHCHECK   2
 
#define HV_RNG_STATE_ERROR   3
 
#define HV_RNG_NUM_CONTROL   4
 
#define N2RNG_FLAG_MULTI   0x00000001 /* Multi-unit capable RNG */
 
#define N2RNG_FLAG_CONTROL   0x00000002 /* Operating in control domain */
 
#define N2RNG_FLAG_READY   0x00000008 /* Ready for hw-rng layer */
 
#define N2RNG_FLAG_SHUTDOWN   0x00000010 /* Driver unregistering */
 
#define N2RNG_FLAG_BUFFER_VALID   0x00000020 /* u32 buffer holds valid data */
 
#define N2RNG_HEALTH_CHECK_SEC_DEFAULT   0
 
#define N2RNG_ACCUM_CYCLES_DEFAULT   2048
 
#define N2RNG_WD_TIMEO_DEFAULT   0
 
#define SELFTEST_TICKS   38859
 
#define SELFTEST_VAL   ((u64)0xB8820C7BD387E32C)
 
#define SELFTEST_POLY   ((u64)0x231DCEE91262B8A3)
 
#define SELFTEST_MATCH_GOAL   6
 
#define SELFTEST_LOOPS_MAX   40000
 
#define SELFTEST_BUFFER_WORDS   8
 
#define N2RNG_BLOCK_LIMIT   60000
 
#define N2RNG_BUSY_LIMIT   100
 
#define N2RNG_HCHECK_LIMIT   100
 

Functions

unsigned long sun4v_rng_get_diag_ctl (void)
 
unsigned long sun4v_rng_ctl_read_v1 (unsigned long ctl_regs_ra, unsigned long *state, unsigned long *tick_delta)
 
unsigned long sun4v_rng_ctl_read_v2 (unsigned long ctl_regs_ra, unsigned long unit, unsigned long *state, unsigned long *tick_delta, unsigned long *watchdog, unsigned long *write_status)
 
unsigned long sun4v_rng_ctl_write_v1 (unsigned long ctl_regs_ra, unsigned long state, unsigned long write_timeout, unsigned long *tick_delta)
 
unsigned long sun4v_rng_ctl_write_v2 (unsigned long ctl_regs_ra, unsigned long state, unsigned long write_timeout, unsigned long unit)
 
unsigned long sun4v_rng_data_read_diag_v1 (unsigned long data_ra, unsigned long len, unsigned long *tick_delta)
 
unsigned long sun4v_rng_data_read_diag_v2 (unsigned long data_ra, unsigned long len, unsigned long unit, unsigned long *tick_delta)
 
unsigned long sun4v_rng_data_read (unsigned long data_ra, unsigned long *tick_delta)
 

Macro Definition Documentation

#define HV_FAST_RNG_CTL_READ   0x131

Definition at line 22 of file n2rng.h.

#define HV_FAST_RNG_CTL_WRITE   0x132

Definition at line 23 of file n2rng.h.

#define HV_FAST_RNG_DATA_READ   0x134

Definition at line 25 of file n2rng.h.

#define HV_FAST_RNG_DATA_READ_DIAG   0x133

Definition at line 24 of file n2rng.h.

#define HV_FAST_RNG_GET_DIAG_CTL   0x130

Definition at line 21 of file n2rng.h.

#define HV_RNG_NUM_CONTROL   4

Definition at line 32 of file n2rng.h.

#define HV_RNG_STATE_CONFIGURED   1

Definition at line 28 of file n2rng.h.

#define HV_RNG_STATE_ERROR   3

Definition at line 30 of file n2rng.h.

#define HV_RNG_STATE_HEALTHCHECK   2

Definition at line 29 of file n2rng.h.

#define HV_RNG_STATE_UNCONFIGURED   0

Definition at line 27 of file n2rng.h.

#define N2RNG_ACCUM_CYCLES_DEFAULT   2048

Definition at line 95 of file n2rng.h.

#define N2RNG_BLOCK_LIMIT   60000

Definition at line 112 of file n2rng.h.

#define N2RNG_BUSY_LIMIT   100

Definition at line 113 of file n2rng.h.

#define N2RNG_FLAG_BUFFER_VALID   0x00000020 /* u32 buffer holds valid data */

Definition at line 75 of file n2rng.h.

#define N2RNG_FLAG_CONTROL   0x00000002 /* Operating in control domain */

Definition at line 72 of file n2rng.h.

#define N2RNG_FLAG_MULTI   0x00000001 /* Multi-unit capable RNG */

Definition at line 71 of file n2rng.h.

#define N2RNG_FLAG_READY   0x00000008 /* Ready for hw-rng layer */

Definition at line 73 of file n2rng.h.

#define N2RNG_FLAG_SHUTDOWN   0x00000010 /* Driver unregistering */

Definition at line 74 of file n2rng.h.

#define N2RNG_HCHECK_LIMIT   100

Definition at line 114 of file n2rng.h.

#define N2RNG_HEALTH_CHECK_SEC_DEFAULT   0

Definition at line 94 of file n2rng.h.

#define N2RNG_WD_TIMEO_DEFAULT   0

Definition at line 96 of file n2rng.h.

#define RNG_CTL_ASEL   0x0000000000000030ULL /* Analog MUX select */

Definition at line 14 of file n2rng.h.

#define RNG_CTL_ASEL_SHIFT   4

Definition at line 15 of file n2rng.h.

#define RNG_CTL_BYPASS   0x0000000000000100ULL /* VCO voltage source */

Definition at line 11 of file n2rng.h.

#define RNG_CTL_ES1   0x0000000000000001ULL /* Enable entropy source 1 */

Definition at line 19 of file n2rng.h.

#define RNG_CTL_ES2   0x0000000000000002ULL /* Enable entropy source 2 */

Definition at line 18 of file n2rng.h.

#define RNG_CTL_ES3   0x0000000000000004ULL /* Enable entropy source 3 */

Definition at line 17 of file n2rng.h.

#define RNG_CTL_LFSR   0x0000000000000008ULL /* Use LFSR or plain shift */

Definition at line 16 of file n2rng.h.

#define RNG_CTL_VCO   0x00000000000000c0ULL /* VCO rate control */

Definition at line 12 of file n2rng.h.

#define RNG_CTL_VCO_SHIFT   6

Definition at line 13 of file n2rng.h.

#define RNG_CTL_WAIT   0x0000000001fffe00ULL /* Minimum wait time */

Definition at line 9 of file n2rng.h.

#define RNG_CTL_WAIT_SHIFT   9

Definition at line 10 of file n2rng.h.

#define SELFTEST_BUFFER_WORDS   8

Definition at line 105 of file n2rng.h.

#define SELFTEST_LOOPS_MAX   40000

Definition at line 104 of file n2rng.h.

#define SELFTEST_MATCH_GOAL   6

Definition at line 103 of file n2rng.h.

#define SELFTEST_POLY   ((u64)0x231DCEE91262B8A3)

Definition at line 102 of file n2rng.h.

#define SELFTEST_TICKS   38859

Definition at line 100 of file n2rng.h.

#define SELFTEST_VAL   ((u64)0xB8820C7BD387E32C)

Definition at line 101 of file n2rng.h.

Function Documentation

unsigned long sun4v_rng_ctl_read_v1 ( unsigned long  ctl_regs_ra,
unsigned long state,
unsigned long tick_delta 
)
unsigned long sun4v_rng_ctl_read_v2 ( unsigned long  ctl_regs_ra,
unsigned long  unit,
unsigned long state,
unsigned long tick_delta,
unsigned long watchdog,
unsigned long write_status 
)
unsigned long sun4v_rng_ctl_write_v1 ( unsigned long  ctl_regs_ra,
unsigned long  state,
unsigned long  write_timeout,
unsigned long tick_delta 
)
unsigned long sun4v_rng_ctl_write_v2 ( unsigned long  ctl_regs_ra,
unsigned long  state,
unsigned long  write_timeout,
unsigned long  unit 
)
unsigned long sun4v_rng_data_read ( unsigned long  data_ra,
unsigned long tick_delta 
)
unsigned long sun4v_rng_data_read_diag_v1 ( unsigned long  data_ra,
unsigned long  len,
unsigned long tick_delta 
)
unsigned long sun4v_rng_data_read_diag_v2 ( unsigned long  data_ra,
unsigned long  len,
unsigned long  unit,
unsigned long tick_delta 
)
unsigned long sun4v_rng_get_diag_ctl ( void  )