Skip to contentSkip to conversation

Difference between twl4030_hsmmc_info and omap_mmc_platform_data

DISCUSSION Elvis Dowson 4 participants 6 messages Oct 14, 2010 – Oct 15, 2010 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,
I'm trying to bring up a TI WL1271 wlan module connected to MMC2 controller of a TI OMAP 3530 processor.

I am unclear about the difference between the use of twl4030_hsmmc_info and omap_mmc_platform_data, to set the attributes and constraints for the MMC1 (connected to microSD card) and MMC2 (connected to WLAN module).

The beagleboard uses twl4030_mmc_init, which has a wrapper for omap_mmc_platform_data defined in mmc-twl4030.h.

The board-sholes-hsmmc.c doesn't use twl4030, but directly uses the omap_mmc_platform_data structure.

Example:

board-omap3beagle.c uses twl4030_mmc_init, which internally uses the following structure to define mmc properties.

static struct twl4030_hsmmc_info mmc[] = {
{
.mmc = 1,
.wires = 8,
.gpio_wp = -ENOSYS,
.gpio_cd = -ENOSYS,
.name = "MMC1 controller slot"
},
{
.mmc = 2,
.wires = 4,
.gpio_cd = -EINVAL,
.gpio_wp = -EINVAL,
// .transceiver = true,

		.name           = "MMC2 controller slot",
		.ocr_mask       = 0x00000080,
	},
	{}	/* Terminator */
};

For board-sholes-hsmmc.c, it uses a omap_mmc_platform_data

static struct omap_mmc_platform_data mmc1_data = {
	.nr_slots			= 1,
	.init				= hsmmc_late_init,
	.cleanup			= hsmmc_cleanup,
#ifdef CONFIG_PM
	.suspend			= hsmmc_suspend,
	.resume				= hsmmc_resume,
#endif
	.dma_mask			= 0xffffffff,
	.slots[0] = {
		.wires			= 8,
		.set_power		= hsmmc_set_power,
		.ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34 |
						MMC_VDD_165_195,
		.name			= "first slot",
		/* we get car_detect_irq later */
		.card_detect_irq	= 0,
		.card_detect            = hsmmc_card_detect,
	},
};

#if defined(CONFIG_OMAP_HS_MMC2)
#ifdef CONFIG_MMC_EMBEDDED_SDIO

static struct sdio_embedded_func wifi_func_array[] = {
	{
		.f_class        = SDIO_CLASS_NONE,
		.f_maxblksize   = 0,
	},
	{
		.f_class        = SDIO_CLASS_WLAN,
		.f_maxblksize   = 512,
	},
};
static struct embedded_sdio_data sholes_wifi_emb_data = {
	.cis    = {
		.vendor         = 0x104c,
		.device         = 0x9066,
		.blksize        = 512,
		.max_dtr        = 24000000,
	},
	.cccr   = {
		.multi_block    = 1,
		.low_speed      = 0,
		.wide_bus       = 1,
		.high_power     = 0,
		.high_speed     = 0,
	},
	.funcs  = wifi_func_array,
	.num_funcs = 2,
};

#endif

static struct omap_mmc_platform_data mmc2_data = {
	.nr_slots			= 1,
	.init				= hsmmc2_late_init,
	.cleanup			= hsmmc2_cleanup,
#ifdef CONFIG_PM
	.suspend			= hsmmc2_suspend,
	.resume				= hsmmc2_resume,
#endif
	.dma_mask			= 0xffffffff,
#ifndef CONFIG_MMC_EMBEDDED_SDIO
	.name				= "TIWLAN_SDIO",
#endif
	.slots[0] = {
		.wires			= 4,
		.set_power		= hsmmc2_set_power,
		.ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34 |
						MMC_VDD_165_195,
		.name			= "first slot",
		.internal_clock		= 1,
		.card_detect_irq        = 0,
		.card_detect            = hsmmc2_card_detect,
#ifdef CONFIG_MMC_EMBEDDED_SDIO
		.embedded_sdio		= &sholes_wifi_emb_data,
		.register_status_notify	= &sholes_wifi_status_register,
#endif
	},
};

#endif

Best regards,

Elvis Dowson

#1 lore raw

Elvis Dowson had written, on 10/14/2010 04:48 PM, the following:

Quoted 4 lines

Hi,
I'm trying to bring up a TI WL1271 wlan module connected to MMC2 controller of a TI OMAP 3530 processor.

I am unclear about the difference between the use of twl4030_hsmmc_info and omap_mmc_platform_data, to set the attributes and constraints for the MMC1 (connected to microSD card) and MMC2 (connected to WLAN module).

could you please fix your mailer btw for line wraps?

Quoted 43 lines

The beagleboard uses twl4030_mmc_init, which has a wrapper for omap_mmc_platform_data defined in mmc-twl4030.h.

The board-sholes-hsmmc.c doesn't use twl4030, but directly uses the omap_mmc_platform_data structure.

Example:

board-omap3beagle.c uses twl4030_mmc_init, which internally uses the following structure to define mmc properties.

static struct twl4030_hsmmc_info mmc[] = {
{
.mmc = 1,
.wires = 8,
.gpio_wp = -ENOSYS,
.gpio_cd = -ENOSYS,
.name = "MMC1 controller slot"
},
{
.mmc = 2,
.wires = 4,
.gpio_cd = -EINVAL,
.gpio_wp = -EINVAL,
// .transceiver = true,

		.name           = "MMC2 controller slot",
		.ocr_mask       = 0x00000080,
	},
	{}	/* Terminator */
};

