xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/dell_rbu.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun=========================================
2*4882a593SmuzhiyunDell Remote BIOS Update driver (dell_rbu)
3*4882a593Smuzhiyun=========================================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunPurpose
6*4882a593Smuzhiyun=======
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunDocument demonstrating the use of the Dell Remote BIOS Update driver
9*4882a593Smuzhiyunfor updating BIOS images on Dell servers and desktops.
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunScope
12*4882a593Smuzhiyun=====
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunThis document discusses the functionality of the rbu driver only.
15*4882a593SmuzhiyunIt does not cover the support needed from applications to enable the BIOS to
16*4882a593Smuzhiyunupdate itself with the image downloaded in to the memory.
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunOverview
19*4882a593Smuzhiyun========
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunThis driver works with Dell OpenManage or Dell Update Packages for updating
22*4882a593Smuzhiyunthe BIOS on Dell servers (starting from servers sold since 1999), desktops
23*4882a593Smuzhiyunand notebooks (starting from those sold in 2005).
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunPlease go to  http://support.dell.com register and you can find info on
26*4882a593SmuzhiyunOpenManage and Dell Update packages (DUP).
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunLibsmbios can also be used to update BIOS on Dell systems go to
29*4882a593Smuzhiyunhttps://linux.dell.com/libsmbios/ for details.
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunDell_RBU driver supports BIOS update using the monolithic image and packetized
32*4882a593Smuzhiyunimage methods. In case of monolithic the driver allocates a contiguous chunk
33*4882a593Smuzhiyunof physical pages having the BIOS image. In case of packetized the app
34*4882a593Smuzhiyunusing the driver breaks the image in to packets of fixed sizes and the driver
35*4882a593Smuzhiyunwould place each packet in contiguous physical memory. The driver also
36*4882a593Smuzhiyunmaintains a link list of packets for reading them back.
37*4882a593Smuzhiyun
38*4882a593SmuzhiyunIf the dell_rbu driver is unloaded all the allocated memory is freed.
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunThe rbu driver needs to have an application (as mentioned above) which will
41*4882a593Smuzhiyuninform the BIOS to enable the update in the next system reboot.
42*4882a593Smuzhiyun
43*4882a593SmuzhiyunThe user should not unload the rbu driver after downloading the BIOS image
44*4882a593Smuzhiyunor updating.
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunThe driver load creates the following directories under the /sys file system::
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun	/sys/class/firmware/dell_rbu/loading
49*4882a593Smuzhiyun	/sys/class/firmware/dell_rbu/data
50*4882a593Smuzhiyun	/sys/devices/platform/dell_rbu/image_type
51*4882a593Smuzhiyun	/sys/devices/platform/dell_rbu/data
52*4882a593Smuzhiyun	/sys/devices/platform/dell_rbu/packet_size
53*4882a593Smuzhiyun
54*4882a593SmuzhiyunThe driver supports two types of update mechanism; monolithic and packetized.
55*4882a593SmuzhiyunThese update mechanism depends upon the BIOS currently running on the system.
56*4882a593SmuzhiyunMost of the Dell systems support a monolithic update where the BIOS image is
57*4882a593Smuzhiyuncopied to a single contiguous block of physical memory.
58*4882a593Smuzhiyun
59*4882a593SmuzhiyunIn case of packet mechanism the single memory can be broken in smaller chunks
60*4882a593Smuzhiyunof contiguous memory and the BIOS image is scattered in these packets.
61*4882a593Smuzhiyun
62*4882a593SmuzhiyunBy default the driver uses monolithic memory for the update type. This can be
63*4882a593Smuzhiyunchanged to packets during the driver load time by specifying the load
64*4882a593Smuzhiyunparameter image_type=packet.  This can also be changed later as below::
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun	echo packet > /sys/devices/platform/dell_rbu/image_type
67*4882a593Smuzhiyun
68*4882a593SmuzhiyunIn packet update mode the packet size has to be given before any packets can
69*4882a593Smuzhiyunbe downloaded. It is done as below::
70*4882a593Smuzhiyun
71*4882a593Smuzhiyun	echo XXXX > /sys/devices/platform/dell_rbu/packet_size
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunIn the packet update mechanism, the user needs to create a new file having
74*4882a593Smuzhiyunpackets of data arranged back to back. It can be done as follows:
75*4882a593SmuzhiyunThe user creates packets header, gets the chunk of the BIOS image and
76*4882a593Smuzhiyunplaces it next to the packetheader; now, the packetheader + BIOS image chunk
77*4882a593Smuzhiyunadded together should match the specified packet_size. This makes one
78*4882a593Smuzhiyunpacket, the user needs to create more such packets out of the entire BIOS
79*4882a593Smuzhiyunimage file and then arrange all these packets back to back in to one single
80*4882a593Smuzhiyunfile.
81*4882a593Smuzhiyun
82*4882a593SmuzhiyunThis file is then copied to /sys/class/firmware/dell_rbu/data.
83*4882a593SmuzhiyunOnce this file gets to the driver, the driver extracts packet_size data from
84*4882a593Smuzhiyunthe file and spreads it across the physical memory in contiguous packet_sized
85*4882a593Smuzhiyunspace.
86*4882a593Smuzhiyun
87*4882a593SmuzhiyunThis method makes sure that all the packets get to the driver in a single operation.
88*4882a593Smuzhiyun
89*4882a593SmuzhiyunIn monolithic update the user simply get the BIOS image (.hdr file) and copies
90*4882a593Smuzhiyunto the data file as is without any change to the BIOS image itself.
91*4882a593Smuzhiyun
92*4882a593SmuzhiyunDo the steps below to download the BIOS image.
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun1) echo 1 > /sys/class/firmware/dell_rbu/loading
95*4882a593Smuzhiyun2) cp bios_image.hdr /sys/class/firmware/dell_rbu/data
96*4882a593Smuzhiyun3) echo 0 > /sys/class/firmware/dell_rbu/loading
97*4882a593Smuzhiyun
98*4882a593SmuzhiyunThe /sys/class/firmware/dell_rbu/ entries will remain till the following is
99*4882a593Smuzhiyundone.
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun::
102*4882a593Smuzhiyun
103*4882a593Smuzhiyun	echo -1 > /sys/class/firmware/dell_rbu/loading
104*4882a593Smuzhiyun
105*4882a593SmuzhiyunUntil this step is completed the driver cannot be unloaded.
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunAlso echoing either mono, packet or init in to image_type will free up the
108*4882a593Smuzhiyunmemory allocated by the driver.
109*4882a593Smuzhiyun
110*4882a593SmuzhiyunIf a user by accident executes steps 1 and 3 above without executing step 2;
111*4882a593Smuzhiyunit will make the /sys/class/firmware/dell_rbu/ entries disappear.
112*4882a593Smuzhiyun
113*4882a593SmuzhiyunThe entries can be recreated by doing the following::
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun	echo init > /sys/devices/platform/dell_rbu/image_type
116*4882a593Smuzhiyun
117*4882a593Smuzhiyun.. note:: echoing init in image_type does not change its original value.
118*4882a593Smuzhiyun
119*4882a593SmuzhiyunAlso the driver provides /sys/devices/platform/dell_rbu/data readonly file to
120*4882a593Smuzhiyunread back the image downloaded.
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun.. note::
123*4882a593Smuzhiyun
124*4882a593Smuzhiyun   After updating the BIOS image a user mode application needs to execute
125*4882a593Smuzhiyun   code which sends the BIOS update request to the BIOS. So on the next reboot
126*4882a593Smuzhiyun   the BIOS knows about the new image downloaded and it updates itself.
127*4882a593Smuzhiyun   Also don't unload the rbu driver if the image has to be updated.
128*4882a593Smuzhiyun
129