这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 嵌入式开发 » MCU » WinBond w90p710 uClinux移植问题

共1条 1/1 1 跳转至

WinBond w90p710 uClinux移植问题

菜鸟
2007-03-29 17:33:19     打赏

一网友的帖子,发上来供大家参考吧!

1、Makefile中没有romfs target,如何生成romfs是一个问题
2、MTD
相对原始版本uClinux, 修改了如下一些东西
include/linux/mtd/map.h
struct map_info {
char *name;
unsigned long size;

......
int bankwidth; /* in octets. This isn't necessarily the width 由buswidth修改成bankwidth
of actual bus cycles -- it's the repeat interval
in bytes, before you are talking to the first chip again.
*/

#ifdef CONFIG_MTD_COMPLEX_MAPPINGS 必须选择Support for non-linear mappings of flash chips才行
//2004-11-2 12:03
u8 (*read8)(struct map_info *, unsigned long);
u16 (*read16)(struct map_info *, unsigned long);
u32 (*read32)(struct map_info *, unsigned long);
u64 (*read64)(struct map_info *, unsigned long);
//2004-11-2 12:03
map_word (*read)(struct map_info *, unsigned long);
void (*copy_from)(struct map_info *, void *, unsigned long, ssize_t);

//2004-11-2 12:03
void (*write8)(struct map_info *, u8, unsigned long);
void (*write16)(struct map_info *, u16, unsigned long);
void (*write32)(struct map_info *, u32, unsigned long);
void (*write64)(struct map_info *, u64, unsigned long);
//2004-11-2 12:03

void (*write)(struct map_info *, const map_word, unsigned long);
void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t);

/* We can perhaps put in 'point' and 'unpoint' methods, if we really
want to enable XIP for non-linear mappings. Not yet though. */
#endif
......
};

include/linux/mtd/mtd.h
struct mtd_info {
u_char type;
u_int32_t flags;
u_int32_t size; // Total size of the MTD

/* "Major" erase size for the device. Na飗e users may take this
* to be the only erase size available, or may use the more detailed
* information below if they desire
*/
u_int32_t erasesize;

u_int32_t oobblock; // Size of OOB blocks (e.g. 512)
u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
u_int32_t oobavail; // Number of bytes in OOB area available for fs
u_int32_t ecctype;
u_int32_t eccsize;


// Kernel-only stuff starts here.
char *name;
int index;

// oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO)
struct nand_oobinfo oobinfo;

/* Data for variable erase regions. If numeraseregions is zero,
* it means that the whole device has erasesize as given above.
*/
int numeraseregions;
struct mtd_erase_region_info *eraseregions;

/* This really shouldn't be here. It can go away in 2.5 */
u_int32_t bank_size;

int (*erase) (struct mtd_info *mtd, struct erase_info *instr);

/* This stuff for eXecute-In-Place */
int (*point) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf);

/* We probably shouldn't allow XIP if the unpoint isn't a NULL */
void (*unpoint) (struct mtd_info *mtd, u_char * addr, loff_t from, size_t len);


int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);

int (*read_ecc) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
int (*write_ecc) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);

int (*read_oob) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
int (*write_oob) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);

/*
* Methods to access the protection register area, present in some
* flash devices. The user data is one time programmable but the
* factory data is read only.
*/
int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);

int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);

/* This function is not yet implemented */
int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);

/* kvec-based read/write methods. We need these especially for NAND flash,
with its limited number of write cycles per erase.
NB: The 'count' parameter is the number of _vectors_, each of
which contains an (ofs, len) tuple.
*/
int (*readv) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from, size_t *retlen);
int (*readv_ecc) (struct mtd_info *mtd, struct kvec *vecs, unsigned long count, loff_t from,
size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);
int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
int (*writev_ecc) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to,
size_t *retlen, u_char *eccbuf, struct nand_oobinfo *oobsel);

/* Sync */
void (*sync) (struct mtd_info *mtd);

/* Chip-supported device locking */
int (*lock) (struct mtd_info *mtd, loff_t ofs, size_t len);
int (*unlock) (struct mtd_info *mtd, loff_t ofs, size_t len);

/* Power Management functions */
int (*suspend) (struct mtd_info *mtd);
void (*resume) (struct mtd_info *mtd);

/* Bad block management functions */
int (*block_isbad) (struct mtd_info *mtd, loff_t ofs);
int (*block_markbad) (struct mtd_info *mtd, loff_t ofs);

void *priv;

struct module *owner; 由module修改为owner
int usecount;
};




关键词: WinBond     w90p710     uClinux         

共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]