Patchwork [meta-fsl-arm-extra] linux-firmware: add support for bcm4329

login
register
mail settings
Submitter John Weber
Date March 16, 2013, 1:45 p.m.
Message ID <1363441542-5300-6-git-send-email-rjohnweber@gmail.com>
Download mbox | patch
Permalink /patch/46277/
State Changes Requested
Delegated to: Otavio Salvador
Headers show

Comments

John Weber - March 16, 2013, 1:45 p.m.
Adds linux-firmware bbappend recipe to provide support for the Broadcom
BCM4329 Wifi device.  Also adds a .txt file for nvram support.

Signed-off-by: John Weber <rjohnweber@gmail.com>
---
 .../linux-firmware/brcmfmac-sdio.txt               |   70 ++++++++++++++++++++
 .../linux-firmware/linux-firmware_git.bbappend     |   28 ++++++++
 2 files changed, 98 insertions(+)
 create mode 100644 recipes-kernel/linux-firmware/linux-firmware/brcmfmac-sdio.txt
 create mode 100644 recipes-kernel/linux-firmware/linux-firmware_git.bbappend
Otavio Salvador - March 16, 2013, 2:31 p.m.
On Sat, Mar 16, 2013 at 10:45 AM, John Weber <rjohnweber@gmail.com> wrote:
> Adds linux-firmware bbappend recipe to provide support for the Broadcom
> BCM4329 Wifi device.  Also adds a .txt file for nvram support.
>
> Signed-off-by: John Weber <rjohnweber@gmail.com>

