Skip to content

Commit

Permalink
virtio: upstream virtio block for odroidc4
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Chan <[email protected]>
  • Loading branch information
erichchan999 committed Oct 24, 2024
1 parent b80b2ad commit 2b94cff
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
23 changes: 17 additions & 6 deletions examples/virtio/board/odroidc4/blk_driver_vm/dts/overlays/io.dts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,24 @@
uio0 {
compatible = "generic-uio\0uio";
reg = <
0x00 0x39800000 0x00 0x1000
0x00 0x40000000 0x00 0x1000
0x00 0x40200000 0x00 0x200000
0x00 0x40400000 0x00 0x200000
0x00 0x40800000 0x00 0x200000
0x00 0x79800000 0x00 0x1000
0x00 0x80000000 0x00 0x1000
0x00 0x80200000 0x00 0x200000
0x00 0x80400000 0x00 0x200000
0x00 0x60600000 0x00 0x200000
>;
interrupts = <0x00 18 0x04>;
// IRQ = 50
};
};

/* Second UIO device for blk, just need this for the 2 extra regions */
uio1 {
compatible = "generic-uio\0uio";
reg = <
0x00 0x60800000 0x00 0x200000
0x00 0x60a00000 0x00 0x200000
>;
interrupts = <0x00 19 0x04>;
// IRQ = 51
};
};
45 changes: 25 additions & 20 deletions examples/virtio/board/odroidc4/virtio.system
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<system>
<memory_region name="client_vm_1_ram" size="0x6_000_000" page_size="0x200_000" />
<memory_region name="client_vm_2_ram" size="0x6_000_000" page_size="0x200_000" />
<memory_region name="driver_blk_vm_ram" size="0x6_000_000" page_size="0x200_000" phys_addr="0x20_000_000"/>
<memory_region name="blk_driver_vm_ram" size="0x6_000_000" page_size="0x200_000" phys_addr="0x20_000_000"/>
<memory_region name="gic_vcpu" size="0x1_000" phys_addr="0xffc06000" />
<memory_region name="uart" size="0x1000" phys_addr="0xff803000" />
<memory_region name="sd" size="0x1000" phys_addr="0xffe05000" />
Expand Down Expand Up @@ -165,20 +165,20 @@
</channel>

<!-- Block sDDF regions -->
<memory_region name="driver_blk_storage_info" size="0x1000" page_size="0x1000" />
<memory_region name="driver_blk_storage_info" size="0x1000" page_size="0x1000"/>
<memory_region name="driver_blk_req_queue" size="0x200_000" page_size="0x200_000"/>
<memory_region name="driver_blk_resp_queue" size="0x200_000" page_size="0x200_000"/>
<memory_region name="driver_blk_data" size="0x200_000" page_size="0x200_000" />
<memory_region name="driver_blk_data" size="0x200_000" page_size="0x200_000" phys_addr="0x60600000"/>

<memory_region name="client_vmm_1_blk_storage_info" size="0x1000" page_size="0x1000" />
<memory_region name="client_vmm_1_blk_req_queue" size="0x200_000" page_size="0x200_000"/>
<memory_region name="client_vmm_1_blk_resp_queue" size="0x200_000" page_size="0x200_000"/>
<memory_region name="client_vmm_1_blk_data" size="0x200_000" page_size="0x200_000" />
<memory_region name="client_vmm_1_blk_data" size="0x200_000" page_size="0x200_000" phys_addr="0x60800000"/>

<memory_region name="client_vmm_2_blk_storage_info" size="0x1000" page_size="0x1000" />
<memory_region name="client_vmm_2_blk_req_queue" size="0x200_000" page_size="0x200_000"/>
<memory_region name="client_vmm_2_blk_resp_queue" size="0x200_000" page_size="0x200_000"/>
<memory_region name="client_vmm_2_blk_data" size="0x200_000" page_size="0x200_000" />
<memory_region name="client_vmm_2_blk_data" size="0x200_000" page_size="0x200_000" phys_addr="0x60a00000"/>

<!-- UIO irq status page -->
<memory_region name="uio_irq_status" size="0x1000" page_size="0x1000" />
Expand Down Expand Up @@ -207,33 +207,38 @@
<map mr="bus3" vaddr="0xffd00000" perms="rw" cached="false" />

