linux2.6.28块设备mmc_sd卡s3c_device_hsmmc1设备

内核初始化时调用的函数
static struct platform_device *smdk6410_devices[] __initdata = {
#ifdef CONFIG_SMDK6410_SD_CH0
&s3c_device_hsmmc0,
#endif
#ifdef CONFIG_SMDK6410_SD_CH1
&s3c_device_hsmmc1,
#endif
#ifdef CONFIG_SMDK6410_SD_CH2
&s3c_device_hsmmc2,
#endif
&s3c_device_wdt,
&s3c_device_rtc,
&s3c_device_i2c0,
//&s3c_device_i2c1,
&s3c_device_spi0,
&s3c_device_spi1,
&s3c_device_dm9000_cs1,
&s3c_device_nand,
&s3c_device_usb,
&s3c_device_usbgadget,
&s3c_device_usb_otghcd,
省略很多----
};
/

struct platform_device s3c_device_hsmmc1 = {
.name = “s3c-sdhci”,
.id = 1,
.num_resources = ARRAY_SIZE(s3c_hsmmc1_resource),
.resource = s3c_hsmmc1_resource,
.dev = {
.dma_mask = &s3c_device_hsmmc1_dmamask,
.coherent_dma_mask = 0xffffffffUL,
.platform_data = &s3c_hsmmc1_def_platdata,
},
};
//
platform_driver定义在

static struct platform_driver sdhci_s3c_driver
///

static struct resource s3c_hsmmc1_resource[] = {
[0] = {
.start = S3C_PA_HSMMC1,
.end = S3C_PA_HSMMC1 + S3C_SZ_HSMMC - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_HSMMC1,
.end = IRQ_HSMMC1,
.flags = IORESOURCE_IRQ,
}
};
/
s3c6400与s3c6410是pin-to-pin的,可以认为是一样的,6400多了几个特殊外设而已。

#include

/* HSMMC units */
#define S3C64XX_PA_HSMMC(x) (0x7C200000 + ((x) * 0x100000))
#define S3C64XX_PA_HSMMC0 S3C64XX_PA_HSMMC(0)
#define S3C64XX_PA_HSMMC1 S3C64XX_PA_HSMMC(1)
#define S3C64XX_PA_HSMMC2 S3C64XX_PA_HSMMC(2)
#define S3C_SZ_HSMMC SZ_1M

#define S3C_PA_HSMMC0 S3C64XX_PA_HSMMC0
#define S3C_PA_HSMMC1 S3C64XX_PA_HSMMC1
#define S3C_PA_HSMMC2 S3C64XX_PA_HSMMC2

#define IRQ_HSMMC0 S3C64XX_IRQ_VIC1(24)
#define IRQ_HSMMC1 S3C64XX_IRQ_VIC1(25)
#define IRQ_HSMMC2 IRQ_SPI1 /* shared with SPI1 */

HSMMC0正好是VIC1的第24个
图片
/

struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
.max_width = 4,
.host_caps = (MMC_CAP_4_BIT_DATA | MMC_CAP_MMC_HIGHSPEED |
MMC_CAP_SD_HIGHSPEED),
};
///

#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers /
#define MMC_CAP_MMC_HIGHSPEED (1 << 1) /
Can do MMC high-speed timing /
#define MMC_CAP_SD_HIGHSPEED (1 << 2) /
Can do SD high-speed timing /
#define MMC_CAP_SDIO_IRQ (1 << 3) /
Can signal pending SDIO IRQs /
#define MMC_CAP_SPI (1 << 4) /
Talks only SPI protocols /
#define MMC_CAP_NEEDS_POLL (1 << 5) /
Needs polling for card-detection /
#define MMC_CAP_8_BIT_DATA (1 << 6) /
Can the host do 8 bit transfers /
#define MMC_CAP_ON_BOARD (1 << 7) /
Do not need to rescan after bootup /
#define MMC_CAP_BOOT_ONTHEFLY (1 << 8) /
Can detect device at boot time */
/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xx-xx-xxx-xxx

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值