spi.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * This file is part of wl1251
  4. *
  5. * Copyright (c) 1998-2007 Texas Instruments Incorporated
  6. * Copyright (C) 2008 Nokia Corporation
  7. */
  8. #ifndef __WL1251_SPI_H__
  9. #define __WL1251_SPI_H__
  10. #include "cmd.h"
  11. #include "acx.h"
  12. #include "reg.h"
  13. #define WSPI_CMD_READ 0x40000000
  14. #define WSPI_CMD_WRITE 0x00000000
  15. #define WSPI_CMD_FIXED 0x20000000
  16. #define WSPI_CMD_BYTE_LENGTH 0x1FFE0000
  17. #define WSPI_CMD_BYTE_LENGTH_OFFSET 17
  18. #define WSPI_CMD_BYTE_ADDR 0x0001FFFF
  19. #define WSPI_INIT_CMD_CRC_LEN 5
  20. #define WSPI_INIT_CMD_START 0x00
  21. #define WSPI_INIT_CMD_TX 0x40
  22. /* the extra bypass bit is sampled by the TNET as '1' */
  23. #define WSPI_INIT_CMD_BYPASS_BIT 0x80
  24. #define WSPI_INIT_CMD_FIXEDBUSY_LEN 0x07
  25. #define WSPI_INIT_CMD_EN_FIXEDBUSY 0x80
  26. #define WSPI_INIT_CMD_DIS_FIXEDBUSY 0x00
  27. #define WSPI_INIT_CMD_IOD 0x40
  28. #define WSPI_INIT_CMD_IP 0x20
  29. #define WSPI_INIT_CMD_CS 0x10
  30. #define WSPI_INIT_CMD_WS 0x08
  31. #define WSPI_INIT_CMD_WSPI 0x01
  32. #define WSPI_INIT_CMD_END 0x01
  33. #define WSPI_INIT_CMD_LEN 8
  34. #define HW_ACCESS_WSPI_FIXED_BUSY_LEN \
  35. ((WL1251_BUSY_WORD_LEN - 4) / sizeof(u32))
  36. #define HW_ACCESS_WSPI_INIT_CMD_MASK 0
  37. #endif /* __WL1251_SPI_H__ */