Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

rng_rnga.h

/*
 * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
 */

/*
 * The code contained herein is licensed under the GNU General Public
 * License. You may obtain a copy of the GNU General Public License
 * Version 2 or later at the following locations:
 *
 * http://www.opensource.org/licenses/gpl-license.html
 * http://www.gnu.org/copyleft/gpl.html
 */

#ifndef RNG_RNGA_H
#define RNG_RNGA_H

/*! @defgroup rngaregs RNGA Registers
 *  @ingroup RNG
 * These are the definitions for the RNG registers and their offsets
 * within the RNG.  They are used in the @c register_offset parameter of
 * #rng_read_register() and #rng_write_register().
 */
/*! @addtogroup rngaregs */
/*! @{ */

/*! Control Register.  See @ref rngacontrolreg.  */
00027 #define RNGA_CONTROL                    0x00
/*! Status Register. See @ref rngastatusreg. */
00029 #define RNGA_STATUS                     0x04
/*! Register for adding to the Entropy of the RNG */
00031 #define RNGA_ENTROPY                    0x08
/*! Register containing latest 32 bits of random value */
00033 #define RNGA_OUTPUT_FIFO                0x0c
/*! Mode Register.  Non-secure mode access only.  See @ref rngmodereg. */
00035 #define RNGA_MODE                       0x10
/*! Verification Control Register.  Non-secure mode access only.  See
 *  @ref rngvfctlreg. */
00038 #define RNGA_VERIFICATION_CONTROL       0x14
/*! Oscillator Control Counter Register.  Non-secure mode access only.
 *  See @ref rngosccntctlreg. */
00041 #define RNGA_OSCILLATOR_CONTROL_COUNTER 0x18
/*! Oscillator 1 Counter Register.  Non-secure mode access only.  See
 *  @ref rngosccntreg. */
00044 #define RNGA_OSCILLATOR1_COUNTER        0x1c
/*! Oscillator 2 Counter Register.  Non-secure mode access only.  See
 *  @ref rngosccntreg. */
00047 #define RNGA_OSCILLATOR2_COUNTER        0x20
/*! Oscillator Counter Status Register.  Non-secure mode access only.  See
 *  @ref rngosccntstatreg. */
00050 #define RNGA_OSCILLATOR_COUNTER_STATUS  0x24
/*! @} */

/*! Total address space of the RNGA, in bytes */
#define RNG_ADDRESS_RANGE 0x28

/*! @defgroup rngacontrolreg RNGA Control Register Definitions
 *  @ingroup RNG
 */
/*! @addtogroup rngacontrolreg */
/*! @{ */
/*! These bits are unimplemented or reserved */
00062 #define RNGA_CONTROL_ZEROS_MASK      0x0fffffe0
/*! 'RNG type' - should be 0 for RNGA */
00064 #define RNGA_CONTROL_RNG_TYPE_MASK   0xf0000000
/*! Number of bits to shift the type to get it to LSB */
00066 #define RNGA_CONTROL_RNG_TYPE_SHIFT  28
/*! Put RNG to sleep */
00068 #define RNGA_CONTROL_SLEEP           0x00000010
/*! Clear interrupt & status */
00070 #define RNGA_CONTROL_CLEAR_INTERRUPT 0x00000008
/*! Mask interrupt generation */
00072 #define RNGA_CONTROL_MASK_INTERRUPTS 0x00000004
/*! Enter into Secure Mode.  Notify SCC of security violation should FIFO
 *  underflow occur. */
00075 #define RNGA_CONTROL_HIGH_ASSURANCE  0x00000002
/*! Load data into FIFO */
00077 #define RNGA_CONTROL_GO              0x00000001
/*! @} */

/*! @defgroup rngastatusreg RNGA Status Register Definitions
 *  @ingroup RNG
 */
