18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * This file is part of wl1251 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 1998-2007 Texas Instruments Incorporated 68c2ecf20Sopenharmony_ci * Copyright (C) 2008 Nokia Corporation 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef __WL1251_SPI_H__ 108c2ecf20Sopenharmony_ci#define __WL1251_SPI_H__ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include "cmd.h" 138c2ecf20Sopenharmony_ci#include "acx.h" 148c2ecf20Sopenharmony_ci#include "reg.h" 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci#define WSPI_CMD_READ 0x40000000 178c2ecf20Sopenharmony_ci#define WSPI_CMD_WRITE 0x00000000 188c2ecf20Sopenharmony_ci#define WSPI_CMD_FIXED 0x20000000 198c2ecf20Sopenharmony_ci#define WSPI_CMD_BYTE_LENGTH 0x1FFE0000 208c2ecf20Sopenharmony_ci#define WSPI_CMD_BYTE_LENGTH_OFFSET 17 218c2ecf20Sopenharmony_ci#define WSPI_CMD_BYTE_ADDR 0x0001FFFF 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_CRC_LEN 5 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_START 0x00 268c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_TX 0x40 278c2ecf20Sopenharmony_ci/* the extra bypass bit is sampled by the TNET as '1' */ 288c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_BYPASS_BIT 0x80 298c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_FIXEDBUSY_LEN 0x07 308c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_EN_FIXEDBUSY 0x80 318c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_DIS_FIXEDBUSY 0x00 328c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_IOD 0x40 338c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_IP 0x20 348c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_CS 0x10 358c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_WS 0x08 368c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_WSPI 0x01 378c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_END 0x01 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci#define WSPI_INIT_CMD_LEN 8 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#define HW_ACCESS_WSPI_FIXED_BUSY_LEN \ 428c2ecf20Sopenharmony_ci ((WL1251_BUSY_WORD_LEN - 4) / sizeof(u32)) 438c2ecf20Sopenharmony_ci#define HW_ACCESS_WSPI_INIT_CMD_MASK 0 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#endif /* __WL1251_SPI_H__ */ 46