Bringing up WiFi interface on Wandboard Quad

This forum is for supported devices using an ARMv7 Freescale SoC.

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Mon Aug 25, 2014 3:04 pm

alright building
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Mon Aug 25, 2014 9:44 pm

WRAP arch/arm/include/generated/asm/sizes.h
WRAP arch/arm/include/generated/asm/socket.h
WRAP arch/arm/include/generated/asm/sockios.h
WRAP arch/arm/include/generated/asm/termbits.h
WRAP arch/arm/include/generated/asm/termios.h
WRAP arch/arm/include/generated/asm/timex.h
WRAP arch/arm/include/generated/asm/trace_clock.h
WRAP arch/arm/include/generated/asm/types.h
WRAP arch/arm/include/generated/asm/unaligned.h
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Generating include/generated/mach-types.h
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/arm/kernel/asm-offsets.s
GEN include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
==> Stopping build
==> ERROR: A failure occurred in build().
Aborting...

I'll check where this is happening.
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby PLyttle » Tue Aug 26, 2014 6:17 am

EDIT:
all of a sudden I realize this is probably happening the first time you started makepkg.
This is what is supposed to happen. you see the message "Stopping build"
but what I neglected to mention is that "return 1" returns with an error.

after this, just continue with the procedure, apply the patch, edit PKGBUILD again and do the full build with makepkg -e
/EDIT

looks like you forgot to put the hashes back in the PKGBUILD file

