Commit Graph

79 Commits

Author SHA1 Message Date
Meco Man 84db60ecfa [sdio] remove rt_mmcsd_blk_init 2021-08-01 07:31:32 +08:00
@lin12345678 9f9c3a2bb0 修改mmc初始化错误,将card-》csd写成card-》cid 2021-07-09 17:53:07 +08:00
Jianjia Ma 398718f0f9
Update mmc.c 2021-04-13 18:27:53 +01:00
Jianjia Ma 4e74279d27
Add more trys when switching data width
Try a few times before switching to other data widths. 
The original strategy (simply wait for 20ms ) failed on STM32H743 with an MTFC4GACAJCN-4M (4GB EMMC) when switching data width. 
(unless the debugging info is enabled, which add more delays)
With this EMMC, the fixed delay was set to 50ms for it to be able to work. 

Instead of a fixed delay, I think we better change to trying a few more times with smaller delays.
2021-04-13 18:04:59 +01:00
Meco Man 3c05a4e719 [compoenets] auto & manual formatted 2021-03-08 18:19:04 +08:00
wanghaijing f62d8938dc [sdio] free memory and enhance performance 2021-02-05 15:49:30 +08:00
guozhanxin bb016927f8 Improve the clock Settings for switching to high speed mode in the SDIO framework. 2020-11-27 17:28:49 +08:00
Shawn Lin 4c7106fa9d component: sdio: fix potential ricky clock setting
Currently RTT mmc stack only support Highspeed mode or
blow, which means the max speed should be 52MHz according
to JEDEC spec. Two problems show here:

(1) max_data_rate = (unsigned int)-1. The value of unsigned int
depends on compilers/arch. Moreover, it makes no sense to assume
cpu addressing width with IP clock rate limit.
(1)hs_max_data_rate was set to 200MHz.

So what should BSP drivers do if 52MHz < max_data_rate < 200MHz?
Either it blindly sets a spec-violated clock rate to drive a Highspeed
card, or just adjust the clock rate internally. Both cases are
really bad for practice.

If the card claims to support Highspeed, we set the clock to not
to exceed 52MHz. Otherwise it should be set according to
card->max_data_rate parsed by ext_csd. This patch fixes it as-is,
and also simplify the code a lot.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2020-03-16 14:45:41 +08:00
Shawn Lin 11277014a3 [Components] sdio: try bus width depends on host's capability
It makes no sense to try bus width if not supported by drivers or BSP,
since we know it must be failed. It saves a lot for booting in time
critical environment.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2020-03-12 09:00:41 +08:00
Shawn Lin a33bc0f321 [component] sdio: Fix mmc mount function if the whole device is a partition
If the whole sd card was formatted as a partition, current
code break out the loop mistakenly, so it skips dfs_mount_device
later. Simply remove the broken 'break' to solve this problem.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2020-03-12 09:00:33 +08:00
bigmagic e09c99fcfb fix raspi3-64 sdio driver 2020-02-28 14:56:56 +08:00
A.orz a646b9275d
Update sd.c
clean #if 0 code
2020-02-23 09:20:09 +08:00
hichard aafed7b434 1.修复sd卡热插拔内存泄露的bug
2.dfs增加函数,配合实现sd卡热插拔自动挂载卸载文件系统
2019-11-16 11:16:48 +08:00
tangyuxin 2f2933245e [components][drivers][sdio]修复 SDIO product 为空的问题 2019-09-03 16:55:10 +08:00
Zhou Yanjie de69a9b500 sdio: mmc.c: 修复缩进/Fix indentation.
修复版权信息中的缩进格式。

Fix indentation in copyright information.

Signed-off-by: Zhou Yanjie <zhouyanjie@zoho.com>
2019-07-19 21:18:56 +08:00
Zhou Yanjie 976ea24112 sdio: mmc.c: 防止容量计算过程溢出/Prevent capacity calculation overflow.
修改“mmc_parse_ext_csd”函数,防止容量计算过程溢出。

Modify the "mmc_parse_ext_csd" function to prevent the capacity
calculation process from overflowing.

