2010-11-08 22:14:39

by Joerie de Gram

[permalink] [raw]
Subject: wl1271 sdio timeouts on omap3

Hi,

I'm trying to get the wl1271 (sdio) driver running on an
OMAP3430-based board. I've based my board support on the patches by
Ohad Ben-Cohen for zoom2 and Luciano Coelho's beagleboard patches.
However, I'm experiencing trouble bringing the interface up, getting a
lockup in mmc_wait_for_req (called from wl1271_sdio_power_on). In 10%
of my attempts the driver gets as far as uploading the firmware after
which I'm getting similar SDIO timeouts.

I'm mostly unsure about my regulator config (relevant snippets below),
having no wl1271 documentation to work with. The wl1271 is on mmc3,
powered by twl4030 vsim. I assume the fixed regulator in [1] is just
to be able to control the PMENA GPIO?

Pin muxing aside, all changes are equal to those displayed in [1]. Is
there anything I might be doing wrong wrt. the power-up sequence?

[1]: https://patchwork.kernel.org/patch/201572/

Joerie

----------

static struct regulator_consumer_supply nowplus_vsim_supply = {
.supply = "vmmc",
};


static struct regulator_consumer_supply nowplus_wl1271_supply = {
.supply = "vmmc_aux",
.dev_name = "mmci-omap-hs.2",
};


