Skip to contentSkip to conversation

dell_rbu: Resubmitting patch for new Dell BIOS update driver

RFC PATCH In review Abhay Salunke 3 participants 4 messages Jun 29, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 dell_rbu: Resubmitting patch for new Dell BIOS update driver

This patch adds a new function to firmware_calss.c request_firmware_nowait_nohotplug . The dell_rbu driver uses this call to create entries in /sys/class/firmware.

Thanks
Abhay

Documentation/dell_rbu.txt +72 -0
diff -uprN linux-2.6.11.11.orig/Documentation/dell_rbu.txt linux-2.6.11.11.new/Documentation/dell_rbu.txt
@@ -0,0 +1,72 @@
+Purpose:
+Demonstrate the usage of the new open sourced rbu (Remote BIOS Update) driver
+for updating BIOS images on Dell servers and desktops.
+
+Scope:
+This document discusses the functionality of the rbu driver only.
+It does not cover the support needed from aplications to enable the BIOS to
+update itself with the image downloaded in to the memory.
+
+Overview:
+This driver enables userspace applications to update the BIOS on Dell servers
+(starting from servers sold since 1999), desktops and notebooks (starting
+from those sold in 2005).
+
+The driver supports BIOS update using the monilothic image and packetized
+image methods. In case of moniolithic the driver allocates a contiguous chunk
+of physical pages having the BIOS image. In case of packetized the app
+using the driver breaks the image in to packets of fixed sizes and the driver
+would place each packet in contiguous physical memory. The driver also
+maintains a link list of packets for reading them back.
+If the dell_rbu driver is unloaded all the allocated memory is freed.
+
+The rbu driver needs to have an application which will inform the BIOS to
+enable the update in the next system reboot.
+
+The user should not unload the rbu driver after downloading the BIOS image
+or updating.
+
+The driver load creates the following directories under the /sys file system.
+/sys/class/firmware/dell_rbu/loading 
+/sys/class/firmware/dell_rbu/data
+/sys/devices/platform/dell_rbu/image_type
+/sys/devices/platform/dell_rbu/data
+
+The driver supports two types of update mechanism; monolithic and packetized.
+These update mechanism depends upon the BIOS currently running on the system.
+Most of the Dell systems support a monolithic update where the BIOS image is 
+copied to a single contiguous block of physical memory. 
+In case of packet mechanism the single memory can be broken in smaller chuks
+of contiguous memory and the BIOS image is scattered in these packets.
+
+By default the driver uses monolithic memory for the update type. This can be
+changed to contiguous during the driver load time by specifying the load
+parameter image_type=packet.  This can also be changed later as below
+echo "packet" > /sys/devices/platform/dell_rbu/image_type 
+
+Do the steps below to download the BIOS image.
+1) echo 1 > /sys/class/firmware/dell_rbu/loading
+2) cp bios_image.hdr /sys/class/firmware/dell_rbu/data
+3) echo 0 > /sys/class/firmware/dell_rbu/loading
+
+The /sys/class/firmware/dell_rbu/ entries will remain till the following is
+done. 
+echo -1 > /sys/class/firmware/dell_rbu/loading
+
+Until this step is completed the driver cannot be unloaded.
+
+Also the driver provides /sys/devices/platform/dell_rbu/data readonly file to
+read back the image downloaded. This is useful in case of packet update 
+mechanism where the above steps 1,2,3 will repeated for every packet. 
+By reading the /sys/devices/platform/dell_rbu/data file all packet data 
+downloaded can be verified in a single file. 
+The packets are arranged in this file one after the other in a FIFO order.
+
+NOTE:
+This driver requires a patch for firmware_class.c which has the addition
+of request_firmware_nowait_nohotplug function to wortk
+Also after updating the BIOS image an user mdoe application neeeds to execute
+code which message the BIOS update request to the BIOS. So on the next reboot
+the BIOS knows about the new image downloaded and it updates it self.
+Also don't unload the rbu drive if the image has to be updated.
+
drivers/base/firmware_class.c +102 -47

