Monitor, PCI DMA and BAR

This commit is contained in:
Ciro Santilli
2017-06-23 17:58:06 +01:00
parent 366b1c1af2
commit 01032004f7
2 changed files with 10 additions and 2 deletions

View File

@@ -19,6 +19,11 @@ Grep QEMU source for the device description, and keep it open at all times!
- https://is.muni.cz/el/1433/podzim2016/PB173/um/65218991/ course given by the creator of the edu device. - https://is.muni.cz/el/1433/podzim2016/PB173/um/65218991/ course given by the creator of the edu device.
In Czech, and only describes API In Czech, and only describes API
- http://nairobi-embedded.org/linux_pci_device_driver.html - http://nairobi-embedded.org/linux_pci_device_driver.html
DMA:
- https://stackoverflow.com/questions/32592734/are-there-any-dma-driver-example-pcie-and-fpga/44716747#44716747
- https://stackoverflow.com/questions/17913679/how-to-instantiate-and-use-a-dma-driver-linux-module
*/ */
#include <asm/uaccess.h> /* put_user */ #include <asm/uaccess.h> /* put_user */
@@ -30,7 +35,9 @@ Grep QEMU source for the device description, and keep it open at all times!
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
/* Each PCI device has 6 BAR IOs (base address register) as per the PCI spec. /* https://stackoverflow.com/questions/30190050/what-is-base-address-register-bar-in-pcie/44716618#44716618
*
* Each PCI device has 6 BAR IOs (base address register) as per the PCI spec.
* *
* Each BAR corresponds to an address range that can be used to communicate with the PCI. * Each BAR corresponds to an address range that can be used to communicate with the PCI.
* *

View File

@@ -49,9 +49,9 @@ case "$arch" in
cmd="$debug_qemu ./buildroot/output/host/usr/bin/qemu-system-x86_64 \ cmd="$debug_qemu ./buildroot/output/host/usr/bin/qemu-system-x86_64 \
-M pc \ -M pc \
-append 'root=/dev/vda $extra_append' \ -append 'root=/dev/vda $extra_append' \
-device edu \
-drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \ -drive file=${images_dir}/rootfs.ext2,if=virtio,format=raw \
-kernel ${images_dir}/bzImage \ -kernel ${images_dir}/bzImage \
-monitor telnet::45454,server,nowait \
-m 128M \ -m 128M \
-net nic,model=virtio \ -net nic,model=virtio \
-net user \ -net user \
@@ -70,6 +70,7 @@ case "$arch" in
-dtb ${images_dir}/versatile-pb.dtb \ -dtb ${images_dir}/versatile-pb.dtb \
-kernel ${images_dir}/zImage \ -kernel ${images_dir}/zImage \
-m 128M \ -m 128M \
-monitor telnet::45454,server,nowait \
-net nic,model=rtl8139 \ -net nic,model=rtl8139 \
-net user \ -net user \
-serial stdio \ -serial stdio \