/*! @addtogroup rngastatusreg */
/*! @{ */
/*! RNG Oscillator not working */
00086 #define RNGA_STATUS_OSCILLATOR_DEAD         0x80000000
/*! These bits are undefined or reserved */
00088 #define RNGA_STATUS_ZEROS1_MASK             0x7f000000
/*! How big FIFO is, in bytes */
00090 #define RNGA_STATUS_OUTPUT_FIFO_SIZE_MASK   0x00ff0000
/*! How many bits right to shift fifo size to make it LSB */
00092 #define RNGA_STATUS_OUTPUT_FIFO_SIZE_SHIFT  16
/*! How many bytes are currently in the FIFO */
00094 #define RNGA_STATUS_OUTPUT_FIFO_LEVEL_MASK  0x0000ff00
/*! How many bits right to shift fifo level to make it LSB */
00096 #define RNGA_STATUS_OUTPUT_FIFO_LEVEL_SHIFT 8
/*! These bits are undefined or reserved. */
00098 #define RNGA_STATUS_ZEROS2_MASK             0x000000e0
/*! RNG is sleeping. */
00100 #define RNGA_STATUS_SLEEP                   0x00000010
/*! Error detected. */
00102 #define RNGA_STATUS_ERROR_INTERRUPT         0x00000008
/*! FIFO was empty on some read since last status read. */
00104 #define RNGA_STATUS_FIFO_UNDERFLOW          0x00000004
/*! FIFO was empty on most recent read. */
00106 #define RNGA_STATUS_LAST_READ_STATUS        0x00000002
/*! Security violation occurred.  Will only happen in High Assurance mode.  */
00108 #define RNGA_STATUS_SECURITY_VIOLATION      0x00000001
/*! @} */

/*! @defgroup rngmodereg RNG Mode Register Definitions
 *  @ingroup RNG
 */
/*! @addtogroup rngmodereg */
/*! @{ */
/*! These bits are undefined or reserved */
00117 #define RNGA_MODE_ZEROS_MASK                0xfffffffc
/*! RNG is in / put RNG in Oscillator Frequency Test Mode. */
00119 #define RNGA_MODE_OSCILLATOR_FREQ_TEST      0x00000002
/*! Put RNG in verification mode / RNG is in verification mode. */
00121 #define RNGA_MODE_VERIFICATION              0x00000001
/*! @} */

/*! @defgroup rngvfctlreg RNG Verification Control Register Definitions
 *  @ingroup RNG
 */
/*! @addtogroup rngvfctlreg */
/*! @{ */
/*! These bits are undefined or reserved. */
00130 #define RNGA_VFCTL_ZEROS_MASK               0xfffffff8
/*! Reset the shift registers. */
00132 #define RNGA_VFCTL_RESET_SHIFT_REGISTERS    0x00000004
/*! Drive shift registers from system clock. */
00134 #define RNGA_VFCTL_FORCE_SYSTEM_CLOCK       0x00000002
/*! Turn off shift register clocks. */
00136 #define RNGA_VFCTL_SHIFT_CLOCK_OFF          0x00000001
/*! @} */

/*!
 * @defgroup rngosccntctlreg RNG Oscillator Counter Control Register Definitions
 * @ingroup RNG
 */
/*! @addtogroup rngosccntctlreg */
/*! @{ */
/*! These bits are undefined or reserved. */
00146 #define RNGA_OSCCR_ZEROS_MASK               0xfffc0000
/*! Bits containing clock cycle counter */
00148 #define RNGA_OSCCR_CLOCK_CYCLES_MASK        0x0003ffff
/*! Bits to shift right RNG_OSCCR_CLOCK_CYCLES_MASK */
00150 #define RNGA_OSCCR_CLOCK_CYCLES_SHIFT       0
/*! @} */

/*!
 * @defgroup rngosccntreg RNG Oscillator (1 and 2) Counter Register Definitions
 * @ingroup RNG
 */
/*! @addtogroup rngosccntreg */
/*! @{ */
/*! These bits are undefined or reserved. */
00160 #define RNGA_COUNTER_ZEROS_MASK             0xfff00000
/*! Bits containing number of clock pulses received from the oscillator. */
00162 #define RNGA_COUNTER_PULSES_MASK            0x000fffff
/*! Bits right to shift RNG_COUNTER_PULSES_MASK to make it LSB. */
00164 #define RNGA_COUNTER_PULSES_SHIFT           0
/*! @} */

/*!
 * @defgroup rngosccntstatreg RNG Oscillator Counter Status Register Definitions
 * @ingroup RNG
 */
/*! @addtogroup rngosccntstatreg */
/*! @{ */
/*! These bits are undefined or reserved. */
00174 #define RNGA_COUNTER_STATUS_ZEROS_MASK      0xfffffffc
/*! Oscillator 2 has toggled 0x400 times */
00176 #define RNGA_COUNTER_STATUS_OSCILLATOR2     0x00000002
/*! Oscillator 1 has toggled 0x400 times */
00178 #define RNGA_COUNTER_STATUS_OSCILLATOR1     0x00000001
/*! @} */

#endif                        /* RNG_RNGA_H */

Generated by  Doxygen 1.6.0   Back to index