From patchwork Thu Feb 21 18:57:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 158938 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp841883jaa; Thu, 21 Feb 2019 11:07:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IaZ/Ma0U+E9Z5cGMU24WMIHP71bOYudpFj/kYiNoCux94HUFAnuypLrDEEk0d7wexWy0DnT X-Received: by 2002:a81:24c2:: with SMTP id k185mr25830ywk.179.1550776040770; Thu, 21 Feb 2019 11:07:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550776040; cv=none; d=google.com; s=arc-20160816; b=nvf7+6mhV6sxvSCQQsAGPgMrQA4lSRFsFyR6a5U3sX5yZoVmK8he67zbNz4qnE9xmV Iy/QzXsVY4UantQAkCDmrvSHZShxo/o/9Br5g21PsXzFoQbc+qAOEu7gpfuCozKUzc6I yifBS7KlEycRmMnoIcMiLPAMKaOf/M+jIIh8U1rCslNt78HsahDURwfeXXDv+b5JaGOx fCQdP9HyOVgHJMhB4YQY52tN30ncMoPFam4oKPCqR65EGf6CuoR1cotEFcEylJEqWOV3 BaxXyCepygzGC6HMQuAWjzCqipUvwh+EgDnRTeaZwUpdCbc4TZzfQOgJcn7yzwgdNQZG Bp8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=6DwAcLSaFzva9ACId1E/asTJ9WH92ZHxCzcEEbU6fo4=; b=uZizE5OeSEwkpTlVaNwAGaXK0TuYOnm/lv5Azikk59DRJS8wYYIVA7LGc3NC97fLJf BSG83D0PkY3w5fcwTspfxhJ1VJ3ymePEr5oKwTBwcSiiuplPctLooVLDVEG97+sE1MlO p/KwWgTuW+BFQ0BeCVwVYqw/dC8N860fvfS0c3woz+0uPluPaiS/WpzoVhWfeDQ3hRAm MILVGCHNzAA09XUWg+3FbCKsPuMs3HHZX6e+UhZS4XNX+OHX6rkx0f39Mo2akKGN3AcK 17QqIDAVhZDtFN/YKWfugoDCseH9TxeYGejzqFP4Kg8JGiEU51h4QZ0JvMftCSnr6JYh iT+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="mm/hNaYr"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k2si10579149ywb.253.2019.02.21.11.07.20 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 21 Feb 2019 11:07:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="mm/hNaYr"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:37002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwtgl-0000Cq-O9 for patch@linaro.org; Thu, 21 Feb 2019 14:07:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwtXr-0008Uv-HS for qemu-devel@nongnu.org; Thu, 21 Feb 2019 13:58:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwtXp-0007Sr-9a for qemu-devel@nongnu.org; Thu, 21 Feb 2019 13:58:07 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:41451) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gwtXo-0007Pv-SM for qemu-devel@nongnu.org; Thu, 21 Feb 2019 13:58:05 -0500 Received: by mail-wr1-x434.google.com with SMTP id n2so19644307wrw.8 for ; Thu, 21 Feb 2019 10:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=6DwAcLSaFzva9ACId1E/asTJ9WH92ZHxCzcEEbU6fo4=; b=mm/hNaYrCApiTTvGc/kB88zs47nh2Ucoti5Wiik2fxY2Y/a//0Rs4dYQO14uVz6e1d lgkQ5NjavUy0azuEXXuqcFRJqVkjqpx+gNL+hFDMdwHh4x7wuaDPtLd5r3/eo8/JJu2L EHybT8DyECfGEts9RX6fuvQeL8fSQxdh9owxPmO5hxmihZXDvO1yOhn8fUcBKYGfEcCC DKEhl1lebBuubEvtbye7TBEZ7pgTZyUFhVOHzy/w2vhAB0knnw4lHwaNuIJUMSj3U75L 5zk/1TOsU9hl6DxHr+TLp/Metcqg7b+N+GrDbQaI87m6cgQsqq2NJLlm29QNduAfR0tR V7oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6DwAcLSaFzva9ACId1E/asTJ9WH92ZHxCzcEEbU6fo4=; b=qZt8oFJS34YNiQWUBrxOZwbR9c7aQT6YshsXR25GODPaBpsOTSNcHKReiHNh87G4nw X+iGQSzdmKWprzLZMnK0KwUmQ+vH45vnZTWvgaQnBAxgPXwQQRmmf5PPCA4J48QsrwQE 2nUgnV28OZ1WIgX1eY86SsxvNO0G5IB4ETx3DqByxpstYJKoTb6gKxU2whJKj22IpcVb +yRGP/0y+BroxqbVRo0R4l/sNhaB4y/oMCMla+h+t362KrE1Xuho/j0f47ner6uTIydh LMeod3LzAQEgGC90gnMu1iiQLNKYVdlV3gi4XUEioORxmFl+o9G2jR0NUduXQprG6at/ zk+g== X-Gm-Message-State: AHQUAuYyL2WaXZV+jtRFQNE9QpLTaxxXDCQ2Ut3hxmCzMy4npKBdoMI/ K6l20rX7IRz0nCNLnJqxVAfmJUOFGGk= X-Received: by 2002:adf:fc12:: with SMTP id i18mr28307069wrr.201.1550775481089; Thu, 21 Feb 2019 10:58:01 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id c18sm29065085wre.32.2019.02.21.10.57.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 10:58:00 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 21 Feb 2019 18:57:33 +0000 Message-Id: <20190221185739.25362-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190221185739.25362-1-peter.maydell@linaro.org> References: <20190221185739.25362-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::434 Subject: [Qemu-devel] [PULL 15/21] hw/arm/armsse: Allow boards to specify init-svtor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/arm/armsse.h | 3 +++ hw/arm/armsse.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) -- 2.20.1 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 d0207dbabc7..50da41f64c5 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 @@ -1187,6 +1186,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() };