This project aims to emulate a BMC system by running openBMC on qemu and controlling fan speed based on temperature.
In this section, you should mention the hardware or simulators utilized in your project.
- Qemu
- OpenBMC
in order to add sensors to a system we must
1- Add I2C sensor config to devicetree in (openbmc/build/e3c246d4i/workspace/sources/linux-aspeed/arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c246d4i.dts) &i2c7 {status = "okay"; lm75@4d {compatible = "national,lm75"; reg = <0x4d>;};};
2- Add sensor recipe to openbmc/meta-asrock/meta-e3c246d4i/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/[email protected] and bbappend file. we can get the recipe from a similar machine like romulus
3- Build the OS image(as described below).
libraries and packages requiered for openbmc
sudo apt install git python3-distutils gcc g++ make file wget \
gawk diffstat bzip2 cpio chrpath zstd lz4 bzip2
first we must clone openbmc from github
git clone https://github.com/openbmc/openbmc
cd openbmc
then we target our hardware
. setup e3c246d4i
after that we build the image
bitbake u-boot-aspeed && bitbake obmc-phosphor-image
first we must get qemu
sudo apt-get install qemu-system-arm
then we change our directory to where the openbmc image is stored
cd openbmc/build/e3c246d4i/tmp/deploy/images/e3c246d4i/
and the we run "image-bmc" with qemu
qemu-system-arm -m 256 -M ast2500-evb -nographic \
-drive file=image-bmc,format=raw,if=mtd \
-net nic \
-net user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostfwd=udp:127.0.0.1:2623-:623,hostname=qemu
after the OS is booted we enter the username and password
e3c246d4i login: root
Password: 0penBmc
in order to chech our temperature and fan controller we must check hwmon
cd /sys/class/hwmon
ls
here the first folder is our fan cotroller
which has to profiles pwm1 and pwm2 and seven fans
the second entry is the temperature sensor which always shows zero because there is no real sensor!
Some links related to your project come here.
Authors and their github link come here.