您的位置:首页 > 其它

UBOOT-2012-10在OK6410平台的移植(九)MMC驱动

2014-04-01 01:47 495 查看
需要修改的内容:
1./include/configs/smdk6410.h
增加:
#define CONFIG_GENERIC_MMC 1
#define CONFIG_MMC 1
#define CONFIG_S3C64X0_MMC 1
#define CONFIG_CMD_MMC /* MMC support */
2./board/samsuang/smdk6410/smdk6410.c
增加:
#ifdef CONFIG_GENERIC_MMC
int board_mmc_init(bd_t *bis)
{
return s3c64x0_mmc_init(0);
}
#endif
3./drivers/mmc/makefile
增加:
COBJS-$(CONFIG_S3C64X0_MMC) = s3c64x0_mmc.o
4./arch/arm/asm/arch_s3c64xx/s3c64x0.h
增加:

//zxd -->
struct s3c64x0_mmc {
unsigned int sysad;
unsigned short blksize;
unsigned short blkcnt;
unsigned int argument;
unsigned short trnmod;
unsigned short cmdreg;
unsigned int rspreg0;
unsigned int rspreg1;
unsigned int rspreg2;
unsigned int rspreg3;
unsigned int bdata;
unsigned int prnsts;
unsigned char hostctl;
unsigned char pwrcon;
unsigned char blkgap;
unsigned char wakcon;
unsigned short clkcon;
unsigned char timeoutcon;
unsigned char swrst;
unsigned int norintsts; /* errintsts */
unsigned int norintstsen; /* errintstsen */
unsigned int norintsigen; /* errintsigen */
unsigned short acmd12errsts;
unsigned char res1[2];
unsigned int capareg;
unsigned char res2[4];
unsigned int maxcurr;
unsigned char res3[0x34];
unsigned int control2;
unsigned int control3;
unsigned int control4;
unsigned char res4[0x6e];
unsigned short hcver;
unsigned char res5[0xFFF02];
};
5./arch/arm/asm/arch_s3c64xx/s3c6410.h
增加:
//-->zxd
struct mmc_host {
struct s3c64x0_mmc *reg;
unsigned int version; /* SDHCI spec. version */
unsigned int clock; /* Current clock (MHz) */
};

int s3c64x0_mmc_init(int dev_index);
//<--zxd

6.复制 s3c64x0_mmc.c 到 /drivers/mmc/s3c64x0_mmc.c
s3c64x0_mmc.c增加:
#include /asm/arch/s3c64x0.h
7./include/mmc.h
struct mmc 结构体里面增加:
int (*detect_mmc)(struct mmc_host *mmc_host);//zxd
8./board/samsung/smdk6410/lowlevel_init.S
修改:
把0x200203 改为0x80200203,不然SD卡的命令都会没响应而“Time out error!”
/* FOUT of EPLL is 96MHz */
ldr r1, =0x80200203//zxd 0x200203
str r1, [r0, #EPLL_CON0_OFFSET]
改完后显示如下:
U-Boot 2012.10 (Nov 21 2012 - 16:29:30) for SMDK6410

CPU: S3C6410@533MHz

Fclk = 533MHz, Hclk = 133MHz, Pclk = 66MHz (ASYNC Mode)

Board: SMDK6410

monitor len: 0007F9C8

ramsize: 10000000

TLB table at: 5fff0000

Top of RAM usable for U-Boot at: 5fff0000

Reserving 510k for U-Boot at: 5ff30000

Reserving 544k for malloc() at: 5fea8000

Reserving 40 Bytes for Board Info at: 5fea7fd8

Reserving 120 Bytes for Global Data at: 5fea7f60

New Stack Pointer is: 5fea7f50

DRAM: 256 MiB

relocation Offset is: 08130000

_start addr is: 57e00000

new_gd: 5FEA7F60

new_addr: 5FF30000

new_sp: 5FEA7F50

WARNING: Caches not enabled

Flash: *** failed ***

NAND: 2048 MiB

MMC: SAMSUNG SD/MMC: 0

*** Warning - bad CRC, using default environment

********************************************************

initial lcd controller

clk_freq:9 MHz, div_freq:13 ,rea_freq:9 MHz

HBP = 2 HFP = 2 HSW = 41,Hpixs:480

VBP = 2 VFP = 2 VSW = 10,Vpixs:272

FrameBuff:5ffb0000

LCD initialization Finished.

In: serial

Out: lcd

Err: lcd

Net: dm9000Hit any key to stop autoboot: 0 SMDK6410 #mmcinfo
Device: SAMSUNG SD/MMC

Manufacturer ID: 2

OEM: 544d

Name: SD02G

Tran Speed: 50000000

Rd Block Len: 512

SD version 2.0

High Capacity: No

Capacity: 1.8 GiB

Bus Width: 4-bit

SMDK6410 # fatls mmc 0
15 test.txt

1 file(s), 0 dir(s)

SMDK6410 #


s3c64x0_mmc.c.zip


阅读(5) | 评论(0) | 转发(0) |

0
上一篇:UBOOT-2012-10在OK6410平台的移植(八)LCD输出

下一篇:UBOOT-2012-10在OK6410平台的移植(十)MLC NAND驱动(硬件8位ECC)

相关热门文章

欢迎ssw218在ChinaUnix博客安...

欢迎dadamouse在ChinaUnix博客...

欢迎zjkida在ChinaUnix博客安...

欢迎我是月下在ChinaUnix博客...

欢迎wenzishaniu在ChinaUnix博...

linux 常见服务端口

【ROOTFS搭建】busybox的httpd...

什么是shell

linux socket的bug??

linux的线程是否受到了保护?...

虚拟机中ubuntu无线连接问题...

IBM DS3400 盘阵怎么查看是单...

启动auditd时,报错如下,怎么...

CGSL系统中root密码正确,但无...

在CGSL系统中,如何为不同的用...

给主人留下些什么吧!~~

评论热议
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: