[phosphor-ipmi-flash]: Question about in-band update of BMC firmware
Chris Chen (TPI)
Chris.Chen3 at flex.com
Wed Jul 13 18:15:45 AEST 2022
Hi Brandon and William,
As you know, I have already built the "burn_my_bmc" on my Host (Eagle Stream with Aspeed 2600). I for now tried to use it to do the in-band update of BMC firmware, the debug messages of the "burn_my_bmc" look good and I also got "bmc-image" and "bmc.sig" file in the "/run/initramfs" and "/tmp" directory respectively via LPC data transfer mechanism on the BMC. However, one thing is strange which is the content of the "bmcimage" and "bmc.sig" file are all 0xff. I think this should not be the normal case, perhaps I made a mistake. Following are my steps/changes on the Host-side and BMC-side, could you please take a look at it, is there anything wrong? Or do you have any suggestions for enabling the feature? Thanks.
Host-side
=====
* The e820 map of the Host system (just choose one area randomly, should I need to reserve a specific area for this??)
####
archer at archer-ArcherCityM:mtd.all$ sudo dmesg | grep e820
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009dfff] usable
[ 0.000000] BIOS-e820: [mem 0x000000000009e000-0x000000000009efff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000000009f000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved <-- choose this area.
[ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000006d8effff] usable
[ 0.000000] BIOS-e820: [mem 0x000000006d8f0000-0x000000006f9effff] reserved
[ 0.000000] BIOS-e820: [mem 0x000000006f9f0000-0x00000000702effff] ACPI data
[ 0.000000] BIOS-e820: [mem 0x00000000702f0000-0x0000000072c2ffff] ACPI NVS
[ 0.000000] BIOS-e820: [mem 0x0000000072c30000-0x00000000777fefff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000777ff000-0x00000000777fffff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000077800000-0x000000008fffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000fe010000-0x00000000fe010fff] reserved
[ 0.000000] BIOS-e820: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
[ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000047fffffff] usable
[ 0.000000] e820: update [mem 0x624a8018-0x624b0057] usable ==> usable
[ 0.000000] e820: update [mem 0x624a8018-0x624b0057] usable ==> usable
[ 0.000022] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[ 0.000027] e820: remove [mem 0x000a0000-0x000fffff] usable
[ 0.003943] e820: update [mem 0x80000000-0xffffffff] usable ==> reserved
[ 0.017281] e820: update [mem 0x69d87000-0x69d87fff] usable ==> reserved
[ 0.017300] e820: update [mem 0x686c6000-0x686c6fff] usable ==> reserved
[ 5.045333] e820: reserve RAM buffer [mem 0x0009e000-0x0009ffff]
[ 5.045336] e820: reserve RAM buffer [mem 0x624a8018-0x63ffffff]
[ 5.045338] e820: reserve RAM buffer [mem 0x686c6000-0x6bffffff]
[ 5.045340] e820: reserve RAM buffer [mem 0x69d87000-0x6bffffff]
[ 5.045341] e820: reserve RAM buffer [mem 0x6d8f0000-0x6fffffff]
[ 5.045342] e820: reserve RAM buffer [mem 0x77800000-0x77ffffff]
[ 33.565052] systemd[1]: Mounting Mount unit for e820-bios, revision 9...
[ 33.702641] systemd[1]: Mounted Mount unit for e820-bios, revision 9.
####
* The executed command and its result.
####
archer at archer-ArcherCityM:mtd.all$ time sudo burn_my_bmc \
--command update \
--interface ipmilpc
--image ./image-bmc \
--sig ./image-bmc.sig \
--type image \
--address 0x000a0000 \
--length 0x10000
Sending over the firmware image.
sending writeMeta
writemeta sent
Progress: 100.00%
Sending over the hash file.
sending writeMeta
writemeta sent
Progress: 100.00%
Opening the verification file
Committing to /flash/verify to trigger service
Calling stat on /flash/verify session to check status
success
succeeded
Opening the update file
Committing to /flash/update to trigger service
Calling stat on /flash/update session to check status
success
succeeded
real 0m17.616s
user 0m0.046s
sys 0m0.147s
####
=====
BMC-side
=====
* Code changes
* Add to install "phosphor-ipmi-flash" and "phosphor-ipmi-blobs" these two packages in packagegroup recipe.
####
SUMMARY:${PN}-system = "Flex Ltd System"
RDEPENDS:${PN}-system = " \
phosphor-ipmi-blobs \
phosphor-ipmi-flash \
"
####
* Add "phosphor-impi-flash_%.bbapend" recipe with these lines(Bold).
####
SRCREV = "c277935e6fe0cdcf8aefc45b53d11bd6ca20f964"
PACKAGECONFIG:append = " static-bmc"
PACKAGECONFIG:append = " aspeed-lpc"
PACKAGECONFIG:append = " reboot-update"
IPMI_FLASH_BMC_ADDRESS = "0x98000000"
####
* Remove ",-Dupdate-type=none" in the phosphor-ipmi-flash_git.bb recipe as below, because the "Enabled Firmware Update Features" and "config-static-bmc-reboot.json" are not be included. This seems the "update-type" would always pass "none" to "phosphor-impi-flash" package without this change, but I'm not sure??
####
PACKAGECONFIG[static-bmc] = "-Dupdate-type=static-layout"
####
* Add these lines(Bold). in Kernel dts file
####
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
video_engine_memory: video {
size = <0x04000000>;
alignment = <0x01000000>;
compatible = "shared-dma-pool";
reusable;
};
/* LPC FW cycle bridge region requires natural alignment */
flash_memory: region at 98000000 {
no-map;
reg = <0x98000000 0x04000000>; /* 64M */
};
};
&lpc_ctrl {
status = "okay";
memory-region = <&flash_memory>;
};
####
* BMC console
* Manually modify "config-static-bmc-reboot.json" to skip "preparation", "verification", and "update" actions because I want to make sure image file transfer is okay first.
####
root at hudsonbay-obmc:~# cat /usr/share/phosphor-ipmi-flash/config-static-bmc-reboot.json
[{
"blob": "/flash/image",
"handler": {
"type": "file",
"path": "/run/initramfs/bmc-image"
},
"actions": {
"preparation": {
"type": "skip"
},
"verification": {
"type": "skip"
},
"update": {
"type": "skip"
}
}
}]
####
* Create "/run/initramfs" directory manually.
####
root at hudsonbay-obmc:~# mkdir /run/initramfs
####
* Result after executing burn_my_bmc command. (the content of bmc-image and bmc.sig are all 0xff)
####
root at hudsonbay-obmc:~# ls -al /run/initramfs/bmc-image
-rw-r--r-- 1 root root 67108864 Jan 1 01:47 /run/initramfs/bmc-image
root at hudsonbay-obmc:~# hexdump -C /run/initramfs/bmc-image
00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
04000000
root at hudsonbay-obmc:~# ls -al /tmp/bmc.sig
-rw-r--r-- 1 root root 128 Jan 1 01:47 /tmp/bmc.sig
root at hudsonbay-obmc:~# hexdump -C /tmp/bmc.sig
00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000080
####
=====
Regards,
Chris Chen
Legal Disclaimer :
The information contained in this message may be privileged and confidential.
It is intended to be read only by the individual or entity to whom it is addressed
or by their designee. If the reader of this message is not the intended recipient,
you are on notice that any distribution of this message, in any form,
is strictly prohibited. If you have received this message in error,
please immediately notify the sender and delete or destroy any copy of this message!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20220713/5821b119/attachment-0001.htm>
More information about the openbmc
mailing list