All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Weber <rjohnweber@gmail.com>
To: "Eric Bénard" <eric@eukrea.com>
Cc: "meta-freescale@yoctoproject.org"
	<meta-freescale@yoctoproject.org>,
	poky@yoctoproject.org
Subject: Re: [meta-freescale] Firmware loading
Date: Wed, 06 Mar 2013 15:56:03 -0600	[thread overview]
Message-ID: <5137BB73.2050607@gmail.com> (raw)
In-Reply-To: <20130306224808.6efe1351@e6520eb>

Hi Eric,

On 3/6/13 3:48 PM, Eric Bénard wrote:
> Hi John,
>
> Le Wed, 06 Mar 2013 09:06:36 -0600,
> John Weber <rjohnweber@gmail.com> a écrit :
>
>> I'm attempting to configure Linux to load firmware for a Broadcom SDIO Wifi chip
>> (BCM4329) onto an i.MX6-based board.
>>
>> Here is my main question - How is firmware supposed to be loaded within the
>> paradigm of a Yocto/Poky-built system?  Any insight and guidance is appreciated.
>>
>> What I've done so far, and what I've discovered:
>>
>> I've incorporated the driver into the kernel (backported from an upstream kernel
>> rev), and removed the staging drivers present in 3.0.35.  It is built-in at the
>> moment (not a module) and this is the error that I'm getting when it times-out
>> loading firmware:
>>
>> brcmfmac: brcmf_sdbrcm_download_code_file: Fail to request firmware -2
>> brcmfmac: _brcmf_sdbrcm_download_firmware: dongle image file download failed
>> brcmfmac: brcmf_bus_start: brcmf_sdbrcm_bus_init failed -1
>>
>> The error code indicates that it cannot load firmware because it can't find the
>> firmware file.
>>
>> I've taken care to put the firmware in /lib/firmware/brcm (2 files).  The driver
>> hardcodes a relative path filename to the firmware files and I've made sure that
>> they are the same.
>>
>> I've researched the firmware request process for the kernel.  My understanding
>> is that the process looks like this:
>> 1) driver requests firmware file
>> 2) kernel opens up a special set of files in sysfs (/sys/class/firmware/xxx
>> where xxx is the device name)
>> 3) kernel signals udev to load firmware, giving it the filename and the device name
>> 4) udev, through its rules, locates the firmware file for the device and writes
>> it to the special file in sysfs
>>
> if the driver is in the kernel it may not have the ability to require
> the firmware from the file system as the file system may not yet be
> mounted which can explain why you get the timeout.
> You can check if you are in that case if you get the timeout log
> before getting the log saying the filesystem is mounted.
>
> To workaround that, you can integrate the firmware in the kernel image
> by setting CONFIG_EXTRA_FIRMWARE="path/to/your/firmware" in the kernel
> config, so that your driver can get its firmware (or you can compile
> your driver as a module and load it after the file system is mounted).
>
> Eric
>

Thanks for the help.  I've since broken the driver out of the kernel and 
modprobed it with the same results.  This allows me to start udevadm to see some 
debug output from udev, but it still fails.  I've manually created a firmware 
helper script as well, and that's not even being executed at the moment.

It just seems like this kind of thing is already being done as the i.MX6 vpu 
firmware is needed (not being loaded into the filesystem now, but that is a 
different issue), as well as other machines use atheros wifi modules.  This 
seems that I'm missing something.

John


WARNING: multiple messages have this Message-ID (diff)
From: John Weber <rjohnweber@gmail.com>
To: "Eric Bénard" <eric@eukrea.com>
Cc: "meta-freescale@yoctoproject.org"
	<meta-freescale@yoctoproject.org>,
	poky@yoctoproject.org
Subject: Re: Firmware loading
Date: Wed, 06 Mar 2013 15:56:03 -0600	[thread overview]
Message-ID: <5137BB73.2050607@gmail.com> (raw)
In-Reply-To: <20130306224808.6efe1351@e6520eb>

Hi Eric,