224 lines not on this page · raw message

drivers/firmware/dell_rbu.c +627 -0

627 lines not on this page · raw message

drivers/firmware/Kconfig +11 -0
diff -uprN linux-2.6.11.11.orig/drivers/firmware/Kconfig linux-2.6.11.11.new/drivers/firmware/Kconfig
@@ -58,4 +58,15 @@ config EFI_PCDP
 
 	  See <http://www.dig64.org/specifications/DIG64_HCDPv20_042804.pdf>
 
+config DELL_RBU
+	tristate "BIOS update support for DELL systems via sysfs"
+	default y
+	select FW_LOADER
+	help
+	 Say Y if you want to have the option of updating the BIOS for your
+	 DELL system. Note you need a supporting application to comunicate
+	 with the BIOS regardin the new image for the image update to
+	 take effect.
+	 See <file:Documentation/dell_rbu.txt> for more details on the driver.
+
 endmenu
drivers/firmware/Makefile +1 -0
diff -uprN linux-2.6.11.11.orig/drivers/firmware/Makefile linux-2.6.11.11.new/drivers/firmware/Makefile
@@ -4,3 +4,4 @@
 obj-$(CONFIG_EDD)             	+= edd.o
 obj-$(CONFIG_EFI_VARS)		+= efivars.o
 obj-$(CONFIG_EFI_PCDP)		+= pcdp.o
+obj-$(CONFIG_DELL_RBU)          += dell_rbu.o
#1 lore raw
Quoted 2 lines · Abhay Salunke

This patch adds a new function to firmware_calss.c request_firmware_nowait_nohotplug . The dell_rbu driver uses this call to create entries in /sys/class/firmware.

No, this patch is your whole driver and the firmware changes all together. Please split this up into at least two different patches so we can review them easier.

thanks,

greg k-h

#2 lore raw
In reply to Abhay Salunke
Quoted 1 line · Abhay Salunke

diff -uprN linux-2.6.11.11.orig/Documentation/dell_rbu.txt linux-2.6.11.11.ne

w/Documentation/dell_rbu.txt

Quoted 1 line

--- linux-2.6.11.11.orig/Documentation/dell_rbu.txt 1969-12-31 18:00:00.000

000000 -0600

Quoted 1 line

+++ linux-2.6.11.11.new/Documentation/dell_rbu.txt 2005-06-29 15:18:52.000

000000 -0500

Documentation/dell_rbu.txt line 24

Quoted 4 lines
Documentation/dell_rbu.txt +2 -0
@@ -0,0 +1,72 @@
 
+The rbu driver needs to have an application which will inform the BIOS to
+enable the update in the next system reboot.

And the API for the userspace application to do that is? There's a comment in patch to drivers/firmware/dell_rbu.c that says:

* contiguous and packetized. Both these methods still require having some
* application to set the CMOS bit indicating the BIOS to update itself
* after a reboot.

but no hint *which* CMOS bit needs to be tweaked - is the drivers/char/nvram.c driver sufficient if you know the bit/byte number to set?

#3 lore raw
In reply to Abhay Salunke

Documentation/dell_rbu.txt line 13

Quoted 12 lines · Abhay Salunke

This patch adds a new function to firmware_calss.c request_firmware_nowait_nohotplug . The dell_rbu driver uses this call to create entries in /sys/class/firmware.

Thanks
Abhay
diff -uprN linux-2.6.11.11.orig/Documentation/dell_rbu.txt linux-2.6.11.11.new/Documentation/dell_rbu.txt

Documentation/dell_rbu.txt +3 -0
+This driver enables userspace applications to update the BIOS on Dell servers
+(starting from servers sold since 1999), desktops and notebooks (starting
+from those sold in 2005).

I may be blind, but I'm not seeing where this code makes a check - what happens if I try to run this on my 3-year-old Latitude laptop?