Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-17 Thread Eliad Peller
On Mon, Mar 16, 2015 at 8:24 PM, Tony Lindgren t...@atomide.com wrote:
 * Sebastian Reichel s...@ring0.de [150316 11:26]:
 Hi,

 On Mon, Mar 16, 2015 at 08:29:39AM -0700, Tony Lindgren wrote:
  * Arnd Bergmann a...@arndb.de [150315 05:10]:
   On Sunday 15 March 2015 10:50:42 Eliad Peller wrote:
yeah, i missed it :/
   
looks like there's no platform that defines platform data for it.
i'll replace the dev_get_platdata() with a function that only parses
the clock-frequency properties (the irq is taken in this case from the
spi_device).
(or maybe i should just drop it, as no one actually uses it?)
  
   I don't think we should drop the driver, but dropping the platform_data
   support sounds reasonable. New users of this driver should all be using
   DT, and if there is a good reason to use platform_data, it's easily
   put back.
 
  Well we have n8x0 and n900 using the spi driver. For those, n8x0 boot
  all in dts mode, but n900 still also boots in legacy mode. It seems the
  board-rx51-peripherals.c only passes the power_gpio though, so that
  should be easy to keep around.
 
  We should keep things still working for n900 in legacy mode until the
  pending regressions with device tree based booting have been cleared
  for at least one merge cycle. I believe the last pending issues is the
  support for ATAG_REVISION in device tree mode as posted by Pali.

 mh by migrating to newer gpiod interface platform data is no longer
 needed (instead the boardfile would need a gpiod_lookup_table). That
 way all of the dirty code is in the board file and will be removed
 once the time comes. See for example rx51_fmtx_gpios_table.

 Note: This is independent of wl12xx changes, since N900 uses wl1251.

 Oh sorry yes sounds like that's different platform data then. In that
 case I see no reasons to drop the platform data for wl12xx.

great.
so i'll drop the relevant wlcore_spi platform data code, and rebase
the patches on top of v4.0-rc4 (probably tomorrow).

Eliad.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-16 Thread Pali Rohár
On Monday 16 March 2015 16:29:39 Tony Lindgren wrote:
 I believe the last pending issues is the support for
 ATAG_REVISION in device tree mode as posted by Pali.
 

No. In DT boot there is missing /proc/atags file (readable by 
userspace processes). And also broken AES/SHA/MD5 support. Fix 
for crypto DT stuff I already sent.

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-16 Thread Pali Rohár
On Monday 16 March 2015 22:01:43 Tony Lindgren wrote:
 * Pali Rohár pali.ro...@gmail.com [150316 13:59]:
  On Monday 16 March 2015 16:29:39 Tony Lindgren wrote:
   I believe the last pending issues is the support for
   ATAG_REVISION in device tree mode as posted by Pali.
  
  No. In DT boot there is missing /proc/atags file (readable
  by userspace processes).
 
 Oh OK thanks for the update.
 
  And also broken AES/SHA/MD5 support. Fix for crypto DT stuff
  I already sent.
 
 But this is not a regression in mainline with legacy boot vs
 device tree based booting, right? Sounds like it never worked
 in the mainline or am thinking of some other set of patches?
 
 Regards,
 
 Tony

In legacy board code are DMA channels defined. In DT files not. 
So I think this is regression. Omap secure devices are broken in 
both legacy  DT code, but non secure could work with legacy 
code. But all devices booted with DT are broken.

-- 
Pali Rohár
pali.ro...@gmail.com


signature.asc
Description: This is a digitally signed message part.


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-16 Thread Tony Lindgren
* Arnd Bergmann a...@arndb.de [150315 05:10]:
 On Sunday 15 March 2015 10:50:42 Eliad Peller wrote:
  yeah, i missed it :/
  
  looks like there's no platform that defines platform data for it.
  i'll replace the dev_get_platdata() with a function that only parses
  the clock-frequency properties (the irq is taken in this case from the
  spi_device).
  (or maybe i should just drop it, as no one actually uses it?)
 
 I don't think we should drop the driver, but dropping the platform_data
 support sounds reasonable. New users of this driver should all be using
 DT, and if there is a good reason to use platform_data, it's easily
 put back.