For board-sholes-hsmmc.c, it uses a omap_mmc_platform_data

static struct omap_mmc_platform_data mmc1_data = {
	.nr_slots			= 1,
	.init				= hsmmc_late_init,
	.cleanup			= hsmmc_cleanup,
#ifdef CONFIG_PM
	.suspend			= hsmmc_suspend,
	.resume				= hsmmc_resume,
#endif
	.dma_mask			= 0xffffffff,
	.slots[0] = {
		.wires			= 8,
		.set_power		= hsmmc_set_power,
Quoted 8 lines
		.ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34 |
						MMC_VDD_165_195,
		.name			= "first slot",
		/* we get car_detect_irq later */
		.card_detect_irq	= 0,
		.card_detect            = hsmmc_card_detect,
	},
};

Dont have a board-sholes-hsmm.c in l-o[1]... :( so not sure which kernel you are talking about here.
mainline does it this way:
board files report using omap2_hsmmc_info[2] to hsmmc.c using omap2_hsmmc_init[3] - hsmmc.c converts them to required datastructures that omap_hsmmc.c uses..

[1] http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=tree;f=arch/arm/mach-omap2;h=abedb1903a0d81f33d7614480da0f7a0c78f8f2f;hb=HEAD
[2] http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=blob;f=arch/arm/mach-omap2/hsmmc.h;h=281e97287adf988493efd1ca94b19ab8588b7aaf;hb=HEAD#l11
[3] http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=blob;f=arch/arm/mach-omap2/board-omap3beagle.c;h=73689c082b26d0ef38233c0adefc1d0b9d14e8d0;hb=HEAD#l287

Signature · 2 lines
Regards,
Nishanth Menon

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Elvis Dowson had written, on 10/14/2010 06:08 PM, the following:

Quoted 9 lines

Hi Nishanth,

Quoted 1 line · Nishanth Menon

Dont have a board-sholes-hsmm.c in l-o[1]... :( so not sure which kernel you are talking about here.

This is in the omapzoom, p-android-omap-2.6.32 branch

http://git.omapzoom.org/?p=kernel/omap.git;a=tree;f=arch/arm/mach-omap2;h=c64c82c9c28c33f925ce59f1c5c471f7fa8ac0c3;hb=refs/heads/p-android-omap-2.6.32

Cant really help you with this kernel as I am not familiar with that code. I recommend [1] instead.

Ref:
[1] https://gforge.ti.com/gf/project/omapandroid/mailman/?action=ListThreads&mailman_id=22

Signature · 2 lines
Regards,
Nishanth Menon

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

Elvis Dowson had written, on 10/14/2010 06:18 PM, the following:

Quoted 9 lines

Hi,

Quoted 3 lines · Nishanth Menon

mainline does it this way:
board files report using omap2_hsmmc_info[2] to hsmmc.c using omap2_hsmmc_init[3] - hsmmc.c converts them to required datastructures that omap_hsmmc.c uses..

What is the relationship between twl4030 and hsmmc controller in this chain, especially with respect to MMC2?

As far as I know, card detection and power supply.

Signature · 2 lines
Regards,
Nishanth Menon
#6 lore raw

RE: [Omapandroid-discussion] Difference between twl4030_hsmmc_infoand omap_mmc_platform_data

In reply to a message not in the archive
Quoted 15 lines

-----Original Message-----
From: [email protected] [mailto:omapandroid- [email protected]] On Behalf Of Elvis Dowson
Sent: Thursday, October 14, 2010 6:19 PM
To: Nishanth Menon
Cc: Linux OMAP Mailing List; [email protected]
Subject: Re: [Omapandroid-discussion] Difference between twl4030_hsmmc_infoand omap_mmc_platform_data

Hi,

Quoted 1 line · Nishanth Menon
Quoted 9 lines
Quoted 2 lines

mainline does it this way:
board files report using omap2_hsmmc_info[2] to hsmmc.c using

omap2_hsmmc_init[3] - hsmmc.c converts them to required datastructures that omap_hsmmc.c uses..

What is the relationship between twl4030 and hsmmc controller in this chain,
especially with respect to MMC2?

Twl4030 is the power chip. Its LDOs are modeled through the regulator framework used by MMC1 and MMC2. On OMAP3 the card detect is from the GPIO module of twl4030.

Regards,
Madhu

Quoted 8 lines

Best regards,

Elvis

_______________________________________________
Omapandroid-discussion mailing list
[email protected]
https://gforge.ti.com/mailman/listinfo/omapandroid-discussion

#7 lore raw
In reply to Elvis Dowson

Hi Elvis,

Quoted 1 line · ext Elvis Dowson

I'm trying to bring up a TI WL1271 wlan module connected to MMC2 controller of a TI OMAP 3530 processor.

Some weeks ago I have sent a patch to linux-omap and linux-wireless mailing lists to add support for the wl1271 expansion card on the Beagle board. It was not accepted because of two things: first I had hardcoded the board configuration file, so that it would only work with wl1271 (and not with other expansion boards); second the expansion card should be detected by using the EEPROM connected to the i2c lines in the expansion board, but at the moment Beagle people do this kind of detection in the bootloader and not in the kernel

Anyways, the patch I sent works at least with the wl1271 daugther card from CircuitCo, if you just want to try it out.

https://patchwork.kernel.org/patch/201572/

Signature · 2 lines
Cheers,
Luca.