On 3/6/13 3:48 PM, Eric Bénard wrote:
> Hi John,
>
> Le Wed, 06 Mar 2013 09:06:36 -0600,
> John Weber <rjohnweber@gmail.com> a écrit :
>
>> I'm attempting to configure Linux to load firmware for a Broadcom SDIO Wifi chip
>> (BCM4329) onto an i.MX6-based board.
>>
>> Here is my main question - How is firmware supposed to be loaded within the
>> paradigm of a Yocto/Poky-built system?  Any insight and guidance is appreciated.
>>
>> What I've done so far, and what I've discovered:
>>
>> I've incorporated the driver into the kernel (backported from an upstream kernel
>> rev), and removed the staging drivers present in 3.0.35.  It is built-in at the
>> moment (not a module) and this is the error that I'm getting when it times-out
>> loading firmware:
>>
>> brcmfmac: brcmf_sdbrcm_download_code_file: Fail to request firmware -2
>> brcmfmac: _brcmf_sdbrcm_download_firmware: dongle image file download failed
>> brcmfmac: brcmf_bus_start: brcmf_sdbrcm_bus_init failed -1
>>
>> The error code indicates that it cannot load firmware because it can't find the
>> firmware file.
>>
>> I've taken care to put the firmware in /lib/firmware/brcm (2 files).  The driver
>> hardcodes a relative path filename to the firmware files and I've made sure that
>> they are the same.
>>
>> I've researched the firmware request process for the kernel.  My understanding
>> is that the process looks like this:
>> 1) driver requests firmware file
>> 2) kernel opens up a special set of files in sysfs (/sys/class/firmware/xxx
>> where xxx is the device name)
>> 3) kernel signals udev to load firmware, giving it the filename and the device name
>> 4) udev, through its rules, locates the firmware file for the device and writes
>> it to the special file in sysfs
>>
> if the driver is in the kernel it may not have the ability to require
> the firmware from the file system as the file system may not yet be
> mounted which can explain why you get the timeout.
> You can check if you are in that case if you get the timeout log
> before getting the log saying the filesystem is mounted.
>
> To workaround that, you can integrate the firmware in the kernel image
> by setting CONFIG_EXTRA_FIRMWARE="path/to/your/firmware" in the kernel
> config, so that your driver can get its firmware (or you can compile
> your driver as a module and load it after the file system is mounted).
>
> Eric
>

Thanks for the help.  I've since broken the driver out of the kernel and 
modprobed it with the same results.  This allows me to start udevadm to see some 
debug output from udev, but it still fails.  I've manually created a firmware 
helper script as well, and that's not even being executed at the moment.

It just seems like this kind of thing is already being done as the i.MX6 vpu 
firmware is needed (not being loaded into the filesystem now, but that is a 
different issue), as well as other machines use atheros wifi modules.  This 
seems that I'm missing something.

John


  reply	other threads:[~2013-03-06 21:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06 15:06 Firmware loading John Weber
2013-03-06 21:18 ` Otavio Salvador
2013-03-06 21:50   ` [meta-freescale] " John Weber
2013-03-06 21:50     ` John Weber
2013-03-06 21:48 ` [meta-freescale] " Eric Bénard
2013-03-06 21:48   ` Eric Bénard
2013-03-06 21:56   ` John Weber [this message]
2013-03-06 21:56     ` John Weber
2013-03-06 22:04     ` [meta-freescale] " Eric Bénard
2013-03-06 22:04       ` Eric Bénard
2013-03-07 16:21       ` [meta-freescale] " John Weber
2013-03-07 16:21         ` John Weber
2013-03-07 17:50         ` [meta-freescale] " John Weber
2013-03-07 17:50           ` John Weber
2013-03-08 12:15           ` Otavio Salvador
2013-03-08 15:35             ` [meta-freescale] " John Weber
2013-03-08 15:35               ` John Weber
2013-03-08 17:36               ` Otavio Salvador
2013-03-12  3:53                 ` [meta-freescale] " John Weber
2013-03-12  3:53                   ` John Weber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5137BB73.2050607@gmail.com \
    --to=rjohnweber@gmail.com \
    --cc=eric@eukrea.com \
    --cc=meta-freescale@yoctoproject.org \
    --cc=poky@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.