Well we have n8x0 and n900 using the spi driver. For those, n8x0 boot
all in dts mode, but n900 still also boots in legacy mode. It seems the
board-rx51-peripherals.c only passes the power_gpio though, so that
should be easy to keep around.

We should keep things still working for n900 in legacy mode until the
pending regressions with device tree based booting have been cleared
for at least one merge cycle. I believe the last pending issues is the
support for ATAG_REVISION in device tree mode as posted by Pali.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-16 Thread Tony Lindgren
* Pali Rohár pali.ro...@gmail.com [150316 13:59]:
 On Monday 16 March 2015 16:29:39 Tony Lindgren wrote:
  I believe the last pending issues is the support for
  ATAG_REVISION in device tree mode as posted by Pali.
  
 
 No. In DT boot there is missing /proc/atags file (readable by 
 userspace processes).

Oh OK thanks for the update.

 And also broken AES/SHA/MD5 support. Fix for crypto DT stuff
 I already sent.

But this is not a regression in mainline with legacy boot vs
device tree based booting, right? Sounds like it never worked
in the mainline or am thinking of some other set of patches?

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-16 Thread Tony Lindgren
* Pali Rohár pali.ro...@gmail.com [150316 14:15]:
 On Monday 16 March 2015 22:01:43 Tony Lindgren wrote:
  * Pali Rohár pali.ro...@gmail.com [150316 13:59]:
   On Monday 16 March 2015 16:29:39 Tony Lindgren wrote:
I believe the last pending issues is the support for
ATAG_REVISION in device tree mode as posted by Pali.
   
   No. In DT boot there is missing /proc/atags file (readable
   by userspace processes).
  
  Oh OK thanks for the update.
  
   And also broken AES/SHA/MD5 support. Fix for crypto DT stuff
   I already sent.
  
  But this is not a regression in mainline with legacy boot vs
  device tree based booting, right? Sounds like it never worked
  in the mainline or am thinking of some other set of patches?
  
  Regards,
  
  Tony
 
 In legacy board code are DMA channels defined. In DT files not. 
 So I think this is regression. Omap secure devices are broken in 
 both legacy  DT code, but non secure could work with legacy 
 code. But all devices booted with DT are broken.

OK I'll apply the DMA channels into omap-for-v4.0/fixes in
that case.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-16 Thread Tony Lindgren
* Sebastian Reichel s...@ring0.de [150316 11:26]:
 Hi,
 
 On Mon, Mar 16, 2015 at 08:29:39AM -0700, Tony Lindgren wrote:
  * Arnd Bergmann a...@arndb.de [150315 05:10]:
   On Sunday 15 March 2015 10:50:42 Eliad Peller wrote:
yeah, i missed it :/

looks like there's no platform that defines platform data for it.
i'll replace the dev_get_platdata() with a function that only parses
the clock-frequency properties (the irq is taken in this case from the
spi_device).
(or maybe i should just drop it, as no one actually uses it?)
   
   I don't think we should drop the driver, but dropping the platform_data
   support sounds reasonable. New users of this driver should all be using
   DT, and if there is a good reason to use platform_data, it's easily
   put back.
  
  Well we have n8x0 and n900 using the spi driver. For those, n8x0 boot
  all in dts mode, but n900 still also boots in legacy mode. It seems the
  board-rx51-peripherals.c only passes the power_gpio though, so that
  should be easy to keep around.
  
  We should keep things still working for n900 in legacy mode until the
  pending regressions with device tree based booting have been cleared
  for at least one merge cycle. I believe the last pending issues is the
  support for ATAG_REVISION in device tree mode as posted by Pali.
 
 mh by migrating to newer gpiod interface platform data is no longer
 needed (instead the boardfile would need a gpiod_lookup_table). That
 way all of the dirty code is in the board file and will be removed
 once the time comes. See for example rx51_fmtx_gpios_table.
 
 Note: This is independent of wl12xx changes, since N900 uses wl1251.

Oh sorry yes sounds like that's different platform data then. In that
case I see no reasons to drop the platform data for wl12xx.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-16 Thread Sebastian Reichel
Hi,

