Simon Horman | cba179a | 2011-03-24 09:48:36 +0100 | [diff] [blame] | 1 | /* |
| 2 | * include/linux/mmc/tmio.h |
| 3 | * |
Wolfram Sang | bf96208 | 2016-01-19 12:32:58 +0100 | [diff] [blame] | 4 | * Copyright (C) 2016 Sang Engineering, Wolfram Sang |
| 5 | * Copyright (C) 2015-16 Renesas Electronics Corporation |
Simon Horman | cba179a | 2011-03-24 09:48:36 +0100 | [diff] [blame] | 6 | * Copyright (C) 2007 Ian Molton |
| 7 | * Copyright (C) 2004 Ian Molton |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
| 12 | * |
| 13 | * Driver for the MMC / SD / SDIO cell found in: |
| 14 | * |
| 15 | * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3 |
| 16 | */ |
Robert P. J. Day | 100e918 | 2011-05-27 16:04:03 -0400 | [diff] [blame] | 17 | #ifndef LINUX_MMC_TMIO_H |
| 18 | #define LINUX_MMC_TMIO_H |
Simon Horman | cba179a | 2011-03-24 09:48:36 +0100 | [diff] [blame] | 19 | |
| 20 | #define CTL_SD_CMD 0x00 |
| 21 | #define CTL_ARG_REG 0x04 |
| 22 | #define CTL_STOP_INTERNAL_ACTION 0x08 |
| 23 | #define CTL_XFER_BLK_COUNT 0xa |
| 24 | #define CTL_RESPONSE 0x0c |
| 25 | #define CTL_STATUS 0x1c |
Simon Horman | 973ed3a | 2011-06-21 08:00:10 +0900 | [diff] [blame] | 26 | #define CTL_STATUS2 0x1e |
Simon Horman | cba179a | 2011-03-24 09:48:36 +0100 | [diff] [blame] | 27 | #define CTL_IRQ_MASK 0x20 |
| 28 | #define CTL_SD_CARD_CLK_CTL 0x24 |
| 29 | #define CTL_SD_XFER_LEN 0x26 |
| 30 | #define CTL_SD_MEM_CARD_OPT 0x28 |
| 31 | #define CTL_SD_ERROR_DETAIL_STATUS 0x2c |
| 32 | #define CTL_SD_DATA_PORT 0x30 |
| 33 | #define CTL_TRANSACTION_CTL 0x34 |
| 34 | #define CTL_SDIO_STATUS 0x36 |
| 35 | #define CTL_SDIO_IRQ_MASK 0x38 |
Simon Horman | 95c7348 | 2011-06-21 08:00:08 +0900 | [diff] [blame] | 36 | #define CTL_DMA_ENABLE 0xd8 |
Simon Horman | cba179a | 2011-03-24 09:48:36 +0100 | [diff] [blame] | 37 | #define CTL_RESET_SD 0xe0 |
Kuninori Morimoto | e3c418f | 2013-11-20 00:31:13 -0800 | [diff] [blame] | 38 | #define CTL_VERSION 0xe2 |
Simon Horman | cba179a | 2011-03-24 09:48:36 +0100 | [diff] [blame] | 39 | #define CTL_SDIO_REGS 0x100 |
| 40 | #define CTL_CLK_AND_WAIT_CTL 0x138 |
| 41 | #define CTL_RESET_SDIO 0x1e0 |
| 42 | |
| 43 | /* Definitions for values the CTRL_STATUS register can take. */ |
| 44 | #define TMIO_STAT_CMDRESPEND 0x00000001 |
| 45 | #define TMIO_STAT_DATAEND 0x00000004 |
| 46 | #define TMIO_STAT_CARD_REMOVE 0x00000008 |
| 47 | #define TMIO_STAT_CARD_INSERT 0x00000010 |
| 48 | #define TMIO_STAT_SIGSTATE 0x00000020 |
| 49 | #define TMIO_STAT_WRPROTECT 0x00000080 |
| 50 | #define TMIO_STAT_CARD_REMOVE_A 0x00000100 |
| 51 | #define TMIO_STAT_CARD_INSERT_A 0x00000200 |
| 52 | #define TMIO_STAT_SIGSTATE_A 0x00000400 |
| 53 | #define TMIO_STAT_CMD_IDX_ERR 0x00010000 |
| 54 | #define TMIO_STAT_CRCFAIL 0x00020000 |
| 55 | #define TMIO_STAT_STOPBIT_ERR 0x00040000 |
| 56 | #define TMIO_STAT_DATATIMEOUT 0x00080000 |
| 57 | #define TMIO_STAT_RXOVERFLOW 0x00100000 |
| 58 | #define TMIO_STAT_TXUNDERRUN 0x00200000 |
| 59 | #define TMIO_STAT_CMDTIMEOUT 0x00400000 |
| 60 | #define TMIO_STAT_RXRDY 0x01000000 |
| 61 | #define TMIO_STAT_TXRQ 0x02000000 |
| 62 | #define TMIO_STAT_ILL_FUNC 0x20000000 |
| 63 | #define TMIO_STAT_CMD_BUSY 0x40000000 |
| 64 | #define TMIO_STAT_ILL_ACCESS 0x80000000 |
| 65 | |
Wolfram Sang | bf96208 | 2016-01-19 12:32:58 +0100 | [diff] [blame] | 66 | #define CLK_CTL_DIV_MASK 0xff |
| 67 | #define CLK_CTL_SCLKEN BIT(8) |
| 68 | |
Simon Horman | cba179a | 2011-03-24 09:48:36 +0100 | [diff] [blame] | 69 | #define TMIO_BBS 512 /* Boot block size */ |
| 70 | |
Robert P. J. Day | 100e918 | 2011-05-27 16:04:03 -0400 | [diff] [blame] | 71 | #endif /* LINUX_MMC_TMIO_H */ |