uffs_nand_samsung.c File Reference

samsung NAND flash specific file More...

#include "uffs/uffs_public.h"
#include "uffs/uffs_ecc.h"
#include <string.h>

Go to the source code of this file.

Defines

#define PFX   "samsung NAND:"
#define SAMSUNG_BLOCK_STATUS_OFS   5
#define SAMSUNG_ECC_LEN   6
#define SAMSUNG_SPARE_LENGTH   16

Typedefs

typedef uffs_SamsungSpareSt uffs_SamsungSpare

Functions

int Samsung_GetEccSize (uffs_Device *dev)
 get ecc size for samsung NAND flash
UBOOL Samsung_IsBlockBad (uffs_Device *dev, uffs_blockInfo *bc)
URET Samsung_LoadPageSpare (uffs_Device *dev, int block, int page, uffs_Tags *tag)
 load NAND spare data to "uffs_pageSpare"
URET Samsung_MakeBadBlockMark (uffs_Device *dev, int block)
URET Samsung_MakePageValid (uffs_Device *dev, int block, int page, uffs_Tags *tag)
 make the given block.page valid
URET Samsung_WritePageSpare (uffs_Device *dev, int block, int page, uffs_Tags *tag)
 write page spare space with given tag, all other spare content will be read from page spare before write to it.

Variables

uffs_FlashClassSt Samsung_FlashClass


Detailed Description

samsung NAND flash specific file

Author:
Ricky Zheng, created 12th May, 2005

Definition in file uffs_nand_samsung.c.


Define Documentation

#define PFX   "samsung NAND:"

Definition at line 11 of file uffs_nand_samsung.c.

#define SAMSUNG_BLOCK_STATUS_OFS   5

Definition at line 15 of file uffs_nand_samsung.c.

Referenced by Samsung_LoadPageSpare(), Samsung_MakeBadBlockMark(), and Samsung_WritePageSpare().

#define SAMSUNG_ECC_LEN   6

Definition at line 13 of file uffs_nand_samsung.c.

Referenced by Samsung_GetEccSize().

#define SAMSUNG_SPARE_LENGTH   16

Definition at line 14 of file uffs_nand_samsung.c.


Typedef Documentation

typedef struct uffs_SamsungSpareSt uffs_SamsungSpare

Definition at line 25 of file uffs_nand_samsung.c.


Function Documentation

int Samsung_GetEccSize ( uffs_Device dev  ) 

get ecc size for samsung NAND flash

Parameters:
[in] dev uffs device
Returns:
size of ECC in bytes

Definition at line 112 of file uffs_nand_samsung.c.

References SAMSUNG_ECC_LEN.

UBOOL Samsung_IsBlockBad ( uffs_Device dev,
uffs_blockInfo bc 
)

Definition at line 123 of file uffs_nand_samsung.c.

References uffs_TagsSt::blockStatus, uffs_blockInfoSt::spares, uffs_pageSpareSt::tag, U_FALSE, U_TRUE, and uffs_LoadBlockInfo().

URET Samsung_LoadPageSpare ( uffs_Device dev,
int  block,
int  page,
uffs_Tags tag 
)

load NAND spare data to "uffs_pageSpare"

Parameters:
[in] dev uffs device
[in] block block number to be loaded
[in] page page number to be loaded
[out] tag output for NAND page spare
Note:
these function must be implemented in NAND specific file.

Note:
We must to work around the STATUS byte

Definition at line 36 of file uffs_nand_samsung.c.

References uffs_TagsSt::blockStatus, NULL, uffs_DeviceSt::ops, uffs_DeviceOpsSt::ReadPage, SAMSUNG_BLOCK_STATUS_OFS, and U_SUCC.

URET Samsung_MakeBadBlockMark ( uffs_Device dev,
int  block 
)

Definition at line 140 of file uffs_nand_samsung.c.

References uffs_DeviceSt::ops, PFX, uffs_DeviceOpsSt::ReadPageSpare, SAMSUNG_BLOCK_STATUS_OFS, U_SUCC, UFFS_ERR_NOISY, uffs_Perror(), and uffs_DeviceOpsSt::WritePageSpare.

URET Samsung_MakePageValid ( uffs_Device dev,
int  block,
int  page,
uffs_Tags tag 
)

make the given block.page valid

Parameters:
[in] dev uffs device
[in] block block number
[in] page page number
[in] tag source tag of this page.

Definition at line 101 of file uffs_nand_samsung.c.

References Samsung_WritePageSpare().

URET Samsung_WritePageSpare ( uffs_Device dev,
int  block,
int  page,
uffs_Tags tag 
)

write page spare space with given tag, all other spare content will be read from page spare before write to it.

Parameters:
[in] dev uffs device
[in] block block number to be wrote to
[in] page page number to be wrote to
[in] tag input tag
Note:
you must make sure that the block are erased, and page spare should not be wrote more then twice after block been erased once.

Definition at line 68 of file uffs_nand_samsung.c.

References NULL, uffs_DeviceSt::ops, PFX, uffs_DeviceOpsSt::ReadPage, SAMSUNG_BLOCK_STATUS_OFS, U_FAIL, UFFS_ERR_SERIOUS, uffs_Perror(), and uffs_DeviceOpsSt::WritePage.

Referenced by Samsung_MakePageValid().


Variable Documentation

struct uffs_FlashClassSt Samsung_FlashClass

Initial value:

 {
    "Samsung NAND",
    0xec,               
    valid_id_list,
    &Samsung_Flash,
}

Definition at line 169 of file uffs_nand_samsung.c.


Generated on Sat Mar 17 15:45:45 2007 for uffs-doc by  doxygen 1.5.0