Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
b2bcc798
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b2bcc798
编写于
5月 22, 2007
作者:
P
Pierre Ossman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mmc: implement SDIO IO_RW_DIRECT operation
Signed-off-by:
N
Pierre Ossman
<
drzeus@drzeus.cx
>
上级
5c4e6f13
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
74 addition
and
0 deletion
+74
-0
drivers/mmc/core/sdio_ops.c
drivers/mmc/core/sdio_ops.c
+37
-0
drivers/mmc/core/sdio_ops.h
drivers/mmc/core/sdio_ops.h
+2
-0
include/linux/mmc/core.h
include/linux/mmc/core.h
+1
-0
include/linux/mmc/sdio.h
include/linux/mmc/sdio.h
+34
-0
未找到文件。
drivers/mmc/core/sdio_ops.c
浏览文件 @
b2bcc798
...
...
@@ -10,6 +10,7 @@
*/
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/sdio.h>
...
...
@@ -47,3 +48,39 @@ int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
return
err
;
}
int
mmc_io_rw_direct
(
struct
mmc_card
*
card
,
int
write
,
unsigned
fn
,
unsigned
addr
,
u8
in
,
u8
*
out
)
{
struct
mmc_command
cmd
;
int
err
;
BUG_ON
(
!
card
);
BUG_ON
(
fn
>
7
);
memset
(
&
cmd
,
0
,
sizeof
(
struct
mmc_command
));
cmd
.
opcode
=
SD_IO_RW_DIRECT
;
cmd
.
arg
=
write
?
0x80000000
:
0x00000000
;
cmd
.
arg
|=
fn
<<
28
;
cmd
.
arg
|=
(
write
&&
out
)
?
0x08000000
:
0x00000000
;
cmd
.
arg
|=
addr
<<
9
;
cmd
.
arg
|=
in
;
cmd
.
flags
=
MMC_RSP_R5
|
MMC_CMD_AC
;
err
=
mmc_wait_for_cmd
(
card
->
host
,
&
cmd
,
0
);
if
(
err
)
return
err
;
if
(
cmd
.
resp
[
0
]
&
R5_ERROR
)
return
-
EIO
;
if
(
cmd
.
resp
[
0
]
&
R5_FUNCTION_NUMBER
)
return
-
EINVAL
;
if
(
cmd
.
resp
[
0
]
&
R5_OUT_OF_RANGE
)
return
-
ERANGE
;
if
(
out
)
*
out
=
cmd
.
resp
[
0
]
&
0xFF
;
return
0
;
}
drivers/mmc/core/sdio_ops.h
浏览文件 @
b2bcc798
...
...
@@ -13,6 +13,8 @@
#define _MMC_SDIO_OPS_H
int
mmc_send_io_op_cond
(
struct
mmc_host
*
host
,
u32
ocr
,
u32
*
rocr
);
int
mmc_io_rw_direct
(
struct
mmc_card
*
card
,
int
write
,
unsigned
fn
,
unsigned
addr
,
u8
in
,
u8
*
out
);
#endif
include/linux/mmc/core.h
浏览文件 @
b2bcc798
...
...
@@ -42,6 +42,7 @@ struct mmc_command {
#define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
#define MMC_RSP_R3 (MMC_RSP_PRESENT)
#define MMC_RSP_R4 (MMC_RSP_PRESENT)
#define MMC_RSP_R5 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
#define MMC_RSP_R7 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
...
...
include/linux/mmc/sdio.h
浏览文件 @
b2bcc798
...
...
@@ -14,6 +14,40 @@
/* SDIO commands type argument response */
#define SD_IO_SEND_OP_COND 5
/* bcr [23:0] OCR R4 */
#define SD_IO_RW_DIRECT 52
/* ac [31:0] See below R5 */
/*
* SD_IO_RW_DIRECT argument format:
*
* [31] R/W flag
* [30:28] Function number
* [27] RAW flag
* [25:9] Register address
* [7:0] Data
*/
/*
SDIO status in R5
Type
e : error bit
s : status bit
r : detected and set for the actual command response
x : detected and set during command execution. the host must poll
the card by sending status command in order to read these bits.
Clear condition
a : according to the card state
b : always related to the previous command. Reception of
a valid command will clear it (with a delay of one command)
c : clear by read
*/
#define R5_COM_CRC_ERROR (1 << 15)
/* er, b */
#define R5_ILLEGAL_COMMAND (1 << 14)
/* er, b */
#define R5_ERROR (1 << 11)
/* erx, c */
#define R5_FUNCTION_NUMBER (1 << 9)
/* er, c */
#define R5_OUT_OF_RANGE (1 << 8)
/* er, c */
#define R5_STATUS(x) (x & 0xCB00)
#define R5_IO_CURRENT_STATE(x) ((x & 0x3000) >> 12)
/* s, b */
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录