On Mon, Mar 16, 2015 at 08:29:39AM -0700, Tony Lindgren wrote:
 * Arnd Bergmann a...@arndb.de [150315 05:10]:
  On Sunday 15 March 2015 10:50:42 Eliad Peller wrote:
   yeah, i missed it :/
   
   looks like there's no platform that defines platform data for it.
   i'll replace the dev_get_platdata() with a function that only parses
   the clock-frequency properties (the irq is taken in this case from the
   spi_device).
   (or maybe i should just drop it, as no one actually uses it?)
  
  I don't think we should drop the driver, but dropping the platform_data
  support sounds reasonable. New users of this driver should all be using
  DT, and if there is a good reason to use platform_data, it's easily
  put back.
 
 Well we have n8x0 and n900 using the spi driver. For those, n8x0 boot
 all in dts mode, but n900 still also boots in legacy mode. It seems the
 board-rx51-peripherals.c only passes the power_gpio though, so that
 should be easy to keep around.
 
 We should keep things still working for n900 in legacy mode until the
 pending regressions with device tree based booting have been cleared
 for at least one merge cycle. I believe the last pending issues is the
 support for ATAG_REVISION in device tree mode as posted by Pali.

mh by migrating to newer gpiod interface platform data is no longer
needed (instead the boardfile would need a gpiod_lookup_table). That
way all of the dirty code is in the board file and will be removed
once the time comes. See for example rx51_fmtx_gpios_table.

Note: This is independent of wl12xx changes, since N900 uses wl1251.

-- Sebastian


signature.asc
Description: Digital signature


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-15 Thread Arnd Bergmann
On Sunday 15 March 2015 10:50:42 Eliad Peller wrote:
 yeah, i missed it :/
 
 looks like there's no platform that defines platform data for it.
 i'll replace the dev_get_platdata() with a function that only parses
 the clock-frequency properties (the irq is taken in this case from the
 spi_device).
 (or maybe i should just drop it, as no one actually uses it?)

I don't think we should drop the driver, but dropping the platform_data
support sounds reasonable. New users of this driver should all be using
DT, and if there is a good reason to use platform_data, it's easily
put back.

Arnd
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-15 Thread Eliad Peller
On Fri, Mar 13, 2015 at 5:13 PM, Tony Lindgren t...@atomide.com wrote:
 * Eliad Peller el...@wizery.com [150312 05:10]:
 Now that we have wlcore device-tree bindings in place
 (for both wl12xx and wl18xx), remove the legacy
 wl12xx_platform_data struct, and move its members
 into the platform device data (that is passed to wlcore)

 Davinci 850 is the only platform that still set
 the platform data in the legacy way (and doesn't
 have DT bindings), so remove the relevant
 code/Kconfig option from the board file (as suggested
 by Sekhar Nori)

 Signed-off-by: Luciano Coelho l...@coelho.fi
 Signed-off-by: Eliad Peller el...@wizery.com
 ---
  arch/arm/mach-davinci/Kconfig  |  11 ---
  arch/arm/mach-davinci/board-da850-evm.c| 113 
 -
  drivers/net/wireless/ti/wilink_platform_data.c |  25 --
  drivers/net/wireless/ti/wl12xx/main.c  |  19 ++---
  drivers/net/wireless/ti/wlcore/boot.c  |   1 -
  drivers/net/wireless/ti/wlcore/main.c  |   4 +-
  drivers/net/wireless/ti/wlcore/sdio.c  |  75 +---
  drivers/net/wireless/ti/wlcore/wlcore_i.h  |   8 +-
  include/linux/wl12xx.h |  25 --
  9 files changed, 36 insertions(+), 245 deletions(-)

 I got a build error related to the SPI driver with this series, probably
 need to update this patch:

 drivers/net/wireless/ti/wlcore/spi.c: In function ‘wl1271_probe’:
 drivers/net/wireless/ti/wlcore/spi.c:334:11: error: ‘struct 
 wlcore_platdev_data’ has no member named ‘pdata’
   pdev_data.pdata = dev_get_platdata(spi-dev);
