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