spi.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * This file is part of wl1251
  3. *
  4. * Copyright (c) 1998-2007 Texas Instruments Incorporated
  5. * Copyright (C) 2008 Nokia Corporation
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. *
  21. */
  22. #ifndef __WL1251_SPI_H__
  23. #define __WL1251_SPI_H__
  24. #include "cmd.h"
  25. #include "acx.h"
  26. #include "reg.h"
  27. #define WSPI_CMD_READ 0x40000000
  28. #define WSPI_CMD_WRITE 0x00000000
  29. #define WSPI_CMD_FIXED 0x20000000
  30. #define WSPI_CMD_BYTE_LENGTH 0x1FFE0000
  31. #define WSPI_CMD_BYTE_LENGTH_OFFSET 17
  32. #define WSPI_CMD_BYTE_ADDR 0x0001FFFF
  33. #define WSPI_INIT_CMD_CRC_LEN 5
  34. #define WSPI_INIT_CMD_START 0x00
  35. #define WSPI_INIT_CMD_TX 0x40
  36. /* the extra bypass bit is sampled by the TNET as '1' */
  37. #define WSPI_INIT_CMD_BYPASS_BIT 0x80
  38. #define WSPI_INIT_CMD_FIXEDBUSY_LEN 0x07
  39. #define WSPI_INIT_CMD_EN_FIXEDBUSY 0x80
  40. #define WSPI_INIT_CMD_DIS_FIXEDBUSY 0x00
  41. #define WSPI_INIT_CMD_IOD 0x40
  42. #define WSPI_INIT_CMD_IP 0x20
  43. #define WSPI_INIT_CMD_CS 0x10
  44. #define WSPI_INIT_CMD_WS 0x08
  45. #define WSPI_INIT_CMD_WSPI 0x01
  46. #define WSPI_INIT_CMD_END 0x01
  47. #define WSPI_INIT_CMD_LEN 8
  48. #define HW_ACCESS_WSPI_FIXED_BUSY_LEN \
  49. ((WL1251_BUSY_WORD_LEN - 4) / sizeof(u32))
  50. #define HW_ACCESS_WSPI_INIT_CMD_MASK 0
  51. #endif /* __WL1251_SPI_H__ */