Thinking about how it was done, I'd say you could do it:

 * Make this to split the binaries but without renaming it

 * Add a new recipe (let's say wandboard-wifi-support) which rdepends
on the binary package and installs the .txt file for nvram as well.

So we avoid to make linux-firmware machine specific. We cannot have
more than one package with same contents in filesystem (without being
different recipe name) so we'd need to complicate it a lot, using the
extra recipe makes it easy.
John Weber - March 17, 2013, 12:40 a.m.
Otavio -

I assume you mean this rename?

+do_install_append() {
+	# Broadcom BCM4329 SDIO
+	cp -r ${D}/lib/firmware/brcm/brcmfmac4329.bin \
+              ${D}/lib/firmware/brcm/brcmfmac-sdio.bin
+	cp -r ${WORKDIR}/brcmfmac-sdio.txt \
+              ${D}/lib/firmware/brcm
+	cp -r ${D}/lib/firmware/LICENCE.broadcom_bcm43xx \
+              ${D}/lib/firmware/brcm
+}

If I do not rename them, then the default kernel module for brcmfmac will not 
find the firmware files because it expects them to be named as above.

 From the driver in the mainline kernel (and also the backported driver, so it 
hasn't changed):

drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c, line 317-320

#define BRCMF_SDIO_FW_NAME      "brcm/brcmfmac-sdio.bin"
#define BRCMF_SDIO_NV_NAME      "brcm/brcmfmac-sdio.txt"
MODULE_FIRMWARE(BRCMF_SDIO_FW_NAME);
MODULE_FIRMWARE(BRCMF_SDIO_NV_NAME);

I'll create a recipe to populate the nvram file separately from the kernel 
firmware.  I can also do the rename there - is that what you are suggesting?  If 
that is the case, then everyone that wants to use the brcmfmac driver will need 
to create their own recipe to do the copy (or a patch to the kernel to rename 
the files that the driver expects).

In the end, I'll submit 2 patches instead of this 1 patch:
- linux-firmware_git.bbappend - which will split the binaries only.
- wandboard-wifi-support.bb - which will add the nvram file (.txt) and rename 
the binaries as the driver expects.

Then the image/machine/conf should only have to include the 
wandboard-wifi-support recipe.  I really don't think that renaming the .bin file 
makes the linux-firmware recipe machine-specific, but I think it should be done 
in the packages-split step when it is filtering out the bcm4329-specific files 
for inclusion into the image.  That way, the user through the selection of 
linux-firmware-bcm4329 definitely gets the bcm4329 firmware file.

John


On 3/16/13 9:31 AM, Otavio Salvador wrote:
> On Sat, Mar 16, 2013 at 10:45 AM, John Weber <rjohnweber@gmail.com> wrote:
>> Adds linux-firmware bbappend recipe to provide support for the Broadcom
>> BCM4329 Wifi device.  Also adds a .txt file for nvram support.
>>
>> Signed-off-by: John Weber <rjohnweber@gmail.com>
>
> Thinking about how it was done, I'd say you could do it:
>
>   * Make this to split the binaries but without renaming it
>
>   * Add a new recipe (let's say wandboard-wifi-support) which rdepends
> on the binary package and installs the .txt file for nvram as well.
>
> So we avoid to make linux-firmware machine specific. We cannot have
> more than one package with same contents in filesystem (without being
> different recipe name) so we'd need to complicate it a lot, using the
> extra recipe makes it easy.
>
>

Patch

diff --git a/recipes-kernel/linux-firmware/linux-firmware/brcmfmac-sdio.txt b/recipes-kernel/linux-firmware/linux-firmware/brcmfmac-sdio.txt
new file mode 100644
index 0000000..53e4bba
--- /dev/null
+++ b/recipes-kernel/linux-firmware/linux-firmware/brcmfmac-sdio.txt
@@ -0,0 +1,70 @@ 
+# bcm4329 NVRAM file for Wandboard Dual
+# $Copyright (C) 2008 Broadcom Corporation$
+# $id$
+
+sromrev=3
+vendid=0x14e4
+devid=0x432f
+boardtype=0x53e
+
+boardrev=0x41
+
+#boardflags=0x1200
+boardflags=0x200
+
+# Specify the xtalfreq if it is otherthan 38.4MHz
+xtalfreq=37400
+
+aa2g=3
+aa5g=0
+
+ag0=255
+#tri2g=0x64
+
+# 11g paparams
+pa0b0=5542,5542,5542
+pa0b1=64244,64244,64244
+pa0b2=65202,65202,65202
+
+pa0itssit=62
+pa0maxpwr=74
+opo=0
+mcs2gpo0=0x6666
+mcs2gpo1=0x6666
+
+# 11g rssi params
+rssismf2g=0xa,0xa,0xa
+rssismc2g=0xb,0xb,0xb
+rssisav2g=0x3,0x3,0x3
+bxa2g=0
+
+# country code
+ccode=ALL
+cctl=0x0
+cckdigfilttype=0
+ofdmdigfilttype=1
+
+rxpo2g=0
+
+boardnum=1
+macaddr=00:90:4c:c5:00:34
+
+# xtal pu and pd time control variable
+# pu time is driver default (0x1501)
+#r13t=0x1501
+
+#######
+nocrc=1
+
+#for mfgc
+otpimagesize=182
+
+# sdio extra configs
+hwhdr=0x05ffff031030031003100000
+
+#This generates empty F1, F2 and F3 tuple chains, and may be used if the host SDIO stack does not require the standard tuples.
+#RAW1=80 02 fe ff
+
+#This includes the standard FUNCID and FUNCE tuples in the F1, F2, F3 and common CIS.
+RAW1=80 32 fe 21 02 0c 00 22 2a 01 01 00 00 c5 0 e6 00 00 00 00 00 40 00 00 ff ff 80 00 00 00 00 00 00 00 00 00 00 c8 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 20 04 D0 2 29 43 21 02 0c 00 22 04 00 20 00 5A
+nvramver=4.218.214.0
diff --git a/recipes-kernel/linux-firmware/linux-firmware_git.bbappend b/recipes-kernel/linux-firmware/linux-firmware_git.bbappend
new file mode 100644
index 0000000..47cf682
--- /dev/null
+++ b/recipes-kernel/linux-firmware/linux-firmware_git.bbappend
@@ -0,0 +1,28 @@ 
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}"
+
+PRINC := "${@int(PRINC) + 1}"
+
+SRC_URI_append = " \
+   file://brcmfmac-sdio.txt \
+"
+LIC_FILES_CHKSUM += "file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc\
+"
+
+do_install_append() {
+	# Broadcom BCM4329 SDIO
+	cp -r ${D}/lib/firmware/brcm/brcmfmac4329.bin \
+              ${D}/lib/firmware/brcm/brcmfmac-sdio.bin
+	cp -r ${WORKDIR}/brcmfmac-sdio.txt \ 
+              ${D}/lib/firmware/brcm
+	cp -r ${D}/lib/firmware/LICENCE.broadcom_bcm43xx \ 
+              ${D}/lib/firmware/brcm
+}
+
+PACKAGES =+ "${PN}-bcm4329"
+
+LICENSE_${PN}-bcm4329 = "Firmware-bcm4329"
+FILES_${PN}-bcm4329 = " \
+  /lib/firmware/brcm/brcmfmac-sdio.bin \
+  /lib/firmware/brcm/brcmfmac-sdio.txt \
+  /lib/firmware/brcm/LICENCE.broadcom_bcm43xx \
+"