From patchwork Thu Feb 14 12:51:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 158374 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1325866jaa; Thu, 14 Feb 2019 04:51:20 -0800 (PST) X-Received: by 2002:a5d:6846:: with SMTP id o6mr2729451wrw.160.1550148680146; Thu, 14 Feb 2019 04:51:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550148680; cv=none; d=google.com; s=arc-20160816; b=KZ36TcoAa0HIOxWRncKLOJEHZSTGzrr1TAg9L2AIOmcpS0FXF3vnn9G+mkKbtHCd9B O7ax9OV7XPUtyyqyllCXoKB1ZuNKOZsiqnDaPXs5X4kxP4Fjkytco4UEam2O4rKBSkaF 7OIAAD4cIyhxpSH8yjSDu0+1qyfEPJI1ZEJcW65uzQKiEAQlArXYrqKGlAGmt7rrMrS2 739ZC1siXqV6B4kZ9RmuSoXm4zLRtA3tRXOJyaOFEnwNNrKguckAdrR7NSZLcKx4+T5X TG3hl3e7i3j00e4i4VFKooUzb6BUyJzX5cO1dRXV9DufWNaSGgOYqlvZKXIHK/g0dN2r nmhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=i7iefvAvCVRA+KRHNYGYL+qeYUkXaEz5YcRL7tedKZY=; b=GG7hAzGPFRiYsKYANRAevqpWT6lGXxFIC4k8ECiTfej3LFLiQf5UwZSJe70/vA5muf GSRW7lU3elzs79sQTT7BBszWp9E2MR87lQYCYPqyqtuPgXR/rJkKYi14k7lynY9lJbV9 U+H+/qt/O48RYEpGzHsZMq5PByANtW79K7xpEyZLC30CUIkif9wY4thhKitXbnVbpxgC 4PyR9E4bz7dJUM/SHqXazR/ZzGe8jtD97KFgws5bkqLhPpvciyNypLxIfA2U+PJMA8lZ SSRqjG5H+NItq1DNw7OWytGBwisTTElLiW3jUPksIRJ7HhxlFlvOEYzhRnqLslgJMHtv 8CdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RJDEqj7j; spf=pass (google.com: domain of peter.maydell@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.maydell@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id p2sor1486959wmh.18.2019.02.14.04.51.20 for (Google Transport Security); Thu, 14 Feb 2019 04:51:20 -0800 (PST) Received-SPF: pass (google.com: domain of peter.maydell@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RJDEqj7j; spf=pass (google.com: domain of peter.maydell@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.maydell@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i7iefvAvCVRA+KRHNYGYL+qeYUkXaEz5YcRL7tedKZY=; b=RJDEqj7j8XWkG/cMdBPF8DDTmFYF71f6ppHBCIj8blVUT3Id1IvQ9u21UvtfDavnRg Gt8RKUIkzBjMxfRVL3K7MT9sdlzsytUnYN5mXm3fHFCIBCyNw4+B5TKgsuPQDu5qPeca nOukU8K7yVbm7GlLheLXUaS5fuJRlYBWvOGrasCGPOQHUqSq23v6svgWnLe8x0gjORMl tsMRyku9uF89kg4ZBgAfv5kcLJITnnZ1VNuvXiNL4Cf6ukzZOzrB0nHR4dNsrIpfPbwE oFoaCPgJypi3mGrCb2CDJ/0IjYo5ziaNHrhqdpHxFfWney7mkk7pLNB1wPbzwmLXtuHa +kAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i7iefvAvCVRA+KRHNYGYL+qeYUkXaEz5YcRL7tedKZY=; b=gcN2Jr1/z/Guf7H4aTN4pKps1zvJxmLTXVrsoQIkru8nW3OZPjsI5jqOYHZbj5safY UP/A2I2abnzWVJgSkK2mf4bgIxHYDnvcNrhHDxkPuhHUyqwCaOOHcWLukugQ6tAnp3rN 5mt2wSUSxWnd8AkPOgLNHxvj4l82M1FSjlGlM53I22nWiUiyYMYn4C6F+Fv1iHiI/YT/ bL3+/SmwpxovXbdNJa6eTDaKM6f0b3qZ57ZSrSxP135p+3CfNK1E1CPkaEHmD1ew+xnF vVri2UYkCUvgRnOBhe9cUCylox/2nzdSUyZS04lHCaoGdXi/cqEQEVjbseuPc+eWM5xD p7dA== X-Gm-Message-State: AHQUAuYdkDh9lKWxDY/7wmUZCBKZlOCVYi0Kg6dYY62CuJL3ZBAg6VfL +9n53IBmWnCv8xsPDW00k/CQZwTDDL2aFUJS X-Google-Smtp-Source: AHgI3IZ+FGrL2VXmlrVdLteBjBJACF4FOWCTEhLe9soyNqkqbHIniMGCTrJvQ633Z92GgMcYDmI2rQ== X-Received: by 2002:a1c:c40c:: with SMTP id u12mr2530542wmf.11.1550148679746; Thu, 14 Feb 2019 04:51:19 -0800 (PST) Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j3sm1488073wmb.39.2019.02.14.04.51.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 04:51:19 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 09/14] hw/arm/armsse: Allow boards to specify init-svtor Date: Thu, 14 Feb 2019 12:51:02 +0000 Message-Id: <20190214125107.22178-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190214125107.22178-1-peter.maydell@linaro.org> References: <20190214125107.22178-1-peter.maydell@linaro.org> MIME-Version: 1.0 The Musca boards have DAPLink firmware that sets the initial secure VTOR value (the location of the vector table) differently depending on the boot mode (from flash, from RAM, etc). Export the init-svtor as a QOM property of the ARMSSE object so that the board can change it. Signed-off-by: Peter Maydell --- include/hw/arm/armsse.h | 3 +++ hw/arm/armsse.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h index 444605b44dc..84879f40dd8 100644 --- a/include/hw/arm/armsse.h +++ b/include/hw/arm/armsse.h @@ -48,6 +48,8 @@ * if necessary.) * + QOM property "SRAM_ADDR_WIDTH" sets the number of bits used for the * address of each SRAM bank (and thus the total amount of internal SRAM) + * + QOM property "init-svtor" sets the initial value of the CPU SVTOR register + * (where it expects to load the PC and SP from the vector table on reset) * + Named GPIO inputs "EXP_IRQ" 0..n are the expansion interrupts for CPU 0, * which are wired to its NVIC lines 32 .. n+32 * + Named GPIO inputs "EXP_CPU1_IRQ" 0..n are the expansion interrupts for @@ -204,6 +206,7 @@ typedef struct ARMSSE { uint32_t exp_numirq; uint32_t mainclk_frq; uint32_t sram_addr_width; + uint32_t init_svtor; } ARMSSE; typedef struct ARMSSEInfo ARMSSEInfo; diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c index 9a8c49547db..3040ea9324e 100644 --- a/hw/arm/armsse.c +++ b/hw/arm/armsse.c @@ -505,11 +505,10 @@ static void armsse_realize(DeviceState *dev, Error **errp) * the INITSVTOR* registers before powering up the CPUs in any case, * so the hardware's default value doesn't matter. QEMU doesn't emulate * the control processor, so instead we behave in the way that the - * firmware does. All boards currently known about have firmware that - * sets the INITSVTOR0 and INITSVTOR1 registers to 0x10000000, like the - * IoTKit default. We can make this more configurable if necessary. + * firmware does. The initial value is configurable by the board code + * to match whatever its firmware does. */ - qdev_prop_set_uint32(cpudev, "init-svtor", 0x10000000); + qdev_prop_set_uint32(cpudev, "init-svtor", s->init_svtor); /* * Start all CPUs except CPU0 powered down. In real hardware it is * a configurable property of the SSE-200 which CPUs start powered up @@ -1185,6 +1184,7 @@ static Property armsse_properties[] = { DEFINE_PROP_UINT32("EXP_NUMIRQ", ARMSSE, exp_numirq, 64), DEFINE_PROP_UINT32("MAINCLK", ARMSSE, mainclk_frq, 0), DEFINE_PROP_UINT32("SRAM_ADDR_WIDTH", ARMSSE, sram_addr_width, 15), + DEFINE_PROP_UINT32("init-svtor", ARMSSE, init_svtor, 0x10000000), DEFINE_PROP_END_OF_LIST() };