Add board configuration for the wl1271 daughter board. This patch is based
on Ohad Ben-Cohen's patches for Zoom boards.
Cc: Ohad Ben-Cohen <[email protected]>
Signed-off-by: Luciano Coelho <[email protected]>
---
from v2 to v3: removed accidental change to wl1271.h
arch/arm/mach-omap2/board-omap3beagle.c | 69 +++++++++++++++++++++++++++++++
1 files changed, 69 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 87969c7..755df29 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -29,7 +29,9 @@
#include <linux/mtd/nand.h>
#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
#include <linux/i2c/twl.h>
+#include <linux/wl12xx.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
@@ -48,6 +50,9 @@
#include "mux.h"
#include "hsmmc.h"
+#define OMAP_BEAGLE_WLAN_EN_GPIO (139)
+#define OMAP_BEAGLE_WLAN_IRQ_GPIO (137)
+
#define NAND_BLOCK_SIZE SZ_128K
static struct mtd_partition omap3beagle_nand_partitions[] = {
@@ -163,12 +168,25 @@ static void __init beagle_display_init(void)
#include "sdram-micron-mt46h32m32lf-6.h"
+struct wl12xx_platform_data omap_beagle_wlan_data __initdata = {
+ .irq = OMAP_GPIO_IRQ(OMAP_BEAGLE_WLAN_IRQ_GPIO),
+ .board_ref_clock = 2, /* 38.4 MHz */
+};
+
static struct omap2_hsmmc_info mmc[] = {
{
.mmc = 1,
.wires = 8,
.gpio_wp = 29,
},
+ {
+ .name = "wl1271",
+ .mmc = 2,
+ .wires = 4,
+ .gpio_wp = -EINVAL,
+ .gpio_cd = -EINVAL,
+ .nonremovable = true,
+ },
{} /* Terminator */
};
@@ -176,10 +194,43 @@ static struct regulator_consumer_supply beagle_vmmc1_supply = {
.supply = "vmmc",
};
+static struct regulator_consumer_supply beagle_vmmc2_supply = {
+ .supply = "vmmc",
+ .dev_name = "mmci-omap-hs.1",
+};
+
+
static struct regulator_consumer_supply beagle_vsim_supply = {
.supply = "vmmc_aux",
};
+
+static struct regulator_init_data beagle_vmmc2 = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &beagle_vmmc2_supply,
+};
+
+static struct fixed_voltage_config beagle_vwlan = {
+ .supply_name = "vwl1271",
+ .microvolts = 1800000, /* 1.8V */
+ .gpio = OMAP_BEAGLE_WLAN_EN_GPIO,
+ .startup_delay = 70000, /* 70ms */
+ .enable_high = 1,
+ .enabled_at_boot = 0,
+ .init_data = &beagle_vmmc2,
+};
+
+static struct platform_device omap_vwlan_device = {
+ .name = "reg-fixed-voltage",
+ .id = 1,
+ .dev = {
+ .platform_data = &beagle_vwlan,
+ },
+};
+
static struct gpio_led gpio_leds[];
static int beagle_twl_gpio_setup(struct device *dev,
@@ -449,6 +500,19 @@ static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
#ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = {
+ /* WLAN IRQ - GPIO 137 */
+ OMAP3_MUX(SDMMC2_DAT5, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP),
+ /* WLAN POWER ENABLE - GPIO 139 */
+ OMAP3_MUX(SDMMC2_DAT7, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
+ /* WLAN SDIO: MMC2 CMD */
+ OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+ /* WLAN SDIO: MMC2 CLK */
+ OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+ /* WLAN SDIO: MMC2 DAT[0-3] */
+ OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+ OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+ OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
+ OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP),
{ .reg_offset = OMAP_MUX_TERMINATOR },
};
#else
@@ -464,9 +528,14 @@ static struct omap_musb_board_data musb_board_data = {
static void __init omap3_beagle_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+ if (wl12xx_set_platform_data(&omap_beagle_wlan_data))
+ pr_err("error setting wl12xx data\n");
+
omap3_beagle_i2c_init();
platform_add_devices(omap3_beagle_devices,
ARRAY_SIZE(omap3_beagle_devices));
+ platform_device_register(&omap_vwlan_device);
+
omap_serial_init();
omap_mux_init_gpio(170, OMAP_PIN_INPUT);
--
1.6.3.3
On Fri, 2010-09-24 at 21:11 +0200, ext Tony Lindgren wrote:
> * Luciano Coelho <[email protected]> [100924 11:42]:
> > On Fri, 2010-09-24 at 20:03 +0200, ext John W. Linville wrote:
> > > On Thu, Sep 23, 2010 at 01:03:35PM +0300, Luciano Coelho wrote:
> > > > Add board configuration for the wl1271 daughter board. This patch is based
> > > > on Ohad Ben-Cohen's patches for Zoom boards.
> > > >
> > > > Cc: Ohad Ben-Cohen <[email protected]>
> > > > Signed-off-by: Luciano Coelho <[email protected]>
> > > > ---
> > > > from v2 to v3: removed accidental change to wl1271.h
> > >
> > > I presume that this should come through my tree as well (since it
> > > contains the move of wl12xx.h)?
> >
> > Yes, this is based on your tree. But please hold on, because there were
> > some comments (namely, the expansion board should be detected, not
> > configured for wl1271 by default), which I still have to fix. I'm
> > waiting for the manufacturer of the expansion board to provide me with
> > some more info for proper detection.
> >
> > Also, I know that there are some other work being done in the beagle
> > board file, so we may need to rethink how to sync this.
> >
> > So, for now, let's skip this patch and I'll provide another one when
> > these issues are addressed.
>
> You could also do it based on some kernel cmdline option. Of course
> detection during the runtime would be better.
Yes, this is more or less what Openembedded (?) guys seem to be doing.
You can check Robert Nelson's email in the "v2" thread.
The already have some changes in u-boot (which are apparently not in its
mainline yet) that does exactly that. The bootloader probes the
expansion board and passes the result in a kernel cmdline option. This
is "runtime", but I think the best solution would be in the end to let
the kernel do the probing itself.
As far as I could tell after some googling, having the bootloader probe
this kind of stuff is legacy because of problems with muxing in older
kernels, so the omap muxing had to be done in the bootloader. Now that
muxing is working fine in newer kernel, this kind of thing should be
moved to the kernel, or what do you think?
--
Cheers,
Luca.
* Gadiyar, Anand <[email protected]> [100924 12:13]:
> On Sat, Sep 25, 2010 at 12:41 AM, Tony Lindgren <[email protected]> wrote:
>
> This seems to be a generic problem that many boards with potential for
> adding expansion boards seem to have. How about one of these options:
> (a) having u-boot modify ATAGS_REVISION based on an environment variable
> or
> (b) add a generic board_revision kernel command line parameter that
> each such board file can parse
There is already system_rev that can be used for that and has an
ARM generic atag for it. Just needs to be passed from u-boot,
and should have setenv option for it in u-boot also.
Tony
On Sat, Sep 25, 2010 at 12:41 AM, Tony Lindgren <[email protected]> wrote:
> * Luciano Coelho <[email protected]> [100924 11:42]:
>> On Fri, 2010-09-24 at 20:03 +0200, ext John W. Linville wrote:
>> > On Thu, Sep 23, 2010 at 01:03:35PM +0300, Luciano Coelho wrote:
>> > > Add board configuration for the wl1271 daughter board. ?This patch is based
>> > > on Ohad Ben-Cohen's patches for Zoom boards.
>> > >
>> > > Cc: Ohad Ben-Cohen <[email protected]>
>> > > Signed-off-by: Luciano Coelho <[email protected]>
>> > > ---
>> > > from v2 to v3: removed accidental change to wl1271.h
>> >
>> > I presume that this should come through my tree as well (since it
>> > contains the move of wl12xx.h)?
>>
>> Yes, this is based on your tree. ?But please hold on, because there were
>> some comments (namely, the expansion board should be detected, not
>> configured for wl1271 by default), which I still have to fix. ?I'm
>> waiting for the manufacturer of the expansion board to provide me with
>> some more info for proper detection.
>>
>> Also, I know that there are some other work being done in the beagle
>> board file, so we may need to rethink how to sync this.
>>
>> So, for now, let's skip this patch and I'll provide another one when
>> these issues are addressed.
>
> You could also do it based on some kernel cmdline option. Of course
> detection during the runtime would be better.
>
This seems to be a generic problem that many boards with potential for
adding expansion boards seem to have. How about one of these options:
(a) having u-boot modify ATAGS_REVISION based on an environment variable
or
(b) add a generic board_revision kernel command line parameter that
each such board file can parse
By default - with no special command line options - peripherals for
the most common board revision could be picked. Anyway a user that
uses such a daughterboard would know to modify the kernel command
line, or set an environment variable in u-boot, (or use a custom
u-boot) so this could scale well.
What do you think?
- Anand
* Luciano Coelho <[email protected]> [100924 11:42]:
> On Fri, 2010-09-24 at 20:03 +0200, ext John W. Linville wrote:
> > On Thu, Sep 23, 2010 at 01:03:35PM +0300, Luciano Coelho wrote:
> > > Add board configuration for the wl1271 daughter board. This patch is based
> > > on Ohad Ben-Cohen's patches for Zoom boards.
> > >
> > > Cc: Ohad Ben-Cohen <[email protected]>
> > > Signed-off-by: Luciano Coelho <[email protected]>
> > > ---
> > > from v2 to v3: removed accidental change to wl1271.h
> >
> > I presume that this should come through my tree as well (since it
> > contains the move of wl12xx.h)?
>
> Yes, this is based on your tree. But please hold on, because there were
> some comments (namely, the expansion board should be detected, not
> configured for wl1271 by default), which I still have to fix. I'm
> waiting for the manufacturer of the expansion board to provide me with
> some more info for proper detection.
>
> Also, I know that there are some other work being done in the beagle
> board file, so we may need to rethink how to sync this.
>
> So, for now, let's skip this patch and I'll provide another one when
> these issues are addressed.
You could also do it based on some kernel cmdline option. Of course
detection during the runtime would be better.
Regards,
Tony
On Fri, 2010-09-24 at 20:03 +0200, ext John W. Linville wrote:
> On Thu, Sep 23, 2010 at 01:03:35PM +0300, Luciano Coelho wrote:
> > Add board configuration for the wl1271 daughter board. This patch is based
> > on Ohad Ben-Cohen's patches for Zoom boards.
> >
> > Cc: Ohad Ben-Cohen <[email protected]>
> > Signed-off-by: Luciano Coelho <[email protected]>
> > ---
> > from v2 to v3: removed accidental change to wl1271.h
>
> I presume that this should come through my tree as well (since it
> contains the move of wl12xx.h)?
Yes, this is based on your tree. But please hold on, because there were
some comments (namely, the expansion board should be detected, not
configured for wl1271 by default), which I still have to fix. I'm
waiting for the manufacturer of the expansion board to provide me with
some more info for proper detection.
Also, I know that there are some other work being done in the beagle
board file, so we may need to rethink how to sync this.
So, for now, let's skip this patch and I'll provide another one when
these issues are addressed.
--
Cheers,
Luca.
Op 24 sep 2010, om 21:11 heeft Tony Lindgren het volgende geschreven:
> * Luciano Coelho <[email protected]> [100924 11:42]:
>> On Fri, 2010-09-24 at 20:03 +0200, ext John W. Linville wrote:
>>> On Thu, Sep 23, 2010 at 01:03:35PM +0300, Luciano Coelho wrote:
>>>> Add board configuration for the wl1271 daughter board. This patch is based
>>>> on Ohad Ben-Cohen's patches for Zoom boards.
>>>>
>>>> Cc: Ohad Ben-Cohen <[email protected]>
>>>> Signed-off-by: Luciano Coelho <[email protected]>
>>>> ---
>>>> from v2 to v3: removed accidental change to wl1271.h
>>>
>>> I presume that this should come through my tree as well (since it
>>> contains the move of wl12xx.h)?
>>
>> Yes, this is based on your tree. But please hold on, because there were
>> some comments (namely, the expansion board should be detected, not
>> configured for wl1271 by default), which I still have to fix. I'm
>> waiting for the manufacturer of the expansion board to provide me with
>> some more info for proper detection.
>>
>> Also, I know that there are some other work being done in the beagle
>> board file, so we may need to rethink how to sync this.
>>
>> So, for now, let's skip this patch and I'll provide another one when
>> these issues are addressed.
>
> You could also do it based on some kernel cmdline option. Of course
> detection during the runtime would be better.
That's what we're currently doing in the beagle kernels: http://gitorious.org/beagleboard-validation/linux/commit/17c1b214b918c6f9efc5579134a7ff71d51b60bf
That needs forward porting to .37 before I can submit is as RFC here :)
On Fri, 2010-09-24 at 21:42 +0200, ext Koen Kooi wrote:
> Op 24 sep 2010, om 21:11 heeft Tony Lindgren het volgende geschreven:
>
> > * Luciano Coelho <[email protected]> [100924 11:42]:
> >> On Fri, 2010-09-24 at 20:03 +0200, ext John W. Linville wrote:
> >>> On Thu, Sep 23, 2010 at 01:03:35PM +0300, Luciano Coelho wrote:
> >>>> Add board configuration for the wl1271 daughter board. This patch is based
> >>>> on Ohad Ben-Cohen's patches for Zoom boards.
> >>>>
> >>>> Cc: Ohad Ben-Cohen <[email protected]>
> >>>> Signed-off-by: Luciano Coelho <[email protected]>
> >>>> ---
> >>>> from v2 to v3: removed accidental change to wl1271.h
> >>>
> >>> I presume that this should come through my tree as well (since it
> >>> contains the move of wl12xx.h)?
> >>
> >> Yes, this is based on your tree. But please hold on, because there were
> >> some comments (namely, the expansion board should be detected, not
> >> configured for wl1271 by default), which I still have to fix. I'm
> >> waiting for the manufacturer of the expansion board to provide me with
> >> some more info for proper detection.
> >>
> >> Also, I know that there are some other work being done in the beagle
> >> board file, so we may need to rethink how to sync this.
> >>
> >> So, for now, let's skip this patch and I'll provide another one when
> >> these issues are addressed.
> >
> > You could also do it based on some kernel cmdline option. Of course
> > detection during the runtime would be better.
>
> That's what we're currently doing in the beagle kernels: http://gitorious.org/beagleboard-validation/linux/commit/17c1b214b918c6f9efc5579134a7ff71d51b60bf
>
> That needs forward porting to .37 before I can submit is as RFC here :)
Yes! I have seen that as pointed out by Robert. It would be nice if you
could port this soon(ish) so that others can start using it (ok, maybe
not many people, but at least me :P)
What would you think about having the actual probing moved from u-boot
to the kernel? Do you think that would make sense or are there some
other reasons for having it in the bootloader?
--
Cheers,
Luca.
Op 24 sep 2010, om 22:00 heeft Luciano Coelho het volgende geschreven:
> On Fri, 2010-09-24 at 21:42 +0200, ext Koen Kooi wrote:
>> Op 24 sep 2010, om 21:11 heeft Tony Lindgren het volgende geschreven:
>>
>>> * Luciano Coelho <[email protected]> [100924 11:42]:
>>>> On Fri, 2010-09-24 at 20:03 +0200, ext John W. Linville wrote:
>>>>> On Thu, Sep 23, 2010 at 01:03:35PM +0300, Luciano Coelho wrote:
>>>>>> Add board configuration for the wl1271 daughter board. This patch is based
>>>>>> on Ohad Ben-Cohen's patches for Zoom boards.
>>>>>>
>>>>>> Cc: Ohad Ben-Cohen <[email protected]>
>>>>>> Signed-off-by: Luciano Coelho <[email protected]>
>>>>>> ---
>>>>>> from v2 to v3: removed accidental change to wl1271.h
>>>>>
>>>>> I presume that this should come through my tree as well (since it
>>>>> contains the move of wl12xx.h)?
>>>>
>>>> Yes, this is based on your tree. But please hold on, because there were
>>>> some comments (namely, the expansion board should be detected, not
>>>> configured for wl1271 by default), which I still have to fix. I'm
>>>> waiting for the manufacturer of the expansion board to provide me with
>>>> some more info for proper detection.
>>>>
>>>> Also, I know that there are some other work being done in the beagle
>>>> board file, so we may need to rethink how to sync this.
>>>>
>>>> So, for now, let's skip this patch and I'll provide another one when
>>>> these issues are addressed.
>>>
>>> You could also do it based on some kernel cmdline option. Of course
>>> detection during the runtime would be better.
>>
>> That's what we're currently doing in the beagle kernels: http://gitorious.org/beagleboard-validation/linux/commit/17c1b214b918c6f9efc5579134a7ff71d51b60bf
>>
>> That needs forward porting to .37 before I can submit is as RFC here :)
>
> Yes! I have seen that as pointed out by Robert. It would be nice if you
> could port this soon(ish) so that others can start using it (ok, maybe
> not many people, but at least me :P)
>
> What would you think about having the actual probing moved from u-boot
> to the kernel? Do you think that would make sense or are there some
> other reasons for having it in the bootloader?
It would make a lot of sense, but when we did the code the in-kernel muxing was pretty much unusable for this goal. I'd prefer to get the uboot based detection way into the kernel first before embarking on the bigger fully in-kernel stuff.
Note that on beagleboard-xM we have an additional problem with the camera modules, the different sensors use the same i2c address, which means it completely falls down with the current i2c implementation. Does anyone have any hints on how to read a register over i2c before registering the i2c platform data?
regards,
Koen
On Thu, Sep 23, 2010 at 01:03:35PM +0300, Luciano Coelho wrote:
> Add board configuration for the wl1271 daughter board. This patch is based
> on Ohad Ben-Cohen's patches for Zoom boards.
>
> Cc: Ohad Ben-Cohen <[email protected]>
> Signed-off-by: Luciano Coelho <[email protected]>
> ---
> from v2 to v3: removed accidental change to wl1271.h
I presume that this should come through my tree as well (since it
contains the move of wl12xx.h)?
John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.