plat-pxa: Enable ability to adjust SD/MMC clocks
Subsystems (4)
PATCH 1/1 plat-pxa: Enable ability to adjust SD/MMC clocks
The PXA168, PXA910, and MMP2 SoC have the ability to adjust the SD/MMC clock. This feature is useful and required depending on the board design. Add infrastructure to support SD clock tuning.
--- arch/arm/plat-pxa/include/plat/sdhci.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/plat-pxa/include/plat/sdhci.h +3 -0
@@ -30,6 +30,9 @@ struct sdhci_pxa_platdata {unsigned int max_speed;unsigned int quirks;unsigned int flags; +unsigned short adjust_clocks; +unsigned short clk_select; + unsigned short clk_delay; };#endif /* __PLAT_PXA_SDHCI_H */
Signature · 1 line
1.7.0.4
PATCH 1/1 plat-pxa: Enable ability to adjust SD/MMC clocks
Quoted 3 lines · Philip Rakity
The PXA168, PXA910, and MMP2 SoC have the ability to adjust the SD/MMC clock. This feature is useful and required depending on the board design. Add infrastructure to support SD clock tuning.
It just adds fields to a structure which remain unused. On its own this patch is useless, and I don't see a patch which makes use of these new fields in any way. Did you forget to copy it to the linux-arm-kernel list?
PATCH 1/1 plat-pxa: Enable ability to adjust SD/MMC clocks
Begin forwarded message:
Quoted 86 lines
From: Philip Rakity <[email protected]>
Date: April 22, 2011 1:18:33 PM PDT
To: "linux-mmc at vger.kernel.org" <[email protected]>
Cc: Zhangfei Gao <[email protected]>
Subject: [PATCH] sdhci:sdhci-pxa.c: Add post reset processing for chip specific registers
RESET_ALLresets chips private registers.
Reset to values specified in board file.depends on board specific mach-mmp/plat-pxa
sdhci.hdefinitionsSigned-off-by Philip Rakity <[email protected]>---
drivers/mmc/host/sdhci-pxa.c| 42 ++++++++++++++++++++++++++++++++++++++++++1 files changed, 42 insertions(+), 0 deletions(-)drivers/mmc/host/sdhci-pxa.c +42
-0@@ -29,6 +29,13 @@#define DRIVER_NAME "sdhci-pxa" +#define SD_CLOCK_AND_BURST_SIZE_SETUP 0x10A +#define SDCLK_DELAY_MASK 0x1F +#define SDCLK_SEL_MASK 0x1 +#define SDCLK_DELAY_SHIFT 9 +#define SDCLK_SEL_SHIFT 8 + +struct sdhci_pxa {struct sdhci_host *host;struct sdhci_pxa_platdata *pdata;@@ -53,7 +60,42 @@ static void enable_clock(struct sdhci_host *host) } } +static void set_clock_and_burst_size (struct sdhci_host *host) +{ +u16 tmp; +struct sdhci_pxa *pxa =sdhci_priv (host); + +pr_debug ("%s:%s: adjust = %d\n" , + __func__,mmc_hostname (host->mmc), pxa->pdata->adjust_clocks); + +if (pxa->pdata->adjust_clocks) { + tmp =readw (host->ioaddr +SD_CLOCK_AND_BURST_SIZE_SETUP ); +pr_debug ("%s:%s: (B) SD_CLOCK_AND_BURST = %04X, " +"delay = %d, sel = %d\n" , + __func__,mmc_hostname (host->mmc), tmp, + pxa->pdata->clk_delay, pxa->pdata->clk_select); + tmp &= ~(SDCLK_DELAY_MASK <<SDCLK_DELAY_SHIFT ); + tmp &= ~(SDCLK_SEL_MASK <<SDCLK_SEL_SHIFT ); + tmp |= (pxa->pdata->clk_delay &SDCLK_DELAY_MASK ) << +SDCLK_DELAY_SHIFT ; + tmp |= (pxa->pdata->clk_select &SDCLK_SEL_MASK ) << +SDCLK_SEL_SHIFT ; +writew (tmp, host->ioaddr +SD_CLOCK_AND_BURST_SIZE_SETUP ); +pr_debug ("%s:%s: (A) SD_CLOCK_AND_BURST_SIZE_SETUP = %04X\n" , + __func__,mmc_hostname (host->mmc), tmp); + } +} + +static void platform_reset_exit (struct sdhci_host *host,u8 mask) +{ +if (mask ==SDHCI_RESET_ALL ) { +/* reset private registers */ +set_clock_and_burst_size (host); + } +} +static struct sdhci_ops sdhci_pxa_ops = { + .platform_reset_exit = platform_reset_exit, };/*****************************************************************************\ Signature · 7 lines
1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Russell King - ARM Linux
Quoted 3 lines · Philip Rakity
The PXA168, PXA910, and MMP2 SoC have the ability to adjust the SD/MMC clock. This feature is useful and required depending on the board design. Add infrastructure to support SD clock tuning.
It just adds fields to a structure which remain unused. On its own this patch is useless, and I don't see a patch which makes use of these new fields in any way. Did you forget to copy it to the linux-arm-kernel list?
PATCH 1/1 plat-pxa: Enable ability to adjust SD/MMC clocks
The patches were submitted a while ago.
Enclosed.
PATCH 1/1 plat-pxa: Enable ability to adjust SD/MMC clocks
Quoted 1 line · Philip Rakity
The patches were submitted a while ago.
It would be a good idea to reference them so that people know where to find then and what the status of them is. It's also a good idea to Cc interested parties on related patches.
A couple of points in one of those patches though:
Review
Quoted 1 line
(quoted diff) +1
-0+ if(gpio_request(reset, "sd8xxx reset")) {
space between if and (.
Review
Quoted 12 lines
(quoted diff) +12
-0+ printk(KERN_INFO "gpio %d request failed\n", reset); + return; + } + + if(gpio_request(poweron, "sd8xxx PDn")) { + gpio_free(reset); + printk(KERN_INFO "gpio %d request failed\n", poweron); + return; + } + + gpio_direction_output(poweron, 1); + msleep (1);
No space between msleep and (.
PATCH v2 1/1 arm: mach-mmp: brownstone.c support multiple sd slots
Support multiple sd/eMMC interfaces. enable mmc1, 2, and 3. mmc2 is used eMMC and slot is marked PERMANENT and 8 bit device. mmc1 is used for Wifi and slot is marked PERMANENT
Note: eMMC (mmc2) is set to initialize first to workaround a problem where booting in logical order requires mmc create work queue to be multi-threaded otherwise boot process hangs. BUG report send to linux-mmc and linux-kernel mailing list.
Wifi (mmc1) requires we enable power on the device by toggling the gpio lines for power and reset.
--- arch/arm/mach-mmp/brownstone.c | 52 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 1 deletions(-)
arch/arm/mach-mmp/brownstone.c +51 -1
@@ -19,6 +19,7 @@#include <linux/regulator/max8649.h> #include <linux/regulator/fixed.h> #include <linux/mfd/max8925.h> +#include <linux/delay.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -177,9 +178,56 @@ static struct i2c_board_info brownstone_twsi1_info[] = { };static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { - .max_speed =25000000 , + .adjust_clocks =1 , + .clk_select =1 , + .clk_delay =31 , }; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + .adjust_clocks =1 , + .clk_select =1 , + .clk_delay =15 , + .flags =PXA_FLAG_CARD_PERMANENT , +}; + +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { + .adjust_clocks =1 , + .clk_select =1 , + .clk_delay =31 , + .flags =PXA_FLAG_CARD_PERMANENT | +PXA_FLAG_SD_8_BIT_CAPABLE_SLOT , +}; + +static void __init mmc_sdio_wifi (void ) +{ +int poweron; +int reset; + + poweron =mfp_to_gpio (GPIO57_GPIO ); + reset =mfp_to_gpio (GPIO58_GPIO ); + +if (gpio_request (reset,"sd8xxx reset" )) { +printk (KERN_INFO "gpio %d request failed\n" , reset); +return ; + } + +if (gpio_request (poweron,"sd8xxx PDn" )) { +gpio_free (reset); +printk (KERN_INFO "gpio %d request failed\n" , poweron); +return ; + } + +gpio_direction_output (poweron,1 ); +msleep (1 ); +gpio_direction_output (reset,0 ); +msleep (1 ); +gpio_direction_output (reset,1 ); +gpio_free (reset); +gpio_free (poweron); + +mmp2_add_sdhost (1 , &mmp2_sdh_platdata_mmc1);/* Wifi */ +} +static void __init brownstone_init (void ) {mfp_config (ARRAY_AND_SIZE (brownstone_pin_config));
@@ -188,7 +236,9 @@ static void __init brownstone_init(void)mmp2_add_uart (1 );mmp2_add_uart (3 );mmp2_add_twsi (1 ,NULL ,ARRAY_AND_SIZE (brownstone_twsi1_info)); +mmp2_add_sdhost (2 , &mmp2_sdh_platdata_mmc2);/* eMMC */ mmp2_add_sdhost (0 , &mmp2_sdh_platdata_mmc0);/* SD/MMC */ +mmc_sdio_wifi ();/* enable 5v regulator */ platform_device_register (&brownstone_v_5vp_device);
Signature · 1 line
1.7.0.4
Eric Miao
AppliedPATCH v2 1/1 arm: mach-mmp: brownstone.c support multiple sd slots
Quoted 10 lines · Philip Rakity
Support multiple sd/eMMC interfaces. enable mmc1, 2, and 3. mmc2 is used eMMC and slot is marked PERMANENT and 8 bit device. mmc1 is used for Wifi and slot is marked PERMANENT
Note: eMMC (mmc2) is set to initialize first to workaround a problem where booting in logical order requires mmc create work queue to be multi-threaded otherwise boot process hangs. ?BUG report send to linux-mmc and linux-kernel mailing list.
Quoted 4 lines
Wifi (mmc1) requires we enable power on the device by toggling the gpio lines for power and reset.
Signed-off-by Philip Rakity <[email protected]>
Applied. Though the email client was fiddling the spaces/CR-LF a bit.
Quoted 89 lines
---
?arch/arm/mach-mmp/brownstone.c | ? 52 +++++++++++++++++++++++++++++++++++++++- ?1 files changed, 51 insertions(+), 1 deletions(-)arch/arm/mach-mmp/brownstone.c +0
-0@@ -19,6 +19,7 @@?#include <
linux/regulator/max8649.h>
?#include <linux/regulator/fixed.h>
?#include <linux/mfd/max8925.h>
+#include <linux/delay.h>?#include <
asm/mach-types.h>
?#include <asm/mach/arch.h>arch/arm/mach-mmp/brownstone.c +49
-1@@ -177,9 +178,56 @@ static struct i2c_board_info brownstone_twsi1_info[] = { ?}; ?static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { - ? ? ? .max_speed ? ? ?= 25000000, + ? ? ? .adjust_clocks ?= 1, + ? ? ? .clk_select ? ? = 1, + ? ? ? .clk_delay ? ? ?= 31, ?}; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + ? ? ? .adjust_clocks ?= 1, + ? ? ? .clk_select ? ? = 1, + ? ? ? .clk_delay ? ? ?= 15, + ? ? ? .flags ? ? ? ? ?= PXA_FLAG_CARD_PERMANENT, +}; + +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { + ? ? ? .adjust_clocks ?= 1, + ? ? ? .clk_select ? ? = 1, + ? ? ? .clk_delay ? ? ?= 31, + ? ? ? .flags ? ? ? ? ?= PXA_FLAG_CARD_PERMANENT | + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? PXA_FLAG_SD_8_BIT_CAPABLE_SLOT, +}; + +static void __init mmc_sdio_wifi (void ) +{ + ? ? ? int poweron; + ? ? ? int reset; + + ? ? ? poweron = mfp_to_gpio(GPIO57_GPIO); + ? ? ? reset = mfp_to_gpio(GPIO58_GPIO); + + ? ? ? if (gpio_request(reset, "sd8xxx reset")) { + ? ? ? ? ? ? ? printk(KERN_INFO "gpio %d request failed\n", reset); + ? ? ? ? ? ? ? return; + ? ? ? } + + ? ? ? if (gpio_request(poweron, "sd8xxx PDn")) { + ? ? ? ? ? ? ? gpio_free(reset); + ? ? ? ? ? ? ? printk(KERN_INFO "gpio %d request failed\n", poweron); + ? ? ? ? ? ? ? return; + ? ? ? } + + ? ? ? gpio_direction_output(poweron, 1); + ? ? ? msleep(1); + ? ? ? gpio_direction_output(reset, 0); + ? ? ? msleep(1); + ? ? ? gpio_direction_output(reset, 1); + ? ? ? gpio_free(reset); + ? ? ? gpio_free(poweron); + + ? ? ? mmp2_add_sdhost(1, &mmp2_sdh_platdata_mmc1); /* Wifi */ +} + ?static void __init brownstone_init(void) ?{ ? ? ? ?mfp_config(ARRAY_AND_SIZE(brownstone_pin_config));@@ -188,7 +236,9 @@ static void __init brownstone_init(void) ? ? ? ?mmp2_add_uart(1); ? ? ? ?mmp2_add_uart(3); ? ? ? ?mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); + ? ? ? mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */? ? ? ?mmp2_add_sdhost(0,
&mmp2_sdh_platdata_mmc0); /* SD/MMC */
+ ? ? ?mmc_sdio_wifi();? ? ? ?/* enable 5v regulator */
? ? ? ?platform_device_register(&brownstone_v_5vp_device); --
1.7.0.4
PATCH v2 1/1 arm: mach-mmp: brownstone.c support multiple sd slots
Quoted 11 lines · Eric Miao
Quoted 10 lines · Philip Rakity
Support multiple sd/eMMC interfaces. enable mmc1, 2, and 3. mmc2 is used eMMC and slot is marked PERMANENT and 8 bit device. mmc1 is used for Wifi and slot is marked PERMANENT
Note: eMMC (mmc2) is set to initialize first to workaround a problem where booting in logical order requires mmc create work queue to be multi-threaded otherwise boot process hangs. ?BUG report send to linux-mmc and linux-kernel mailing list.
Quoted 11 lines
Quoted 4 lines
Wifi (mmc1) requires we enable power on the device by toggling the gpio lines for power and reset.
Signed-off-by Philip Rakity <[email protected]>Applied. Though the email client was fiddling the spaces/CR-LF a bit.
Quoted 4 lines
---
?arch/arm/mach-mmp/brownstone.c | ? 52 +++++++++++++++++++++++++++++++++++++++- ?1 files changed, 51 insertions(+), 1 deletions(-)
Hi, Eric
arch/arm/mach-mmp/brownstone.c has already been modified from mmc-next, here will have conflict.
Sorry for inconvenience.
Thanks
PATCH v2 1/1 arm: mach-mmp: brownstone.c support multiple sd slots
Quoted 24 lines · zhangfei gao
Quoted 11 lines · Eric Miao
Quoted 10 lines · Philip Rakity
Support multiple sd/eMMC interfaces. enable mmc1, 2, and 3. mmc2 is used eMMC and slot is marked PERMANENT and 8 bit device. mmc1 is used for Wifi and slot is marked PERMANENT
Note: eMMC (mmc2) is set to initialize first to workaround a problem where booting in logical order requires mmc create work queue to be multi-threaded otherwise boot process hangs. ?BUG report send to linux-mmc and linux-kernel mailing list.
Quoted 11 lines
Quoted 4 lines
Wifi (mmc1) requires we enable power on the device by toggling the gpio lines for power and reset.
Signed-off-by Philip Rakity <[email protected]>Applied. Though the email client was fiddling the spaces/CR-LF a bit.
Quoted 4 lines
---
?arch/arm/mach-mmp/brownstone.c | ? 52 +++++++++++++++++++++++++++++++++++++++- ?1 files changed, 51 insertions(+), 1 deletions(-)
Quoted 5 lines
Hi, Eric
arch/arm/mach-mmp/brownstone.chas already been modified from mmc-next, here will have conflict.
Sorry for inconvenience.
'K, I'll drop it then.
Quoted 3 lines
Thanks
PATCH v3 1/1 arm: mach-mmp: brownstone.c support multiple sd slots
Subject: [PATCH V3] arm: mach-mmp: brownstone.c support multiple sd slots
V3
==
Change since V2 -- delete mmc3 since it was committed to linux next.
enable mmc1 used for wifi (8688) and marked PERMANENT.
Wifi requires enabling of power on the device by
toggling the gpio lines for power and reset. Enable eMMC first to work around problem in booting order due to workqueue bug.
--- arch/arm/mach-mmp/brownstone.c | 41 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 40 insertions(+), 1 deletions(-)
arch/arm/mach-mmp/brownstone.c +40 -1
@@ -19,6 +19,7 @@#include <linux/regulator/max8649.h> #include <linux/regulator/fixed.h> #include <linux/mfd/max8925.h> +#include <linux/delay.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -180,6 +181,11 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { .clk_delay_cycles = 0x1f, }; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + .clk_delay_cycles =0x1f , + .flags =PXA_FLAG_CARD_PERMANENT , +}; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { .clk_delay_cycles =0x1f , .flags =PXA_FLAG_CARD_PERMANENT
@@ -187,6 +193,38 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { }; +static void __init mmc_sdio_wifi (void ) +{ +int poweron; +int reset; + + poweron =mfp_to_gpio (GPIO57_GPIO ); + reset =mfp_to_gpio (GPIO58_GPIO ); + +if (gpio_request (reset,"sd8xxx reset" )) { +printk (KERN_INFO "gpio %d request failed\n" , reset); +return ; + } + +if (gpio_request (poweron,"sd8xxx PDn" )) { +gpio_free (reset); +printk (KERN_INFO "gpio %d request failed\n" , poweron); +return ; + } + +gpio_direction_output (poweron,0 ); +msleep (1 ); +gpio_direction_output (poweron,1 ); +msleep (1 ); +gpio_direction_output (reset,0 ); +msleep (1 ); +gpio_direction_output (reset,1 ); +gpio_free (reset); +gpio_free (poweron); + +mmp2_add_sdhost (1 , &mmp2_sdh_platdata_mmc1);/* Wifi */ +} +static void __init brownstone_init (void ) {mfp_config (ARRAY_AND_SIZE (brownstone_pin_config));
@@ -195,8 +233,9 @@ static void __init brownstone_init(void)mmp2_add_uart (1 );mmp2_add_uart (3 );mmp2_add_twsi (1 ,NULL ,ARRAY_AND_SIZE (brownstone_twsi1_info)); -mmp2_add_sdhost (0 , &mmp2_sdh_platdata_mmc0);/* SD/MMC */ mmp2_add_sdhost (2 , &mmp2_sdh_platdata_mmc2);/* eMMC */ +mmp2_add_sdhost (0 , &mmp2_sdh_platdata_mmc0);/* SD/MMC */ +mmc_sdio_wifi ();/* enable 5v regulator */ platform_device_register (&brownstone_v_5vp_device);
Signature · 1 line
1.7.0.4
Quoted 36 lines · Eric Miao
Quoted 24 lines · zhangfei gao
Quoted 11 lines · Eric Miao
Quoted 10 lines · Philip Rakity
Support multiple sd/eMMC interfaces. enable mmc1, 2, and 3. mmc2 is used eMMC and slot is marked PERMANENT and 8 bit device. mmc1 is used for Wifi and slot is marked PERMANENT
Note: eMMC (mmc2) is set to initialize first to workaround a problem where booting in logical order requires mmc create work queue to be multi-threaded otherwise boot process hangs. BUG report send to linux-mmc and linux-kernel mailing list.
Quoted 11 lines
Quoted 4 lines
Wifi (mmc1) requires we enable power on the device by toggling the gpio lines for power and reset.
Signed-off-by Philip Rakity <[email protected]>Applied. Though the email client was fiddling the spaces/CR-LF a bit.
Quoted 4 lines
--- arch/arm/mach-mmp/brownstone.c | 52 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 1 deletions(-)Quoted 5 lines
Hi, Eric
arch/arm/mach-mmp/brownstone.chas already been modified from mmc-next, here will have conflict.
Sorry for inconvenience.'K, I'll drop it then.
Quoted 3 lines
Thanks
PATCH v3 1/1 arm: mach-mmp: brownstone.c support multiple sd slots
Quoted 67 lines · Philip Rakity
Subject: [PATCH V3] arm: mach-mmp:
brownstone.csupport multiple sd slotsV3
==
Change since V2 -- delete mmc3 since it was committed to linux next.enable mmc1 used for wifi (8688) and marked PERMANENT.
Wifi requires enabling of power on the device by
toggling the gpio lines for power and reset. ?Enable eMMC first to work around problem in booting order due to workqueue bug.Signed-off-by Philip Rakity <[email protected]>---
?arch/arm/mach-mmp/brownstone.c | ? 41 +++++++++++++++++++++++++++++++++++++++- ?1 files changed, 40 insertions(+), 1 deletions(-)arch/arm/mach-mmp/brownstone.c +0
-0@@ -19,6 +19,7 @@?#include <
linux/regulator/max8649.h>
?#include <linux/regulator/fixed.h>
?#include <linux/mfd/max8925.h>
+#include <linux/delay.h>?#include <
asm/mach-types.h>
?#include <asm/mach/arch.h>arch/arm/mach-mmp/brownstone.c +5
-0@@ -180,6 +181,11 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { ? ? ? ?.clk_delay_cycles = 0x1f, ?}; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + ? ? ? .clk_delay_cycles = 0x1f, + ? ? ? .flags ? ? ? ? ?= PXA_FLAG_CARD_PERMANENT, +}; + ?static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { ? ? ? ?.clk_delay_cycles = 0x1f,? ? ? ?.flags =
PXA_FLAG_CARD_PERMANENTarch/arm/mach-mmp/brownstone.c +22
-0@@ -187,6 +193,38 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { ?}; +static void __init mmc_sdio_wifi (void ) +{ + ? ? ? int poweron; + ? ? ? int reset; + + ? ? ? poweron = mfp_to_gpio(GPIO57_GPIO); + ? ? ? reset = mfp_to_gpio(GPIO58_GPIO); + + ? ? ? if (gpio_request(reset, "sd8xxx reset")) { + ? ? ? ? ? ? ? printk(KERN_INFO "gpio %d request failed\n", reset); + ? ? ? ? ? ? ? return; + ? ? ? } + + ? ? ? if (gpio_request(poweron, "sd8xxx PDn")) { + ? ? ? ? ? ? ? gpio_free(reset); + ? ? ? ? ? ? ? printk(KERN_INFO "gpio %d request failed\n", poweron); + ? ? ? ? ? ? ? return; + ? ? ? } + + ? ? ? gpio_direction_output(poweron, 0); + ? ? ? msleep(1); + ? ? ? gpio_direction_output(poweron, 1);
arch/arm/mach-mmp/brownstone.c static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { · line 227
Quoted 10 lines
arch/arm/mach-mmp/brownstone.c +10
-0+ ? ? ? msleep(1); + ? ? ? gpio_direction_output(reset, 0); + ? ? ? msleep(1); + ? ? ? gpio_direction_output(reset, 1); + ? ? ? gpio_free(reset); + ? ? ? gpio_free(poweron); + + ? ? ? mmp2_add_sdhost(1, &mmp2_sdh_platdata_mmc1); /* Wifi */ +} +
The method keeps power on wifi chip, without dynamically enable/disable wifi power, which is not final solution. How about pushing later with dynamically control power, which is in debugging here.
Quoted 16 lines
arch/arm/mach-mmp/brownstone.c +0
-1?static void __init brownstone_init(void) ?{ ? ? ? ?mfp_config(ARRAY_AND_SIZE(brownstone_pin_config));@@ -195,8 +233,9 @@ static void __init brownstone_init(void) ? ? ? ?mmp2_add_uart(1); ? ? ? ?mmp2_add_uart(3); ? ? ? ?mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); - ? ? ? mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */? ? ? ?mmp2_add_sdhost(2,
&mmp2_sdh_platdata_mmc2); /* eMMC */
+ ? ? ?mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
+ ? ? ?mmc_sdio_wifi();? ? ? ?/* enable 5v regulator */
? ? ? ?platform_device_register(&brownstone_v_5vp_device); --
1.7.0.4
PATCH v3 1/1 arm: mach-mmp: brownstone.c support multiple sd slots
Quoted 75 lines · zhangfei gao
Quoted 74 lines · Philip Rakity
Subject: [PATCH V3] arm: mach-mmp:
brownstone.csupport multiple sd slotsV3
==
Change since V2 -- delete mmc3 since it was committed to linux next.enable mmc1 used for wifi (8688) and marked PERMANENT.
Wifi requires enabling of power on the device by
toggling the gpio lines for power and reset. Enable eMMC first to work around problem in booting order due to workqueue bug.Signed-off-by Philip Rakity <[email protected]>--- arch/arm/mach-mmp/brownstone.c | 41 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 40 insertions(+), 1 deletions(-)arch/arm/mach-mmp/brownstone.c +35
-0@@ -19,6 +19,7 @@#include <linux/regulator/max8649.h> #include <linux/regulator/fixed.h> #include <linux/mfd/max8925.h> +#include <linux/delay.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -180,6 +181,11 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { .clk_delay_cycles = 0x1f, }; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + .clk_delay_cycles =0x1f , + .flags =PXA_FLAG_CARD_PERMANENT , +}; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { .clk_delay_cycles =0x1f , .flags =PXA_FLAG_CARD_PERMANENT @@ -187,6 +193,38 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { }; +static void __init mmc_sdio_wifi (void ) +{ +int poweron; +int reset; + + poweron =mfp_to_gpio (GPIO57_GPIO ); + reset =mfp_to_gpio (GPIO58_GPIO ); + +if (gpio_request (reset,"sd8xxx reset" )) { +printk (KERN_INFO "gpio %d request failed\n" , reset); +return ; + } + +if (gpio_request (poweron,"sd8xxx PDn" )) { +gpio_free (reset); +printk (KERN_INFO "gpio %d request failed\n" , poweron); +return ; + } + +gpio_direction_output (poweron,0 ); +msleep (1 ); +gpio_direction_output (poweron,1 ); +msleep (1 ); +gpio_direction_output (reset,0 ); +msleep (1 ); +gpio_direction_output (reset,1 ); +gpio_free (reset); +gpio_free (poweron); +
Quoted 9 lines
arch/arm/mach-mmp/brownstone.c static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { · line 227
Quoted 3 lines
arch/arm/mach-mmp/brownstone.c +3
-0+mmp2_add_sdhost (1 , &mmp2_sdh_platdata_mmc1);/* Wifi */ +} +The method keeps power on wifi chip, without dynamically enable/disable wifi power, which is not final solution. How about pushing later with dynamically control power, which is in debugging here.
Good Point -- Will do.
What is the correct method to handle this ?
Quoted 16 lines
Quoted 16 lines
arch/arm/mach-mmp/brownstone.c +2
-2static void __init brownstone_init (void ) {mfp_config (ARRAY_AND_SIZE (brownstone_pin_config));@@ -195,8 +233,9 @@ static void __init brownstone_init(void)mmp2_add_uart (1 );mmp2_add_uart (3 );mmp2_add_twsi (1 ,NULL ,ARRAY_AND_SIZE (brownstone_twsi1_info)); -mmp2_add_sdhost (0 , &mmp2_sdh_platdata_mmc0);/* SD/MMC */ mmp2_add_sdhost (2 , &mmp2_sdh_platdata_mmc2);/* eMMC */ +mmp2_add_sdhost (0 , &mmp2_sdh_platdata_mmc0);/* SD/MMC */ +mmc_sdio_wifi ();/* enable 5v regulator */ platform_device_register (&brownstone_v_5vp_device); --1.7.0.4
PATCH v4 1/1 arm: mach-mmp: brownstone.c support multiple sd slots
In reply to Philip RakityEric,
Not sure what to suggest.
If it makes more sense to take V3 which powers on the wifi card but does not do power handling per new spec take that. At least wifi card works and then wait for power code. New code could delete power code as part of the mod.
If it makes more sense to wait for power code -- take V4.
Philip
V4
==
remove code to enable power for wifi. Coming in separate patch (by others) that conforms to new power architecture.
V3
==
Change since V2 -- delete mmc3 since it was committed to linux next.
enable mmc1 used for wifi (8688) and marked PERMANENT. Wifi requires enabling of power on the device by toggling the gpio lines for power and reset.
--- arch/arm/mach-mmp/brownstone.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-mmp/brownstone.c +7 -1
@@ -180,6 +180,11 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { .clk_delay_cycles = 0x1f, }; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + .clk_delay_cycles =0x1f , + .flags =PXA_FLAG_CARD_PERMANENT , +}; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { .clk_delay_cycles =0x1f , .flags =PXA_FLAG_CARD_PERMANENT
@@ -195,8 +200,9 @@ static void __init brownstone_init(void)mmp2_add_uart (1 );mmp2_add_uart (3 );mmp2_add_twsi (1 ,NULL ,ARRAY_AND_SIZE (brownstone_twsi1_info)); -mmp2_add_sdhost (0 , &mmp2_sdh_platdata_mmc0);/* SD/MMC */ mmp2_add_sdhost (2 , &mmp2_sdh_platdata_mmc2);/* eMMC */ +mmp2_add_sdhost (0 , &mmp2_sdh_platdata_mmc0);/* SD/MMC */ +mmp2_add_sdhost (1 , &mmp2_sdh_platdata_mmc1);/* Wifi */ /* enable 5v regulator */ platform_device_register (&brownstone_v_5vp_device);
Signature · 1 line
1.7.0.4
PATCH v4 1/1 arm: mach-mmp: brownstone.c support multiple sd slots
Quoted 10 lines · Philip Rakity
Eric,
Not sure what to suggest.
If it makes more sense to take V3 which powers on the wifi card but does not do power handling per new spec take that. ?At least wifi card works and then wait for power code. ?New code could delete power code as part of the mod.
If it makes more sense to wait for power code -- take V4.
No worries. I'll wait for v4.
Quoted 56 lines
Philip
V4
==
remove code to enable power for wifi. ?Coming in separate patch (by others) that conforms to new power architecture.V3
==
Change since V2 -- delete mmc3 since it was committed to linux next.enable mmc1 used for wifi (8688) and marked PERMANENT. Wifi requires enabling of power on the device by toggling the gpio lines for power and reset.
Signed-off-by Philip Rakity <[email protected]>---
?arch/arm/mach-mmp/brownstone.c | ? ?8 +++++++-
?1 files changed, 7 insertions(+), 1 deletions(-)arch/arm/mach-mmp/brownstone.c +5
-0@@ -180,6 +180,11 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { ? ? ? ?.clk_delay_cycles = 0x1f, ?}; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + ? ? ? .clk_delay_cycles = 0x1f, + ? ? ? .flags ? ? ? ? ?= PXA_FLAG_CARD_PERMANENT, +}; + ?static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { ? ? ? ?.clk_delay_cycles = 0x1f,? ? ? ?.flags =
PXA_FLAG_CARD_PERMANENTarch/arm/mach-mmp/brownstone.c +0
-1@@ -195,8 +200,9 @@ static void __init brownstone_init(void) ? ? ? ?mmp2_add_uart(1); ? ? ? ?mmp2_add_uart(3); ? ? ? ?mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); - ? ? ? mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */? ? ? ?mmp2_add_sdhost(2,
&mmp2_sdh_platdata_mmc2); /* eMMC */
+ ? ? ?mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
+ ? ? ?mmp2_add_sdhost(1, &mmp2_sdh_platdata_mmc1); /* Wifi */? ? ? ?/* enable 5v regulator */
? ? ? ?platform_device_register(&brownstone_v_5vp_device); --
1.7.0.4