WandBoard rev C1 brcm4330 integration

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

WandBoard rev C1 brcm4330 integration

Postby PLyttle » Fri Jun 27, 2014 10:57 am

The rev C1 update for wandboard requires a device tree update.
I posted a preliminary patch already, but this post is more complete.
Also by making a new topic the information is less buried

This is the patch for arch/arm/boot/dts/imx6qdl-wandboard.dtsi:

$this->bbcode_second_pass_code('', '
--- arch/arm/boot/dts/imx6qdl-wandboard.dtsi.ORIG 1970-01-01 01:43:37.300000154 +0100
+++ arch/arm/boot/dts/imx6qdl-wandboard.dtsi 2014-06-27 11:45:08.630306855 +0200
@@ -94,12 +94,12 @@
pinctrl-names = "default";
pinctrl-0 = <>;

- bluetooth-on = <&gpio3 13 0>;
- bluetooth-wake = <&gpio3 14 0>;
- bluetooth-host-wake = <&gpio3 15 0>;
+ bluetooth-on = <&gpio5 21 0>;
+ bluetooth-wake = <&gpio5 30 0>;
+ bluetooth-host-wake = <&gpio5 20 0>;

- wifi-ref-on = <&gpio2 29 0>;
- wifi-rst-n = <&gpio5 2 0>;
+ wifi-ref-on = <&gpio5 31 0>;
+ wifi-rst-n = <&gpio6 0 0>;
wifi-reg-on = <&gpio1 26 0>;
wifi-host-wake = <&gpio1 29 0>;
wifi-wake = <&gpio1 30 0>;
@@ -332,15 +332,15 @@ reference manual.
MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x0b0b0/* ov5640 mipi powerdown */
MX6QDL_PAD_KEY_COL4__GPIO4_IO14 0x000b0/* ov5640 mipi reset */
MX6QDL_PAD_GPIO_3__CCM_CLKO2 0x000b0/* ov5640 mclk */
- MX6QDL_PAD_EIM_A25__GPIO5_IO02 0x0f0b0/* WIFI_ON (reset, active low) */
+ MX6QDL_PAD_CSI0_DAT14__GPIO6_IO00 0x0f0b0/* WIFI_ON (reset, active low) */
MX6QDL_PAD_ENET_RXD1__GPIO1_IO26 0x000b0/* WL_REG_ON (unused) */
MX6QDL_PAD_ENET_TXD1__GPIO1_IO29 0x80000000 /* WL_HOST_WAKE, input */
- MX6QDL_PAD_EIM_EB1__GPIO2_IO29 0x0f0b0/* EIM_EB1 (Wifi Power Enable) */
+ MX6QDL_PAD_CSI0_DAT13__GPIO5_IO31 0x0f0b0/* CSI0_DAT13 (Wifi Power Enable) */
MX6QDL_PAD_ENET_TXD0__GPIO1_IO30 0x80000000 /* WL_WAKE (unused) */
MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x80000000
- MX6QDL_PAD_EIM_DA13__GPIO3_IO13 0x80000000 /* BT_ON */
- MX6QDL_PAD_EIM_DA14__GPIO3_IO14 0x80000000 /* BT_WAKE */
- MX6QDL_PAD_EIM_DA15__GPIO3_IO15 0x80000000 /* BT_HOST_WAKE */
+ MX6QDL_PAD_CSI0_VSYNC__GPIO5_IO21 0x80000000 /* BT_ON */
+ MX6QDL_PAD_CSI0_DAT12__GPIO5_IO30 0x80000000 /* BT_WAKE */
+ MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 0x80000000 /* BT_HOST_WAKE */
>;
};

')

