summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2023-10-26 18:59:10 -0600
committerMark Hatle <mark.hatle@amd.com>2023-10-26 19:34:01 -0600
commit32a7e9eab3fd3f31e5fb9c603ba3cdff6cb36965 (patch)
treec3a7c9acb228b5d32a92b7a466bcadbf78e2c483
parent6133471e563c242f7ce8f80a9601f4382ed84d37 (diff)
downloadmeta-xilinx-32a7e9eab3fd3f31e5fb9c603ba3cdff6cb36965.tar.gz
various machines: Change qemu serial port configuration for nanbield
As of Yocto Project nanbield, if a -serial is pass in QB_OPT_APPEND the runqemu may add additional null entries (padding) or simply skip further setup. Due to this, emulated platforms where the first hardware serial port is not used in Linux need specific "-serial null" settings, but with the new rules also need the real serial port defined (this can no longer be assumed.) The downside of this new approach is all consoles must be defined, so we can not rely on runqemu adding "-serial mon:<device>", as now assume the primary usage is stdio (nographic/serial port) settings. Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc10
-rw-r--r--meta-xilinx-core/conf/machine/microblaze-generic.conf9
-rw-r--r--meta-xilinx-core/conf/machine/versal-generic.conf12
-rw-r--r--meta-xilinx-core/conf/machine/versal-net-generic.conf12
-rw-r--r--meta-xilinx-core/conf/machine/zynq-generic.conf12
-rw-r--r--meta-xilinx-core/conf/machine/zynqmp-generic.conf10
-rw-r--r--meta-xilinx-vendor/conf/machine/ultra96-zynqmp.conf11
7 files changed, 65 insertions, 11 deletions
diff --git a/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc b/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc
index 1c651816..c450b542 100644
--- a/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc
+++ b/meta-xilinx-core/conf/machine/include/machine-xilinx-qemu.inc
@@ -13,3 +13,13 @@ EXTRA_IMAGEDEPENDS += "qemu-system-native qemu-helper-native:do_addto_recipe_sys
13 13
14# Use the xilinx specific version for these users 14# Use the xilinx specific version for these users
15IMAGE_CLASSES += "qemuboot-xilinx" 15IMAGE_CLASSES += "qemuboot-xilinx"
16
17# As of Yocto Project nanbield, if a -serial is pass in QB_OPT_APPEND the
18# runqemu may add additional null entries or simply skip further setup.
19#
20# To help us be able to adjust for this behavior add a special
21# QB_XILINX_SERIAL that will allow us to define serial ports for qemu
22# emulated boards that may not match the standard Linux behavior.
23#
24QB_XILINX_SERIAL ?= ""
25QB_OPT_APPEND += "${QB_XILINX_SERIAL}"
diff --git a/meta-xilinx-core/conf/machine/microblaze-generic.conf b/meta-xilinx-core/conf/machine/microblaze-generic.conf
index 5bf87344..8fb40070 100644
--- a/meta-xilinx-core/conf/machine/microblaze-generic.conf
+++ b/meta-xilinx-core/conf/machine/microblaze-generic.conf
@@ -91,9 +91,16 @@ IMAGE_FSTYPES += "cpio.gz"
91# Microblaze QEMU Configurations 91# Microblaze QEMU Configurations
92QB_MEM = "-m 2G" 92QB_MEM = "-m 2G"
93QB_KERNEL_CMDLINE_APPEND = "console=ttyUL0,115200 root=/dev/ram0 rw" 93QB_KERNEL_CMDLINE_APPEND = "console=ttyUL0,115200 root=/dev/ram0 rw"
94QB_OPT_APPEND = ""
95QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@" 94QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@"
96 95
96# This will work with the default runqemu, as the first serial port is the
97# correct console
98#
99# One total serial port defined in this model (according to the generated dts)
100#
101# hw serial0 axi_uartlite_0 (40600000) - linux serial0 (ttyUL0)
102QB_XILINX_SERIAL = ""
103
97#### No additional settings should be after the Postamble 104#### No additional settings should be after the Postamble
98#### Postamble 105#### Postamble
99PACKAGE_EXTRA_ARCHS:append = "${@['', ' ${MB_MACHINE_ARCH}']['microblaze-generic' != "${MACHINE}"]}" 106PACKAGE_EXTRA_ARCHS:append = "${@['', ' ${MB_MACHINE_ARCH}']['microblaze-generic' != "${MACHINE}"]}"
diff --git a/meta-xilinx-core/conf/machine/versal-generic.conf b/meta-xilinx-core/conf/machine/versal-generic.conf
index 9fab8875..5ee09599 100644
--- a/meta-xilinx-core/conf/machine/versal-generic.conf
+++ b/meta-xilinx-core/conf/machine/versal-generic.conf
@@ -89,9 +89,17 @@ QEMU_HW_DTB_PMC = "${QEMU_HW_DTB_PATH}/board-versal-pmc-vc-p-a2197-00.dtb"
89QEMU_HW_DTB_PS_vp1202-versal = "${QEMU_HW_DTB_PATH}/board-versal-vp1202-ps-virt.dtb" 89QEMU_HW_DTB_PS_vp1202-versal = "${QEMU_HW_DTB_PATH}/board-versal-vp1202-ps-virt.dtb"
90QEMU_HW_DTB_PMC_vp1202-versal = "${QEMU_HW_DTB_PATH}/board-versal-vp1202-pmc-virt.dtb" 90QEMU_HW_DTB_PMC_vp1202-versal = "${QEMU_HW_DTB_PATH}/board-versal-vp1202-pmc-virt.dtb"
91 91
92QB_OPT_APPEND = " \ 92# Four total serial ports defined in this model (according to the dts)
93#
94# hw serial0 xps-uartlite (f0110000) -
95# hw serial1 ddrmc/xps-uartlite (f0310000) -
96# hw serial2 pl011 (ff000000) - linux serial0 (ttyAMA0)
97# hw serial3 pl011 (ff010000) - linux serial1 (ttyAMA1) (disabled)
98# ? dcc ? - linux serial2 (????)
99QB_XILINX_SERIAL = "-serial null -serial null -serial mon:stdio -serial null"
100
101QB_OPT_APPEND += " \
93 -hw-dtb ${QEMU_HW_DTB_PS} \ 102 -hw-dtb ${QEMU_HW_DTB_PS} \
94 -serial null -serial null \
95 ${@qemu_add_extra_args(d)} \ 103 ${@qemu_add_extra_args(d)} \
96 " 104 "
97 105
diff --git a/meta-xilinx-core/conf/machine/versal-net-generic.conf b/meta-xilinx-core/conf/machine/versal-net-generic.conf
index e1f222e2..9945d301 100644
--- a/meta-xilinx-core/conf/machine/versal-net-generic.conf
+++ b/meta-xilinx-core/conf/machine/versal-net-generic.conf
@@ -19,6 +19,10 @@ YAML_DT_BOARD_FLAGS ?= "{BOARD versal-net-ipp-rev1.9}"
19YAML_SERIAL_CONSOLE_STDIN:pn-plm-firmware ?= "psx_wizard_0_psxl_0_psx_sbsauart_0" 19YAML_SERIAL_CONSOLE_STDIN:pn-plm-firmware ?= "psx_wizard_0_psxl_0_psx_sbsauart_0"
20YAML_SERIAL_CONSOLE_STDOUT:pn-plm-firmware ?= "psx_wizard_0_psxl_0_psx_sbsauart_0" 20YAML_SERIAL_CONSOLE_STDOUT:pn-plm-firmware ?= "psx_wizard_0_psxl_0_psx_sbsauart_0"
21 21
22# Versal Serial Console
23SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;ttyAMA1"
24YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200"
25
22require conf/machine/versal-generic.conf 26require conf/machine/versal-generic.conf
23 27
24SOC_VARIANT = "net" 28SOC_VARIANT = "net"
@@ -31,6 +35,14 @@ HDF_MACHINE = "versal-net-generic"
31QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/board-versal-net-psx-spp-1.4.dtb" 35QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/board-versal-net-psx-spp-1.4.dtb"
32QEMU_HW_DTB_PMC = "${QEMU_HW_DTB_PATH}/board-versal-pmx-virt.dtb" 36QEMU_HW_DTB_PMC = "${QEMU_HW_DTB_PATH}/board-versal-pmx-virt.dtb"
33 37
38# Four total serial ports defined in this model (according to the dts)
39#
40# hw serial0 xps-uartlite (0xf0110000) -
41# hw serial1 xps-uartlite (0xf0310000) -
42# hw serial2 pl011 (0xf1920000) - linux serial0 (ttyAMA0)
43# hw serial3 pl011 (0xf1930000) - linux serial1 (ttyAMA1)
44QB_XILINX_SERIAL = "-serial null -serial null -serial mon:stdio -serial null"
45
34#### No additional settings should be after the Postamble 46#### No additional settings should be after the Postamble
35#### Postamble 47#### Postamble
36PACKAGE_EXTRA_ARCHS:append = "${@['', ' versal_net_generic']['versal-net-generic' != "${MACHINE}"]}" 48PACKAGE_EXTRA_ARCHS:append = "${@['', ' versal_net_generic']['versal-net-generic' != "${MACHINE}"]}"
diff --git a/meta-xilinx-core/conf/machine/zynq-generic.conf b/meta-xilinx-core/conf/machine/zynq-generic.conf
index 673dad68..3dea2012 100644
--- a/meta-xilinx-core/conf/machine/zynq-generic.conf
+++ b/meta-xilinx-core/conf/machine/zynq-generic.conf
@@ -75,9 +75,17 @@ QB_NETWORK_DEVICE = "-net nic,netdev=net0,macaddr=@MAC@"
75 75
76QB_KERNEL_ROOT = "/dev/mmcblk0p2" 76QB_KERNEL_ROOT = "/dev/mmcblk0p2"
77 77
78# Side effect of not-enabled serial port is we have to lock
79# the second (console) to mon:stdio.
80#
81# Two total serial ports defined in this model (according to the generated dts)
82#
83# hw uart0 xuartps (e0000000) -
84# hw uart1 xuartps (e0001000) - linux serial0 (ttyPS0)
85QB_XILINX_SERIAL = "-serial null -serial mon:stdio"
86
78# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) 87# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW)
79QB_OPT_APPEND = " \ 88QB_OPT_APPEND += " \
80 -serial null \
81 -device loader,addr=0xf8000008,data=0xDF0D,data-len=4 \ 89 -device loader,addr=0xf8000008,data=0xDF0D,data-len=4 \
82 -device loader,addr=0xf8000140,data=0x00500801,data-len=4 \ 90 -device loader,addr=0xf8000140,data=0x00500801,data-len=4 \
83 -device loader,addr=0xf800012c,data=0x1ed044d,data-len=4 \ 91 -device loader,addr=0xf800012c,data=0x1ed044d,data-len=4 \
diff --git a/meta-xilinx-core/conf/machine/zynqmp-generic.conf b/meta-xilinx-core/conf/machine/zynqmp-generic.conf
index b1365e5f..40ad6006 100644
--- a/meta-xilinx-core/conf/machine/zynqmp-generic.conf
+++ b/meta-xilinx-core/conf/machine/zynqmp-generic.conf
@@ -43,7 +43,7 @@ UBOOT_ENTRYPOINT ?= "0x200000"
43UBOOT_LOADADDRESS ?= "0x200000" 43UBOOT_LOADADDRESS ?= "0x200000"
44 44
45# ZynqMP Serial Console 45# ZynqMP Serial Console
46SERIAL_CONSOLES ?= "115200;ttyPS0" 46SERIAL_CONSOLES ?= "115200;ttyPS0 115200;ttyPS1"
47YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200" 47YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200"
48 48
49require conf/machine/include/soc-zynqmp.inc 49require conf/machine/include/soc-zynqmp.inc
@@ -99,6 +99,12 @@ QEMU_HW_DTB_PATH = "${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch"
99QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/zcu102-arm.dtb" 99QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/zcu102-arm.dtb"
100QEMU_HW_DTB_PMU = "${QEMU_HW_DTB_PATH}/zynqmp-pmu.dtb" 100QEMU_HW_DTB_PMU = "${QEMU_HW_DTB_PATH}/zynqmp-pmu.dtb"
101 101
102# Two total serial ports defined in this model (according to the dts)
103#
104# hw ps7_uart_0 (0xFF000000) - linux serial1 (ttyPS1)
105# hw ps7_uart_1 (0xFF010000) - linux serial0 (ttyPS0)
106QB_XILINX_SERIAL = "-serial mon:stdio -serial null"
107
102# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) 108# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW)
103# 109#
104# In an actual device the FSBL will run first, load ATF and setup the 110# In an actual device the FSBL will run first, load ATF and setup the
@@ -124,7 +130,7 @@ QEMU_HW_DTB_PMU = "${QEMU_HW_DTB_PATH}/zynqmp-pmu.dtb"
124# 00000000fffc0000: 0x584e4c58 0x00000001 0x08000000 0x00000000 130# 00000000fffc0000: 0x584e4c58 0x00000001 0x08000000 0x00000000
125# 00000000fffc0010: 0x00000010 0x00000000 131# 00000000fffc0010: 0x00000010 0x00000000
126# 132#
127QB_OPT_APPEND = " \ 133QB_OPT_APPEND += " \
128 -hw-dtb ${QEMU_HW_DTB_PS} \ 134 -hw-dtb ${QEMU_HW_DTB_PS} \
129 ${@qemu_zynqmp_unhalt(d, True)} \ 135 ${@qemu_zynqmp_unhalt(d, True)} \
130 -device loader,addr=0xfffc0000,data=0x584c4e5801000000,data-be=true,data-len=8 \ 136 -device loader,addr=0xfffc0000,data=0x584c4e5801000000,data-be=true,data-len=8 \
diff --git a/meta-xilinx-vendor/conf/machine/ultra96-zynqmp.conf b/meta-xilinx-vendor/conf/machine/ultra96-zynqmp.conf
index daa73f2a..d0b95cac 100644
--- a/meta-xilinx-vendor/conf/machine/ultra96-zynqmp.conf
+++ b/meta-xilinx-vendor/conf/machine/ultra96-zynqmp.conf
@@ -34,7 +34,7 @@ UBOOT_LOADADDRESS ?= "0x200000"
34# ultra96-zynqmp Serial Console 34# ultra96-zynqmp Serial Console
35# In Ultra96 uart1 is the primary uart device but DTG set the serial0 alias 35# In Ultra96 uart1 is the primary uart device but DTG set the serial0 alias
36# to uart1, hence we are using ttyPS0 for Ultra96. 36# to uart1, hence we are using ttyPS0 for Ultra96.
37SERIAL_CONSOLES ?= "115200;ttyPS0" 37SERIAL_CONSOLES ?= "115200;ttyPS1 115200;ttyPS0"
38YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200" 38YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200"
39 39
40# Required generic machine inclusion 40# Required generic machine inclusion
@@ -58,9 +58,12 @@ QB_MEM = "-m 2G"
58# Ultra96 board uses ultra96-arm.dtb as QEMU HW PS DTB. 58# Ultra96 board uses ultra96-arm.dtb as QEMU HW PS DTB.
59QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/ultra96-arm.dtb" 59QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/ultra96-arm.dtb"
60 60
61# runqemu assumes psu_uart_0 is used but in Ultra96 psu_uart_1 is the primary 61# Both psu_uart_0 and psu_uart_1 are defined, but 1 is the primary uart.
62# uart device, So set psu_uart_0 as null. 62#
63QB_OPT_APPEND += " -serial null" 63# hw ps7_uart_0 (0xFF000000) - linux serial1 (ttyPS1)
64# hw ps7_uart_1 (0xFF010000) - linux serial0 (ttyPS0)
65# ? dcc / axi_uart16550_0 ? - linux serial2
66QB_XILINX_SERIAL = "-serial null -serial mon:stdio"
64 67
65# KERNEL_DEVICETREE is disabled as we use board device tree from DTG to match 68# KERNEL_DEVICETREE is disabled as we use board device tree from DTG to match
66# the xsa. User can enable explicitly if required from local.conf. 69# the xsa. User can enable explicitly if required from local.conf.