/* VSIM for WiFi SDIO */
static struct regulator_init_data nowplus_vsim = {
.constraints = {
.name = "VSIM",
.min_uV = 1800000,
.max_uV = 1800000,
.apply_uV = true,
.valid_modes_mask = REGULATOR_MODE_NORMAL
| REGULATOR_MODE_STANDBY,
.valid_ops_mask = REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1,
.consumer_supplies = &nowplus_vsim_supply,
};

static struct regulator_init_data nowplus_wlgpio = {
.constraints = {
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1,
.consumer_supplies = &nowplus_wl1271_supply,
};


2010-11-10 21:24:51

by Joerie de Gram

[permalink] [raw]
Subject: Re: wl1271 sdio timeouts on omap3

Hi,

On Wed, Nov 10, 2010 at 4:13 PM, Ohad Ben-Cohen <[email protected]> wrote:
> Can you pls tell me what's the output of those commands (after
> bringing up the wlan interface):

clock: 25000000 Hz
vdd: 7 (1.65 - 1.95 V)
bus mode: 2 (push-pull)
chip select: 0 (don't care)
power mode: 2 (on)
bus width: 2 (4 bits)
timing spec: 0 (legacy)

> Can you say what board is it ? is it something you assembled or is it
> off-the-shelf ?

It's a samsung GT-i8320 smartphone. Supposedly assembled correctly..

> Honestly I would hook up a hw scope and sniff the SDIO lines to see
> what's going on.

Unfortunately I don't have access to a scope.

> Check out mmc_sdio_init_card() - the clock rate is increased there.

If I stop it from setting maximum clock speed, it appears to run at
400 KHz and subsequently it (usually) manages to bring up the
interface. AP scans seem to complete just fine too (although they
yield no result, which is a different problem). It's still not
entirely stable though (bringing the interface down and back up again
results in another timeout).

Peeking at /dev/mem with the proprietary driver running suggests it
runs at a (usual) 24 MHz mmc clock.

Joerie

2010-11-11 11:06:01

by Grazvydas Ignotas

[permalink] [raw]
Subject: Re: wl1271 sdio timeouts on omap3

On Wed, Nov 10, 2010 at 5:01 PM, Joerie de Gram <[email protected]> wrote:
> On Wed, Nov 10, 2010 at 6:35 AM, Ohad Ben-Cohen <[email protected]> wrote:
>> Snippets below are not complete. E.g., where do you actually indicate
>> the gpio number ?
>> It's better to send your complete patch so we can have a look.
>
> Sorry, I've attached a full diff of the board changes below.

Your vsim configuration looks wrong.

<snip>

>
> @@ -213,6 +224,16 @@ static struct regulator_consumer_supply
> nowplus_vpll2_supply = {
> ? ? ? ?.dev ? ? ? ? ? ? ? ? ? ?= &nowplus_dss_device.dev,
> ?};
>
> +static struct regulator_consumer_supply nowplus_vsim_supply = {
> + ? ? ? .supply ? ? ? ? ? ? ? ? = "vmmc",
> +};

You need to set .dev or .dev_name here, best just do
+ .dev_name = "mmci-omap-hs.2",

> +
> +
> +static struct regulator_consumer_supply nowplus_wl1271_supply = {
> + ? ? ? .supply ? ? ? ? ? ? ? ? = "vmmc_aux",
> + ? ? ? .dev_name ? ? ? ? ? ? ? = "mmci-omap-hs.2",
> +};
> +
> ?/* VMMC1 for MMC1 card */
> ?static struct regulator_init_data nowplus_vmmc1 = {
> ? ? ? ?.constraints = {
> @@ -311,6 +332,53 @@ static struct regulator_init_data nowplus_vpll2 = {
> ? ? ? ?.consumer_supplies ? ? ?= &nowplus_vpll2_supply,
> ?};
>
> +/* VSIM for WiFi SDIO */
> +static struct regulator_init_data nowplus_vsim = {

doesn't seem to be referenced anywhere? You need to add it to
twl4030_platform_data I think.

2010-11-10 15:01:42

by Joerie de Gram

[permalink] [raw]
Subject: Re: wl1271 sdio timeouts on omap3

Hi Ohad,

On Wed, Nov 10, 2010 at 6:35 AM, Ohad Ben-Cohen <[email protected]> wrote:
> Snippets below are not complete. E.g., where do you actually indicate
> the gpio number ?
> It's better to send your complete patch so we can have a look.

Sorry, I've attached a full diff of the board changes below.

> The issues you are experiencing sound more like hw issues (e.g. faulty
> board level shifter) or misconfiguration of the SDIO pins (e.g. lines
> not pulled up).

The board shipped with a firmware image which uses the TI proprietary
driver, that works.. I've carefully checked my pin muxing (the other
pads on which MMC3 may be muxed are disabled).

> I suggest you to try working with 1 bit SDIO and/or low clock speeds
> and see if stability is improved.

Setting .wires to 1 unfortunately didn't help. I'm not sure how to
lower the clock speeds though.

I've enabled MMC debugging, which yields the following dmesg output
(tried to bring the interface up at t=265).

[ 6.108154] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
[ 6.108215] mmc2: starting CMD52 arg 80042202 flags 00000195
[ 6.108245] mmc2: req done (CMD52): 0: 00001002 00000000 00000000 00000000
[ 6.112121] wl1271: loaded
[ 6.112152] wl1271: initialized
[ 15.989318] wl1271: mac80211 start
[ 15.989410] wl1271: mac80211 stop
[ 265.258666] wl1271: mac80211 start
[ 265.258758] wl1271: mac80211 add interface type 2 mac 9e:be:10:f4:a4:d6
[ 265.512664] SDIO: Enabling device mmc2:0001:2...
[ 265.512695] mmc2: starting CMD52 arg 00000400 flags 00000195
[ 279.317413] INFO: task ifconfig:1301 blocked for more than 10 seconds.
[ 279.317443] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"
disables this message.
[ 279.317474] ifconfig D c03111d4 0 1301 1269 0x00000000
[ 279.317535] [<c03111d4>] (schedule+0x37c/0x404) from [<c0311814>]
(schedule_timeout+0x18/0x1dc)
[ 279.317565] [<c0311814>] (schedule_timeout+0x18/0x1dc) from
[<c0311698>] (wait_for_common+0xf0/0x1a8)
[ 279.317626] [<c0311698>] (wait_for_common+0xf0/0x1a8) from
[<c02194a8>] (mmc_wait_for_req+0x224/0x244)
[ 279.317657] [<c02194a8>] (mmc_wait_for_req+0x224/0x244) from
[<c021952c>] (mmc_wait_for_cmd+0x64/0x74)
[ 279.317687] [<c021952c>] (mmc_wait_for_cmd+0x64/0x74) from
[<c021d8dc>] (mmc_io_rw_direct_host+0xc0/0x124)
[ 279.317749] [<c021d8dc>] (mmc_io_rw_direct_host+0xc0/0x124) from
[<c021efcc>] (sdio_enable_func+0x64/0x15c)
[ 279.317779] [<c021efcc>] (sdio_enable_func+0x64/0x15c) from
[<c01cdaec>] (wl1271_sdio_set_power+0x20/0x44)
[ 279.317810] [<c01cdaec>] (wl1271_sdio_set_power+0x20/0x44) from
[<c01c500c>] (wl1271_chip_wakeup+0x28/0x2f0)
<snip>

Joerie

----

diff --git b/arch/arm/mach-omap2/board-nowplus.c
a/arch/arm/mach-omap2/board-nowplus.c
index 54246dd..af47e98 100644
--- b/arch/arm/mach-omap2/board-nowplus.c
+++ a/arch/arm/mach-omap2/board-nowplus.c
@@ -29,6 +29,7 @@
#include <linux/input.h>
#include <linux/input/matrix_keypad.h>

+#include <linux/wl12xx.h>
#include <linux/leds-bd2802.h>
#include <linux/max17040_battery.h>

@@ -52,6 +53,8 @@

#define NOWPLUS_CHARGER_ENABLE_GPIO 157
#define NOWPLUS_CHARGING_STATUS_GPIO 16
+#define NOWPLUS_WLAN_IRQ_GPIO 21
+#define NOWPLUS_WLAN_PMENA_GPIO 160

static struct bd2802_led_platform_data nowplus_led_data = {
.reset_gpio = 151,
@@ -119,6 +122,14 @@ static struct omap2_hsmmc_info nowplus_mmc[] = {
.gpio_cd = -EINVAL,
.gpio_wp = -EINVAL,
},
+ {
+ .name = "wl1271",
+ .mmc = 3,
+ .wires = 4,
+ .nonremovable = 1,
+ .gpio_cd = -EINVAL,
+ .gpio_wp = -EINVAL,
+ },
{} /* Terminator */
};

@@ -213,6 +224,16 @@ static struct regulator_consumer_supply
nowplus_vpll2_supply = {
.dev = &nowplus_dss_device.dev,
};

+static struct regulator_consumer_supply nowplus_vsim_supply = {
+ .supply = "vmmc",
+};
+
+
+static struct regulator_consumer_supply nowplus_wl1271_supply = {
+ .supply = "vmmc_aux",
+ .dev_name = "mmci-omap-hs.2",
+};
+
/* VMMC1 for MMC1 card */
static struct regulator_init_data nowplus_vmmc1 = {
.constraints = {
@@ -311,6 +332,53 @@ static struct regulator_init_data nowplus_vpll2 = {
.consumer_supplies = &nowplus_vpll2_supply,
};

+/* VSIM for WiFi SDIO */
+static struct regulator_init_data nowplus_vsim = {
+ .constraints = {
+ .name = "VSIM",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .apply_uV = true,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &nowplus_vsim_supply,
+};
+
+static struct regulator_init_data nowplus_wlgpio = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &nowplus_wl1271_supply,
+};
+
+static struct fixed_voltage_config nowplus_vwlan = {
+ .supply_name = "vwl1271",
+ .microvolts = 1800000, /* 1.8V */
+ .gpio = NOWPLUS_WLAN_PMENA_GPIO,
+ .startup_delay = 70000, /* 70msec */
+ .enable_high = 1,
+ .enabled_at_boot = 0,
+ .init_data = &nowplus_wlgpio,
+};
+
+static struct platform_device nowplus_vwlan_device = {
+ .name = "reg-fixed-voltage",
+ .id = 1,
+ .dev = {
+ .platform_data = &nowplus_vwlan,
+ },
+};
+
+struct wl12xx_platform_data nowplus_wlan_data __initdata = {
+ .irq = OMAP_GPIO_IRQ(NOWPLUS_WLAN_IRQ_GPIO),
+ .board_ref_clock = 1, /* 26 MHz */
+};
+
static int nowplus_twl_gpio_setup(struct device *dev,
unsigned gpio, unsigned ngpio)
{
@@ -467,6 +535,19 @@ static void __init nowplus_init_irq(void)

#ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = {
+ /* WLAN IRQ - GPIO 21 */
+ OMAP3_MUX(ETK_D7, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
+ /* WLAN POWER ENABLE - GPIO 160 */
+ OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
+ /* WLAN SDIO: MMC3 CMD */
+ OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
+ /* WLAN SDIO: MMC3 CLK */
+ OMAP3_MUX(MCSPI1_CS2, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
+ /* WLAN SDIO: MMC3 DAT[0-3] */
+ OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+ OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+ OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
+ OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
{ .reg_offset = OMAP_MUX_TERMINATOR },
};
#else
@@ -483,10 +564,14 @@ static void __init nowplus_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);

+ if (wl12xx_set_platform_data(&nowplus_wlan_data))
+ pr_err("error setting wl12xx data\n");
+
nowplus_i2c_init();

platform_add_devices(nowplus_devices,
ARRAY_SIZE(nowplus_devices));
+ platform_device_register(&nowplus_vwlan_device);

spi_register_board_info(nowplus_spi_board_info,
ARRAY_SIZE(nowplus_spi_board_info));

2010-11-10 21:40:18

by Ohad Ben Cohen

[permalink] [raw]
Subject: Re: wl1271 sdio timeouts on omap3

On Wed, Nov 10, 2010 at 11:24 PM, Joerie de Gram <[email protected]> wrote:
> clock: ? ? ? ? ?25000000 Hz
> vdd: ? ? ? ? ? ?7 (1.65 - 1.95 V)
> bus mode: ? ? ? 2 (push-pull)
> chip select: ? ?0 (don't care)
> power mode: ? ? 2 (on)
> bus width: ? ? ?2 (4 bits)
> timing spec: ? ?0 (legacy)

seems good...

> It's a samsung GT-i8320 smartphone. Supposedly assembled correctly..

heh. yeah.

> If I stop it from setting maximum clock speed, it appears to run at
> 400 KHz and subsequently it (usually) manages to bring up the
> interface. AP scans seem to complete just fine too (although they
> yield no result, which is a different problem). It's still not
> entirely stable though (bringing the interface down and back up again
> results in another timeout).

Assuming that the hw is good (and if the proprietary driver runs ok
then it is) leaves us with mmc pins misconfiguration. Are you sure the
lines are pulled up ?

> Peeking at /dev/mem with the proprietary driver running suggests it
> runs at a (usual) 24 MHz mmc clock.

Yeah. but after passing the host controller divisor, it's exactly the
same as the 25Mhz you see with the the mainline driver.

>
> Joerie
>

2010-11-10 15:13:30

by Ohad Ben Cohen

[permalink] [raw]
Subject: Re: wl1271 sdio timeouts on omap3

Hi Joerie,

On Wed, Nov 10, 2010 at 5:01 PM, Joerie de Gram <[email protected]> wrote:
> Sorry, I've attached a full diff of the board changes below.

Ok, thanks.

I took a brief look and couldn't find anything outstanding, but as I
said, if you passed CMD5 (very early at the SDIO init process) then
your card is powered and communicating.

Can you pls tell me what's the output of those commands (after
bringing up the wlan interface):

mount -t debugfs none /sys/kernel/debug
cat /sys/kernel/debug/mmc2/ios

> The board shipped with a firmware image which uses the TI proprietary

Can you say what board is it ? is it something you assembled or is it
off-the-shelf ?

Honestly I would hook up a hw scope and sniff the SDIO lines to see
what's going on.

> driver, that works.. I've carefully checked my pin muxing (the other
> pads on which MMC3 may be muxed are disabled).
>
>> I suggest you to try working with 1 bit SDIO and/or low clock speeds
>> and see if stability is improved.
>
> Setting .wires to 1 unfortunately didn't help. I'm not sure how to
> lower the clock speeds though.

There are several ways to do that.

Check out mmc_sdio_init_card() - the clock rate is increased there.

Regards,
Ohad.

>
> I've enabled MMC debugging, which yields the following dmesg output
> (tried to bring the interface up at t=265).
>
> [ ? ?6.108154] mmc2: req done (CMD52): 0: 00001000 00000000 00000000 00000000
> [ ? ?6.108215] mmc2: starting CMD52 arg 80042202 flags 00000195
> [ ? ?6.108245] mmc2: req done (CMD52): 0: 00001002 00000000 00000000 00000000
> [ ? ?6.112121] wl1271: loaded
> [ ? ?6.112152] wl1271: initialized
> [ ? 15.989318] wl1271: mac80211 start
> [ ? 15.989410] wl1271: mac80211 stop
> [ ?265.258666] wl1271: mac80211 start
> [ ?265.258758] wl1271: mac80211 add interface type 2 mac 9e:be:10:f4:a4:d6
> [ ?265.512664] SDIO: Enabling device mmc2:0001:2...
> [ ?265.512695] mmc2: starting CMD52 arg 00000400 flags 00000195
> [ ?279.317413] INFO: task ifconfig:1301 blocked for more than 10 seconds.
> [ ?279.317443] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"
> disables this message.
> [ ?279.317474] ifconfig ? ? ?D c03111d4 ? ? 0 ?1301 ? 1269 0x00000000
> [ ?279.317535] [<c03111d4>] (schedule+0x37c/0x404) from [<c0311814>]
> (schedule_timeout+0x18/0x1dc)
> [ ?279.317565] [<c0311814>] (schedule_timeout+0x18/0x1dc) from
> [<c0311698>] (wait_for_common+0xf0/0x1a8)
> [ ?279.317626] [<c0311698>] (wait_for_common+0xf0/0x1a8) from
> [<c02194a8>] (mmc_wait_for_req+0x224/0x244)
> [ ?279.317657] [<c02194a8>] (mmc_wait_for_req+0x224/0x244) from
> [<c021952c>] (mmc_wait_for_cmd+0x64/0x74)
> [ ?279.317687] [<c021952c>] (mmc_wait_for_cmd+0x64/0x74) from
> [<c021d8dc>] (mmc_io_rw_direct_host+0xc0/0x124)
> [ ?279.317749] [<c021d8dc>] (mmc_io_rw_direct_host+0xc0/0x124) from
> [<c021efcc>] (sdio_enable_func+0x64/0x15c)
> [ ?279.317779] [<c021efcc>] (sdio_enable_func+0x64/0x15c) from
> [<c01cdaec>] (wl1271_sdio_set_power+0x20/0x44)
> [ ?279.317810] [<c01cdaec>] (wl1271_sdio_set_power+0x20/0x44) from
> [<c01c500c>] (wl1271_chip_wakeup+0x28/0x2f0)
> <snip>
>
> Joerie
>
> ----
>
> diff --git b/arch/arm/mach-omap2/board-nowplus.c
> a/arch/arm/mach-omap2/board-nowplus.c
> index 54246dd..af47e98 100644
> --- b/arch/arm/mach-omap2/board-nowplus.c
> +++ a/arch/arm/mach-omap2/board-nowplus.c
> @@ -29,6 +29,7 @@
> ?#include <linux/input.h>
> ?#include <linux/input/matrix_keypad.h>
>
> +#include <linux/wl12xx.h>
> ?#include <linux/leds-bd2802.h>
> ?#include <linux/max17040_battery.h>
>
> @@ -52,6 +53,8 @@
>
> ?#define NOWPLUS_CHARGER_ENABLE_GPIO ? ?157
> ?#define NOWPLUS_CHARGING_STATUS_GPIO ? 16
> +#define NOWPLUS_WLAN_IRQ_GPIO ? ? ? ? ?21
> +#define NOWPLUS_WLAN_PMENA_GPIO ? ? ? ?160
>
> ?static struct bd2802_led_platform_data nowplus_led_data = {
> ? ? ? ?.reset_gpio = 151,
> @@ -119,6 +122,14 @@ static struct omap2_hsmmc_info nowplus_mmc[] = {
> ? ? ? ? ? ? ? ?.gpio_cd ? ? ? ?= -EINVAL,
> ? ? ? ? ? ? ? ?.gpio_wp ? ? ? ?= -EINVAL,
> ? ? ? ?},
> + ? ? ? {
> + ? ? ? ? ? ? ? .name ? ? ? ? ? = "wl1271",
> + ? ? ? ? ? ? ? .mmc ? ? ? ? ? ?= 3,
> + ? ? ? ? ? ? ? .wires ? ? ? ? ?= 4,
> + ? ? ? ? ? ? ? .nonremovable ? = 1,
> + ? ? ? ? ? ? ? .gpio_cd ? ? ? ?= -EINVAL,
> + ? ? ? ? ? ? ? .gpio_wp ? ? ? ?= -EINVAL,
> + ? ? ? },
> ? ? ? ?{} ? ? ?/* Terminator */
> ?};
>
> @@ -213,6 +224,16 @@ static struct regulator_consumer_supply
> nowplus_vpll2_supply = {
> ? ? ? ?.dev ? ? ? ? ? ? ? ? ? ?= &nowplus_dss_device.dev,
> ?};
>
> +static struct regulator_consumer_supply nowplus_vsim_supply = {
> + ? ? ? .supply ? ? ? ? ? ? ? ? = "vmmc",
> +};
> +
> +
> +static struct regulator_consumer_supply nowplus_wl1271_supply = {
> + ? ? ? .supply ? ? ? ? ? ? ? ? = "vmmc_aux",
> + ? ? ? .dev_name ? ? ? ? ? ? ? = "mmci-omap-hs.2",
> +};
> +
> ?/* VMMC1 for MMC1 card */
> ?static struct regulator_init_data nowplus_vmmc1 = {
> ? ? ? ?.constraints = {
> @@ -311,6 +332,53 @@ static struct regulator_init_data nowplus_vpll2 = {
> ? ? ? ?.consumer_supplies ? ? ?= &nowplus_vpll2_supply,
> ?};
>
> +/* VSIM for WiFi SDIO */
> +static struct regulator_init_data nowplus_vsim = {
> + ? ? ? .constraints = {
> + ? ? ? ? ? ? ? .name ? ? ? ? ? ? ? ? ? = "VSIM",
> + ? ? ? ? ? ? ? .min_uV ? ? ? ? ? ? ? ? = 1800000,
> + ? ? ? ? ? ? ? .max_uV ? ? ? ? ? ? ? ? = 1800000,
> + ? ? ? ? ? ? ? .apply_uV ? ? ? ? ? ? ? = true,
> + ? ? ? ? ? ? ? .valid_modes_mask ? ? ? = REGULATOR_MODE_NORMAL
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | REGULATOR_MODE_STANDBY,
> + ? ? ? ? ? ? ? .valid_ops_mask ? ? ? ? = REGULATOR_CHANGE_MODE
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | REGULATOR_CHANGE_STATUS,
> + ? ? ? },
> + ? ? ? .num_consumer_supplies ?= 1,
> + ? ? ? .consumer_supplies ? ? ?= &nowplus_vsim_supply,
> +};
> +
> +static struct regulator_init_data nowplus_wlgpio = {
> + ? ? ? .constraints = {
> + ? ? ? ? ? ? ? .valid_ops_mask = REGULATOR_CHANGE_STATUS,
> + ? ? ? },
> + ? ? ? .num_consumer_supplies ?= 1,
> + ? ? ? .consumer_supplies ? ? ?= &nowplus_wl1271_supply,
> +};
> +
> +static struct fixed_voltage_config nowplus_vwlan = {
> + ? ? ? .supply_name ? ? ? ? ? ?= "vwl1271",
> + ? ? ? .microvolts ? ? ? ? ? ? = 1800000, /* 1.8V */
> + ? ? ? .gpio ? ? ? ? ? ? ? ? ? = NOWPLUS_WLAN_PMENA_GPIO,
> + ? ? ? .startup_delay ? ? ? ? ?= 70000, /* 70msec */
> + ? ? ? .enable_high ? ? ? ? ? ?= 1,
> + ? ? ? .enabled_at_boot ? ? ? ?= 0,
> + ? ? ? .init_data ? ? ? ? ? ? ?= &nowplus_wlgpio,
> +};
> +
> +static struct platform_device nowplus_vwlan_device = {
> + ? ? ? .name ? ? ? ? ? = "reg-fixed-voltage",
> + ? ? ? .id ? ? ? ? ? ? = 1,
> + ? ? ? .dev = {
> + ? ? ? ? ? ? ? .platform_data ?= &nowplus_vwlan,
> + ? ? ? },
> +};
> +
> +struct wl12xx_platform_data nowplus_wlan_data __initdata = {
> + ? ? ? .irq = OMAP_GPIO_IRQ(NOWPLUS_WLAN_IRQ_GPIO),
> + ? ? ? .board_ref_clock = 1, /* 26 MHz */
> +};
> +
> ?static int nowplus_twl_gpio_setup(struct device *dev,
> ? ? ? ? ? ? ? ?unsigned gpio, unsigned ngpio)
> ?{
> @@ -467,6 +535,19 @@ static void __init nowplus_init_irq(void)
>
> ?#ifdef CONFIG_OMAP_MUX
> ?static struct omap_board_mux board_mux[] __initdata = {
> + ? ? ? /* WLAN IRQ - GPIO 21 */
> + ? ? ? OMAP3_MUX(ETK_D7, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
> + ? ? ? /* WLAN POWER ENABLE - GPIO 160 */
> + ? ? ? OMAP3_MUX(MCBSP_CLKS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
> + ? ? ? /* WLAN SDIO: MMC3 CMD */
> + ? ? ? OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
> + ? ? ? /* WLAN SDIO: MMC3 CLK */
> + ? ? ? OMAP3_MUX(MCSPI1_CS2, OMAP_MUX_MODE3 | OMAP_PIN_INPUT_PULLUP),
> + ? ? ? /* WLAN SDIO: MMC3 DAT[0-3] */
> + ? ? ? OMAP3_MUX(ETK_D3, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
> + ? ? ? OMAP3_MUX(ETK_D4, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
> + ? ? ? OMAP3_MUX(ETK_D5, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
> + ? ? ? OMAP3_MUX(ETK_D6, OMAP_MUX_MODE2 | OMAP_PIN_INPUT_PULLUP),
> ? ? ? ?{ .reg_offset = OMAP_MUX_TERMINATOR },
> ?};
> ?#else
> @@ -483,10 +564,14 @@ static void __init nowplus_init(void)
> ?{
> ? ? ? ?omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
>
> + ? ? ? if (wl12xx_set_platform_data(&nowplus_wlan_data))
> + ? ? ? ? ? ? ? pr_err("error setting wl12xx data\n");
> +
> ? ? ? ?nowplus_i2c_init();
>
> ? ? ? ?platform_add_devices(nowplus_devices,
> ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(nowplus_devices));
> + ? ? ? platform_device_register(&nowplus_vwlan_device);
>
> ? ? ? ?spi_register_board_info(nowplus_spi_board_info,
> ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(nowplus_spi_board_info));
>

2010-11-10 05:35:36

by Ohad Ben Cohen

[permalink] [raw]
Subject: Re: wl1271 sdio timeouts on omap3

Hi Joerie,

On Tue, Nov 9, 2010 at 12:14 AM, Joerie de Gram <[email protected]> wrote:
> lockup in mmc_wait_for_req (called from wl1271_sdio_power_on). In 10%
> of my attempts the driver gets as far as uploading the firmware after
> which I'm getting similar SDIO timeouts.
>
> I'm mostly unsure about my regulator config (relevant snippets below),

Snippets below are not complete. E.g., where do you actually indicate
the gpio number ?

It's better to send your complete patch so we can have a look.

> having no wl1271 documentation to work with. The wl1271 is on mmc3,
> powered by twl4030 vsim. I assume the fixed regulator in [1] is just
> to be able to control the PMENA GPIO?

Yes.

> Pin muxing aside, all changes are equal to those displayed in [1]. Is
> there anything I might be doing wrong wrt. the power-up sequence?

Indeterministic SDIO behavior is unlikely to be related to the
device's gpio-based power, since it's either on or off.

The issues you are experiencing sound more like hw issues (e.g. faulty
board level shifter) or misconfiguration of the SDIO pins (e.g. lines
not pulled up).

I suggest you to try working with 1 bit SDIO and/or low clock speeds
and see if stability is improved.

If not, the best thing to do is sniffing the hardware lines - power,
clock, mmc 1-4,.. You will then know exactly what's wrong.

Regards,
Ohad.

>
> [1]: https://patchwork.kernel.org/patch/201572/
>
> Joerie
>
> ----------
>
> static struct regulator_consumer_supply nowplus_vsim_supply = {
> ? ? ? ?.supply ? ? ? ? ? ? ? ? = "vmmc",
> };
>
>
> static struct regulator_consumer_supply nowplus_wl1271_supply = {
> ? ? ? ?.supply ? ? ? ? ? ? ? ? = "vmmc_aux",
> ? ? ? ?.dev_name ? ? ? ? ? ? ? = "mmci-omap-hs.2",
> };
>
>
> /* VSIM for WiFi SDIO */
> static struct regulator_init_data nowplus_vsim = {
> ? ? ? ?.constraints = {
> ? ? ? ? ? ? ? ?.name ? ? ? ? ? ? ? ? ? = "VSIM",
> ? ? ? ? ? ? ? ?.min_uV ? ? ? ? ? ? ? ? = 1800000,
> ? ? ? ? ? ? ? ?.max_uV ? ? ? ? ? ? ? ? = 1800000,
> ? ? ? ? ? ? ? ?.apply_uV ? ? ? ? ? ? ? = true,
> ? ? ? ? ? ? ? ?.valid_modes_mask ? ? ? = REGULATOR_MODE_NORMAL
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| REGULATOR_MODE_STANDBY,
> ? ? ? ? ? ? ? ?.valid_ops_mask ? ? ? ? = REGULATOR_CHANGE_MODE
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| REGULATOR_CHANGE_STATUS,
> ? ? ? ?},
> ? ? ? ?.num_consumer_supplies ?= 1,
> ? ? ? ?.consumer_supplies ? ? ?= &nowplus_vsim_supply,
> };
>
> static struct regulator_init_data nowplus_wlgpio = {
> ? ? ? ?.constraints = {
> ? ? ? ? ? ? ? ?.valid_ops_mask = REGULATOR_CHANGE_STATUS,
> ? ? ? ?},
> ? ? ? ?.num_consumer_supplies ?= 1,
> ? ? ? ?.consumer_supplies ? ? ?= &nowplus_wl1271_supply,
> };
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
>