which results in this patch for a decompiled /boot/dtbs/imx6q-wandboard.dtb
$this->bbcode_second_pass_code('', '
--- imx6q-wandboard.dts.ORIG 2014-06-25 21:45:44.633032103 +0200
+++ imx6q-wandboard.dts 2014-06-27 11:53:48.973189669 +0200
@@ -434,8 +434,6 @@
#gpio-cells = <0x2>;
interrupt-controller;
#interrupt-cells = <0x2>;
- linux,phandle = <0x2b>;
- phandle = <0x2b>;
};

gpio@020a4000 {
@@ -470,8 +468,8 @@
#gpio-cells = <0x2>;
interrupt-controller;
#interrupt-cells = <0x2>;
- linux,phandle = <0x2c>;
- phandle = <0x2c>;
+ linux,phandle = <0x2b>;
+ phandle = <0x2b>;
};

gpio@020b0000 {
@@ -482,6 +480,8 @@
#gpio-cells = <0x2>;
interrupt-controller;
#interrupt-cells = <0x2>;
+ linux,phandle = <0x2c>;
+ phandle = <0x2c>;
};

gpio@020b4000 {
@@ -1098,7 +1098,7 @@
imx6qdl-wandboard {

hoggrp-1 {
- fsl,pins = <0x220 0x5f0 0x0 0x0 0x0 0x130b0 0xa8 0x3bc 0x0 0x5 0x0 0x80000000 0x234 0x604 0x0 0x5 0x0 0x80000000 0x138 0x44c 0x0 0x5 0x0 0x80000000 0x220 0x5f0 0x0 0x0 0x0 0xb0 0x230 0x600 0x0 0x5 0x0 0xb0b0 0x218 0x5e8 0x0 0x5 0x0 0xb0 0x22c 0x5fc 0x0 0x4 0x0 0xb0 0x88 0x39c 0x0 0x5 0x0 0xf0b0 0x1e0 0x4f4 0x0 0x5 0x0 0xb0 0x1ec 0x500 0x0 0x5 0x0 0x80000000 0x110 0x424 0x0 0x5 0x0 0xf0b0 0x1f0 0x504 0x0 0x5 0x0 0x80000000 0xc8 0x3dc 0x0 0x5 0x0 0x80000000 0x148 0x45c 0x0 0x5 0x0 0x80000000 0x14c 0x460 0x0 0x5 0x0 0x80000000 0x150 0x464 0x0 0x5 0x0 0x80000000>;
+ fsl,pins = <0x220 0x5f0 0x0 0x0 0x0 0x130b0 0xa8 0x3bc 0x0 0x5 0x0 0x80000000 0x234 0x604 0x0 0x5 0x0 0x80000000 0x138 0x44c 0x0 0x5 0x0 0x80000000 0x220 0x5f0 0x0 0x0 0x0 0xb0 0x230 0x600 0x0 0x5 0x0 0xb0b0 0x218 0x5e8 0x0 0x5 0x0 0xb0 0x22c 0x5fc 0x0 0x4 0x0 0xb0 0x290 0x660 0x0 0x5 0x0 0xf0b0 0x1e0 0x4f4 0x0 0x5 0x0 0xb0 0x1ec 0x500 0x0 0x5 0x0 0x80000000 0x28c 0x65c 0x0 0x5 0x0 0xf0b0 0x1f0 0x504 0x0 0x5 0x0 0x80000000 0xc8 0x3dc 0x0 0x5 0x0 0x80000000 0x264 0x634 0x0 0x5 0x0 0x80000000 0x288 0x658 0x0 0x5 0x0 0x80000000 0x260 0x630 0x0 0x5 0x0 0x80000000>;
linux,phandle = <0xd>;
phandle = <0xd>;
};
@@ -1735,11 +1735,11 @@
compatible = "wand,imx6qdl-wandboard-rfkill";
pinctrl-names = "default";
pinctrl-0;
- bluetooth-on = <0x18 0xd 0x0>;
- bluetooth-wake = <0x18 0xe 0x0>;
- bluetooth-host-wake = <0x18 0xf 0x0>;
- wifi-ref-on = <0x2b 0x1d 0x0>;
- wifi-rst-n = <0x2c 0x2 0x0>;
+ bluetooth-on = <0x2b 0x15 0x0>;
+ bluetooth-wake = <0x2b 0x1e 0x0>;
+ bluetooth-host-wake = <0x2b 0x14 0x0>;
+ wifi-ref-on = <0x2b 0x1f 0x0>;
+ wifi-rst-n = <0x2c 0x0 0x0>;
wifi-reg-on = <0x1b 0x1a 0x0>;
wifi-host-wake = <0x1b 0x1d 0x0>;
wifi-wake = <0x1b 0x1e 0x0>;

')

and this patch for a decompiled /boot/dtbs/imx6dl-wandboard.dtb
$this->bbcode_second_pass_code('', '
--- imx6dl-wandboard.dts.ORIG 2014-06-27 12:32:13.380000263 +0200
+++ imx6dl-wandboard.dts 2014-06-27 12:31:13.470000256 +0200
@@ -422,8 +422,6 @@
#gpio-cells = <0x2>;
interrupt-controller;
#interrupt-cells = <0x2>;
- linux,phandle = <0x2b>;
- phandle = <0x2b>;
};

gpio@020a4000 {
@@ -458,8 +456,8 @@
#gpio-cells = <0x2>;
interrupt-controller;
#interrupt-cells = <0x2>;
- linux,phandle = <0x2c>;
- phandle = <0x2c>;
+ linux,phandle = <0x2b>;
+ phandle = <0x2b>;
};

gpio@020b0000 {
@@ -470,6 +468,8 @@
#gpio-cells = <0x2>;
interrupt-controller;
#interrupt-cells = <0x2>;
+ linux,phandle = <0x2c>;
+ phandle = <0x2c>;
};

gpio@020b4000 {
@@ -1086,7 +1086,7 @@
imx6qdl-wandboard {

hoggrp-1 {
- fsl,pins = <0x20c 0x5dc 0x0 0x0 0x0 0x130b0 0x15c 0x52c 0x0 0x5 0x0 0x80000000 0x224 0x5f4 0x0 0x5 0x0 0x80000000 0x1c0 0x590 0x0 0x5 0x0 0x80000000 0x20c 0x5dc 0x0 0x0 0x0 0xb0 0x234 0x604 0x0 0x5 0x0 0xb0b0 0x254 0x63c 0x0 0x5 0x0 0xb0 0x228 0x5f8 0x0 0x4 0x0 0xb0 0x134 0x504 0x0 0x5 0x0 0xf0b0 0x1fc 0x5cc 0x0 0x5 0x0 0xb0 0x208 0x5d8 0x0 0x5 0x0 0x80000000 0x1c8 0x598 0x0 0x5 0x0 0xf0b0 0x204 0x5d4 0x0 0x5 0x0 0x80000000 0x178 0x548 0x0 0x5 0x0 0x80000000 0x198 0x568 0x0 0x5 0x0 0x80000000 0x19c 0x56c 0x0 0x5 0x0 0x80000000 0x1a0 0x570 0x0 0x5 0x0 0x80000000>;
+ fsl,pins = <0x20c 0x5dc 0x0 0x0 0x0 0x130b0 0x15c 0x52c 0x0 0x5 0x0 0x80000000 0x224 0x5f4 0x0 0x5 0x0 0x80000000 0x1c0 0x590 0x0 0x5 0x0 0x80000000 0x20c 0x5dc 0x0 0x0 0x0 0xb0 0x234 0x604 0x0 0x5 0x0 0xb0b0 0x254 0x63c 0x0 0x5 0x0 0xb0 0x228 0x5f8 0x0 0x4 0x0 0xb0 0x5c 0x370 0x0 0x5 0x0 0xf0b0 0x1fc 0x5cc 0x0 0x5 0x0 0xb0 0x208 0x5d8 0x0 0x5 0x0 0x80000000 0x58 0x36c 0x0 0x5 0x0 0xf0b0 0x204 0x5d4 0x0 0x5 0x0 0x80000000 0x178 0x548 0x0 0x5 0x0 0x80000000 0x98 0x3ac 0x0 0x5 0x0 0x80000000 0x54 0x368 0x0 0x5 0x0 0x80000000 0x8c 0x3a0 0x0 0x5 0x0 0x80000000>;
linux,phandle = <0xd>;
phandle = <0xd>;
};
@@ -1722,11 +1722,11 @@
compatible = "wand,imx6qdl-wandboard-rfkill";
pinctrl-names = "default";
pinctrl-0;
- bluetooth-on = <0x18 0xd 0x0>;
- bluetooth-wake = <0x18 0xe 0x0>;
- bluetooth-host-wake = <0x18 0xf 0x0>;
- wifi-ref-on = <0x2b 0x1d 0x0>;
- wifi-rst-n = <0x2c 0x2 0x0>;
+ bluetooth-on = <0x2b 0x15 0x0>;
+ bluetooth-wake = <0x2b 0x1e 0x0>;
+ bluetooth-host-wake = <0x2b 0x14 0x0>;
+ wifi-ref-on = <0x2b 0x1f 0x0>;
+ wifi-rst-n = <0x2c 0x0 0x0>;
wifi-reg-on = <0x1b 0x1a 0x0>;
wifi-host-wake = <0x1b 0x1d 0x0>;
wifi-wake = <0x1b 0x1e 0x0>;
')
This time I thought of changing the PAD_CTL bitfields too. (oops) :-(

you need the first patch if you want to compile your own device tree from the kernel sources, the second ones are included if you just want to change the tree in your installed kernel package.

This only works for rev.C1 so in order to make this universal, u-boot needs to be modified too, which I am currently not inclined to do. I first want to get bluetooth to work.

Caveat: I would invite people knowledgeable in device trees to look critically at this patch, because it is my first effort in this field, and there are bound to be mistakes.

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

Re: WandBoard rev C1 brcm4330 integration

Postby pepedog » Fri Jun 27, 2014 12:16 pm

This is annoying, especially with this comment
http://forums.wandboard.org/viewtopic.php?f=8&t=440
$this->bbcode_second_pass_quote('', 'I') think many people who make these images don't have a Wandboard themselves and/or are used to booting with a HDMI screen.

So this device requires it's own rootfs/own kernel/own uboot?
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: WandBoard rev C1 brcm4330 integration

Postby kmihelich » Fri Jun 27, 2014 12:49 pm

I think many people who complain about our images missed the note that this distribution is for the competent Linux user. ;)

There is nothing about this change that would prevent our standard procedure of having ssh available over ethernet working, and there is no display enabled by default, as is typical. However, we will need to find out if this new revision can be detected at U-Boot in order to load the different dtb, like is done for the few BeagleBoard revisions. Though I am not going to be purchasing another Wandboard just to do this, and really it's more the responsibility of the Wandboard devs to cook up an appropriate solution to this given that they changed the hardware.

It seems that people tend to forget that we are running this distribution with very few people, all of whom have full-time jobs and spend gobs of our free time outside of work, family, and personal commitments for this.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: WandBoard rev C1 brcm4330 integration

Postby PLyttle » Fri Jun 27, 2014 1:09 pm

Maybe not. The board signals itself as a rev.C1 by a pull-up on GPIO2_IO28 (EIM_EB0) so it can be auto-detected. I am not well versed in u-boot, but it must be possible to load a tree depending on which board is detected. That u-boot should then work for both versions.

an alternative is to provide a rev C1 package, containing a modified tree. (i cringe to have said that :-)) but that is basically what I have done already (except for the package)

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

Re: WandBoard rev C1 brcm4330 integration

Postby PLyttle » Fri Jun 27, 2014 1:27 pm

@ kmihelich
My post crossed yours, sorry for that.

I fully agree with you. I wonder sometimes which part of "development board" is unclear.
You guys do a great job of maintaining stuff that Linus himself deemed to be unmaintainable.

No matter what you do, there is always somebody who will whine about it, like they are entitled to it.

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

Re: WandBoard rev C1 brcm4330 integration

Postby kmihelich » Fri Jun 27, 2014 2:12 pm

If it's just a matter of checking a GPIO, it won't be difficult at all to check that and set the appropriate dtb to load.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: WandBoard rev C1 brcm4330 integration

Postby PLyttle » Sat Jun 28, 2014 2:58 pm

Continuing this project I now got bluetooth to work too.

What we have here is a genuine error in the device tree; the UART3 pins are assigned wrong!

here is the patch:
$this->bbcode_second_pass_code('', '--- arch/arm/boot/dts/imx6qdl.dtsi.ORIG 2014-06-28 16:25:14.325424485 +0200
+++ arch/arm/boot/dts/imx6qdl.dtsi 2014-06-28 16:27:51.485424504 +0200
@@ -1512,9 +1512,9 @@
uart3 {
pinctrl_uart3_1: uart3grp-1 {
fsl,pins = <
- MX6QDL_PAD_SD4_CLK__UART3_RX_DATA 0x1b0b1
- MX6QDL_PAD_SD4_CMD__UART3_TX_DATA 0x1b0b1
- MX6QDL_PAD_EIM_D30__UART3_CTS_B 0x1b0b1
+ MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
+ MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
+ MX6QDL_PAD_EIM_D23__UART3_CTS_B 0x1b0b1
MX6QDL_PAD_EIM_EB3__UART3_RTS_B 0x1b0b1
>;
};
')

This patch is also necessary for rev.B1 and for single, dual and quad.

Apply this patch and the package "firmware-brcm43xx" works out of the box.

success all

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

Re: WandBoard rev C1 brcm4330 integration

Postby kmihelich » Sat Jun 28, 2014 3:16 pm

What needs to happen for the first dtsi patch is something along the lines of converting the board dts's over to dtsi's that have the common bits between the two revs, then make new board dts's that include those dtsi's and only have the changed pieces from the imx6qdl-wandboard.dtsi relevant to each rev. Of course, need to remove those bits from that dtsi as well.

I'm pretty swamped this weekend and then will be traveling for a few days, so I can tackle that when I have time unless you want to take it on.

Summary of what needs to happen..
- imx6qdl-wandboard.dtsi: remove the sections that need changes
- imx6q-wandboard.dts -> .dtsi, any pertinent changes (don't think there are any)
- imx6dl-wandboard.dts -> .dtsi, same
- new imx6(q|dl)-wandboard.dts files that include the renamed dtsi files (which include the main dtsi, so don't need to re-include that), which only populate the structures with the changes from the main dtsi that were removed. There will of course be 4 of these, with a q and dl version for each hardware rev. Original rev should maintain the original dts naming, with the new rev only being differentiated in the name.

That's the cleanest approach I can come up with at the moment, and follows what has been done with other systems.
Arch Linux ARM exists and continues to grow through community support, please donate today!
kmihelich
Developer
 
Posts: 1133
Joined: Tue Jul 20, 2010 6:55 am
Location: aka leming #archlinuxarm

Re: WandBoard rev C1 brcm4330 integration

Postby PLyttle » Sat Jun 28, 2014 3:24 pm

I'll see what I can do, I't my baby at the moment anyway.

No hurry, the really impatient people can fix their systems themselves. Or learn how to, what it is all about anyway.

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

Re: WandBoard rev C1 brcm4330 integration

Postby PLyttle » Sun Jun 29, 2014 1:03 pm

@kmihelich

I sent the requested changes by pm.
Hope it helps.

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


Return to Freescale

Who is online

Users browsing this forum: No registered users and 4 guests