From bfcda714d8724ed21bfee4e6553f4cc6025acbfc Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 9 Sep 2014 09:43:50 +0200 Subject: [PATCH] zynqmp: Do not run Linux SMP on more then 2 cpus on QEMU Limit number of cpus in the kernel running on QEMU to 2 to ensure that stalls are not reported by the kernel. ZynqMP QEMU is single-threaded and it runs the VCPUs in round-robin. It takes longer between the CPUs get to run when more VCPUs are used. Signed-off-by: Michal Simek --- board/xilinx/zynqmp/zynqmp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 293642058f4..d80457e1d7a 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -93,9 +93,14 @@ int board_mmc_init(bd_t *bd) } #endif +#ifndef CONFIG_LINUX_CMDLINE_SIZE +# define CONFIG_LINUX_CMDLINE_SIZE 120 +#endif + int board_late_init(void) { u32 reg = 0; + char args[CONFIG_LINUX_CMDLINE_SIZE]; u8 bootmode; u32 ver = zynqmp_get_silicon_version(); @@ -107,6 +112,10 @@ int board_late_init(void) break; case ZYNQMP_CSU_VERSION_QEMU: default: + strcpy(args, getenv("bootargs")); + strncat(args, " maxcpus=2", CONFIG_LINUX_CMDLINE_SIZE); + setenv("bootargs", args); + setenv("serverip", "10.0.2.2"); setenv("ipaddr", "10.0.2.15"); } -- 2.47.3