<!-- sDDF block -->
<map mr="driver_blk_storage_info" vaddr="0x40000000" perms="rw" cached="false" />
<map mr="driver_blk_req_queue" vaddr="0x40200000" perms="rw" cached="false" />
<map mr="driver_blk_resp_queue" vaddr="0x40400000" perms="rw" cached="false" />
<map mr="driver_blk_data" vaddr="0x40800000" perms="rw" cached="true" />
<map mr="driver_blk_storage_info" vaddr="0x80000000" perms="rw" cached="false" />
<map mr="driver_blk_req_queue" vaddr="0x80200000" perms="rw" cached="false" />
<map mr="driver_blk_resp_queue" vaddr="0x80400000" perms="rw" cached="false" />
<map mr="driver_blk_data" vaddr="0x60600000" perms="rw" cached="true" />
<map mr="client_vmm_1_blk_data" vaddr="0x60800000" perms="rw" cached="true" />
<map mr="client_vmm_2_blk_data" vaddr="0x60a00000" perms="rw" cached="true" />

<!-- UIO irq status -->
<map mr="uio_irq_status" vaddr="0x39800000" perms="rw" cached="true" />
<map mr="uio_irq_status" vaddr="0x79800000" perms="rw" cached="true" />
</virtual_machine>
<!-- SD Card -->
<irq irq="222" id="1"/>
</protection_domain>

<protection_domain name="BLK_VIRT" priority="150" budget="100" period="400">
<program_image path="blk_virt.elf" />
<map mr="driver_blk_storage_info" vaddr="0x40000000" perms="rw" cached="false" setvar_vaddr="blk_driver_storage_info" />
<map mr="driver_blk_req_queue" vaddr="0x40200000" perms="rw" cached="false" setvar_vaddr="blk_req_queue_driver" />
<map mr="driver_blk_resp_queue" vaddr="0x40400000" perms="rw" cached="false" setvar_vaddr="blk_resp_queue_driver" />
<map mr="driver_blk_data" vaddr="0x40800000" perms="rw" cached="true" setvar_vaddr="blk_data_driver" />

<map mr="client_vmm_1_blk_storage_info" vaddr="0x30000000" perms="rw" cached="false" setvar_vaddr="blk_storage_info" />
<map mr="client_vmm_2_blk_storage_info" vaddr="0x30200000" perms="rw" cached="false" />
<map mr="client_vmm_1_blk_req_queue" vaddr="0x31000000" perms="rw" cached="false" setvar_vaddr="blk_req_queue" />
<map mr="driver_blk_storage_info" vaddr="0x20000000" perms="rw" cached="false" setvar_vaddr="blk_driver_storage_info" />
<map mr="driver_blk_req_queue" vaddr="0x20200000" perms="rw" cached="false" setvar_vaddr="blk_driver_req_queue" />
<map mr="driver_blk_resp_queue" vaddr="0x20400000" perms="rw" cached="false" setvar_vaddr="blk_driver_resp_queue" />
<map mr="driver_blk_data" vaddr="0x20800000" perms="rw" cached="true" setvar_vaddr="blk_driver_data" />
<setvar symbol="blk_data_paddr_driver" region_paddr="driver_blk_data" />

<map mr="client_vmm_1_blk_storage_info" vaddr="0x30000000" perms="rw" cached="false" setvar_vaddr="blk_client_storage_info" />
<map mr="client_vmm_2_blk_storage_info" vaddr="0x30001000" perms="rw" cached="false" />
<map mr="client_vmm_1_blk_req_queue" vaddr="0x31000000" perms="rw" cached="false" setvar_vaddr="blk_client_req_queue" />
<map mr="client_vmm_2_blk_req_queue" vaddr="0x31200000" perms="rw" cached="false" />
<map mr="client_vmm_1_blk_resp_queue" vaddr="0x32000000" perms="rw" cached="false" setvar_vaddr="blk_resp_queue" />
<map mr="client_vmm_1_blk_resp_queue" vaddr="0x32000000" perms="rw" cached="false" setvar_vaddr="blk_client_resp_queue" />
<map mr="client_vmm_2_blk_resp_queue" vaddr="0x32200000" perms="rw" cached="false" />
<map mr="client_vmm_1_blk_data" vaddr="0x33000000" perms="rw" cached="true" setvar_vaddr="blk_client_data_start"/>
<map mr="client_vmm_1_blk_data" vaddr="0x33000000" perms="rw" cached="true" setvar_vaddr="blk_client_data"/>
<setvar symbol="blk_client0_data_paddr" region_paddr="client_vmm_1_blk_data" />
<map mr="client_vmm_2_blk_data" vaddr="0x33200000" perms="rw" cached="true" />
<setvar symbol="blk_client1_data_paddr" region_paddr="client_vmm_2_blk_data" />
</protection_domain>

<channel>
Expand Down

0 comments on commit 2b94cff

Please sign in to comment.