-
Manohar Vanga authored
Signed-off-by:
Manohar Vanga <manohar.vanga@cern.ch>
8385f1b0
To learn more about this project, read the wiki.
README 2.13 KiB
Wishbone bus simulation in Linux. The project contains a wishbone bus driver, a PCI board driver (that has the wishbone bus on it) and tools for generating the required firmware (for "faking" stuff like memory maps). Included are also two fake wishbone drivers. I am currently testing this on a QEMU virtual machine (running the latest git kernel). The hard disk image has been made using debootstrap. Please send any bugs/comments/criticism/flames/free-cookies to manohar dot vanga at cern dot ch Compiling --------- You should just "make". The only external dependency is the kernel to build against. You can set it in the LINUX environment variable: export LINUX=/opt/stuff/kernels/wb-kernel-source The default is $(HOME)/linux-for-wbonesim so you can just make a symlink to the real place and forget about it. Running ------- Install the wishbone.ko module: insmod wishbone.ko Install the fake wishbone device drivers: insmod fakeadc.ko insmod fakedac.ko Install the fake Wishbone bus driver: insmod fake_wb_bus.ko You can additionally specify the device and vendor to use for loading the firmware file. The firmware file name is formatted as fakespec-VVVVVVVV-DDDD, where V is vendor and D is device. The default device and vendor have been set in the fake bus to 0xbabe, so the default firmware file is: firmware-0000babe-babe To change, use the spec_vendor and spec_device module parameters of the fake_wb_bus driver. Remember to name the firmware to load accordingly. Generating Firmware =================== To generate a Wishbone memory map, we can use the wb_cfggen tool found in the simulation/fw/ directory. To generate a firmware file (the wishbone memory space): $ ./wb_cfggen wbone.list firmware.bin The wbone.def file specifies the devices that should be attached to the Wishbone bus. The format for specifying devices can be seen in the example wbone.def file at simulation/fw/wbone.def. Installing Firmware =================== The generated firmware file should be 4KB in size. Copy the firmware file into /lib/firmware/NAME where NAME is as specified above. $ cp firmware.bin /lib/firmware/firmware-0000babe-babe