From: Patrick Mansfield <patmans@us.ibm.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: firmware and initrd [was Re: [ANNOUNCE] yaird, a mkinitrd based on hotplug concepts]
Date: Fri, 25 Feb 2005 23:29:11 +0000 [thread overview]
Message-ID: <20050225232911.GA11012@us.ibm.com> (raw)
In-Reply-To: <20050224224343.B7339@banaan.localdomain>
On Thu, Feb 24, 2005 at 10:43:43PM +0100, Erik van Konijnenburg wrote:
> Some thoughts on how this should work.
>
> - The easy case is where everything is modular. If there's a dependency
> on firmware_class, bingo, we need firmware support.
But not necessarily in the initrd.
> - This does not cover the case where firmware_class or caller is
> compiled into the kernel. Note that if a caller is compiled in,
> firmware_class must also be compiled in. We track kernel defines;
> bingo if CONFIG_FW_LOADER=y.
Do you mean if CONFIG_FW_LOADER=y, we don't support firmware loading in
initrd? Why not? Is driver init happening before initrd is ready?
There could be an option to the initrd generator to add firmware files, or
to behave as if driver X were built as a module (depending on if or how you
figure out firmware to driver mappings).
> - Firmware loading works as follows: the device driver invokes
> request_firmware, which creates a new class in sysfs. request_firmware
> then calls hotplug with FIRMWARE set to the desired file, and waits
> for hotplug to return. Hotplug cats the requested firmware file to a
> 'data' file in /sysfs/class/firmware/... and uses a 'loading' file
> next to it to indicate when it's done. Back in the kernel, the 'data'
> and 'loading' files have callbacks that let the device driver upload
> the firmware to the device.
Yes.
>
> - Thus, any boot image that requires firmware also requires hotplug.
> At the moment, Debian mkinitrd has no hotplug, and Fedora FC3 mkinitrd
> has a limited version, which does udev but no hotplug.agent.
>
> - Interpreting the modules to determine which particular firmware
> file is needed (MODULE_FIRMWARE) is error prone: there are too many
> opportunities for the driver author to come up with creative ways to
> break the interpretation.
The driver writers/maintainers already have to specify the name of the
firmware file somewhere in the driver, it is not much more work to add a
matching MODULE_FIRMWARE. We can also have multiple MODULE_FIRMWARE lines
in one module.
> - On the other hand, it would be reliable and fairly simple to put a
> wrapper around the firmware file and annotate it with the devices it
> supports. (For example, put it in mime/multi-part format with base64
> encoding for the payload, plus some patterns in the header modeled
> on modules.alias. Or wrap it in XML and claim SOAP conformance.)
Or just add to some sort of modules.firmwaremap file? Then no wrappers
around the firmware files are needed, but the rpm or installer pieces need
changes. I still like a MODULE_FIRMWARE so such a file can be
auto-generated (or just dump modinfo output in the ya/mkinitrd).
Maybe under /lib/firmware (I don't know if that is appropriate). It would
only be used by the initrd generator.
For qlogic, we would have some lines like:
qla2100.ko ql2100_fw.bin
qla2200.ko ql2100_fw.bin
qla2300.ko ql2300_fw.bin
qla2300.ko ql2322_fw.bin
> - On the third hand, if a hardware vendor went to the trouble of
> supporting such annotations, what he would achieve is a smaller boot
> image for everybody *except* the people who actually bought his device.
> I can't imagine it will be easy to find budget for such an exercise.
For qlogic, they have multiple devices, so it would help them out.
Andrew V: BTW, what are the sizes of qlogic firmware files?
-- Patrick Mansfield
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2005-02-25 23:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-24 21:43 firmware and initrd [was Re: [ANNOUNCE] yaird, a mkinitrd based on hotplug concepts] Erik van Konijnenburg
2005-02-25 23:29 ` Patrick Mansfield [this message]
2005-02-27 11:32 ` Erik van Konijnenburg
2005-03-04 11:16 ` Roman Kagan
2005-03-05 15:10 ` Erik van Konijnenburg
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=20050225232911.GA11012@us.ibm.com \
--to=patmans@us.ibm.com \
--cc=linux-hotplug@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).