Controlling mmcblk0 Devices in Xen on S32G274ARDB2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Controlling mmcblk0 Devices in Xen on S32G274ARDB2

Jump to solution
488 Views
hulk101
Contributor III

Hi,

I am working with the S32G274ARDB2 image, where I have enabled Xen hypervisor support as per the guidelines in the Linux BSP 38.0 User Manual. After building the image, I observed the following output from the `lsblk` command in the Xen environment:

NAME                 MAJ:MIN   RM   SIZE     RO     TYPE     MOUNTPOINTS
mmcblk0          179:0          0    14.8G     0       disk
|-mmcblk0p1    179:1           0    64M      0       part
|-mmcblk0p2   179:2          0   980M     0       part      /
|-mmcblk0p3   179:3          0   980M     0       part
`-mmcblk0p4   179:4          0   980M     0       part

I would like to understand how to manage the number of `mmcblk0` devices (partitions) exposed to Xen. Specifically, I need guidance on the following:
 
1. How can I restrict the number of `mmcblk0` partitions visible to Xen or specific domains (e.g., Dom0 or DomU)?
2. Is it possible to add or control the number of `mmcblk0` partitions dynamically within Xen, and if so, what configurations or tools should I use?
3. Are there specific device tree settings, Xen configuration files, or U-Boot commands that I should modify to achieve this control?
 
Any references to relevant documentation, configuration examples, or steps to achieve this would be greatly appreciated. Please let me know if additional details about my setup are required.
 
Thank you for your support.
0 Kudos
Reply
1 Solution
451 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @hulk101,

Xen is not an NXP product and therefore I cannot offer you much support about it. However, here is some information that you might find useful. Dom0 has default access to all hardware resources, this includes SD/eMMC partitions (mmcblk0p1, mmcblk0p2, mmcblk0p3, ...), although it might be possible to restrict access to Dom0 I would not recommend it since Dom0 is intended to create all other domains (like Domu). DomU does not have access to all hardware resources by default, for example for partitions, you can dynamically attach them by running:

xl block-attach domu1 phy:/dev/mmcblk0p3 xvdb w

or to detach them:

xl block-detach domu1 xvdb

You can also add those commands in the configuration files of the configuration file of domu1.

Please note that the commands might change slightly depending on the partitions needed and the domain names.

This way the partition will appear in domu1 in:

/dev/xvdb

 

There are some configuration you can perform in the device tree, however for the requirements you have it does not seem that it would be the correct approach, however, please check https://wiki.xenproject.org/wiki/Device_tree.

 

Let me know if you have more questions. 

 

View solution in original post

0 Kudos
Reply
2 Replies
452 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @hulk101,

Xen is not an NXP product and therefore I cannot offer you much support about it. However, here is some information that you might find useful. Dom0 has default access to all hardware resources, this includes SD/eMMC partitions (mmcblk0p1, mmcblk0p2, mmcblk0p3, ...), although it might be possible to restrict access to Dom0 I would not recommend it since Dom0 is intended to create all other domains (like Domu). DomU does not have access to all hardware resources by default, for example for partitions, you can dynamically attach them by running:

xl block-attach domu1 phy:/dev/mmcblk0p3 xvdb w

or to detach them:

xl block-detach domu1 xvdb

You can also add those commands in the configuration files of the configuration file of domu1.

Please note that the commands might change slightly depending on the partitions needed and the domain names.

This way the partition will appear in domu1 in:

/dev/xvdb

 

There are some configuration you can perform in the device tree, however for the requirements you have it does not seem that it would be the correct approach, however, please check https://wiki.xenproject.org/wiki/Device_tree.

 

Let me know if you have more questions. 

 

0 Kudos
Reply
337 Views
alejandro_e
NXP TechSupport
NXP TechSupport

Hello @hulk101,

Were you able achieve your goal with the information I provided?

If so, please select my last reply as an accepted solution, if not, please let me know if you encounter any errors.

 

Thanks! 

0 Kudos
Reply