Skip to content

Commit

Permalink
dom0: add possibility to use DomU without GSX
Browse files Browse the repository at this point in the history
GSX-related configs are separated and are moved
into gsx-common.cfg.
The SOC-specific GSX options are added at compile time.

The 'gsx' MACHINE_FEATURE is required to generate proper
configuration files for domains.

Signed-off-by: Ruslan Shymkevych <[email protected]>
  • Loading branch information
rshym committed Nov 6, 2024
1 parent ad94410 commit d2017ab
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 51 deletions.
26 changes: 20 additions & 6 deletions layers/meta-xt-dom0-gen3/recipes-guests/domu/domu.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ SRC_URI += "\
file://domu-set-root-virtio.conf \
${@bb.utils.contains('DISTRO_FEATURES', 'sndbe', 'file://sndbe-backend.conf', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'displbe', 'file://displbe-backend.conf', '', d)} \
file://gsx-common.cfg \
"

python () {
if d.getVar('XT_DOMU_CONFIG_NAME'):
d.appendVar('SRC_URI', ' file://pvr-${XT_DOMU_CONFIG_NAME}')
}

FILES:${PN} += " \
${libdir}/xen/bin/domu-set-root \
${@bb.utils.contains('DISTRO_FEATURES', 'enable_virtio', \
Expand All @@ -31,6 +27,12 @@ FILES:${PN} += " \
# It is used a lot in the do_install, so variable will be handy
CFG_FILE="${D}${sysconfdir}/xen/domu.cfg"

DTDEV_H3 = 'dtdev = [\"/soc/gsx_pv0_domu\", \"/soc/gsx_pv1_domu\", \"/soc/gsx_pv2_domu\", \"/soc/gsx_pv3_domu\"]'
DTDEV_M3 = 'dtdev = [\"/soc/gsx_pv0_domu\", \"/soc/gsx_pv1_domu\"]'

EXTRA_LINE_GSX = 'extra = \"root=/dev/xvda1 rw rootwait console=hvc0 cma=256M pvrsrvkm.DriverMode=1\"'
EXTRA_LINE = 'extra = \"root=/dev/xvda1 rw rootwait console=hvc0 cma=32M\"'

do_install:append() {

if ${@bb.utils.contains('DISTRO_FEATURES', 'pvcamera', 'true', 'false', d)}; then
Expand All @@ -49,7 +51,19 @@ do_install:append() {
fi
else
cat ${WORKDIR}/domu-vdevices.cfg >> ${CFG_FILE}
cat ${WORKDIR}/pvr-${XT_DOMU_CONFIG_NAME} >> ${CFG_FILE}

if ${@bb.utils.contains('MACHINE_FEATURES', 'gsx', 'true', 'false', d)}; then
echo "\n${EXTRA_LINE_GSX}\n" >> ${CFG_FILE}
cat ${WORKDIR}/gsx-common.cfg >> ${CFG_FILE}
if ${@bb.utils.contains('XT_DOMU_CONFIG_NAME', 'domu-generic-h3-4x2g.cfg', 'true', 'false', d)}; then
echo "\n${DTDEV_H3}\n" >> ${CFG_FILE}
fi
if ${@bb.utils.contains('XT_DOMU_CONFIG_NAME', 'domu-generic-m3-2x4g.cfg', 'true', 'false', d)}; then
echo "\n${DTDEV_M3}\n" >> ${CFG_FILE}
fi
else
echo "\n${EXTRA_LINE}\n" >> ${CFG_FILE}
fi
fi

# Install domu-set-root script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# DomU virtual devices
# =====================================================================

device_tree = "/usr/lib/xen/boot/domu.dtb"

# Note1:
# In case of using virtio-disk there should be additional properties:
# "backendtype=standalone, specification=virtio"
Expand All @@ -11,21 +13,12 @@
# https://xenbits.xenproject.org/docs/4.15-testing/man/xl-disk-configuration.5.html
disk = [ 'backend=DomD, vdev=xvda1, target=/dev/STORAGE_PART3' ]

vgsx = [ 'backend=DomD, osid=1' ]

# We use predefined MAC addresses for domains:
# 08:00:27:ff:cb:cd - domF
# 08:00:27:ff:cb:ce - domA
# 08:00:27:ff:cb:cf - domU
vif = [ 'backend=DomD, bridge=xenbr0, mac=08:00:27:ff:cb:cf' ]

vdispl = [ 'backend=DomD, be-alloc=0, connectors=1000:1920x1080' ]

# multi-touch-width/height should be equal to physical touchscreen parameters when displ_be runs on top of DRM in DomD,
# but in both cases (Weston/DRM) multi-touch-num-contacts should also be set properly to match HW
vkb = [ 'backend=DomD, backend-type=linux, multi-touch-width=1920, multi-touch-height=1080, multi-touch-num-contacts=10, unique-id=T:1000, feature-disable-pointer=1, feature-disable-keyboard=1' ]

vsnd = [[ 'card, backend=DomD, buffer-size=65536, short-name=VCard, long-name=Virtual sound card, sample-rates=8000;11025;16000;22050;32000;44100;48000, sample-formats=s16_le',
'pcm, name=dev1', 'stream, unique-id=pulse, type=P'
]]

19 changes: 19 additions & 0 deletions layers/meta-xt-dom0-gen3/recipes-guests/domu/files/gsx-common.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
irqs = [
151
]

iomem = [
#gsx@fd000000
"0xfd010,1@0xfd000",
]

vgsx = [ 'backend=DomD, osid=1' ]

# 'vkb' and 'vdispl' are not GSX-related things, but we use them only for build with GSX
# that why this 'workaround' is here

vdispl = [ 'backend=DomD, be-alloc=0, connectors=1000:1920x1080' ]

# multi-touch-width/height should be equal to physical touchscreen parameters when displ_be runs on top of DRM in DomD,
# but in both cases (Weston/DRM) multi-touch-num-contacts should also be set properly to match HW
vkb = [ 'backend=DomD, backend-type=linux, multi-touch-width=1920, multi-touch-height=1080, multi-touch-num-contacts=10, unique-id=T:1000, feature-disable-pointer=1, feature-disable-keyboard=1' ]

This file was deleted.

This file was deleted.

12 changes: 12 additions & 0 deletions prod-devel-rcar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,12 @@ parameters:
XT_DOMA_KERNEL_EXTRA_MODULES: ""
XT_DOMA_SOURCE_GROUP: "default"
components:
dom0:
builder:
conf:
# this machine feature is required to select proper
# configuration for DomU
- [MACHINE_FEATURES:append, " gsx"]
domd:
builder:
conf:
Expand Down Expand Up @@ -728,6 +734,12 @@ parameters:
overrides:
# for the linux
components:
dom0:
builder:
conf:
# this machine feature is required to select proper
# configuration for DomU
- [MACHINE_FEATURES:append, " gsx"]
domd:
sources:
- *GFX_SOURCES
Expand Down

0 comments on commit d2017ab

Please sign in to comment.