turn this:
$this->bbcode_second_pass_code('', ' ####################
# stop here
# this is useful to configure the kernel
msg "Stopping build"
return 1
####################
')
into this:
$this->bbcode_second_pass_code('', ' ####################
# stop here
# this is useful to configure the kernel
#msg "Stopping build"
#return 1
####################
')
after you applied the patch and before you started building


LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Tue Aug 26, 2014 4:09 pm

got it, thanks. Will retry tonight and let you know.
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Tue Aug 26, 2014 4:13 pm

$this->bbcode_second_pass_code('', 'patch -p1 < ../../../../../brcm.patch
(Patch is indented 4 spaces.)
patching file arch/arm/boot/dts/imx6qdl-wandboard.dtsi
Hunk #1 succeeded at 106 with fuzz 2.
(Patch is indented 4 spaces.)
patching file arch/arm/mach-imx/devices/wand-rfkill.c
patch: **** malformed patch at line 25: };
')

The diff is:

$this->bbcode_second_pass_code('', '

18 /* Rev B/C probe gpio */
19 wand-rev-gpio = <&gpio2 28 0>;
20 diff -rupN a/arch/arm/mach-imx/devices/wand-rfkill.c b/arch/arm/mach-imx /devices/wand-rfkill.c
21 --- a/arch/arm/mach-imx/devices/wand-rfkill.c 2014-07-11 21:53:12.0000 00000 +0200
22 +++ b/arch/arm/mach-imx/devices/wand-rfkill.c 2014-08-13 08:29:20.7428 90988 +0200
23 @@ -55,84 +55,6 @@ static const struct rfkill_ops wand_rfki
24 .set_block = wand_rfkill_set_block,
25 };
26

')
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Tue Aug 26, 2014 4:17 pm

The file being patched says:

PKGBUILDs/core/linux-wandboard/src/linux-13697f2edf19fc99921376039bdb0ad595b48ebb/arch/arm/mach-imx/devices/wand-rfkill.c

$this->bbcode_second_pass_code('', '
37 static int wand_rfkill_set_block(void *data, bool blocked)
38 {
39 struct wand_rfkill_data *rfkill = data;
40
41 pr_debug("wandboard-rfkill: set block %d\n", blocked);
42
43 if (blocked) {
44 if (gpio_is_valid(rfkill->shutdown_gpio))
45 gpio_direction_output(rfkill->shutdown_gpio, 0);
46 } else {
47 if (gpio_is_valid(rfkill->shutdown_gpio))
48 gpio_direction_output(rfkill->shutdown_gpio, 1);
49 }
50
51 return 0;
52 }
53
54 static const struct rfkill_ops wand_rfkill_ops = {
55 .set_block = wand_rfkill_set_block,
56 };
')
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby PLyttle » Tue Aug 26, 2014 7:44 pm

That is unexpected, I'll figure out what went wrong.
get back soon


EDIT

I'm back.
Can't really figure out where the file got clobbered.
here it is again. I verified this working on the current arch kernel
make sure there are no extra linefeeds on long lines

$this->bbcode_second_pass_code('', 'diff -rupN a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi
--- a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi 2014-08-26 21:48:12.649889453 +0200
+++ b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi 2014-08-26 21:53:50.771802147 +0200
@@ -106,11 +106,13 @@

/* Rev C1 gpio definitions */
bluetooth-on-revc1 = <&gpio5 21 0>;
- bluetooth-wake-revc1 = <&gpio5 30 0>;
+ bluetooth-wake-revc1 = <&gpio1 30 0>;
bluetooth-host-wake-revc1 = <&gpio5 20 0>;

wifi-ref-on-revc1 = <&gpio5 31 0>;
- wifi-rst-n-revc1 = <&gpio6 0 0>;
+ wifi-rst-n-revc1 = <&gpio1 26 0>;
+ wifi-reg-on-revc1 = <&gpio5 30 0>;
+ wifi-wake-revc1 = <&gpio6 0 0>;

/* Rev B/C probe gpio */
wand-rev-gpio = <&gpio2 28 0>;
diff -rupN a/arch/arm/mach-imx/devices/wand-rfkill.c b/arch/arm/mach-imx/devices/wand-rfkill.c
--- a/arch/arm/mach-imx/devices/wand-rfkill.c 2014-08-26 21:48:12.869897198 +0200
+++ b/arch/arm/mach-imx/devices/wand-rfkill.c 2014-08-26 22:07:00.919708995 +0200
@@ -55,84 +55,6 @@ static const struct rfkill_ops wand_rfki
.set_block = wand_rfkill_set_block,
};

-static int wand_rfkill_wifi_probe(struct device *dev,
- struct device_node *np,
- struct wand_rfkill_data *rfkill,
- int wand_rev)
-{
- int ret;
- int wl_ref_on, wl_rst_n, wl_reg_on, wl_wake, wl_host_wake;
-
- if(wand_rev){
- wl_ref_on = of_get_named_gpio(np, "wifi-ref-on-revc1", 0);
- wl_rst_n = of_get_named_gpio(np, "wifi-rst-n-revc1", 0);
- }
- else {
- wl_ref_on = of_get_named_gpio(np, "wifi-ref-on", 0);
- wl_rst_n = of_get_named_gpio(np, "wifi-rst-n", 0);
- }
-
- wl_reg_on = of_get_named_gpio(np, "wifi-reg-on", 0);
- wl_wake = of_get_named_gpio(np, "wifi-wake", 0);
- wl_host_wake = of_get_named_gpio(np, "wifi-host-wake", 0);
-
- if (!gpio_is_valid(wl_rst_n) || !gpio_is_valid(wl_ref_on) ||
- !gpio_is_valid(wl_reg_on) || !gpio_is_valid(wl_wake) ||
- !gpio_is_valid(wl_host_wake)) {
-
- dev_err(dev, "incorrect wifi gpios (%d %d %d %d %d)\n",
- wl_rst_n, wl_ref_on, wl_reg_on, wl_wake, wl_host_wake);
- return -EINVAL;
- }
-
- dev_info(dev, "initialize wifi chip\n");
-
- gpio_request(wl_rst_n, "wl_rst_n");
- gpio_direction_output(wl_rst_n, 0);
- msleep(11);
- gpio_set_value(wl_rst_n, 1);
-
- gpio_request(wl_ref_on, "wl_ref_on");
- gpio_direction_output(wl_ref_on, 1);
-
- gpio_request(wl_reg_on, "wl_reg_on");
- gpio_direction_output(wl_reg_on, 1);
-
- gpio_request(wl_wake, "wl_wake");
- gpio_direction_output(wl_wake, 1);
-
- gpio_request(wl_host_wake, "wl_host_wake");
- gpio_direction_input(wl_host_wake);
-
- rfkill->shutdown_name = "wifi_shutdown";
- rfkill->shutdown_gpio = wl_wake;
-
- rfkill->rfkill_dev = rfkill_alloc("wifi-rfkill", dev, RFKILL_TYPE_WLAN,
- &wand_rfkill_ops, rfkill);
- if (!rfkill->rfkill_dev) {
- ret = -ENOMEM;
- goto wifi_fail_free_gpio;
- }
-
- ret = rfkill_register(rfkill->rfkill_dev);
- if (ret < 0)
- goto wifi_fail_unregister;
-
- dev_info(dev, "wifi-rfkill registered.\n");
-
- return 0;
-
-wifi_fail_unregister:
- rfkill_destroy(rfkill->rfkill_dev);
-wifi_fail_free_gpio:
- if (gpio_is_valid(wl_rst_n)) gpio_free(wl_rst_n);
- if (gpio_is_valid(wl_ref_on)) gpio_free(wl_ref_on);
- if (gpio_is_valid(wl_reg_on)) gpio_free(wl_reg_on);
- if (gpio_is_valid(wl_wake)) gpio_free(wl_wake);
- if (gpio_is_valid(wl_host_wake)) gpio_free(wl_host_wake);
-
- return ret;
-}

static int wand_rfkill_bt_probe(struct device *dev,
struct device_node *np,
@@ -249,27 +171,13 @@ static int wand_rfkill_probe(struct plat
else
dev_info(&pdev->dev,"wandboard is rev B0\n");

- /* setup WiFi */
- ret = wand_rfkill_wifi_probe(&pdev->dev, pdev->dev.of_node, &rfkill[0], wand_rev);
- if (ret < 0)
- goto fail_free_rfkill;
-
/* setup bluetooth */
ret = wand_rfkill_bt_probe(&pdev->dev, pdev->dev.of_node, &rfkill[1], wand_rev);
- if (ret < 0)
- goto fail_unregister_wifi;

platform_set_drvdata(pdev, rfkill);

return 0;

-fail_unregister_wifi:
- if (rfkill[1].rfkill_dev) {
- rfkill_unregister(rfkill[1].rfkill_dev);
- rfkill_destroy(rfkill[1].rfkill_dev);
- }
-
- /* TODO free gpio */

fail_free_rfkill:
kfree(rfkill);
@@ -286,13 +194,6 @@ static int wand_rfkill_remove(struct pla
if (!rfkill)
return 0;

- /* WiFi */
- if (gpio_is_valid(rfkill[0].shutdown_gpio))
- gpio_free(rfkill[0].shutdown_gpio);
-
- rfkill_unregister(rfkill[0].rfkill_dev);
- rfkill_destroy(rfkill[0].rfkill_dev);
-
/* Bt */
if (gpio_is_valid(rfkill[1].shutdown_gpio))
gpio_free(rfkill[1].shutdown_gpio);
')
LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

Re: Bringing up WiFi interface on Wandboard Quad

Postby PLyttle » Wed Aug 27, 2014 9:41 am

The problem was that some of the leading spaces somehow got removed, sorry about that.

If you still have problems applying the patch try
$this->bbcode_second_pass_code('', 'patch -p1 -l < ~/brcm.patch
')
this takes care of tab - space discrepancies

you can also use
$this->bbcode_second_pass_code('', 'patch -p1 -l --dry-run < ~/brcm.patch
')

this goes through the motions without actually modifying anything
if that does not complain, you can use the command without --dry-run

LP
PLyttle
 
Posts: 120
Joined: Mon Jun 10, 2013 6:52 am

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Sun Aug 31, 2014 5:22 pm

$this->bbcode_second_pass_code('', ' patch -p1 < ~/brcm.patch
(Patch is indented 4 spaces.)
patching file arch/arm/boot/dts/imx6qdl-wandboard.dtsi
Hunk #1 succeeded at 106 with fuzz 2.
(Patch is indented 4 spaces.)
patching file arch/arm/mach-imx/devices/wand-rfkill.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n] y
Hunk #1 FAILED at 55.
Hunk #2 FAILED at 249.
Hunk #3 FAILED at 286.
3 out of 3 hunks FAILED -- saving rejects to file arch/arm/mach-imx/devices/wand-rfkill.c.rej
')
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

Re: Bringing up WiFi interface on Wandboard Quad

Postby Alarmed » Sun Aug 31, 2014 5:23 pm

$this->bbcode_second_pass_code('', ' patch -p1 -l < ~/brcm.patch
(Patch is indented 4 spaces.)
patching file arch/arm/boot/dts/imx6qdl-wandboard.dtsi
Reversed (or previously applied) patch detected! Assume -R? [n] y
(Patch is indented 4 spaces.)
patching file arch/arm/mach-imx/devices/wand-rfkill.c
Reversed (or previously applied) patch detected! Assume -R? [n] y
')
Alarmed
 
Posts: 54
Joined: Sun Jul 27, 2014 2:07 pm

PreviousNext

Return to Freescale

Who is online

Users browsing this forum: No registered users and 12 guests