^
 drivers/net/wireless/ti/wlcore/spi.c:335:16: error: ‘struct 
 wlcore_platdev_data’ has no member named ‘pdata’
   if (!pdev_data.pdata) {

yeah, i missed it :/

looks like there's no platform that defines platform data for it.
i'll replace the dev_get_platdata() with a function that only parses
the clock-frequency properties (the irq is taken in this case from the
spi_device).
(or maybe i should just drop it, as no one actually uses it?)

thanks,
Eliad.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-13 Thread Tony Lindgren
* Eliad Peller el...@wizery.com [150312 05:10]:
 Now that we have wlcore device-tree bindings in place
 (for both wl12xx and wl18xx), remove the legacy
 wl12xx_platform_data struct, and move its members
 into the platform device data (that is passed to wlcore)
 
 Davinci 850 is the only platform that still set
 the platform data in the legacy way (and doesn't
 have DT bindings), so remove the relevant
 code/Kconfig option from the board file (as suggested
 by Sekhar Nori)
 
 Signed-off-by: Luciano Coelho l...@coelho.fi
 Signed-off-by: Eliad Peller el...@wizery.com
 ---
  arch/arm/mach-davinci/Kconfig  |  11 ---
  arch/arm/mach-davinci/board-da850-evm.c| 113 
 -
  drivers/net/wireless/ti/wilink_platform_data.c |  25 --
  drivers/net/wireless/ti/wl12xx/main.c  |  19 ++---
  drivers/net/wireless/ti/wlcore/boot.c  |   1 -
  drivers/net/wireless/ti/wlcore/main.c  |   4 +-
  drivers/net/wireless/ti/wlcore/sdio.c  |  75 +---
  drivers/net/wireless/ti/wlcore/wlcore_i.h  |   8 +-
  include/linux/wl12xx.h |  25 --
  9 files changed, 36 insertions(+), 245 deletions(-)

I got a build error related to the SPI driver with this series, probably
need to update this patch:

drivers/net/wireless/ti/wlcore/spi.c: In function ‘wl1271_probe’:
drivers/net/wireless/ti/wlcore/spi.c:334:11: error: ‘struct 
wlcore_platdev_data’ has no member named ‘pdata’
  pdev_data.pdata = dev_get_platdata(spi-dev);
   ^
drivers/net/wireless/ti/wlcore/spi.c:335:16: error: ‘struct 
wlcore_platdev_data’ has no member named ‘pdata’
  if (!pdev_data.pdata) {

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 6/6] wlcore: remove wl12xx_platform_data

2015-03-12 Thread Eliad Peller
Now that we have wlcore device-tree bindings in place
(for both wl12xx and wl18xx), remove the legacy
wl12xx_platform_data struct, and move its members
into the platform device data (that is passed to wlcore)

Davinci 850 is the only platform that still set
the platform data in the legacy way (and doesn't
have DT bindings), so remove the relevant
code/Kconfig option from the board file (as suggested
by Sekhar Nori)

Signed-off-by: Luciano Coelho l...@coelho.fi
Signed-off-by: Eliad Peller el...@wizery.com
---
 arch/arm/mach-davinci/Kconfig  |  11 ---
 arch/arm/mach-davinci/board-da850-evm.c| 113 -
 drivers/net/wireless/ti/wilink_platform_data.c |  25 --
 drivers/net/wireless/ti/wl12xx/main.c  |  19 ++---
 drivers/net/wireless/ti/wlcore/boot.c  |   1 -
 drivers/net/wireless/ti/wlcore/main.c  |   4 +-
 drivers/net/wireless/ti/wlcore/sdio.c  |  75 +---
 drivers/net/wireless/ti/wlcore/wlcore_i.h  |   8 +-
 include/linux/wl12xx.h |  25 --
 9 files changed, 36 insertions(+), 245 deletions(-)

diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
index 584e8d4..6bb1049 100644
--- a/arch/arm/mach-davinci/Kconfig
+++ b/arch/arm/mach-davinci/Kconfig
@@ -198,17 +198,6 @@ config DA850_UI_SD_VIDEO_PORT
 
 endchoice
 
-config DA850_WL12XX
-   bool AM18x wl1271 daughter board
-   depends on MACH_DAVINCI_DA850_EVM
-   help
- The wl1271 daughter card for AM18x EVMs is a combo wireless
- connectivity add-on card, based on the LS Research TiWi module with
- Texas Instruments' wl1271 solution.
- Say Y if you want to use a wl1271 expansion card connected to the
- AM18x EVM.
-
-
 config MACH_MITYOMAPL138
bool Critical Link MityDSP-L138/MityARM-1808 SoM
depends on ARCH_DAVINCI_DA850
diff --git a/arch/arm/mach-davinci/board-da850-evm.c 
b/arch/arm/mach-davinci/board-da850-evm.c
index 853b941..1ed545c 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -38,7 +38,6 @@
 #include linux/regulator/fixed.h
 #include linux/spi/spi.h
 #include linux/spi/flash.h
-#include linux/wl12xx.h
 
 #include mach/common.h
 #include mach/cp_intc.h
@@ -60,9 +59,6 @@
 #define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
 #define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
 
-#define DA850_WLAN_EN  GPIO_TO_PIN(6, 9)
-#define DA850_WLAN_IRQ GPIO_TO_PIN(6, 10)
-
 #define DA850_MII_MDIO_CLKEN_PIN   GPIO_TO_PIN(2, 6)
 
 static struct mtd_partition da850evm_spiflash_part[] = {
@@ -1343,110 +1339,6 @@ static __init void da850_vpif_init(void)
 static __init void da850_vpif_init(void) {}
 #endif
 
-#ifdef CONFIG_DA850_WL12XX
-
-static void wl12xx_set_power(int index, bool power_on)
-{
-   static bool power_state;
-
-   pr_debug(Powering %s wl12xx, power_on ? on : off);
-
-   if (power_on == power_state)
-   return;
-   power_state = power_on;
-
-   if (power_on) {
-   /* Power up sequence required for wl127x devices */
-   gpio_set_value(DA850_WLAN_EN, 1);
-   usleep_range(15000, 15000);
-   gpio_set_value(DA850_WLAN_EN, 0);
-   usleep_range(1000, 1000);
-   gpio_set_value(DA850_WLAN_EN, 1);
-   msleep(70);
-   } else {
-   gpio_set_value(DA850_WLAN_EN, 0);
-   }
-}
-
-static struct davinci_mmc_config da850_wl12xx_mmc_config = {
-   .set_power  = wl12xx_set_power,
-   .wires  = 4,
-   .max_freq   = 2500,
-   .caps   = MMC_CAP_4_BIT_DATA | MMC_CAP_NONREMOVABLE |
- MMC_CAP_POWER_OFF_CARD,
-};
-
-static const short da850_wl12xx_pins[] __initconst = {
-   DA850_MMCSD1_DAT_0, DA850_MMCSD1_DAT_1, DA850_MMCSD1_DAT_2,
-   DA850_MMCSD1_DAT_3, DA850_MMCSD1_CLK, DA850_MMCSD1_CMD,
-   DA850_GPIO6_9, DA850_GPIO6_10,
-   -1
-};
-
-static struct wl12xx_platform_data da850_wl12xx_wlan_data __initdata = {
-   .irq= -1,
-   .irq_trigger= IRQ_TYPE_EDGE_RISING,
-   .ref_clock_freq = 3840,
-   .ref_clock_xtal = false,
-};
-
-static __init int da850_wl12xx_init(void)
-{
-   int ret;
-
-   ret = davinci_cfg_reg_list(da850_wl12xx_pins);
-   if (ret) {
-   pr_err(wl12xx/mmc mux setup failed: %d\n, ret);
-   goto exit;
-   }
-
-   ret = da850_register_mmcsd1(da850_wl12xx_mmc_config);
-   if (ret) {
-   pr_err(wl12xx/mmc registration failed: %d\n, ret);
-   goto exit;
-   }
-
-   ret = gpio_request_one(DA850_WLAN_EN, GPIOF_OUT_INIT_LOW, wl12xx_en);
-   if (ret) {
-   pr_err(Could not request wl12xx enable gpio: %d\n, ret);
-   goto exit;
-   }
-
-   ret =