what does CMD_SET_BOOT2_VER ?
Dan Williams
dcbw at redhat.com
Thu Dec 6 05:25:56 EST 2007
On Thu, 2007-12-06 at 09:56 +0100, Holger Schurig wrote:
> main.c currently does this:
>
> /* Disable mesh autostart */
> if (priv->mesh_dev) {
> memset(&mesh_access, 0, sizeof(mesh_access));
> mesh_access.data[0] = cpu_to_le32(0);
> ret = lbs_prepare_and_send_command(priv,
> CMD_MESH_ACCESS,
> CMD_ACT_MESH_SET_AUTOSTART_ENABLED,
> CMD_OPTION_WAITFORRSP, 0, (void *)&mesh_access);
> if (ret) {
> ret = -1;
> goto done;
> }
> priv->mesh_autostart_enabled = 0;
> }
>
> /* Set the boot2 version in firmware */
> ret = lbs_prepare_and_send_command(priv, CMD_SET_BOOT2_VER,
> 0, CMD_OPTION_WAITFORRSP, 0, NULL);
>
> ret = 0;
>
>
> For my firmware (CF card), this simply generates an error. Which
> is then thrown away ("ret = x(); ret = 0;" ...).
>
> However, my real question is: isn't BOOT2 a purely USB specific
> thing? If yes, than this belongs into if_usb.c.
Possibly, yes. At this point the command is implemented only for the
usb8388. But think of "Boot2" like the helper firmware for SD or CF
cards. The real firmware replaces the helper image in the memory of
the 838x after you load it. On OLPC the helper firmware is stored in
SPI flash on the libertas module itself since it needs to know how to
talk USB before the host can tell it to do anything.
The problem is that after the helper (boot2) firmware has been replaced
by the real firmware, at least on USB, the real firmware has no idea
what version the helper firmware was. This is fine until you start
suspending and resuming, because after the Linux kernel has disconnected
the libertas module from the bus for suspend and tried to reconnect for
resume, it has lost the original USB bcdDevice number. But guess what?
The real firmware doesn't know what the bcdDevice was that the helper
firmware provided to the Linux kernel originally.
But you're right, this is currently USB specific (and specific to the
OLPC firmware though Marvell may merge this to their main firmware
branch, who knows) and should likely be moved to if_usb.c.
Dan
More information about the libertas-dev
mailing list