Added C++ ctors and partial SDHOST driver
[rpi-open-firmware.git] / arm_chainloader / drivers / sd2.hpp
1 #pragma once
2
3 /* Error Code */
4 #define SD_NO_ERROR 0x0
5 #define SD_CRC_ERR 0x80
6 #define SD_TO_ERR 0x40
7 #define SD_NO_CARD 0x20
8 #define SD_BUSY 0x10
9 #define SD_STS_ERR 0x08
10 #define SD_RSP_TIMEOUT 0x04
11 #define SD_IO_ERR 0x02
12 /* Return code for MMC switch bus */
13 #define SWITCH_SUCCESS 0
14 #define SWITCH_ERR 1
15 #define SWITCH_FAIL 2
16 /* MMC/SD Command Index */
17 /* Basic command (class 0) */
18 #define GO_IDLE_STATE 0
19 #define SEND_OP_COND 1
20 #define ALL_SEND_CID 2
21 #define SET_RELATIVE_ADDR 3
22 #define SEND_RELATIVE_ADDR 3
23 #define SET_DSR 4
24 #define IO_SEND_OP_COND 5
25 #define SWITCH 6
26 #define SELECT_CARD 7
27 #define DESELECT_CARD 7
28 /* CMD8 is "SEND_EXT_CSD" for MMC4.x Spec
29 * while is "SEND_IF_COND" for SD 2.0
30 */
31 #define SEND_EXT_CSD 8
32 #define SEND_IF_COND 8
33 #define SEND_CSD 9
34 #define SEND_CID 10
35 #define VOLTAGE_SWITCH 11
36 #define READ_DAT_UTIL_STOP 11
37 #define STOP_TRANSMISSION 12
38 #define SEND_STATUS 13
39 #define GO_INACTIVE_STATE 15
40 #define SET_BLOCKLEN 16
41 #define READ_SINGLE_BLOCK 17
42 #define READ_MULTIPLE_BLOCK 18
43 #define SEND_TUNING_PATTERN 19
44 #define BUSTEST_R 14
45 #define BUSTEST_W 19
46 #define WRITE_BLOCK 24
47 #define WRITE_MULTIPLE_BLOCK 25
48 #define PROGRAM_CSD 27
49 #define ERASE_WR_BLK_START 32
50 #define ERASE_WR_BLK_END 33
51 #define ERASE_CMD 38
52 #define LOCK_UNLOCK 42
53 #define IO_RW_DIRECT 52
54 #define APP_CMD 55
55 #define GEN_CMD 56
56 #define SET_BUS_WIDTH 6
57 #define SD_STATUS 13
58 #define SEND_NUM_WR_BLOCKS 22
59 #define SET_WR_BLK_ERASE_COUNT 23
60 #define SD_APP_OP_COND 41
61 #define SET_CLR_CARD_DETECT 42
62 #define SEND_SCR 51
63 #define SD_READ_COMPLETE 0x00
64 #define SD_READ_TO 0x01
65 #define SD_READ_ADVENCE 0x02
66 #define SD_CHECK_MODE 0x00
67 #define SD_SWITCH_MODE 0x80
68 #define SD_FUNC_GROUP_1 0x01
69 #define SD_FUNC_GROUP_2 0x02
70 #define SD_FUNC_GROUP_3 0x03
71 #define SD_FUNC_GROUP_4 0x04
72 #define SD_CHECK_SPEC_V1_1 0xFF
73 #define NO_ARGUMENT 0x00
74 #define CHECK_PATTERN 0x000000AA
75 #define VOLTAGE_SUPPLY_RANGE 0x00000100
76 #define SUPPORT_HIGH_AND_EXTENDED_CAPACITY 0x40000000
77 #define SUPPORT_MAX_POWER_PERMANCE 0x10000000
78 #define SUPPORT_1V8 0x01000000
79 #define SWTICH_NO_ERR 0x00
80 #define CARD_NOT_EXIST 0x01
81 #define SPEC_NOT_SUPPORT 0x02
82 #define CHECK_MODE_ERR 0x03
83 #define CHECK_NOT_READY 0x04
84 #define SWITCH_CRC_ERR 0x05
85 #define SWITCH_MODE_ERR 0x06
86 #define SWITCH_PASS 0x07
This page took 0.063157 seconds and 4 git commands to generate.