ngpixis.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * Copyright 2010 Freescale Semiconductor
  3. * Author: Timur Tabi <timur@freescale.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the Free
  7. * Software Foundation; either version 2 of the License, or (at your option)
  8. * any later version.
  9. *
  10. * This file provides support for the ngPIXIS, a board-specific FPGA used on
  11. * some Freescale reference boards.
  12. */
  13. /* ngPIXIS register set. Hopefully, this won't change too much over time.
  14. * Feel free to add board-specific #ifdefs where necessary.
  15. */
  16. typedef struct ngpixis {
  17. u8 id;
  18. u8 arch;
  19. u8 scver;
  20. u8 csr;
  21. u8 rst;
  22. u8 res1;
  23. u8 aux;
  24. u8 spd;
  25. u8 brdcfg0;
  26. u8 brdcfg1; /* On some boards, this register is called 'dma' */
  27. u8 addr;
  28. u8 res2[2];
  29. u8 data;
  30. u8 led;
  31. u8 res3;
  32. u8 vctl;
  33. u8 vstat;
  34. u8 vcfgen0;
  35. u8 res4;
  36. u8 ocmcsr;
  37. u8 ocmmsg;
  38. u8 gmdbg;
  39. u8 res5[2];
  40. u8 sclk[3];
  41. u8 dclk[3];
  42. u8 watch;
  43. struct {
  44. u8 sw;
  45. u8 en;
  46. } s[8];
  47. } __attribute__ ((packed)) ngpixis_t;
  48. /* Pointer to the PIXIS register set */
  49. #define pixis ((ngpixis_t *)PIXIS_BASE)
  50. /* The PIXIS SW register that corresponds to board switch X, where x >= 1 */
  51. #define PIXIS_SW(x) (pixis->s[(x) - 1].sw)
  52. /* The PIXIS EN register that corresponds to board switch X, where x >= 1 */
  53. #define PIXIS_EN(x) (pixis->s[(x) - 1].en)