设为首页 加入收藏

TOP

Nandflash 驱动移植(一)
2013-01-13 10:31:52 来源: 作者: 【 】 浏览:1782
Tags:Nandflash  驱动 移植

  在飞凌提供的BSP中,Nandflash采用的是FMD+PDD的结构,PDD主要是应对上层的接口,这里我们不需要修改,直接修改FMD就好。(至于在网上看到很多人说这个结构理论上不支持MLC的Nandflash,这个暂且不说)。
  FMD部分的驱动源码在 C:\WINCE600\PLATFORM\SMDK6410\src\common\nandflash\FMD\ 这个目录下边。
  FMD的目录结构:
  nand.s
  cfnand.h
  fmd_LB.h(实际并没用到)
  fmd_SB.h(实际并没用到)
  nand.h
  fmd.cpp
  sources
  makefile
  先看sources文件:
  [cpp]
  !if 0
  Copyright (c) Microsoft Corporation.  All rights reserved.
  !endif
  !if 0
  Use of this sample source code is subject to the terms of the Microsoft
  license agreement under which you licensed this sample source code. If
  you did not accept the terms of the license agreement, you are not
  authorized to use this sample source code. For the terms of the license,
  please see the license agreement between you and Microsoft or, if applicable,
  see the LICENSE.RTF on your install media or the root of your tools installation.
  THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
  !endif
  !IF 0
  Module Name:
  sources.
  Abstract:
  This file specifies the target component being built and the list of
  sources files needed to build that component.  Also specifies optional
  compiler switches and libraries that are unique for the component being
  built.
  !ENDIF
  TARGETNAME=nandflash_lib11
  TARGETTYPE=LIBRARY
  RELEASETYPE=PLATFORM
  SYNCHRONIZE_BLOCK=1
  WINCEOEM=1
  WINCECPU=1
  NOMIPS16CODE=1
  ADEFINES=-pd "_TGTCPU SETS \"$(_TGTCPU)\"" $(ADEFINES)
  LDEFINES=-subsystem:native /DEBUG /DEBUGTYPE:CV /FIXED:NO
  INCLUDES=$(INCLUDES)
  SOURCES=\
  fmd.cpp
  arm_SOURCES=\
  nand.s
  这个代码是飞凌提供的,且看这一句 TARGETNAME=nandflash_lib11,经查实,FMD+PDD使用的是FMD产生的nandflash_lib.lib库文件,而不是nandflash_lib11.lib文件,这也说明飞凌在这方面留了一手,并没有直接提供可用的源码,而是给了一个lib库给我们。
  在这里,我们需要把   TARGETNAME=nandflash_lib11    修改为   TARGETNAME=nandflash_lib
  cfnand.h文件:
  [cpp]
  /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  PARTICULAR PURPOSE.
  Copyright (c) 2001  Microsoft Corporation
  Module Name:    S3C6410.H
  Abstract:        FLASH Media Driver Interface Samsung S3C6410 CPU with NAND Flash
  controller.
  Environment:    As noted, this media driver works on behalf of the FAL to directly
  access the underlying FLASH hardware.  Consquently, this module
  needs to be linked with FLASHFAL.LIB to produce the device driver
  named FLASHDRV.DLL.
  -----------------------------------------------------------------------------*/
  #ifndef _S3C6410_CFNAND_H
  #define _S3C6410_CFNAND_H
  #include "FMD_LB.h"
  #include "FMD_SB.h"
  #include "nand.h"
  #define BW_X08    (0)
  #define BW_X16    (1)
  #define BW_X32    (2)
  #define MAX_SECTORS_PER_PAGE    (8)
  /*****************************************************************************/
  /* S3C6410 Nand Flash Internal Data Structure Definition                                    */
  /*****************************************************************************/

       

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 1/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇简单c++序列化 下一篇AOE网中关键路径的一般求法

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: