Hi Hongpeng,

On 01/04/2021 14:56, 曹宏鹏 wrote:
> Dear sir,
> 
> I wanted to know how to write my own config files about non-root cell. By the 
> way, I tried to alter the 
> rpi4-linux-demo.c and compiled it. Of course, it was successful in that way. 
> 
> 1. But I don't understand why there are several memory regions definitions.

Different memory regions address different aspects of the system (e.g.,
RAM, peripherals, platform devices, …).

> 2. How to know the memory addresses.

You could start by looking into your device-tree or /proc/iomem.

> 3. How many memory regions should be defined. 

Depends on the topology of your system and on what you are trying to
achieve. And it's not just all about memory regions: Keep in mind that
you also need to consider PCI devices or interrupts.

You could start by having a look into Jan's tutorial:
  https://www.youtube.com/watch?v=7fiJbwmhnRw

Hope that helps,
  Ralf

> 
> Whether should I reference the Raspberry Pi 4 model B's manual to resolve 
> three questions.
> Here is the part of rpi4-linux-demo.c about memory definitions.(I didn't why 
> there are 5 memory regions, 2 RAM definitions).
>  
> .mem_regions = {
>  /* IVSHMEM shared memory regions (demo) */
>  {
>  .phys_start = 0x3faf0000,
>  .virt_start = 0x3faf0000,
>  .size = 0x1000,
>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,
>  },
>  {
>  .phys_start = 0x3faf1000,
>  .virt_start = 0x3faf1000,
>  .size = 0x9000,
>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
>  JAILHOUSE_MEM_ROOTSHARED,
>  },
>  {
>  .phys_start = 0x3fafa000,
>  .virt_start = 0x3fafa000,
>  .size = 0x2000,
>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,
>  },
>  {
>  .phys_start = 0x3fafc000,
>  .virt_start = 0x3fafc000,
>  .size = 0x2000,
>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,
>  },
>  {
>  .phys_start = 0x3fafe000,
>  .virt_start = 0x3fafe000,
>  .size = 0x2000,
>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
>  JAILHOUSE_MEM_ROOTSHARED,
>  },
>  /* IVSHMEM shared memory region */
>  JAILHOUSE_SHMEM_NET_REGIONS(0x3fb00000, 1),
>  /* UART */ {
>  .phys_start = 0xfe215040,
>  .virt_start = 0xfe215040,
>  .size = 0x40,
>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
>  JAILHOUSE_MEM_IO | JAILHOUSE_MEM_IO_8 |
>  JAILHOUSE_MEM_IO_32 | JAILHOUSE_MEM_ROOTSHARED,
>  },
>  /* RAM */ {
>  .phys_start = 0x3f900000,
>  .virt_start = 0,
>  .size = 0x10000,
>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
>  JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
>  },
>  /* RAM */ {
>  .phys_start = 0x30000000,
>  .virt_start = 0x30000000,
>  .size = 0x8000000,
>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
>  JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
>  JAILHOUSE_MEM_LOADABLE,
>  },
>  /* communication region */ {
>  .virt_start = 0x80000000,
>  .size = 0x00001000,
>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
>  JAILHOUSE_MEM_COMM_REGION,
>  },
>  }
> 
> By the way, what information should I obtained so that I can  write my own 
> cell config.
> If I can get your generous help, I will appreciate.
> Thank you again !
> 
> Yours sincerely,
> Hongpeng Cao.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/c8d5c803-7d1d-b0fa-d11a-4ad3826e7f4a%40oth-regensburg.de.

Reply via email to