]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
zynqmp: Do not run Linux SMP on more then 2 cpus on QEMU
authorMichal Simek <michal.simek@xilinx.com>
Tue, 9 Sep 2014 07:43:50 +0000 (09:43 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 10 Sep 2014 08:15:40 +0000 (10:15 +0200)
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 <michal.simek@xilinx.com>
board/xilinx/zynqmp/zynqmp.c

index 293642058f48c61745ff2a2be209ebff1273b1bb..d80457e1d7a8a40353ac424fab57d2dea4ada658 100644 (file)
@@ -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");
        }