Skip to content

Commit

Permalink
Simplify guest hash defines in simple example VMM
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-Velickovic committed Jul 10, 2023
1 parent cfc52cd commit 46704f2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions examples/simple/vmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,35 @@
// Part of the problem is that we might need multiple DTBs for the same example
// e.g one DTB for VMM one, one DTB for VMM two. we should be able to hide all
// of this in the build system to avoid doing any run-time DTB stuff.

/*
* As this is just an example, for simplicity we just make the size of the
* guest's "RAM" the same for all platforms. For just booting Linux with a
* simple user-space, 0x10000000 bytes (256MB) is plenty.
*/
#define GUEST_RAM_SIZE 0x10000000

#if defined(BOARD_qemu_arm_virt_hyp)
#define GUEST_DTB_VADDR 0x4f000000
#define GUEST_INIT_RAM_DISK_VADDR 0x4d700000
#define GUEST_RAM_SIZE 0x10000000
#elif defined(BOARD_rpi4b_hyp)
#define GUEST_DTB_VADDR 0x2e000000
#define GUEST_INIT_RAM_DISK_VADDR 0x2d700000
#define GUEST_RAM_SIZE 0x10000000
#elif defined(BOARD_odroidc2_hyp)
#define GUEST_DTB_VADDR 0x2f000000
#define GUEST_INIT_RAM_DISK_VADDR 0x2d700000
#define GUEST_RAM_SIZE 0x10000000
#elif defined(BOARD_odroidc4_hyp)
#define GUEST_DTB_VADDR 0x2f000000
#define GUEST_INIT_RAM_DISK_VADDR 0x2d700000
#define GUEST_RAM_SIZE 0x10000000
#elif defined(BOARD_imx8mm_evk_hyp)
#define GUEST_DTB_VADDR 0x4f000000
#define GUEST_INIT_RAM_DISK_VADDR 0x4d700000
#define GUEST_RAM_SIZE 0x10000000
#else
#error Need to define VM image address and DTB address
#endif

/* For simplicity we just enforce the serial IRQ channel to be the same across platforms. */
/* For simplicity we just enforce the serial IRQ channel number to be the same
* across platforms. */
#define SERIAL_IRQ_CH 1

#if defined(BOARD_qemu_arm_virt_hyp)
Expand Down

0 comments on commit 46704f2

Please sign in to comment.