dell_rbu: Resubmitting patch for new Dell BIOS update driver
PATCH 1/1 dell_rbu: Resubmitting patch for new Dell BIOS update driver
This is a resubmit of the patch after incorporating all the inputs from revieweres. This also has a fix where the packets were leaked in the function create_packet line#227.
By making a contribution to this project, I certify that:
The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file.
Thanks,
Abhay Salunke
Software Engineer.
DELL Inc
Documentation/DELL_RBU.txt +92 -0
@@ -0,0 +1,92 @@ +Purpose: +Demonstrate the usage of the DELL_RBU (DELL Remote BIOS Update) driver +for updating BIOS images on Dell hardware. + +Scope: +This document discusses the functionality of the DELL_RBU driver. +This driver is required by BIOS update applications shipped by DELL for updating +BIOS on DELL servers and client systems. + +Overview: +The rbu driver is designed to be running on 2.6 kernel. +This driver is one single dell_rbu.c file (approx 800 lines total). +The BIOS update is done by writing the new BIOS image in to contiguous physical +memory addressable by the BIOS. The user application indicates the BIOS regarding +the update of a fresh image. The BIOS then scans the memory to find the image and +it will then update itself. There are basically two different mechanisms for +writing the BIOS image in to contiguous memory +1> By writing the image to one single shunk of contiguous physical memory. +2> By writing image in to smaller chunks of contiguous physical memory. +The update mechanism is determined by the update application based on the +particular system type. + +Update mechanism using single physical chunk of memory: +The rbu driver on its load time created the following entries in sysfs +/sys/firmware/rbu/rbudatasize +/sys/firmware/rbu/rbudata + +Steps to update the BIOS image: + +1> Set the incoming BIOS image size in the /sys/firmware/rbudatasize file. + + e.g. echo XXXXXX > /sys/firmware/rbudatasize +NOTE: the size specified is always in decimal. + +you can also read back the image size by doing +cat /sys/firmware/rbudatasize + +2> Download the BIOS image by copying the image file to /sys/firmware/rbudata +file. +e.g. cat image.hdr > /sys/firmware/rbudata + +you can also read back the image using +cat /sys/firmware/rbu/rbudata +This is usually helpful in verifying the image downloaded. + +Step#1 results in the driver allocating contiguous physical memory of the size +echoed in to rbudatasize. The subsequent writes to rbudata as described in +step #2 results in the image getting written to the allocated contiguous physical +pages. Repeating step #2 will overwrite the previous data in rbudata file. + +On a driver unload the allocated memory is freed and the rbudatasize file reads 0. +The user should not unload the driver after downloading the new BIOS image for +if it wants to update BIOS with that image. + +The user can overwrite the rbudata file with a new image. The user has to make +sure that the new image size is less than or equal to the image size copied to +the rbudatasize file. +If the new image is grater than the allocated size then only the allocated size +gets copied the rest will not. + +The user can also free the previous BIOS image as follows +echo 0 > /sys/firmware/rbu/rbudatasize + +If the user tries to set the BIOS image size there is a possiblity that the +system may not have enough contiguous physical memory for upadtes, thus the +image allocation will fail. The user the needs to verify this by reading back +the rbudatasize which will be set to 0. + +Update using smaller chunks (packets) of contiguous memory: +The disadvantage of contiguous allocation is that it may not be always possible +to get that size of contiuguous chunk of avaliable physical pages as in most +Linux systems the memory gets fragmented immideately after a reboot. +The update using smaller chunks fixes this issue; it also requires the BIOS on +the system to support this feature; the update application needs to query this +with the BIOS on the system before using this technique. + +The appplication breaks the BIOS image in to small packets; before starting the +update using this technique, the application sets the packetdatasize as follows + +echo XXXXXX > /sys/firmware/packetdatasize +Any writes to /sys/firmware/packetdata results in allocation of contiguous +physical memory of packetdatasize and the data is written to that meomry. +Writing 0 to packetdatasize results in freeing of all packets. +Unloading the driver will also result in freeing up of the allocated packets. + +NOTE: +Afte updating the BIOS image the appplication needs to communicate with the BIOS +for enabling the update on the next reboot. The application can then choose to +reboot the system imideately or not reboot the system and leave up to the user +to do a reboot. + +
drivers/firmware/dell_rbu.c +853 -0
853 lines not on this page · raw message
drivers/firmware/Kconfig +12 -0
@@ -58,4 +58,16 @@ 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 n + 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 regardign 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
@@ -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
Quoted 3 lines · Abhay Salunke
This is a resubmit of the patch after incorporating all the inputs from revieweres. This also has a fix where the packets were leaked in the function
create_packetline#227.
You did not address the issues I had with your use of binary sysfs files for all file types. Please fix that up.
Also, what's wrong with using the existing firmware interface in the kernel?
thanks,
greg k-h