Documentation/blockdev/mflash翻译

来源:互联网 发布:投资理财软件 编辑:程序博客网 时间:2024/06/03 16:39

Chinese translated version of Documentation/blockdev/mflash

If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.

Chinese maintainer: keyingjing <342311642@qq.com>
---------------------------------------------------------------------
Documentation/blockdev/mflash 的中文翻译

如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。

中文版维护者: 柯莹璟  <342311642@qq.com>
中文版翻译者: 柯莹璟  <342311642@qq.com>
中文版校译者: 柯莹璟  <342311642@qq.com>

This document describes m[g]flash support in linux.
  
   Contents
     1. Overview
     2. Reserved area configuration
     3. Example of mflash platform driver registration
 
本文档介绍了linux下的mflash支持。
    内容
 1.概述
 2.保留区配置
 3.mflash平台的驱动程序的注册示例。
 
1. Overview
  
Mflash and gflash are embedded flash drive. The only difference is mflash is
MCP(Multi Chip Package) device. These two device operate exactly same way.
So the rest mflash repersents mflash and gflash altogether.
 
1.概述
Mflash和gflash是嵌入式闪存驱动器。唯一的区别是mflash是MCP(多芯片封装)设备。
这两个设备的操作方式完全相同。因此,剩余的mflash能完全代表mflash和gflash。
 
Internally, mflash has nand flash and other hardware logics and supports
2 different operation (ATA, IO) modes. ATA mode doesn't need any new
driver and currently works well under standard IDE subsystem. Actually it's
one chip SSD. IO mode is ATA-like custom mode for the host that doesn't have
IDE interface.

在内部,mflash有NAND闪存和其他硬件逻辑,并且支持两种不同的操作方式(ATA,IO)。
ATA模式并不需要任何新的驱动器,目前在标准IDE子系统下运行良好。事实上,这是
一个芯片的固态盘。IO模式是类似ATA的主机没有IDE接口的自定义模式。

Followings are brief descriptions about IO mode.
A. IO mode based on ATA protocol and uses some custom command. (read confirm,
write confirm)
B. IO mode uses SRAM bus interface.
C. IO mode supports 4kB boot area, so host can boot from mflash.

以下是关于IO模式的简要概述
A.IO模式在ATA协议的基础上使用了一些自定义命令。(读确认,写确认)
B.IO模式使用SRAM总线接口。
C.IO模式支持4KB的引导区,所以主机可以从mflash启动。

2. Reserved area configuration
If host boot from mflash, usually needs raw area for boot loader image. All of
the mflash's block device operation will be taken this value as start offset.
Note that boot loader's size of reserved area and kernel configuration value
must be same.

2.保留区配置
如果主机从mflash启动,通常需要开机载入器的原始区域。全部mflash块设备操作将
采取这个值作为起始偏移。注意保留区开机载入器的大小和内核配置值必须是相同的。

3. Example of mflash platform driver registration
Working mflash is very straight forward. Adding platform device stuff to board
configuration file is all. Here is some pseudo example.

3.mflash平台的驱动程序的注册示例。
mflash的工作非常直截了当。新增的平台设备全部在配置文件中登记。下面是一些伪例子。

static struct mg_drv_data mflash_drv_data = {
          /* If you want to polling driver set to 1 */
   .use_polling = 0,
          /* device attribution */
          .dev_attr = MG_BOOT_DEV
  };
 
  static struct resource mg_mflash_rsc[] = {
          /* Base address of mflash */
          [0] = {
                 .start = 0x08000000,
                  .end = 0x08000000 + SZ_64K - 1,
                  .flags = IORESOURCE_MEM
          },
          /* mflash interrupt pin */
          [1] = {
                  .start = IRQ_GPIO(84),
                  .end = IRQ_GPIO(84),
                  .flags = IORESOURCE_IRQ
          },
          /* mflash reset pin */
          [2] = {
                  .start = 43,
                  .end = 43,
                  .name = MG_RST_PIN,
                  .flags = IORESOURCE_IO
          },
          /* mflash reset-out pin
          * If you use mflash as storage device (i.e. other than MG_BOOT_DEV),
           * should assign this */
          [3] = {
                  .start = 51,
                  .end = 51,
                  .name = MG_RSTOUT_PIN,
                  .flags = IORESOURCE_IO
          }
  };
 
 static struct platform_device mflash_dev = {
          .name = MG_DEV_NAME,
          .id = -1,
          .dev = {
                  .platform_data = &mflash_drv_data,
          },
          .num_resources = ARRAY_SIZE(mg_mflash_rsc),
          .resource = mg_mflash_rsc
  };
 
  platform_device_register(&mflash_dev);


 

原创粉丝点击