rng.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * RNG Memory Map
  3. *
  4. * Copyright (C) 2004-2008 Freescale Semiconductor, Inc.
  5. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #ifndef __RNG_H__
  26. #define __RNG_H__
  27. /* Random Number Generator */
  28. typedef struct rng_ctrl {
  29. u32 cr; /* 0x00 Control */
  30. u32 sr; /* 0x04 Status */
  31. u32 er; /* 0x08 Entropy */
  32. u32 out; /* 0x0C Output FIFO */
  33. } rng_t;
  34. #define RNG_CR_SLM (0x00000010) /* Sleep mode - 5445x */
  35. #define RNG_CR_CI (0x00000008) /* Clear interrupt */
  36. #define RNG_CR_IM (0x00000004) /* Interrupt mask */
  37. #define RNG_CR_HA (0x00000002) /* High assurance */
  38. #define RNG_CR_GO (0x00000001) /* Go bit */
  39. #define RNG_SR_OFS(x) (((x) & 0x000000FF) << 16)
  40. #define RNG_SR_OFS_MASK (0xFF00FFFF)
  41. #define RNG_SR_OFL(x) (((x) & 0x000000FF) << 8)
  42. #define RNG_SR_OFL_MASK (0xFFFF00FF)
  43. #define RNG_SR_EI (0x00000008)
  44. #define RNG_SR_FUF (0x00000004)
  45. #define RNG_SR_LRS (0x00000002)
  46. #define RNG_SR_SV (0x00000001)
  47. #endif /* __RNG_H__ */