mdev not loading firmware for marvel chip

Denys Vlasenko vda.linux at googlemail.com
Tue May 27 19:34:48 UTC 2008


On Tuesday 27 May 2008 20:48, Ram kumar wrote:
> hi,
>       Iam trying to make mdev load the firmware for my embedded platform.I
> have cross compiled busybox-1.10.1 to run on my AT91SAM9260 eval kit.I also
> have a running linux kernel 2.6.24.Now when i interface a Marvell wifi SDIO
> card in to the SDIO slot.The kernel recognizes the SDIO card but it is
> unable to load the firmware.

Can you elaborate? Howplug upload is rather straightforwardly coded:

                /* Hotplug:
                 * env ACTION=... DEVPATH=... mdev
                 * ACTION can be "add" or "remove"
                 * DEVPATH is like "/block/sda" or "/class/input/mice"
                 */
                action = getenv("ACTION");
                env_path = getenv("DEVPATH");
                if (!action || !env_path)
                        bb_show_usage();

                snprintf(temp, PATH_MAX, "/sys%s", env_path);
                if (!strcmp(action, "remove"))
                        make_device(temp, 1);
                else if (!strcmp(action, "add")) {
                        make_device(temp, 0);

                        if (ENABLE_FEATURE_MDEV_LOAD_FIRMWARE) {
                                char *fw = getenv("FIRMWARE");
                                if (fw)
                                        load_firmware(fw, temp);
                        }
                }

and load_firmware() does this:

/* For the full gory details, see linux/Documentation/firmware_class/README
 *
 * Firmware loading works like this:
 * - kernel sets FIRMWARE env var
 * - userspace checks /lib/firmware/$FIRMWARE
 * - userspace waits for /sys/$DEVPATH/loading to appear
 * - userspace writes "1" to /sys/$DEVPATH/loading
 * - userspace copies /lib/firmware/$FIRMWARE into /sys/$DEVPATH/data
 * - userspace writes "0" (worked) or "-1" (failed) to /sys/$DEVPATH/loading
 * - kernel loads firmware into device
 */
static void load_firmware(const char *const firmware, const char *const sysfs_path)
{...}

Can you add debug printouts to mdev.c and determine what step doesn't work?

> I think defaultly in desktop linux these 
> firmware loading is handled by udev.But here in my embedded platform i have
> mdev to do that job.
> 
> Please guide me whether i have to apply any patch to make mdev to load the
> firmware ?

mdev had a faw fixes during 1.10.x.

Grab 1.10.2 + http://busybox.net/downloads/fixes-1.10.2/busybox-1.10.2-mdev.patch

> Note:I have the firmware files under /lib/firmware directory.My
> /proc/sys/kernel/hotplug is /sbin/mdev.
--
vda



More information about the busybox mailing list