Signed-off-by: Zhou Yanjie <zhouyanjie@zoho.com>
2019-07-19 21:18:56 +08:00
Bernard Xiong ec6cb9f260 [BSP][qemu-vexpress-a9] code cleaup for compiling warning. 2019-05-12 15:07:26 +08:00
armink fa4d4ab7cf Update all of debug log definition to DBG_TAG and DBG_LVL. 2019-04-12 10:18:57 +08:00
armink 0d7ba79219 Remove the DBG_COLOR and DBG_ENABLE definition. 2019-03-06 17:54:30 +08:00
Bernard Xiong 1f37de29c4 Fix the value width issue under 32/64 bit arch. 2018-12-13 14:54:26 +08:00
armink 5a70247898 [components][DeviceDriver] Update log tag from [SDIO] to SDIO. 2018-11-02 10:15:29 +08:00
Bernard Xiong 2c0640a178 [license] Change license to Apache. 2018-10-14 19:37:18 +08:00
ZYH e00364c5e4 [Components][SDIO]修复脏值调用 2018-10-12 11:22:05 +08:00
ZYH 2e74539130 [Components][SDIO]fix 'rocr' declared without an initial value 2018-09-30 11:01:06 +08:00
ZYH 780f538525 [Components][SDIO][MMC] fix null point check 2018-09-22 15:02:48 +08:00
ZYH 3d69c44ab8 [Components][SDIO]fix Null point access 2018-09-22 14:56:55 +08:00
ZYH f6be7abb2d [Components][SDIO]block 'err' declared without an initial value 2018-09-22 14:53:08 +08:00
ZYH f260f7effd [Components][SDIO]fix Assigned value is garbage or undefined 2018-09-22 14:49:47 +08:00
Bernard Xiong 8c2448a4d4
Merge pull request #1774 from EvalZero/sdio_dev
[DeviceDriver][SDIO] Update sdio debug log.
2018-09-11 19:03:10 +08:00
weety 799c5e4ea2 [sdio] Fixed merge error. 2018-09-09 22:07:06 +08:00
weety e19cfd4571 [sdio] Fixed issue for requset size calculation. 2018-09-09 21:20:08 +08:00
weety 02a2b78943 [sdio] Fixed error for dma size calculation. 2018-09-09 14:05:45 +08:00
weety 618e185cd3 [sdio] Limit the data size per request based on the sdio controller driver configuration parameters. 2018-09-08 23:21:13 +08:00
EvalZero 2c01189114 [DeviceDriver][SDIO] Update sdio debug log. 2018-09-05 14:50:43 +08:00
tangyuxin 78189dfb6b [components][drivers][sdio]修复没有注册SDIO中断导致断言的问题 2018-07-21 16:29:17 +08:00
tangyuxin f850a2dd33 [components][drivers]sdio 给局部指针变量赋初值,修复潜在问题 2018-06-26 11:09:13 +08:00
Bernard Xiong 884fb70fe9 [Kernel] Add device ops feature. 2018-06-10 17:59:17 +08:00
Bernard Xiong ba2b1f0e56 [DeviceDrivers][MMC] rename fls to __rt_fls 2018-03-04 17:25:59 +08:00
Bernard Xiong f746c6e556 [DeviceDrivers] fix compiling warning 2017-12-24 00:06:29 +08:00
tanek liang d8bc33d70b [DeviceDrivers] Fix missing mailbox after SDCard hot plug 2017-12-07 14:44:16 +08:00
Bernard Xiong 6ccebe19d5 [DeviceDrivers] Fix compiling issue in MMC/SD. 2017-11-06 20:11:25 +08:00
weety e4dd86a1b7 [DRIVER][SDIO] Add components initializer. 2017-11-05 21:41:43 +08:00
weety 5150e19d4b [bsp][dm365] Support rt_hw_console_output function; Adjust the initialization sequence; Cleanup code.
[drv][mmcsd] Undo Changes.
2017-10-20 11:19:03 +08:00
weety dd5ac17fc8 [bsp][dm365] Using component initial;
[drv][mmcsd] Add component initial.
2017-10-19 19:14:06 +08:00
bernard d7087fdd3b [DeviceDrivers] change cmd type.
1. Change 'rt_uint8_t' type of cmd to 'int';
2. Add waitqueue;
3. Split device ipc header files;
2017-10-15 22:56:46 +08:00
ruiqian 465fdfc2ff Update sdio.c 2017-07-04 00:50:48 +08:00
ruiqian 0a798b33a5 Update mmcsd_core.c 2017-07-04 00:50:25 +08:00
bernard c1926d3af7 [DeviceDrivers] Improve compatibility for SDIO CCCR v3.00. 2017-06-06 18:18:03 +08:00
ruiqian f136f8895a Update sdio.c 2017-04-19 20:03:11 +08:00
ruiqian 24185f4721 Update sdio.c
Fix a bug in function sdio_unregister_driver
2017-04-19 19:43:40 +08:00