-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
添加新的mtd接口 #1758
添加新的mtd接口 #1758
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对 mtd 的功能要求不太了解,其他代码暂时看出来问题
components/drivers/Kconfig
Outdated
@@ -90,6 +90,16 @@ config RT_USING_MTD_NAND | |||
default n | |||
endif | |||
|
|||
config RT_USING_MTD | |||
bool "Using Memory Technology Device (MTD)" | |||
default n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
格式化下代码吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在的mtd接口是为了统一以前的nor和nand接口(nand还没测试完)
}; | ||
|
||
#ifndef loff_t | ||
typedef uint32_t loff_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加 loff_t 类型是什么目的呢?记得 RT-Thread 也有类似的 rt_off_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
off_t一般32位,loff_t是希望能64位
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里定义的loff_t依然是32位的。
struct mtd_info *master; | ||
|
||
void *priv; | ||
}rt_mtd_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RT-Thread 的大部分 rt_xx_t 类型是指针类型,rt_mtd_t 这里要不要统一一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不建议再定义rt_xx_t类型的typedef了,可以直接用结构体的方式,而不是把结构体隐藏掉。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我用rt_xx_t主要目的1是表明他是一个类2是减小书写麻烦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一般是 typedef 用于隐藏结构体内部信息,所以没有什么特殊的目的,也不是一些标准规定的,都不建议再加入一些 typedef了。内核对象那边的 rt_xx_t 定义已经够绕了。
@armink |
|
我觉得 MTD和FAL/SFUD是职能不同的两个东西吧 MTD位于FLash 驱动层的上方 块设备的下方 原则上根据需求可以进行组合 |
不会和FAL/SFUD冲突的,我想替代以前的mtd_nor mtd_nand但是依然不和他们冲突,分区表放在底层驱动里 |
MTD这套接口,能把nand和nor flash都融合在一起吗?如果不能,这套接口的目的是什么? |
目的就是融合nor和nand,只是nand还没测试完,后续融合spinor都可以 |
这套接口是从linux借鉴的,功能和它一样但是比它精简 |
先给个nand的预览出来 int rt_mtd_nand_init(rt_nand_t *nand, int blk_size, int page_size, int blks_pc, int nchip)
} |
那等你这套框架把nand都支持后,再考虑是否合并进来吧 |
也可以,我抽时间尽快把nand测了 |
heyuanjie seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
请按照上面链接签署CLA协议 |
建议你重新以干净的分支来提交PR,这样CLA应该也没问题,现在帐号应该都被你弄乱了 |
No description provided.